Jump to content

Simple Tab question


Recommended Posts

I am looking to have a tab control with no buttons, and no tabs sticking out. I know there has to be a control to handle this, I just don't know what it is. The reason behind this is, in my full GUI, I have an image BG which hides the tab buttons, and so I want to make my own buttons to control the tabs...

here is an example I made and have been playing with:

#include <GUIConstantsEx.au3>
#include <GuiTab.au3>


global $muhval = 0
    GUICreate("My GUI Tab", 450, 350)
    $butt = Guictrlcreatebutton("SET",10,10,50,20)
    $skroll = Guictrlcreatebutton("skroll",10,30,50,20)
    $bup = Guictrlcreatebutton("up",200,40,50,20)
    $bdown = Guictrlcreatebutton("down",200,70,50,20)
    $inp = Guictrlcreateinput("0x0000",70,10, 209, 28)
    $tab = GUICtrlCreateTab(100, 100, 200, 100)
    $tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    $tab1 = GUICtrlCreateTabItem("tab1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    GUISetState()
    
    ;_GUICtrlTab_SetCurFocus($tab, 1)
    ;_GUICtrlTab_SetCurSel($tab, 1)
        
    While 1
       Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $butt
            change()
            Case $skroll
            skroll()
            case $bup
            up()
            case $bdown
            down()
                        
        endswitch
    WEnd
func change()
Guictrlsetstyle($tab, guictrlread($inp))
guictrlsetdata($skroll, guictrlread($inp))
endfunc


func skroll()


do
$MuhVal +=1
$blah  = 0x & $muhval
Guictrlsetstyle($tab, $blah)
guictrlsetdata($skroll, $blah)
sleep(100)
until $MuhVal = 9999


endfunc


func up()
$MuhVal +=1
$blah  = 0x & $muhval
Guictrlsetstyle($tab, $blah)
guictrlsetdata($skroll, $blah)
endfunc

Func down()
$MuhVal -=1
$blah  = 0x & $muhval
Guictrlsetstyle($tab, $blah)
guictrlsetdata($skroll, $blah)
endfunc

Thanks!!

C0d3 is P0etry( ͡° ͜ʖ ͡°)

Link to comment
Share on other sites

  • Moderators

Kovacic,

I would suggest using child GUIs which you hide/show as required. :)

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

Kovacic,

I would suggest using child GUIs which you hide/show as required. :)

M23

 

I did that with my last inventory app, but this time I was kind of hoping to keep it simple, also I already have so many controls on each tab exactly where I want them. The only other option would be to put a group, or some other clear control overtop the tab buttons, or move the tab control to the top and let the buttons sit off screen. Good call on the multi GUIs though.. My inventory app worked well and looked awesome using multiple GUIs. 

C0d3 is P0etry( ͡° ͜ʖ ͡°)

Link to comment
Share on other sites

  • Moderators

Kovacic,

You might be able to do something with an owner-drawn tab control - funkey has one here. Or perhaps you could use my GUIExtender UDF (the link is in my sig) which allows you to open and close sections of a GUI. ;)

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

Kovacic,

You might be able to do something with an owner-drawn tab control - funkey has one here. Or perhaps you could use my GUIExtender UDF (the link is in my sig) which allows you to open and close sections of a GUI. ;)

M23

 

That pretty darn cool actually, somewhat reminiscent of what you might see with a .NET app!  I am most deff saving that... What I ended up doing was moving the tab control up to bring it off the screen slightly, then just made the buttons... It turned out nice and was fairly easy, each button turns a slight color while the tab is active.

C0d3 is P0etry( ͡° ͜ʖ ͡°)

Link to comment
Share on other sites

  • Moderators

Kovacic,

Glad you like the UDF. :)

M23

P.S. If you were referring to funkey's excellent code, then please do not reply and let me keep my illusions. ;)

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

×
×
  • Create New...