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 » Menus&Toolbars » ToolBar as Ctrl not as Frame [BUG?]
icon5.gif  ToolBar as Ctrl not as Frame [BUG?] [message #6027] Sat, 28 October 2006 22:41 Go to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Is it possible to use a Toolbar as Ctrl and not as Frame?

I have two toolbars in my app - one as Frame working with no Problems and one as Ctrl, resized by TopWindow::Layout function and hidden and shown, too.

But the only thing i see is the BlackFrame() i gave it to check wether the second toolbar is there.

everything is drawn well if i change the line "Add(toolbar);" to "AddFrame(toolbar);"

Any Hints?

thanks,
Bas
Re: ToolBar as Ctrl not as Frame [BUG?] [message #6028 is a reply to message #6027] Sat, 28 October 2006 23:38 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Found the Problem:

you need to refresh the layout because then the toolbar will be drawn - this is automagically called when the toolbar is used as Frame.

Why isn't Layout called when added to a Ctrl or when Repositioned (SetPos)?

is there a nicer solution instead of calling either RefreshLayoutDeep() or toolbar.RefreshLayout() ?

A solution could be to add RefreshLayout in the function ParentChanged(), or wouldn't that help?

Bas
Re: ToolBar as Ctrl not as Frame [BUG?] [message #6031 is a reply to message #6028] Sun, 29 October 2006 04:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
Well, looks like a bug (perhaps nobody tried toolbar as Ctrl yet). Can you post a simple test package?

Mirek
Re: ToolBar as Ctrl not as Frame [BUG?] [message #6042 is a reply to message #6031] Sun, 29 October 2006 07:57 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
sure, Mirek (hope you don't mind if I call you by your name?)

here it is

Bas
Re: ToolBar as Ctrl not as Frame [BUG?] [message #6066 is a reply to message #6042] Sun, 29 October 2006 20:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
Well, this way of adding items works only for (popup) menu. ToolBar needs to be Set:

void ToolBarAsCtrl::MyBar(Bar& tb)
{
	tb.Add("Test",ToolBarImg::heart(),THISBACK(DoNothing));
}

ToolBarAsCtrl::ToolBarAsCtrl()
{
	CtrlLayout(*this, "Window title");
	tb.SetRect(10,10,200,50);
	Add(tb);
	tb.Set(THISBACK(MyBar));
	//in 3 seconds you will see the button
//	SetTimeCallback(3000,THISBACK(ShowToolBarButtons));
}


(hopefully, I am finishing Bar docs right now...)

Mirek
Re: ToolBar as Ctrl not as Frame [BUG?] [message #6075 is a reply to message #6066] Sun, 29 October 2006 22:27 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
thanks for your fast answer, Mirek
good work! Cool

Bas
Previous Topic: How to disable focusing menu using TAB key
Next Topic: update state of a toolbar icon
Goto Forum:
  


Current Time: Wed Sep 22 04:00:55 CEST 2021

Total time taken to generate the page: 0.01549 seconds