Jump to content

_GUICtrlTab_Create & _GUICtrlTab_InsertItem


t0nZ
 Share

Recommended Posts

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 functions

In 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   ;==>_Main

So 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

  • Moderators

t0nZ,

Read the Tabs tutorial in the Wiki - it shows how to manage the controls on UDF created tabs. :graduated:

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

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

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:

post-43241-0-13942200-1290442932_thumb.j

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 information

But 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. :graduated:

file:///C:/Users/N9D5F%7E1.TON/AppData/Local/Temp/moz-screenshot.png

file:///C:/TEMP/Cattura.JPG

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