Source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/aui/notebook.h
|
||||
// Name: wx/aui/auibook.h
|
||||
// Purpose: wxaui: wx advanced user interface - notebook
|
||||
// Author: Benjamin I. Williams
|
||||
// Modified by:
|
||||
@@ -18,13 +18,12 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/aui/framemanager.h"
|
||||
#include "wx/aui/dockart.h"
|
||||
#include "wx/aui/floatpane.h"
|
||||
|
||||
|
||||
#if wxUSE_AUI
|
||||
|
||||
#include "wx/aui/framemanager.h"
|
||||
#include "wx/aui/dockart.h"
|
||||
#include "wx/aui/floatpane.h"
|
||||
|
||||
|
||||
// event declarations/classes
|
||||
@@ -50,11 +49,11 @@ public:
|
||||
void SetOldSelection(int s) { old_selection = s; }
|
||||
int GetSelection() const { return selection; }
|
||||
int GetOldSelection() const { return old_selection; }
|
||||
|
||||
|
||||
public:
|
||||
int old_selection;
|
||||
int selection;
|
||||
|
||||
|
||||
#ifndef SWIG
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent)
|
||||
@@ -118,17 +117,17 @@ public:
|
||||
void DoShowHide();
|
||||
void SetRect(const wxRect& rect);
|
||||
void AddButton(int id, const wxBitmap& bmp);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual void Render(wxDC* dc);
|
||||
virtual void Render(wxDC* dc);
|
||||
|
||||
virtual void DrawTab(wxDC* dc,
|
||||
const wxRect& in_rect,
|
||||
const wxString& caption,
|
||||
bool active,
|
||||
wxRect* out_rect,
|
||||
int* x_extent);
|
||||
int* x_extent);
|
||||
private:
|
||||
|
||||
wxAuiNotebookPageArray m_pages;
|
||||
@@ -156,7 +155,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void OnPaint(wxPaintEvent& evt);
|
||||
@@ -166,9 +165,9 @@ protected:
|
||||
void OnLeftUp(wxMouseEvent& evt);
|
||||
void OnMotion(wxMouseEvent& evt);
|
||||
void OnLeaveWindow(wxMouseEvent& evt);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
wxPoint m_click_pt;
|
||||
int m_click_tab;
|
||||
bool m_is_dragging;
|
||||
@@ -188,54 +187,54 @@ class WXDLLIMPEXP_AUI wxAuiMultiNotebook : public wxControl
|
||||
public:
|
||||
|
||||
wxAuiMultiNotebook();
|
||||
|
||||
|
||||
wxAuiMultiNotebook(wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
|
||||
virtual ~wxAuiMultiNotebook();
|
||||
|
||||
bool Create(wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
long style = 0);
|
||||
|
||||
bool AddPage(wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
|
||||
|
||||
bool InsertPage(size_t page_idx,
|
||||
wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
|
||||
|
||||
bool DeletePage(size_t page);
|
||||
bool RemovePage(size_t page);
|
||||
|
||||
|
||||
bool SetPageText(size_t page, const wxString& text);
|
||||
size_t SetSelection(size_t new_page);
|
||||
int GetSelection() const;
|
||||
size_t GetPageCount() const;
|
||||
wxWindow* GetPage(size_t page_idx) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt);
|
||||
wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl);
|
||||
wxAuiTabCtrl* GetActiveTabCtrl();
|
||||
bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx);
|
||||
void RemoveEmptyTabFrames();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void DoSizing();
|
||||
void InitNotebook();
|
||||
|
||||
|
||||
void OnChildFocus(wxChildFocusEvent& evt);
|
||||
void OnRender(wxFrameManagerEvent& evt);
|
||||
void OnEraseBackground(wxEraseEvent& evt);
|
||||
@@ -253,11 +252,11 @@ protected:
|
||||
int m_curpage;
|
||||
int m_tab_id_counter;
|
||||
wxWindow* m_dummy_wnd;
|
||||
|
||||
|
||||
wxFont m_selected_font;
|
||||
wxFont m_normal_font;
|
||||
int m_tab_ctrl_height;
|
||||
|
||||
|
||||
#ifndef SWIG
|
||||
DECLARE_EVENT_TABLE()
|
||||
#endif
|
||||
@@ -296,7 +295,7 @@ typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&);
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn))
|
||||
#define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn))
|
||||
|
||||
|
||||
#else
|
||||
|
||||
// wxpython/swig event work
|
||||
@@ -313,7 +312,7 @@ typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&);
|
||||
EVT_AUINOTEBOOK_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 1 )
|
||||
EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 1 )
|
||||
EVT_AUINOTEBOOK_END_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 1 )
|
||||
EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 1 )
|
||||
EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 1 )
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/mdig.h
|
||||
// Name: wx/generic/tabmdi.h
|
||||
// Purpose: Generic MDI (Multiple Document Interface) classes
|
||||
// Author: Hans Van Leemputten
|
||||
// Modified by: Benjamin I. Williams / Kirix Corporation
|
||||
@@ -21,9 +21,6 @@
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/aui/auibook.h"
|
||||
|
||||
extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[];
|
||||
extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[];
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -49,7 +46,7 @@ public:
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
~wxTabMDIParentFrame();
|
||||
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
@@ -84,7 +81,7 @@ public:
|
||||
protected:
|
||||
wxTabMDIClientWindow *m_pClientWindow;
|
||||
wxTabMDIChildFrame *m_pActiveChild;
|
||||
|
||||
|
||||
#if wxUSE_MENUS
|
||||
wxMenu *m_pWindowMenu;
|
||||
wxMenuBar *m_pMyMenuBar;
|
||||
@@ -142,7 +139,7 @@ public:
|
||||
|
||||
virtual void Activate();
|
||||
virtual bool Destroy();
|
||||
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// no status bars
|
||||
virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
|
||||
@@ -190,7 +187,7 @@ public:
|
||||
void OnMenuHighlight(wxMenuEvent& evt);
|
||||
void OnActivate(wxActivateEvent& evt);
|
||||
void OnCloseWindow(wxCloseEvent& evt);
|
||||
|
||||
|
||||
void SetMDIParentFrame(wxTabMDIParentFrame* parent);
|
||||
wxTabMDIParentFrame* GetMDIParentFrame() const;
|
||||
|
||||
@@ -235,7 +232,7 @@ public:
|
||||
wxTabMDIClientWindow();
|
||||
wxTabMDIClientWindow(wxTabMDIParentFrame *parent, long style = 0);
|
||||
~wxTabMDIClientWindow();
|
||||
|
||||
|
||||
virtual bool CreateClient(wxTabMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
@@ -243,7 +240,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
void PageChanged(int old_selection, int new_selection);
|
||||
void PageChanged(int old_selection, int new_selection);
|
||||
void OnPageChanged(wxAuiNotebookEvent& event);
|
||||
void OnSize(wxSizeEvent& evt);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/generic/mdig.cpp
|
||||
// Name: src/generic/tabmdi.cpp
|
||||
// Purpose: Generic MDI (Multiple Document Interface) classes
|
||||
// Author: Hans Van Leemputten
|
||||
// Modified by: Benjamin I. Williams / Kirix Corporation
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#if wxUSE_MDI
|
||||
|
||||
#include "wx/settings.h"
|
||||
#include "wx/aui/tabmdi.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
@@ -34,6 +33,7 @@
|
||||
#include "wx/menu.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/settings.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/stockitem.h"
|
||||
@@ -136,10 +136,10 @@ void wxTabMDIParentFrame::SetMenuBar(wxMenuBar *pMenuBar)
|
||||
{
|
||||
// Remove the Window menu from the old menu bar
|
||||
RemoveWindowMenu(GetMenuBar());
|
||||
|
||||
|
||||
// Add the Window menu to the new menu bar.
|
||||
AddWindowMenu(pMenuBar);
|
||||
|
||||
|
||||
wxFrame::SetMenuBar(pMenuBar);
|
||||
m_pMyMenuBar = GetMenuBar();
|
||||
}
|
||||
@@ -230,7 +230,7 @@ wxTabMDIClientWindow *wxTabMDIParentFrame::OnCreateClient()
|
||||
|
||||
void wxTabMDIParentFrame::ActivateNext()
|
||||
{
|
||||
if (m_pClientWindow && m_pClientWindow->GetSelection() != -1)
|
||||
if (m_pClientWindow && m_pClientWindow->GetSelection() != wxNOT_FOUND)
|
||||
{
|
||||
size_t active = m_pClientWindow->GetSelection() + 1;
|
||||
if (active >= m_pClientWindow->GetPageCount())
|
||||
@@ -242,7 +242,7 @@ void wxTabMDIParentFrame::ActivateNext()
|
||||
|
||||
void wxTabMDIParentFrame::ActivatePrevious()
|
||||
{
|
||||
if (m_pClientWindow && m_pClientWindow->GetSelection() != -1)
|
||||
if (m_pClientWindow && m_pClientWindow->GetSelection() != wxNOT_FOUND)
|
||||
{
|
||||
int active = m_pClientWindow->GetSelection() - 1;
|
||||
if (active < 0)
|
||||
@@ -395,10 +395,10 @@ bool wxTabMDIChildFrame::Destroy()
|
||||
{
|
||||
wxTabMDIParentFrame* pParentFrame = GetMDIParentFrame();
|
||||
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
|
||||
|
||||
|
||||
wxTabMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow();
|
||||
wxASSERT_MSG(pClientWindow, wxT("Missing MDI Client Window"));
|
||||
|
||||
|
||||
bool bActive = false;
|
||||
if (pParentFrame->GetActiveChild() == this)
|
||||
{
|
||||
@@ -406,21 +406,21 @@ bool wxTabMDIChildFrame::Destroy()
|
||||
pParentFrame->SetChildMenuBar(NULL);
|
||||
bActive = true;
|
||||
}
|
||||
|
||||
|
||||
size_t pos, page_count = pClientWindow->GetPageCount();
|
||||
for (pos = 0; pos < page_count; pos++)
|
||||
{
|
||||
if (pClientWindow->GetPage(pos) == this)
|
||||
return pClientWindow->DeletePage(pos);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
wxTabMDIParentFrame* pParentFrame = GetMDIParentFrame();
|
||||
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
|
||||
|
||||
|
||||
bool bActive = false;
|
||||
if (pParentFrame->GetActiveChild() == this)
|
||||
{
|
||||
@@ -461,7 +461,7 @@ bool wxTabMDIChildFrame::Destroy()
|
||||
// customary with frame windows
|
||||
if (!wxPendingDelete.Member(this))
|
||||
wxPendingDelete.Append(this);
|
||||
|
||||
|
||||
return true;
|
||||
*/
|
||||
|
||||
@@ -623,7 +623,7 @@ void wxTabMDIChildFrame::ApplyMDIChildFrameRect()
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabMDIClientWindow, wxAuiMultiNotebook)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxTabMDIClientWindow, wxAuiMultiNotebook)
|
||||
EVT_AUINOTEBOOK_PAGE_CHANGED(-1, wxTabMDIClientWindow::OnPageChanged)
|
||||
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, wxTabMDIClientWindow::OnPageChanged)
|
||||
EVT_SIZE(wxTabMDIClientWindow::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@@ -646,19 +646,19 @@ bool wxTabMDIClientWindow::CreateClient(wxTabMDIParentFrame* parent, long style)
|
||||
SetWindowStyleFlag(style);
|
||||
|
||||
if (!wxAuiMultiNotebook::Create(parent,
|
||||
-1,
|
||||
wxID_ANY,
|
||||
wxPoint(0,0),
|
||||
wxSize(100, 100),
|
||||
wxNO_BORDER))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
wxColour bkcolour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
|
||||
SetBackgroundColour(bkcolour);
|
||||
|
||||
|
||||
m_mgr.GetArtProvider()->SetColour(wxAUI_ART_BACKGROUND_COLOUR, bkcolour);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ void wxTabMDIClientWindow::PageChanged(int old_selection, int new_selection)
|
||||
// don't do anything if the page doesn't actually change
|
||||
if (old_selection == new_selection)
|
||||
return;
|
||||
|
||||
|
||||
// don't do anything if the new page is already active
|
||||
if (new_selection != -1)
|
||||
{
|
||||
@@ -686,7 +686,7 @@ void wxTabMDIClientWindow::PageChanged(int old_selection, int new_selection)
|
||||
{
|
||||
wxTabMDIChildFrame* old_child = (wxTabMDIChildFrame*)GetPage(old_selection);
|
||||
wxASSERT_MSG(old_child, wxT("wxTabMDIClientWindow::PageChanged - null page pointer"));
|
||||
|
||||
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, false, old_child->GetId());
|
||||
event.SetEventObject(old_child);
|
||||
old_child->GetEventHandler()->ProcessEvent(event);
|
||||
@@ -697,7 +697,7 @@ void wxTabMDIClientWindow::PageChanged(int old_selection, int new_selection)
|
||||
{
|
||||
wxTabMDIChildFrame* active_child = (wxTabMDIChildFrame*)GetPage(new_selection);
|
||||
wxASSERT_MSG(active_child, wxT("wxTabMDIClientWindow::PageChanged - null page pointer"));
|
||||
|
||||
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, true, active_child->GetId());
|
||||
event.SetEventObject(active_child);
|
||||
active_child->GetEventHandler()->ProcessEvent(event);
|
||||
@@ -717,7 +717,7 @@ void wxTabMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
|
||||
}
|
||||
|
||||
void wxTabMDIClientWindow::OnSize(wxSizeEvent& evt)
|
||||
{
|
||||
{
|
||||
wxAuiMultiNotebook::OnSize(evt);
|
||||
|
||||
for (size_t pos = 0; pos < GetPageCount(); pos++)
|
||||
|
Reference in New Issue
Block a user