Sign in to follow this  
Followers 0
keen

Help

13 posts in this topic

How do you make a button on a gui that when you press it it will create another tab?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites



Like this:

#include <GUIConstants.au3>
#include <GuiTab.au3>
global $tabcount = 1
dim $aTabs[1]

$gui = GUICreate ( "Add Tabs GUI", 800,600,-1,-1, $WS_MAXIMIZE+$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)
$size = WinGetClientSize($gui)

$Button = GUICtrlCreateButton ("Add Tab",  10, 10, 100)

$tab=GUICtrlCreateTab (3,60, $size[0]-6,$size[1]-6-60)
GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)

addtab()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
            addtab()
    EndSelect
Wend

func addtab()   
    redim $aTabs[$tabcount]
    $aTabs[$tabcount-1] = GUICtrlCreateTabitem ("Tab "&$tabcount)
    GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)
    GUICtrlSetStyle(-1,$WS_VISIBLE)
    GUICtrlCreateTabitem (""); end tabitem definition
    $tabcount += 1
EndFunc

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

I want the text and labels the same on every tab. How do i change whats on the tab?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

Sorrybut i really need this fast.


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

I want the text and labels the same on every tab. How do i change whats on the tab?

maybe if you added a thank you... or that helped alot

you would recieve more help

but... no, you just want more without even comending lod3n

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Sorry. The code works. Its very nice thank you.

When i make a new tab it is just blank. How do i change the content on the tabs that are being created.


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

maybe...

#include <GUIConstants.au3>
#include <GuiTab.au3>
global $tabcount = 1
dim $aTabs[1]

$gui = GUICreate ( "Add Tabs GUI", 800,600,-1,-1, $WS_MAXIMIZE+$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)
$size = WinGetClientSize($gui)

$Button = GUICtrlCreateButton ("Add Tab",  10, 10, 100)

$tab=GUICtrlCreateTab (3,60, $size[0]-6,$size[1]-6-60)
GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)



addtab()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
            addtab()
    EndSelect
Wend

func addtab()   
    redim $aTabs[$tabcount]
    $aTabs[$tabcount-1] = GUICtrlCreateTabitem ("Tab_"&$tabcount)
    GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)
    GUICtrlSetStyle(-1,$WS_VISIBLE)
    Call("Tab_"&$tabcount)
    GUICtrlCreateTabitem (""); end tabitem definition
    $tabcount += 1
EndFunc

Func Tab_1()
    $Button1 = GUICtrlCreateButton ("Test #1",  200, 200, 100, 20)
    ; add other stuff
EndFunc

Func Tab_2()
    $Button2 = GUICtrlCreateButton ("Test #2",  200, 200, 100, 20)
    ; add other stuff
EndFunc

Func Tab_3()
    $label3 = GUICtrlCreateLabel ("Last Example Test #3",  200, 200, 200, 20)
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thanks but i dont need cutom stuff for every tab. It can be the same for every tab. How can i make every tab display the same stuff?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks but i dont need cutom stuff for every tab. It can be the same for every tab. How can i make every tab display the same stuff?

func addtab()   
    redim $aTabs[$tabcount]
    $aTabs[$tabcount-1] = GUICtrlCreateTabitem ("Tab_"&$tabcount)
    GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM)
    GUICtrlSetStyle(-1,$WS_VISIBLE)
    ; ********** Add Stuff *****************

    ; ********** End Add Stuff *******************
    GUICtrlCreateTabitem (""); end tabitem definition
    $tabcount += 1
EndFunc

and remove the func Tab_# above ( from the last script i wrote )

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Thanks!

EDIT: I just noticed someting. I need an embedded IE in it. Can you help me do that?

Edited by keen

[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

Sorry but i need this ASAP.


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

What are you trying to do, exactly? What is your intended final result? Are you incrementally building a new web browser via help comments on a web forum?

For creating embedded browsers controls, take a look at _IECreateEmbedded in the help file.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

Well im kinda sorta making a new browser.

I looked in the help files. And i did what they said but it wont work.


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0