Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » simple TopWindow... branch classWindow : TopWindow
simple TopWindow... branch classWindow : TopWindow [message #213] |
Sat, 03 December 2005 15:10  |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
So, the next part of my simple u++ window/widget "tutorial":
1. minimal "titleless MyClassWindow" (derived class from supplied by U++ TopWindow):
#include <CtrlLib/CtrlLib.h> //don't forget to include for the GUI
class MyClassWindow : public TopWindow {
public:
typedef MyClassWindow CLASSNAME;
};
GUI_APP_MAIN
{
MyClassWindow().Run();
}
2. minimal, not very useful, but prepared for extending "titleless MyClassWindow":
#include <CtrlLib/CtrlLib.h>
class MyClassWindow : public TopWindow {
public:
typedef MyClassWindow CLASSNAME;
MyClassWindow(); //1. we need this in here with the same name
};
MyClassWindow::MyClassWindow() //2. we need this in here with the same name
{
}
GUI_APP_MAIN
{
MyClassWindow().Run();
}
3. "titled, zoomable, sizeable MyClassWindow"
Now let's do the extending:
#include <CtrlLib/CtrlLib.h>
class MyClassWindow : public TopWindow {
public:
typedef MyClassWindow CLASSNAME;
MyClassWindow();
};
MyClassWindow::MyClassWindow()
{
Title("MyClassWindow1");
Zoomable().Sizeable();
SetRect(0, 0, 260, 80); //just to remind this is optional
}
GUI_APP_MAIN
{
MyClassWindow().Run();
}
4. "titled, zoomable, sizeable MyClassWindow" + status bar:
(old:edited P.S. would be nice to know why, If I add statusBar like this)
#include <CtrlLib/CtrlLib.h>
class MyClassWindow : public TopWindow {
StatusBar status;
public:
typedef MyClassWindow CLASSNAME;
MyClassWindow();
};
MyClassWindow::MyClassWindow()
{
// AddFrame(status);
Title("MyClassWindow1");
Zoomable().Sizeable();
SetRect(0, 0, 260, 80);
// status = "Welcome to the Ultimate++ !";
}
GUI_APP_MAIN
{
MyClassWindow().Run();
}
(old: Just to know you get:
Linking...
CtrlLib.lib(Prompt.obj) : error LNK2001: unresolved external symbol "public: virtual
struct Size_<int> __thiscall ImageCtrl::GetMinSize(void)const " (?GetMinSize@Im
ageCtrl@@UBE?AU?$Size_@H@@XZ)
if you had added the other package and not CtrlLib... )
[Updated on: Sat, 03 December 2005 10:50]
[Updated on: Sat, 03 December 2005 17:21] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 13:13:33 CEST 2025
Total time taken to generate the page: 0.00610 seconds
|