Home » U++ Library support » StatusBar&InfoCtrl » add StatusBar fields [EXAMPLE]
Re: add StatusBar fields [message #280 is a reply to message #279] |
Mon, 05 December 2005 23:06   |
 |
mirek
Messages: 14258 Registered: November 2005
|
Ultimate Member |
|
|
I am really sorry, but I have misinformed you this time. You are right, I was wrong. You are really supposed to do this this way.
I have posted reference example I have just finished in another topic, anyway it will not hurt to repost it here, in snippets section:
#include <CtrlLib/CtrlLib.h>
struct PosDisplay : Display {
Color color;
virtual void Paint(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword style) const {
int i = q;
w.DrawRect(0, 0, i, r.Height(), color);
w.DrawRect(i, 0, r.Width() - i, r.Height(), SWhite);
}
};
struct App : TopWindow {
StatusBar status;
InfoCtrl pos;
InfoCtrl x, y;
PosDisplay dx, dy;
virtual void MouseMove(Point p, dword)
{
pos.Set(0, AsString(p.x), 40);
pos.Set(1, AsString(p.y), 40);
x.Set(PaintRect(dx, 100 * p.x / GetSize().cx));
y.Set(PaintRect(dy, 100 * p.y / GetSize().cy));
}
virtual void LeftDown(Point, dword)
{
status.Temporary("Left mouse button pressed!");
}
App() {
Sizeable();
SetFrame(FieldFrame());
AddFrame(status);
status.AddFrame(pos.Right(100));
status.AddFrame(x.Left(100));
status.AddFrame(y.Left(100));
dx.color = LtRed;
dy.color = LtGreen;
}
};
GUI_APP_MAIN
{
App().Run();
}
|
|
|
 |
|
add StatusBar fields [EXAMPLE]
By: fudadmin on Mon, 05 December 2005 13:34
|
 |
|
Re: add StatusBar fields
By: mirek on Mon, 05 December 2005 15:01
|
 |
|
Re: add StatusBar fields
By: fudadmin on Mon, 05 December 2005 15:21
|
 |
|
Re: add StatusBar fields
By: fudadmin on Mon, 05 December 2005 22:56
|
 |
|
Re: add StatusBar fields
By: mirek on Mon, 05 December 2005 23:06
|
 |
|
Re: add StatusBar fields
By: fudadmin on Wed, 07 December 2005 12:34
|
 |
|
Re: add StatusBar fields
By: barpas on Sat, 25 March 2006 22:37
|
 |
|
Re: add StatusBar fields
By: mirek on Sat, 25 March 2006 23:11
|
 |
|
Re: add StatusBar fields
By: barpas on Sun, 26 March 2006 00:09
|
 |
|
Re: add StatusBar fields
By: mirek on Sun, 26 March 2006 10:46
|
Goto Forum:
Current Time: Tue May 13 20:34:04 CEST 2025
Total time taken to generate the page: 0.02959 seconds
|