Jump to content

Search the Community

Showing results for tags 'flicker'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 5 results

  1. Hello forum, I want to create a program with multiple menus and many elements inside. The problem is my way of doing this and below I have an example of how I do these menus. I know it's a bad way of doing them as using this method for more elements and menus cause big flickering. Can someone please help me with some tips of optimizing this or tell me another way of creating that menus with many elements without cause flickering? From a long time ago I still try to solve this but without any results, just small improvements. Many thanks for everyone. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $MENU_HOVER = '' Global $MENU_SELECTED = '' Global $COLOR_STANDARD = 0x94A5E9 Global $COLOR_HOVER = 0x8292d1 Global $COLOR_SELECTED = 0x7584bf $MENU = GUICreate("Menu", 615, 437, -1, -1, -1, -1, 0) GUISetFont(10, 400, 0, "Arial") $MENU_1 = GUICtrlCreateLabel("Menu 1", 8, 24, 106, 28, BitOR($SS_CENTER, $SS_CENTERIMAGE)) $MENU_2 = GUICtrlCreateLabel("Menu 2", 8, 56, 106, 28, BitOR($SS_CENTER, $SS_CENTERIMAGE)) $MENU_3 = GUICtrlCreateLabel("Menu 3", 8, 88, 106, 28, BitOR($SS_CENTER, $SS_CENTERIMAGE)) ;MENU 1 ELEMENTS $MENU_1_ELEMENT_1 = GUICtrlCreateButton("Menu1 Button", 128, 24, 147, 25) ;MENU 2 ELEMENTS $MENU_2_ELEMENT_1 = GUICtrlCreateButton("Menu2 Button", 128, 24, 147, 25) $MENU_2_ELEMENT_2 = GUICtrlCreateLabel("Another element", 128, 64, 99, 20) _Design() _Hide_All() GUISetState(@SW_SHOW, $MENU) While 1 $Cursor = GUIGetCursorInfo($MENU) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MENU_1 _Previous_Selected_Cancel() $MENU_SELECTED = 'Menu1' GUICtrlSetBkColor($MENU_1, $COLOR_SELECTED) _Show('Menu1') Case $MENU_2 _Previous_Selected_Cancel() $MENU_SELECTED = 'Menu2' GUICtrlSetBkColor($MENU_2, $COLOR_SELECTED) _Show('Menu2') Case $MENU_3 _Previous_Selected_Cancel() $MENU_SELECTED = 'Menu3' GUICtrlSetBkColor($MENU_3, $COLOR_SELECTED) _Show('Menu3') EndSwitch If $Cursor[4] = $MENU_1 Then If $MENU_HOVER <> 'Menu1' And $MENU_SELECTED <> 'Menu1' Then _Previous_Hover_Cancel() GUICtrlSetBkColor($MENU_1, $COLOR_HOVER) $MENU_HOVER = 'Menu1' EndIf ElseIf $Cursor[4] = $MENU_2 Then If $MENU_HOVER <> 'Menu2' And $MENU_SELECTED <> 'Menu2' Then _Previous_Hover_Cancel() GUICtrlSetBkColor($MENU_2, $COLOR_HOVER) $MENU_HOVER = 'Menu2' EndIf ElseIf $Cursor[4] = $MENU_3 Then If $MENU_HOVER <> 'Menu3' And $MENU_SELECTED <> 'Menu3' Then _Previous_Hover_Cancel() GUICtrlSetBkColor($MENU_3, $COLOR_HOVER) $MENU_HOVER = 'Menu3' EndIf Else _Previous_Hover_Cancel() $MENU_HOVER = 'Idle' EndIf WEnd Func _Design() GUICtrlSetColor($MENU_1, 0xFFFFFF) GUICtrlSetBkColor($MENU_1, $COLOR_STANDARD) GUICtrlSetCursor($MENU_1, 0) GUICtrlSetColor($MENU_2, 0xFFFFFF) GUICtrlSetBkColor($MENU_2, $COLOR_STANDARD) GUICtrlSetCursor($MENU_2, 0) GUICtrlSetColor($MENU_3, 0xFFFFFF) GUICtrlSetBkColor($MENU_3, $COLOR_STANDARD) GUICtrlSetCursor($MENU_3, 0) EndFunc ;==>_Design Func _Hide_All() GUICtrlSetState($MENU_1_ELEMENT_1, $GUI_HIDE) GUICtrlSetState($MENU_2_ELEMENT_1, $GUI_HIDE) GUICtrlSetState($MENU_2_ELEMENT_2, $GUI_HIDE) EndFunc ;==>_Hide_All Func _Show($MENU_SHOW) _Hide_All() If $MENU_SHOW = 'Menu1' Then GUICtrlSetState($MENU_1_ELEMENT_1, $GUI_SHOW) ElseIf $MENU_SHOW = 'Menu2' Then GUICtrlSetState($MENU_2_ELEMENT_1, $GUI_SHOW) GUICtrlSetState($MENU_2_ELEMENT_2, $GUI_SHOW) ElseIf $MENU_SHOW = 'Menu3' Then EndIf EndFunc ;==>_Show Func _Previous_Hover_Cancel() If $MENU_HOVER = 'Menu1' Then If $MENU_SELECTED <> 'Menu1' Then GUICtrlSetBkColor($MENU_1, $COLOR_STANDARD) ElseIf $MENU_HOVER = 'Menu2' Then If $MENU_SELECTED <> 'Menu2' Then GUICtrlSetBkColor($MENU_2, $COLOR_STANDARD) ElseIf $MENU_HOVER = 'Menu3' Then If $MENU_SELECTED <> 'Menu3' Then GUICtrlSetBkColor($MENU_3, $COLOR_STANDARD) EndIf EndFunc ;==>_Previous_Hover_Cancel Func _Previous_Selected_Cancel() If $MENU_SELECTED = 'Menu1' Then GUICtrlSetBkColor($MENU_1, $COLOR_STANDARD) If $MENU_SELECTED = 'Menu2' Then GUICtrlSetBkColor($MENU_2, $COLOR_STANDARD) If $MENU_SELECTED = 'Menu3' Then GUICtrlSetBkColor($MENU_3, $COLOR_STANDARD) EndFunc ;==>_Previous_Selected_Cancel
  2. Hi! I made a script that reads an ini file and updates the controls background color according to the ini key value. There's another script that needs to write to that ini file, but the file is locked by this main script. The loop keeps updating the window according to the ini contents, and that generates the flickering (and stalls the gui) but it also locks the ini file for writing. I can't think of a logic that could solve my problem. I'm sorry for the big script, the UI is still a bit messed up. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\telmo.baia\desktop\pinshell update utility.kxf $Form1_1 = GUICreate("PinShell Update Utility", 618, 357) $MenuItem1 = GUICtrlCreateMenu("&Arquivo") $MenuItem3 = GUICtrlCreateMenuItem("Abrir arquivo de atualização", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Sair", $MenuItem1) $RadioUpdAll = GUICtrlCreateRadio("Atualizar todos os micros", 16, 8, 153, 17) $RadioUpdSel = GUICtrlCreateRadio("Selecionar micros a atualizar", 16, 32, 153, 17) $iStart = GUICtrlCreateDummy() $Group1 = GUICtrlCreateGroup("OFFSET", 8, 64, 145, 265) $Check0 = GUICtrlCreateCheckbox("730", 24, 80, 39, 17) $Check1 = GUICtrlCreateCheckbox("419", 24, 96, 39, 17) $Check2 = GUICtrlCreateCheckbox("208", 24, 112, 39, 17) $Check3 = GUICtrlCreateCheckbox("702", 24, 128, 39, 17) $Check4 = GUICtrlCreateCheckbox("418", 24, 144, 39, 17) $Check5 = GUICtrlCreateCheckbox("209", 24, 160, 39, 17) $Check6 = GUICtrlCreateCheckbox("422", 24, 176, 39, 17) $Check7 = GUICtrlCreateCheckbox("218", 24, 192, 39, 17) $Check8 = GUICtrlCreateCheckbox("417", 24, 208, 39, 17) $Check9 = GUICtrlCreateCheckbox("415", 24, 224, 39, 17) $Check10 = GUICtrlCreateCheckbox("205", 24, 240, 39, 17) $Check44 = GUICtrlCreateCheckbox("999", 24, 280, 39, 17) $Label1 = GUICtrlCreateLabel("- 3R707RV-2", 64, 82, 69, 17) $Label2 = GUICtrlCreateLabel("- 4R707RV-1", 64, 98, 69, 17) $Label3 = GUICtrlCreateLabel("- 5R707", 64, 114, 45, 17) $Label4 = GUICtrlCreateLabel("- 7R707RVUV-1", 64, 130, 84, 17) $Label5 = GUICtrlCreateLabel("- 8R706UV", 64, 146, 60, 17) $Label6 = GUICtrlCreateLabel("- 9CD6UV-1", 64, 162, 64, 17) $Label7 = GUICtrlCreateLabel("- 10R701UV-1", 64, 178, 75, 17) $Label8 = GUICtrlCreateLabel("- 13CD74-6RV-1", 64, 194, 85, 17) $Label9 = GUICtrlCreateLabel("- 14R507RV-1", 64, 210, 75, 17) $Label10 = GUICtrlCreateLabel("- 15R506", 64, 226, 51, 17) $Label11 = GUICtrlCreateLabel("- 17CD102-4", 64, 242, 67, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("CORTE E VINCO", 160, 64, 145, 265) $Check11 = GUICtrlCreateCheckbox("522", 176, 80, 39, 17) $Check12 = GUICtrlCreateCheckbox("521", 176, 96, 39, 17) $Check13 = GUICtrlCreateCheckbox("352", 176, 112, 39, 17) $Check14 = GUICtrlCreateCheckbox("351", 176, 128, 39, 17) $Check15 = GUICtrlCreateCheckbox("350", 176, 144, 39, 17) $Check16 = GUICtrlCreateCheckbox("220", 176, 160, 39, 17) $Check17 = GUICtrlCreateCheckbox("416", 176, 176, 39, 17) $Check18 = GUICtrlCreateCheckbox("703", 176, 192, 39, 17) $Check19 = GUICtrlCreateCheckbox("214", 176, 208, 39, 17) $Check20 = GUICtrlCreateCheckbox("212", 176, 224, 39, 17) $Check21 = GUICtrlCreateCheckbox("213", 176, 240, 39, 17) $Check22 = GUICtrlCreateCheckbox("219", 176, 256, 39, 17) $Check23 = GUICtrlCreateCheckbox("731", 176, 272, 39, 17) $Check24 = GUICtrlCreateCheckbox("295", 176, 288, 39, 17) $Label16 = GUICtrlCreateLabel("- VISIO-2", 216, 82, 50, 17) $Label17 = GUICtrlCreateLabel("- VISIO-1", 216, 98, 50, 17) $Label18 = GUICtrlCreateLabel("- NOVAC-3", 216, 114, 59, 17) $Label19 = GUICtrlCreateLabel("- NOVAC-1", 216, 130, 59, 17) $Label20 = GUICtrlCreateLabel("- NOVAC-2", 216, 146, 59, 17) $Label21 = GUICtrlCreateLabel("- SPERIA-1", 216, 162, 61, 17) $Label22 = GUICtrlCreateLabel("- SPERIA-2", 216, 178, 61, 17) $Label23 = GUICtrlCreateLabel("- SP-102-5", 216, 194, 57, 17) $Label24 = GUICtrlCreateLabel("- SP-102-1", 216, 210, 57, 17) $Label25 = GUICtrlCreateLabel("- SP-102-4", 216, 226, 57, 17) $Label26 = GUICtrlCreateLabel("- SP-102-2", 216, 242, 57, 17) $Label27 = GUICtrlCreateLabel("- SP-102-3", 216, 258, 57, 17) $Label28 = GUICtrlCreateLabel("- SP-102-6", 216, 274, 57, 17) $Label29 = GUICtrlCreateLabel("- EASY", 216, 290, 41, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("COLAGEM", 312, 64, 145, 265) $Check25 = GUICtrlCreateCheckbox("261", 328, 80, 39, 17) $Check26 = GUICtrlCreateCheckbox("704", 328, 96, 39, 17) $Check27 = GUICtrlCreateCheckbox("264", 328, 112, 39, 17) $Check28 = GUICtrlCreateCheckbox("263", 328, 128, 39, 17) $Check29 = GUICtrlCreateCheckbox("262", 328, 144, 39, 17) $Check30 = GUICtrlCreateCheckbox("705", 328, 160, 39, 17) $Check31 = GUICtrlCreateCheckbox("421", 328, 176, 39, 17) $Check32 = GUICtrlCreateCheckbox("420", 328, 192, 39, 17) $Check33 = GUICtrlCreateCheckbox("258", 328, 208, 39, 17) $Check34 = GUICtrlCreateCheckbox("253", 328, 224, 39, 17) $Check35 = GUICtrlCreateCheckbox("255", 328, 240, 39, 17) $Check36 = GUICtrlCreateCheckbox("251", 328, 256, 39, 17) $Check37 = GUICtrlCreateCheckbox("252", 328, 272, 39, 17) $Label31 = GUICtrlCreateLabel("- EXPERT-3", 368, 82, 65, 17) $Label32 = GUICtrlCreateLabel("- EXPERT-5", 368, 98, 65, 17) $Label33 = GUICtrlCreateLabel("- EXPERT-1", 368, 114, 65, 17) $Label34 = GUICtrlCreateLabel("- EXPERT-2", 368, 130, 65, 17) $Label35 = GUICtrlCreateLabel("- EXPERT-4", 368, 146, 65, 17) $Label36 = GUICtrlCreateLabel("- EXPERT-6", 368, 162, 65, 17) $Label37 = GUICtrlCreateLabel("- AM-105-1", 368, 178, 59, 17) $Label38 = GUICtrlCreateLabel("- AM-105-2", 368, 194, 59, 17) $Label39 = GUICtrlCreateLabel("- MD-100-1", 368, 210, 60, 17) $Label40 = GUICtrlCreateLabel("- MD-68-1", 368, 226, 54, 17) $Label41 = GUICtrlCreateLabel("- MD-45-1", 368, 242, 54, 17) $Label47 = GUICtrlCreateLabel("- RICALL", 368, 258, 50, 17) $Label49 = GUICtrlCreateLabel("- BABY", 368, 274, 41, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group4 = GUICtrlCreateGroup("HOT-STAMP", 464, 64, 145, 89) $Check38 = GUICtrlCreateCheckbox("230", 480, 80, 39, 17) $Check39 = GUICtrlCreateCheckbox("424", 480, 96, 39, 17) $Check40 = GUICtrlCreateCheckbox("425", 480, 112, 39, 17) $Label42 = GUICtrlCreateLabel("- STEUER", 520, 82, 57, 17) $Label43 = GUICtrlCreateLabel("- FURNAX-HS", 520, 98, 75, 17) $Label44 = GUICtrlCreateLabel("- FURNAX-HS-2", 520, 114, 84, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group5 = GUICtrlCreateGroup("VERNIZ", 464, 152, 145, 89) $Check41 = GUICtrlCreateCheckbox("291", 480, 168, 39, 17) $Check42 = GUICtrlCreateCheckbox("290", 480, 184, 39, 17) $Label45 = GUICtrlCreateLabel("- VERCAL-1", 520, 170, 64, 17) $Label46 = GUICtrlCreateLabel("- VERCAL-2", 520, 186, 64, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group6 = GUICtrlCreateGroup("MANUTENÇÃO", 464, 240, 145, 89) $Check43 = GUICtrlCreateCheckbox("MICRO0177", 480, 256, 80, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $iEnd = GUICtrlCreateDummy() $ButtonUpdate = GUICtrlCreateButton("Atualizar", 464, 10, 147, 35) $ButtonCleanSel = GUICtrlCreateButton("Limpar seleção", 180, 27, 80, 25) GUICtrlSetState($ButtonCleanSel, $GUI_DISABLE); ###################################################### HABILITAR BOTÃO DE LIMPAR SELEÇÃO SÓ QUANDO ATUALIZAR TODOS NÃO ESTIVER SELECIONADO E NENHUMA SELEÇÃO FEITA GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Shell = "PinShell" $PUUFile = "PUU.dat" $PUUPath = "M:\vm2\" & $Shell & "\" & $Shell & "\" $PUU = $PUUPath & $PUUFile ;~ local CheckStatus() CheckStatus() While 1 CheckStatus() $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem4 Exit Case $MenuItem3 Run ( "notepad.exe " & $PUUFile, $PUUPath) Case $RadioUpdAll For $i = $iStart To $iEnd GUICtrlSetState($i, $GUI_DISABLE) Next ;~ IniWrite($PUU, "MTU Selection", "ALL", "1") Case $RadioUpdSel For $i = $iStart To $iEnd GUICtrlSetState($i, $GUI_ENABLE) Next Case $ButtonUpdate If GUICtrlRead($RadioUpdAll) = 1 Then IniWrite($PUU, "MTU Selection", "ALL", "1") If IniRead($PUU, "MTU Selection", "ALL", "") = 1 Then MsgBox(64, "Informação", "Definida atualização geral automatica.") EndIf ElseIf GUICtrlRead($RadioUpdSel) = 1 Then For $1 = 0 To 44 ; ######################################### ALTERAR NÚMERO DE ACORDO COM AS CHECKBOXES (MÁQUINAS) EXISTENTES If GUICtrlRead(Eval('Check' & $1)) = 1 Then IniWrite($PUU, "MTU Selection", GUICtrlRead(Eval('Check' & $1), 1), "1") If GUICtrlRead(Eval('Check' & $1)) <> 1 Then IniWrite($PUU, "MTU Selection", GUICtrlRead(Eval('Check' & $1), 1), "0") Next IniWrite($PUU, "MTU Selection", "ALL", "0") If IniRead($PUU, "MTU Selection", "ALL", "") = 0 Then MsgBox(64, "Informação", "Definidos micros para atualizar automaticamente.") EndIf EndIf EndSwitch WEnd Func CheckStatus() For $1 = 0 To 44 ; ######################################### ALTERAR NÚMERO DE ACORDO COM AS CHECKBOXES (MÁQUINAS) EXISTENTES If IniRead($PUU, "MTU Selection", GUICtrlRead(Eval('Check' & $1), 1), "") = 1 Then GUICtrlSetState(Eval('Check' & $1), $GUI_CHECKED) Next For $1 = 0 To 44 ; ######################################### ALTERAR NÚMERO DE ACORDO COM AS CHECKBOXES (MÁQUINAS) EXISTENTES If IniRead($PUU, "MTU Selection", GUICtrlRead(Eval('Check' & $1), 1), "") = "A" Then DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", Eval('Check' & $1), "wstr", 0, "wstr", 0) GUICtrlSetBkColor(Eval('Check' & $1), $COLOR_GREEN) EndIf Next For $1 = 0 To 44 ; ######################################### ALTERAR NÚMERO DE ACORDO COM AS CHECKBOXES (MÁQUINAS) EXISTENTES If IniRead($PUU, "MTU Selection", GUICtrlRead(Eval('Check' & $1), 1), "") = "N" Then DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", Eval('Check' & $1), "wstr", 0, "wstr", 0) GUICtrlSetBkColor(Eval('Check' & $1), $COLOR_RED) EndIf Next If IniRead($PUU, "MTU Selection", "ALL", "") = 1 Then GUICtrlSetState($RadioUpdAll, $GUI_CHECKED) For $i = $iStart To $iEnd GUICtrlSetState($i, $GUI_DISABLE) Next Else GUICtrlSetState($RadioUpdSel, $GUI_CHECKED) For $i = $iStart To $iEnd GUICtrlSetState($i, $GUI_ENABLE) Next EndIf EndFunc
  3. Hi guys, So I am facing an issue with my Listview control flickering like crazy when using the Modern GUI UDF. I understand that the reson is because Listviews do not play nice with the $WS_EX_COMPOSITED extended style which is necessary to prevent the rest of the GUI components flickering on resizing. I am looking for suggestions on how I can overcome the flickering issue without having to remove the Listview header (as I need the header to allow column resizing and sorting). The reproducer is here and the lightly modified Modern GUI UDF is attached as a zip (I added $WS_CLIPCHILDREN and $WS_EX_COMPOSITED to the _Metro_CreateGUI() function in order to stop flickering of other controls like buttons/labels/toggles etc). ;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling): #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe ;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling()) #AutoIt3Wrapper_Res_HiDpi=y #include-once #NoTrayIcon #include "MetroGUI-UDF\MetroGUI_UDF.au3" #include <GuiListView.au3> $gui = _Metro_CreateGUI("example", 800, 600, -1, -1, True) ;Add/create control buttons to the GUI $Control_Buttons = _Metro_AddControlButtons(True, True, True, True, False) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True ;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected. $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] ;====================================================================================================================================================================== $Button1 = _Metro_CreateButtonEx("Add new item(s)", 20, 20, 130, 50) $Button2 = _Metro_CreateButtonEx("Edit item(s)", 170, 20, 130, 50) $ListView2 = GUICtrlCreateListView("", 0, 86, 800, 400, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($ListView2, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_FLATSB)) For $i = 0 to 8 _GUICtrlListView_AddColumn($ListView2, "col " &$i) Next _GUICtrlListView_SetBkColor($ListView2, 0xF3F3F3) _GUICtrlListView_SetTextBkColor($ListView2, 0xF3F3F3) ;Set resizing options for the controls so they don't change in size or position. This can be customized to match your gui perfectly for resizing. See AutoIt Help file. GUICtrlSetResizing($Button1, 768 + 2 + 32) GUICtrlSetResizing($Button2, 768 + 2 + 32) GUICtrlSetResizing($ListView2, 102) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($gui) ;This hover check has to be added to the main While loop, otherwise the hover effects won't work. $nMsg = GUIGetMsg() Switch $nMsg ;=========================================Control-Buttons=========================================== Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON _Metro_GUIDelete($gui) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs! Exit Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $GUI_FULLSCREEN_BUTTON, $GUI_FSRestore_BUTTON _Metro_FullscreenToggle($gui, $Control_Buttons) EndSwitch WEnd Any suggestions would be greately appreciated. Cheers! MetroGUI-UDF.zip
  4. First off, I still learning Autoit, and so hopefully this hasn't been answered before on the forum and I just overlooked it... I've been testing/tinkering/researching and can't seem to code what I want. So I'm hoping that someone here can lend me a hand. I'm trying to come up with a 3-stage, flicker-free, .PNG-based button. I'm also looking for this method to let me tab between one of these buttons and other input fields on the same GUI. Essentially I'm wanting to have a button that shows the typical states (normal, hover, pressed) without flickering. And of course, so I can have multiple buttons on the same GUI too. Has anyone gotten this type of thing to work consistently and care to share some code? I should mention that I did get something to work, but it seems kind of overkill and clunky (it uses child GUIs as buttons). So I'm hoping one of you Autoit gurus have a better, sleeker, solution I can take advantage of. Thanks!
  5. Hi peeps, are you able to please help me out with reducing/eliminating the flicker when the GUI is being resized? The example is attached. Reason for zip is that I'm using a couple of UDFs (namely: Ribbon bar and ModernMenuRaw so I've included them in the attached archive). Source here: #Region ### includes ### #include-once #NoTrayIcon #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Ribbonsbar.au3> #include <GuiListView.au3> #include <EditConstants.au3> #EndRegion ### includes ### Opt("GUIResizeMode", 802) Global $appname = 'Example App', $appver = '1.0', $additemsgui_W = 400, $additemsgui_H = 150 #Region ### $maingui ### $maingui = GUICreate($appname & ' ' & $appver, @DesktopWidth, 600, -1, -1, BitOr($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) $hBar = _RibbonsBar_Create($maingui, 0, 0, 0, 0, 'blue') $hTab_Home = _RibbonsBar_Create_Tab($hBar, 'Home') $hItem_FileOps = _RibbonsBar_Create_TabItem($hTab_Home, 'File operations' , 225 ) $hGrandButton_New = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',412,'New',52, True ) _RibbonsBar_GrandButtons_Enable($hGrandButton_New, 0) $hDropDownNew = _RibbonsBar_Create_ContextMenu($hGrandButton_New) $hDropDownNew_1 = _GUICtrlCreateODMenuItem("Standard ...", $hDropDownNew, "smallIcons.dll", 261) $hDropDownNew_2 = _GUICtrlCreateODMenuItem("Manual ...", $hDropDownNew, "smallIcons.dll", 382) $hGrandButton_Open = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',453,'Open',52, False ) _RibbonsBar_GrandButtons_Enable($hGrandButton_Open, 0) $hGrandButton_Save = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',514,'Save',52, True ) _RibbonsBar_GrandButtons_Enable($hGrandButton_Save, 0) $hDropDownSave = _RibbonsBar_Create_ContextMenu($hGrandButton_Save) $hDropDownSave_1 = _GUICtrlCreateODMenuItem("Save", $hDropDownSave, "smallIcons.dll", 287) $hDropDownSave_2 = _GUICtrlCreateODMenuItem("Save As ...", $hDropDownSave, "smallIcons.dll", 286) $hGrandButton_Export = _RibbonsBar_Create_GrandButton($hItem_FileOps,'',337,'Export',62, True ) _RibbonsBar_GrandButtons_Enable($hGrandButton_Export, 0) $hDropDownExport = _RibbonsBar_Create_ContextMenu($hGrandButton_Export) $hDropDownExport_1 = _GUICtrlCreateODMenuItem("To Excel", $hDropDownExport, "smallIcons.dll", 1243) $hItem_ItemOps = _RibbonsBar_Create_TabItem ( $hTab_Home, 'Item operations' , 393 ) $hGrandButton_AddItems = _RibbonsBar_Create_GrandButton($hItem_ItemOps,'',301,'Add item(s)',72, True ) $hDropDownAddItems = _RibbonsBar_Create_ContextMenu($hGrandButton_AddItems) _RibbonsBar_GrandButtons_Enable($hGrandButton_AddItems, 0) $hDropDownAddItems_1 = _GUICtrlCreateODMenuItem("From Catalogue", $hDropDownAddItems, "smallIcons.dll", 173) $hDropDownAddItems_2 = _GUICtrlCreateODMenuItem("From Quote", $hDropDownAddItems, "smallIcons.dll", 143) $hDropDownAddItems_3 = _GUICtrlCreateODMenuItem("Paste", $hDropDownAddItems, "smallIcons.dll", 9) $hGrandButton_DelItems = _RibbonsBar_Create_GrandButton($hItem_ItemOps,'',615,'Delete item(s)',82, False ) _RibbonsBar_GrandButtons_Enable($hGrandButton_DelItems, 0) $SmallButton_Undo = _RibbonsBar_Create_SmallButton($hItem_ItemOps,'',728,1,'Undo (Test: click to enable grand buttons)',230) $SmallButton_Redo = _RibbonsBar_Create_SmallButton($hItem_ItemOps,'',194,2,'Redo (Test: click to disable grand buttons)',230) _RibbonsBar_SmallButtons_Enable($SmallButton_Redo, 0) $hTab_Help = _RibbonsBar_Create_Tab( $hBar, 'Help' ) $hItem_Information = _RibbonsBar_Create_TabItem ( $hTab_Help, 'Information' , 120 ) $hGrandButton_About = _RibbonsBar_Create_GrandButton($hItem_Information,'',631,'Help','',False) $hGrandButton_About = _RibbonsBar_Create_GrandButton($hItem_Information,'',644,'About','',False) _RibbonsBar_Tab_SetState($hTab_Home) GUISwitch($maingui) WinMove($maingui, "", Default, Default, 800, Default) $wPos = WinGetPos($maingui) WinMove($maingui, "", @DesktopWidth/2 - $wPos[2]/2, @DesktopHeight/2 - $wPos[3]/2, Default, Default) $wPos = WinGetPos($maingui) $mainlistview = GUICtrlCreateListView('Col 1|Col 2|Col 3|Col 4|Col 5|Col 6', -2, 120, _ $wPos[2], $wPos[3], Default) _GUICtrlListView_SetExtendedListViewStyle($mainlistview, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_FLATSB)) _GUICtrlListView_SetColumnWidth($mainlistview, 0, 120) _GUICtrlListView_SetColumnWidth($mainlistview, 1, 250) _GUICtrlListView_SetColumnWidth($mainlistview, 2, 50) _GUICtrlListView_SetColumnWidth($mainlistview, 3, 100) _GUICtrlListView_SetColumnWidth($mainlistview, 4, 100) _GUICtrlListView_SetColumnWidth($mainlistview, 5, 50) #EndRegion ### $additemsgui ### #Region ### $additemsgui ### $additemsgui = GUICreate('Add item(s) from Catalogue', $additemsgui_W, $additemsgui_H, 0, 0, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), $WS_EX_MDICHILD, $maingui) GUISetBkColor(0xf2f8ff) GUISetFont(10, 400) $additems_addlabel = GUICtrlCreateLabel('Start typing below to add item(s) from catalogue (min 2 chars):', 10, 15, $additemsgui_W - 20, 21) $additemsinput = GUICtrlCreateInput('', 10, 45, $additemsgui_W - 20, Default) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, False, 'Enter an item number here') $additemsbn_add = GUICtrlCreateButton('Add', 10, 85, 110, 40) #EndRegion ### $additemsgui ### GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") ; Register WM_GETMINMAXINFO GUISetState(@SW_SHOW, $maingui) GUICtrlSetResizing($mainlistview, BitOR($GUI_DOCKLEFT, $GUI_DOCKRIGHT, $GUI_DOCKTOP)) While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $maingui Switch $msg[0] Case $GUI_EVENT_CLOSE Exit Case $hDropDownAddItems_1 GUISetState(@SW_DISABLE, $maingui) $mPos = WinGetPos($maingui) WinMove($additemsgui, '', $mPos[0] + (($mPos[2]/2) - ($additemsgui_W/2)), $mPos[1] + (($mPos[3]/2) - ($additemsgui_H/2))) GUICtrlSetData($additemsinput, '') GUISetState(@SW_SHOW, $additemsgui) _WinAPI_SetFocus(ControlGetHandle('', '', $additems_addlabel)) Case $hDropDownNew_1 ConsoleWrite('Clicked "New" menu item 1'&@CRLF) Case $hDropDownNew_2 ConsoleWrite('Clicked "New" menu item 2'&@CRLF) EndSwitch Case $additemsgui Switch $msg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $maingui) GUISetState(@SW_HIDE, $additemsgui) EndSwitch EndSwitch Switch _RibbonsBar_GetMsg() Case $hGrandButton_Open ConsoleWrite('open...'&@CRLF) Case $SmallButton_Undo _RibbonsBar_GrandButtons_Enable($hGrandButton_New, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_Save, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_Export, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_AddItems, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_DelItems, 1) _RibbonsBar_GrandButtons_Enable($hGrandButton_Open, 1) If _RibbonsBar_SmallButtons_GetState($SmallButton_Undo) = 1 Then ConsoleWrite('undo...'&@CRLF) EndIf Case $SmallButton_Redo _RibbonsBar_GrandButtons_Enable($hGrandButton_New, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_Save, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_Export, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_AddItems, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_DelItems, 0) _RibbonsBar_GrandButtons_Enable($hGrandButton_Open, 0) If _RibbonsBar_SmallButtons_GetState($SmallButton_Redo) = 1 Then ConsoleWrite('redo...'&@CRLF) EndIf Case $hTab_Home _RibbonsBar_Tab_SetState($hTab_Home) Case $hGrandButton_Export _RibbonsBar_ContextMenu_SetState($hDropDownExport) Case $hGrandButton_Save _RibbonsBar_ContextMenu_SetState($hDropDownSave) Case $hGrandButton_AddItems _RibbonsBar_ContextMenu_SetState($hDropDownAddItems) Case $hGrandButton_New _RibbonsBar_ContextMenu_SetState($hDropDownNew) Case $hTab_Help _RibbonsBar_Tab_SetState($hTab_Help) EndSwitch WEnd Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) If $hWnd = $maingui Then $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, 800) ; W (min size) DllStructSetData($tagMaxinfo, 8, 600) ; H (min size) Return 0 EndIf EndFunc ;==>WM_GETMINMAXINFO Thanks heaps in advance! example.zip
×
×
  • Create New...