nJoy: GUI fixes
- It should now look pretty in Linux - wxWindow::Update(); does not seem to work in Linux, so no countdown timer in Linux when pressing a button. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@110 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5698cbde2f
commit
8f1628b69c
|
@ -153,16 +153,25 @@ void ConfigBox::CreateGUIControls()
|
|||
|
||||
for(int i=0; i<4 ;i++)
|
||||
{
|
||||
|
||||
// Groups
|
||||
m_gJoyname[i] = new wxStaticBox(m_Controller[i], IDG_JOYSTICK, wxT("Controller:"), wxPoint(5, 11), wxSize(608, 46));
|
||||
|
||||
#ifdef _WIN32
|
||||
m_Joyattach[i] = new wxCheckBox(m_Controller[i], IDC_JOYATTACH, wxT("Controller attached"), wxPoint(495, 26), wxSize(109, 25), 0, wxDefaultValidator, wxT("Controller attached"));
|
||||
m_Joyname[i] = new wxComboBox(m_Controller[i], IDC_JOYNAME, wxT(""), wxPoint(12, 29), wxSize(476, 21), arrayStringFor_Joyname, 0, wxDefaultValidator, wxT("m_Joyname"));
|
||||
|
||||
m_gExtrasettings[i] = new wxStaticBox(m_Controller[i], IDG_EXTRASETTINGS, wxT("Extra settings:"), wxPoint(104, 385), wxSize(155, 69));
|
||||
m_Deadzone[i] = new wxComboBox(m_Controller[i], IDC_DEADZONE, wxT(""), wxPoint(167, 400), wxSize(59, 21), arrayStringFor_Deadzone, 0, wxDefaultValidator, wxT("m_Deadzone"));
|
||||
|
||||
m_gControllertype[i] = new wxStaticBox(m_Controller[i], IDG_CONTROLLERTYPE, wxT("Controller type:"), wxPoint(359, 383), wxSize(143, 44));
|
||||
m_Controltype[i] = new wxComboBox(m_Controller[i], IDC_CONTROLTYPE, wxT(""), wxPoint(366, 401), wxSize(131, 21), arrayStringFor_Controltype, 0, wxDefaultValidator, wxT("m_Controltype"));
|
||||
#else
|
||||
m_Joyattach[i] = new wxCheckBox(m_Controller[i], IDC_JOYATTACH, wxT("Controller attached"), wxPoint(470, 26), wxSize(140, 25), 0, wxDefaultValidator, wxT("Controller attached"));
|
||||
m_Joyname[i] = new wxComboBox(m_Controller[i], IDC_JOYNAME, wxT(""), wxPoint(10, 25), wxSize(450, 25), arrayStringFor_Joyname, 0, wxDefaultValidator, wxT("m_Joyname"));
|
||||
m_gExtrasettings[i] = new wxStaticBox(m_Controller[i], IDG_EXTRASETTINGS, wxT("Extra settings:"), wxPoint(100, 385), wxSize(155, 65));
|
||||
m_Deadzone[i] = new wxComboBox(m_Controller[i], IDC_DEADZONE, wxT(""), wxPoint(167, 398), wxSize(80, 25), arrayStringFor_Deadzone, 0, wxDefaultValidator, wxT("m_Deadzone"));
|
||||
m_gControllertype[i] = new wxStaticBox(m_Controller[i], IDG_CONTROLLERTYPE, wxT("Controller type:"), wxPoint(359, 383), wxSize(160, 44));
|
||||
m_Controltype[i] = new wxComboBox(m_Controller[i], IDC_CONTROLTYPE, wxT(""), wxPoint(364, 396), wxSize(150, 25), arrayStringFor_Controltype, 0, wxDefaultValidator, wxT("m_Controltype"));
|
||||
#endif
|
||||
|
||||
// GUI left side buttons
|
||||
m_JoyShoulderL[i] = new wxTextCtrl(m_Controller[i], ID_SHOULDER_L, wxT("0"), wxPoint(6, 80), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
|
||||
|
@ -179,7 +188,6 @@ void ConfigBox::CreateGUIControls()
|
|||
m_JoyDpadLeft[i]->Enable(false);
|
||||
m_JoyDpadRight[i] = new wxTextCtrl(m_Controller[i], ID_DPAD_RIGHT, wxT("0"), wxPoint(6, 406), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
|
||||
m_JoyDpadRight[i]->Enable(false);
|
||||
|
||||
m_bJoyShoulderL[i] = new wxButton(m_Controller[i], IDB_SHOULDER_L, wxT(""), wxPoint(70, 82), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
|
||||
m_bJoyAnalogMainX[i] = new wxButton(m_Controller[i], IDB_ANALOG_MAIN_X, wxT(""), wxPoint(70, 220), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
|
||||
m_bJoyAnalogMainY[i] = new wxButton(m_Controller[i], IDB_ANALOG_MAIN_Y, wxT(""), wxPoint(70, 257), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
|
||||
|
@ -190,7 +198,6 @@ void ConfigBox::CreateGUIControls()
|
|||
|
||||
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[i] = new wxStaticText(m_Controller[i], IDT_ANALOG_MAIN_Y, wxT("Y-axis"), wxPoint(6, 241), wxDefaultSize, 0, wxT("Y-axis"));
|
||||
|
||||
m_textDpadUp[i] = new wxStaticText(m_Controller[i], IDT_DPAD_UP, wxT("Up"), wxPoint(6, 282), wxDefaultSize, 0, wxT("Up"));
|
||||
m_textDpadDown[i] = new wxStaticText(m_Controller[i], IDT_DPAD_DOWN, wxT("Down"), wxPoint(6, 319), wxDefaultSize, 0, wxT("Down"));
|
||||
m_textDpadLeft[i] = new wxStaticText(m_Controller[i], IDT_DPAD_LEFT, wxT("Left"), wxPoint(6, 354), wxDefaultSize, 0, wxT("Left"));
|
||||
|
@ -213,7 +220,6 @@ void ConfigBox::CreateGUIControls()
|
|||
m_JoyAnalogSubX[i]->Enable(false);
|
||||
m_JoyAnalogSubY[i] = new wxTextCtrl(m_Controller[i], ID_ANALOG_SUB_Y, wxT("0"), wxPoint(552, 388), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
|
||||
m_JoyAnalogSubY[i]->Enable(false);
|
||||
|
||||
m_bJoyShoulderR[i] = new wxButton(m_Controller[i], IDB_SHOULDER_R, wxT(""), wxPoint(526, 108), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
|
||||
m_bJoyButtonA[i] = new wxButton(m_Controller[i], IDB_BUTTON_A, wxT(""), wxPoint(526, 282), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
|
||||
m_bJoyButtonB[i] = new wxButton(m_Controller[i], IDB_BUTTON_B, wxT(""), wxPoint(526, 82), wxSize(21, 14), 0, wxDefaultValidator, wxT(""));
|
||||
|
@ -231,13 +237,18 @@ void ConfigBox::CreateGUIControls()
|
|||
m_JoyButtonStart[i]->Enable(false);
|
||||
m_JoyButtonHalfpress[i] = new wxTextCtrl(m_Controller[i], ID_BUTTONHALFPRESS, wxT("0"), wxPoint(167, 424), wxSize(59, 19), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
|
||||
m_JoyButtonHalfpress[i]->Enable(false);
|
||||
|
||||
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(""));
|
||||
|
||||
#ifdef _WIN32
|
||||
m_textDeadzone[i] = new wxStaticText(m_Controller[i], IDT_DEADZONE, wxT("Deadzone"), wxPoint(116, 404), wxDefaultSize, 0, wxT("Deadzone"));
|
||||
m_textHalfpress[i] = new wxStaticText(m_Controller[i], IDT_BUTTONHALFPRESS, wxT("Half press"), wxPoint(116, 428), wxDefaultSize, 0, wxT("Half press"));
|
||||
m_textWebsite[i] = new wxStaticText(m_Controller[i], IDT_WEBSITE, wxT("www.multigesture.net"), wxPoint(500, 438), wxDefaultSize, 0, wxT("www.multigesture.net"));
|
||||
#else
|
||||
m_textDeadzone[i] = new wxStaticText(m_Controller[i], IDT_DEADZONE, wxT("Deadzone"), wxPoint(105, 404), wxDefaultSize, 0, wxT("Deadzone"));
|
||||
m_textHalfpress[i] = new wxStaticText(m_Controller[i], IDT_BUTTONHALFPRESS, wxT("Half press"), wxPoint(105, 428), wxDefaultSize, 0, wxT("Half press"));
|
||||
m_textWebsite[i] = new wxStaticText(m_Controller[i], IDT_WEBSITE, wxT("www.multigesture.net"), wxPoint(480, 438), wxDefaultSize, 0, wxT("www.multigesture.net"));
|
||||
#endif
|
||||
|
||||
// TODO: Controller image
|
||||
// Placeholder instead of bitmap
|
||||
|
@ -245,7 +256,7 @@ void ConfigBox::CreateGUIControls()
|
|||
// m_PlaceholderBMP[i]->Enable(false);
|
||||
|
||||
// You can enable the bitmap here:
|
||||
// But it loads überslow on init...
|
||||
// But it loads überslow on init... (only in windows, linux seems to load it fast!)
|
||||
// AAaaand the XPM file (256 colours) looks crappier than the real bitmap... so maybe we can find a way to use a bitmap?
|
||||
m_controllerimage[i] = new wxStaticBitmap(m_Controller[i], ID_CONTROLLERPICTURE, WxStaticBitmap1_BITMAP, wxPoint(98, 75), wxSize(421,304));
|
||||
|
||||
|
@ -578,7 +589,7 @@ void ConfigBox::GetButtons(wxCommandEvent& event)
|
|||
|
||||
sprintf(format, "[%d]", counter2);
|
||||
SetButtonText(ID, format);
|
||||
wxWindow::Update();
|
||||
wxWindow::Update(); // win only? doesnt seem to work in linux...
|
||||
|
||||
while(waiting)
|
||||
{
|
||||
|
@ -602,7 +613,7 @@ void ConfigBox::GetButtons(wxCommandEvent& event)
|
|||
|
||||
sprintf(format, "[%d]", counter2);
|
||||
SetButtonText(ID, format);
|
||||
wxWindow::Update();
|
||||
wxWindow::Update(); // win only? doesnt seem to work in linux...
|
||||
|
||||
if(counter2<0)
|
||||
waiting = false;
|
||||
|
@ -641,6 +652,7 @@ void ConfigBox::GetHats(int ID)
|
|||
|
||||
sprintf(format, "[%d]", counter2);
|
||||
SetButtonText(ID, format);
|
||||
wxWindow::Update(); // win only? doesnt seem to work in linux...
|
||||
|
||||
while(waiting)
|
||||
{
|
||||
|
@ -663,7 +675,8 @@ void ConfigBox::GetHats(int ID)
|
|||
counter2--;
|
||||
|
||||
sprintf(format, "[%d]", counter2);
|
||||
SetButtonText(ID, format); // not updated? ;_;
|
||||
SetButtonText(ID, format);
|
||||
wxWindow::Update(); // win only? doesnt seem to work in linux...
|
||||
|
||||
if(counter2<0)
|
||||
waiting = false;
|
||||
|
@ -703,6 +716,7 @@ void ConfigBox::GetAxis(wxCommandEvent& event)
|
|||
|
||||
sprintf(format, "[%d]", counter2);
|
||||
SetButtonText(ID, format);
|
||||
wxWindow::Update(); // win only? doesnt seem to work in linux...
|
||||
|
||||
while(waiting)
|
||||
{
|
||||
|
@ -726,7 +740,8 @@ void ConfigBox::GetAxis(wxCommandEvent& event)
|
|||
counter2--;
|
||||
|
||||
sprintf(format, "[%d]", counter2);
|
||||
SetButtonText(ID, format); // not updated? ;_;
|
||||
SetButtonText(ID, format);
|
||||
wxWindow::Update(); // win only? doesnt seem to work in linux...
|
||||
|
||||
if(counter2<0)
|
||||
waiting = false;
|
||||
|
|
Loading…
Reference in New Issue