t0nZ Posted November 19, 2010 Share Posted November 19, 2010 I am developing a program with a gui with a tab .The tab has 4 items Now I have conducted various test with the tab functions from the UDF (#include <GuiTab.au3>) versus the native tab functionsIn these tabs I have to run some listviews, and in this case too the question is native functions or UDF functions ?But my first question is: Why using _GUICtrlTab_Create & _GUICtrlTab_InsertItem there is no method to show an item (button - listview - imputbox...) ONLY on a selected tab ?Yes I know the GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") but it is not simple to manage a lot of objects on various tables...The solution of this post is viable only for a very small number of controls and/or tabs : In the example the test button is visible on all the three tabs...#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) $Debug_TAB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Global $hTab,$testbutton _Main() Func _Main() Local $hGUI ; Create GUI $hGUI = GUICreate("(UDF Created) Tab Control Create", 400, 300) $hTab = _GUICtrlTab_Create($hGUI, 2, 2, 396, 296) GUISetState() ; Add tabs _GUICtrlTab_InsertItem($hTab, 0, "Tab 1") $testbutton = GUICtrlCreateButton("test", 30, 30, 50, 50) ; TEST BUTTON visible on every tab... _GUICtrlTab_InsertItem($hTab, 1, "Tab 2") _GUICtrlTab_InsertItem($hTab, 2, "Tab 3") ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_MainSo for me if there isn't other methods to control the visualization of the button the tab UDF is useless !Thanks for the advices.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2010 Moderators Share Posted November 19, 2010 t0nZ,Read the Tabs tutorial in the Wiki - it shows how to manage the controls on UDF created tabs. Unfortunately it is a bit complicated, as you will see. If you can use the native AutoIt tab control I would strongly recommend doing so - it makes life much easier. 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...
t0nZ Posted November 22, 2010 Author Share Posted November 22, 2010 Ok Melba23, I have read the wiki and I understand that native functions are waaaay more friendly.I was writing a gui for manage a sqllite DB for an helpdesk, it looks like this:You can see the first arrow, there is a field and the press of return cause the load of the (search) list.After the user has to select and item and click on the button "trovato" (second arrow).This cause a change of tab and the load of various informationBut after the first time the return on the input field "works" also like a click on the second button .....I try to change the focus on other elements of the gui but with ambiguous behaviours...I think is a problem of mix of native and udf functions.I create tabs with native functions but I select these with _GUICtrlTab_ClickTab, for example.Now I have resolved .. . workarounded by removing the button and using in all my listviews the GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") method, for a simpler double clik on the item.Thanks for the advices. file:///C:/Users/N9D5F%7E1.TON/AppData/Local/Temp/moz-screenshot.pngfile:///C:/TEMP/Cattura.JPG 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