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 » U++ Library support » U++ Widgets - General questions or Mixed problems » Controls & classes design questions
Controls & classes design questions [message #11036] Thu, 16 August 2007 01:19 Go to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

First of all, thanks for such a promising framework.

My question comes from very common task.

My goal is to write an editor for some kind of graphics files. As for modern standard, editor is to be multi-tabbed, working with multiple files simultaneously.
It`s OK, I just added TabCtrl to main window.
Next move is to resolve design approach. My decision was to create a class representing single file in editor. This class contains main window Tab control`s tab, representing this file, and a GLCtrl object.
Something like this:
class MyFile
{
    MyFile (TabCtrl &tabs) { tab = tabs.Add("..."); }

    GLCtrl         gl;
    TabCtrl::Item &tab;
};
//...
class MainWindow
{
    TabCtrl        tabs;
    Vector<MyFile> files;
};
//...
void MainWindow::OnNew()
{
    
    files.Add(MyFile(tabs));
}

So my questions are:

1) Is this an optimal solution for decomposition controls on such a task?

2) I`ve read articles about moveable for a number of times, and just can`t understand, why application doesn`t crash since new MyFile object existed only within MainWindow::OnNew() scope?

3) Class MyFile contains GL control which has virtual methods for sure. Is it still moveable? How could that be?

4) What kind of copy constructor should I implement? What to do with gl and tab fields?

Thanx in advance.

[Updated on: Thu, 16 August 2007 01:30]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multithreading ans updating widgets
Next Topic: DropList bug when removing last item
Goto Forum:
  


Current Time: Mon May 06 00:48:39 CEST 2024

Total time taken to generate the page: 0.02564 seconds