Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.07 KB | None | 0 0
  1. ; GUI Module for Skills
  2.  
  3. #Include <WindowsConstants.au3>
  4. #include <EditConstants.au3>
  5.  
  6. Opt("GUIOnEventMode", 1)
  7.  
  8. Func _GUIs_LoginScreen(ByRef $hWin, ByRef $arr_hControls, $arr_sTranslation)
  9. #cs
  10. Funzione per la creazione della prima schermata, dove verranno mostrati due campi per il
  11. login con il proprio profilo e un pulsante per la creazione di un nuovo profilo.
  12.  
  13. Parametri:
  14. 1 - Variabile già dichiarata per l'handle della GUICreate
  15. 2 - Array bidimensionale già dichiarato con dimensione $[4][7]
  16. 3 - Array della traduzione
  17. 4 - Array delle informazioni addizionali
  18.  
  19. Verrà utilizzato in questo modo:
  20. $[0][*]
  21.     *0: Input - Username
  22.     *1: Input - Password
  23. $[1][*]
  24.     *0: Button - Login
  25.     *1: Button - Nuovo profilo
  26. $[2][*]
  27.     *0: Pic - Sfondo
  28. $[3][*]
  29.     *0: Label - Username
  30.     *1: Label - Password
  31.     *3: Label - Titolo
  32.     *4: Label - Sottotitolo
  33.     *5: Label - Copyright
  34.     *6: Label - Versione
  35. #ce
  36.  
  37.     $iCentralElementWidth = 300
  38.    
  39.     $sT1Font = "Courier New"
  40.  
  41.     $hWin = GUICreate( _
  42.             $arr_sTranslation[$TR_LOGIN_GAMETITLE], _   ; GUI Title
  43.             @DesktopWidth, _    ; Width
  44.             @DesktopHeight, _   ; Height
  45.             0, _        ; Left
  46.             0, _        ; Top
  47.             $WS_POPUP _ ; Style
  48.             )
  49.    
  50.     $arr_hControls[0][0] =  GUICtrlCreateInput( _
  51.                             "", _                           ; Text
  52.                             @DesktopWidth / 2 - 300 / 2,; Left
  53.                             @DesktopHeight / 2 + 22, _      ; Top
  54.                             $iCentralElementWidth _         ; Width
  55.                             )
  56.  
  57.     $arr_hControls[0][1] =  GUICtrlCreateInput( _
  58.                             "", _                           ; Text
  59.                             @DesktopWidth / 2 - 300 / 2,; Left
  60.                             @DesktopHeight / 2 + 104, _     ; Top
  61.                             $iCentralElementWidth, _            ; Width
  62.                             Default, _      ; Height
  63.                             $ES_PASSWORD; Style
  64.                             )
  65.    
  66.     $arr_hControls[3][0] =  GUICtrlCreateLabel( _
  67.                             $arr_sTranslation[$TR_LOGIN_USERNAME], _            ; Text
  68.                             @DesktopWidth / 2 - $iCentralElementWidth / 2, _    ; Left
  69.                             @DesktopHeight / 2, _   ; Top
  70.                             $iCentralElementWidth _ ; Width
  71.                             )
  72.  
  73.     $arr_hControls[3][1] =  GUICtrlCreateLabel( _
  74.                             $arr_sTranslation[$TR_LOGIN_PASSWORD], _            ; Text
  75.                             @DesktopWidth / 2 - $iCentralElementWidth / 2, _    ; Left
  76.                             @DesktopHeight / 2 + 80,; Top
  77.                             $iCentralElementWidth _ ; Width
  78.                             )
  79.    
  80.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  81.    
  82.     $arr_hControls[3][5] =  GUICtrlCreateLabel( _
  83.                             $arr_sTranslation[$TR_LOGIN_COPYRIGHT], _           ; Text
  84.                             15, _   ; Left
  85.                             @DesktopHeight - 25, _      ; Top
  86.                             @DesktopWidth - 15 * 2 _    ; Width
  87.                             )
  88.  
  89.  
  90.     GUISetBkColor(0x000000, $hWin)
  91.  
  92.     GUICtrlSetColor($arr_hControls[3][0], 0xFFFFFF)
  93.     GUICtrlSetColor($arr_hControls[3][1], 0xFFFFFF)
  94.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  95.     GUICtrlSetColor($arr_hControls[3][5], 0xFFFFFF)
  96.    
  97.     GUICtrlSetFont($arr_hControls[0][0], 9.5, 400, 0, $sT1Font)
  98.     GUICtrlSetFont($arr_hControls[0][1], 9.5, 400, 0, $sT1Font)
  99.     GUICtrlSetFont($arr_hControls[3][0], 9.5, 400, 0, $sT1Font)
  100.     GUICtrlSetFont($arr_hControls[3][1], 9.5, 400, 0, $sT1Font)
  101.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  102.     GUICtrlSetFont($arr_hControls[3][5], 11, 400, 0, $sT1Font)
  103.    
  104.     GUISetCursor(3, 1, $hWin)
  105.    
  106.     GUISetState(@SW_SHOW, $hWin)
  107. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement