use wx_static_cast() instead of static_cast<> on an off chance that some compiler still doesn't have the latter; fix svn properties for the new file

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-08-23 16:19:16 +00:00
parent a4c76fe11e
commit e50f48d518
4 changed files with 2670 additions and 2669 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1006,7 +1006,7 @@ wxAuiSimpleTabArt::~wxAuiSimpleTabArt()
wxAuiTabArt* wxAuiSimpleTabArt::Clone() wxAuiTabArt* wxAuiSimpleTabArt::Clone()
{ {
return static_cast<wxAuiTabArt*>(new wxAuiSimpleTabArt); return wx_static_cast(wxAuiTabArt*, new wxAuiSimpleTabArt);
} }

View File

@@ -761,7 +761,7 @@ void wxAuiManager::UpdateHintWindowConfig()
{ {
if (w->IsKindOf(CLASSINFO(wxFrame))) if (w->IsKindOf(CLASSINFO(wxFrame)))
{ {
wxFrame* f = static_cast<wxFrame*>(w); wxFrame* f = wx_static_cast(wxFrame*, w);
can_do_transparent = f->CanSetTransparent(); can_do_transparent = f->CanSetTransparent();
break; break;
} }
@@ -927,7 +927,7 @@ void wxAuiManager::SetArtProvider(wxAuiDockArt* art_provider)
bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info) bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
{ {
wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed")); wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed"));
// check if the pane has a valid window // check if the pane has a valid window
if (!window) if (!window)
return false; return false;
@@ -995,7 +995,7 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
button.button_id = wxAUI_BUTTON_CLOSE; button.button_id = wxAUI_BUTTON_CLOSE;
pinfo.buttons.Add(button); pinfo.buttons.Add(button);
} }
if (pinfo.HasGripper()) if (pinfo.HasGripper())
{ {
if (pinfo.window->IsKindOf(CLASSINFO(wxAuiToolBar))) if (pinfo.window->IsKindOf(CLASSINFO(wxAuiToolBar)))
@@ -1004,13 +1004,13 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
// have a gripper control. The toolbar's built-in gripper // have a gripper control. The toolbar's built-in gripper
// meshes better with the look and feel of the control than ours, // meshes better with the look and feel of the control than ours,
// so turn wxAuiManager's gripper off, and the toolbar's on. // so turn wxAuiManager's gripper off, and the toolbar's on.
wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(pinfo.window); wxAuiToolBar* tb = wx_static_cast(wxAuiToolBar*, pinfo.window);
pinfo.SetFlag(wxAuiPaneInfo::optionGripper, false); pinfo.SetFlag(wxAuiPaneInfo::optionGripper, false);
tb->SetGripperVisible(true); tb->SetGripperVisible(true);
} }
} }
if (pinfo.best_size == wxDefaultSize && if (pinfo.best_size == wxDefaultSize &&
pinfo.window) pinfo.window)
@@ -1043,7 +1043,7 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
} }
return true; return true;
} }
@@ -2336,7 +2336,7 @@ wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes,
cont->Add(middle, 1, wxEXPAND); cont->Add(middle, 1, wxEXPAND);
else else
delete middle; delete middle;
// find any bottom docks in this layer // find any bottom docks in this layer
@@ -3823,7 +3823,7 @@ void wxAuiManager::OnFindManager(wxAuiManagerEvent& evt)
// if we are managing a child frame, get the 'real' manager // if we are managing a child frame, get the 'real' manager
if (window->IsKindOf(CLASSINFO(wxAuiFloatingFrame))) if (window->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
{ {
wxAuiFloatingFrame* float_frame = static_cast<wxAuiFloatingFrame*>(window); wxAuiFloatingFrame* float_frame = wx_static_cast(wxAuiFloatingFrame*, window);
evt.SetManager(float_frame->GetOwnerManager()); evt.SetManager(float_frame->GetOwnerManager());
return; return;
} }
@@ -4201,7 +4201,7 @@ void wxAuiManager::OnLeftUp(wxMouseEvent& event)
{ {
m_hover_button = NULL; m_hover_button = NULL;
m_frame->ReleaseMouse(); m_frame->ReleaseMouse();
if (m_action_part) if (m_action_part)
{ {
UpdateButtonOnScreen(m_action_part, event); UpdateButtonOnScreen(m_action_part, event);

View File

@@ -128,13 +128,13 @@ wxAuiTabArt* wxAuiMDIParentFrame::GetArtProvider()
{ {
if (!m_pClientWindow) if (!m_pClientWindow)
return NULL; return NULL;
return m_pClientWindow->GetArtProvider(); return m_pClientWindow->GetArtProvider();
} }
wxAuiNotebook* wxAuiMDIParentFrame::GetNotebook() const wxAuiNotebook* wxAuiMDIParentFrame::GetNotebook() const
{ {
return static_cast<wxAuiNotebook*>(m_pClientWindow); return wx_static_cast(wxAuiNotebook*, m_pClientWindow);
} }
@@ -205,7 +205,7 @@ bool wxAuiMDIParentFrame::ProcessEvent(wxEvent& event)
if (m_pLastEvt == &event) if (m_pLastEvt == &event)
return false; return false;
m_pLastEvt = &event; m_pLastEvt = &event;
// let the active child (if any) process the event first. // let the active child (if any) process the event first.
bool res = false; bool res = false;
if (m_pActiveChild && if (m_pActiveChild &&
@@ -357,11 +357,11 @@ void wxAuiMDIParentFrame::Tile(wxOrientation orient)
{ {
wxAuiMDIClientWindow* client_window = GetClientWindow(); wxAuiMDIClientWindow* client_window = GetClientWindow();
wxASSERT_MSG(client_window, wxT("Missing MDI Client Window")); wxASSERT_MSG(client_window, wxT("Missing MDI Client Window"));
int cur_idx = client_window->GetSelection(); int cur_idx = client_window->GetSelection();
if (cur_idx == -1) if (cur_idx == -1)
return; return;
if (orient == wxVERTICAL) if (orient == wxVERTICAL)
{ {
client_window->Split(cur_idx, wxLEFT); client_window->Split(cur_idx, wxLEFT);
@@ -399,7 +399,7 @@ wxAuiMDIChildFrame::wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent,
const wxString& name) const wxString& name)
{ {
Init(); Init();
// There are two ways to create an tabbed mdi child fram without // There are two ways to create an tabbed mdi child fram without
// making it the active document. Either Show(false) can be called // making it the active document. Either Show(false) can be called
// before Create() (as is customary on some ports with wxFrame-type // before Create() (as is customary on some ports with wxFrame-type
@@ -409,7 +409,7 @@ wxAuiMDIChildFrame::wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent,
// onto the panel underneath. // onto the panel underneath.
if (style & wxMINIMIZE) if (style & wxMINIMIZE)
m_activate_on_create = false; m_activate_on_create = false;
Create(parent, id, title, wxDefaultPosition, size, 0, name); Create(parent, id, title, wxDefaultPosition, size, 0, name);
} }
@@ -431,7 +431,7 @@ wxAuiMDIChildFrame::~wxAuiMDIChildFrame()
pClientWindow->RemovePage(idx); pClientWindow->RemovePage(idx);
} }
} }
#if wxUSE_MENUS #if wxUSE_MENUS
wxDELETE(m_pMenuBar); wxDELETE(m_pMenuBar);
#endif // wxUSE_MENUS #endif // wxUSE_MENUS
@@ -472,7 +472,7 @@ bool wxAuiMDIChildFrame::Create(wxAuiMDIParentFrame* parent,
pClientWindow->AddPage(this, title, m_activate_on_create); pClientWindow->AddPage(this, title, m_activate_on_create);
pClientWindow->Refresh(); pClientWindow->Refresh();
return true; return true;
} }
@@ -490,7 +490,7 @@ bool wxAuiMDIChildFrame::Destroy()
wxActivateEvent event(wxEVT_ACTIVATE, false, GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
pParentFrame->SetActiveChild(NULL); pParentFrame->SetActiveChild(NULL);
pParentFrame->SetChildMenuBar(NULL); pParentFrame->SetChildMenuBar(NULL);
} }
@@ -578,15 +578,15 @@ void wxAuiMDIChildFrame::SetIcon(const wxIcon& icon)
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
m_icon = icon; m_icon = icon;
wxBitmap bmp; wxBitmap bmp;
bmp.CopyFromIcon(m_icon); bmp.CopyFromIcon(m_icon);
wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow();
if (pClientWindow != NULL) if (pClientWindow != NULL)
{ {
int idx = pClientWindow->GetPageIndex(this); int idx = pClientWindow->GetPageIndex(this);
if (idx != -1) if (idx != -1)
{ {
pClientWindow->SetPageBitmap((size_t)idx, bmp); pClientWindow->SetPageBitmap((size_t)idx, bmp);
@@ -598,8 +598,8 @@ const wxIcon& wxAuiMDIChildFrame::GetIcon() const
{ {
return m_icon; return m_icon;
} }
void wxAuiMDIChildFrame::Activate() void wxAuiMDIChildFrame::Activate()
{ {
wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame();
@@ -667,7 +667,7 @@ void wxAuiMDIChildFrame::Init()
bool wxAuiMDIChildFrame::Show(bool show) bool wxAuiMDIChildFrame::Show(bool show)
{ {
m_activate_on_create = show; m_activate_on_create = show;
// do nothing // do nothing
return true; return true;
} }
@@ -732,11 +732,11 @@ bool wxAuiMDIClientWindow::CreateClient(wxAuiMDIParentFrame* parent, long style)
{ {
SetWindowStyleFlag(style); SetWindowStyleFlag(style);
wxSize caption_icon_size = wxSize caption_icon_size =
wxSize(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X), wxSize(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X),
wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y)); wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y));
SetUniformBitmapSize(caption_icon_size); SetUniformBitmapSize(caption_icon_size);
if (!wxAuiNotebook::Create(parent, if (!wxAuiNotebook::Create(parent,
wxID_ANY, wxID_ANY,
wxPoint(0,0), wxPoint(0,0),
@@ -764,7 +764,7 @@ void wxAuiMDIClientWindow::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)
@@ -773,8 +773,8 @@ void wxAuiMDIClientWindow::PageChanged(int old_selection, int new_selection)
if (child->GetMDIParentFrame()->GetActiveChild() == child) if (child->GetMDIParentFrame()->GetActiveChild() == child)
return; return;
}*/ }*/
// notify old active child that it has been deactivated // notify old active child that it has been deactivated
if ((old_selection != -1) && (old_selection < (int)GetPageCount())) if ((old_selection != -1) && (old_selection < (int)GetPageCount()))
{ {
@@ -785,34 +785,34 @@ void wxAuiMDIClientWindow::PageChanged(int old_selection, int new_selection)
event.SetEventObject(old_child); event.SetEventObject(old_child);
old_child->GetEventHandler()->ProcessEvent(event); old_child->GetEventHandler()->ProcessEvent(event);
} }
// notify new active child that it has been activated // notify new active child that it has been activated
if (new_selection != -1) if (new_selection != -1)
{ {
wxAuiMDIChildFrame* active_child = (wxAuiMDIChildFrame*)GetPage(new_selection); wxAuiMDIChildFrame* active_child = (wxAuiMDIChildFrame*)GetPage(new_selection);
wxASSERT_MSG(active_child, wxT("wxAuiMDIClientWindow::PageChanged - null page pointer")); wxASSERT_MSG(active_child, wxT("wxAuiMDIClientWindow::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);
if (active_child->GetMDIParentFrame()) if (active_child->GetMDIParentFrame())
{ {
active_child->GetMDIParentFrame()->SetActiveChild(active_child); active_child->GetMDIParentFrame()->SetActiveChild(active_child);
active_child->GetMDIParentFrame()->SetChildMenuBar(active_child); active_child->GetMDIParentFrame()->SetChildMenuBar(active_child);
} }
} }
} }
void wxAuiMDIClientWindow::OnPageClose(wxAuiNotebookEvent& evt) void wxAuiMDIClientWindow::OnPageClose(wxAuiNotebookEvent& evt)
{ {
wxAuiMDIChildFrame* wnd; wxAuiMDIChildFrame*
wnd = static_cast<wxAuiMDIChildFrame*>(GetPage(evt.GetSelection())); wnd = wx_static_cast(wxAuiMDIChildFrame*, GetPage(evt.GetSelection()));
wnd->Close(); wnd->Close();
// regardless of the result of wnd->Close(), we've // regardless of the result of wnd->Close(), we've
// already taken care of the close operations, so // already taken care of the close operations, so
// suppress further processing // suppress further processing
@@ -832,5 +832,6 @@ void wxAuiMDIClientWindow::OnSize(wxSizeEvent& evt)
((wxAuiMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect(); ((wxAuiMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect();
} }
#endif //wxUSE_AUI
#endif // wxUSE_MDI #endif // wxUSE_MDI
#endif // wxUSE_AUI