enaiman Posted May 10, 2010 Share Posted May 10, 2010 I don't know why this is happening but I've noticed that the above style is messing up a few things: - ListWiew controls disapears - if a label is used as a Group control text, when this style is applied the label will show as being "under" the group control (you can see the border of the group through the label. Anyone has an idea why this is happening? and if there is any way to fix it? I'm running AutoIt 3.3.0.0 on WinXP Here is a sample code: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Const $WS_EX_COMPOSITED = 0x2000000 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 400, 394, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $ListView1 = GUICtrlCreateListView("", 16, 16, 361, 121, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES)) $ListView1_0 = GUICtrlCreateListViewItem("1|11|12|13", $ListView1) GUICtrlCreateGroup("", 16, 150, 361, 200) GUICtrlCreateLabel("Group Name", 25, 148) $Button1 = GUICtrlCreateButton("Apply Style", 160, 358, 75, 25) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Button1Click() GUISetStyle(-1, $WS_EX_COMPOSITED, $Form1) EndFunc Func Form1Close() Exit EndFunc Thanks, SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
KaFu Posted May 11, 2010 Share Posted May 11, 2010 - if a label is used as a Group control text, when this style is applied the label will show as being "under" the group control (you can see the border of the group through the label.Help-File: "$WS_EX_COMPOSITED = Windows XP or above: Paints all descendants of a window in bottom-to-top painting order using double-buffering."... the painting order is reversed, that's why controls in the foreground suddenly switch to the background. Style also works on Vista and Win7 only if Aero is disabled (search example forum on WS_EX_COMPOSITED, I got a sample somewhere there floating around). Regarding the listview.... I don't know why it behaves like this too ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
enaiman Posted May 11, 2010 Author Share Posted May 11, 2010 @KaFu Thanks for explanation - that fully answers the question related to the label (been experimenting a little creating the label before and after the group and seen the results). That doesn't hurt too much; what it does hurt is the ListView. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
wraithdu Posted May 11, 2010 Share Posted May 11, 2010 (edited) Don't set the extended style from within GuiCtrlCreateListView. Create the listview, then set the extended style with _GuiCtrlListView_SetExtendedStyle. It's a long standing bug or something. Edited May 11, 2010 by wraithdu Link to comment Share on other sites More sharing options...
KaFu Posted May 11, 2010 Share Posted May 11, 2010 Don't set the extended style from within GuiCtrlCreateListView. Create the listview, then set the extended style with _GuiCtrlListView_SetExtendedStyle. It's a long standing bug or something. Hu, tried that, but it seems to make the listview disappear completely on switch. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListview.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) ;Const $WS_EX_COMPOSITED = 0x2000000 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 400, 394, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $ListView1 = GUICtrlCreateListView("", 16, 16, 361, 121) GUICtrlSetBkColor(-1,0x00ff00) _GUICtrlListView_SetExtendedListViewStyle($ListView1,BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES)) $ListView1_0 = GUICtrlCreateListViewItem("1|11|12|13", $ListView1) GUICtrlCreateGroup("", 16, 150, 361, 200) GUICtrlSetBkColor(-1,0x00ff00) GUICtrlCreateLabel("Group Name", 25, 148) GUICtrlSetBkColor(-1,0x00ff00) $Button1 = GUICtrlCreateButton("Apply Style", 160, 358, 75, 25) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Button1Click() GUISetStyle(-1, $WS_EX_COMPOSITED, $Form1) EndFunc Func Form1Close() Exit EndFunc OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
martin Posted May 11, 2010 Share Posted May 11, 2010 WS_EX_COMPOSITED and list views do not mix. I think it's a widows listview problem, but anyway it's a problem that has irritated may people including me. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
enaiman Posted May 11, 2010 Author Share Posted May 11, 2010 Thank you all for your help. I thought there was something wrong with my code/AutoIt version. I'll have to "be happy" with what I have SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now