Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Layout options, which is the best way?

$
0
0

On a GUI im doing im becoming concerned about the amount of buttons and radios im adding affecting load times etc

 

Of these 2 example options which is the better way or is there no difference?

So this one where i hold the icon creation until the reg key has been checked

; ####################################################################### GUICtrlCreateLabel('Battery Check / Advise', 50, 227, 170, 25) _Font() GUIStartGroup() Local $T3BatteryRadio1 = GUICtrlCreateRadio('Pass', 240, 224, 64, 23) _NoTheme($T3BatteryRadio1) Local $T3BatteryRadio2 = GUICtrlCreateRadio('Fail', 300, 224, 64, 23) _NoTheme($T3BatteryRadio2) Local $T3BatteryRegCheck = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple\Service', 'Battery'),$T3BatteryIcon If $T3BatteryRegCheck = '' Then     $T3BatteryIcon = GUICtrlCreateIcon($cross, -1, 22, 226, 20, 20) ElseIf $T3BatteryRegCheck = 'NotCompleted' Then     $T3BatteryIcon = GUICtrlCreateIcon($cross, -1, 22, 226, 20, 20)     GUICtrlSetState($T3BatteryRadio2, $GUI_CHECKED) Else     $T3BatteryIcon = GUICtrlCreateIcon($tick, -1, 22, 226, 20, 20)     GUICtrlSetState($T3BatteryRadio1, $GUI_CHECKED) EndIf Local $T3BatteryGroup = GUICtrlCreateGroup('', 15, 214, 350, 38) DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle($T3BatteryGroup), 'wstr', 0, 'wstr', 0) ; #######################################################################

Or this one where i pre declare the icon and create it, then just set the image

AutoIt         
; ####################################################################### GUICtrlCreateLabel('Battery Check / Advise', 50, 227, 170, 25) _Font() Local $T3BatteryIcon = GUICtrlCreateIcon($cross, -1, 22, 226, 20, 20) GUIStartGroup() Local $T3BatteryRadio1 = GUICtrlCreateRadio('Pass', 240, 224, 64, 23) _NoTheme($T3BatteryRadio1) Local $T3BatteryRadio2 = GUICtrlCreateRadio('Fail', 300, 224, 64, 23) _NoTheme($T3BatteryRadio2) Local $T3BatteryRegCheck = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple\Service', 'Battery'),$T3BatteryIcon If $T3BatteryRegCheck = '' Then     GUICtrlSetImage($T3BatteryIcon, $cross) ElseIf $T3BatteryRegCheck = 'NotCompleted' Then     GUICtrlSetImage($T3BatteryIcon, $cross)     GUICtrlSetState($T3BatteryRadio2, $GUI_CHECKED) Else     GUICtrlSetImage($T3BatteryIcon, $tick)     GUICtrlSetState($T3BatteryRadio1, $GUI_CHECKED) EndIf Local $T3BatteryGroup = GUICtrlCreateGroup('', 15, 214, 350, 38) DllCall('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle($T3BatteryGroup), 'wstr', 0, 'wstr', 0) ; #######################################################################

Its purely that i have a lot of these and i want to slow the gui down as little as possible over a couple of hundred of these


Viewing all articles
Browse latest Browse all 12506

Trending Articles