Пример #1
0
GameSettings::GameSettings(wxFrame *parent)
    : wxDialog (parent, -1, wxT("Settings editor"), wxDefaultPosition, wxSize(460, 480))

{
    topsizer = new wxBoxSizer( wxVERTICAL );
    topsizer->AddSpacer(10); // Top padding.
     
    // In game resolutions box
    _create_resolution_box(); 
    topsizer->Add(resolutionBoxSizer, 0, wxEXPAND);

    // Window mode check box
    topsizer->AddSpacer(10);
    wxStaticBox *windowModeBox = new wxStaticBox(this, wxID_ANY, wxT("Game window"));
    wxStaticBoxSizer* windowModeBoxSizer = new wxStaticBoxSizer(windowModeBox, wxVERTICAL);
    scrnControlChkBx = new wxCheckBox(this, eventID_ScrnCtrlChange, wxT("Windowed mode"));
    scrnControlChkBx->SetToolTip(tooltips_eng[10]);
    scrnControlChkBx->SetValue(false);
    windowModeBoxSizer->Add(scrnControlChkBx, 0, wxEXPAND);
    topsizer->Add(windowModeBoxSizer, 0, wxEXPAND);

    // Language ratio box
    topsizer->AddSpacer(10);
    langRadio = new wxRadioBox( this, wxID_ANY, wxT("Language"), wxDefaultPosition, wxSize(-1, -1),
        WXSIZEOF(supported_languages_text), supported_languages_text, 4, wxRA_SPECIFY_COLS);
    langRadio->SetToolTip(tooltips_eng[6]);
    topsizer->Add(langRadio, 0, wxEXPAND);

    // Other settings
    topsizer->AddSpacer(10);
    wxStaticBox *otherSettingsBox = new wxStaticBox( this, wxID_ANY, wxT("Other settings") );
    wxStaticBoxSizer* otherSettingsSizer = new wxStaticBoxSizer( otherSettingsBox, wxVERTICAL );
    {
        {
            censorChkBx = new wxCheckBox(this, wxID_ANY, wxT("Censorship (limit amount of blood and flesh)"));
            censorChkBx->SetToolTip(tooltips_eng[7]);
            censorChkBx->SetValue(false);
            otherSettingsSizer->Add(censorChkBx, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
        }
        {
            wxPanel *mouseSensitivityPanel = new wxPanel(this, wxID_ANY);
            wxBoxSizer *mouseSensitivityPanelSizer = new wxBoxSizer( wxHORIZONTAL );
            {
                wxStaticText *statTxt = new wxStaticText(mouseSensitivityPanel, wxID_ANY, wxT("Mouse sensitivity"));
                statTxt->SetToolTip(tooltips_eng[8]);
                mouseSensitivityPanelSizer->Add(statTxt, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
                mouseSensitivityPanelSizer->AddSpacer(16);
                wxIntegerValidator<long> mouseSensitivityVal(NULL, wxNUM_VAL_THOUSANDS_SEPARATOR);
                mouseSensitivityVal.SetRange(-10000,10000);
                mouseSensitvTxtCtrl = new wxTextCtrl(mouseSensitivityPanel, wxID_ANY, wxT("100"), wxDefaultPosition, wxSize(64, -1), 0, mouseSensitivityVal);
                mouseSensitvTxtCtrl->SetToolTip(tooltips_eng[8]);
                mouseSensitivityPanelSizer->Add(mouseSensitvTxtCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
            }
            mouseSensitivityPanel->SetSizer(mouseSensitivityPanelSizer);
            otherSettingsSizer->Add(mouseSensitivityPanel, 1, wxEXPAND);
        }
        otherSettingsSizer->SetMinSize(386, 64);
    }
    topsizer->Add(otherSettingsSizer, 0, wxEXPAND); // for wxStaticBox, we're adding sizer instead of the actual wxStaticBox instance

    // Screen shot ratio box
    topsizer->AddSpacer(10);
    scrshotRadio = new wxRadioBox( this, wxID_ANY, wxT("Screenshots"), wxDefaultPosition, wxDefaultSize,
        WXSIZEOF(supported_scrshotfmt_text), supported_scrshotfmt_text, 2, wxRA_SPECIFY_COLS );
    scrshotRadio->SetToolTip(tooltips_eng[9]);
    topsizer->Add(scrshotRadio, 0, wxEXPAND);

    wxPanel *dlgBottomPanel = new wxPanel(this, wxID_ANY);
    wxBoxSizer *dlgBottomPanelSizer = new wxBoxSizer( wxHORIZONTAL );
    {
        dlgBottomPanelSizer->AddStretchSpacer(1);
        wxButton *saveBtn = new wxButton(dlgBottomPanel, eventID_Save, _T("&Save") );
        saveBtn->SetToolTip(tooltips_eng[11]);
        dlgBottomPanelSizer->Add(saveBtn, 0, wxEXPAND);
        dlgBottomPanelSizer->AddStretchSpacer(1);
        wxButton *exitBtn = new wxButton(dlgBottomPanel, eventID_Cancel, _T("&Cancel") );
        exitBtn->SetToolTip(tooltips_eng[12]);
        dlgBottomPanelSizer->Add(exitBtn, 0, wxEXPAND);
        dlgBottomPanelSizer->AddStretchSpacer(1);
    }
    dlgBottomPanel->SetSizer(dlgBottomPanelSizer);
    topsizer->Add(dlgBottomPanel, 0, wxEXPAND);

    SetSizer(topsizer);
    Fit();
    Centre(wxBOTH);
}
Пример #2
0
GameSettings::GameSettings(wxFrame *parent)
    : wxDialog (parent, -1, wxT("Settings editor"), wxDefaultPosition, wxSize(460, 480))

{
    topsizer = new wxBoxSizer( wxVERTICAL );

    resIngameBox = new wxCheckRadioBox(this, wxID_ANY, wxT("In-game resolutions"), NULL, NULL, 0, 0 );
    resIngameBox->SetToolTip(tooltips_eng[1],tooltips_eng[2]);
    resIngameBoxSizer = new wxStaticBoxSizer( resIngameBox, wxHORIZONTAL );
    resIngameBoxSizer->Add(resIngameBox->rbPanel, 1, wxEXPAND); // for wxStaticBox, we're adding sizer instead of the actual wxStaticBox instance
    topsizer->Add(resIngameBoxSizer, 1, wxEXPAND);

    resOtherPanel = new wxPanel(this, wxID_ANY);
    wxBoxSizer *resOtherPanelSizer = new wxBoxSizer( wxHORIZONTAL );
    {
        wxStaticBox *resMenuBox = new wxStaticBox(resOtherPanel, wxID_ANY, wxT("Menu resolution") );
        resMenuBox->SetToolTip(tooltips_eng[4]);
        resMenuBoxSizer = new wxStaticBoxSizer(resMenuBox, wxVERTICAL);
        resMenuCombo = NULL;
        resOtherPanelSizer->Add(resMenuBoxSizer, 1, wxALIGN_CENTER);

        wxStaticBox *resMovieBox = new wxStaticBox(resOtherPanel, wxID_ANY, wxT("Movies resolution") );
        resMovieBox->SetToolTip(tooltips_eng[3]);
        resMovieBoxSizer = new wxStaticBoxSizer(resMovieBox, wxHORIZONTAL);
        resMovieCombo = NULL;
        resOtherPanelSizer->Add(resMovieBoxSizer, 1, wxALIGN_CENTER);

        wxStaticBox *resFailBox = new wxStaticBox(resOtherPanel, wxID_ANY, wxT("Failure resolution") );
        resFailBox->SetToolTip(tooltips_eng[5]);
        resFailBoxSizer = new wxStaticBoxSizer(resFailBox, wxVERTICAL);
        resFailCombo = NULL;
        resOtherPanelSizer->Add(resFailBoxSizer, 1, wxALIGN_CENTER);

        ChangeResolutionOptions(2);
    }
    resOtherPanel->SetSizer(resOtherPanelSizer);
    topsizer->Add(resOtherPanel, 0, wxEXPAND);

    scrnControlRadio = new wxRadioBox( this, eventID_ScrnCtrlChange, wxT("Screen control"), wxDefaultPosition, wxDefaultSize,
        WXSIZEOF(screen_control_mode_text), screen_control_mode_text, 3, wxRA_SPECIFY_COLS );
    scrnControlRadio->SetToolTip(tooltips_eng[10]);
    topsizer->Add(scrnControlRadio, 0, wxEXPAND);

    langRadio = new wxRadioBox( this, wxID_ANY, wxT("Language"), wxDefaultPosition, wxSize(-1, -1),
        WXSIZEOF(supported_languages_text), supported_languages_text, 4, wxRA_SPECIFY_COLS);
    langRadio->SetToolTip(tooltips_eng[6]);
    topsizer->Add(langRadio, 0, wxEXPAND);

    wxStaticBox *otherSettingsBox = new wxStaticBox( this, wxID_ANY, wxT("Other settings") );
    wxStaticBoxSizer* otherSettingsSizer = new wxStaticBoxSizer( otherSettingsBox, wxVERTICAL );
    {
        {
            censorChkBx = new wxCheckBox(this, wxID_ANY, wxT("Censorship (limit amount of blood and flesh)"));
            censorChkBx->SetToolTip(tooltips_eng[7]);
            censorChkBx->SetValue(false);
            otherSettingsSizer->Add(censorChkBx, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
        }
        {
            wxPanel *mouseSensitivityPanel = new wxPanel(this, wxID_ANY);
            wxBoxSizer *mouseSensitivityPanelSizer = new wxBoxSizer( wxHORIZONTAL );
            {
                wxStaticText *statTxt = new wxStaticText(mouseSensitivityPanel, wxID_ANY, wxT("Mouse sensitivity"));
                statTxt->SetToolTip(tooltips_eng[8]);
                mouseSensitivityPanelSizer->Add(statTxt, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
                mouseSensitivityPanelSizer->AddSpacer(16);
                wxIntegerValidator<long> mouseSensitivityVal(NULL, wxNUM_VAL_THOUSANDS_SEPARATOR);
                mouseSensitivityVal.SetRange(-10000,10000);
                mouseSensitvTxtCtrl = new wxTextCtrl(mouseSensitivityPanel, wxID_ANY, wxT("100"), wxDefaultPosition, wxSize(64, -1), 0, mouseSensitivityVal);
                mouseSensitvTxtCtrl->SetToolTip(tooltips_eng[8]);
                mouseSensitivityPanelSizer->Add(mouseSensitvTxtCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
            }
            mouseSensitivityPanel->SetSizer(mouseSensitivityPanelSizer);
            otherSettingsSizer->Add(mouseSensitivityPanel, 1, wxEXPAND);
        }
        otherSettingsSizer->SetMinSize(386, 64);
    }
    topsizer->Add(otherSettingsSizer, 0, wxEXPAND); // for wxStaticBox, we're adding sizer instead of the actual wxStaticBox instance

    scrshotRadio = new wxRadioBox( this, wxID_ANY, wxT("Screenshots"), wxDefaultPosition, wxDefaultSize,
        WXSIZEOF(supported_scrshotfmt_text), supported_scrshotfmt_text, 2, wxRA_SPECIFY_COLS );
    scrshotRadio->SetToolTip(tooltips_eng[9]);
    topsizer->Add(scrshotRadio, 0, wxEXPAND);

    wxPanel *dlgBottomPanel = new wxPanel(this, wxID_ANY);
    wxBoxSizer *dlgBottomPanelSizer = new wxBoxSizer( wxHORIZONTAL );
    {
        dlgBottomPanelSizer->AddStretchSpacer(1);
        wxButton *saveBtn = new wxButton(dlgBottomPanel, eventID_Save, _T("&Save") );
        saveBtn->SetToolTip(tooltips_eng[11]);
        dlgBottomPanelSizer->Add(saveBtn, 0, wxEXPAND);
        dlgBottomPanelSizer->AddStretchSpacer(1);
        wxButton *exitBtn = new wxButton(dlgBottomPanel, eventID_Cancel, _T("&Cancel") );
        exitBtn->SetToolTip(tooltips_eng[12]);
        dlgBottomPanelSizer->Add(exitBtn, 0, wxEXPAND);
        dlgBottomPanelSizer->AddStretchSpacer(1);
    }
    dlgBottomPanel->SetSizer(dlgBottomPanelSizer);
    topsizer->Add(dlgBottomPanel, 0, wxEXPAND);

    SetSizer(topsizer);
    Centre(wxBOTH);

}