Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » TabCtrl » Tabs with same layout but different "threads"
Tabs with same layout but different "threads" [message #33846] Sun, 18 September 2011 20:03 Go to next message
r1kon is currently offline  r1kon
Messages: 7
Registered: January 2011
Promising Member
Hey guys,

Quick question. I am making an app that has a TabCtrl as the main way that it shows information. The best way to think about how this app works is to think of an IRC (chat) client.

The tabs are all themselves using the same type of layout. However, the amount of tabs is noted by what "chat rooms" the person has joined.

So, I basically need one "tab" per chat room. Each "tab" uses the exact same layout, except each tab will have different content (the chat room messages from each room).

I have used, and know how to use, tabs. Problem is, the way that I use them basically "ties" each layout to that specific identifier.

Say my layout is named "myLayout", so it would look like so (in my header):

WithtabLayout<ParentCtrl> newTabLayout;

Then, in my cpp file (my tab control is named "tabs"):

tabs.Add(newTabLayout,"Chat Room #1");

And this works fine. However, when a new chat room is joined and I create a new tab with the newTabLayout, each of the tabs are "linked" since I am using the same layout (changes on one will change all of the tabs).

Is there any way I can create a new tab, with the same layout, but "separated" from the other tabs so when I make changes to one (set a label or something) it doesn't change on all of the tabs?

I really hope this makes sense...and thank you guys so much for helping me out!

Re: Tabs with same layout but different "threads" [message #33849 is a reply to message #33846] Mon, 19 September 2011 09:27 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Kevin

IIRC you can use
Array< WithtabLayout<ParentCtrl> > tabs;
Then whenever you need to add tab just Add() a new item to the tabs array. The same goes for removing tabs - after removing the tab from TabCtrl, it should be safe to call Remove() on the array.

Best regards,
Previous Topic: How do i create tabs??
Next Topic: How to change Tab name
Goto Forum:

Current Time: Fri Jun 21 03:11:39 CEST 2024

Total time taken to generate the page: 0.02329 seconds