Revert the conversion from u32 to size_t from my last commit to reduce compiler warnings in windows.
Fix an issue that made it impossible to close the console and log windows in windows. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5989 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
71d4ece44e
commit
1f119d5e73
|
@ -145,7 +145,7 @@ class CFrame : public CRenderFrame
|
||||||
|
|
||||||
// Utility
|
// Utility
|
||||||
wxWindow * GetNotebookPageFromId(wxWindowID Id);
|
wxWindow * GetNotebookPageFromId(wxWindowID Id);
|
||||||
wxAuiNotebook * GetNotebookFromId(size_t NBId);
|
wxAuiNotebook * GetNotebookFromId(u32 NBId);
|
||||||
int GetNotebookCount();
|
int GetNotebookCount();
|
||||||
wxString GetMenuLabel(int Id);
|
wxString GetMenuLabel(int Id);
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ void CFrame::ToggleConsole(bool bShow)
|
||||||
|
|
||||||
void CFrame::OnToggleWindow(wxCommandEvent& event)
|
void CFrame::OnToggleWindow(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
bool bShow = event.IsChecked();
|
bool bShow = GetMenuBar()->IsChecked(event.GetId());
|
||||||
|
|
||||||
switch(event.GetId())
|
switch(event.GetId())
|
||||||
{
|
{
|
||||||
|
@ -369,7 +369,7 @@ void CFrame::TogglePane()
|
||||||
{
|
{
|
||||||
// Get the first notebook
|
// Get the first notebook
|
||||||
wxAuiNotebook * NB = NULL;
|
wxAuiNotebook * NB = NULL;
|
||||||
for (size_t i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||||
|
@ -506,7 +506,7 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
|
||||||
if (Perspectives.size() > 0)
|
if (Perspectives.size() > 0)
|
||||||
{
|
{
|
||||||
menuPopup->Append(new wxMenuItem(menuPopup));
|
menuPopup->Append(new wxMenuItem(menuPopup));
|
||||||
for (size_t i = 0; i < Perspectives.size(); i++)
|
for (u32 i = 0; i < Perspectives.size(); i++)
|
||||||
{
|
{
|
||||||
wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i,
|
wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i,
|
||||||
wxString::FromAscii(Perspectives[i].Name.c_str()),
|
wxString::FromAscii(Perspectives[i].Name.c_str()),
|
||||||
|
@ -634,7 +634,7 @@ void CFrame::ResetToolbarStyle()
|
||||||
void CFrame::TogglePaneStyle(bool On, int EventId)
|
void CFrame::TogglePaneStyle(bool On, int EventId)
|
||||||
{
|
{
|
||||||
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
||||||
for (size_t i = 0; i < AllPanes.GetCount(); ++i)
|
for (u32 i = 0; i < AllPanes.GetCount(); ++i)
|
||||||
{
|
{
|
||||||
wxAuiPaneInfo& Pane = AllPanes[i];
|
wxAuiPaneInfo& Pane = AllPanes[i];
|
||||||
if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
|
@ -683,7 +683,7 @@ void CFrame::ToggleNotebookStyle(bool On, long Style)
|
||||||
|
|
||||||
void CFrame::OnSelectPerspective(wxCommandEvent& event)
|
void CFrame::OnSelectPerspective(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
size_t _Selection = event.GetId() - IDM_PERSPECTIVES_0;
|
u32 _Selection = event.GetId() - IDM_PERSPECTIVES_0;
|
||||||
if (Perspectives.size() <= _Selection) _Selection = 0;
|
if (Perspectives.size() <= _Selection) _Selection = 0;
|
||||||
ActivePerspective = _Selection;
|
ActivePerspective = _Selection;
|
||||||
DoLoadPerspective();
|
DoLoadPerspective();
|
||||||
|
@ -696,13 +696,12 @@ void CFrame::ResizeConsole()
|
||||||
wxWindow * Win = FindWindowById(IDM_CONSOLEWINDOW);
|
wxWindow * Win = FindWindowById(IDM_CONSOLEWINDOW);
|
||||||
if (!Win) return;
|
if (!Win) return;
|
||||||
|
|
||||||
const int wxBorder = 2, Border = 4, LowerBorder = 6,
|
const int wxBorder = 2, Border = 4,
|
||||||
MenuBar = 30, ScrollBar = 19;
|
MenuBar = 30, ScrollBar = 19;
|
||||||
const int WidthReduction = 30 - Border;
|
|
||||||
|
|
||||||
// Get the client size
|
// Get the client size
|
||||||
int X = Win->GetClientSize().GetX();
|
int X = Win->GetSize().GetX();
|
||||||
int Y = Win->GetClientSize().GetY();
|
int Y = Win->GetSize().GetY();
|
||||||
int InternalWidth = X - wxBorder*2 - ScrollBar;
|
int InternalWidth = X - wxBorder*2 - ScrollBar;
|
||||||
int InternalHeight = Y - wxBorder*2;
|
int InternalHeight = Y - wxBorder*2;
|
||||||
int WindowWidth = InternalWidth + Border*2 +
|
int WindowWidth = InternalWidth + Border*2 +
|
||||||
|
@ -729,7 +728,7 @@ void CFrame::SetPaneSize()
|
||||||
if (Perspectives.size() <= ActivePerspective) return;
|
if (Perspectives.size() <= ActivePerspective) return;
|
||||||
int iClientX = GetSize().GetX(), iClientY = GetSize().GetY();
|
int iClientX = GetSize().GetX(), iClientY = GetSize().GetY();
|
||||||
|
|
||||||
for (size_t i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
||||||
{
|
{
|
||||||
|
@ -737,7 +736,7 @@ void CFrame::SetPaneSize()
|
||||||
if (Perspectives[ActivePerspective].Width.size() <= j ||
|
if (Perspectives[ActivePerspective].Width.size() <= j ||
|
||||||
Perspectives[ActivePerspective].Height.size() <= j)
|
Perspectives[ActivePerspective].Height.size() <= j)
|
||||||
continue;
|
continue;
|
||||||
size_t W = Perspectives[ActivePerspective].Width[j],
|
u32 W = Perspectives[ActivePerspective].Width[j],
|
||||||
H = Perspectives[ActivePerspective].Height[j];
|
H = Perspectives[ActivePerspective].Height[j];
|
||||||
// Check limits
|
// Check limits
|
||||||
W = Limit(W, 5, 95);
|
W = Limit(W, 5, 95);
|
||||||
|
@ -752,7 +751,7 @@ void CFrame::SetPaneSize()
|
||||||
}
|
}
|
||||||
m_Mgr->Update();
|
m_Mgr->Update();
|
||||||
|
|
||||||
for (size_t i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
||||||
{
|
{
|
||||||
|
@ -769,7 +768,7 @@ void CFrame::ReloadPanes()
|
||||||
CloseAllNotebooks();
|
CloseAllNotebooks();
|
||||||
|
|
||||||
// Create new panes with notebooks
|
// Create new panes with notebooks
|
||||||
for (size_t i = 0; i < Perspectives[ActivePerspective].Width.size() - 1; i++)
|
for (u32 i = 0; i < Perspectives[ActivePerspective].Width.size() - 1; i++)
|
||||||
{
|
{
|
||||||
wxString PaneName = wxString::Format(wxT("Pane %i"), i + 1);
|
wxString PaneName = wxString::Format(wxT("Pane %i"), i + 1);
|
||||||
m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide()
|
m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide()
|
||||||
|
@ -816,7 +815,7 @@ void CFrame::LoadIniPerspectives()
|
||||||
ini.Get("Perspectives", "Active", &ActivePerspective, 0);
|
ini.Get("Perspectives", "Active", &ActivePerspective, 0);
|
||||||
SplitString(_Perspectives, ",", VPerspectives);
|
SplitString(_Perspectives, ",", VPerspectives);
|
||||||
|
|
||||||
for (size_t i = 0; i < VPerspectives.size(); i++)
|
for (u32 i = 0; i < VPerspectives.size(); i++)
|
||||||
{
|
{
|
||||||
SPerspectives Tmp;
|
SPerspectives Tmp;
|
||||||
std::string _Section, _Perspective, _Width, _Height;
|
std::string _Section, _Perspective, _Width, _Height;
|
||||||
|
@ -838,12 +837,12 @@ void CFrame::LoadIniPerspectives()
|
||||||
|
|
||||||
SplitString(_Width, ",", _SWidth);
|
SplitString(_Width, ",", _SWidth);
|
||||||
SplitString(_Height, ",", _SHeight);
|
SplitString(_Height, ",", _SHeight);
|
||||||
for (size_t j = 0; j < _SWidth.size(); j++)
|
for (u32 j = 0; j < _SWidth.size(); j++)
|
||||||
{
|
{
|
||||||
int _Tmp;
|
int _Tmp;
|
||||||
if (TryParseInt(_SWidth[j].c_str(), &_Tmp)) Tmp.Width.push_back(_Tmp);
|
if (TryParseInt(_SWidth[j].c_str(), &_Tmp)) Tmp.Width.push_back(_Tmp);
|
||||||
}
|
}
|
||||||
for (size_t j = 0; j < _SHeight.size(); j++)
|
for (u32 j = 0; j < _SHeight.size(); j++)
|
||||||
{
|
{
|
||||||
int _Tmp;
|
int _Tmp;
|
||||||
if (TryParseInt(_SHeight[j].c_str(), &_Tmp)) Tmp.Height.push_back(_Tmp);
|
if (TryParseInt(_SHeight[j].c_str(), &_Tmp)) Tmp.Height.push_back(_Tmp);
|
||||||
|
@ -861,7 +860,7 @@ void CFrame::UpdateCurrentPerspective()
|
||||||
int iClientX = GetSize().GetX(), iClientY = GetSize().GetY();
|
int iClientX = GetSize().GetX(), iClientY = GetSize().GetY();
|
||||||
current->Width.clear();
|
current->Width.clear();
|
||||||
current->Height.clear();
|
current->Height.clear();
|
||||||
for (size_t i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->
|
if (!m_Mgr->GetAllPanes()[i].window->
|
||||||
IsKindOf(CLASSINFO(wxAuiToolBar)))
|
IsKindOf(CLASSINFO(wxAuiToolBar)))
|
||||||
|
@ -892,7 +891,7 @@ void CFrame::SaveIniPerspectives()
|
||||||
|
|
||||||
// Save perspective names
|
// Save perspective names
|
||||||
std::string STmp = "";
|
std::string STmp = "";
|
||||||
for (size_t i = 0; i < Perspectives.size(); i++)
|
for (u32 i = 0; i < Perspectives.size(); i++)
|
||||||
{
|
{
|
||||||
STmp += Perspectives[i].Name + ",";
|
STmp += Perspectives[i].Name + ",";
|
||||||
}
|
}
|
||||||
|
@ -901,13 +900,13 @@ void CFrame::SaveIniPerspectives()
|
||||||
ini.Set("Perspectives", "Active", ActivePerspective);
|
ini.Set("Perspectives", "Active", ActivePerspective);
|
||||||
|
|
||||||
// Save the perspectives
|
// Save the perspectives
|
||||||
for (size_t i = 0; i < Perspectives.size(); i++)
|
for (u32 i = 0; i < Perspectives.size(); i++)
|
||||||
{
|
{
|
||||||
std::string _Section = "P - " + Perspectives[i].Name;
|
std::string _Section = "P - " + Perspectives[i].Name;
|
||||||
ini.Set(_Section.c_str(), "Perspective", Perspectives[i].Perspective.mb_str());
|
ini.Set(_Section.c_str(), "Perspective", Perspectives[i].Perspective.mb_str());
|
||||||
|
|
||||||
std::string SWidth = "", SHeight = "";
|
std::string SWidth = "", SHeight = "";
|
||||||
for (size_t j = 0; j < Perspectives[i].Width.size(); j++)
|
for (u32 j = 0; j < Perspectives[i].Width.size(); j++)
|
||||||
{
|
{
|
||||||
SWidth += StringFromFormat("%i,", Perspectives[i].Width[j]);
|
SWidth += StringFromFormat("%i,", Perspectives[i].Width[j]);
|
||||||
SHeight += StringFromFormat("%i,", Perspectives[i].Height[j]);
|
SHeight += StringFromFormat("%i,", Perspectives[i].Height[j]);
|
||||||
|
@ -943,12 +942,12 @@ void CFrame::AddPane()
|
||||||
|
|
||||||
wxWindow * CFrame::GetNotebookPageFromId(wxWindowID Id)
|
wxWindow * CFrame::GetNotebookPageFromId(wxWindowID Id)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
continue;
|
continue;
|
||||||
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||||
for(size_t j = 0; j < NB->GetPageCount(); j++)
|
for(u32 j = 0; j < NB->GetPageCount(); j++)
|
||||||
{
|
{
|
||||||
if (NB->GetPage(j)->GetId() == Id) return NB->GetPage(j);
|
if (NB->GetPage(j)->GetId() == Id) return NB->GetPage(j);
|
||||||
}
|
}
|
||||||
|
@ -999,12 +998,12 @@ wxAuiNotebook* CFrame::CreateEmptyNotebook()
|
||||||
|
|
||||||
void CFrame::AddRemoveBlankPage()
|
void CFrame::AddRemoveBlankPage()
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
continue;
|
continue;
|
||||||
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||||
for(size_t j = 0; j < NB->GetPageCount(); j++)
|
for(u32 j = 0; j < NB->GetPageCount(); j++)
|
||||||
{
|
{
|
||||||
if (NB->GetPageText(j).IsSameAs(wxT("<>")) && NB->GetPageCount() > 1)
|
if (NB->GetPageText(j).IsSameAs(wxT("<>")) && NB->GetPageCount() > 1)
|
||||||
NB->DeletePage(j);
|
NB->DeletePage(j);
|
||||||
|
@ -1016,12 +1015,12 @@ void CFrame::AddRemoveBlankPage()
|
||||||
|
|
||||||
int CFrame::GetNotebookAffiliation(wxWindowID Id)
|
int CFrame::GetNotebookAffiliation(wxWindowID Id)
|
||||||
{
|
{
|
||||||
for (size_t i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
continue;
|
continue;
|
||||||
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes()[i].window;
|
||||||
for(size_t k = 0; k < NB->GetPageCount(); k++)
|
for(u32 k = 0; k < NB->GetPageCount(); k++)
|
||||||
{
|
{
|
||||||
if (NB->GetPage(k)->GetId() == Id)
|
if (NB->GetPage(k)->GetId() == Id)
|
||||||
return j;
|
return j;
|
||||||
|
@ -1035,7 +1034,7 @@ int CFrame::GetNotebookAffiliation(wxWindowID Id)
|
||||||
void CFrame::CloseAllNotebooks()
|
void CFrame::CloseAllNotebooks()
|
||||||
{
|
{
|
||||||
wxAuiPaneInfoArray AllPanes = m_Mgr->GetAllPanes();
|
wxAuiPaneInfoArray AllPanes = m_Mgr->GetAllPanes();
|
||||||
for (size_t i = 0; i < AllPanes.GetCount(); i++)
|
for (u32 i = 0; i < AllPanes.GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (AllPanes[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (AllPanes[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
{
|
{
|
||||||
|
@ -1048,7 +1047,7 @@ void CFrame::CloseAllNotebooks()
|
||||||
int CFrame::GetNotebookCount()
|
int CFrame::GetNotebookCount()
|
||||||
{
|
{
|
||||||
int Ret = 0;
|
int Ret = 0;
|
||||||
for (size_t i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
Ret++;
|
Ret++;
|
||||||
|
@ -1056,9 +1055,9 @@ int CFrame::GetNotebookCount()
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxAuiNotebook * CFrame::GetNotebookFromId(size_t NBId)
|
wxAuiNotebook * CFrame::GetNotebookFromId(u32 NBId)
|
||||||
{
|
{
|
||||||
for (size_t i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (!m_Mgr->GetAllPanes()[i].window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue