Jump to content

Tab question


Recommended Posts

Hello ,

I ve finished creating one part of my programm and i want to develope it more . I ve decited to use the same exe and i want to divide theese different parts of programm into 2 Tabs . I know how to create theese tabs but i completely need to change the outlook of the gui when users clicks from Tab1 to Tab2 . Like i have a 3 buttons on 1 st tab but i want that when user clicks on 2nd tab button will dissapear and a combobox appears .

Thank you for your time

Link to comment
Share on other sites

  • Moderators

ForsakenGod,

I know how to create theese tabs

So have you run the example in the Help file under GUICtrlCreateTab? It shows you exactly how to do what you want. :(

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

ForsakenGod,

So have you run the example in the Help file under GUICtrlCreateTab? It shows you exactly how to do what you want. :(

M23

Well i m using koda the problem is that i ve 1st part already done (also in groups etc) and when i try to move it on my new tabsheet it slides under :) Also i would like to ask if its possible to modify the color of the tab sheet :)

Edited by ForsakenGod
Link to comment
Share on other sites

  • Moderators

ForsakenGod,

Just arrange your code so it looks like this:

; Create tab control
$tab = GUICtrlCreateTab(....)

    ; Create first tab
    $tab0 = GUICtrlCreateTabItem("tab0")
    ; Now all code to create the controls for this tab    

    ; Now create second tab
    $tab1 = GUICtrlCreateTabItem("tab1")
    ; Here all the code for the controls on this tab

    ; And another tab
    $tab2 = GUICtrlCreateTabItem("tab2")
    ; And again code for the controls on this tab goes here

    ; And then, very impotantly, close the tabitem definition
    GUICtrlCreateTabItem("")    ; end tabitem definition

Forget Koda for the moment, use copy and paste in SciTE to get your code like that and everything should stay in place and not "slide under". :(

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

ForsakenGod,

Just arrange your code so it looks like this:

; Create tab control
$tab = GUICtrlCreateTab(....)

    ; Create first tab
    $tab0 = GUICtrlCreateTabItem("tab0")
    ; Now all code to create the controls for this tab    

    ; Now create second tab
    $tab1 = GUICtrlCreateTabItem("tab1")
    ; Here all the code for the controls on this tab

    ; And another tab
    $tab2 = GUICtrlCreateTabItem("tab2")
    ; And again code for the controls on this tab goes here

    ; And then, very impotantly, close the tabitem definition
    GUICtrlCreateTabItem("")    ; end tabitem definition

Forget Koda for the moment, use copy and paste in SciTE to get your code like that and everything should stay in place and not "slide under". :)

M23

Thank you ! :( Worked like a charm . Any idea if its possible to modify the color of the sheet ? :)
Link to comment
Share on other sites

  • Moderators

ForsakenGod,

You cannot do it directly, bu this will let you go some way towards it: :(

#include <GuiConstantsEx.au3>
#include <GuiTab.au3>

$Gui = GUICreate("_GUICtrlTab_SetBkColor() Demo", 320, 280)

$hTab = GUICtrlCreateTab(10, 20, 300, 250)

GUICtrlCreateTabItem("Tab 1")
_GUICtrlTab_SetBkColor($Gui, $hTab, 0xFF0000)

GUICtrlCreateButton("Some Button", 20, 50)

GUICtrlCreateTabItem("Tab 2")
_GUICtrlTab_SetBkColor($Gui, $hTab, 0x00CC00)

GUICtrlCreateCheckbox("Some Checkbox", 20, 50)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor)
    Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32)

    Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1)

    GUICtrlCreateLabel("", $aTabPos[0]+2, $aTabPos[1]+$aTab_Rect[3]+4, $aTabPos[2]-6, $aTabPos[3]-$aTab_Rect[3]-7)
    GUICtrlSetBkColor(-1, $sBkColor)
    GUICtrlSetState(-1, $GUI_DISABLE)
EndFunc

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

ForsakenGod,

You cannot do it directly, bu this will let you go some way towards it: :(

#include <GuiConstantsEx.au3>
#include <GuiTab.au3>

$Gui = GUICreate("_GUICtrlTab_SetBkColor() Demo", 320, 280)

$hTab = GUICtrlCreateTab(10, 20, 300, 250)

GUICtrlCreateTabItem("Tab 1")
_GUICtrlTab_SetBkColor($Gui, $hTab, 0xFF0000)

GUICtrlCreateButton("Some Button", 20, 50)

GUICtrlCreateTabItem("Tab 2")
_GUICtrlTab_SetBkColor($Gui, $hTab, 0x00CC00)

GUICtrlCreateCheckbox("Some Checkbox", 20, 50)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor)
    Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32)

    Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1)

    GUICtrlCreateLabel("", $aTabPos[0]+2, $aTabPos[1]+$aTab_Rect[3]+4, $aTabPos[2]-6, $aTabPos[3]-$aTab_Rect[3]-7)
    GUICtrlSetBkColor(-1, $sBkColor)
    GUICtrlSetState(-1, $GUI_DISABLE)
EndFunc

M23

Thank youu ! :) Really really nice workaround :)
Link to comment
Share on other sites

  • Moderators

ForsakenGod,

Not mine - so credit to whoever posted it so I could keep it in my "Snippets" folder.

By the way, when you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. :(

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

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