Steve Cookson
2014-09-12 17:39:09 UTC
Is this still the case? Many of these events don't work (Kubuntu 14.04
wxWidgets 3.0.1).
Regards
Steve
wxWidgets 3.0.1).
Regards
Steve
I am working on a program that will feature multiple tabs, each of
which contains a panel that displays something similar to CAD output
when they are painted ( the EVT_PAINT event is handled by the new
panel class to draw all of the data to the panel ). However, when
using the wxAuiNotebook, if I split the tabs by dragging one of the
tabs to the edge of the book, the one I just finished dragging never
calls a paint event.
I figured I could solve this by getting the tab I just finished
dragging from one of the wxAuiNotebookEvent events like
EVT_AUINOTEBOOK_END_DRAG, but most of those events never seem to be
handled in my code. I've put break points/print statements inside
functions connected to EVT_AUINOTEBOOK_BEGIN_DRAG,
EVT_AUINOTEBOOK_END_DRAG, EVT_AUINOTEBOOK_DRAG_MOTION, and
EVT_AUINOTEBOOK_ALLOW_DND but have never once seen my code stop in
those functions.
EVT_AUINOTEBOOK_PAGE_CHANGED and EVT_AUINOTEBOOK_PAGE_CLOSE work fine
though.
Is there a known error here or am I doing something wrong?
Sample of my code bellow...
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
// other frame events
EVT_AUINOTEBOOK_PAGE_CHANGED(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookPageChanged)
EVT_AUINOTEBOOK_PAGE_CLOSE(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookPageClosing)
EVT_AUINOTEBOOK_BEGIN_DRAG(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookBeginDrag)
EVT_AUINOTEBOOK_END_DRAG(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookEndDrag)
EVT_AUINOTEBOOK_ALLOW_DND(MyFrame::NOTEBOOK_ID,
MyFrame::OnAllowNotebookDnD)
EVT_AUINOTEBOOK_DRAG_MOTION(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookDragMotion)
END_EVENT_TABLE()
MyFrame::MyFrame()
{
// initialize some member variables for the frame
mpAuiNotebook = new itiAuiNotebook( this,
NOTEBOOK_ID,
wxDefaultPosition,
wxDefaultSize,
wxAUI_NB_DEFAULT_STYLE|
wxAUI_NB_WINDOWLIST_BUTTON|
wxAUI_NB_CLOSE_ON_ALL_TABS );
// other objects on frame
}
//other functions
void MyFrame::OnNotebookPageChanged(wxAuiNotebookEvent &event)
{
//Handle switching views of CAD data
}
void MyFrame::OnNotebookPageClosing(wxAuiNotebookEvent &event)
{
//Cleanup data after closing a tab
}
void MyFrame::OnNotebookBeginDrag(wxAuiNotebookEvent &event)
{
//do before drag
}
void MyFrame::OnNotebookEndDrag(wxAuiNotebookEvent &event)
{
//do after drag
}
void MyFrame::OnAllowNotebookDnD(wxAuiNotebookEvent &event)
{
//handle dnd allow
}
void MyFrame::OnNotebookDragMotion(wxAuiNotebookEvent &event)
{
//thing to do while dragging
}
which contains a panel that displays something similar to CAD output
when they are painted ( the EVT_PAINT event is handled by the new
panel class to draw all of the data to the panel ). However, when
using the wxAuiNotebook, if I split the tabs by dragging one of the
tabs to the edge of the book, the one I just finished dragging never
calls a paint event.
I figured I could solve this by getting the tab I just finished
dragging from one of the wxAuiNotebookEvent events like
EVT_AUINOTEBOOK_END_DRAG, but most of those events never seem to be
handled in my code. I've put break points/print statements inside
functions connected to EVT_AUINOTEBOOK_BEGIN_DRAG,
EVT_AUINOTEBOOK_END_DRAG, EVT_AUINOTEBOOK_DRAG_MOTION, and
EVT_AUINOTEBOOK_ALLOW_DND but have never once seen my code stop in
those functions.
EVT_AUINOTEBOOK_PAGE_CHANGED and EVT_AUINOTEBOOK_PAGE_CLOSE work fine
though.
Is there a known error here or am I doing something wrong?
Sample of my code bellow...
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
// other frame events
EVT_AUINOTEBOOK_PAGE_CHANGED(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookPageChanged)
EVT_AUINOTEBOOK_PAGE_CLOSE(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookPageClosing)
EVT_AUINOTEBOOK_BEGIN_DRAG(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookBeginDrag)
EVT_AUINOTEBOOK_END_DRAG(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookEndDrag)
EVT_AUINOTEBOOK_ALLOW_DND(MyFrame::NOTEBOOK_ID,
MyFrame::OnAllowNotebookDnD)
EVT_AUINOTEBOOK_DRAG_MOTION(MyFrame::NOTEBOOK_ID,
MyFrame::OnNotebookDragMotion)
END_EVENT_TABLE()
MyFrame::MyFrame()
{
// initialize some member variables for the frame
mpAuiNotebook = new itiAuiNotebook( this,
NOTEBOOK_ID,
wxDefaultPosition,
wxDefaultSize,
wxAUI_NB_DEFAULT_STYLE|
wxAUI_NB_WINDOWLIST_BUTTON|
wxAUI_NB_CLOSE_ON_ALL_TABS );
// other objects on frame
}
//other functions
void MyFrame::OnNotebookPageChanged(wxAuiNotebookEvent &event)
{
//Handle switching views of CAD data
}
void MyFrame::OnNotebookPageClosing(wxAuiNotebookEvent &event)
{
//Cleanup data after closing a tab
}
void MyFrame::OnNotebookBeginDrag(wxAuiNotebookEvent &event)
{
//do before drag
}
void MyFrame::OnNotebookEndDrag(wxAuiNotebookEvent &event)
{
//do after drag
}
void MyFrame::OnAllowNotebookDnD(wxAuiNotebookEvent &event)
{
//handle dnd allow
}
void MyFrame::OnNotebookDragMotion(wxAuiNotebookEvent &event)
{
//thing to do while dragging
}
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users