Puckmeister Posted September 23, 2005 Share Posted September 23, 2005 hi, is it possible to make a gui with for example three buttons and when pressing tab again and again the focus only switches between button1 and button3 so that button2 never gets focus ? i don`t want to disable button2. greets, chris Link to comment Share on other sites More sharing options...
GaryFrost Posted September 23, 2005 Share Posted September 23, 2005 It would help to supply the script you have so far, so the forum user's can understand and see what you are attempting to do, otherwise it's best guess. Gary SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Puckmeister Posted September 26, 2005 Author Share Posted September 26, 2005 It would help to supply the script you have so far, so the forum user's can understand and see what you are attempting to do, otherwise it's best guess. Garyyes, i need this function for this script here Klip!and for example here is a piece of code#include <GUIConstants.au3> GUICreate("How to...", 190, 40) ; will create a dialog box that when displayed is centered Opt("GUICoordMode",2) GUICtrlCreateButton ("Button1", 10, 10, 50) GUICtrlCreateButton ("Button2", 10, -1, 50) GUICtrlCreateButton ("Button3", 10, -1, 50) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wendits just a little problem:if i press tab, right-arrow or down-arrow in this gui the focus moves from button 1 to button 2, then to button 3 and finally back to 1 where it starts over and over again.my problem is that i want to miss out a button, lets say button 2, so that when focus is on button 1 and i press tab or right- or down-arrow focus moves to button 3 and NOT to button 2.i don`t know if this is possible without Hotkeyset or _IsPressed functions but i hope someone can help megreets, chris Link to comment Share on other sites More sharing options...
quaizywabbit Posted September 26, 2005 Share Posted September 26, 2005 you'll have to unset $WS_TABSTOP from the styles of that button [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
Groumphy Posted September 27, 2005 Share Posted September 27, 2005 Hmmm ... Why not use a small "routine" [external function] : ; ; Fonction : _Enable ; Description : Active un contrôle ; Paramètres : $s_Ctrl1 est le contrôle a activer ; Dépendance : Aucunes ; Valeur retournée : Identique à GUICtrlSetState ; ==> 1 = succès ; ==> 0 = échecs ; Auteur : Groumphy ; License : GPL ; Version : v1.0.226.alpha ; Func _Enable($s_Ctrl1) Return GUICtrlSetState($s_Ctrl1, $GUI_ENABLE) If @error Then MsgBox(0 + 32, "Error", "Error occured" & @CR _ "Failed loading Func _Enable (" & $s_Ctrl1 & ")") EndFunc ; ; Fonction : _Disable ; Description : Désactive un contrôle ; Paramètres : $s_Ctrl1 est le contrôle a activer ; Dépendance : Aucunes ; Valeur retournée : Identique à GUICtrlSetState ; ==> 1 = succès ; ==> 0 = échecs ; Auteur : Groumphy ; License : GPL ; Version : v1.0.226.alpha ; Func _Disable($s_Ctrl2) Return GUICtrlSetState($s_Ctrl2, $GUI_DISABLE) If @error Then MsgBox(0 + 32, "Error", "Error occured" & @CR _ "Failed loading Func _Disable (" & $s_Ctrl2 & ")") EndFunc For sample used on a ComboBox : ; Création de l'interface utilisateur globale permettant la récolte des renseignements GUICreate(_Lng($u_Lng, "s_005"), 500, 600, -1, -1, -1, -1, -1) GUISetState (@SW_SHOW) ; Affichage de l'interface utilisateur $s_cSocLeasing = GUICtrlCreateCombo(_Lng($u_Lng, "s_021"), 185, 28, 130, 95, $CBS_DROPDOWNLIST) GUICtrlSetData($s_cSocLeasing, _Lng($u_Lng, "s_022")) GUICtrlSetTip($s_cSocLeasing, _Lng($u_Lng, "s_024")) $s_iOthLeasing = GUICtrlCreateInput(_Lng($u_Lng, "s_025"), 330, 28, 150, 20, $WS_DISABLED) GUICtrlSetTip($s_iOthLeasing, _Lng($u_Lng, "s_026")) While 1 ; Affiche l'interface utilisateur ; tant que l'évenement n'est pas fermé. Dim $s_GUI $s_GUI = GUIGetMsg() If $s_GUI = $GUI_EVENT_CLOSE Or $s_GUI = $s_smExit Then ExitLoop Select Case $s_GUI = $s_cSocLeasing If GUICtrlRead($s_cSocLeasing) = _Lng($u_Lng, "s_029") Then _Enable($s_iOthLeasing) Else _Disable($s_iOthLeasing) EndIf EndSelect Wend Is it not more easyly for you to give an external function ? It's the same on un button ... ----------------------GroumphyMore information about me [Fr] Link to comment Share on other sites More sharing options...
Puckmeister Posted September 27, 2005 Author Share Posted September 27, 2005 you'll have to unset $WS_TABSTOP from the styles of that button@quaizywabbiti thought about that, but i didn`t know how to unset a style.In the Helpfile there is no style added by default on a push-button.i added the $BS_ICON-style to display an icon on my button. it`s the only style there.is it really possible to set or unset $WS_TABSTOP on a button ?if yes, plz give me an exampleHmmm ... Why not use a small "routine" [external function] : Is it not more easyly for you to give an external function ?It's the same on un button ...@Groumphythx for this, but i don`t want to disable these buttons, i just want to ignore them while using tab Link to comment Share on other sites More sharing options...
LxP Posted September 27, 2005 Share Posted September 27, 2005 You can add a style to an already-defined set of styles like this: $myNewStyles = bitOR($myOldStyles, $styleToAdd) So you can remove a style from an already-defined set of styles like this: $myNewStyles = bitAND($myOldStyles, bitNOT($styleToRemove)) Link to comment Share on other sites More sharing options...
Puckmeister Posted September 27, 2005 Author Share Posted September 27, 2005 You can add a style to an already-defined set of styles like this: $myNewStyles = bitOR($myOldStyles, $styleToAdd) So you can remove a style from an already-defined set of styles like this: $myNewStyles = bitAND($myOldStyles, bitNOT($styleToRemove))thx for the fast answer, i tried it but it didn`t worked.i think it is because $WS_TABSTOP doesn`t work on buttons, but i didn`t know for suregreets, chris Link to comment Share on other sites More sharing options...
LxP Posted September 27, 2005 Share Posted September 27, 2005 The help file notes $WS_TABSTOP as a 'forced' style for buttons. Perhaps this is the problem? (Why is it forced?) Link to comment Share on other sites More sharing options...
GaryFrost Posted September 27, 2005 Share Posted September 27, 2005 The help file notes $WS_TABSTOP as a 'forced' style for buttons. Perhaps this is the problem?(Why is it forced?) I would think that one would be a default style not a forced style, might want to take that up with the devs, in the idea lab SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
quaizywabbit Posted September 27, 2005 Share Posted September 27, 2005 (edited) the problem might be that all of the original Style(s) might not have been entered in the first parameter:BitAnd($oldstyle, BitNot($styletoremove))and i'm not sure if guictrlsetstyle() updates the control before it returnsI've had no problems since my last revision of ANYGUI, try using _TargetStyle().....it's the last function in ANYGUI. Edited September 27, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
Puckmeister Posted September 29, 2005 Author Share Posted September 29, 2005 i don`t get it, could you please show me how to unset ws_tabstop for button 2 in the following gui quaizywabbit ?#include <GUIConstants.au3>GUICreate("How to...", 190, 40) ; will create a dialog box that when displayed is centeredOpt("GUICoordMode",2)GUICtrlCreateButton ("Button1", 10, 10, 50)GUICtrlCreateButton ("Button2", 10, -1, 50)GUICtrlCreateButton ("Button3", 10, -1, 50)GUISetState ()While 1$msg = GUIGetMsg()If $msg = $GUI_EVENT_CLOSE Then ExitLoopWendgreets, chris 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