Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
fudadmin is currently offline  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

Re: simple TopWindow... branch classWindow : TopWindow [message #228 is a reply to message #213] Sun, 04 December 2005 19:04 Go to previous message
mirek is currently offline  mirek
Messages: 13995
Registered: November 2005
Ultimate Member
Nice tutorial. Should not it be this is Documentation?

I will adopt it to Topic++ and website....

Keep posting! Smile

Mirek
Previous Topic: simple TopWindow... branch GUI_APP_MAIN
Next Topic: standalone VectorDesigner or VectorEditor
Goto Forum:
  


Current Time: Sat Jul 20 12:39:05 CEST 2024

Total time taken to generate the page: 0.02166 seconds