Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-07-24 06:30:49 +00:00
parent 6bdeda4785
commit 4444d148a5
4 changed files with 231 additions and 234 deletions

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: wx/aui/notebook.h // Name: wx/aui/auibook.h
// Purpose: wxaui: wx advanced user interface - notebook // Purpose: wxaui: wx advanced user interface - notebook
// Author: Benjamin I. Williams // Author: Benjamin I. Williams
// Modified by: // Modified by:
@@ -18,13 +18,12 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/aui/framemanager.h"
#include "wx/aui/dockart.h"
#include "wx/aui/floatpane.h"
#if wxUSE_AUI #if wxUSE_AUI
#include "wx/aui/framemanager.h"
#include "wx/aui/dockart.h"
#include "wx/aui/floatpane.h"
// event declarations/classes // event declarations/classes
@@ -50,11 +49,11 @@ public:
void SetOldSelection(int s) { old_selection = s; } void SetOldSelection(int s) { old_selection = s; }
int GetSelection() const { return selection; } int GetSelection() const { return selection; }
int GetOldSelection() const { return old_selection; } int GetOldSelection() const { return old_selection; }
public: public:
int old_selection; int old_selection;
int selection; int selection;
#ifndef SWIG #ifndef SWIG
private: private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent) DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent)
@@ -118,17 +117,17 @@ public:
void DoShowHide(); void DoShowHide();
void SetRect(const wxRect& rect); void SetRect(const wxRect& rect);
void AddButton(int id, const wxBitmap& bmp); void AddButton(int id, const wxBitmap& bmp);
protected: protected:
virtual void Render(wxDC* dc); virtual void Render(wxDC* dc);
virtual void DrawTab(wxDC* dc, virtual void DrawTab(wxDC* dc,
const wxRect& in_rect, const wxRect& in_rect,
const wxString& caption, const wxString& caption,
bool active, bool active,
wxRect* out_rect, wxRect* out_rect,
int* x_extent); int* x_extent);
private: private:
wxAuiNotebookPageArray m_pages; wxAuiNotebookPageArray m_pages;
@@ -156,7 +155,7 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0); long style = 0);
protected: protected:
void OnPaint(wxPaintEvent& evt); void OnPaint(wxPaintEvent& evt);
@@ -166,9 +165,9 @@ protected:
void OnLeftUp(wxMouseEvent& evt); void OnLeftUp(wxMouseEvent& evt);
void OnMotion(wxMouseEvent& evt); void OnMotion(wxMouseEvent& evt);
void OnLeaveWindow(wxMouseEvent& evt); void OnLeaveWindow(wxMouseEvent& evt);
protected: protected:
wxPoint m_click_pt; wxPoint m_click_pt;
int m_click_tab; int m_click_tab;
bool m_is_dragging; bool m_is_dragging;
@@ -188,54 +187,54 @@ class WXDLLIMPEXP_AUI wxAuiMultiNotebook : public wxControl
public: public:
wxAuiMultiNotebook(); wxAuiMultiNotebook();
wxAuiMultiNotebook(wxWindow* parent, wxAuiMultiNotebook(wxWindow* parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0); long style = 0);
virtual ~wxAuiMultiNotebook(); virtual ~wxAuiMultiNotebook();
bool Create(wxWindow* parent, bool Create(wxWindow* parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0); long style = 0);
bool AddPage(wxWindow* page, bool AddPage(wxWindow* page,
const wxString& caption, const wxString& caption,
bool select = false, bool select = false,
const wxBitmap& bitmap = wxNullBitmap); const wxBitmap& bitmap = wxNullBitmap);
bool InsertPage(size_t page_idx, bool InsertPage(size_t page_idx,
wxWindow* page, wxWindow* page,
const wxString& caption, const wxString& caption,
bool select = false, bool select = false,
const wxBitmap& bitmap = wxNullBitmap); const wxBitmap& bitmap = wxNullBitmap);
bool DeletePage(size_t page); bool DeletePage(size_t page);
bool RemovePage(size_t page); bool RemovePage(size_t page);
bool SetPageText(size_t page, const wxString& text); bool SetPageText(size_t page, const wxString& text);
size_t SetSelection(size_t new_page); size_t SetSelection(size_t new_page);
int GetSelection() const; int GetSelection() const;
size_t GetPageCount() const; size_t GetPageCount() const;
wxWindow* GetPage(size_t page_idx) const; wxWindow* GetPage(size_t page_idx) const;
protected: protected:
wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt); wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt);
wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl); wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl);
wxAuiTabCtrl* GetActiveTabCtrl(); wxAuiTabCtrl* GetActiveTabCtrl();
bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx); bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx);
void RemoveEmptyTabFrames(); void RemoveEmptyTabFrames();
protected: protected:
void DoSizing(); void DoSizing();
void InitNotebook(); void InitNotebook();
void OnChildFocus(wxChildFocusEvent& evt); void OnChildFocus(wxChildFocusEvent& evt);
void OnRender(wxFrameManagerEvent& evt); void OnRender(wxFrameManagerEvent& evt);
void OnEraseBackground(wxEraseEvent& evt); void OnEraseBackground(wxEraseEvent& evt);
@@ -253,11 +252,11 @@ protected:
int m_curpage; int m_curpage;
int m_tab_id_counter; int m_tab_id_counter;
wxWindow* m_dummy_wnd; wxWindow* m_dummy_wnd;
wxFont m_selected_font; wxFont m_selected_font;
wxFont m_normal_font; wxFont m_normal_font;
int m_tab_ctrl_height; int m_tab_ctrl_height;
#ifndef SWIG #ifndef SWIG
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
#endif #endif
@@ -296,7 +295,7 @@ typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&);
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn))
#define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \ #define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn))
#else #else
// wxpython/swig event work // 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_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 1 )
EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 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_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 #endif

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/mdig.h // Name: wx/generic/tabmdi.h
// Purpose: Generic MDI (Multiple Document Interface) classes // Purpose: Generic MDI (Multiple Document Interface) classes
// Author: Hans Van Leemputten // Author: Hans Van Leemputten
// Modified by: Benjamin I. Williams / Kirix Corporation // Modified by: Benjamin I. Williams / Kirix Corporation
@@ -21,9 +21,6 @@
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/aui/auibook.h" #include "wx/aui/auibook.h"
extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[];
extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[];
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// classes // classes
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -49,7 +46,7 @@ public:
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
~wxTabMDIParentFrame(); ~wxTabMDIParentFrame();
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID winid, wxWindowID winid,
const wxString& title, const wxString& title,
@@ -84,7 +81,7 @@ public:
protected: protected:
wxTabMDIClientWindow *m_pClientWindow; wxTabMDIClientWindow *m_pClientWindow;
wxTabMDIChildFrame *m_pActiveChild; wxTabMDIChildFrame *m_pActiveChild;
#if wxUSE_MENUS #if wxUSE_MENUS
wxMenu *m_pWindowMenu; wxMenu *m_pWindowMenu;
wxMenuBar *m_pMyMenuBar; wxMenuBar *m_pMyMenuBar;
@@ -142,7 +139,7 @@ public:
virtual void Activate(); virtual void Activate();
virtual bool Destroy(); virtual bool Destroy();
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
// no status bars // no status bars
virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1, virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
@@ -190,7 +187,7 @@ public:
void OnMenuHighlight(wxMenuEvent& evt); void OnMenuHighlight(wxMenuEvent& evt);
void OnActivate(wxActivateEvent& evt); void OnActivate(wxActivateEvent& evt);
void OnCloseWindow(wxCloseEvent& evt); void OnCloseWindow(wxCloseEvent& evt);
void SetMDIParentFrame(wxTabMDIParentFrame* parent); void SetMDIParentFrame(wxTabMDIParentFrame* parent);
wxTabMDIParentFrame* GetMDIParentFrame() const; wxTabMDIParentFrame* GetMDIParentFrame() const;
@@ -235,7 +232,7 @@ public:
wxTabMDIClientWindow(); wxTabMDIClientWindow();
wxTabMDIClientWindow(wxTabMDIParentFrame *parent, long style = 0); wxTabMDIClientWindow(wxTabMDIParentFrame *parent, long style = 0);
~wxTabMDIClientWindow(); ~wxTabMDIClientWindow();
virtual bool CreateClient(wxTabMDIParentFrame *parent, virtual bool CreateClient(wxTabMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL); long style = wxVSCROLL | wxHSCROLL);
@@ -243,7 +240,7 @@ public:
protected: protected:
void PageChanged(int old_selection, int new_selection); void PageChanged(int old_selection, int new_selection);
void OnPageChanged(wxAuiNotebookEvent& event); void OnPageChanged(wxAuiNotebookEvent& event);
void OnSize(wxSizeEvent& evt); void OnSize(wxSizeEvent& evt);

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: src/generic/mdig.cpp // Name: src/generic/tabmdi.cpp
// Purpose: Generic MDI (Multiple Document Interface) classes // Purpose: Generic MDI (Multiple Document Interface) classes
// Author: Hans Van Leemputten // Author: Hans Van Leemputten
// Modified by: Benjamin I. Williams / Kirix Corporation // Modified by: Benjamin I. Williams / Kirix Corporation
@@ -26,7 +26,6 @@
#if wxUSE_MDI #if wxUSE_MDI
#include "wx/settings.h"
#include "wx/aui/tabmdi.h" #include "wx/aui/tabmdi.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -34,6 +33,7 @@
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/settings.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
#include "wx/stockitem.h" #include "wx/stockitem.h"
@@ -136,10 +136,10 @@ void wxTabMDIParentFrame::SetMenuBar(wxMenuBar *pMenuBar)
{ {
// Remove the Window menu from the old menu bar // Remove the Window menu from the old menu bar
RemoveWindowMenu(GetMenuBar()); RemoveWindowMenu(GetMenuBar());
// Add the Window menu to the new menu bar. // Add the Window menu to the new menu bar.
AddWindowMenu(pMenuBar); AddWindowMenu(pMenuBar);
wxFrame::SetMenuBar(pMenuBar); wxFrame::SetMenuBar(pMenuBar);
m_pMyMenuBar = GetMenuBar(); m_pMyMenuBar = GetMenuBar();
} }
@@ -230,7 +230,7 @@ wxTabMDIClientWindow *wxTabMDIParentFrame::OnCreateClient()
void wxTabMDIParentFrame::ActivateNext() 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; size_t active = m_pClientWindow->GetSelection() + 1;
if (active >= m_pClientWindow->GetPageCount()) if (active >= m_pClientWindow->GetPageCount())
@@ -242,7 +242,7 @@ void wxTabMDIParentFrame::ActivateNext()
void wxTabMDIParentFrame::ActivatePrevious() void wxTabMDIParentFrame::ActivatePrevious()
{ {
if (m_pClientWindow && m_pClientWindow->GetSelection() != -1) if (m_pClientWindow && m_pClientWindow->GetSelection() != wxNOT_FOUND)
{ {
int active = m_pClientWindow->GetSelection() - 1; int active = m_pClientWindow->GetSelection() - 1;
if (active < 0) if (active < 0)
@@ -395,10 +395,10 @@ bool wxTabMDIChildFrame::Destroy()
{ {
wxTabMDIParentFrame* pParentFrame = GetMDIParentFrame(); wxTabMDIParentFrame* pParentFrame = GetMDIParentFrame();
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
wxTabMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); wxTabMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow();
wxASSERT_MSG(pClientWindow, wxT("Missing MDI Client Window")); wxASSERT_MSG(pClientWindow, wxT("Missing MDI Client Window"));
bool bActive = false; bool bActive = false;
if (pParentFrame->GetActiveChild() == this) if (pParentFrame->GetActiveChild() == this)
{ {
@@ -406,21 +406,21 @@ bool wxTabMDIChildFrame::Destroy()
pParentFrame->SetChildMenuBar(NULL); pParentFrame->SetChildMenuBar(NULL);
bActive = true; bActive = true;
} }
size_t pos, page_count = pClientWindow->GetPageCount(); size_t pos, page_count = pClientWindow->GetPageCount();
for (pos = 0; pos < page_count; pos++) for (pos = 0; pos < page_count; pos++)
{ {
if (pClientWindow->GetPage(pos) == this) if (pClientWindow->GetPage(pos) == this)
return pClientWindow->DeletePage(pos); return pClientWindow->DeletePage(pos);
} }
return false; return false;
} }
/* /*
wxTabMDIParentFrame* pParentFrame = GetMDIParentFrame(); wxTabMDIParentFrame* pParentFrame = GetMDIParentFrame();
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
bool bActive = false; bool bActive = false;
if (pParentFrame->GetActiveChild() == this) if (pParentFrame->GetActiveChild() == this)
{ {
@@ -461,7 +461,7 @@ bool wxTabMDIChildFrame::Destroy()
// customary with frame windows // customary with frame windows
if (!wxPendingDelete.Member(this)) if (!wxPendingDelete.Member(this))
wxPendingDelete.Append(this); wxPendingDelete.Append(this);
return true; return true;
*/ */
@@ -623,7 +623,7 @@ void wxTabMDIChildFrame::ApplyMDIChildFrameRect()
IMPLEMENT_DYNAMIC_CLASS(wxTabMDIClientWindow, wxAuiMultiNotebook) IMPLEMENT_DYNAMIC_CLASS(wxTabMDIClientWindow, wxAuiMultiNotebook)
BEGIN_EVENT_TABLE(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) EVT_SIZE(wxTabMDIClientWindow::OnSize)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -646,19 +646,19 @@ bool wxTabMDIClientWindow::CreateClient(wxTabMDIParentFrame* parent, long style)
SetWindowStyleFlag(style); SetWindowStyleFlag(style);
if (!wxAuiMultiNotebook::Create(parent, if (!wxAuiMultiNotebook::Create(parent,
-1, wxID_ANY,
wxPoint(0,0), wxPoint(0,0),
wxSize(100, 100), wxSize(100, 100),
wxNO_BORDER)) wxNO_BORDER))
{ {
return false; return false;
} }
wxColour bkcolour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); wxColour bkcolour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
SetBackgroundColour(bkcolour); SetBackgroundColour(bkcolour);
m_mgr.GetArtProvider()->SetColour(wxAUI_ART_BACKGROUND_COLOUR, bkcolour); m_mgr.GetArtProvider()->SetColour(wxAUI_ART_BACKGROUND_COLOUR, bkcolour);
return true; 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 // don't do anything if the page doesn't actually change
if (old_selection == new_selection) if (old_selection == new_selection)
return; return;
// don't do anything if the new page is already active // don't do anything if the new page is already active
if (new_selection != -1) if (new_selection != -1)
{ {
@@ -686,7 +686,7 @@ void wxTabMDIClientWindow::PageChanged(int old_selection, int new_selection)
{ {
wxTabMDIChildFrame* old_child = (wxTabMDIChildFrame*)GetPage(old_selection); wxTabMDIChildFrame* old_child = (wxTabMDIChildFrame*)GetPage(old_selection);
wxASSERT_MSG(old_child, wxT("wxTabMDIClientWindow::PageChanged - null page pointer")); wxASSERT_MSG(old_child, wxT("wxTabMDIClientWindow::PageChanged - null page pointer"));
wxActivateEvent event(wxEVT_ACTIVATE, false, old_child->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, old_child->GetId());
event.SetEventObject(old_child); event.SetEventObject(old_child);
old_child->GetEventHandler()->ProcessEvent(event); 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); wxTabMDIChildFrame* active_child = (wxTabMDIChildFrame*)GetPage(new_selection);
wxASSERT_MSG(active_child, wxT("wxTabMDIClientWindow::PageChanged - null page pointer")); wxASSERT_MSG(active_child, wxT("wxTabMDIClientWindow::PageChanged - null page pointer"));
wxActivateEvent event(wxEVT_ACTIVATE, true, active_child->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, active_child->GetId());
event.SetEventObject(active_child); event.SetEventObject(active_child);
active_child->GetEventHandler()->ProcessEvent(event); active_child->GetEventHandler()->ProcessEvent(event);
@@ -717,7 +717,7 @@ void wxTabMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
} }
void wxTabMDIClientWindow::OnSize(wxSizeEvent& evt) void wxTabMDIClientWindow::OnSize(wxSizeEvent& evt)
{ {
wxAuiMultiNotebook::OnSize(evt); wxAuiMultiNotebook::OnSize(evt);
for (size_t pos = 0; pos < GetPageCount(); pos++) for (size_t pos = 0; pos < GetPageCount(); pos++)