|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » easiest way to convert a Topwindow into a control
easiest way to convert a Topwindow into a control [message #6022] |
Sat, 28 October 2006 20:06 |
yeus
Messages: 19 Registered: October 2006
|
Promising Member |
|
|
Hi everyone, in this nice forum, desperatly defending "real" c++
I started programming an application. it has its own layout and everything. After a while (now) it turned out that this window would also make a very nice control element for a window of another application I'm, working on.
I played with adding frames and stuff, and inheriting my own topwindow class from frames and vice versa, to add my window into the layout editor as "user class". But nothing seemed to work. Now I want to know: what's the easiest way to turn my window into a control without having to copy&paste code fragments into a new class and completly rewriting paint-events and similar things?
How does a user-class have to be declared, for beeing accepted as user class in the layout designer resource file?
(btw another thing: what about "spin-off" products of my applications? I have written several control classes, which are kind of practicable. Is there anyone who i can give those to? Who can check the code and decides, whether to add them to ultimate++ or not?)
Greetings, Tom
[Updated on: Sat, 28 October 2006 20:12] Report message to a moderator
|
|
|
Re: easiest way to convert a Topwindow into a control [message #6023 is a reply to message #6022] |
Sat, 28 October 2006 20:35 |
fallingdutch
Messages: 258 Registered: July 2006
|
Experienced Member |
|
|
Hi Tom,
as far as i know it just needs to be derived from class Ctrl and, if you want your class to be able to act as a Frame, FrameCtrl.
so change your class myNiceClass : public TopWindow
to class myNiceClass : public FrameCtrl<Ctrl> //both: Ctrl and Frame
class myNiceClass: public Ctrl //only Ctrl, not acting as a Frame
but then GUI_APP_RUN won't work so you have to add your Ctrl to your new TopWindow with AddFrame(instanceOfMyNiceClass); //for the Frame version
Add(instanceOfMyNiceClass); //both only Ctrl and "Ctrl and Frame"
yeus wrote on Sat, 28 October 2006 20:06 | How does a user-class have to be declared, for beeing accepted as user class in the layout designer resource file?
|
you need a description of your class in an .usc file ... but i don't know how - if you know it tell me, please
Bas
[Updated on: Sat, 28 October 2006 20:45] Report message to a moderator
|
|
|
|
|
Re: easiest way to convert a Topwindow into a control [message #6035 is a reply to message #6022] |
Sun, 29 October 2006 04:27 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
yeus wrote on Sat, 28 October 2006 14:06 |
How does a user-class have to be declared, for beeing accepted as user class in the layout designer resource file?
|
Well, depends on desired level of integration.
Usually I just do nothing (I am lazy person) and use "User class", then fill in the name of class, being happy with empty rectangle to visualize the widget.
If you want higher level, you need .usc script.
Quote: |
(btw another thing: what about "spin-off" products of my applications? I have written several control classes, which are kind of practicable. Is there anyone who i can give those to? Who can check the code and decides, whether to add them to ultimate++ or not?)
|
For now I recommend "useful code snippets" forum, or development forums.
There also seem to be suggestions for "U++ extensions" separate sourceforge project. Perhaps a nice idea, I see that at the moment a lot of useful is happening, but core U++ team is quite limited in resources (-> not much time to check).
Mirek
Mirek
Mirek
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue May 21 18:43:24 CEST 2024
Total time taken to generate the page: 0.02043 seconds
|
|
|