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 » microscopic button in a toolbar with GetMinSize()?
microscopic button in a toolbar with GetMinSize()? [message #549] Mon, 09 January 2006 02:50 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I wanted to place a Button on a Toolbar but it is microscopic.
Is this normal?
//this doesn't help	bar.Add(btn_run.SetLabel("Run"), btn_run.GetMinSize() );
//but this works:
	bar.Add(btn_run.SetLabel("Run"), btn_run.AddFrameSize(50,20) );

But what if I want to change its size (y) depending on Label's text length?

And what is then supposed by MinSize?

P.S. I'll have a look at the sources, but if you know and have time... Smile

[Updated on: Mon, 09 January 2006 03:09]

Report message to a moderator

Re: microscopic button in a toolbar with GetMinSize()? [message #552 is a reply to message #549] Mon, 09 January 2006 04:47 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
this works:
...
	if(bar.IsToolBar()) {
		bar.Add(btn_run.SetLabel("Run"), btn_run.AddFrameSize(30,20));

	}


but I also would like this logic to work:
...
	if(bar.IsToolBar()) {
		bar.Add(btn_run.SetLabel("Run"), btn_run.AddFrameSize(30,20))
		.Key(K_CTRL_R)
		.Help("Run your something");

	}
Re: microscopic button in a toolbar with GetMinSize()? [message #556 is a reply to message #552] Mon, 09 January 2006 09:45 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
GetMinSize is defined as the minimal reasonable size of a specific Ctrl and does not need to be defined for each one. It is not defined for Button (should it be?), as such use is not typical.

AddFrameSize adds the size of Ctrl's frame to the specified size of Ctrl's view. Not much use for Button, but possible solution.

button.AddFrameSize(20, 50) is likely equivalent of Size(20, 50), unless you do some Frame magic with the Button (normally, Button has single NullFrame).
Next Topic: Menu callbacks
Goto Forum:
  


Current Time: Thu Mar 28 09:56:33 CET 2024

Total time taken to generate the page: 0.00886 seconds