mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
.reference: RectTracker now demostrates rounding too
git-svn-id: svn://ultimatepp.org/upp/trunk@4687 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ba16e5f2c4
commit
b4893a4f4e
1 changed files with 11 additions and 1 deletions
|
|
@ -5,6 +5,15 @@ using namespace Upp;
|
|||
struct MyApp : TopWindow {
|
||||
Rect rect;
|
||||
int hline, vline;
|
||||
|
||||
typedef MyApp CLASSNAME;
|
||||
|
||||
void Round(Rect& r)
|
||||
{
|
||||
int cx = r.GetWidth();
|
||||
r.left = r.left / 10 * 10;
|
||||
r.right = r.left + cx;
|
||||
}
|
||||
|
||||
virtual void Paint(Draw& w)
|
||||
{
|
||||
|
|
@ -20,6 +29,7 @@ struct MyApp : TopWindow {
|
|||
Size sz = GetSize();
|
||||
if(keyflags & K_ALT) {
|
||||
tr.Dashed().Animation();
|
||||
tr.round = THISBACK(Round);
|
||||
rect = tr.Track(rect, ALIGN_CENTER, ALIGN_CENTER);
|
||||
}
|
||||
else
|
||||
|
|
@ -33,7 +43,7 @@ struct MyApp : TopWindow {
|
|||
vline = tr.TrackVertLine(0, 0, sz.cy, vline);
|
||||
}
|
||||
else {
|
||||
tr.Dashed().Animation();
|
||||
tr.Normal();
|
||||
rect = tr.Track(rect, ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||
}
|
||||
Refresh();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue