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 » Community » Newbie corner » Control with fixed rate Height/Width
Re: Control with fixed rate Height/Width [message #32587 is a reply to message #32519] Thu, 26 May 2011 10:19 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
*.usc files are the U++ own ESC language files (go to manual for it), they serve TheIDE as a description how to show custom (or builtin) Ctrl's in Layout editor.

to achieve your goal, you need to derive the desired class overriding the Layout() function from Ctrl and specifying new size of the control based on lets say the x size.

maybe sth like that.
class MyEdit : public EditString
{
    virtual void Layout()
    {
         Rect r = GetRect();
         r.y = 0.5*x;
         SetRect(r);         
    }
};


what kolde meant is, that Layout editor wont be aware of your custom Layout function, in case you place your widget as a user class Ctrl on a layout. so it will be arbitrary resizeable in Layout Editor but will behave accordingly at runtime.

BTW: SetRect always Sets your Ctrl LogPos as to be LeftPos().TopPos() aligned. if you want sth more specific, you need to dig the LogPos facilities. see my LogPosCtrl package, there you will find some ressources on how to handle LogPos properly recalculating it based on alignment and Rect position.

[Updated on: Thu, 26 May 2011 10:22]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] I have a problem linking a LIB
Next Topic: How to internet enable a serial device
Goto Forum:
  


Current Time: Sun Jun 09 21:26:31 CEST 2024

Total time taken to generate the page: 0.01900 seconds