Home » U++ Library support » StatusBar&InfoCtrl » add StatusBar fields [EXAMPLE]
add StatusBar fields [EXAMPLE] [message #255] |
Mon, 05 December 2005 13:34  |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
/*
demo - add StatusBar fields -version 1
not very correct according to luzr...
*/
#include <CtrlLib/CtrlLib.h>
class MyClassWindow : public TopWindow {
private:
Label label1;
StatusBar status1;
InfoCtrl info2;
public:
typedef MyClassWindow CLASSNAME;
MyClassWindow();
};
MyClassWindow::MyClassWindow()
{
//label stuff
//Note: can't use AddFrame here, use:
Add(label1.VCenterPos().HCenterPos(350));
//questions: 350 is width -howto make auto?, what VCenter param does?
label1.SetLabel("demo\n - add StatusBarFields -\nnot very correct according to luzr...");
//status stuff
status1.AddFrame(info2.Width(250));
AddFrame(status1.Height(25));
info2="info2: Welcome to the Ultimate++ !";
}
GUI_APP_MAIN
{
MyClassWindow().Title("StatusBarFields -v1").Zoomable().Sizeable().Run();
}
[Updated on: Mon, 01 May 2006 10:28] Report message to a moderator
|
|
|
|
|
|
Re: add StatusBar fields [message #280 is a reply to message #279] |
Mon, 05 December 2005 23:06   |
 |
mirek
Messages: 13930 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();
}
|
|
|
Re: add StatusBar fields [message #291 is a reply to message #280] |
Wed, 07 December 2005 12:34   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Mon, 05 December 2005 17:06 | 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:
|
Thank you, Myrek, for 2 things:
1) the titanic job you've been doing with U++,
2) dignity to acknowledge your mistakes.
I'm not questioning the power of U++. I would call that "titanic power" - light yet very strong. Also, I want to find and show for other users the hidden parts of the iceberg to compensate the lack of documantation and features.
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 22 00:25:43 CEST 2023
Total time taken to generate the page: 0.03346 seconds
|