int left_buttons_width = 0;
int right_buttons_width = 0;
- int offset = 0;
-
// draw the buttons on the right side
- offset = m_rect.x + m_rect.width;
+ int offset = m_rect.x + m_rect.width;
for (i = 0; i < button_count; ++i)
{
wxAuiTabContainerButton& button = m_buttons.Item(button_count - i - 1);
int left_buttons_width = 0;
int right_buttons_width = 0;
- int offset = 0;
-
// calculate size of the buttons on the right side
- offset = m_rect.x + m_rect.width;
+ int offset = m_rect.x + m_rect.width;
for (i = 0; i < button_count; ++i)
{
wxAuiTabContainerButton& button = m_buttons.Item(button_count - i - 1);
{
m_isDragging = false;
- wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_clickTab));
- evt.SetOldSelection(evt.GetSelection());
- evt.SetEventObject(this);
- GetEventHandler()->ProcessEvent(evt);
+ wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, m_windowId);
+ e.SetSelection(GetIdxFromWindow(m_clickTab));
+ e.SetOldSelection(e.GetSelection());
+ e.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(e);
return;
}
if (!(m_pressedButton->curState & wxAUI_BUTTON_STATE_DISABLED))
{
- wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_clickTab));
- evt.SetInt(m_pressedButton->id);
- evt.SetEventObject(this);
- GetEventHandler()->ProcessEvent(evt);
+ wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, m_windowId);
+ e.SetSelection(GetIdxFromWindow(m_clickTab));
+ e.SetInt(m_pressedButton->id);
+ e.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(e);
}
m_pressedButton = NULL;
if (m_isDragging)
{
- wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_clickTab));
- evt.SetOldSelection(evt.GetSelection());
- evt.SetEventObject(this);
- GetEventHandler()->ProcessEvent(evt);
+ wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, m_windowId);
+ e.SetSelection(GetIdxFromWindow(m_clickTab));
+ e.SetOldSelection(e.GetSelection());
+ e.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(e);
return;
}
if (abs(pos.x - m_clickPt.x) > drag_x_threshold ||
abs(pos.y - m_clickPt.y) > drag_y_threshold)
{
- wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_clickTab));
- evt.SetOldSelection(evt.GetSelection());
- evt.SetEventObject(this);
- GetEventHandler()->ProcessEvent(evt);
+ wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, m_windowId);
+ e.SetSelection(GetIdxFromWindow(m_clickTab));
+ e.SetOldSelection(e.GetSelection());
+ e.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(e);
m_isDragging = true;
}
for (i = 0; i < page_count; ++i)
{
- int height = m_rect.height - m_tabCtrlHeight;
+ wxAuiNotebookPage& page = pages.Item(i);
+ int border_space = m_tabs->GetArtProvider()->GetAdditionalBorderSpace(page.window);
+
+ int height = m_rect.height - m_tabCtrlHeight - border_space;
if ( height < 0 )
{
// avoid passing negative height to wxWindow::SetSize(), this
height = 0;
}
- wxAuiNotebookPage& page = pages.Item(i);
if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM)
{
- page.window->SetSize(m_rect.x, m_rect.y, m_rect.width, height);
+ page.window->SetSize(m_rect.x + border_space,
+ m_rect.y + border_space,
+ m_rect.width - 2 * border_space,
+ height);
}
else //TODO: if (GetFlags() & wxAUI_NB_TOP)
{
- page.window->SetSize(m_rect.x, m_rect.y + m_tabCtrlHeight,
- m_rect.width, height);
+ page.window->SetSize(m_rect.x + border_space,
+ m_rect.y + m_tabCtrlHeight,
+ m_rect.width - 2 * border_space,
+ height);
}
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
// TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}