Home » Community » Newbie corner » Control with fixed rate Height/Width
Re: Control with fixed rate Height/Width [message #32595 is a reply to message #32594] |
Thu, 26 May 2011 13:31   |
 |
koldo
Messages: 3443 Registered: August 2008
|
Senior Veteran |
|
|
Hello Jibe
As far as I know there are no .usc document.
However I was not completely right about Layout Designer. See this code. It is a little bit overcomplex for this example, but it is rather easy
ctrl StaticRectangle {
group "Static";
GetMinSize() { return Size(0, 0); }
GetStdSize() { return Size(64, 24); }
bool IsSquare = false;
int SetWidth = 1;
Color SetColor = :SBlack;
Color SetBackground = Null;
Paint(w) {
r = GetRect();
width = r.right - r.left;
if (.IsSquare)
height = r.right - r.left;
else
height = r.bottom - r.top;
w.DrawRect(r.left, r.top, width, height, .SetBackground);
w.DrawRect(r.left, r.top, width, .SetWidth, .SetColor);
w.DrawRect(r.right - .SetWidth, r.top, .SetWidth, height, .SetColor);
w.DrawRect(r.left, r.top + height - .SetWidth, width, .SetWidth, .SetColor);
w.DrawRect(r.left, r.top, .SetWidth, height, .SetColor);
}
}
If the programmer chooses IsSquare = true in Layout Designer, s/he will obtain these possibilities:

As you can see, Layout Designeer does not let you draw outside Control boundaries.
-
Attachment: dib.PNG
(Size: 2.73KB, Downloaded 681 times)
Best regards
IƱaki
|
|
|
Goto Forum:
Current Time: Sun Aug 24 06:59:57 CEST 2025
Total time taken to generate the page: 0.06990 seconds
|