Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / BlueGui - Question about TabBar

Author
Message
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 8th Apr 2007 15:08
I've just got BlueGui so I could use some help with TabBars...

When I create Buttons, Textboxes, Ect, How do I attach them to a Tab?

I'm asking as there is no Example on using tabs

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Apr 2007 12:57 Edited at: 9th Apr 2007 12:58
Well, there isn't any command that does this.

The easiest way would be using a panel for each tab, layered over eachother. And storing their handles in an array.

`For example
dim TabPanel(10)

for a = 1 to 10
TabPanel(a) = createPanel(...)
next a

And then hiding or showing them using the tab number currently active.

So if the second tab would be active, you just hide every panel, and show TabPanel(2) (the commands for doing this are documented under tab and general).
By hiding the Panels, all gadgets that have this panel as a parent will be hidden along with the panel.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 4th Jul 2007 00:32
sven, sorry for bringing up a dead topic but can you explain this a bit more detailed? i have 12 tabs and they all look the same
if you could explain it a bit better i'd appreciate it!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Jul 2007 16:03 Edited at: 5th Jul 2007 22:27
Allright,

1) You create a tab gadget
2) You add all the tabs you want
3) You create as many panels as there are tabs and size them over the tab.
4) You attach all new gadgets to the panels that have a corresponding tab.
5) You hide every panel except for the active tab panel.

Or an example:



- tab numbers start from 0. Therefor you have to decrement i in "if selectedTab(hTab) = i - 1"
- I searched the correct tab position and size already. borders are 3px, and the tab buttons are 21 px high.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 4th Jul 2007 19:10 Edited at: 4th Jul 2007 19:21
Sven B, there's a new command (since 2005) that can attach a gadget (such as a panel, or even a bunch of smaller gadgets) to a specific tab:

'attachGadget tabsgadget,index,gadgetToAttach'

This will cause that gadget to be shown whenever that tab is selected.

It's still best to have a panel for each tab, though, because if a tab is switched to by the program using setTab, then a 'setGadgetVisible' is needed for each gadget attached to the tab (minor bug).

-Xol

Sam 93
17
Years of Service
User Offline
Joined: 4th Jul 2007
Location:
Posted: 4th Jul 2007 19:57
Hi, sorry I'm kind of new at this , but are you saying that you can get the specific gadget that you want to show up when you select its tab?

This is my signature...I guess
Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 4th Jul 2007 21:09 Edited at: 4th Jul 2007 21:41
Sven, may wanna hide your key m8, and ty for your response.

Edit: How would i keep adding stuff onto the Tabs though in the Visual UI Designer?

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Jul 2007 22:35
Xolatron,
I have never heard of this command
And it isn't documented either. Under special > tab commands, it says:
addTab
removeTab
changeTab
tabCount
tabCaption
selectTab
selectedTab


Though the command DOES exist and works like you say:


Thank you for telling!
And, so Sam 93, yes ^^

Xsnip3rX,

Thanks! Didn't see it.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 6th Jul 2007 02:17
Sven, i've added you to MSN, also, how do i add content to each tab like what i've got?(it would be alot clearer if you could contact me on msn lol)

Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 6th Jul 2007 15:17 Edited at: 6th Jul 2007 15:18
Yeah... I noticed it didn't have any link in the help file. Rob K added it back in 2005 when Keaz and I were working on IDEs using BlueGUI.

Xsnip3rX,
to put a specific gadget on a tab, first create the gadget as a child of the tabs gadget (using the name of the tabs gadget as the value specified in parent, usually the last parameter for creating a gadget). Then, call attachGadget:



Then add other gadgets as children of each panel.

-Xol

Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 27th Jul 2007 06:46
Xolatron, could you add me to msn? xsnip3rx@mythscape.org (im still working on this issue.)

Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 28th Jul 2007 03:18
Sorry, I don't have an msn, but I'm happy to keep discussing this here or by email (xolpublica@gmail.com)

As to your question about adding content to tabs through Rainbow (the Visual UI Designer), you can't. But MSon is working on an alternative to Rainbow called Visual DarkBasic, which includes attaching gadgets to tabs.

If you'd like an example of attachgadget working, my previous IonRay IDE thread. The source code is available here. Just click control-F and search for attachGadget to find the right place. Sorry, it's the only example I have at the momoent. I know it's sort-of large, and I hope it still compiles properly (it was written with DBp5.8 and BlueGUI 2.051).

If you have a specific question about using attachGadget, or source code to post, it would be easier to help.

-Xol

Login to post a reply

Server time is: 2024-11-22 21:28:36
Your offset time is: 2024-11-22 21:28:36