Page 1 of 1

Small Widgets Size in LayoutEditor

Posted: Tue Oct 24, 2006 14:40
by kintaro
Hi, I am developing a skin for my project and a have to deal with small buttons sizes.

I noticed that in CEGUI Layout Editor when I resize some widget, there is a minimum size, and the only way to reduce even more is setting scale, like "Bottom Scale", but when I do that, I can move anymore the widget with mouse.

So the feature request is that CEGUI Layout Editor could resize the widget to any size with mouse pointer and it could move the widget indenpendent of size it has.

I am using CEGUI Layout Editor 0.5 RC2.


Posted: Sun Oct 29, 2006 07:30
by Dalfy
I move the topic to the tool forum which is best suited for your request

Posted: Sun Oct 29, 2006 10:43
by scriptkid
Hi kintaro,

removing that limitations shouldn't be a problem. The reason they're in-place, is more a matter of convenience, so you cannot accidently 'hide' your widgets for example ;-)

I'll have a look, thanks for the suggestion :-)

Posted: Sun Dec 03, 2006 11:35
by scriptkid
For the record: this has been added to mantis:

Posted: Mon Apr 23, 2007 13:30
by Colbey
I'm trying to alter the CEGUI Layout editor code to tweak the default minimum widget size, and also prevent the window sizing area from being disabled after manually entering a size in the property sheet.

Could someone explain exactly where I can set/manipulate these settings within the code? I can't seem to trace where these settings are defined.....


Posted: Tue Apr 24, 2007 10:08
by scriptkid

tweaking min- and max widget sizes can be done in this method:

Code: Select all

void SelectionMover::UpdateWindowAreas

Search for the line:

Code: Select all

// Avoid negative widths and heights

There you could tweak (in pixels) that if-statement to only allow larger sizes for example.

As you can see in that method too, it will deny 'locked' widgets. Locking was added to prevent editing of widgets which are calculated by their parent, such as menu items and tab controls. However you could add some logic to this method:

Code: Select all

bool EditorDocument::SetProperty
, such as a parameter which defines whether the touched widget should become locked from now on.

Good luck! :)

Posted: Tue Apr 24, 2007 11:22
by Colbey
Thanks for that info, I found this section of code and edited it to achieve what I wanted, however I had to change the call

Code: Select all


Code: Select all


as the returned pixel area was incorrect, do you know what would be affecting the result returned from this function?