Fix up wxw asserts and exceptions caused by: the "booting..." msg, hacked up tooltips in the debugger, and the staticbitmaps in wiimoteframe.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1479 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2008-12-10 08:57:57 +00:00
parent 2cbef47d0e
commit 514826f282
12 changed files with 90 additions and 236 deletions

View File

@ -100,26 +100,8 @@ EVT_MENU(IDM_TOGGLE_DUALCORE, CFrame::OnToggleDualCore)
EVT_MENU(IDM_TOGGLE_SKIPIDLE, CFrame::OnToggleSkipIdle)
EVT_MENU(IDM_TOGGLE_TOOLBAR, CFrame::OnToggleToolbar)
EVT_MENU(IDM_TOGGLE_STATUSBAR, CFrame::OnToggleStatusbar)
EVT_MENU(IDM_LOADSLOT1, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT2, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT3, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT4, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT5, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT6, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT7, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT8, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT9, CFrame::OnLoadState)
EVT_MENU(IDM_LOADSLOT10, CFrame::OnLoadState)
EVT_MENU(IDM_SAVESLOT1, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT2, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT3, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT4, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT5, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT6, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT7, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT8, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT9, CFrame::OnSaveState)
EVT_MENU(IDM_SAVESLOT10, CFrame::OnSaveState)
EVT_MENU_RANGE(IDM_LOADSLOT1, IDM_LOADSLOT10, CFrame::OnLoadState)
EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT10, CFrame::OnSaveState)
EVT_SIZE(CFrame::MoveIcons)
EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage)
END_EVENT_TABLE()
@ -144,7 +126,6 @@ CFrame::CFrame(wxFrame* parent,
, m_Panel(NULL)
, m_pStatusBar(NULL)
, m_pMenuBar(NULL)
, m_pBootProcessDialog(NULL)
, HaveLeds(false), HaveSpeakers(false)
{
InitBitmaps();
@ -209,10 +190,6 @@ WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
#endif
// =======================================================
// Create menu items
// -------------
@ -420,6 +397,12 @@ void CFrame::OnHelp(wxCommandEvent& event)
// -------------
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
{
// shuffle2: wxBusyInfo is meant to be created on the stack
// and only stay around for the life of the scope it's in.
// If that is not what we want, find another solution. I don't
// think such a dialog is needed anyways, so maybe kill it?
wxBusyInfo bootingDialog(wxString::FromAscii("Booting..."), this);
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
if (Core::GetState() == Core::CORE_RUN)
@ -538,43 +521,16 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
{
switch (event.GetId())
{
case IDM_UPDATEGUI:
UpdateGUI();
break;
case IDM_UPDATEGUI:
UpdateGUI();
break;
case IDM_BOOTING_STARTED:
if (m_pBootProcessDialog == NULL)
{
/* m_pBootProcessDialog = new wxProgressDialog
(_T("Booting the core"),
_T("Booting..."),
1, // range
this,
wxPD_APP_MODAL |
// wxPD_AUTO_HIDE | -- try this as well
wxPD_ELAPSED_TIME |
wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small
);*/
m_pBootProcessDialog = new wxBusyInfo(wxString::FromAscii("Booting..."), this);
}
break;
case IDM_BOOTING_ENDED:
if (m_pBootProcessDialog != NULL)
{
// m_pBootProcessDialog->Destroy();
delete m_pBootProcessDialog;
m_pBootProcessDialog = NULL;
}
break;
case IDM_UPDATESTATUSBAR:
if (m_pStatusBar != NULL)
{
m_pStatusBar->SetStatusText(event.GetString(), event.GetInt());
}
break;
case IDM_UPDATESTATUSBAR:
if (m_pStatusBar != NULL)
{
m_pStatusBar->SetStatusText(event.GetString(), event.GetInt());
}
break;
}
}

View File

@ -120,8 +120,6 @@ class CFrame : public wxFrame
wxMenuItem* m_pMenuItemSave;
wxToolBarToolBase* m_pToolPlay;
wxBusyInfo* m_pBootProcessDialog;
void UpdateGUI();

View File

@ -44,7 +44,7 @@ namespace WiimoteLeds
int SPEAKER_SIZE_X = 8;
int SPEAKER_SIZE_Y = 8;
int ConnectionStatusWidth = 103;
int ConnectionStatusWidth = 103; // This needs to be wider, for vista at least
int ConnectionStatusOnlyAdj = 7;
int RightmostMargin = 6;
int SpIconMargin = 11;
@ -104,17 +104,6 @@ void CFrame::ModifyStatusBar()
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{ LedsOn = false; SpeakersOn = false; }
/* For some reason the Debug build of wxWidgets can't use these bitmaps so it will
produce a "assert "wxWidgets Debug Alert, bmp.Ok()" failed" message and show
blank bitmaps. I check that wxUSE_STATBMP was enabled even for Debug builds so
I don't see why it wouldn't work. You can uncomment this if you find the bug.
In my case the same thing occured for CFrame::InitBitmaps() so it was not just
thse bitmaps that failed. So even with this comment you may get that warning. */
#ifdef _DEBUG
LedsOn = false; SpeakersOn = false;
#endif
// Declarations
int Fields;
int *Widths;
@ -165,6 +154,11 @@ void CFrame::ModifyStatusBar()
}
}
// Update the settings
m_pStatusBar->SetFieldsCount(Fields);
m_pStatusBar->SetStatusWidths(Fields, Widths);
m_pStatusBar->SetStatusStyles(Fields, StylesFields);
/* Destroy and create all, and check for HaveLeds and HaveSpeakers in case we have
gotten a confirmed on or off setting, in which case we don't do anything */
if(!LedsOn && HaveLeds) CreateDestroy(DESTROYLEDS);
@ -172,11 +166,6 @@ void CFrame::ModifyStatusBar()
if(LedsOn && !HaveLeds) CreateDestroy(CREATELEDS);
if(SpeakersOn && !HaveSpeakers) CreateDestroy(CREATESPEAKERS);
// Update the settings
m_pStatusBar->SetFieldsCount(Fields);
m_pStatusBar->SetStatusWidths(Fields, Widths);
m_pStatusBar->SetStatusStyles(Fields, StylesFields);
DoMoveIcons();
m_pStatusBar->Refresh(); // avoid small glitches that can occur
}
@ -192,7 +181,7 @@ void CFrame::CreateDestroy(int Case)
case CREATELEDS:
{
CreateLeds();
//UpdateLeds(g_Leds);
UpdateLeds();
HaveLeds = true;
break;
}

View File

@ -72,8 +72,6 @@ enum
IDM_UPDATESTATUSBAR,
IDM_UPDATEBREAKPOINTS,
IDM_HOST_MESSAGE,
IDM_BOOTING_STARTED,
IDM_BOOTING_ENDED,
IDM_HELPABOUT,
IDM_HELPWEBSITE,
IDM_HELPGOOGLECODE,

View File

@ -267,30 +267,6 @@ bool wxPanicAlert(const char* text, bool /*yes_no*/)
}
void Host_BootingStarted()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_BOOTING_STARTED);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
void Host_BootingEnded()
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_BOOTING_ENDED);
wxPostEvent(main_frame, event);
if (g_pCodeWindow)
{
wxPostEvent(g_pCodeWindow, event);
}
}
// OK, this thread boundary is DANGEROUS on linux
// wxPostEvent / wxAddPendingEvent is the solution.
void Host_NotifyMapLoaded()

View File

@ -26,12 +26,6 @@ bool wxPanicAlert(const char* text, bool /*yes_no*/)
}
void Host_BootingStarted(){}
void Host_BootingEnded(){}
// OK, this thread boundary is DANGEROUS on linux
// wxPostEvent / wxAddPendingEvent is the solution.
void Host_NotifyMapLoaded(){}