Jump to content

Tabs


MrVitar
 Share

Recommended Posts

(as some of you may know) Iam working on a poltergeisting program; and i would like to add tabs to reduce the size of the already being built GUI. How would this be possible? I would love to have some help on this. Or atleast some sort of tips and pointers on how to get a good start on this.

I have swept over the wiki and couldnt find a immediate answer that would help with this.

Link to comment
Share on other sites

here's an example streight out of the help section... (_GUICtrlTabSetCurSel.au3)

you can find an example of almost everything there.

C:\Program Files\AutoIt3\Examples\Helpfile

hope it helps a bit.

#include <GUIConstants.au3>
#include <GuiTab.au3>

opt('MustDeclareVars', 1)

Dim $tab, $tab0, $tab0OK, $tab0input, $tab1, $tab1combo, $tab1OK, $tab2, $tab2OK, $tab3, $tab4
Dim $msg, $Status, $current, $button, $item = 0

GUICreate("Tab Set Current Selection", 300, 200) ; will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 200, 100, $TCS_MULTILINE)

$tab0 = GUICtrlCreateTabItem("tab0")
GUICtrlCreateLabel("label0", 30, 80, 50, 20)
$tab0OK = GUICtrlCreateButton("OK0", 20, 60, 50, 20)
$tab0input = GUICtrlCreateInput("default", 80, 60, 70, 20)
GUICtrlCreateTabItem(""); end tabitem definition

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label1", 30, 80, 50, 20)
$tab1combo = GUICtrlCreateCombo("", 20, 60, 60, 40)
GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
$tab1OK = GUICtrlCreateButton("OK1", 80, 60, 50, 20)
GUICtrlCreateTabItem(""); end tabitem definition

$tab2 = GUICtrlCreateTabItem("tab2")
GUICtrlSetState(-1, $GUI_SHOW); will be display first
GUICtrlCreateLabel("label2", 30, 80, 50, 20)
$tab2OK = GUICtrlCreateButton("OK2", 140, 60, 50)
GUICtrlCreateTabItem(""); end tabitem definition

$tab3 = GUICtrlCreateTabItem("tab3")
GUICtrlCreateTabItem(""); end tabitem definition

$tab4 = GUICtrlCreateTabItem("tab4")
GUICtrlCreateTabItem(""); end tabitem definition

GUICtrlCreateLabel("label3", 20, 130, 50, 20)
$button = GUICtrlCreateButton("Set", 200, 130, 90, 30)

$Status = GUICtrlCreateLabel("", 0, 180, 300, 20, BitOR($SS_SUNKEN, $SS_CENTER))

GUISetState()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $button
            _GUICtrlTabSetCurSel ($tab, $item)
            $item = Not $item
    EndSelect
WEnd

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

Link to comment
Share on other sites

(as some of you may know) Iam working on a poltergeisting program; and i would like to add tabs to reduce the size of the already being built GUI. How would this be possible? I would love to have some help on this. Or atleast some sort of tips and pointers on how to get a good start on this.

I have swept over the wiki and couldnt find a immediate answer that would help with this.

Look in the help file, it's in there.

EDIT: You were quicker than me, lol.

Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

hello Cyanidemonkey,

2 errors in your script :

you've forgotten

#include <StaticConstants.au3>

you've written

_GUICtrlTabSetCurSel instead of _GUICtrlTab_SetCurSel

not my script brother, see first line of my post above.

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

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