Home » U++ Library support » TabCtrl » Hide tab in TabCtrl
Hide tab in TabCtrl [message #25579] |
Mon, 01 March 2010 17:42 |
|
koldo
Messages: 3357 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
Is it possible to have a hidden tab in TabCtrl ?
Best regards
Iñaki
|
|
|
|
|
|
Re: Hide tab in TabCtrl [message #25600 is a reply to message #25596] |
Wed, 03 March 2010 09:13 |
|
koldo
Messages: 3357 Registered: August 2008
|
Senior Veteran |
|
|
luzr wrote on Tue, 02 March 2010 22:20 |
koldo wrote on Tue, 02 March 2010 15:03 |
luzr wrote on Tue, 02 March 2010 19:03 | Right now, you can remove it (and reinsert later).
|
Hello Mirek
It was because some times it will be visible and sometimes it will not, but in all times I wanted to use some data inside.
|
Hm, and what is the problem?
You usually have all tabs as variables of master dialog class. Them being part of TabCtrl or not is irrelevant to the data inside.
Mirek
|
Hello Mirek
You are right, tab contents are outside TabCtrl.
The problem is that if I remove a tab, the WhenAction() functions will not know which tab has been clicked.
Could it be possible to have something like this in TabCtrl class ?:
In class Item, to know the text of a tab:
String GetText() {return text;};
In class TabCtrl, to now the id of a tab with a title:
int GetItemId(const char *title) {
for (int i = 0; i < GetCount(); ++i) {
if (GetItem(i).GetText() == title)
return i;
}
return -1;
}
Best regards
Iñaki
|
|
|
Re: Hide tab in TabCtrl [message #25601 is a reply to message #25600] |
Wed, 03 March 2010 10:03 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Well, I guess TabCtrl was lacking in this kind of operation. I think these methods might improve situation:
int Find(const Ctrl& slave) const;
void Set(Ctrl& slave);
TabCtrl::Item& Insert(Ctrl& before_slave);
TabCtrl::Item& Insert(Ctrl& before_slave, const char *text);
TabCtrl::Item& Insert(Ctrl& before_slave, const Image& m, const char *text);
TabCtrl::Item& Insert(Ctrl& before_slave, Ctrl& slave, const char *text);
TabCtrl::Item& Insert(Ctrl& before_slave, Ctrl& slave, const Image& m, const char *text);
void Remove(Ctrl& slave);
Still, maybe we should add visibility flag too (but its a bit more difficult and I do not have enough time now).
Mirek
|
|
|
Re: Hide tab in TabCtrl [message #25602 is a reply to message #25601] |
Wed, 03 March 2010 10:26 |
|
koldo
Messages: 3357 Registered: August 2008
|
Senior Veteran |
|
|
luzr wrote on Wed, 03 March 2010 10:03 | Well, I guess TabCtrl was lacking in this kind of operation. I think these methods might improve situation:
int Find(const Ctrl& slave) const;
void Set(Ctrl& slave);
TabCtrl::Item& Insert(Ctrl& before_slave);
TabCtrl::Item& Insert(Ctrl& before_slave, const char *text);
TabCtrl::Item& Insert(Ctrl& before_slave, const Image& m, const char *text);
TabCtrl::Item& Insert(Ctrl& before_slave, Ctrl& slave, const char *text);
TabCtrl::Item& Insert(Ctrl& before_slave, Ctrl& slave, const Image& m, const char *text);
void Remove(Ctrl& slave);
Still, maybe we should add visibility flag too (but its a bit more difficult and I do not have enough time now).
Mirek
|
Thank you Mirek
Tested. It runs well and it is simpler and better behaved.
With this now I do not need visibility flag .
Best regards
Iñaki
|
|
|
|
Re: Hide tab in TabCtrl [message #25606 is a reply to message #25604] |
Wed, 03 March 2010 11:56 |
chickenk
Messages: 169 Registered: May 2007 Location: Grenoble, France
|
Experienced Member |
|
|
Could this solve the situation ?
int TabCtrl::Find(const Ctrl& slave) const
{
for(int i = 0; i < tab.GetCount(); i++)
if(tab[i].slave == &slave)
return i;
return -1;
} regards,
Lionel
|
|
|
Goto Forum:
Current Time: Fri Apr 26 21:20:04 CEST 2024
Total time taken to generate the page: 0.02940 seconds
|