void populate_shader_table(GtkWidget* shader_table)
{
	GtkWidget* shader            = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Select an external shader", "shaderfx_glsl", "dummy.glsl");
	GtkWidget* shader_conf       = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Then select a config", "shaderfx_conf", "dummy.ini");
	GtkWidget* shader_label      = gtk_label_new("External shader glsl");
	GtkWidget* shader_conf_label = gtk_label_new("External shader conf");

	GtkWidget* shadeboost_check = CreateCheckBox("Shade boost", "shadeboost");
	GtkWidget* fxaa_check       = CreateCheckBox("Fxaa shader", "fxaa");
	GtkWidget* shaderfx_check   = CreateCheckBox("External shader", "shaderfx");

	// Shadeboost scale
	GtkWidget* sb_brightness       = CreateScale("ShadeBoost_Brightness", 50);
	GtkWidget* sb_brightness_label = gtk_label_new("Shade Boost Brightness");

	GtkWidget* sb_contrast         = CreateScale("ShadeBoost_Contrast", 50);
	GtkWidget* sb_contrast_label   = gtk_label_new("Shade Boost Contrast");

	GtkWidget* sb_saturation       = CreateScale("ShadeBoost_Saturation", 50);
	GtkWidget* sb_saturation_label = gtk_label_new("Shade Boost Saturation");

	s_table_line = 0;
	InsertWidgetInTable(shader_table , fxaa_check);
	InsertWidgetInTable(shader_table , shadeboost_check);
	InsertWidgetInTable(shader_table , sb_brightness_label , sb_brightness);
	InsertWidgetInTable(shader_table , sb_contrast_label   , sb_contrast);
	InsertWidgetInTable(shader_table , sb_saturation_label , sb_saturation);
	InsertWidgetInTable(shader_table , shaderfx_check);
	InsertWidgetInTable(shader_table , shader_label        , shader);
	InsertWidgetInTable(shader_table , shader_conf_label   , shader_conf);
}
void populate_hw_table(GtkWidget* hw_table)
{
	GtkWidget* filter_label     = gtk_label_new ("Texture Filtering:");
	GtkWidget* filter_combo_box = CreateComboBoxFromVector(theApp.m_gs_filter, "filter", 2);

	GtkWidget* af_label     = gtk_label_new("Anisotropic Filtering:");
	GtkWidget* af_combo_box = CreateComboBoxFromVector(theApp.m_gs_max_anisotropy, "MaxAnisotropy", 1);

	GtkWidget* crc_label     = gtk_label_new("Automatic CRC level:");
	GtkWidget* crc_combo_box = CreateComboBoxFromVector(theApp.m_gs_crc_level, "crc_hack_level", 3);

	GtkWidget* paltex_check     = CreateCheckBox("Allow 8 bits textures", "paltex");
	GtkWidget* acc_date_check   = CreateCheckBox("Accurate Date", "accurate_date", false);
	GtkWidget* tc_depth_check   = CreateCheckBox("Full Depth Emulation", "texture_cache_depth", true);

	GtkWidget* acc_bld_label     = gtk_label_new("Blending Unit Accuracy:");
	GtkWidget* acc_bld_combo_box = CreateComboBoxFromVector(theApp.m_gs_acc_blend_level, "accurate_blending_unit", 1);

	// Some helper string
	AddTooltip(paltex_check, IDC_PALTEX);
	AddTooltip(acc_date_check, IDC_ACCURATE_DATE);
	AddTooltip(crc_label, crc_combo_box, IDC_CRC_LEVEL);
	AddTooltip(acc_bld_label, acc_bld_combo_box, IDC_ACCURATE_BLEND_UNIT);
	AddTooltip(tc_depth_check, IDC_TC_DEPTH);
	AddTooltip(filter_label, filter_combo_box, IDC_FILTER);

	s_table_line = 0;
	InsertWidgetInTable(hw_table, paltex_check, tc_depth_check);
	InsertWidgetInTable(hw_table, acc_date_check);
	InsertWidgetInTable(hw_table, acc_bld_label, acc_bld_combo_box);
	InsertWidgetInTable(hw_table, filter_label, filter_combo_box);
	InsertWidgetInTable(hw_table, af_label, af_combo_box);
	InsertWidgetInTable(hw_table, crc_label, crc_combo_box);
}
Exemplo n.º 3
0
void populate_osd_table(GtkWidget* osd_table)
{
	GtkWidget* fontname_label  = left_label("Font:");
	GtkWidget* fontname_file = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Select a font", "osd_fontname");
	GtkWidget* fontsize_label  = left_label("Size:");
	GtkWidget* fontsize_text = CreateSpinButton(1, 100, "osd_fontsize");
	GtkWidget* transparency_label = left_label("Transparency:");
	GtkWidget* transparency_slide = CreateScale("osd_transparency");
	GtkWidget* log_check = CreateCheckBox("Enable Log", "osd_log_enabled");
	GtkWidget* log_speed_label  = left_label("Speed:");
	GtkWidget* log_speed_text = CreateSpinButton(2, 10, "osd_log_speed");
	GtkWidget* max_messages_label = left_label("Maximum Onscreen Log Messages:");
	GtkWidget* max_messages_spin = CreateSpinButton(1, 20, "osd_max_log_messages");
	GtkWidget* monitor_check = CreateCheckBox("Enable Monitor", "osd_monitor_enabled");
	GtkWidget* indicator_check = CreateCheckBox("Enable Indicator", "osd_indicator_enabled");

	AddTooltip(log_check, IDC_OSD_LOG);
	AddTooltip(monitor_check, IDC_OSD_MONITOR);
	AddTooltip(max_messages_label, max_messages_spin, IDC_OSD_MAX_LOG);

	InsertWidgetInTable(osd_table , fontname_label , fontname_file);
	InsertWidgetInTable(osd_table , fontsize_label , fontsize_text);
	InsertWidgetInTable(osd_table , transparency_label , transparency_slide);
	InsertWidgetInTable(osd_table , log_check);
	InsertWidgetInTable(osd_table , log_speed_label, log_speed_text);
	InsertWidgetInTable(osd_table , max_messages_label, max_messages_spin);
	InsertWidgetInTable(osd_table , monitor_check, indicator_check);
}
void ToolsOptionsWindow::CreateGeneralPanel ()
{
	//m_pfoldersframe = CreateGroupBox ("Protected Folders", 130, 15, 390, 103, ID_LBLSTATIC);
	
	//m_pfoldersinfo1 = CreateLabel ("When my computer starts up / wakes up:", 140, 35, 300, 20, ID_LBLSTATIC);
	//m_pfolderspromptpowerup = CreateCheckBox ("Ask me before Decrypting protected folders", 155, 53, 300, 20, ID_CHKPFOLDERPROMPTPUP);
	//m_pfoldersinfo2 = CreateLabel ("When my computer shuts down / sleeps:", 140, 75, 300, 20, ID_LBLSTATIC);
	//m_pfolderspromptpowerdown = CreateCheckBox ("Ask me before Encrypting protected folders", 155, 92, 300, 20, ID_CHKPFOLDERPROMPTPDN);

	m_ptextencframe = CreateGroupBox ("Universal Text Encryption", 130, 130, 390, 120, ID_LBLSTATIC);
	
	//m_lblenc = CreateLabel ("Encrypt Hotkey", 170, 164, 100, 20, ID_LBLSTATIC);
	//m_chkencctrl = CreateCheckBox ("Ctrl", 280, 163, 40, 20, ID_UTEBTNHOTENCCTRL);
	//m_chkencalt = CreateCheckBox ("Alt", 340, 163, 40, 20, ID_UTEBTNHOTENCALT);
	//m_txtenckey = CreateTextBox (400, 163, 40, 20, ID_UTETXTHOTENC);

	m_lbldec = CreateLabel ("Decrypt Hotkey", 170, 194, 100, 20, ID_LBLSTATIC);
	m_chkdecctrl = CreateCheckBox ("Ctrl", 280, 193, 40, 20, ID_UTEBTNHOTDECCTRL);
	m_chkdecalt = CreateCheckBox ("Alt", 340, 193, 40, 20, ID_UTEBTNHOTDECALT);
	m_txtdeckey = CreateTextBox (400, 193, 40, 20, ID_UTETXTHOTDEC);

	m_lblinfo = CreateLabel ("NOTE: Hot Key settings will take effect after next reboot.", 170, 227, 300, 20, ID_LBLSTATIC);

	//m_autoupdateframe = CreateGroupBox ("Automatic Updates", 130, 265, 390, 103, ID_LBLSTATIC);
	//m_chkautoupdate = CreateCheckBox ("Automatically check online for a newer version of CedeCrypt", 155, 310, 300, 20, ID_CHKAUTOUPDATECHECK);

	ShowWindow (m_chkencalt, SW_HIDE);
	ShowWindow (m_chkdecalt, SW_HIDE);

}
void populate_sw_table(GtkWidget* sw_table)
{
	GtkWidget* threads_label = gtk_label_new("Extra rendering threads:");
	GtkWidget* threads_spin  = CreateSpinButton(0, 32, "extrathreads", 0);

	GtkWidget* aa_check         = CreateCheckBox("Edge anti-aliasing (AA1)", "aa1");
	GtkWidget* mipmap_check     = CreateCheckBox("Mipmap", "mipmap", true);
	GtkWidget* spin_thread_check= CreateCheckBox("Disable thread sleeping (6+ cores CPU)", "spin_thread");

	s_table_line = 0;
	InsertWidgetInTable(sw_table , threads_label     , threads_spin);
	InsertWidgetInTable(sw_table , aa_check, mipmap_check);
	InsertWidgetInTable(sw_table , spin_thread_check , spin_thread_check);
}
Exemplo n.º 6
0
void populate_hw_table(GtkWidget* hw_table)
{
	GtkWidget* filter_label     = left_label("Texture Filtering:");
	GtkWidget* filter_combo_box = CreateComboBoxFromVector(theApp.m_gs_filter, "filter");

	GtkWidget* fsaa_label     = left_label("Internal Resolution:");
	GtkWidget* fsaa_combo_box = CreateComboBoxFromVector(theApp.m_gs_upscale_multiplier, "upscale_multiplier");

	GtkWidget* af_label     = left_label("Anisotropic Filtering:");
	GtkWidget* af_combo_box = CreateComboBoxFromVector(theApp.m_gs_max_anisotropy, "MaxAnisotropy");

	GtkWidget* crc_label     = left_label("Automatic CRC level:");
	GtkWidget* crc_combo_box = CreateComboBoxFromVector(theApp.m_gs_crc_level, "crc_hack_level");

	GtkWidget* paltex_check     = CreateCheckBox("Allow 8 bits textures", "paltex");
	GtkWidget* acc_date_check   = CreateCheckBox("Accurate Date", "accurate_date");
	GtkWidget* large_fb_check   = CreateCheckBox("Large Framebuffer", "large_framebuffer");

	GtkWidget* acc_bld_label     = left_label("Blending Unit Accuracy:");
	GtkWidget* acc_bld_combo_box = CreateComboBoxFromVector(theApp.m_gs_acc_blend_level, "accurate_blending_unit");

	GtkWidget* hack_enable_check   = CreateCheckBox("Enable User Hacks", "UserHacks");

	GtkWidget* mipmap_label     = left_label("Mipmapping (Insert):");
	GtkWidget* mipmap_combo_box = CreateComboBoxFromVector(theApp.m_gs_hw_mipmapping, "mipmap_hw");

	// Some helper string
	AddTooltip(paltex_check, IDC_PALTEX);
	AddTooltip(acc_date_check, IDC_ACCURATE_DATE);
	AddTooltip(large_fb_check, IDC_LARGE_FB);
	AddTooltip(crc_label, crc_combo_box, IDC_CRC_LEVEL);
	AddTooltip(acc_bld_label, acc_bld_combo_box, IDC_ACCURATE_BLEND_UNIT);
	AddTooltip(filter_label, filter_combo_box, IDC_FILTER);
	AddTooltip(af_label, af_combo_box, IDC_AFCOMBO);
	gtk_widget_set_tooltip_text(hack_enable_check, "Enable the HW hack option panel");
	AddTooltip(mipmap_label, IDC_MIPMAP_HW);
	AddTooltip(mipmap_combo_box, IDC_MIPMAP_HW);

	s_table_line = 0;
	InsertWidgetInTable(hw_table , paltex_check  , acc_date_check);
	InsertWidgetInTable(hw_table , large_fb_check, hack_enable_check);
	InsertWidgetInTable(hw_table , fsaa_label    , fsaa_combo_box);
	InsertWidgetInTable(hw_table , filter_label  , filter_combo_box);
	InsertWidgetInTable(hw_table , af_label      , af_combo_box);
	InsertWidgetInTable(hw_table , acc_bld_label , acc_bld_combo_box);
	InsertWidgetInTable(hw_table , crc_label     , crc_combo_box);
	InsertWidgetInTable(hw_table , mipmap_label  , mipmap_combo_box);
}
Exemplo n.º 7
0
void populate_sw_table(GtkWidget* sw_table)
{
	GtkWidget* threads_label = left_label("Extra rendering threads:");
	GtkWidget* threads_spin  = CreateSpinButton(0, 32, "extrathreads");

	GtkWidget* aa_check         = CreateCheckBox("Edge anti-aliasing (AA1)", "aa1");
	GtkWidget* mipmap_check     = CreateCheckBox("Mipmapping", "mipmap");

	AddTooltip(aa_check, IDC_AA1);
	AddTooltip(mipmap_check, IDC_MIPMAP_SW);
	AddTooltip(threads_label, threads_spin, IDC_SWTHREADS);

	s_table_line = 0;
	InsertWidgetInTable(sw_table , threads_label, threads_spin);
	InsertWidgetInTable(sw_table , aa_check     , mipmap_check);
}
Exemplo n.º 8
0
void populate_shader_table(GtkWidget* shader_table)
{
	GtkWidget* shader            = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Select an external shader", "shaderfx_glsl");
	GtkWidget* shader_conf       = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Then select a config", "shaderfx_conf");
	GtkWidget* shader_label      = left_label("External shader glsl");
	GtkWidget* shader_conf_label = left_label("External shader conf");

	GtkWidget* shadeboost_check = CreateCheckBox("Shade boost", "ShadeBoost");
	GtkWidget* fxaa_check       = CreateCheckBox("Fxaa shader", "fxaa");
	GtkWidget* shaderfx_check   = CreateCheckBox("External shader", "shaderfx");

	GtkWidget* tv_shader_label  = left_label("TV shader:");
	GtkWidget* tv_shader        = CreateComboBoxFromVector(theApp.m_gs_tv_shaders, "TVShader");

	GtkWidget* linear_check     = CreateCheckBox("Texture Filtering of Display", "linear_present");

	// Shadeboost scale
	GtkWidget* sb_brightness       = CreateScale("ShadeBoost_Brightness");
	GtkWidget* sb_brightness_label = left_label("Shade Boost Brightness:");

	GtkWidget* sb_contrast         = CreateScale("ShadeBoost_Contrast");
	GtkWidget* sb_contrast_label   = left_label("Shade Boost Contrast:");

	GtkWidget* sb_saturation       = CreateScale("ShadeBoost_Saturation");
	GtkWidget* sb_saturation_label = left_label("Shade Boost Saturation:");

	AddTooltip(shadeboost_check, IDC_SHADEBOOST);
	AddTooltip(shaderfx_check, IDC_SHADER_FX);
	AddTooltip(fxaa_check, IDC_FXAA);
	AddTooltip(linear_check, IDC_LINEAR_PRESENT);

	s_table_line = 0;
	InsertWidgetInTable(shader_table , linear_check);
	InsertWidgetInTable(shader_table , fxaa_check);
	InsertWidgetInTable(shader_table , shadeboost_check);
	InsertWidgetInTable(shader_table , sb_brightness_label , sb_brightness);
	InsertWidgetInTable(shader_table , sb_contrast_label   , sb_contrast);
	InsertWidgetInTable(shader_table , sb_saturation_label , sb_saturation);
	InsertWidgetInTable(shader_table , shaderfx_check);
	InsertWidgetInTable(shader_table , shader_label        , shader);
	InsertWidgetInTable(shader_table , shader_conf_label   , shader_conf);
	InsertWidgetInTable(shader_table , tv_shader_label, tv_shader);
}
Exemplo n.º 9
0
void populate_hack_table(GtkWidget* hack_table)
{
	GtkWidget* hack_offset_label   = left_label("Half-pixel Offset Hack:");
	GtkWidget* hack_offset_box     = CreateComboBoxFromVector(theApp.m_gs_offset_hack, "UserHacks_HalfPixelOffset");
	GtkWidget* hack_skipdraw_label = left_label("Skipdraw:");
	GtkWidget* hack_skipdraw_spin  = CreateSpinButton(0, 1000, "UserHacks_SkipDraw");
	GtkWidget* hack_wild_check     = CreateCheckBox("Wild Arms Hack", "UserHacks_WildHack");
	GtkWidget* hack_tco_label      = left_label("Texture Offset: 0x");
	GtkWidget* hack_tco_entry      = CreateTextBox("UserHacks_TCOffset");
	GtkWidget* align_sprite_check  = CreateCheckBox("Align sprite hack", "UserHacks_align_sprite_X");
	GtkWidget* preload_gs_check    = CreateCheckBox("Preload Frame", "preload_frame_with_gs_data");
	GtkWidget* hack_fast_inv       = CreateCheckBox("Fast Texture Invalidation", "UserHacks_DisablePartialInvalidation");
	GtkWidget* hack_depth_check    = CreateCheckBox("Disable Depth Emulation", "UserHacks_DisableDepthSupport");
	GtkWidget* hack_auto_flush     = CreateCheckBox("Auto Flush Primitives", "UserHacks_AutoFlush");
	GtkWidget* hack_unscale_prim   = CreateCheckBox("Unscale Point&Line Primitives", "UserHacks_unscale_point_line");

	GtkWidget* hack_sprite_box     = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_SpriteHack");
	GtkWidget* hack_sprite_label   = left_label("Alpha-Sprite Hack:");
	GtkWidget* stretch_hack_box    = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_round_sprite_offset");
	GtkWidget* stretch_hack_label  = left_label("Align Sprite Texture:");
	GtkWidget* trilinear_box       = CreateComboBoxFromVector(theApp.m_gs_trifilter, "UserHacks_TriFilter");
	GtkWidget* trilinear_label     = left_label("Trilinear Filtering:");

	// Reuse windows helper string :)
	AddTooltip(hack_offset_label, IDC_OFFSETHACK);
	AddTooltip(hack_offset_box, IDC_OFFSETHACK);
	AddTooltip(hack_skipdraw_label, IDC_SKIPDRAWHACK);
	AddTooltip(hack_skipdraw_spin, IDC_SKIPDRAWHACK);
	AddTooltip(hack_wild_check, IDC_WILDHACK);
	AddTooltip(hack_sprite_label, hack_sprite_box, IDC_SPRITEHACK);
	AddTooltip(hack_tco_label, IDC_TCOFFSETX);
	AddTooltip(hack_tco_entry, IDC_TCOFFSETX);
	AddTooltip(align_sprite_check, IDC_ALIGN_SPRITE);
	AddTooltip(stretch_hack_label, stretch_hack_box, IDC_ROUND_SPRITE);
	AddTooltip(preload_gs_check, IDC_PRELOAD_GS);
	AddTooltip(hack_fast_inv, IDC_FAST_TC_INV);
	AddTooltip(hack_depth_check, IDC_TC_DEPTH);
	AddTooltip(hack_auto_flush, IDC_AUTO_FLUSH);
	AddTooltip(hack_unscale_prim, IDC_UNSCALE_POINT_LINE);
	AddTooltip(trilinear_box, IDC_TRI_FILTER);
	AddTooltip(trilinear_label, IDC_TRI_FILTER);


	s_table_line = 0;
	// Hack
	InsertWidgetInTable(hack_table , hack_fast_inv       , hack_auto_flush);
	InsertWidgetInTable(hack_table , hack_depth_check    , preload_gs_check);
	// Upscaling hack
	InsertWidgetInTable(hack_table , hack_wild_check     , align_sprite_check);
	InsertWidgetInTable(hack_table , hack_unscale_prim);
	InsertWidgetInTable(hack_table , hack_offset_label   , hack_offset_box);
	InsertWidgetInTable(hack_table , hack_sprite_label   , hack_sprite_box );
	InsertWidgetInTable(hack_table , stretch_hack_label  , stretch_hack_box );
	InsertWidgetInTable(hack_table , hack_skipdraw_label , hack_skipdraw_spin);
	InsertWidgetInTable(hack_table , hack_tco_label      , hack_tco_entry);
	InsertWidgetInTable(hack_table , trilinear_label     , trilinear_box);
}
Exemplo n.º 10
0
void CheckBoxTestCase::InvalidStyles()
{
    // Check that using incompatible styles doesn't work.
    wxDELETE( m_check );
    WX_ASSERT_FAILS_WITH_ASSERT( CreateCheckBox(wxCHK_2STATE | wxCHK_3STATE) );
#if !wxDEBUG_LEVEL
    CPPUNIT_ASSERT( !m_check->Is3State() );
    CPPUNIT_ASSERT( !m_check->Is3rdStateAllowedForUser() );
#endif

    wxDELETE( m_check );
    WX_ASSERT_FAILS_WITH_ASSERT(
        CreateCheckBox(wxCHK_2STATE | wxCHK_ALLOW_3RD_STATE_FOR_USER) );
#if !wxDEBUG_LEVEL
    CPPUNIT_ASSERT( !m_check->Is3State() );
    CPPUNIT_ASSERT( !m_check->Is3rdStateAllowedForUser() );
#endif

    // wxCHK_ALLOW_3RD_STATE_FOR_USER without wxCHK_3STATE doesn't work.
    wxDELETE( m_check );
    WX_ASSERT_FAILS_WITH_ASSERT( CreateCheckBox(wxCHK_ALLOW_3RD_STATE_FOR_USER) );
}
void populate_hack_table(GtkWidget* hack_table)
{
	GtkWidget* hack_offset_check   = CreateCheckBox("Offset Hack", "UserHacks_HalfPixelOffset");
	GtkWidget* hack_skipdraw_label = gtk_label_new("Skipdraw:");
	GtkWidget* hack_skipdraw_spin  = CreateSpinButton(0, 1000, "UserHacks_SkipDraw");
	GtkWidget* hack_enble_check    = CreateCheckBox("Enable User Hacks", "UserHacks");
	GtkWidget* hack_wild_check     = CreateCheckBox("Wild arm Hack", "UserHacks_WildHack");
	GtkWidget* hack_tco_label      = gtk_label_new("Texture Offset: 0x");
	GtkWidget* hack_tco_entry      = CreateTextBox("UserHacks_TCOffset");
	GtkWidget* align_sprite_check  = CreateCheckBox("Align sprite hack", "UserHacks_align_sprite_X");

	GtkWidget* hack_sprite_box     = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_SpriteHack");
	GtkWidget* hack_sprite_label   = gtk_label_new("Alpha-Sprite Hack:");
	GtkWidget* stretch_hack_box    = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_round_sprite_offset");
	GtkWidget* stretch_hack_label  = gtk_label_new("Align Sprite Texture:");

	// Reuse windows helper string :)
	AddTooltip(hack_offset_check, IDC_TCOFFSETX);
	AddTooltip(hack_skipdraw_label, IDC_SKIPDRAWHACK);
	AddTooltip(hack_skipdraw_spin, IDC_SKIPDRAWHACK);
	gtk_widget_set_tooltip_text(hack_enble_check, "Allow to use hack below");
	AddTooltip(hack_wild_check, IDC_WILDHACK);
	AddTooltip(hack_sprite_label, hack_sprite_box, IDC_SPRITEHACK);
	AddTooltip(hack_tco_label, IDC_TCOFFSETX);
	AddTooltip(hack_tco_entry, IDC_TCOFFSETX);
	AddTooltip(align_sprite_check, IDC_ALIGN_SPRITE);
	AddTooltip(stretch_hack_label, stretch_hack_box, IDC_ROUND_SPRITE);


	s_table_line = 0;
	InsertWidgetInTable(hack_table , hack_enble_check);
	InsertWidgetInTable(hack_table , hack_wild_check     , align_sprite_check);
	InsertWidgetInTable(hack_table , hack_sprite_label   , hack_sprite_box );
	InsertWidgetInTable(hack_table , stretch_hack_label  , stretch_hack_box );
	InsertWidgetInTable(hack_table , hack_skipdraw_label , hack_skipdraw_spin);
	InsertWidgetInTable(hack_table , hack_offset_check);
	InsertWidgetInTable(hack_table , hack_tco_label      , hack_tco_entry);
}
Exemplo n.º 12
0
void populate_hack_table(GtkWidget* hack_table)
{
	GtkWidget* hack_offset_check   = CreateCheckBox("Half-pixel Offset Hack", "UserHacks_HalfPixelOffset");
	GtkWidget* hack_skipdraw_label = left_label("Skipdraw:");
	GtkWidget* hack_skipdraw_spin  = CreateSpinButton(0, 1000, "UserHacks_SkipDraw");
	GtkWidget* hack_enble_check    = CreateCheckBox("Enable User Hacks", "UserHacks");
	GtkWidget* hack_wild_check     = CreateCheckBox("Wild Arms Hack", "UserHacks_WildHack");
	GtkWidget* hack_tco_label      = left_label("Texture Offset: 0x");
	GtkWidget* hack_tco_entry      = CreateTextBox("UserHacks_TCOffset");
	GtkWidget* align_sprite_check  = CreateCheckBox("Align sprite hack", "UserHacks_align_sprite_X");
	GtkWidget* preload_gs_check    = CreateCheckBox("Preload Frame", "preload_frame_with_gs_data");
	GtkWidget* hack_safe_fbmask    = CreateCheckBox("Safe Accurate Blending", "UserHacks_safe_fbmask");
	GtkWidget* hack_fast_inv       = CreateCheckBox("Fast Texture Invalidation", "UserHacks_DisablePartialInvalidation");
	GtkWidget* hack_depth_check    = CreateCheckBox("Disable Depth Emulation", "UserHacks_DisableDepthSupport");

	GtkWidget* hack_sprite_box     = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_SpriteHack");
	GtkWidget* hack_sprite_label   = left_label("Alpha-Sprite Hack:");
	GtkWidget* stretch_hack_box    = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_round_sprite_offset");
	GtkWidget* stretch_hack_label  = left_label("Align Sprite Texture:");

	// Reuse windows helper string :)
	AddTooltip(hack_offset_check, IDC_OFFSETHACK);
	AddTooltip(hack_skipdraw_label, IDC_SKIPDRAWHACK);
	AddTooltip(hack_skipdraw_spin, IDC_SKIPDRAWHACK);
	gtk_widget_set_tooltip_text(hack_enble_check, "Allows the use of the hack below");
	AddTooltip(hack_wild_check, IDC_WILDHACK);
	AddTooltip(hack_sprite_label, hack_sprite_box, IDC_SPRITEHACK);
	AddTooltip(hack_tco_label, IDC_TCOFFSETX);
	AddTooltip(hack_tco_entry, IDC_TCOFFSETX);
	AddTooltip(align_sprite_check, IDC_ALIGN_SPRITE);
	AddTooltip(stretch_hack_label, stretch_hack_box, IDC_ROUND_SPRITE);
	AddTooltip(preload_gs_check, IDC_PRELOAD_GS);
	AddTooltip(hack_safe_fbmask, IDC_SAFE_FBMASK);
	AddTooltip(hack_fast_inv, IDC_FAST_TC_INV);
	AddTooltip(hack_depth_check, IDC_TC_DEPTH);


	s_table_line = 0;
	InsertWidgetInTable(hack_table , hack_enble_check);
	InsertWidgetInTable(hack_table , hack_wild_check     , align_sprite_check);
	InsertWidgetInTable(hack_table , hack_offset_check   , preload_gs_check);
	InsertWidgetInTable(hack_table , hack_safe_fbmask    , hack_fast_inv);
	InsertWidgetInTable(hack_table , hack_depth_check);
	InsertWidgetInTable(hack_table , hack_sprite_label   , hack_sprite_box );
	InsertWidgetInTable(hack_table , stretch_hack_label  , stretch_hack_box );
	InsertWidgetInTable(hack_table , hack_skipdraw_label , hack_skipdraw_spin);
	InsertWidgetInTable(hack_table , hack_tco_label      , hack_tco_entry);
}
Exemplo n.º 13
0
void populate_hw_table(GtkWidget* hw_table)
{
	GtkWidget* filter_label     = left_label("Texture Filtering:");
	GtkWidget* filter_combo_box = CreateComboBoxFromVector(theApp.m_gs_filter, "filter", 2);

	GtkWidget* fsaa_label     = left_label("Internal Resolution:");
	GtkWidget* fsaa_combo_box = CreateComboBoxFromVector(theApp.m_gs_upscale_multiplier, "upscale_multiplier", 1);

	GtkWidget* af_label     = left_label("Anisotropic Filtering:");
	GtkWidget* af_combo_box = CreateComboBoxFromVector(theApp.m_gs_max_anisotropy, "MaxAnisotropy", 0);

	GtkWidget* crc_label     = left_label("Automatic CRC level:");
	GtkWidget* crc_combo_box = CreateComboBoxFromVector(theApp.m_gs_crc_level, "crc_hack_level", 3);

	GtkWidget* paltex_check     = CreateCheckBox("Allow 8 bits textures", "paltex");
	GtkWidget* acc_date_check   = CreateCheckBox("Accurate Date", "accurate_date", false);

	GtkWidget* acc_bld_label     = left_label("Blending Unit Accuracy:");
	GtkWidget* acc_bld_combo_box = CreateComboBoxFromVector(theApp.m_gs_acc_blend_level, "accurate_blending_unit", 1);

	// Some helper string
	AddTooltip(paltex_check, IDC_PALTEX);
	AddTooltip(acc_date_check, IDC_ACCURATE_DATE);
	AddTooltip(crc_label, crc_combo_box, IDC_CRC_LEVEL);
	AddTooltip(acc_bld_label, acc_bld_combo_box, IDC_ACCURATE_BLEND_UNIT);
	AddTooltip(filter_label, filter_combo_box, IDC_FILTER);
	AddTooltip(af_label, af_combo_box, IDC_AFCOMBO);

	s_table_line = 0;
	InsertWidgetInTable(hw_table , paltex_check  , acc_date_check);
	InsertWidgetInTable(hw_table , fsaa_label    , fsaa_combo_box);
	InsertWidgetInTable(hw_table , filter_label  , filter_combo_box);
	InsertWidgetInTable(hw_table , af_label      , af_combo_box);
	InsertWidgetInTable(hw_table , acc_bld_label , acc_bld_combo_box);
	InsertWidgetInTable(hw_table , crc_label     , crc_combo_box);
}
void populate_record_table(GtkWidget* record_table)
{
	GtkWidget* capture_check = CreateCheckBox("Enable Recording (with F12)", "capture_enabled");
	GtkWidget* resxy_label   = gtk_label_new("Resolution:");
	GtkWidget* resx_spin     = CreateSpinButton(256, 8192, "capture_resx", 1280);
	GtkWidget* resy_spin     = CreateSpinButton(256, 8192, "capture_resy", 1024);
	GtkWidget* threads_label = gtk_label_new("Saving Threads:");
	GtkWidget* threads_spin  = CreateSpinButton(1, 32, "capture_threads", 4);
	GtkWidget* out_dir_label = gtk_label_new("Output Directory:");
	GtkWidget* out_dir       = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, "Select a directory", "capture_out_dir", "/tmp");

	InsertWidgetInTable(record_table , capture_check);
	InsertWidgetInTable(record_table , resxy_label   , resx_spin      , resy_spin);
	InsertWidgetInTable(record_table , threads_label , threads_spin);
	InsertWidgetInTable(record_table , out_dir_label , out_dir);
}
Exemplo n.º 15
0
void CheckBoxTestCase::ThirdStateUser()
{
    wxDELETE(m_check);
    CreateCheckBox(wxCHK_3STATE | wxCHK_ALLOW_3RD_STATE_FOR_USER);

    CPPUNIT_ASSERT_EQUAL(wxCHK_UNCHECKED, m_check->Get3StateValue());
    CPPUNIT_ASSERT(m_check->Is3State());
    CPPUNIT_ASSERT(m_check->Is3rdStateAllowedForUser());

    m_check->SetValue(true);

    CPPUNIT_ASSERT_EQUAL(wxCHK_CHECKED, m_check->Get3StateValue());

    m_check->Set3StateValue(wxCHK_UNDETERMINED);

    CPPUNIT_ASSERT_EQUAL(wxCHK_UNDETERMINED, m_check->Get3StateValue());
}
void populate_res_table(GtkWidget* res_table)
{
	GtkWidget* native_label     = gtk_label_new("Original PS2 Resolution: ");
	GtkWidget* native_res_check = CreateCheckBox("Native", "nativeres");

	GtkWidget* fsaa_label     = gtk_label_new("Or Use Scaling:");
	GtkWidget* fsaa_combo_box = CreateComboBoxFromVector(theApp.m_gs_upscale_multiplier, "upscale_multiplier", 2);

	GtkWidget* resxy_label = gtk_label_new("Custom Resolution:");
	GtkWidget* resx_spin   = CreateSpinButton(256, 8192, "resx", 1024);
	GtkWidget* resy_spin   = CreateSpinButton(256, 8192, "resy", 1024);

	s_table_line = 0;
	InsertWidgetInTable(res_table, native_label, native_res_check);
	InsertWidgetInTable(res_table, fsaa_label, fsaa_combo_box);
	InsertWidgetInTable(res_table, resxy_label, resx_spin, resy_spin);
}
Exemplo n.º 17
0
// Helpers for GUI (Creating ribbon elements to edit props)
void CNodePropertyUI::CreateUI()
{
	// mHasUI = true;
	DestroyUI();
	if (mTargetNode)
	{
		mNameCtrl = CreateText("Name");
		mNameCtrl->SetValue(mTargetNode->GetName().c_str());
		mCtrlList.clear();
		for (TPropTable::iterator iter = mTargetNode->mPropTable.begin();
			iter != mTargetNode->mPropTable.end(); iter++)
		{
			if ((*iter).mType == std::string("T"))
			{
				wxTextCtrl* control = CreateText((*iter).mName);
				control->SetValue((*iter).mValue);
				
				TControlPair tCtrlPair;
				tCtrlPair.first = (*iter).mName;
				tCtrlPair.second = control;
				mCtrlList.push_back(tCtrlPair);
			}
			else if ((*iter).mType == std::string("D"))
			{
				// UNIMPLEMENTED!!!!!!!!!
				//wxTextCtrl* control = CreateText((*iter).mName);
				//control->SetValue((*iter).mValue);
			}
			else if ((*iter).mType == std::string("C"))
			{
				wxCheckBox* control = CreateCheckBox((*iter).mName);
				if ((*iter).mValue == std::string("T"))
					control->SetValue(true);
				else
					control->SetValue(false);

				TControlPair tCtrlPair;
				tCtrlPair.first = (*iter).mName;
				tCtrlPair.second = control;
				mCtrlList.push_back(tCtrlPair);
			}
		}
	}
	gEnv->MainFrame->mPropertyPage->Realize();
}
Exemplo n.º 18
0
void populate_record_table(GtkWidget* record_table)
{
	GtkWidget* capture_check = CreateCheckBox("Enable Recording (with F12)", "capture_enabled");
	GtkWidget* resxy_label   = left_label("Resolution:");
	GtkWidget* resx_spin     = CreateSpinButton(256, 8192, "CaptureWidth");
	GtkWidget* resy_spin     = CreateSpinButton(256, 8192, "CaptureHeight");
	GtkWidget* threads_label = left_label("Saving Threads:");
	GtkWidget* threads_spin  = CreateSpinButton(1, 32, "capture_threads");
	GtkWidget* out_dir_label = left_label("Output Directory:");
	GtkWidget* out_dir       = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, "Select a directory", "capture_out_dir");
	GtkWidget* png_label     = left_label("PNG Compression Level:");
	GtkWidget* png_level     = CreateSpinButton(1, 9, "png_compression_level");

	InsertWidgetInTable(record_table , capture_check);
	InsertWidgetInTable(record_table , resxy_label   , resx_spin      , resy_spin);
	InsertWidgetInTable(record_table , threads_label , threads_spin);
	InsertWidgetInTable(record_table , png_label     , png_level);
	InsertWidgetInTable(record_table , out_dir_label , out_dir);
}
Exemplo n.º 19
0
OptionBox::OptionBox(int x, int y)
{
	// Create the display checkboxes
	hWndCheck[0] = CreateCheckBox(x + 10, y + 10, IDB_TABLE);
	hWndCheck[1] = CreateCheckBox(x + 10, y + 30, IDB_CLASS);
	hWndCheck[2] = CreateCheckBox(x + 10, y + 50, IDB_STATE);
	hWndCheck[3] = CreateCheckBox(x + 10, y + 70, IDB_FUNCTION);
	hWndCheck[4] = CreateCheckBox(x + 118, y + 10, IDB_IMPORT);
	hWndCheck[5] = CreateCheckBox(x + 118, y + 30, IDB_VARIABLE);
	hWndCheck[6] = CreateCheckBox(x + 118, y + 50, IDB_OBJECT);
	hWndCheck[7] = CreateCheckBox(x + 118, y + 70, IDB_INTERFACE);

	// Create the frame
	CreateWindowEx(0,
		"STATIC",
		NULL,
		WS_VISIBLE | WS_CHILD | SS_ETCHEDFRAME,
		x, y,
		168, 100,
		hWndMain,
		NULL,
		hInstMain,
		NULL);

	// Create the menu ruler
	CreateWindowEx(0,
		"STATIC",
		NULL,
		WS_VISIBLE | WS_CHILD | SS_ETCHEDFRAME,
		5, 0,
		582, 2,
		hWndMain,
		NULL,
		hInstMain,
		NULL);
}
Exemplo n.º 20
0
void populate_debug_table(GtkWidget* debug_table)
{
	GtkWidget* glsl_debug_check = CreateCheckBox("GLSL compilation", "debug_glsl_shader");
	GtkWidget* gl_debug_check   = CreateCheckBox("Print GL error", "debug_opengl");
	GtkWidget* gs_dump_check    = CreateCheckBox("Dump GS data", "dump");
	GtkWidget* gs_save_check    = CreateCheckBox("Save RT", "save");
	GtkWidget* gs_savef_check   = CreateCheckBox("Save Frame", "savef");
	GtkWidget* gs_savet_check   = CreateCheckBox("Save Texture", "savet");
	GtkWidget* gs_savez_check   = CreateCheckBox("Save Depth", "savez");

	GtkWidget* gs_saven_label   = left_label("Start of Dump");
	GtkWidget* gs_saven_spin    = CreateSpinButton(0, pow(10, 9), "saven");
	GtkWidget* gs_savel_label   = left_label("Length of Dump");
	GtkWidget* gs_savel_spin    = CreateSpinButton(0, pow(10, 5), "savel");

	s_table_line = 0;
	InsertWidgetInTable(debug_table, gl_debug_check, glsl_debug_check);
	InsertWidgetInTable(debug_table, gs_dump_check);
	InsertWidgetInTable(debug_table, gs_save_check, gs_savef_check);
	InsertWidgetInTable(debug_table, gs_savet_check, gs_savez_check);
	InsertWidgetInTable(debug_table, gs_saven_label, gs_saven_spin);
	InsertWidgetInTable(debug_table, gs_savel_label, gs_savel_spin);
}
Exemplo n.º 21
0
// -----------------------------------------------------------------------
// Initialize Form
int CALLBACK FRMPrjPropsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    PAINTSTRUCT CreatePs;
    CStr BufString;

    switch(uMsg)
    {
        case WM_INITDIALOG:
            FRMPrjPropshWnd = hwndDlg;
            ControlSetText(hwndDlg, "Project properties");
            FRMPrjPropsFr1 = CreateFrame(2, -1, 202, 108, hwndDlg, "Application", 0, 0, 0);
            FRMPrjPropsFr2 = CreateFrame(206, -1, 194, 108, hwndDlg, "Version", 0, 0, 0);
            FRMPrjPropsFr3 = CreateFrame(2, 108, 398, 94, hwndDlg, "Version informations", 14, &FRMPrjPropsFrame3, 0);
            CreateLabel(5, 21 + 20, 35, 15, FRMPrjPropsFr1, "Title :", 0, 0, 0, 0);
            CreateLabel(5, 41 + 25, 52, 15, FRMPrjPropsFr1, "File type :", 0, 0, 0, 0);
            CreateLabel(131, 41 + 25, 34, 15, FRMPrjPropsFr1, "Icon :", 0, 0, 0, 0);
            FRMPrjPropsOk = CreateButton(243, 214, 77, 23, hwndDlg, "Ok", 1, 0, 0, 0, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP, Buttons_StaticEdge);
            FRMPrjPropsCancel = CreateButton(322, 214, 77, 23, hwndDlg, "Cancel", 2, 0, 0, 0, WS_TABSTOP, Buttons_StaticEdge);
            FRMPrjPropsReg = CreateButton(159, 214, 77, 23, hwndDlg, "Register", 3, 0, 0, 0, WS_TABSTOP, Buttons_StaticEdge);
            FRMPrjPropsConstants = CreateButton(3, 214, 77, 23, hwndDlg, "Constants", 4, 0, 0, 0, WS_TABSTOP, Buttons_StaticEdge);
            FRMPrjPropsIncludeVersion = CreateCheckBox(7, 18, 140, 15, FRMPrjPropsFr1, "Include version resource", 5, 0, WS_TABSTOP | WS_GROUP, 0);
            FRMPrjPropsTxtTitle = CreateTextBox(36, 18 + 20, 159, 20, FRMPrjPropsFr1, "", 6, 0, WS_TABSTOP | ES_AUTOHSCROLL, WS_EX_STATICEDGE);
            FRMPrjPropsFileType = CreateComboBox(5, 56 + 25, 123, 150, FRMPrjPropsFr1, "", 7, 0, CBS_DROPDOWNLIST | WS_TABSTOP);
            ComboBoxAddItem(FRMPrjPropsFileType, "UNKNOWN", -1);
            ComboBoxAddItem(FRMPrjPropsFileType, "APP", -1);
            ComboBoxAddItem(FRMPrjPropsFileType, "DLL", -1);
            ComboBoxAddItem(FRMPrjPropsFileType, "DRV", -1);
            ComboBoxAddItem(FRMPrjPropsFileType, "FONT", -1);
            ComboBoxAddItem(FRMPrjPropsFileType, "VXD", -1);
            ComboBoxAddItem(FRMPrjPropsFileType, "STATIC_LIB", -1);
            ComboBoxSetIndex(FRMPrjPropsFileType, 0);
            FRMPrjPropsSetIcon = CreateButton(133, 56 + 25, 25, 21, hwndDlg, "...", 8, 0, 0, 0, WS_TABSTOP, Buttons_StaticEdge);
            // Current icon
            if(ProjectTypeScheduledImg.Len()) BufString = ProjectTypeScheduledImg;
            else BufString = ProjectDir + (CStr) "\\" + (CStr) ProjectTypeImg;
            FRMPrjPropsIconhandle = LoadImage(0, BufString.Get_String(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
            FRMPrjPropsIcon = CreatePictureBox(163, 43 + 25, 35, 34, FRMPrjPropsFr1, FRMPrjPropsIconhandle, IMAGE_ICON, 9, 0, SS_CENTERIMAGE);
            CreateLabel(7, 15, 52, 13, FRMPrjPropsFr2, "Major :", 0, 0, 0, 0);
            CreateLabel(99, 15, 52, 13, FRMPrjPropsFr2, "Minor :", 0, 0, 0, 0);
            CreateLabel(7, 35, 52, 13, FRMPrjPropsFr2, "Revision :", 0, 0, 0, 0);
            CreateLabel(99, 35, 52, 13, FRMPrjPropsFr2, "Release :", 0, 0, 0, 0);
            FRMPrjPropsTxtMajor = CreateTextBox(59, 12, 33, 20, FRMPrjPropsFr2, "", 10, 0, WS_TABSTOP | ES_NUMBER, WS_EX_STATICEDGE);
            FRMPrjPropsTxtMinor = CreateTextBox(151, 12, 33, 20, FRMPrjPropsFr2, "", 11, 0, WS_TABSTOP | ES_NUMBER, WS_EX_STATICEDGE);
            FRMPrjPropsTxtRevision = CreateTextBox(59, 32, 33, 20, FRMPrjPropsFr2, "", 12, 0, WS_TABSTOP | ES_NUMBER, WS_EX_STATICEDGE);
            FRMPrjPropsTxtRelease = CreateTextBox(151, 32, 33, 20, FRMPrjPropsFr2, "", 13, 0, WS_TABSTOP | ES_NUMBER, WS_EX_STATICEDGE);
            CreateLabel(7, 61, 31, 15, FRMPrjPropsFr2, "OS :", 0, 0, 0, 0);
            FRMPrjPropsOS = CreateComboBox(34, 57, 150, 150, FRMPrjPropsFr2, "", 14, 0, CBS_DROPDOWNLIST | WS_TABSTOP);
            ComboBoxAddItem(FRMPrjPropsOS, "UNKNOWN", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "DOS", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "NT", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "WINDOWS16", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "WINDOWS32", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "DOS_WINDOWS16", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "DOS_WINDOWS32", -1);
            ComboBoxAddItem(FRMPrjPropsOS, "NT_WINDOWS32", -1);
            ComboBoxSetIndex(FRMPrjPropsOS, 0);
            FRMPrjPropsIncludeXPManifest = CreateCheckBox(16, 85, 170, 15, FRMPrjPropsFr2, "Include Windows XP manifest", 15, 0, WS_TABSTOP | WS_GROUP, 0);
            CreateLabel(5, 16, 52, 13, FRMPrjPropsFr3, "Type :", 0, 0, 0, 0);
            FRMPrjPropsTypeProp = CreateListBox(5, 30, 140, 59, FRMPrjPropsFr3, 16, 0, 0, WS_TABSTOP | WS_HSCROLL, WS_EX_STATICEDGE);
            ListBoxAddItem(FRMPrjPropsTypeProp, "Comments", -1);
            ListBoxAddItem(FRMPrjPropsTypeProp, "Company name", -1);
            ListBoxAddItem(FRMPrjPropsTypeProp, "File description", -1);
            ListBoxAddItem(FRMPrjPropsTypeProp, "Legal copyright", -1);
            ListBoxAddItem( FRMPrjPropsTypeProp, "Legal trademarks", -1);
            ListBoxAddItem(FRMPrjPropsTypeProp, "Product name", -1);
            ListBoxSetIndex(FRMPrjPropsTypeProp, 0);
            FRMPrjPropsTypeTxt = CreateTextBox(147, 13 - 2, 245, 79, FRMPrjPropsFr3, "", 17, &FRMPrjPropsTypeTxtHook, WS_TABSTOP | ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL | ES_WANTRETURN, WS_EX_STATICEDGE);
            LoadUserInfos();
            ControlSetText(FRMPrjPropsTxtMajor, Prj_Major);
            ControlSetText(FRMPrjPropsTxtMinor, Prj_Minor);
            ControlSetText(FRMPrjPropsTxtRevision, Prj_Revision);
            ControlSetText(FRMPrjPropsTxtRelease, Prj_Release);
            CheckBoxSetState(FRMPrjPropsIncludeVersion, Prj_IncludeVersion);
            CheckBoxSetState(FRMPrjPropsIncludeXPManifest, Prj_IncludeManifest);
            ComboBoxSetIndex(FRMPrjPropsOS, Prj_OS);
            ComboBoxSetIndex(FRMPrjPropsFileType, Prj_FileType);
            ControlSetText(FRMPrjPropsTxtTitle, ProjectTitle);
            TmpPrj_Comments = Prj_Comments;
            if(Prj_CompanyName.Len()) TmpPrj_CompanyName = Prj_CompanyName;
            TmpPrj_FileDescription = Prj_FileDescription;
            if(Prj_LegalCopyRight.Len()) TmpPrj_LegalCopyRight = Prj_LegalCopyRight;
            if(Prj_LegalTrademarks.Len()) TmpPrj_LegalTrademarks = Prj_LegalTrademarks;
            TmpPrj_ProductName = Prj_ProductName;
            ControlSetText(FRMPrjPropsTypeTxt, TmpPrj_Comments);
            FreezeTimer = 1;
            return(1);
        case WM_COMMAND:
            if((HWND) lParam == FRMPrjPropsOk)
            {
                ProjectTypeScheduledImg = NewIconFile;
                SaveProjectProperties();
                ControlClose(hwndDlg);
                return(0);
            }
            else if((HWND) lParam == FRMPrjPropsCancel)
            {
                ControlClose(hwndDlg);
                return(0);
            }
            else if((HWND) lParam == FRMPrjPropsConstants)
            {
                CreateConstants(hwndDlg);
                return(0);
            }
            else if((HWND) lParam == FRMPrjPropsReg)
            {
                RegisterUserInfos();
                return(0);
            }
            else if((HWND) lParam == FRMPrjPropsSetIcon)
            {
                SetProjectIcon();
                return(0);
            }
            break;
        case WM_PAINT:
            BeginPaint(hwndDlg, &CreatePs);
            GDIDrawHorzSep(hwndDlg, 0, 207, 402);
            EndPaint(hwndDlg, &CreatePs);
            break;
        case WM_CLOSE:
            FreezeTimer = 0;
            EndDialog(hwndDlg, 0);
            break;
    }
    return(0);
}
Exemplo n.º 22
0
Arquivo: main.c Projeto: RFBGH/ugui
void TestBtn(void)
{
	PWindow pWinSon0 = NULL;
	PButton pBtnSon0 = NULL;
	PEditView pEditSon0 = NULL;
	PCheckBox pBkBoxSon0 = NULL;
	PWindow pWinParent = NULL;
	int iRnd;
	int i;
	int iParent;
	CRect rect;
	CFont font;
	CBrush brush;
	INT iID;

	iID = 1;

	InitHeapPool(INIT_HEAP_DEFAULT);

	InitGUI();
	Log("start...\n");

	pWinParent = CreateWindowE(0, pWinRoot, iID++);

	rect.m_iLeft = 10;
	rect.m_iTop = 10;
	rect.m_iHeigh = 200;
	rect.m_iWidth = 300;

	pWinParent->m_pfSelWinRect(P2H(pWinParent), &rect, NULL);
	SetWinBKColor(pWinParent, 0xFF000000);

	pBtnSon0 = CreateButton(pWinParent, iID++, "btn1", 0, WIN_MSG_BUTTON, WinOnUsrProc);
	rect.m_iLeft = 80;
	rect.m_iTop = 10;
	rect.m_iHeigh = 50;
	rect.m_iWidth = 50;
	pBtnSon0->m_pfSelWinRect(P2H(pBtnSon0), &rect, NULL);
	SetWinBKColor(&pBtnSon0->m_baseWin, 0xFF00FF00);
	font.m_color = 0xFF000000;

	pBtnSon0->m_pfSelWinFont(P2H(pBtnSon0), &font, NULL);

	pWinSon0 = CreateWindowE(0, pWinParent, iID++);
	rect.m_iLeft = 50;
	rect.m_iTop = 10;
	rect.m_iHeigh = 50;
	rect.m_iWidth = 50;
	pWinSon0->m_pfSelWinRect(P2H(pWinSon0), &rect, NULL);
	SetWinBKColor(pWinSon0, 0xFFFF0000);

	pEditSon0 = CreateEditView(pWinParent, iID++, "you are pig stupid, fool is your nick name kill youyou are pig stupid, fool is your nick name kill you", 0/*EDIT_VIEW_MULTI_LINE*/);
	rect.m_iLeft = 30;
	rect.m_iTop = 90;
	rect.m_iHeigh = 50;
	rect.m_iWidth = 100;
	pEditSon0->m_pfSelWinRect(P2H(pEditSon0), &rect, NULL);
	pEditSon0->m_pfSelWinFont(P2H(pEditSon0), &font, NULL);
	brush.m_color = 0xFFFFFFFF;
	pEditSon0->m_pfSelWinBrush(P2H(pEditSon0), &brush, NULL);
	pEditSon0->m_iCurEdit =  10;

	pBkBoxSon0 = CreateCheckBox(pWinParent, iID++, "CheckMe", TRUE, 0);
	rect.m_iLeft = 146;
	rect.m_iTop = 80;
	rect.m_iHeigh = 24;
	rect.m_iWidth = 100;
	pBkBoxSon0->m_pfSelWinRect(P2H(pBkBoxSon0), &rect, NULL);
	pBkBoxSon0->m_pfSelWinFont(P2H(pBkBoxSon0), &font, NULL);
	brush.m_color = 0xFFFF00FF;
	pBkBoxSon0->m_pfSelWinBrush(P2H(pBkBoxSon0), &brush, NULL);

	Log("window flow...\n");
	FlowWindow0(pWinRoot, WindowFlow);

	//pWinTmp = FindWindowByID(25);
	//Log("find...");
	//WindowFlow(pWinTmp);

	PrintScreen();

#if 0
	pWinTmp = FindWindowByID(2);

	if(pWinTmp == NULL)
	{
		Log("NULL pointer\r\n");
	}

	Log("OK\r\n");

	ReorderWindow(pWinTmp);
	FlowWindow0(pWinRoot, WindowFlow);
#endif


	while(TRUE)
	{
		int x;
		int y;
		int iRet;
		PPoint pPoint;
		scanf("%d %d", &x, &y);
		pPoint = (PPoint)Malloc(sizeof(CPoint));
		pPoint->m_iX = x;
		pPoint->m_iY = y;

		iRet = pWinRoot->m_pfPostMessage(P2H(pWinRoot), WIN_MSG_ID_CLICK_SCREEN_DOWN, 0, pPoint);
		Log("iRet[%d]\r\n", iRet);
		WinFlowMain();

		FlowWindow0(pWinRoot, WindowFlow);
		PrintScreen();
	}

	DeleteEditView(pEditSon0);
	DeleteButton(pBtnSon0);
}
Exemplo n.º 23
0
// -----------------------------------------------------------------------
// Initialize Form
int CALLBACK FRMProcPerms(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    PAINTSTRUCT EnterValuePerms;
    
    switch(uMsg)
    {
        case WM_INITDIALOG:
            ControlSetText(hwndDlg, "Change directories/files permissions");
            FRMProcPermshwnd = hwndDlg;
            FRMPermsFrameOwner = CreateFrame(2, -1, 98, 72, hwndDlg, "Owner", 0, 0, 0);
            FRMPermsFrameGroup = CreateFrame(2 + 101, -1, 98, 72, hwndDlg, "Group", 0, 0, 0);
            FRMPermsFrameOther = CreateFrame(2 + (101 * 2), -1, 98, 72, hwndDlg, "Other", 0, 0, 0);
            if(PermOwnerR == 0)
            {
                FRMPermsChkOwnerR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameOwner, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 0);
            }
            else if(PermOwnerR == PermNbrFiles)
            {
                FRMPermsChkOwnerR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameOwner, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 0);
                CheckBoxSetState(FRMPermsChkOwnerR, 1);
            }
            else
            {
                FRMPermsChkOwnerR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameOwner, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 1);
                CheckBoxSetState(FRMPermsChkOwnerR, BST_INDETERMINATE);
            }
            if(PermOwnerW == 0)
            {
                FRMPermsChkOwnerW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameOwner, "Write", 1, 0, WS_TABSTOP, 0);
            }
            else if(PermOwnerW == PermNbrFiles)
            {
                FRMPermsChkOwnerW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameOwner, "Write", 1, 0, WS_TABSTOP, 0);
                CheckBoxSetState(FRMPermsChkOwnerW, 1);
            }
            else
            {
                FRMPermsChkOwnerW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameOwner, "Write", 1, 0, WS_TABSTOP, 1);
                CheckBoxSetState(FRMPermsChkOwnerW, BST_INDETERMINATE);
            }
            if(PermOwnerX == 0)
            {
                FRMPermsChkOwnerE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameOwner, "Execute", 1, 0, WS_TABSTOP, 0);
            }
            else if(PermOwnerX == PermNbrFiles)
            {
                FRMPermsChkOwnerE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameOwner, "Execute", 1, 0, WS_TABSTOP, 0);
                CheckBoxSetState(FRMPermsChkOwnerE, 1);
            }
            else
            {
                FRMPermsChkOwnerE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameOwner, "Execute", 1, 0, WS_TABSTOP, 1);
                CheckBoxSetState(FRMPermsChkOwnerE, BST_INDETERMINATE);
            }
            if(PermGroupR == 0)
            {
                FRMPermsChkGroupR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameGroup, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 0);
            }
            else if(PermGroupR == PermNbrFiles)
            {
                FRMPermsChkGroupR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameGroup, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 0);
                CheckBoxSetState(FRMPermsChkGroupR, 1);
            }
            else
            {
                FRMPermsChkGroupR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameGroup, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 1);
                CheckBoxSetState(FRMPermsChkGroupR, BST_INDETERMINATE);
            }
            if(PermGroupW == 0)
            {
                FRMPermsChkGroupW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameGroup, "Write", 1, 0, WS_TABSTOP, 0);
            }
            else if(PermGroupW == PermNbrFiles)
            {
                FRMPermsChkGroupW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameGroup, "Write", 1, 0, WS_TABSTOP, 0);
                CheckBoxSetState(FRMPermsChkGroupW, 1);
            }
            else
            {
                FRMPermsChkGroupW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameGroup, "Write", 1, 0, WS_TABSTOP, 1);
                CheckBoxSetState(FRMPermsChkGroupW, BST_INDETERMINATE);
            }
            if(PermGroupX == 0)
            {
                FRMPermsChkGroupE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameGroup, "Execute", 1, 0, WS_TABSTOP, 0);
            }
            else if(PermGroupX == PermNbrFiles)
            {
                FRMPermsChkGroupE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameGroup, "Execute", 1, 0, WS_TABSTOP, 0);
                CheckBoxSetState(FRMPermsChkGroupE, 1);
            }
            else
            {
                FRMPermsChkGroupE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameGroup, "Execute", 1, 0, WS_TABSTOP, 1);
                CheckBoxSetState(FRMPermsChkGroupE, BST_INDETERMINATE);
            }
            if(PermOtherR == 0)
            {
                FRMPermsChkOtherR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameOther, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 0);
            }
            else if(PermOtherR == PermNbrFiles)
            {
                FRMPermsChkOtherR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameOther, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 0);
                CheckBoxSetState(FRMPermsChkOtherR, 1);
            }
            else
            {
                FRMPermsChkOtherR = CreateCheckBox(14, 16, 80, 15, FRMPermsFrameOther, "Read", 1, 0, WS_TABSTOP | WS_GROUP, 1);
                CheckBoxSetState(FRMPermsChkOtherR, BST_INDETERMINATE);
            }
            if(PermOtherW == 0)
            {
                FRMPermsChkOtherW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameOther, "Write", 1, 0, WS_TABSTOP, 0);
            }
            else if(PermOtherW == PermNbrFiles)
            {
                FRMPermsChkOtherW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameOther, "Write", 1, 0, WS_TABSTOP, 0);
                CheckBoxSetState(FRMPermsChkOtherW, 1);
            }
            else
            {
                FRMPermsChkOtherW = CreateCheckBox(14, 16 + 17, 80, 15, FRMPermsFrameOther, "Write", 1, 0, WS_TABSTOP, 1);
                CheckBoxSetState(FRMPermsChkOtherW, BST_INDETERMINATE);
            }
            if(PermOtherX == 0)
            {
                FRMPermsChkOtherE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameOther, "Execute", 1, 0, WS_TABSTOP, 0);
            }
            else if(PermOtherX == PermNbrFiles)
            {
                FRMPermsChkOtherE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameOther, "Execute", 1, 0, WS_TABSTOP, 0);
                CheckBoxSetState(FRMPermsChkOtherE, 1);
            }
            else
            {
                FRMPermsChkOtherE = CreateCheckBox(14, 16 + (17 * 2), 80, 15, FRMPermsFrameOther, "Execute", 1, 0, WS_TABSTOP, 1);
                CheckBoxSetState(FRMPermsChkOtherE, BST_INDETERMINATE);
            }
            FRMPermsOk = CreateButton(116 + 29, 84, 77, 23, hwndDlg, "Ok", 3, 0, 0, 0, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP, Buttons_StaticEdge);
            FRMPermsCancel = CreateButton(195 + 29, 84, 77, 23, hwndDlg, "Cancel", 2, 0, 0, 0, WS_TABSTOP, Buttons_StaticEdge);
            FreezeTimer = 1;
            return(1);
        case WM_PAINT:
            BeginPaint(hwndDlg, &EnterValuePerms);
            GDIDrawHorzSep(hwndDlg, 0, 77, 304);
            EndPaint(hwndDlg, &EnterValuePerms);
            break;
        case WM_COMMAND:
            if((HWND) lParam == FRMPermsOk)
            {
                switch(CheckBoxGetState(FRMPermsChkOwnerR))
                {
                    case BST_UNCHECKED:
                        PermOwnerR = 0;
                        break;
                    case BST_CHECKED:
                        PermOwnerR = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkOwnerW))
                {
                    case BST_UNCHECKED:
                        PermOwnerW = 0;
                        break;
                    case BST_CHECKED:
                        PermOwnerW = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkOwnerE))
                {
                    case BST_UNCHECKED:
                        PermOwnerX = 0;
                        break;
                    case BST_CHECKED:
                        PermOwnerX = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkGroupR))
                {
                    case BST_UNCHECKED:
                        PermGroupR = 0;
                        break;
                    case BST_CHECKED:
                        PermGroupR = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkGroupW))
                {
                    case BST_UNCHECKED:
                        PermGroupW = 0;
                        break;
                    case BST_CHECKED:
                        PermGroupW = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkGroupE))
                {
                    case BST_UNCHECKED:
                        PermGroupX = 0;
                        break;
                    case BST_CHECKED:
                        PermGroupX = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkOtherR))
                {
                    case BST_UNCHECKED:
                        PermOtherR = 0;
                        break;
                    case BST_CHECKED:
                        PermOtherR = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkOtherW))
                {
                    case BST_UNCHECKED:
                        PermOtherW = 0;
                        break;
                    case BST_CHECKED:
                        PermOtherW = PermNbrFiles;
                        break;
                }
                switch(CheckBoxGetState(FRMPermsChkOtherE))
                {
                    case BST_UNCHECKED:
                        PermOtherX = 0;
                        break;
                    case BST_CHECKED:
                        PermOtherX = PermNbrFiles;
                        break;
                }
                ControlClose(hwndDlg);
                return(0);
            }
            else if((HWND) lParam == FRMPermsCancel)
            {
                ControlClose(hwndDlg);
                return(0);
            }
            break;
        case WM_CLOSE:
            FreezeTimer = 0;
            EndDialog(hwndDlg, 0);
    }
    return(0);
}
Exemplo n.º 24
0
static void AddListFItem(t_x11 *x11, t_dlgitemlist *list, 
			 t_fitem *fitem, t_id GroupID, t_id *ID,
			 int x, int *y, int *w,bool bUseMon)
{
  int i,iSel,slen;
  char buf[STRLEN];
  
  switch(fitem->edlg) {
  case edlgBN:
    AddListItem
      (list,CreateButton(x11,fitem->name[0],fitem->bDef,(*ID)++,GroupID,
			 x,(*y),0,0,0));
    break;
  case edlgRB:
    strcpy(buf,fitem->def);
    iSel=-1;
    for (i=0; (i<fitem->nname); i++) {
      char buf2[100];

      strcpy(buf2,fitem->name[i]);
      buf2[strlen(buf)]='\0'; /* truncate itemname */
      if (strcasecmp(buf2,buf)==0)
	iSel=i;
    }

    for(i=0; (i<fitem->nname); i++) {
      AddListItem(list,
		  CreateRadioButton(x11,fitem->name[i],(iSel==i),
				    (*ID)++,GroupID,x,(*y),0,0,0));
      (*y)+=list->list[list->nitem-1]->win.height+OFFS_Y;
      (*w)=max((*w),list->list[list->nitem-1]->win.width);
      SetDlgitemOpts(list->list[list->nitem-1],bUseMon,
		     fitem->set,fitem->get,fitem->help);
    }
    break;
  case edlgCB: {
    bool bCheck;

    bCheck=strcasecmp(fitem->def,"TRUE")==0;
    AddListItem(list,CreateCheckBox(x11,fitem->name[0],bCheck,
				    (*ID)++,GroupID,x,(*y),0,0,0));
    break;
  }
  case edlgST:
    AddListItem(list,
		CreateStaticText(x11,fitem->nname,fitem->name,(*ID)++,
				 GroupID,x,(*y),0,0,0));
    break;
  case edlgET:
    slen=strlen(fitem->name[0])+strlen(fitem->def);
    AddListItem(list,CreateEditText(x11,fitem->name[0],slen,fitem->def,
				    (*ID)++,GroupID,x,(*y),0,0,0));
    break;
  case edlgPM:
  case edlgGB:
  default:
    gmx_fatal(FARGS,"Invalid list->list type: %d\n",fitem->edlg);
  }
  SetDlgitemOpts(list->list[list->nitem-1],bUseMon,
		 fitem->set,fitem->get,fitem->help);
  
  if (fitem->edlg != edlgRB) {
    (*y)+=list->list[list->nitem-1]->win.height+OFFS_Y;
    (*w)=max((*w),list->list[list->nitem-1]->win.width);
  }
}
Exemplo n.º 25
0
VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& _ininame)
	: wxDialog(parent, -1,
		wxString::Format(_("Dolphin %s Graphics Configuration"), wxGetTranslation(StrToWxStr(title))),
		wxDefaultPosition, wxDefaultSize)
	, vconfig(g_Config)
	, ininame(_ininame)
{
	vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());

	Bind(wxEVT_UPDATE_UI, &VideoConfigDiag::OnUpdateUI, this);

	wxNotebook* const notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize);

	// -- GENERAL --
	{
	wxPanel* const page_general = new wxPanel(notebook, -1, wxDefaultPosition);
	notebook->AddPage(page_general, _("General"));
	wxBoxSizer* const szr_general = new wxBoxSizer(wxVERTICAL);

	// - basic
	{
	wxFlexGridSizer* const szr_basic = new wxFlexGridSizer(2, 5, 5);

	// backend
	{
	wxStaticText* const label_backend = new wxStaticText(page_general, wxID_ANY, _("Backend:"));
	choice_backend = new wxChoice(page_general, wxID_ANY, wxDefaultPosition);
	RegisterControl(choice_backend, wxGetTranslation(backend_desc));

	std::vector<VideoBackend*>::const_iterator
			it = g_available_video_backends.begin(),
			itend = g_available_video_backends.end();
	for (; it != itend; ++it)
		choice_backend->AppendString(wxGetTranslation(StrToWxStr((*it)->GetDisplayName())));

	choice_backend->SetStringSelection(wxGetTranslation(StrToWxStr(g_video_backend->GetDisplayName())));
	choice_backend->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_Backend, this);

	szr_basic->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5);
	szr_basic->Add(choice_backend, 1, 0, 0);

	if (Core::GetState() != Core::CORE_UNINITIALIZED)
	{
		label_backend->Disable();
		choice_backend->Disable();
	}
	}

	// adapter (D3D only)
	if (vconfig.backend_info.Adapters.size())
	{
		wxChoice* const choice_adapter = CreateChoice(page_general, vconfig.iAdapter, wxGetTranslation(adapter_desc));

		std::vector<std::string>::const_iterator
			it = vconfig.backend_info.Adapters.begin(),
			itend = vconfig.backend_info.Adapters.end();
		for (; it != itend; ++it)
			choice_adapter->AppendString(StrToWxStr(*it));

		choice_adapter->Select(vconfig.iAdapter);

		szr_basic->Add(new wxStaticText(page_general, -1, _("Adapter:")), 1, wxALIGN_CENTER_VERTICAL, 5);
		szr_basic->Add(choice_adapter, 1, 0, 0);
	}


	// - display
	wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, 5, 5);

	{

#if !defined(__APPLE__)
	// display resolution
	{
		wxArrayString res_list = GetListOfResolutions();
		if (res_list.empty())
			res_list.Add(_("<No resolutions found>"));
		wxStaticText* const label_display_resolution = new wxStaticText(page_general, wxID_ANY, _("Fullscreen resolution:"));
		choice_display_resolution = new wxChoice(page_general, wxID_ANY, wxDefaultPosition, wxDefaultSize, res_list);
		RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc));
		choice_display_resolution->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_DisplayResolution, this);

		choice_display_resolution->SetStringSelection(StrToWxStr(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution));

		szr_display->Add(label_display_resolution, 1, wxALIGN_CENTER_VERTICAL, 0);
		szr_display->Add(choice_display_resolution);

		if (Core::GetState() != Core::CORE_UNINITIALIZED)
		{
			label_display_resolution->Disable();
			choice_display_resolution->Disable();
		}
	}
#endif

	// aspect-ratio
	{
	const wxString ar_choices[] = { _("Auto"), _("Force 16:9"), _("Force 4:3"), _("Stretch to Window") };

	szr_display->Add(new wxStaticText(page_general, -1, _("Aspect Ratio:")), 1, wxALIGN_CENTER_VERTICAL, 0);
	wxChoice* const choice_aspect = CreateChoice(page_general, vconfig.iAspectRatio, wxGetTranslation(ar_desc),
														sizeof(ar_choices)/sizeof(*ar_choices), ar_choices);
	szr_display->Add(choice_aspect, 1, 0, 0);
	}

	// various other display options
	{
	szr_display->Add(CreateCheckBox(page_general, _("V-Sync"), wxGetTranslation(vsync_desc), vconfig.bVSync));
	szr_display->Add(CreateCheckBox(page_general, _("Use Fullscreen"), wxGetTranslation(use_fullscreen_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen));
	}
	}

	// - other
	wxFlexGridSizer* const szr_other = new wxFlexGridSizer(2, 5, 5);

	{
	SettingCheckBox* render_to_main_cb;
	szr_other->Add(CreateCheckBox(page_general, _("Show FPS"), wxGetTranslation(show_fps_desc), vconfig.bShowFPS));
	szr_other->Add(CreateCheckBox(page_general, _("Log FPS to file"), wxGetTranslation(log_fps_to_file_desc), vconfig.bLogFPSToFile));
	szr_other->Add(CreateCheckBox(page_general, _("Auto adjust Window Size"), wxGetTranslation(auto_window_size_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize));
	szr_other->Add(CreateCheckBox(page_general, _("Keep window on top"), wxGetTranslation(keep_window_on_top_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bKeepWindowOnTop));
	szr_other->Add(CreateCheckBox(page_general, _("Hide Mouse Cursor"), wxGetTranslation(hide_mouse_cursor_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor));
	szr_other->Add(render_to_main_cb = CreateCheckBox(page_general, _("Render to Main Window"), wxGetTranslation(render_to_main_win_desc), SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain));

	if (Core::GetState() != Core::CORE_UNINITIALIZED)
		render_to_main_cb->Disable();

	}


	wxStaticBoxSizer* const group_basic = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Basic"));
	group_basic->Add(szr_basic, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_general->Add(group_basic, 0, wxEXPAND | wxALL, 5);

	wxStaticBoxSizer* const group_display = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Display"));
	group_display->Add(szr_display, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_general->Add(group_display, 0, wxEXPAND | wxALL, 5);

	wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Other"));
	group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_general->Add(group_other, 0, wxEXPAND | wxALL, 5);
	}

	szr_general->AddStretchSpacer();
	CreateDescriptionArea(page_general, szr_general);
	page_general->SetSizerAndFit(szr_general);
	}

	// -- ENHANCEMENTS --
	{
	wxPanel* const page_enh = new wxPanel(notebook, -1, wxDefaultPosition);
	notebook->AddPage(page_enh, _("Enhancements"));
	wxBoxSizer* const szr_enh_main = new wxBoxSizer(wxVERTICAL);

	// - enhancements
	wxFlexGridSizer* const szr_enh = new wxFlexGridSizer(2, 5, 5);

	// Internal resolution
	{
	const wxString efbscale_choices[] = { _("Auto (Window Size)"), _("Auto (Multiple of 640x528)"),
		_("1x Native (640x528)"), _("1.5x Native (960x792)"), _("2x Native (1280x1056)"),
		_("2.5x Native (1600x1320)"), _("3x Native (1920x1584)"), _("4x Native (2560x2112)") };

	wxChoice *const choice_efbscale = CreateChoice(page_enh,
		vconfig.iEFBScale, wxGetTranslation(internal_res_desc), sizeof(efbscale_choices)/sizeof(*efbscale_choices), efbscale_choices);

	szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Internal Resolution:")), 1, wxALIGN_CENTER_VERTICAL, 0);
	szr_enh->Add(choice_efbscale);
	}

	// AA
	{
	text_aamode = new wxStaticText(page_enh, -1, _("Anti-Aliasing:"));
	choice_aamode = CreateChoice(page_enh, vconfig.iMultisampleMode, wxGetTranslation(aa_desc));

	std::vector<std::string>::const_iterator
		it = vconfig.backend_info.AAModes.begin(),
		itend = vconfig.backend_info.AAModes.end();
	for (; it != itend; ++it)
		choice_aamode->AppendString(wxGetTranslation(StrToWxStr(*it)));

	choice_aamode->Select(vconfig.iMultisampleMode);
	szr_enh->Add(text_aamode, 1, wxALIGN_CENTER_VERTICAL, 0);
	szr_enh->Add(choice_aamode);
	}

	// AF
	{
	const wxString af_choices[] = {wxT("1x"), wxT("2x"), wxT("4x"), wxT("8x"), wxT("16x")};
	szr_enh->Add(new wxStaticText(page_enh, -1, _("Anisotropic Filtering:")), 1, wxALIGN_CENTER_VERTICAL, 0);
	szr_enh->Add(CreateChoice(page_enh, vconfig.iMaxAnisotropy, wxGetTranslation(af_desc), 5, af_choices));
	}

	// postproc shader
	if (vconfig.backend_info.PPShaders.size())
	{
		wxChoice *const choice_ppshader = new wxChoice(page_enh, -1, wxDefaultPosition);
		RegisterControl(choice_ppshader, wxGetTranslation(ppshader_desc));
		choice_ppshader->AppendString(_("(off)"));

		std::vector<std::string>::const_iterator
			it = vconfig.backend_info.PPShaders.begin(),
			itend = vconfig.backend_info.PPShaders.end();
		for (; it != itend; ++it)
			choice_ppshader->AppendString(StrToWxStr(*it));

		if (vconfig.sPostProcessingShader.empty())
			choice_ppshader->Select(0);
		else
			choice_ppshader->SetStringSelection(StrToWxStr(vconfig.sPostProcessingShader));

		choice_ppshader->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_PPShader, this);

		szr_enh->Add(new wxStaticText(page_enh, -1, _("Post-Processing Effect:")), 1, wxALIGN_CENTER_VERTICAL, 0);
		szr_enh->Add(choice_ppshader);
	}

	// Scaled copy, PL, Bilinear filter, 3D Vision
	szr_enh->Add(CreateCheckBox(page_enh, _("Scaled EFB Copy"), wxGetTranslation(scaled_efb_copy_desc), vconfig.bCopyEFBScaled));
	szr_enh->Add(pixel_lighting = CreateCheckBox(page_enh, _("Per-Pixel Lighting"), wxGetTranslation(pixel_lighting_desc), vconfig.bEnablePixelLighting));
	szr_enh->Add(CreateCheckBox(page_enh, _("Force Texture Filtering"), wxGetTranslation(force_filtering_desc), vconfig.bForceFiltering));

	szr_enh->Add(CreateCheckBox(page_enh, _("Widescreen Hack"), wxGetTranslation(ws_hack_desc), vconfig.bWidescreenHack));
	szr_enh->Add(CreateCheckBox(page_enh, _("Disable Fog"), wxGetTranslation(disable_fog_desc), vconfig.bDisableFog));

	// 3D Vision
	_3d_vision = CreateCheckBox(page_enh, _("3D Vision"), wxGetTranslation(_3d_vision_desc), vconfig.b3DVision);
	_3d_vision->Show(vconfig.backend_info.bSupports3DVision);
	szr_enh->Add(_3d_vision);
	// TODO: Add anaglyph 3d here

	wxStaticBoxSizer* const group_enh = new wxStaticBoxSizer(wxVERTICAL, page_enh, _("Enhancements"));
	group_enh->Add(szr_enh, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_enh_main->Add(group_enh, 0, wxEXPAND | wxALL, 5);


	szr_enh_main->AddStretchSpacer();
	CreateDescriptionArea(page_enh, szr_enh_main);
	page_enh->SetSizerAndFit(szr_enh_main);
	}


	// -- SPEED HACKS --
	{
	wxPanel* const page_hacks = new wxPanel(notebook, -1, wxDefaultPosition);
	notebook->AddPage(page_hacks, _("Hacks"));
	wxBoxSizer* const szr_hacks = new wxBoxSizer(wxVERTICAL);

	// - EFB hacks
	wxStaticBoxSizer* const szr_efb = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Embedded Frame Buffer"));

	// format change emulation
	emulate_efb_format_changes = CreateCheckBox(page_hacks, _("Ignore Format Changes"), wxGetTranslation(efb_emulate_format_changes_desc), vconfig.bEFBEmulateFormatChanges, true);

	// EFB copies
	wxStaticBoxSizer* const group_efbcopy = new wxStaticBoxSizer(wxHORIZONTAL, page_hacks, _("EFB Copies"));

	SettingCheckBox* efbcopy_disable = CreateCheckBox(page_hacks, _("Disable"), wxGetTranslation(efb_copy_desc), vconfig.bEFBCopyEnable, true);
	efbcopy_texture = CreateRadioButton(page_hacks, _("Texture"), wxGetTranslation(efb_copy_texture_desc), vconfig.bCopyEFBToTexture, false, wxRB_GROUP);
	efbcopy_ram = CreateRadioButton(page_hacks, _("RAM"), wxGetTranslation(efb_copy_ram_desc), vconfig.bCopyEFBToTexture, true);
	cache_efb_copies = CreateCheckBox(page_hacks, _("Enable Cache"), wxGetTranslation(cache_efb_copies_desc), vconfig.bEFBCopyCacheEnable);

	group_efbcopy->Add(efbcopy_disable, 0, wxLEFT | wxRIGHT | wxBOTTOM, 5);
	group_efbcopy->AddStretchSpacer(1);
	group_efbcopy->Add(efbcopy_texture, 0, wxRIGHT, 5);
	group_efbcopy->Add(efbcopy_ram, 0, wxRIGHT, 5);
	group_efbcopy->Add(cache_efb_copies, 0, wxRIGHT, 5);

	szr_efb->Add(CreateCheckBox(page_hacks, _("Skip EFB Access from CPU"), wxGetTranslation(efb_access_desc), vconfig.bEFBAccessEnable, true), 0, wxBOTTOM | wxLEFT, 5);
	szr_efb->Add(emulate_efb_format_changes, 0, wxBOTTOM | wxLEFT, 5);
	szr_efb->Add(group_efbcopy, 0, wxEXPAND | wxALL, 5);
	szr_hacks->Add(szr_efb, 0, wxEXPAND | wxALL, 5);

	// Texture cache
	{
	wxStaticBoxSizer* const szr_safetex = new wxStaticBoxSizer(wxHORIZONTAL, page_hacks, _("Texture Cache"));

	// TODO: Use wxSL_MIN_MAX_LABELS or wxSL_VALUE_LABEL with wx 2.9.1
	wxSlider* const stc_slider = new wxSlider(page_hacks, wxID_ANY, 0, 0, 2, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_BOTTOM);
	stc_slider->Bind(wxEVT_COMMAND_SLIDER_UPDATED, &VideoConfigDiag::Event_Stc, this);
	RegisterControl(stc_slider, wxGetTranslation(stc_desc));

	if (vconfig.iSafeTextureCache_ColorSamples == 0) stc_slider->SetValue(0);
	else if (vconfig.iSafeTextureCache_ColorSamples == 512) stc_slider->SetValue(1);
	else if (vconfig.iSafeTextureCache_ColorSamples == 128) stc_slider->SetValue(2);
	else stc_slider->Disable(); // Using custom number of samples; TODO: Inform the user why this is disabled..

	szr_safetex->Add(new wxStaticText(page_hacks, wxID_ANY, _("Accuracy:")), 0, wxALL, 5);
	szr_safetex->AddStretchSpacer(1);
	szr_safetex->Add(new wxStaticText(page_hacks, wxID_ANY, _("Safe")), 0, wxLEFT|wxTOP|wxBOTTOM, 5);
	szr_safetex->Add(stc_slider, 2, wxRIGHT, 0);
	szr_safetex->Add(new wxStaticText(page_hacks, wxID_ANY, _("Fast")), 0, wxRIGHT|wxTOP|wxBOTTOM, 5);
	szr_hacks->Add(szr_safetex, 0, wxEXPAND | wxALL, 5);
	}

	// - XFB
	{
	wxStaticBoxSizer* const group_xfb = new wxStaticBoxSizer(wxHORIZONTAL, page_hacks, _("External Frame Buffer"));

	SettingCheckBox* disable_xfb = CreateCheckBox(page_hacks, _("Disable"), wxGetTranslation(xfb_desc), vconfig.bUseXFB, true);
	virtual_xfb = CreateRadioButton(page_hacks, _("Virtual"), wxGetTranslation(xfb_virtual_desc), vconfig.bUseRealXFB, true, wxRB_GROUP);
	real_xfb = CreateRadioButton(page_hacks, _("Real"), wxGetTranslation(xfb_real_desc), vconfig.bUseRealXFB);

	group_xfb->Add(disable_xfb, 0, wxLEFT | wxRIGHT | wxBOTTOM, 5);
	group_xfb->AddStretchSpacer(1);
	group_xfb->Add(virtual_xfb, 0, wxRIGHT, 5);
	group_xfb->Add(real_xfb, 0, wxRIGHT, 5);
	szr_hacks->Add(group_xfb, 0, wxEXPAND | wxALL, 5);
	}	// xfb

	// - other hacks
	{
	wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5);
	szr_other->Add(CreateCheckBox(page_hacks, _("Cache Display Lists"), wxGetTranslation(dlc_desc), vconfig.bDlistCachingEnable));
	szr_other->Add(CreateCheckBox(page_hacks, _("Disable Destination Alpha"), wxGetTranslation(disable_dstalpha_desc), vconfig.bDstAlphaPass));
	szr_other->Add(CreateCheckBox(page_hacks, _("OpenMP Texture Decoder"), wxGetTranslation(omp_desc), vconfig.bOMPDecoder));
	szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), wxGetTranslation(fast_depth_calc_desc), vconfig.bFastDepthCalc));

	wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other"));
	group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_hacks->Add(group_other, 0, wxEXPAND | wxALL, 5);
	}

	szr_hacks->AddStretchSpacer();
	CreateDescriptionArea(page_hacks, szr_hacks);
	page_hacks->SetSizerAndFit(szr_hacks);
	}

	// -- ADVANCED --
	{
	wxPanel* const page_advanced = new wxPanel(notebook, -1, wxDefaultPosition);
	notebook->AddPage(page_advanced, _("Advanced"));
	wxBoxSizer* const szr_advanced = new wxBoxSizer(wxVERTICAL);

	// - debug
	{
	wxGridSizer* const szr_debug = new wxGridSizer(2, 5, 5);

	szr_debug->Add(CreateCheckBox(page_advanced, _("Enable Wireframe"), wxGetTranslation(wireframe_desc), vconfig.bWireFrame));
	szr_debug->Add(CreateCheckBox(page_advanced, _("Show EFB Copy Regions"), wxGetTranslation(efb_copy_regions_desc), vconfig.bShowEFBCopyRegions));
	szr_debug->Add(CreateCheckBox(page_advanced, _("Show Statistics"), wxGetTranslation(show_stats_desc), vconfig.bOverlayStats));
	szr_debug->Add(CreateCheckBox(page_advanced, _("Texture Format Overlay"), wxGetTranslation(texfmt_desc), vconfig.bTexFmtOverlayEnable));

	wxStaticBoxSizer* const group_debug = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Debugging"));
	szr_advanced->Add(group_debug, 0, wxEXPAND | wxALL, 5);
	group_debug->Add(szr_debug, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	}

	// - utility
	{
	wxGridSizer* const szr_utility = new wxGridSizer(2, 5, 5);

	szr_utility->Add(CreateCheckBox(page_advanced, _("Dump Textures"), wxGetTranslation(dump_textures_desc), vconfig.bDumpTextures));
	szr_utility->Add(CreateCheckBox(page_advanced, _("Load Custom Textures"), wxGetTranslation(load_hires_textures_desc), vconfig.bHiresTextures));
	szr_utility->Add(CreateCheckBox(page_advanced, _("Dump EFB Target"), wxGetTranslation(dump_efb_desc), vconfig.bDumpEFBTarget));
	szr_utility->Add(CreateCheckBox(page_advanced, _("Dump Frames"), wxGetTranslation(dump_frames_desc), vconfig.bDumpFrames));
	szr_utility->Add(CreateCheckBox(page_advanced, _("Free Look"), wxGetTranslation(free_look_desc), vconfig.bFreeLook));
#if !defined WIN32 && defined HAVE_LIBAV
	szr_utility->Add(CreateCheckBox(page_advanced, _("Frame Dumps use FFV1"), wxGetTranslation(use_ffv1_desc), vconfig.bUseFFV1));
#endif

	wxStaticBoxSizer* const group_utility = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Utility"));
	szr_advanced->Add(group_utility, 0, wxEXPAND | wxALL, 5);
	group_utility->Add(szr_utility, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	}

	// - misc
	{
	wxGridSizer* const szr_misc = new wxGridSizer(2, 5, 5);

	szr_misc->Add(CreateCheckBox(page_advanced, _("Show Input Display"), wxGetTranslation(show_input_display_desc), vconfig.bShowInputDisplay));
	szr_misc->Add(CreateCheckBox(page_advanced, _("Crop"), wxGetTranslation(crop_desc), vconfig.bCrop));

	// Progressive Scan
	{
	wxCheckBox* const cb_prog_scan = new wxCheckBox(page_advanced, wxID_ANY, _("Enable Progressive Scan"));
	RegisterControl(cb_prog_scan, wxGetTranslation(prog_scan_desc));
	cb_prog_scan->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &VideoConfigDiag::Event_ProgressiveScan, this);
	if (Core::GetState() != Core::CORE_UNINITIALIZED)
		cb_prog_scan->Disable();

	cb_prog_scan->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive);
	// A bit strange behavior, but this needs to stay in sync with the main progressive boolean; TODO: Is this still necessary?
	SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive);

	szr_misc->Add(cb_prog_scan);
	}

	wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc"));
	szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5);
	group_misc->Add(szr_misc, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	}

	szr_advanced->AddStretchSpacer();
	CreateDescriptionArea(page_advanced, szr_advanced);
	page_advanced->SetSizerAndFit(szr_advanced);
	}

	wxButton* const btn_close = new wxButton(this, wxID_OK, _("Close"), wxDefaultPosition);
	btn_close->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &VideoConfigDiag::Event_ClickClose, this);

	Bind(wxEVT_CLOSE_WINDOW, &VideoConfigDiag::Event_Close, this);

	wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL);
	szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5);
	szr_main->Add(btn_close, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 5);

	SetSizerAndFit(szr_main);
	Center();
	SetFocus();

	UpdateWindowUI();
}
Exemplo n.º 26
0
VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& _ininame)
	: wxDialog(parent, wxID_ANY,
		wxString::Format(_("Dolphin %s Graphics Configuration"), wxGetTranslation(StrToWxStr(title))))
	, vconfig(g_Config)
	, ininame(_ininame)
{
	vconfig.Load(File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini");

	Bind(wxEVT_UPDATE_UI, &VideoConfigDiag::OnUpdateUI, this);

	wxNotebook* const notebook = new wxNotebook(this, wxID_ANY);

	// -- GENERAL --
	{
	wxPanel* const page_general = new wxPanel(notebook);
	notebook->AddPage(page_general, _("General"));
	wxBoxSizer* const szr_general = new wxBoxSizer(wxVERTICAL);

	// - basic
	{
	wxFlexGridSizer* const szr_basic = new wxFlexGridSizer(2, 5, 5);

	// backend
	{
	label_backend = new wxStaticText(page_general, wxID_ANY, _("Backend:"));
	choice_backend = new wxChoice(page_general, wxID_ANY);
	RegisterControl(choice_backend, wxGetTranslation(backend_desc));

	for (const VideoBackend* backend : g_available_video_backends)
	{
		choice_backend->AppendString(wxGetTranslation(StrToWxStr(backend->GetDisplayName())));
	}

	choice_backend->SetStringSelection(wxGetTranslation(StrToWxStr(g_video_backend->GetDisplayName())));
	choice_backend->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_Backend, this);

	szr_basic->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5);
	szr_basic->Add(choice_backend, 1, 0, 0);
	}

	// adapter (D3D only)
	if (vconfig.backend_info.Adapters.size())
	{
		choice_adapter = CreateChoice(page_general, vconfig.iAdapter, wxGetTranslation(adapter_desc));

		for (const std::string& adapter : vconfig.backend_info.Adapters)
		{
			choice_adapter->AppendString(StrToWxStr(adapter));
		}

		choice_adapter->Select(vconfig.iAdapter);

		label_adapter = new wxStaticText(page_general, wxID_ANY, _("Adapter:"));
		szr_basic->Add(label_adapter, 1, wxALIGN_CENTER_VERTICAL, 5);
		szr_basic->Add(choice_adapter, 1, 0, 0);
	}


	// - display
	wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, 5, 5);

	{

#if !defined(__APPLE__)
	// display resolution
	{
		wxArrayString res_list = GetListOfResolutions();
		if (res_list.empty())
			res_list.Add(_("<No resolutions found>"));
		label_display_resolution = new wxStaticText(page_general, wxID_ANY, _("Fullscreen Resolution:"));
		choice_display_resolution = new wxChoice(page_general, wxID_ANY, wxDefaultPosition, wxDefaultSize, res_list);
		RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc));
		choice_display_resolution->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_DisplayResolution, this);

		choice_display_resolution->SetStringSelection(StrToWxStr(SConfig::GetInstance().strFullscreenResolution));

		szr_display->Add(label_display_resolution, 1, wxALIGN_CENTER_VERTICAL, 0);
		szr_display->Add(choice_display_resolution);
	}
#endif

	// aspect-ratio
	{
	const wxString ar_choices[] = { _("Auto"), _("Force 16:9"), _("Force 4:3"), _("Stretch to Window") };

	szr_display->Add(new wxStaticText(page_general, wxID_ANY, _("Aspect Ratio:")), 1, wxALIGN_CENTER_VERTICAL, 0);
	wxChoice* const choice_aspect = CreateChoice(page_general, vconfig.iAspectRatio, wxGetTranslation(ar_desc),
	                                             sizeof(ar_choices)/sizeof(*ar_choices), ar_choices);
	szr_display->Add(choice_aspect, 1, 0, 0);
	}

	// various other display options
	{
	szr_display->Add(CreateCheckBox(page_general, _("V-Sync"), wxGetTranslation(vsync_desc), vconfig.bVSync));
	szr_display->Add(CreateCheckBox(page_general, _("Use Fullscreen"), wxGetTranslation(use_fullscreen_desc), SConfig::GetInstance().bFullscreen));
	}
	}

	// - other
	wxFlexGridSizer* const szr_other = new wxFlexGridSizer(2, 5, 5);

	{
	szr_other->Add(CreateCheckBox(page_general, _("Show FPS"), wxGetTranslation(show_fps_desc), vconfig.bShowFPS));
	szr_other->Add(CreateCheckBox(page_general, _("Log Render Time to File"), wxGetTranslation(log_render_time_to_file_desc), vconfig.bLogRenderTimeToFile));
	szr_other->Add(CreateCheckBox(page_general, _("Auto adjust Window Size"), wxGetTranslation(auto_window_size_desc), SConfig::GetInstance().bRenderWindowAutoSize));
	szr_other->Add(CreateCheckBox(page_general, _("Keep Window on Top"), wxGetTranslation(keep_window_on_top_desc), SConfig::GetInstance().bKeepWindowOnTop));
	szr_other->Add(CreateCheckBox(page_general, _("Hide Mouse Cursor"), wxGetTranslation(hide_mouse_cursor_desc), SConfig::GetInstance().bHideCursor));
	szr_other->Add(render_to_main_checkbox = CreateCheckBox(page_general, _("Render to Main Window"), wxGetTranslation(render_to_main_win_desc), SConfig::GetInstance().bRenderToMain));
	}


	wxStaticBoxSizer* const group_basic = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Basic"));
	group_basic->Add(szr_basic, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_general->Add(group_basic, 0, wxEXPAND | wxALL, 5);

	wxStaticBoxSizer* const group_display = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Display"));
	group_display->Add(szr_display, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_general->Add(group_display, 0, wxEXPAND | wxALL, 5);

	wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_general, _("Other"));
	group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_general->Add(group_other, 0, wxEXPAND | wxALL, 5);
	}

	szr_general->AddStretchSpacer();
	CreateDescriptionArea(page_general, szr_general);
	page_general->SetSizerAndFit(szr_general);
	}

	// -- ENHANCEMENTS --
	{
	wxPanel* const page_enh = new wxPanel(notebook);
	notebook->AddPage(page_enh, _("Enhancements"));
	wxBoxSizer* const szr_enh_main = new wxBoxSizer(wxVERTICAL);

	// - enhancements
	wxFlexGridSizer* const szr_enh = new wxFlexGridSizer(2, 5, 5);

	// Internal resolution
	{
	const wxString efbscale_choices[] = { _("Auto (Window Size)"), _("Auto (Multiple of 640x528)"),
		_("Native (640x528)"), _("1.5x Native (960x792)"), _("2x Native (1280x1056) for 720p"), _("2.5x Native (1600x1320)"),
		_("3x Native (1920x1584) for 1080p"), _("4x Native (2560x2112) for 1440p"), _("5x Native (3200x2640)"),
		_("6x Native (3840x3168) for 4K"), _("7x Native (4480x3696)"), _("8x Native (5120x4224) for 5K"), _("Custom") };

	wxChoice *const choice_efbscale = CreateChoice(page_enh,
		vconfig.iEFBScale, wxGetTranslation(internal_res_desc), (vconfig.iEFBScale > 11) ?
		ArraySize(efbscale_choices) : ArraySize(efbscale_choices) - 1, efbscale_choices);


	if (vconfig.iEFBScale > 11)
		choice_efbscale->SetSelection(12);

	szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Internal Resolution:")), 1, wxALIGN_CENTER_VERTICAL, 0);
	szr_enh->Add(choice_efbscale);
	}

	// AA
	{

	wxFlexGridSizer* const aa_sizer = new wxFlexGridSizer(3, 1, 1);

	text_aamode = new wxStaticText(page_enh, wxID_ANY, _("Anti-Aliasing:"));
	choice_aamode = CreateChoice(page_enh, vconfig.iMultisampleMode, wxGetTranslation(aa_desc));

	RefreshAAList();

	szr_enh->Add(text_aamode, 1, wxALIGN_CENTER_VERTICAL, 0);
	aa_sizer->Add(choice_aamode);

	ssaa_checkbox = CreateCheckBox(page_enh, _("SSAA"), wxGetTranslation(ssaa_desc), vconfig.bSSAA);
	ssaa_checkbox->Bind(wxEVT_CHECKBOX, &VideoConfigDiag::OnSSAAClick, this);

	aa_sizer->AddSpacer(10);
	aa_sizer->Add(ssaa_checkbox, 0, wxTOP, 3);
	szr_enh->Add(aa_sizer);

	}

	// AF
	{
	const wxString af_choices[] = {"1x", "2x", "4x", "8x", "16x"};
	szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Anisotropic Filtering:")), 1, wxALIGN_CENTER_VERTICAL, 0);
	szr_enh->Add(CreateChoice(page_enh, vconfig.iMaxAnisotropy, wxGetTranslation(af_desc), 5, af_choices));
	}

	// postproc shader
	if (vconfig.backend_info.bSupportsPostProcessing)
	{
		wxFlexGridSizer* const szr_pp = new wxFlexGridSizer(3, 5, 5);
		choice_ppshader = new wxChoice(page_enh, wxID_ANY);
		RegisterControl(choice_ppshader, wxGetTranslation(ppshader_desc));
		button_config_pp = new wxButton(page_enh, wxID_ANY, _("Config"));

		PopulatePostProcessingShaders();

		choice_ppshader->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_PPShader, this);
		button_config_pp->Bind(wxEVT_BUTTON, &VideoConfigDiag::Event_ConfigurePPShader, this);

		szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Post-Processing Effect:")), 1, wxALIGN_CENTER_VERTICAL, 0);
		szr_pp->Add(choice_ppshader);
		szr_pp->Add(button_config_pp);
		szr_enh->Add(szr_pp);
	}
	else
	{
		choice_ppshader = nullptr;
		button_config_pp = nullptr;
	}

	// Scaled copy, PL, Bilinear filter
	szr_enh->Add(CreateCheckBox(page_enh, _("Scaled EFB Copy"), wxGetTranslation(scaled_efb_copy_desc), vconfig.bCopyEFBScaled));
	szr_enh->Add(CreateCheckBox(page_enh, _("Per-Pixel Lighting"), wxGetTranslation(pixel_lighting_desc), vconfig.bEnablePixelLighting));
	szr_enh->Add(CreateCheckBox(page_enh, _("Force Texture Filtering"), wxGetTranslation(force_filtering_desc), vconfig.bForceFiltering));
	szr_enh->Add(CreateCheckBox(page_enh, _("Widescreen Hack"), wxGetTranslation(ws_hack_desc), vconfig.bWidescreenHack));
	szr_enh->Add(CreateCheckBox(page_enh, _("Disable Fog"), wxGetTranslation(disable_fog_desc), vconfig.bDisableFog));

	wxStaticBoxSizer* const group_enh = new wxStaticBoxSizer(wxVERTICAL, page_enh, _("Enhancements"));
	group_enh->Add(szr_enh, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_enh_main->Add(group_enh, 0, wxEXPAND | wxALL, 5);

	// - stereoscopy

	if (vconfig.backend_info.bSupportsGeometryShaders)
	{
		wxFlexGridSizer* const szr_stereo = new wxFlexGridSizer(2, 5, 5);

		szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Stereoscopic 3D Mode:")), 1, wxALIGN_CENTER_VERTICAL, 0);

		const wxString stereo_choices[] = { _("Off"), _("Side-by-Side"), _("Top-and-Bottom"), _("Anaglyph"), _("Nvidia 3D Vision") };
		wxChoice* stereo_choice = CreateChoice(page_enh, vconfig.iStereoMode, wxGetTranslation(stereo_3d_desc), vconfig.backend_info.bSupports3DVision ? ArraySize(stereo_choices) : ArraySize(stereo_choices) - 1, stereo_choices);
		stereo_choice->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_StereoMode, this);
		szr_stereo->Add(stereo_choice);

		wxSlider* const sep_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoDepth, 0, 100, wxDefaultPosition, wxDefaultSize);
		sep_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoDepth, this);
		RegisterControl(sep_slider, wxGetTranslation(stereo_depth_desc));

		szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Depth:")), 1, wxALIGN_CENTER_VERTICAL, 0);
		szr_stereo->Add(sep_slider, 0, wxEXPAND | wxRIGHT);

		wxSlider* const conv_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoConvergence, 0, 500, wxDefaultPosition, wxDefaultSize);
		conv_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoConvergence, this);
		RegisterControl(conv_slider, wxGetTranslation(stereo_convergence_desc));

		szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Convergence:")), 1, wxALIGN_CENTER_VERTICAL, 0);
		szr_stereo->Add(conv_slider, 0, wxEXPAND | wxRIGHT);

		szr_stereo->Add(CreateCheckBox(page_enh, _("Swap Eyes"), wxGetTranslation(stereo_swap_desc), vconfig.bStereoSwapEyes));

		wxStaticBoxSizer* const group_stereo = new wxStaticBoxSizer(wxVERTICAL, page_enh, _("Stereoscopy"));
		group_stereo->Add(szr_stereo, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
		szr_enh_main->Add(group_stereo, 0, wxEXPAND | wxALL, 5);
	}

	szr_enh_main->AddStretchSpacer();
	CreateDescriptionArea(page_enh, szr_enh_main);
	page_enh->SetSizerAndFit(szr_enh_main);
	}


	// -- SPEED HACKS --
	{
	wxPanel* const page_hacks = new wxPanel(notebook);
	notebook->AddPage(page_hacks, _("Hacks"));
	wxBoxSizer* const szr_hacks = new wxBoxSizer(wxVERTICAL);

	// - EFB hacks
	wxStaticBoxSizer* const szr_efb = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Embedded Frame Buffer (EFB)"));

	szr_efb->Add(CreateCheckBox(page_hacks, _("Skip EFB Access from CPU"), wxGetTranslation(efb_access_desc), vconfig.bEFBAccessEnable, true), 0, wxBOTTOM | wxLEFT, 5);
	szr_efb->Add(CreateCheckBox(page_hacks, _("Ignore Format Changes"), wxGetTranslation(efb_emulate_format_changes_desc), vconfig.bEFBEmulateFormatChanges, true), 0, wxBOTTOM | wxLEFT, 5);
	szr_efb->Add(CreateCheckBox(page_hacks, _("Store EFB Copies to Texture Only"), wxGetTranslation(skip_efb_copy_to_ram_desc), vconfig.bSkipEFBCopyToRam), 0, wxBOTTOM | wxLEFT, 5);

	szr_hacks->Add(szr_efb, 0, wxEXPAND | wxALL, 5);

	// Texture cache
	{
	wxStaticBoxSizer* const szr_safetex = new wxStaticBoxSizer(wxHORIZONTAL, page_hacks, _("Texture Cache"));

	// TODO: Use wxSL_MIN_MAX_LABELS or wxSL_VALUE_LABEL with wx 2.9.1
	wxSlider* const stc_slider = new wxSlider(page_hacks, wxID_ANY, 0, 0, 2, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_BOTTOM);
	stc_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_Stc, this);
	RegisterControl(stc_slider, wxGetTranslation(stc_desc));

	if (vconfig.iSafeTextureCache_ColorSamples == 0) stc_slider->SetValue(0);
	else if (vconfig.iSafeTextureCache_ColorSamples == 512) stc_slider->SetValue(1);
	else if (vconfig.iSafeTextureCache_ColorSamples == 128) stc_slider->SetValue(2);
	else stc_slider->Disable(); // Using custom number of samples; TODO: Inform the user why this is disabled..

	szr_safetex->Add(new wxStaticText(page_hacks, wxID_ANY, _("Accuracy:")), 0, wxALL, 5);
	szr_safetex->AddStretchSpacer(1);
	szr_safetex->Add(new wxStaticText(page_hacks, wxID_ANY, _("Safe")), 0, wxLEFT|wxTOP|wxBOTTOM, 5);
	szr_safetex->Add(stc_slider, 2, wxRIGHT, 0);
	szr_safetex->Add(new wxStaticText(page_hacks, wxID_ANY, _("Fast")), 0, wxRIGHT|wxTOP|wxBOTTOM, 5);
	szr_hacks->Add(szr_safetex, 0, wxEXPAND | wxALL, 5);
	}

	// - XFB
	{
	wxStaticBoxSizer* const group_xfb = new wxStaticBoxSizer(wxHORIZONTAL, page_hacks, _("External Frame Buffer (XFB)"));

	SettingCheckBox* disable_xfb = CreateCheckBox(page_hacks, _("Disable"), wxGetTranslation(xfb_desc), vconfig.bUseXFB, true);
	virtual_xfb = CreateRadioButton(page_hacks, _("Virtual"), wxGetTranslation(xfb_virtual_desc), vconfig.bUseRealXFB, true, wxRB_GROUP);
	real_xfb = CreateRadioButton(page_hacks, _("Real"), wxGetTranslation(xfb_real_desc), vconfig.bUseRealXFB);

	group_xfb->Add(disable_xfb, 0, wxLEFT | wxRIGHT | wxBOTTOM, 5);
	group_xfb->AddStretchSpacer(1);
	group_xfb->Add(virtual_xfb, 0, wxRIGHT, 5);
	group_xfb->Add(real_xfb, 0, wxRIGHT, 5);
	szr_hacks->Add(group_xfb, 0, wxEXPAND | wxALL, 5);
	} // xfb

	// - other hacks
	{
	wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5);
	szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), wxGetTranslation(fast_depth_calc_desc), vconfig.bFastDepthCalc));
	szr_other->Add(CreateCheckBox(page_hacks, _("Disable Bounding Box"), wxGetTranslation(disable_bbox_desc), vconfig.bBBoxEnable, true));

	wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other"));
	group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	szr_hacks->Add(group_other, 0, wxEXPAND | wxALL, 5);
	}

	szr_hacks->AddStretchSpacer();
	CreateDescriptionArea(page_hacks, szr_hacks);
	page_hacks->SetSizerAndFit(szr_hacks);
	}

	// -- ADVANCED --
	{
	wxPanel* const page_advanced = new wxPanel(notebook);
	notebook->AddPage(page_advanced, _("Advanced"));
	wxBoxSizer* const szr_advanced = new wxBoxSizer(wxVERTICAL);

	// - debug
	{
	wxGridSizer* const szr_debug = new wxGridSizer(2, 5, 5);

	szr_debug->Add(CreateCheckBox(page_advanced, _("Enable Wireframe"), wxGetTranslation(wireframe_desc), vconfig.bWireFrame));
	szr_debug->Add(CreateCheckBox(page_advanced, _("Show Statistics"), wxGetTranslation(show_stats_desc), vconfig.bOverlayStats));
	szr_debug->Add(CreateCheckBox(page_advanced, _("Texture Format Overlay"), wxGetTranslation(texfmt_desc), vconfig.bTexFmtOverlayEnable));

	wxStaticBoxSizer* const group_debug = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Debugging"));
	szr_advanced->Add(group_debug, 0, wxEXPAND | wxALL, 5);
	group_debug->Add(szr_debug, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	}

	// - utility
	{
	wxGridSizer* const szr_utility = new wxGridSizer(2, 5, 5);

	szr_utility->Add(CreateCheckBox(page_advanced, _("Dump Textures"), wxGetTranslation(dump_textures_desc), vconfig.bDumpTextures));
	szr_utility->Add(CreateCheckBox(page_advanced, _("Load Custom Textures"), wxGetTranslation(load_hires_textures_desc), vconfig.bHiresTextures));
	cache_hires_textures = CreateCheckBox(page_advanced, _("Prefetch Custom Textures"), wxGetTranslation(cache_hires_textures_desc), vconfig.bCacheHiresTextures);
	szr_utility->Add(cache_hires_textures);
	szr_utility->Add(CreateCheckBox(page_advanced, _("Dump EFB Target"), wxGetTranslation(dump_efb_desc), vconfig.bDumpEFBTarget));
	szr_utility->Add(CreateCheckBox(page_advanced, _("Free Look"), wxGetTranslation(free_look_desc), vconfig.bFreeLook));
#if !defined WIN32 && defined HAVE_LIBAV
	szr_utility->Add(CreateCheckBox(page_advanced, _("Frame Dumps use FFV1"), wxGetTranslation(use_ffv1_desc), vconfig.bUseFFV1));
#endif

	wxStaticBoxSizer* const group_utility = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Utility"));
	szr_advanced->Add(group_utility, 0, wxEXPAND | wxALL, 5);
	group_utility->Add(szr_utility, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	}

	// - misc
	{
	wxGridSizer* const szr_misc = new wxGridSizer(2, 5, 5);

	szr_misc->Add(CreateCheckBox(page_advanced, _("Crop"), wxGetTranslation(crop_desc), vconfig.bCrop));

	// Progressive Scan
	{
	progressive_scan_checkbox = new wxCheckBox(page_advanced, wxID_ANY, _("Enable Progressive Scan"));
	RegisterControl(progressive_scan_checkbox, wxGetTranslation(prog_scan_desc));
	progressive_scan_checkbox->Bind(wxEVT_CHECKBOX, &VideoConfigDiag::Event_ProgressiveScan, this);

	progressive_scan_checkbox->SetValue(SConfig::GetInstance().bProgressive);
	// A bit strange behavior, but this needs to stay in sync with the main progressive boolean; TODO: Is this still necessary?
	SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", SConfig::GetInstance().bProgressive);

	szr_misc->Add(progressive_scan_checkbox);
	}

#if defined WIN32
	// Borderless Fullscreen
	borderless_fullscreen = CreateCheckBox(page_advanced, _("Borderless Fullscreen"), wxGetTranslation(borderless_fullscreen_desc), vconfig.bBorderlessFullscreen);
	szr_misc->Add(borderless_fullscreen);
#endif

	wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc"));
	szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5);
	group_misc->Add(szr_misc, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
	}

	szr_advanced->AddStretchSpacer();
	CreateDescriptionArea(page_advanced, szr_advanced);
	page_advanced->SetSizerAndFit(szr_advanced);
	}

	wxButton* const btn_close = new wxButton(this, wxID_OK, _("Close"));
	btn_close->Bind(wxEVT_BUTTON, &VideoConfigDiag::Event_ClickClose, this);

	Bind(wxEVT_CLOSE_WINDOW, &VideoConfigDiag::Event_Close, this);

	wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL);
	szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5);
	szr_main->Add(btn_close, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 5);

	SetSizerAndFit(szr_main);
	Center();
	SetFocus();

	UpdateWindowUI();
}