Jump to content

Tabbing through defined GUICtrls


Lorenzen
 Share

Recommended Posts

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

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 9 months later...

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 by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

  • Moderators

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. :x

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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. :x

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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. :x

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...