Lorenzen Posted March 15, 2010 Share Posted March 15, 2010 Hi I've been writing autoIt for some years now, and have created several larger code-solutions - i love autoIt. However I've encountered a problem lately when using GUI features. I cannot choose what ctrls to tab through. It seems that the tabbing goes through labels aswell as buttons and inputboxen. Can anybody help me? (im leaving work now - ill be back in 16 hours or so) thx Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 15, 2010 Moderators Share Posted March 15, 2010 Lorenzen, Welcome to the AutoIt forum. I do not get tabstops on labels, only on controls where the $WS_TABSTOP style is applied (like buttons and inputs) - as you can see from the script below. But if you want to remove a control from the TABSTOP list, you can do it like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("One", 10, 10, 50, 20) GUICtrlCreateLabel("Two", 10, 30, 50, 20) GUICtrlCreateLabel("Three", 10, 50, 50, 20) GUICtrlCreateButton("One", 10, 100, 80, 30) GUICtrlCreateButton("Two", 10, 140, 80, 30) _WinAPI_SetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE, BitAND(_WinAPI_GetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE), BitNOT($WS_TABSTOP))) GUICtrlCreateButton("Three", 10, 180, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Not the easiest syntax, but quite understandable, I hope! 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...
Lorenzen Posted March 16, 2010 Author Share Posted March 16, 2010 Thank you for ur reply - it helped me sort out what was wrong (debugging). The problem was my code - my project has 2000+ code lines, and a few inwanted controls had snuck into the code :/ Thx again Melba Link to comment Share on other sites More sharing options...
jennico Posted December 31, 2010 Share Posted December 31, 2010 (edited) well, there's an easier and more understandable way to get rid of the "forced styles" : GUICtrlSetStyle. don't forget to add the styles you need, because otherwise you will lose notification and other necessary things, so look it up in helpfile. some examples: ;Example For Button ;================== GUICtrlCreateButton(.......) GUICtrlSetStyle(-1,$BS_NOTIFY) ;Example for Icon ;================ GUICtrlCreateIcon(........) GUICtrlSetStyle(-1,BitOR($SS_NOTIFY,$SS_ICON)) ;Example for Checkbox ;==================== GUICtrlCreateCheckbox(........) GUICtrlSetStyle(-1,$BS_AUTOCHECKBOX) cheers j. Edited December 31, 2010 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 31, 2010 Moderators Share Posted December 31, 2010 jennico,The advantage of my "long and complicated" code is that you do not need to know which styles have been applied previously - the code detects the currently set styles and just subtracts the $WS_TABSTOP. 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...
Mat Posted December 31, 2010 Share Posted December 31, 2010 You could combine them: GUICtrlSetStyle(-1, BitAND(_WinAPI_GetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE), BitNOT($WS_TABSTOP))) AutoIt Project Listing Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 31, 2010 Moderators Share Posted December 31, 2010 Mat, If I were a betting man, I would put a fair sum on your code being transformed into mine by the interpreter when it runs. 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...
jennico Posted December 31, 2010 Share Posted December 31, 2010 the advantage is, for self-autoit-made controls, that there is no need to detect the style, because you can look it up in helpfile. the "long and complicated" way (not my words) is well suitable for "alien" windows. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 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