friends Posted November 22, 2004 Share Posted November 22, 2004 Hi there. Here's the scenario: I've created 2 Tab items, where one is "Tab 1" and "Tab 2". Each of these tabs have their own input fields. Is it possible that when I click on "Tab 2", the "Tab 1" will become "Lost Focus" until task in "Tab 2" is completed ? Hope my explanation is clear. Any idea ? Please show me a simple example.... TQ Link to comment Share on other sites More sharing options...
this-is-me Posted November 22, 2004 Share Posted November 22, 2004 Do you mean disabled? Who else would I be? Link to comment Share on other sites More sharing options...
friends Posted November 22, 2004 Author Share Posted November 22, 2004 kinda... I just don't want the user able to click on "Tab 1" while they are in "Tab 2" input fields. That's it.... Link to comment Share on other sites More sharing options...
this-is-me Posted November 22, 2004 Share Posted November 22, 2004 You stumped me personally on that one. I haven't worked with tabs much yet. Who else would I be? Link to comment Share on other sites More sharing options...
CyberSlug Posted November 22, 2004 Share Posted November 22, 2004 (edited) I'll work on some Tab control wrapper functions.... Maybe something like this will work in the meantime? $GUI = GuiCreate("Example") $tab = GuiCtrlCreateTab(10, 10, 400, 200) $zero = GuiCtrlCreateTabItem("Zero") $input0 = GuiCtrlCreateInput("When you click on Tab One, you must complete it...",50, 50, 300, 20) $one = GuiCtrlCreateTabItem("One") $input1 = GuiCtrlCreateInput("",30, 50, 100, 20) $input2 = GuiCtrlCreateInput("",30, 150, 100, 20) GuiCtrlCreateTabItem("") GuiSetState() While 1 $msg = GuiGetMsg() If $msg = -3 Then Exit;GUI_EVENT_CLOSE If $msg = $tab Then $tabitem = GuiRead($tab) ;;; if user clicks on tab zero before all inputboxes on tab one are complete, then... If $tabitem = 0 And (GuiRead($input1) = "" Or GuiRead($input2) = "") Then ControlCommand($GUI,"","SysTabControl321","TabRight") EndIf EndIf WEnd Edited November 22, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
MHz Posted November 22, 2004 Share Posted November 22, 2004 All tabs are active in memory. No information or anything is lost. You can even disable buttons or even the whole gui to keep a current process running without interruption. The computer sees all the tabs, like as if they where one. Link to comment Share on other sites More sharing options...
CyberSlug Posted November 23, 2004 Share Posted November 23, 2004 http://www.autoitscript.com/fileman/users/public/CyberSlug/tabctrl.au3Note: Because the function _GuiTCM_SetCurSel(...) does not notify, it will not replace ControlCommand(..."TabRight") I haven't figured out the right way to call TCN_SELCHANGE....... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted November 23, 2004 Share Posted November 23, 2004 I don't really understand the question. Today the TCN_SELCHANGE lead to a notification thru the message pump. so the script can take action on the click the following code is workingexpandcollapse popup#include "GUIConstants.au3" ; ---------------------------------------------------------------------------- ; Script Start ; ---------------------------------------------------------------------------- ;Test script to try and get a list box information updated ;by clicking on a button GUICreate("My GUI TAB"); will create a dialog box that when displayed is centered GuiSetBkColor (0x00E0FFFF) GUISetFont(9, 300) $tab=GuiCtrlCreateTab ( 10,10, 200,100) GuiCtrlSetBkColor (-1,0x20) $tab0=GuiCtrlCreateTabitem ("tab0") GuiCtrlCreateLabel ("label0", 30,80,50,20) $tab0OK=GuiCtrlCreateButton ("OK0", 20,50,50,20) $tab0input=GuiCtrlCreateInput ("default", 80,50,70,20) $tab1=GuiCtrlCreateTabitem ("tab----1") GuiCtrlCreateLabel ("label1", 30,80,50,20) GuiCtrlSetBkColor (-1,0xff) $tab1combo=GuiCtrlCreateCombo ("", 20,50,60,40) GuiCtrlSetData (-1,"Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon $tab1OK=GuiCtrlCreateButton ("OK1", 80,50,50,20) $tab2=GuiCtrlCreateTabitem ("tab2") GuiCtrlSetState (-1,$GUI_SHOW) GuiCtrlCreateLabel ("label2", 30,80,50,20) $tab2OK=GuiCtrlCreateButton ("OK2", 140,50,50) GuiCtrlCreateTabitem ("") GuiCtrlCreateLabel ("label3", 20,130,50,20) GuiCtrlSetBkColor (-1,0xff) GuiSetState() ; Run the GUI until the dialog is closed or timeout $start=TimerInit() Do $msg = GUIGetMsg() if $msg > 0 then $start=TimerInit() if $msg= $tab then msgbox(0,"Click tab#",GuiRead($tab),2) else msgbox(0,"Click #",$msg,2) endif endif Until $msg = -3 OR TimerDiff($start)>=3000 msgbox(0,"exit #",GuiRead($tab1combo),2) Link to comment Share on other sites More sharing options...
friends Posted November 23, 2004 Author Share Posted November 23, 2004 thanks for the feedback and examples. I'll try it out... and, some of your discussion about the TAB thingy... sorry cos I don't really get it. :"> Anyway, thanks.... Link to comment Share on other sites More sharing options...
CyberSlug Posted November 23, 2004 Share Posted November 23, 2004 I don't really understand the question.Today the TCN_SELCHANGE lead to a notification thru the message pump.I wasn't being clear... sorry.I mean in an AutoIt script, if I call GuiSendMsg($ref, $TCM_SETCURSEL, $index, 0) then any controls nested on a tab control are not updated because that GuiSendMsg does not lead to a notification (it's a Win32 API feature) .....So how would I GuiSendMsg the correct notification in an AutoIt script?GuiCreate("Example") $send = GuiCtrlCreateButton("GuiSendMsg....", 10, 250, 100, 50) $tab = GuiCtrlCreateTab(10, 10, 300, 200) GuiCtrlCreateTabItem("Zero") GuiCtrlCreateButton("This button is on tab #zero", 50, 50, 200, 100) GuiCtrlCreateTabItem("One") GuiCtrlCreateButton("This button is on tab #one", 100, 100, 200, 100) GuiCtrlCreateTabItem("") GuiSetState() While 1 $msg = GuiGetMsg() If $msg = -3 Then Exit If $msg = $send Then GuiSendMsg($tab, 0x130C, 1, 0);$TCM_SETCURSEL WEnd Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted November 23, 2004 Share Posted November 23, 2004 If there is code inside AutoIt v3 that depends on TCN_SELCHANGE then you will not be able to invoke TCN_SELCHANGE due to "struct" dependability. Perhaps a ControlCommand could be changed to send the WM_NOTIFY + TCN_SELCHANGE message...Lar.<{POST_SNAPBACK}>I did a one line addition in the actual code to have the following script working.I Upload it to Jon. I put it in my upload area for testingGuiCreate("Example") $send = GuiCtrlCreateButton("GuiSendMsg....", 10, 250, 100, 50) $tab = GuiCtrlCreateTab(10, 10, 300, 200) GuiCtrlCreateTabItem("Zero") GuiCtrlCreateButton("This button is on tab #zero", 50, 50, 200, 100) $tab1=GuiCtrlCreateTabItem("One") GuiCtrlCreateButton("This button is on tab #one", 100, 100, 200, 100) GuiCtrlCreateTabItem("") GuiSetState() While 1 $msg = GuiGetMsg() If $msg = -3 Then Exit If $msg = $send Then GuiCtrlSetState($tab1,$GUI_SHOW) WEnd 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