Kirix Support Forums

OnLeftDown (X)

Please post any wxAUI patches or modifications you've created here. Thanks!

OnLeftDown (X)

Postby Guest on Sun Jan 15, 2006 10:56 pm

The code for case wxFNB_X (when you hit the corner X button), fires a closing event, and then deletes the page... which fires -another- closing event. Since its undesirable to inform the parent twice, I changed this:
Code: Select all
   case wxFNB_X:
      {
         wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, GetParent()->GetId());
         event.SetSelection(m_iActivePage);
         event.SetEventObject(GetParent());
         GetParent()->GetEventHandler()->ProcessEvent(event);
         DeletePage((size_t)m_iActivePage);
         break;
      }


to this:
Code: Select all
   case wxFNB_X:
      {
         DeletePage((size_t)m_iActivePage);
         break;
      }
Guest
 

Postby crioux on Sun Jan 15, 2006 10:57 pm

Oops, forgot to log in. Hi!
crioux
Registered User
 
Posts: 3
Joined: Sun Jan 15, 2006 10:53 pm

Postby crioux on Sun Jan 15, 2006 10:59 pm

Hah!

And i'm an idiot! This is a patch for wxFlatNotebook, not wxAUI. Sorry for the crosspost. I'm using both in a project, and somehow managed to post to the wrong place.

Anyway, someone here might find it useful, if not, sorry for the spam!
crioux
Registered User
 
Posts: 3
Joined: Sun Jan 15, 2006 10:53 pm

Postby crioux on Mon Jan 16, 2006 12:09 am

And on top of that, it appears that the patch is somewhat inverted in nature. DeletePage and RemovePage shouldn't fire the event, but an interaction with a user control should. Anyway. I'll take this discussion somewhere else.
crioux
Registered User
 
Posts: 3
Joined: Sun Jan 15, 2006 10:53 pm

Return to wxAUI Patches & Modifications