Kirix Support Forums

What about Doc/View framework?

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

What about Doc/View framework?

Postby R.U.10 on Wed Nov 14, 2007 7:57 am

Hello,

I would be interested in something like wxAuiDocMDIParentFrame/wxAuiDocMDIChildFrame and wxAuiDocManager to implement the Doc/View framework of wxWidgets with the Aui concept.

Nobody have worked on the subject?

Regards
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Re: What about Doc/View framework?

Postby Ben on Mon Nov 19, 2007 3:26 am

Hello,

Nobody has worked on this yet. If you'd like to give it a go, I'd certainly entertain including your patch in the official releases.

Best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: What about Doc/View framework?

Postby R.U.10 on Thu Nov 22, 2007 6:29 am

Hello,

Ok, I give it a go.

I created the classes wxAuiDocMDIParent/ChildFrame which derives from the corresponding wxAuiMDI classes and placed them into tabdocmdi.h/cpp files. I took back the wxDocMDI code and adapted it to the wxAui needs. After some issues it seems to work fine.

Before sending you a patch I would like to create the documentation.
Unfortunately there is no documentation for wxAuiMDIParent/ChildFrame to start with. Would someone (probably you, ben :wink: ) like to create this doc?

Best regards,
R.U.10
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Re: What about Doc/View framework?

Postby Ben on Fri Nov 23, 2007 9:23 am

I should be the one, but I just can't in the next few weeks-- simply too much to do. I'm finishing up wxAuiToolBar which will also be a nice addition.

I'm really happy you're taking care of this. Thanks much!

Best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: What about Doc/View framework?

Postby R.U.10 on Mon Dec 17, 2007 9:14 am

I made a patch based on WX_2_8_BRANCH to manage the Doc/View framework with wxAUI MDI concept (see that post). I'm waiting for any remark, critic, idea...
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Re: What about Doc/View framework?

Postby Jedzia on Sat Apr 12, 2008 7:11 am

Thanks R.U.10.
I like it :)

Just done some steps with that nice code and found a problem when you want to cancel the close or close-all windows. I can't cancel that action. I've done this:


in class AuiFrame: public wxAuiDocMDIParentFrame

Code: Select all
....
void AuiFrame::DoHandleMenu(wxCommandEvent& event)
{
....
      ///Todo: move to Baseclass ? 
   case wxWINDOWCLOSEALL:
         while(wxAuiDocMDIChildFrame* child =
            wxDynamicCast(m_pActiveChild, wxAuiDocMDIChildFrame))
         {
            if(!child->Close())
               return;
            else
               child->OnCloseWindow(closeEvent);
         }
      //if (m_docManager)
      //    m_docManager->OnFileCloseAll(event);
      break;
   case wxWINDOWNEXT:
....



oooh, remarks: keep on coding :)
Jedzia
Registered User
 
Posts: 4
Joined: Sat Apr 12, 2008 7:00 am

Re: What about Doc/View framework?

Postby Jedzia on Sat Apr 12, 2008 7:26 am

2. In your auidocvwmdi samle application:

- start
- new drawing
- draw a men with a tin-foil-hat
- press the exit application button
- choose "NO" under the save dialog

then it crashes.

Ive done something similar like the above to fix that in the

Code: Select all
::OnCloseWindow( wxCloseEvent& event )
{
   while(wxAuiDocMDIChildFrame* child =
      wxDynamicCast(m_pActiveChild, wxAuiDocMDIChildFrame))
   {
      if(!child->Close())
      {
         event.Veto(true);
         return;
      }
   }
   event.Skip();
}


event of the application to fix this. don't know if thats correct, i am a noob :)
Jedzia
Registered User
 
Posts: 4
Joined: Sat Apr 12, 2008 7:00 am

Re: What about Doc/View framework?

Postby R.U.10 on Thu Apr 17, 2008 7:48 am

Hello Jedzia,

I'm glad that my Doc/View adaptation pleases you :wink:

Thank you for reporting these issues. Here is my solution:

Code: Select all
void wxAuiDocMDIParentFrame::OnCloseWindow(wxCloseEvent& event)
{
    wxCommandEvent eventCloseAll(wxEVT_COMMAND_MENU_SELECTED, wxWINDOWCLOSEALL);
    eventCloseAll.Skip();
    DoHandleMenu(eventCloseAll);

    if (eventCloseAll.GetSkipped())
        this->Destroy();
    else
        event.Veto();
}
and
Code: Select all
void wxAuiDocMDIParentFrame::DoHandleMenu(wxCommandEvent& event)
{
    switch (event.GetId())
    {
    case wxWINDOWCLOSEALL:
        while (m_pActiveChild)
        {
            if (!m_pActiveChild->Close())
            {
                event.Skip(false);
                return; // failure
            }
        }
        break;
    default:
        wxAuiMDIParentFrame::DoHandleMenu(event);
    }
}


The patch can be downloaded:
- diff from last patch (only the previous modifications)
- patch for all files (from wx28 branch)

Tell me if that resolves your problem.

Regards
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Re: What about Doc/View framework?

Postby Jedzia on Wed Apr 23, 2008 7:01 pm

hmmmmm .... forum
aaah feedback
it works great, R.U.10
Jedzia
Registered User
 
Posts: 4
Joined: Sat Apr 12, 2008 7:00 am

Re: What about Doc/View framework?

Postby Jedzia on Wed Apr 23, 2008 7:12 pm

hmmmmm .... forum
aaah feedback
it works great, R.U.10

edit: a draft got lost where i told you "honey", but at all: we have to do a cross plattform easy to use idiots and even more idiots not to use aui template with a pretty parrentwindow and wxeditors like dialogf*ck oder .. or easy to use template that we can rely on.

Just a thought from another girl around/after 2:pm

excuse me for that pathetics ..... i fixed some cross plattform fucking ... a i mean static auimanager and shipped the raw template out. all say: whoooot ? what do you want with that ==??? ... after i had to ship libtest.so on linux ... and libtest.dll on windows. nice :) I missed both in the packets for the victims.

Keep on coding !
Jedzia
Registered User
 
Posts: 4
Joined: Sat Apr 12, 2008 7:00 am

Re: What about Doc/View framework?

Postby NinjaNL on Wed May 14, 2008 6:26 am

Has there been any progress on this?

I would like to see the hard work done by R.U.10 appear in the SVN tree.

Hopefully it will be added before the next 2.8 release.

Any ideas as to whether it will be integrated?

Mal
NinjaNL
Registered User
 
Posts: 40
Joined: Thu Jun 14, 2007 6:53 am

Re: What about Doc/View framework?

Postby pflooo on Tue May 20, 2008 1:55 pm

Hi,
My question is about the wxAUINoteBook and the document/view framework.

I didn't really understood what was able to do with the wxAUIDocChildFrame... Is it possible to have a notebook in the main application frame and open documents in notebook's tabs ?

I though this could be done implementing a wxDocChildPanel like class as wxPanel may be embedded in notebook's tabs.

Help or advice would be appreciated,
Regards
pflooo
Registered User
 
Posts: 2
Joined: Tue May 20, 2008 1:49 pm

Re: What about Doc/View framework?

Postby R.U.10 on Wed May 28, 2008 7:21 am

Hello,

My implementation is strongly inspired of the wxWidgets's classes wxDocMDIParent/ChildFrame. So you can take a look on the documentation of these classes (I also written the documentation in tex format, just generate it with the standard procedure). Unfortunately the documentation for the classes wxAuiMDIParent/ChildFrame with which I concatenate the wxWidgets classes to make the wxAuiDocMDI classes does not exist at this time...

But of what I understood of the functioning of the wxAUIParent/ChildFrame classes, wxAuiParentFrame contains a wxAuiMDIClientWindow which derives from wxAuiNotebook. And each wxAuiChildFrame appears under the shape of a notebook's tab in the main application. You can get the ParentFrame's managed notebook with the function GetNotebook(). If you wish to add a notebook in a child frame, you should link a wxAuiManager with the child frame and add the child notebook with the AuiManager functions.

I hope that will answer to your questions.

Regards
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Re: What about Doc/View framework?

Postby R.U.10 on Mon Aug 25, 2008 10:49 am

Hello,

I received some news from wxTrac (by vadz) few weeks ago. Let me show you its comments:

(...)the code in `src/aui/tabdocmdi.cpp` doesn't seem to be at all AUI-specific and duplicates a lot of code already existing e.g. in `src/common/docmdi.cpp`.

And it's even worse with the sample: while it's a very good idea to provide changes to the sample illustrating the new functionality I really don't want to end up with the ''third'' copy of this example (there are already two in samples/docview and docmdi). I think it would be better to have a compilation switch in docmdi sample to allow compiling it with AUI MDI support instead of the native one.

If you could find a way to implement these classes without duplicating too much code, it would be really great.(...)


I effectively duplicate some parts of code because I did not want to modify the native classes, notably put "virtual" several functions, get back some ID defined in cpp files (wxWINDOWNEXT, wxWINDOWPREV, etc.). Especially I did not want double inheritance of wxAuiDocMDIParentFrame from wxAuiMDIParentFrame AND wxDocMDIParentFrame :shock:

But if they are the wishes then some work waits for me 8)

Regards
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Re: What about Doc/View framework?

Postby R.U.10 on Mon Sep 01, 2008 3:42 am

Dear Ben (or someone else who can answer his place :wink:),

I'm studying the possibilities of improving my code and I see that the wxAuiMDI frame classes are already really similar to the wxGenericMDI ones. I suggest to make inherit the AuiMDI frame classes from GenericMDI and overload only the methods useful for AUI uses. Could you give me your opinion about that?

Regards
R.U.10
Registered User
 
Posts: 30
Joined: Mon May 21, 2007 9:26 am

Return to wxAUI Questions, Thoughts & Feedback