Steuerelement zur Auswahl von Dateien (Basis Tab3)

Veröffentliche deine funktionierenden Skripte und Funktionen

Moderator: jNizM

UniqueContent
Posts: 21
Joined: 10 Oct 2017, 00:57

Steuerelement zur Auswahl von Dateien (Basis Tab3)

08 Feb 2018, 06:40

Hallo Zusammen,

anbei ein Skript auf Tab 3 Basis. Dank des Forums wurde dieses aufgehübscht.
Fügt in den Pfaden eure Bilder ein.
Viel Spaß damit.

Code: Select all

SplashImage, C:\... , B CW00FFFF FS50 , Die Anwendung wird gestartet...                                         ; bei C:\... Link für Startbild eingeben
Sleep, 4000                                                                                                     ; Startscreen erscheint 4000ms
SplashImage, Off                                                                                                ;Startsequenz Ende

; Tab-Steuerelement:
Gui, Destroy																									; Vermeidung mehrerer Anwendungen
BkgImg := "C:\..."                                                                                              ; Pfad für Hintergundbild der Anwendung hier eingeben
Gui, Color, White                                                                                               ; Hintergrundfarbe Anwendung
Gui, Add, Picture, x20 y50 w1000 h65, C:\...                                                                    ; Logo für Kopf der Anwendung hier eingeben

Gui, Font, s35,																									; Schriftgröße Karten Auswahlreiter
Gui, Add, Tab3, w1300 h600 Y+50, Reiter 1|Reiter 2|Reiter 3|Reiter 4|Reiter 5                             	  	; TAB-Steuerelemente, Größe
Gui, Font, s25,																									; Schriftgröße der Buttons etc.

    Gui, Add, Button, VBtn, Button1      																	    ; Tab 1
    GuiControlGet, Btn, Pos
    Gui, Add, Button,, Button2
    Gui, Add, Button,, Button3
    Gui, Add, Button,, Button4
    Gui, Add, Button,,Button5
    Gui, Add, Pic, x%BtnX% y%BtnY% w1280 h470 +0x04000000, %BkgImg%                                             ; wichtig: das Hintergrundbild muss als letztes control mit +0x04000000 eingefügt werden


    Gui, Tab, 2,                                                                                                ; Tab 2
    Gui, Add, Button,, Button6
    Gui, Add, Pic, x%BtnX% y%BtnY% w1280 h470 +0x04000000, %BkgImg%                                             ; wichtig: das Hintergrundbild muss als letztes control mit +0x04000000 eingefügt werden


    Gui, Tab, 3																									; Tab 3
    Gui, Add, Button,, Button7
    Gui, Add, Button,, Button8
    Gui, Add, Button,, Button9
    Gui, Add, Button,, Button10
    Gui, Add, Button,, Button11
    Gui, Add, Pic, x%BtnX% y%BtnY% w1280 h470 +0x04000000, %BkgImg%                                              ; wichtig: das Hintergrundbild muss als letztes control mit +0x04000000 eingefügt werden

    Gui, Tab, 4																								    ; Tab 4
    Gui, Add, Button,, Button12
    Gui, Add, Button,, Button13
    Gui, Add, Pic, x%BtnX% y%BtnY% w1280 h470 +0x04000000, %BkgImg%                                             ; wichtig: das Hintergrundbild muss als letztes control mit +0x04000000 eingefügt werden

    Gui, Tab, 5																									; Tab 5
    Gui, Add, Button,, Button14
    Gui, Add, Pic, x%BtnX% y%BtnY% w1280 h470 +0x04000000, %BkgImg%                                             ; wichtig: das Hintergrundbild muss als letztes control mit +0x04000000 eingefügt werden

    Gui, Tab                                                   													; nachfolgende Steuerelemente werden nicht als Teil des Tab-Steuerelements angesehen

Gui, Add, Button, default x1100, Beenden


Gui, Show, , Titel für Steuerelement hier angeben															  	; Fensterbreite optional, Titel Steuerelement

return

;Nachfolgend wird den einzelnen Buttons anhand ihrer Bezeichnung eine Funktion zugeordnet, * sind Platzhalter für Variablen:
;immer nach Loop Files den Pfad für Anwendung, Datei eingeben

Button1:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button2:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button3:
Loop Files, \\C:\...
{    
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button4:

Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button5:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return

Button6:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button7:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return

Button8:
Run, \\C:\...

return

Button9:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return

Button10:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return

Button11:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button12:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


Button13:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return

Button14: 
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return


ButtonBeenden:
GuiClose:

SplashImage, C:\... , B CW00FFFF FS50 , Die Anwendung wird beendet...                                                       ; Bei C:\... Pfad für Endbild eingeben
Sleep, 4000                                                                                                                 ; Endbild erscheint für 4 Sekunden
SplashImage, Off
ExitApp                                                                                                                     ; Ende

AHKF.ahk
(5.53 KiB) Downloaded 183 times
garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: Steuerelement zur Auswahl von Dateien (Basis Tab3)

10 Feb 2018, 07:57

Hello UniqueContent
hast ein script hier , GUI TAB3 , funktioniert nicht ( buttons )
beachte BackGroundBild-Pfad und gLabel zu buttons

das mit dem Befehl 'Loop,files ' ist mir nicht ganz klar, willst nicht einen Ordner mit 200 files starten und alle abfragen ( ? )

Code: Select all

; -- funktioniert
ButtonButton1:
Loop, Files,C:\test\*.ahk    ; - nur ahk -files
{
msgbox, 262436,START Y/N,Willst Du dieses AHK-Program starten ?`n%A_LoopFileFullPath%
 IfMsgBox, No
        continue                             ;- frage nächstes ab , sonst program starten und denn evtl break
 run, %A_LoopFileFullPath%
}
return

;-- meine Idee ---
calc:
run,calc
return

;- oder 
Labelxx2:
msgbox, 262208, ,Hier Pfad angeben  ;- für Test
;ifexist, xxx
;     run,xxx
return

;--  ??? ( falsch ) -------
Button3:
Loop Files, \\C:\...
{
    run %A_LoopFileFullPath%
    IfMsgBox, No
        break
}
return

hier ein Beispiel, GUI TAB mit Buttons , lediglich Calculator und Beenden funktioniert, Rest muss man selber zuweisen

Code: Select all

;-------- saved at Mittwoch, 7. Februar 2018 14:47:37 --------------
;-------- https://autohotkey.com/boards/viewtopic.php?f=9&t=43881 ---
;- Tab3x TABx
#warn
setworkingdir,%a_scriptdir%

Gui,Color,Black
Gui, Font, cGray,   ;- auch Fontname, Size, Color
BkgImg := "C:\Windows\Web\Wallpaper\Kristall.jpg"
Gui, Add, Picture, x20 y50 w1000 h65, C:\Windows\Web\Wallpaper\Düne.jpg
Gui, Font, s35,
;---------------------------------------------
Gui, Add, Tab3, w1300 h600 Y+50, Arbeitsanweisungen|Prozessparameterblätter|Prüfpläne|Fehlerkatalog|QACs
Gui, Font, s25,

Gui,Add,Progress, Disabled BackgroundBlue
Gui,Add,Text,     xp   yp   wp   hp   cGray  BackgroundTrans  Center 0x200 vBtn,Rüstanweisungen   ;- color button

GuiControlGet, Btn, Pos
Gui, Add, Button,, Masteranweisungen
Gui, Add, Button,, Bedienungsanweisungen
Gui, Add, Button, gCalc, Calculator                                                               ;- gLabel zu CALC
Gui, Add, Button,, A110 Führen Messwerterfassungskarte
Gui, Add, Pic, x%BtnX% y%BtnY% w1280 h500 +0x04000000, %BkgImg%   ;- BackgroundPicture
;---------------------------------------------
Gui, Tab, 2,
Gui, Add, Button,, Prozessparameterblätter
;----------------------------
Gui, Tab, 3
Gui, Add, Button,, N47C
Gui, Add, Button,, N47C EU6
Gui, Add, Button,, N47C Tomas
Gui, Add, Button,, N47D
Gui, Add, Button,, N47Dopt
;----------------------------
Gui, Tab, 4
Gui, Add, Button,, FK BH
Gui, Add, Button,, FK CH
;----------------------------
Gui, Tab, 5
Gui, Add, Button,, zu den QACs
Gui, Tab                              ;- TAB -ENDE
;-----------------------------
Gui, Add, Button, default x1100 gEnd, Beenden                  ;- gLabel zu END
Gui, Show, , IHI NEXT - Digitalisierung
return
;--------------------------------------------
GuiClose:
End:
ExitApp

calc:
run,calc
return
;==============================================================


Return to “Skripte und Funktionen”

Who is online

Users browsing this forum: No registered users and 29 guests