FinalVersion Posted February 13, 2010 Share Posted February 13, 2010 1. How can I have multiple Styles or ExStyles? I've tried this. GUICtrlCreateListView("Process Name|Process ID (PID)", 8, 8, 362, 382, ($style1, $style2)) It appears it didn't work. 2. How can I make columns in ListView's automatically adjust to the largest size text in the column? 3. Is it possible for a ListView to update in realtime? And how would I go about it? [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 13, 2010 Moderators Share Posted February 13, 2010 FinalVersion,Having a busy day, aren't we! multiple Styles or ExStylesYou use BitOR like this:BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)A couple of points:1. Do not use simple addition - although it might work in some cases, Windows often uses the bits as markers and addition can set bits you do not want - then you take ages working out why you have not got what you think you should have (speaking from personal experience here!)2. When you ever specify a style setting, you overwrite all the previously set styles. If you wish to retain them you must add them back in as well. A common example: the default styles for a ListBox are $LBS_SORT, $WS_BORDER, $WS_VSCROLL; if the $LBS_NOTIFY style is used on its own when the ListBox is created, it overwrites these and the user wonders why the ListBox no longer sorts and has no scrollbar! You have to BitOR the lot (although there is a shorthand way of defining the default styles for most controls - look in the Help file)2a. You can retrieve the current style setting via an API call and use BitOR again, but we will leave that for another day....make columns in ListView's automatically adjust to the largest size textUse _GUICtrlListView_SetColumnWidth with $LVSCW_AUTOSIZE in the $iWidth parameter. Look in the Help file for more details.Is it possible for a ListView to update in realtimeNo, you have to update the ListViewItems in a loop.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
FinalVersion Posted February 13, 2010 Author Share Posted February 13, 2010 Indeed it is a big day. Can you give me an example of multiple styles & exstyles, thanks. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
martin Posted February 13, 2010 Share Posted February 13, 2010 (edited) Indeed it is a big day. Can you give me an example of multiple styles & exstyles, thanks.Hey, look in the help. GuiCreate is one but there are loads.EDIT: and since you have been told the answer, what on earth prevents you from just tring it? All you have to do is put BitOr around the style you used in your first post. Edited February 13, 2010 by martin 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...
Moderators Melba23 Posted February 13, 2010 Moderators Share Posted February 13, 2010 FinalVersion,Does Sir want fries with that? Run this 3 times using the relevant creation line each time:#include <GUIConstantsEx.au3> #include <ListboxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hList = GUICtrlCreateList("", 10, 10, 250, 100) ; run this one first ;$hList = GUICtrlCreateList("", 10, 10, 250, 100, $LBS_NOTIFY) ; run this one second ;$hList = GUICtrlCreateList("", 10, 10, 250, 100, BitOR($GUI_SS_DEFAULT_LIST , $LBS_NOTIFY)) ; run this one third GUICtrlSetData($hList, "1|2|6|4|7|3|5|8|9") ; unsorted list GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndFirst run will give you a sorted list with a scroll bar.Second run will give you an unsorted list and no scroll bar - you have overwritten the default styles by specifying $LBS_NOTIFY.Third run gives you a sorted list and a scroll bar.Clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
FinalVersion Posted February 13, 2010 Author Share Posted February 13, 2010 I tried this, but it fails. $lstProcesses = GUICtrlCreateListView("Process Name|Process ID (PID)", 8, 8, 362, 382 BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL,$LVS_SINGLESEL, $LVS_SORTASCENDING)) ERROR: GUICtrlCreateListView() [built-in] called with wrong number of args. I know the error says BitOR has to many parameters. I given it 5, you showed me 4, I believe max is 3. How do I fix this? [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
FinalVersion Posted February 14, 2010 Author Share Posted February 14, 2010 (edited) Ah didn't see your second post, anyway I tried your 3rd example, and AutoIt thinks $GUI_SS_DEFAULT_LIST and $LBS_NOTIFY are variables. I got it working with just "$LVS_SORTASCENDING" and without using BitOR, for the moment it appears to do what I want. Edited February 14, 2010 by FinalVersion [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Yoriz Posted February 14, 2010 Share Posted February 14, 2010 I tried this, but it fails. $lstProcesses = GUICtrlCreateListView("Process Name|Process ID (PID)", 8, 8, 362, 382 BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL,$LVS_SINGLESEL, $LVS_SORTASCENDING)) ERROR: GUICtrlCreateListView() [built-in] called with wrong number of args. I know the error says BitOR has to many parameters. I given it 5, you showed me 4, I believe max is 3. How do I fix this? up to 255 values can be specified to BitOR The error is a missing comma between the number 382 and BitOR. GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. 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