nJoy: GUI fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@108 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Laurence Muller 2008-07-30 22:17:45 +00:00
parent 059b56043b
commit fb7a7f9001
2 changed files with 31 additions and 38 deletions

View File

@ -149,6 +149,8 @@ void ConfigBox::CreateGUIControls()
arrayStringFor_Deadzone.Add(wxString::FromAscii(buffer)); arrayStringFor_Deadzone.Add(wxString::FromAscii(buffer));
} }
wxBitmap WxStaticBitmap1_BITMAP(ConfigBox_WxStaticBitmap1_XPM);
for(int i=0; i<4 ;i++) for(int i=0; i<4 ;i++)
{ {
// Groups // Groups
@ -186,13 +188,13 @@ void ConfigBox::CreateGUIControls()
m_bJoyDpadLeft[i] = new wxButton(m_Controller[i], IDB_DPAD_LEFT, wxT(""), wxPoint(70, 371), wxSize(21, 14), 0, wxDefaultValidator, wxT("")); m_bJoyDpadLeft[i] = new wxButton(m_Controller[i], IDB_DPAD_LEFT, wxT(""), wxPoint(70, 371), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
m_bJoyDpadRight[i] = new wxButton(m_Controller[i], IDB_DPAD_RIGHT, wxT(""), wxPoint(70, 408), wxSize(21, 14), 0, wxDefaultValidator, wxT("")); m_bJoyDpadRight[i] = new wxButton(m_Controller[i], IDB_DPAD_RIGHT, wxT(""), wxPoint(70, 408), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
m_textMainX = new wxStaticText(m_Controller[i], IDT_ANALOG_MAIN_X, wxT("X-axis"), wxPoint(6, 204), wxDefaultSize, 0, wxT("X-axis")); m_textMainX[i] = new wxStaticText(m_Controller[i], IDT_ANALOG_MAIN_X, wxT("X-axis"), wxPoint(6, 204), wxDefaultSize, 0, wxT("X-axis"));
m_textMainY = new wxStaticText(m_Controller[i], IDT_ANALOG_MAIN_Y, wxT("Y-axis"), wxPoint(6, 241), wxDefaultSize, 0, wxT("Y-axis")); m_textMainY[i] = new wxStaticText(m_Controller[i], IDT_ANALOG_MAIN_Y, wxT("Y-axis"), wxPoint(6, 241), wxDefaultSize, 0, wxT("Y-axis"));
m_textDpadUp = new wxStaticText(m_Controller[i], IDT_DPAD_UP, wxT("Up"), wxPoint(6, 282), wxDefaultSize, 0, wxT("Up")); m_textDpadUp[i] = new wxStaticText(m_Controller[i], IDT_DPAD_UP, wxT("Up"), wxPoint(6, 282), wxDefaultSize, 0, wxT("Up"));
m_textDpadDown = new wxStaticText(m_Controller[i], IDT_DPAD_DOWN, wxT("Down"), wxPoint(6, 319), wxDefaultSize, 0, wxT("Down")); m_textDpadDown[i] = new wxStaticText(m_Controller[i], IDT_DPAD_DOWN, wxT("Down"), wxPoint(6, 319), wxDefaultSize, 0, wxT("Down"));
m_textDpadLeft = new wxStaticText(m_Controller[i], IDT_DPAD_LEFT, wxT("Left"), wxPoint(6, 354), wxDefaultSize, 0, wxT("Left")); m_textDpadLeft[i] = new wxStaticText(m_Controller[i], IDT_DPAD_LEFT, wxT("Left"), wxPoint(6, 354), wxDefaultSize, 0, wxT("Left"));
m_textDpadRight = new wxStaticText(m_Controller[i], IDT_DPAD_RIGHT, wxT("Right"), wxPoint(6, 391), wxDefaultSize, 0, wxT("Right")); m_textDpadRight[i] = new wxStaticText(m_Controller[i], IDT_DPAD_RIGHT, wxT("Right"), wxPoint(6, 391), wxDefaultSize, 0, wxT("Right"));
// GUI right side buttons // GUI right side buttons
m_JoyShoulderR[i] = new wxTextCtrl(m_Controller[i], ID_SHOULDER_R, wxT("0"), wxPoint(552, 106), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0")); m_JoyShoulderR[i] = new wxTextCtrl(m_Controller[i], ID_SHOULDER_R, wxT("0"), wxPoint(552, 106), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
@ -221,8 +223,8 @@ void ConfigBox::CreateGUIControls()
m_bJoyAnalogSubX[i] = new wxButton(m_Controller[i], IDB_ANALOG_SUB_X, wxT(""), wxPoint(526, 353), wxSize(21, 14), 0, wxDefaultValidator, wxT("")); m_bJoyAnalogSubX[i] = new wxButton(m_Controller[i], IDB_ANALOG_SUB_X, wxT(""), wxPoint(526, 353), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
m_bJoyAnalogSubY[i] = new wxButton(m_Controller[i], IDB_ANALOG_SUB_Y, wxT(""), wxPoint(526, 390), wxSize(21, 14), 0, wxDefaultValidator, wxT("")); m_bJoyAnalogSubY[i] = new wxButton(m_Controller[i], IDB_ANALOG_SUB_Y, wxT(""), wxPoint(526, 390), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
m_textSubX = new wxStaticText(m_Controller[i], IDT_ANALOG_SUB_X, wxT("X-axis"), wxPoint(552, 336), wxDefaultSize, 0, wxT("X-axis")); m_textSubX[i] = new wxStaticText(m_Controller[i], IDT_ANALOG_SUB_X, wxT("X-axis"), wxPoint(552, 336), wxDefaultSize, 0, wxT("X-axis"));
m_textSubY = new wxStaticText(m_Controller[i], IDT_ANALOG_SUB_Y, wxT("Y-axis"), wxPoint(552, 373), wxDefaultSize, 0, wxT("Y-axis")); m_textSubY[i] = new wxStaticText(m_Controller[i], IDT_ANALOG_SUB_Y, wxT("Y-axis"), wxPoint(552, 373), wxDefaultSize, 0, wxT("Y-axis"));
// GUI center button // GUI center button
m_JoyButtonStart[i] = new wxTextCtrl(m_Controller[i], ID_BUTTONSTART, wxT("0"), wxPoint(278, 403), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0")); m_JoyButtonStart[i] = new wxTextCtrl(m_Controller[i], ID_BUTTONSTART, wxT("0"), wxPoint(278, 403), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
@ -233,9 +235,9 @@ void ConfigBox::CreateGUIControls()
m_bJoyButtonStart[i] = new wxButton(m_Controller[i], IDB_BUTTONSTART, wxT(""), wxPoint(297, 385), wxSize(21, 14), 0, wxDefaultValidator, wxT("")); m_bJoyButtonStart[i] = new wxButton(m_Controller[i], IDB_BUTTONSTART, wxT(""), wxPoint(297, 385), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
m_bJoyButtonHalfpress[i] = new wxButton(m_Controller[i], IDB_BUTTONHALFPRESS, wxT(""), wxPoint(231, 426), wxSize(21, 14), 0, wxDefaultValidator, wxT("")); m_bJoyButtonHalfpress[i] = new wxButton(m_Controller[i], IDB_BUTTONHALFPRESS, wxT(""), wxPoint(231, 426), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
m_textDeadzone = new wxStaticText(m_Controller[i], IDT_DEADZONE, wxT("Deadzone"), wxPoint(116, 404), wxDefaultSize, 0, wxT("Deadzone")); m_textDeadzone[i] = new wxStaticText(m_Controller[i], IDT_DEADZONE, wxT("Deadzone"), wxPoint(116, 404), wxDefaultSize, 0, wxT("Deadzone"));
m_textHalfpress = new wxStaticText(m_Controller[i], IDT_BUTTONHALFPRESS, wxT("Half press"), wxPoint(116, 428), wxDefaultSize, 0, wxT("Half press")); m_textHalfpress[i] = new wxStaticText(m_Controller[i], IDT_BUTTONHALFPRESS, wxT("Half press"), wxPoint(116, 428), wxDefaultSize, 0, wxT("Half press"));
m_textWebsite = new wxStaticText(m_Controller[i], IDT_WEBSITE, wxT("www.multigesture.net"), wxPoint(500, 438), wxDefaultSize, 0, wxT("www.multigesture.net")); m_textWebsite[i] = new wxStaticText(m_Controller[i], IDT_WEBSITE, wxT("www.multigesture.net"), wxPoint(500, 438), wxDefaultSize, 0, wxT("www.multigesture.net"));
// TODO: Controller image // TODO: Controller image
// Placeholder instead of bitmap // Placeholder instead of bitmap
@ -244,8 +246,7 @@ void ConfigBox::CreateGUIControls()
// You can enable the bitmap here: // You can enable the bitmap here:
// But it loads überslow on init... // But it loads überslow on init...
// AAaaand the XPM file (256 colours) looks crappier than the real bitmap... so maybe we can find a way to use a bitmap? // AAaaand the XPM file (256 colours) looks crappier than the real bitmap... so maybe we can find a way to use a bitmap?
wxBitmap WxStaticBitmap1_BITMAP(ConfigBox_WxStaticBitmap1_XPM);
m_controllerimage[i] = new wxStaticBitmap(m_Controller[i], ID_CONTROLLERPICTURE, WxStaticBitmap1_BITMAP, wxPoint(98, 75), wxSize(421,304)); m_controllerimage[i] = new wxStaticBitmap(m_Controller[i], ID_CONTROLLERPICTURE, WxStaticBitmap1_BITMAP, wxPoint(98, 75), wxSize(421,304));
if(emulator_running) if(emulator_running)
@ -390,14 +391,10 @@ void ConfigBox::UpdateVisibleItems(int controller)
m_bJoyDpadLeft[controller]->Show(TRUE); m_bJoyDpadLeft[controller]->Show(TRUE);
m_bJoyDpadRight[controller]->Show(TRUE); m_bJoyDpadRight[controller]->Show(TRUE);
/*
// not working? wtf?
// TODO: Fix
m_textDpadUp[controller]->Show(TRUE); m_textDpadUp[controller]->Show(TRUE);
m_textDpadDown[controller]->Show(TRUE); m_textDpadDown[controller]->Show(TRUE);
m_textDpadLeft[controller]->Show(TRUE); m_textDpadLeft[controller]->Show(TRUE);
m_textDpadRight[controller]->Show(TRUE); m_textDpadRight[controller]->Show(TRUE);
*/
} }
else else
{ {
@ -409,14 +406,10 @@ void ConfigBox::UpdateVisibleItems(int controller)
m_bJoyDpadLeft[controller]->Show(FALSE); m_bJoyDpadLeft[controller]->Show(FALSE);
m_bJoyDpadRight[controller]->Show(FALSE); m_bJoyDpadRight[controller]->Show(FALSE);
/*
// not working? wtf?
// TODO: Fix
m_textDpadUp[controller]->Show(FALSE); m_textDpadUp[controller]->Show(FALSE);
m_textDpadDown[controller]->Show(FALSE); m_textDpadDown[controller]->Show(FALSE);
m_textDpadLeft[controller]->Show(FALSE); m_textDpadLeft[controller]->Show(FALSE);
m_textDpadRight[controller]->Show(FALSE); m_textDpadRight[controller]->Show(FALSE);
*/
} }
} }
@ -555,8 +548,6 @@ void ConfigBox::SetButtonText(int id, char text[128])
default: default:
break; break;
} }
// TODO: Hmm why doesnt it updates the GUI immediately?
} }
// Wait for button press // Wait for button press
@ -586,8 +577,9 @@ void ConfigBox::GetButtons(wxCommandEvent& event)
int counter2 = 10; int counter2 = 10;
sprintf(format, "[%d]", counter2); sprintf(format, "[%d]", counter2);
SetButtonText(ID, format); // not updated? SetButtonText(ID, format);
wxWindow::Update();
while(waiting) while(waiting)
{ {
SDL_JoystickUpdate(); SDL_JoystickUpdate();
@ -609,7 +601,8 @@ void ConfigBox::GetButtons(wxCommandEvent& event)
counter2--; counter2--;
sprintf(format, "[%d]", counter2); sprintf(format, "[%d]", counter2);
SetButtonText(ID, format); // not updated? ;_; SetButtonText(ID, format);
wxWindow::Update();
if(counter2<0) if(counter2<0)
waiting = false; waiting = false;

View File

@ -117,21 +117,21 @@ class ConfigBox : public wxDialog
wxButton *m_bJoyDpadLeft[4]; wxButton *m_bJoyDpadLeft[4];
wxButton *m_bJoyDpadRight[4]; wxButton *m_bJoyDpadRight[4];
wxStaticText *m_textMainX; wxStaticText *m_textMainX[4];
wxStaticText *m_textMainY; wxStaticText *m_textMainY[4];
wxStaticText *m_textDpadUp; wxStaticText *m_textDpadUp[4];
wxStaticText *m_textDpadDown; wxStaticText *m_textDpadDown[4];
wxStaticText *m_textDpadLeft; wxStaticText *m_textDpadLeft[4];
wxStaticText *m_textDpadRight; wxStaticText *m_textDpadRight[4];
wxStaticText *m_textDeadzone; wxStaticText *m_textDeadzone[4];
wxStaticText *m_textHalfpress; wxStaticText *m_textHalfpress[4];
wxStaticText *m_textSubX; wxStaticText *m_textSubX[4];
wxStaticText *m_textSubY; wxStaticText *m_textSubY[4];
wxStaticText *m_textWebsite; wxStaticText *m_textWebsite[4];
wxTextCtrl *m_PlaceholderBMP[4]; wxTextCtrl *m_PlaceholderBMP[4];
wxStaticBitmap *m_controllerimage[4]; wxStaticBitmap *m_controllerimage[4];
int notebookpage; int notebookpage;
private: private:
enum enum