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 » TopWindow&PopUp, TrayIcon » Minor bug: TopWindow::GetStdSize()
Minor bug: TopWindow::GetStdSize() [message #11945] Wed, 03 October 2007 14:25 Go to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Ctrl::GetStdSize() returns GetMinSize().cx*10 (A recent change?), but TopWindow and ParentCtrl should return GetMinSize unchanged.

The addition of a SetStdSize would also be useful, but since this would require the addition of a member I will leave it to your discretion.

Also:
Image HorzFadeOut(int cx, int cy, Color color); 
(ImageOp.h)
Is missing it's body. Presumably should call HorzFadeOut(Size sz, Color color).


Cheers,
James

[Updated on: Wed, 03 October 2007 18:08]

Report message to a moderator

Re: Minor bug: TopWindow::GetStdSize() [message #11973 is a reply to message #11945] Fri, 05 October 2007 14:54 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Also... Rolling Eyes Smile

It would very helpful if ParentCtrl supported SetMinSize properly (ie. not with an empty template like other controls). Otherwise there is no way of telling how large a layout is.

struct ParentCtrl : public Ctrl {
	virtual Rect   GetVoidRect();

	ParentCtrl();
	
	virtual void SetMinSize(Size sz) { minsize = sz; }
	virtual Size GetMinSize() const  { return minsize; }
private:
	Size          minsize;
};


All of this stuff may seem somewhat trivial, but one of the things that is difficult in Upp is creating gerneric container widgets of any sort, simply because there is often no way of guessing how large a control should be in a layout.

With a few small changes this could be made much easier.

Cheers,
James

[Updated on: Fri, 05 October 2007 14:55]

Report message to a moderator

Re: Minor bug: TopWindow::GetStdSize() [message #12005 is a reply to message #11945] Sun, 07 October 2007 19:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Wed, 03 October 2007 08:25

Ctrl::GetStdSize() returns GetMinSize().cx*10 (A recent change?), but TopWindow and ParentCtrl should return GetMinSize unchanged.

The addition of a SetStdSize would also be useful, but since this would require the addition of a member I will leave it to your discretion.

Also:
Image HorzFadeOut(int cx, int cy, Color color); 
(ImageOp.h)
Is missing it's body. Presumably should call HorzFadeOut(Size sz, Color color).


Cheers,
James



Thanks, fixed.
Re: Minor bug: TopWindow::GetStdSize() [message #12006 is a reply to message #11945] Sun, 07 October 2007 19:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Wed, 03 October 2007 08:25

Ctrl::GetStdSize() returns GetMinSize().cx*10



Actually, not really recent, but stupid idea nevertheless.

I hope to be able to replace this to by simple GetMinSize() call, however I have to investigate carefuly the extent of the code that would be broken by such change...

Mirek

Re: Minor bug: TopWindow::GetStdSize() [message #12007 is a reply to message #11973] Sun, 07 October 2007 19:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Fri, 05 October 2007 08:54

Also... Rolling Eyes Smile

It would very helpful if ParentCtrl supported SetMinSize properly (ie. not with an empty template like other controls). Otherwise there is no way of telling how large a layout is.

struct ParentCtrl : public Ctrl {
	virtual Rect   GetVoidRect();

	ParentCtrl();
	
	virtual void SetMinSize(Size sz) { minsize = sz; }
	virtual Size GetMinSize() const  { return minsize; }
private:
	Size          minsize;
};


All of this stuff may seem somewhat trivial, but one of the things that is difficult in Upp is creating gerneric container widgets of any sort, simply because there is often no way of guessing how large a control should be in a layout.

With a few small changes this could be made much easier.

Cheers,
James


I am not too sure, considering that you would need this for some layout management scheme, that such attribute is really a good idea.

I believe that such size should be in fact a result of the whole layout machinery somehow. This perhaps not really different from the size of the whole dialog and I believe that sizing the dialog based on the size of its children is the point.... so perhaps something similar should be used for ParentCtrl too...
Re: Minor bug: TopWindow::GetStdSize() [message #12017 is a reply to message #12007] Mon, 08 October 2007 10:53 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
But how would this work? What you suggest (working out correct size based on children) implies some sort of additional layout logic that is not currently possible.

Personally I think SetMinSize makes perfect sense for ParentCtrl. Why should it be different from TopWindow?

You're the boss though Smile

Edit: Incidentally, the expandable container frame I have just posted (here) is the reason for the previous posts. Currently it is necessary to explicitly give the size of the ParentCtrl when adding it to the frame because there is no reliable way of guessing.

[Updated on: Mon, 08 October 2007 12:01]

Report message to a moderator

Re: Minor bug: TopWindow::GetStdSize() [message #12024 is a reply to message #12017] Mon, 08 October 2007 18:59 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Mon, 08 October 2007 04:53


Personally I think SetMinSize makes perfect sense for ParentCtrl. Why should it be different from TopWindow?



The real purpose of SetMinSize of TopWindow to limit its resizing to the size of designed layout. I guess the whole point is to avoid designed layouts here Wink

Mirek
Previous Topic: Modal vs non-modal window
Next Topic: Balloon notifications and Callbacks...
Goto Forum:
  


Current Time: Thu Mar 28 10:46:40 CET 2024

Total time taken to generate the page: 0.01164 seconds