Пример #1
0
ControllerConfigDiag::ControllerConfigDiag(wxWindow* const parent)
	: wxDialog(parent, wxID_ANY, _("Dolphin Controller Configuration"))
{
	m_gc_pad_type_strs = {{
		_("None"),
		_("Standard Controller"),
		_("Steering Wheel"),
		_("Dance Mat"),
		_("TaruKonga (Bongos)"),
		_("GBA"),
		_("Keyboard"),
		_("AM Baseboard")
	}};

	wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);

	// Combine all UI controls into their own encompassing sizer.
	wxBoxSizer* control_sizer = new wxBoxSizer(wxVERTICAL);
	control_sizer->Add(CreateGamecubeSizer(), 0, wxEXPAND | wxALL, 5);
	control_sizer->Add(CreateWiimoteConfigSizer(), 0, wxEXPAND | wxALL, 5);

	main_sizer->Add(control_sizer, 0, wxEXPAND);
	main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);

	Bind(wxEVT_BUTTON, &ControllerConfigDiag::Save, this, wxID_OK);
	Bind(wxEVT_BUTTON, &ControllerConfigDiag::Cancel, this, wxID_CANCEL);

	SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
	SetSizerAndFit(main_sizer);
	Center();
	Bind(wxEVT_ADAPTER_UPDATE, &ControllerConfigDiag::UpdateAdapter, this);
}
Пример #2
0
luNewProjWizard::luNewProjWizard(wxFrame* parent, bool useSizer) :
	 wxWizard(parent, ID_NEW_PROJ_WIZARD, _T("Create New Project Wizard"),
                   wxBitmap(wiz_xpm),wxDefaultPosition,
                   wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
	SetBitmapPlacement(wxWIZARD_VALIGN_CENTRE);

    SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);

    m_page1 = new wxWizardPageSimple(this);

	new wxStaticText(m_page1, wxID_ANY,
		_T("Create New Project for LuaEditor"),
		wxPoint(5,5)
	);

	m_page2 = new luNewProjNamePage(this);
	m_page3 = new luNewProjTemplatePage(this);
	m_page4 = new luNewProjFinishPage(this);

	wxWizardPageSimple::Chain(m_page1, m_page2);
	wxWizardPageSimple::Chain(m_page2, m_page3);
	wxWizardPageSimple::Chain(m_page3, m_page4);


	if (useSizer)
		GetPageAreaSizer()->Add(m_page1);

}
Пример #3
0
MyWizard::MyWizard(wxFrame *frame, bool useSizer)
{
    SetExtraStyle(wxWIZARD_EX_HELPBUTTON);

    Create(frame,wxID_ANY,wxT("Absolutely Useless Wizard"),
                   wxBitmap(wiztest_xpm),wxDefaultPosition,
                   wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
    SetIcon(wxICON(sample));

    // Allow the bitmap to be expanded to fit the page height
    if (frame->GetMenuBar()->IsChecked(Wizard_ExpandBitmap))
        SetBitmapPlacement(wxWIZARD_VALIGN_CENTRE);

    // Enable scrolling adaptation
    if (frame->GetMenuBar()->IsChecked(Wizard_LargeWizard))
        SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);

    // a wizard page may be either an object of predefined class
    m_page1 = new wxWizardPageSimple(this);

    /* wxStaticText *text = */ new wxStaticText(m_page1, wxID_ANY,
             wxT("This wizard doesn't help you\nto do anything at all.\n")
             wxT("\n")
             wxT("The next pages will present you\nwith more useless controls."),
             wxPoint(5,5)
        );

    // ... or a derived class
    wxRadioboxPage *page3 = new wxRadioboxPage(this);
    wxValidationPage *page4 = new wxValidationPage(this);

    // set the page order using a convenience function - could also use
    // SetNext/Prev directly as below, but Chain() is shorter, avoids the risk
    // of an error and can itself be chained, e.g. you could write
    // page3.Chain(page4).Chain(page5) and so on.
    page3->Chain(page4);

    // this page is not a wxWizardPageSimple, so we use SetNext/Prev to insert
    // it into the chain of pages
    wxCheckboxPage *page2 = new wxCheckboxPage(this, m_page1, page3);
    m_page1->SetNext(page2);
    page3->SetPrev(page2);

    if ( useSizer )
    {
        // allow the wizard to size itself around the pages
        GetPageAreaSizer()->Add(m_page1);
    }
}
Пример #4
0
void CISOProperties::CreateGUIControls()
{
    const int space5 = FromDIP(5);

    wxButton* const EditConfig = new wxButton(this, ID_EDITCONFIG, _("Edit Config"));
    EditConfig->SetToolTip(_("This will let you manually edit the INI config file."));

    wxButton* const EditConfigDefault = new wxButton(this, ID_SHOWDEFAULTCONFIG, _("Show Defaults"));
    EditConfigDefault->SetToolTip(
        _("Opens the default (read-only) configuration for this game in an external text editor."));

    // Notebook
    wxNotebook* const m_Notebook = new wxNotebook(this, ID_NOTEBOOK);
    wxPanel* const m_GameConfig = new wxPanel(m_Notebook, ID_GAMECONFIG);
    m_Notebook->AddPage(m_GameConfig, _("GameConfig"));
    wxPanel* const m_PatchPage = new wxPanel(m_Notebook, ID_PATCH_PAGE);
    m_Notebook->AddPage(m_PatchPage, _("Patches"));
    wxPanel* const m_CheatPage = new wxPanel(m_Notebook, ID_ARCODE_PAGE);
    m_Notebook->AddPage(m_CheatPage, _("AR Codes"));
    wxPanel* const gecko_cheat_page = new wxPanel(m_Notebook);
    m_Notebook->AddPage(gecko_cheat_page, _("Gecko Codes"));
    m_Notebook->AddPage(new InfoPanel(m_Notebook, ID_INFORMATION, OpenGameListItem, m_open_iso),
                        _("Info"));

    // GameConfig editing - Overrides and emulation state
    wxStaticText* const OverrideText = new wxStaticText(
        m_GameConfig, wxID_ANY, _("These settings override core Dolphin settings.\nUndetermined "
                                  "means the game uses Dolphin's setting."));

    // Core
    CPUThread = new wxCheckBox(m_GameConfig, ID_USEDUALCORE, _("Enable Dual Core"), wxDefaultPosition,
                               wxDefaultSize, GetElementStyle("Core", "CPUThread"));
    MMU = new wxCheckBox(m_GameConfig, ID_MMU, _("Enable MMU"), wxDefaultPosition, wxDefaultSize,
                         GetElementStyle("Core", "MMU"));
    MMU->SetToolTip(_(
                        "Enables the Memory Management Unit, needed for some games. (ON = Compatible, OFF = Fast)"));
    DCBZOFF = new wxCheckBox(m_GameConfig, ID_DCBZOFF, _("Skip DCBZ clearing"), wxDefaultPosition,
                             wxDefaultSize, GetElementStyle("Core", "DCBZ"));
    DCBZOFF->SetToolTip(_("Bypass the clearing of the data cache by the DCBZ instruction. Usually "
                          "leave this option disabled."));
    FPRF = new wxCheckBox(m_GameConfig, ID_FPRF, _("Enable FPRF"), wxDefaultPosition, wxDefaultSize,
                          GetElementStyle("Core", "FPRF"));
    FPRF->SetToolTip(_("Enables Floating Point Result Flag calculation, needed for a few games. (ON "
                       "= Compatible, OFF = Fast)"));
    SyncGPU = new wxCheckBox(m_GameConfig, ID_SYNCGPU, _("Synchronize GPU thread"), wxDefaultPosition,
                             wxDefaultSize, GetElementStyle("Core", "SyncGPU"));
    SyncGPU->SetToolTip(_("Synchronizes the GPU and CPU threads to help prevent random freezes in "
                          "Dual Core mode. (ON = Compatible, OFF = Fast)"));
    FastDiscSpeed =
        new wxCheckBox(m_GameConfig, ID_DISCSPEED, _("Speed up Disc Transfer Rate"),
                       wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "FastDiscSpeed"));
    FastDiscSpeed->SetToolTip(_("Enable fast disc access. This can cause crashes and other problems "
                                "in some games. (ON = Fast, OFF = Compatible)"));
    DSPHLE = new wxCheckBox(m_GameConfig, ID_AUDIO_DSP_HLE, _("DSP HLE emulation (fast)"),
                            wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "DSPHLE"));
    // TimeStretching
    TimeStretching =
        new wxCheckBox(m_GameConfig, ID_TIMESTRETCHING, _("Time Stretching"),
                       wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "TimeStretching"));
    FastDiscSpeed->SetToolTip(_("Enable Audio Time Stretching. Can Cause Audio Issues in some games."));

    wxBoxSizer* const sGPUDeterminism = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* const GPUDeterminismText =
        new wxStaticText(m_GameConfig, wxID_ANY, _("Deterministic dual core: "));
    arrayStringFor_GPUDeterminism.Add(_("Not Set"));
    arrayStringFor_GPUDeterminism.Add(_("auto"));
    arrayStringFor_GPUDeterminism.Add(_("none"));
    arrayStringFor_GPUDeterminism.Add(_("fake-completion"));
    GPUDeterminism = new wxChoice(m_GameConfig, ID_GPUDETERMINISM, wxDefaultPosition, wxDefaultSize,
                                  arrayStringFor_GPUDeterminism);
    sGPUDeterminism->Add(GPUDeterminismText, 0, wxALIGN_CENTER_VERTICAL);
    sGPUDeterminism->Add(GPUDeterminism, 0, wxALIGN_CENTER_VERTICAL);
    // Video Rate Hack
    HalfAudioRate = new wxCheckBox(m_GameConfig, ID_HALFAUDIORATE, _("Half Audio Rate"), wxDefaultPosition, wxDefaultSize,
                                   GetElementStyle("Core", "VideoRateAudioFix"));
    wxBoxSizer* const svideorate = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* const videorateText =
        new wxStaticText(m_GameConfig, wxID_ANY, _("Video Rate Hack: "));

    DVideo = new DolphinSlider(m_GameConfig, ID_DVIDEO, 8, 4, 36);
    DVideo->SetToolTip(_("Multiply the rate of video interruptions to allow High framerate hacks"));
    DVideo->Bind(wxEVT_SLIDER, &CISOProperties::OnDVideoChanged, this);
    svideorate->Add(videorateText);
    svideorate->Add(DVideo);
    svideorate->Add(label_DVideo = new wxStaticText(m_GameConfig, wxID_ANY, wxT("1.0x")));

    // Wii Console
    EnableWideScreen =
        new wxCheckBox(m_GameConfig, ID_ENABLEWIDESCREEN, _("Enable WideScreen"), wxDefaultPosition,
                       wxDefaultSize, GetElementStyle("Wii", "Widescreen"));

    // Stereoscopy
    wxBoxSizer* const sDepthPercentage = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* const DepthPercentageText =
        new wxStaticText(m_GameConfig, wxID_ANY, _("Depth Percentage: "));
    DepthPercentage = new DolphinSlider(m_GameConfig, ID_DEPTHPERCENTAGE, 100, 0, 200);
    DepthPercentage->SetToolTip(
        _("This value is multiplied with the depth set in the graphics configuration."));
    sDepthPercentage->Add(DepthPercentageText);
    sDepthPercentage->Add(DepthPercentage);

    wxBoxSizer* const sConvergence = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* const ConvergenceText =
        new wxStaticText(m_GameConfig, wxID_ANY, _("Convergence: "));
    Convergence = new wxSpinCtrl(m_GameConfig, ID_CONVERGENCE);
    Convergence->SetRange(0, INT32_MAX);
    Convergence->SetToolTip(
        _("This value is added to the convergence value set in the graphics configuration."));
    sConvergence->Add(ConvergenceText);
    sConvergence->Add(Convergence);

    MonoDepth =
        new wxCheckBox(m_GameConfig, ID_MONODEPTH, _("Monoscopic Shadows"), wxDefaultPosition,
                       wxDefaultSize, GetElementStyle("Video_Stereoscopy", "StereoEFBMonoDepth"));
    MonoDepth->SetToolTip(_("Use a single depth buffer for both eyes. Needed for a few games."));

    wxBoxSizer* const sEmuState = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* const EmuStateText =
        new wxStaticText(m_GameConfig, wxID_ANY, _("Emulation State: "));
    arrayStringFor_EmuState.Add(_("Not Set"));
    arrayStringFor_EmuState.Add(_("Broken"));
    arrayStringFor_EmuState.Add(_("Intro"));
    arrayStringFor_EmuState.Add(_("In Game"));
    arrayStringFor_EmuState.Add(_("Playable"));
    arrayStringFor_EmuState.Add(_("Perfect"));
    EmuState = new wxChoice(m_GameConfig, ID_EMUSTATE, wxDefaultPosition, wxDefaultSize,
                            arrayStringFor_EmuState);
    EmuIssues = new wxTextCtrl(m_GameConfig, ID_EMU_ISSUES, wxEmptyString);
    sEmuState->Add(EmuStateText, 0, wxALIGN_CENTER_VERTICAL);
    sEmuState->Add(EmuState, 0, wxALIGN_CENTER_VERTICAL);
    sEmuState->Add(EmuIssues, 1, wxEXPAND);

    wxStaticBoxSizer* const sbCoreOverrides =
        new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Core"));
    sbCoreOverrides->Add(CPUThread, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->Add(MMU, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->Add(DCBZOFF, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->Add(FPRF, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->Add(SyncGPU, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->Add(FastDiscSpeed, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->Add(DSPHLE, 0, wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->AddSpacer(space5);
    sbCoreOverrides->Add(TimeStretching, 0, wxLEFT, 5);
    sbCoreOverrides->Add(sGPUDeterminism, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sbCoreOverrides->AddSpacer(space5);
    sbCoreOverrides->Add(svideorate, 0, wxLEFT, 5);
    sbCoreOverrides->Add(HalfAudioRate, 0, wxLEFT, 5);
    sbCoreOverrides->AddSpacer(space5);

    wxStaticBoxSizer* const sbWiiOverrides =
        new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Wii Console"));
    if (m_open_iso->GetVolumeType() == DiscIO::Platform::GAMECUBE_DISC)
    {
        sbWiiOverrides->ShowItems(false);
        EnableWideScreen->Hide();
    }
    sbWiiOverrides->Add(EnableWideScreen, 0, wxLEFT, space5);

    wxStaticBoxSizer* const sbStereoOverrides =
        new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Stereoscopy"));
    sbStereoOverrides->Add(sDepthPercentage);
    sbStereoOverrides->Add(sConvergence);
    sbStereoOverrides->Add(MonoDepth);

    wxStaticBoxSizer* const sbGameConfig =
        new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings"));
    sbGameConfig->AddSpacer(space5);
    sbGameConfig->Add(OverrideText, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sbGameConfig->AddSpacer(space5);
    sbGameConfig->Add(sbCoreOverrides, 0, wxEXPAND);
    sbGameConfig->Add(sbWiiOverrides, 0, wxEXPAND);
    sbGameConfig->Add(sbStereoOverrides, 0, wxEXPAND);

    wxBoxSizer* const sConfigPage = new wxBoxSizer(wxVERTICAL);
    sConfigPage->AddSpacer(space5);
    sConfigPage->Add(sbGameConfig, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sConfigPage->AddSpacer(space5);
    sConfigPage->Add(sEmuState, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sConfigPage->AddSpacer(space5);
    m_GameConfig->SetSizer(sConfigPage);

    // Patches
    wxBoxSizer* const sPatches = new wxBoxSizer(wxVERTICAL);
    Patches = new wxCheckListBox(m_PatchPage, ID_PATCHES_LIST, wxDefaultPosition, wxDefaultSize, 0,
                                 nullptr, wxLB_HSCROLL);
    wxBoxSizer* const sPatchButtons = new wxBoxSizer(wxHORIZONTAL);
    EditPatch = new wxButton(m_PatchPage, ID_EDITPATCH, _("Edit..."));
    wxButton* const AddPatch = new wxButton(m_PatchPage, ID_ADDPATCH, _("Add..."));
    RemovePatch = new wxButton(m_PatchPage, ID_REMOVEPATCH, _("Remove"));
    EditPatch->Disable();
    RemovePatch->Disable();

    wxBoxSizer* sPatchPage = new wxBoxSizer(wxVERTICAL);
    sPatches->Add(Patches, 1, wxEXPAND);
    sPatchButtons->Add(EditPatch, 0, wxEXPAND);
    sPatchButtons->AddStretchSpacer();
    sPatchButtons->Add(AddPatch, 0, wxEXPAND);
    sPatchButtons->Add(RemovePatch, 0, wxEXPAND);
    sPatches->Add(sPatchButtons, 0, wxEXPAND);
    sPatchPage->AddSpacer(space5);
    sPatchPage->Add(sPatches, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sPatchPage->AddSpacer(space5);
    m_PatchPage->SetSizer(sPatchPage);

    // Action Replay Cheats
    m_ar_code_panel =
        new ActionReplayCodesPanel(m_CheatPage, ActionReplayCodesPanel::STYLE_MODIFY_BUTTONS);
    m_cheats_disabled_ar = new CheatWarningMessage(m_CheatPage, game_id);

    m_ar_code_panel->Bind(DOLPHIN_EVT_ARCODE_TOGGLED, &CISOProperties::OnCheatCodeToggled, this);

    wxBoxSizer* const sCheatPage = new wxBoxSizer(wxVERTICAL);
    sCheatPage->Add(m_cheats_disabled_ar, 0, wxEXPAND | wxTOP, space5);
    sCheatPage->Add(m_ar_code_panel, 1, wxEXPAND | wxALL, space5);
    m_CheatPage->SetSizer(sCheatPage);

    // Gecko Cheats
    m_geckocode_panel = new Gecko::CodeConfigPanel(gecko_cheat_page);
    m_cheats_disabled_gecko = new CheatWarningMessage(gecko_cheat_page, game_id);

    m_geckocode_panel->Bind(DOLPHIN_EVT_GECKOCODE_TOGGLED, &CISOProperties::OnCheatCodeToggled, this);

    wxBoxSizer* gecko_layout = new wxBoxSizer(wxVERTICAL);
    gecko_layout->Add(m_cheats_disabled_gecko, 0, wxEXPAND | wxTOP, space5);
    gecko_layout->Add(m_geckocode_panel, 1, wxEXPAND);
    gecko_cheat_page->SetSizer(gecko_layout);

    if (m_open_iso->GetVolumeType() != DiscIO::Platform::WII_WAD)
    {
        m_Notebook->AddPage(
            new FilesystemPanel(m_Notebook, ID_FILESYSTEM, OpenGameListItem, m_open_iso),
            _("Filesystem"));
    }

    wxStdDialogButtonSizer* sButtons = CreateStdDialogButtonSizer(wxOK | wxNO_DEFAULT);
    sButtons->Prepend(EditConfigDefault);
    sButtons->Prepend(EditConfig);
    sButtons->GetAffirmativeButton()->SetLabel(_("Close"));

    // If there is no default gameini, disable the button.
    bool game_ini_exists = false;
    for (const std::string& ini_filename :
            SConfig::GetGameIniFilenames(game_id, m_open_iso->GetRevision()))
    {
        if (File::Exists(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + ini_filename))
        {
            game_ini_exists = true;
            break;
        }
    }
    if (!game_ini_exists)
        EditConfigDefault->Disable();

    // Add notebook and buttons to the dialog
    wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
    sMain->AddSpacer(space5);
    sMain->Add(m_Notebook, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sMain->AddSpacer(space5);
    sMain->Add(sButtons, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
    sMain->AddSpacer(space5);
    sMain->SetMinSize(FromDIP(wxSize(500, -1)));

    SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
    SetLayoutAdaptationLevel(wxDIALOG_ADAPTATION_STANDARD_SIZER);
    SetSizerAndFit(sMain);
    Center();
    SetFocus();
}