Home » U++ Library support » StatusBar&InfoCtrl » howto add more InfoCtrl's to StatusBar?
Re: howto add more InfoCtrl's to StatusBar? [message #275 is a reply to message #233] |
Mon, 05 December 2005 22:51 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
I have to apologize... this time you understood my code better than me "Set" is further level of division, you are really supposed to use AddFrame to add more "fields".
I have created this nice reference example to demonstrate StatusBar:
#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();
}
Once again, sorry for misinformation, last time I visited StatusBar was two years ago and never used it above simple assigning text to it....
|
|
|
|
|
howto add more InfoCtrl's to StatusBar?
By: fudadmin on Sat, 03 December 2005 18:29
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: fudadmin on Sun, 04 December 2005 18:11
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 18:28
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 18:29
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: fudadmin on Sun, 04 December 2005 22:41
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 23:07
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Mon, 05 December 2005 22:51
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: digodigo on Thu, 29 November 2007 15:29
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Tue, 26 February 2008 21:03
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 18:25
|
Goto Forum:
Current Time: Fri Nov 01 01:36:09 CET 2024
Total time taken to generate the page: 0.04647 seconds
|