U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Howto create control-collection -control? [SOLVED -good example]
Re: Howto create control-collection -control? [message #1655 is a reply to message #1654] Sat, 11 March 2006 18:43 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Well, a couple of comments first:

Vector<SButton*> buttons;
......
new SButton(&vert, &ctrl);

This is "non-U++" way - forces you to take care of deleting in destructor.

U++ way is to:

- use member function in SButton instead of constructor
- use Array<SButton>
- not use pointers here
- (and, for the record, use indexes instead of iterators....)

What is "dummy" class for?

Why Empty layout?

To me it seems like you could simply derive from ParentCtrl...

(also: visible = !visible Smile

Now, I was not sure what exactly is the goal, until I run (after long time) Outlook express. Well, I am afraid that the solution will have to be a bit different - what you do here has problem with ordering of those subpanes.

I guess the right solution should be single class like

class ExpressPane : public Ctrl {
    Array<Button>  closer;
    Vector<Ctrl *> slave;
    Splitter       splitter;

    void CloseButton();
    void Rearrange();
public:
    void Add(const char *text, Ctrl& slave);
};


The important part is that Rearrange should reset the splitter and add all subpanes again. And both Add and CloseButton should call Rearrange....

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help needed to deal with Display
Next Topic: Application crush
Goto Forum:
  


Current Time: Thu Sep 17 19:12:20 GMT+2 2026

Total time taken to generate the page: 0.00845 seconds