Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TabCtrl » TabCtrl and layouts
TabCtrl and layouts [message #8102] Thu, 08 February 2007 01:27 Go to next message
MikeyV is currently offline  MikeyV
Messages: 20
Registered: February 2007
Promising Member
Hello again.

Let me show you my code first, and then I'll tell you my problem.

In SATSII.h
---------------
class Sats : public WithSatsLayout<TopWindow> {
	WithISTAddLayout<ParentCtrl> ISTAdd;
	WithOpsAreaUpdLayout<ParentCtrl> OpsAreaUpd;
---------------------------

In main.cpp
---------------------------
void Sats::DoSm() {
	tab.Reset();
	CtrlLayout(ISTAdd);
	tab.Add(ISTAdd, "Add Soldier");
}

void Sats::DoOps() {
	tab.Reset();
	CtrlLayout(OpsAreaUpd);
	tab.Add(OpsAreaUpd, "Area Update");
}
---------------------------


This works sortof how I expected it to as in the tabs are cleared and renamed, and the new layout is loaded. However, the layouts just appear one on top of the other.

How do I clear the layout so the new layout is the only one showing?
Re: TabCtrl and layouts [message #8103 is a reply to message #8102] Thu, 08 February 2007 05:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13990
Registered: November 2005
Ultimate Member
Please send a compilable testcase (zip a package that we can compile and run to see the problem).

Mirek
Re: TabCtrl and layouts [message #8104 is a reply to message #8103] Thu, 08 February 2007 05:27 Go to previous messageGo to next message
MikeyV is currently offline  MikeyV
Messages: 20
Registered: February 2007
Promising Member
Ok...here it is. The only two working buttons are the IST/ISR and Operations buttons. Click them each to see what I mean.

  • Attachment: Sats2.zip
    (Size: 2.39KB, Downloaded 528 times)
Re: TabCtrl and layouts [message #8109 is a reply to message #8104] Thu, 08 February 2007 20:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13990
Registered: November 2005
Ultimate Member
MikeyV wrote on Wed, 07 February 2007 23:27

Ok...here it is. The only two working buttons are the IST/ISR and Operations buttons. Click them each to see what I mean.




Thank you. Identified as bug in TabCtrl code. Will be fixed in next release, or you can use

Quick fix CtrlLib/TabCtrl.cpp 407

void TabCtrl::Reset()
{
	for(int i = 0; i < tab.GetCount(); i++) {
		if(tab[i].ctrl)
			tab[i].ctrl->Remove();
		if(tab[i].slave)
			tab[i].slave->Remove();
	}
	tab.Clear();
	x0 = 0;
	CancelMode();
	sel = -1;
	Refresh();
	accept_current = false;
}


I apologize for troubles.

Mirek
Re: TabCtrl and layouts [message #8110 is a reply to message #8109] Thu, 08 February 2007 21:31 Go to previous message
MikeyV is currently offline  MikeyV
Messages: 20
Registered: February 2007
Promising Member
Yay! I found a bug and wasn't even trying. Very Happy Thank you for the quick feedback, I will make changes to TabCtrl.cpp now.

Thanks again.

Edit: Ok, made the changes, and now it works as expected. Thanks so much.

[Updated on: Thu, 08 February 2007 21:41]

Report message to a moderator

Previous Topic: Removing tabs from TabDlg?
Next Topic: [BUG - FIXED] TabDlg crashes the application
Goto Forum:
  


Current Time: Wed Jul 17 17:36:23 CEST 2024

Total time taken to generate the page: 0.02463 seconds