示例#1
0
ApplicationFolder::ApplicationFolder(wxWizard* parent, wxWizardPageSimple* prev, wxWizardPageSimple* next)
{
  //(*Initialize(ApplicationFolder)
  wxBoxSizer* BoxSizer4;
  wxBoxSizer* BoxSizer6;
  wxBoxSizer* BoxSizer19;
  wxBoxSizer* BoxSizer5;
  wxBoxSizer* BoxSizer10;
  wxBoxSizer* BoxSizer7;
  wxBoxSizer* BoxSizer8;
  wxStaticText* StaticText2;
  wxBoxSizer* BoxSizer13;
  wxStaticBitmap* StaticBitmap1;
  wxStaticText* StaticText8;
  wxStaticText* StaticText1;
  wxBoxSizer* BoxSizer2;
  wxBoxSizer* BoxSizer11;
  wxBoxSizer* BoxSizer12;
  wxBoxSizer* BoxSizer14;
  wxStaticText* StaticText5;
  wxStaticText* StaticText7;
  wxBoxSizer* BoxSizer1;
  wxBoxSizer* BoxSizer9;
  wxBoxSizer* BoxSizer3;

  Create(parent, prev, next);
  BoxSizer1 = new wxBoxSizer(wxVERTICAL);
  Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
  Panel1->SetBackgroundColour( wxColour( 255, 255, 255));
  BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer5 = new wxBoxSizer(wxVERTICAL);
  BoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer6->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText2 = new wxStaticText(Panel1, ID_STATICTEXT2, _("Application Folder"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
  wxFont StaticText2Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
  StaticText2->SetFont(StaticText2Font);
  BoxSizer6->Add(StaticText2, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer5->Add(BoxSizer6, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer7->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText1 = new wxStaticText(Panel1, ID_STATICTEXT1, _("    Please specify folder information about your application."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
  BoxSizer7->Add(StaticText1, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer5->Add(BoxSizer7, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer4->Add(BoxSizer5, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer4->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticBitmap1 = new wxStaticBitmap(Panel1, wxID_ANY, wxBitmap(LinksOben_xpm), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
  BoxSizer4->Add(StaticBitmap1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  Panel1->SetSizer(BoxSizer4);
  BoxSizer4->Fit(Panel1);
  BoxSizer4->SetSizeHints(Panel1);
  BoxSizer1->Add(Panel1, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
  BoxSizer1->Add(StaticLine1, 0, wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2 = new wxBoxSizer(wxVERTICAL);
  BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer3->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  text1 = new wxStaticText(this, ID_STATICTEXT3, _("Application destination base folder:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
  wxFont text1Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
  text1->SetFont(text1Font);
  BoxSizer3->Add(text1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer3->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer3, 0, wxBOTTOM|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer8->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  chProgrammFolder = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxSize(214,21), 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
  chProgrammFolder->SetSelection( chProgrammFolder->Append(_("program Files folder")) );
  chProgrammFolder->Append(_("(custom)"));
  BoxSizer8->Add(chProgrammFolder, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer8->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer8, 0, wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer9->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  txtCustom = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize(217,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
  txtCustom->Disable();
  BoxSizer9->Add(txtCustom, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer9->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer9, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer10->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  text2 = new wxStaticText(this, ID_STATICTEXT4, _("Application folder name:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
  wxFont text2Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
  text2->SetFont(text2Font);
  BoxSizer10->Add(text2, 1, wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer10->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer10, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer11->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  txtAppFolderName = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(221,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
  BoxSizer11->Add(txtAppFolderName, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer11->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer11, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer12->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  cbAppFolderName = new wxCheckBox(this, ID_CHECKBOX1, _("Allow user to change the application folder"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
  cbAppFolderName->SetValue(true);
  BoxSizer12->Add(cbAppFolderName, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer12->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer12, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer13->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Otehr:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5"));
  BoxSizer13->Add(StaticText5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer13->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer13, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer14 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer14->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  cbDoesntFolder = new wxCheckBox(this, ID_CHECKBOX2, _("The application doesn\'t need a folder"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
  cbDoesntFolder->SetValue(false);
  BoxSizer14->Add(cbDoesntFolder, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer14->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer2->Add(BoxSizer14, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer2, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer19 = new wxBoxSizer(wxHORIZONTAL);
  BoxSizer19->Add(75,20,0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText7 = new wxStaticText(this, ID_STATICTEXT7, _("bold"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7"));
  StaticText7->Disable();
  wxFont StaticText7Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
  StaticText7->SetFont(StaticText7Font);
  BoxSizer19->Add(StaticText7, 0, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  StaticText8 = new wxStaticText(this, ID_STATICTEXT8, _("= required"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8"));
  StaticText8->Disable();
  BoxSizer19->Add(StaticText8, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  BoxSizer1->Add(BoxSizer19, 0, wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
  SetSizer(BoxSizer1);
  SetSizer(BoxSizer1);
  Layout();

  Connect(ID_CHOICE1,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&ApplicationFolder::OnchProgrammFolderSelect);
  Connect(ID_CHECKBOX2,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&ApplicationFolder::OncbDoesntFolderClick);
  //*)
  SetSize( wxSize(480,320));
}
示例#2
0
void WMain_wxg::do_layout()
{
    // begin wxGlade: WMain_wxg::do_layout
    wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
    wxStaticBoxSizer* sizer_10 = new wxStaticBoxSizer(sizer_10_staticbox, wxVERTICAL);
    wxBoxSizer* sizer_2 = new wxBoxSizer(wxVERTICAL);
    wxStaticBoxSizer* sizer_9 = new wxStaticBoxSizer(sizer_9_staticbox, wxVERTICAL);
    wxFlexGridSizer* grid_sizer_3 = new wxFlexGridSizer(1, 7, 0, 0);
    wxBoxSizer* sizer_7 = new wxBoxSizer(wxHORIZONTAL);
    wxStaticBoxSizer* sizer_8 = new wxStaticBoxSizer(sizer_8_staticbox, wxVERTICAL);
    wxFlexGridSizer* grid_sizer_2 = new wxFlexGridSizer(3, 2, 0, 0);
    wxStaticBoxSizer* sizer_3 = new wxStaticBoxSizer(sizer_3_staticbox, wxVERTICAL);
    wxFlexGridSizer* grid_sizer_1 = new wxFlexGridSizer(3, 2, 0, 0);
    wxStaticText* label_1 = new wxStaticText(panel_Main, wxID_ANY, wxT("Data Type"));
    grid_sizer_1->Add(label_1, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_1->Add(choice_DataType, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxSHAPED, 4);
    wxStaticText* label_3 = new wxStaticText(panel_Main, wxID_ANY, wxT("Node Slots"));
    grid_sizer_1->Add(label_3, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_1->Add(choice_NodeSlots, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxSHAPED, 4);
    grid_sizer_1->Add(2, 2, 0, wxADJUST_MINSIZE, 0);
    grid_sizer_1->Add(checkbox_Duplicates, 0, wxALL, 4);
    grid_sizer_1->AddGrowableCol(0);
    grid_sizer_1->AddGrowableCol(1);
    sizer_3->Add(grid_sizer_1, 1, wxEXPAND, 0);
    sizer_7->Add(sizer_3, 1, wxALL|wxEXPAND, 6);
    sizer_8->Add(1, 1, 1, wxADJUST_MINSIZE, 0);
    wxStaticText* label_5 = new wxStaticText(panel_Main, wxID_ANY, wxT("Key"));
    grid_sizer_2->Add(label_5, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_2->Add(textctrl_Key, 0, wxALL|wxEXPAND, 4);
    wxStaticText* label_6 = new wxStaticText(panel_Main, wxID_ANY, wxT("Data"));
    grid_sizer_2->Add(label_6, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_2->Add(textctrl_Data, 1, wxALL|wxEXPAND, 4);
    grid_sizer_2->AddGrowableCol(1);
    sizer_8->Add(grid_sizer_2, 0, wxEXPAND, 0);
    sizer_8->Add(1, 1, 1, wxADJUST_MINSIZE, 0);
    sizer_7->Add(sizer_8, 1, wxRIGHT|wxTOP|wxBOTTOM|wxEXPAND, 6);
    sizer_2->Add(sizer_7, 0, wxEXPAND, 0);
    grid_sizer_3->Add(button_Insert, 0, wxLEFT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_3->Add(button_Erase, 0, wxLEFT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_3->Add(button_InsertRandom, 0, wxLEFT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_3->Add(button_FindKey, 0, wxLEFT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_3->Add(button_EqualRange, 0, wxLEFT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_3->Add(button_Clear, 0, wxLEFT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4);
    grid_sizer_3->Add(button_LoadFile, 0, wxALL, 4);
    grid_sizer_3->AddGrowableCol(0);
    grid_sizer_3->AddGrowableCol(1);
    grid_sizer_3->AddGrowableCol(2);
    grid_sizer_3->AddGrowableCol(3);
    grid_sizer_3->AddGrowableCol(4);
    grid_sizer_3->AddGrowableCol(5);
    sizer_9->Add(grid_sizer_3, 0, wxEXPAND, 0);
    sizer_9->Add(textctrl_OpResult, 0, wxALL|wxEXPAND, 4);
    sizer_2->Add(sizer_9, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 6);
    sizer_1->Add(sizer_2, 0, wxEXPAND, 0);
    sizer_10->Add(window_TreeDrawing, 1, wxALL|wxEXPAND, 2);
    sizer_1->Add(sizer_10, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 6);
    panel_Main->SetSizer(sizer_1);
    sizer_4->Add(panel_Main, 1, wxEXPAND, 0);
    SetSizer(sizer_4);
    sizer_4->Fit(this);
    Layout();
    Centre();
    // end wxGlade
}
示例#3
0
bool wxRibbonGallery::Realize()
{
    CalculateMinSize();
    return Layout();
}
示例#4
0
LobbyOptionsTab::LobbyOptionsTab(wxWindow* parent)
    : wxScrolledWindow( parent, -1 ),
    m_show_tooltips_label( 0 )
{
    GetAui().manager->AddPane( this, wxLEFT, _T("lobbyoptionstab") );

    m_main_sizer = new wxBoxSizer ( wxVERTICAL );

/* ================================
   * Web browser
   */

    wxStaticBox* m_web_box = new wxStaticBox( this , -1, _("Web Browser") );
    m_web_loc_text = new wxStaticText( this, -1, _("Web Browser") );

    m_web_def_radio = new wxRadioButton( this, SPRING_DEFWEB, _("Default Browser."),
                 wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
    m_web_def_radio->SetToolTip(TE(_("Use your system-wide browser preference")));

    m_web_spec_radio = new wxRadioButton( this, SPRING_DEFWEB, _("Specify:") );
    m_web_spec_radio->SetToolTip(TE(_("Specify the web browser you want to use")));

    m_web_edit = new wxTextCtrl( this, -1, sett().GetWebBrowserPath() );

    m_web_browse_btn = new wxButton( this, SPRING_WEBBROWSE, _("Browse") );
    m_web_browse_btn->SetToolTip(TE(_("Use a file dialog to find the web browser")));

    if ( sett().GetWebBrowserUseDefault() ) m_web_def_radio->SetValue( true );
    else m_web_spec_radio->SetValue( true );

    m_web_loc_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_web_loc_sizer->Add( m_web_loc_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2 );
    m_web_loc_sizer->Add( m_web_edit, 1, wxEXPAND );
    m_web_loc_sizer->Add( m_web_browse_btn );

    m_web_box_sizer = new wxStaticBoxSizer( m_web_box, wxVERTICAL );

    m_web_box_sizer->Add( m_web_def_radio, 0, wxALL, 2 );
    m_web_box_sizer->Add( m_web_spec_radio, 0, wxALL, 2 );
    m_web_box_sizer->Add( m_web_loc_sizer, 0, wxEXPAND | wxALL, 2 );
/////
    wxStaticBox* m_editor_box = new wxStaticBox( this , -1, _("External text editor") );
    m_editor_loc_text = new wxStaticText( this, -1, _("Path") );

    m_editor_edit = new wxTextCtrl( this, -1, sett().GetEditorPath() );

    m_editor_browse_btn = new wxButton( this, ID_BUT_EDITOR, _("Browse") );
    m_editor_browse_btn->SetToolTip(TE(_("Use a file dialog to find the editor binary")));

    m_editor_loc_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_editor_loc_sizer->Add( m_editor_loc_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2 );
    m_editor_loc_sizer->Add( m_editor_edit, 1, wxEXPAND );
    m_editor_loc_sizer->Add( m_editor_browse_btn );

    m_editor_box_sizer = new wxStaticBoxSizer( m_editor_box, wxVERTICAL );

    m_editor_box_sizer->Add( m_editor_loc_sizer, 0, wxEXPAND | wxALL, 2 );
////////
    wxStaticBoxSizer* m_autojoin_sizer= new wxStaticBoxSizer ( wxVERTICAL, this, _("Autoconnect") );
    m_autoconnect_label = new wxStaticText ( this, -1, _("If checked, SpringLobby will automatically log on to the last used server") );
    m_autojoin = new wxCheckBox( this, -1, _("Autoconnect on lobby start"), wxDefaultPosition, wxDefaultSize, 0 );
    m_autojoin->SetValue( sett().GetAutoConnect() );
    m_autojoin_sizer->Add( m_autoconnect_label, 1, wxEXPAND | wxALL, 5 );
    m_autojoin_sizer->Add( m_autojoin, 0, wxEXPAND | wxALL, 5 );

    wxStaticBoxSizer* m_reportstats_sizer = new wxStaticBoxSizer ( wxVERTICAL, this, _("Report statistics") );
    m_reportstats_label = new wxStaticText ( this, -1, _("By default SpringLobby will send some statistics (OS,SpringLobby version) to server,\nto both make helping you in case of problems easier and inform of critical updates.\nUncheck to disable.") );
    m_reportstats = new wxCheckBox( this, -1, _("report statistics"), wxDefaultPosition, wxDefaultSize, 0 );
    m_reportstats->SetValue( sett().GetReportStats() );
    m_reportstats_sizer->Add( m_reportstats_label, 1, wxEXPAND|wxALL, 5);
    m_reportstats_sizer->Add( m_reportstats, 0, wxEXPAND|wxALL, 5);

    m_main_sizer->Add( m_web_box_sizer, 0, wxEXPAND | wxALL, 5 );
    m_main_sizer->Add( m_editor_box_sizer, 0, wxEXPAND | wxALL, 5 );
    m_main_sizer->Add( m_autojoin_sizer, 0, wxALL, 5 );
    m_main_sizer->Add( m_reportstats_sizer, 0, wxALL, 5 );

#ifdef __WXMSW__
    wxStaticBoxSizer* m_updater_sizer = new wxStaticBoxSizer ( wxVERTICAL, this, _("Automatic updates") );
    m_updater_label = new wxStaticText ( this, -1, _("SpringLobby can check at startup if a newer version is available and automatically download it for you.") );
    m_updater = new wxCheckBox( this, -1, _("automatically check for updates"), wxDefaultPosition, wxDefaultSize, 0 );
    m_updater->SetValue( sett().GetAutoUpdate() );
    m_updater_sizer->Add( m_updater_label, 1, wxEXPAND|wxALL, 5);
    m_updater_sizer->Add( m_updater, 0, wxEXPAND|wxALL, 5);

    m_main_sizer->Add( m_updater_sizer, 0, wxALL, 5 );
#endif

    wxStaticBoxSizer* m_show_tooltips_sizer = new wxStaticBoxSizer ( wxVERTICAL, this, _("Tooltips") );
    m_show_tooltips = new wxCheckBox( this, -1, _("Show Tooltips?"), wxDefaultPosition, wxDefaultSize, 0 );
    m_show_tooltips->SetValue( sett().GetShowTooltips() );
#ifndef __WXMSW__ // on windows this change is immediate
    m_show_tooltips_label = new wxStaticText ( this, -1, _("Requires SpringLobby restart to take effect.") );
    m_show_tooltips_sizer->Add( m_show_tooltips_label, 1, wxEXPAND|wxALL, 5);
#endif
    m_show_tooltips_sizer->Add( m_show_tooltips, 0, wxEXPAND|wxALL, 5);

    m_main_sizer->Add( m_show_tooltips_sizer, 0, wxALL, 5 );

    wxStaticBoxSizer* m_complete_method_sizer = new wxStaticBoxSizer ( wxVERTICAL, this, _("Tab completion method") );
    m_complete_method_label = new wxStaticText ( this, -1, _("\"Match exact\" will complete a word if there is one and only one match.\n"
        "\"Match nearest\" will select the (first) match that has closest Levenshtein distance") );
    m_complete_method_old = new wxRadioButton( this, -1, _("Match exact"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
    m_complete_method_new = new wxRadioButton( this, -1, _("Match nearest"), wxDefaultPosition, wxDefaultSize );
    m_complete_method_old->SetValue( sett().GetCompletionMethod() == Settings::MatchExact );
    m_complete_method_new->SetValue( sett().GetCompletionMethod() == Settings::MatchNearest );
    m_complete_method_sizer->Add( m_complete_method_label, 1, wxEXPAND|wxALL, 5);
    m_complete_method_sizer->Add( m_complete_method_old, 0, wxEXPAND|wxALL, 5);
    m_complete_method_sizer->Add( m_complete_method_new, 0, wxEXPAND|wxALL, 5);

    m_main_sizer->Add( m_complete_method_sizer, 0, wxALL, 5 );

    wxStaticBoxSizer* m_misc_gui_sizer = new wxStaticBoxSizer ( wxVERTICAL, this, _("Misc GUI") );
    m_use_tabicons = new wxCheckBox( this, -1, _("Show big icons in mainwindow tabs?"), wxDefaultPosition, wxDefaultSize, 0 );
    m_use_tabicons->SetValue( sett().GetUseTabIcons() );
    m_misc_gui_sizer->Add( m_use_tabicons , 0, wxEXPAND | wxALL, 5 );
	m_use_notif_popups = new wxCheckBox( this, -1, _("Use notification popups?"), wxDefaultPosition, wxDefaultSize, 0 );
	m_misc_gui_sizer->Add( m_use_notif_popups, 0, wxEXPAND | wxALL, 5 );
	m_notif_popup_pos_sizer = new wxBoxSizer( wxHORIZONTAL );
	m_notif_popup_pos_label = new wxStaticText( this, -1, _("Screen position for notification popups") );
	m_notif_popup_pos = new wxChoice( this, -1,  wxDefaultPosition, wxDefaultSize, ScreenPosition() );
	m_notif_popup_pos_sizer->Add( m_notif_popup_pos_label, 0, wxALL| wxALIGN_CENTER_VERTICAL, 5 );
	m_notif_popup_pos_sizer->Add( m_notif_popup_pos, 0, wxALL| wxALIGN_CENTER_VERTICAL, 5 );
	m_misc_gui_sizer->Add( m_notif_popup_pos_sizer, 0, wxEXPAND | wxALL, 0 );
	m_notif_popup_time_sizer  = new wxBoxSizer( wxHORIZONTAL );
	m_notif_popup_time = new wxSpinCtrl( this, wxID_ANY );
	m_notif_popup_time_label = new wxStaticText( this, -1, _("Display time for popup notifications in seconds") );
	m_notif_popup_time_sizer->Add( m_notif_popup_time_label, 0, wxALL| wxALIGN_CENTER_VERTICAL, 5 );
	m_notif_popup_time_sizer->Add( m_notif_popup_time, 0, wxALL| wxALIGN_CENTER_VERTICAL, 5 );
	m_misc_gui_sizer->Add( m_notif_popup_time_sizer, 0, wxEXPAND | wxALL, 0 );


    m_x_on_all_tabs = new wxCheckBox( this, -1, _("Show close button on all tabs? (needs restart to take effect)"), wxDefaultPosition, wxDefaultSize, 0 );
    m_x_on_all_tabs->SetValue( sett().GetShowXallTabs() );
    m_misc_gui_sizer->Add( m_x_on_all_tabs , 1, wxEXPAND | wxALL, 5 );
    m_main_sizer->Add( m_misc_gui_sizer , 0, wxALL, 5 );

    wxStaticBoxSizer* m_start_tab_sizer = new wxStaticBoxSizer ( wxHORIZONTAL, this, _("Start tab") );
    m_start_tab = new wxChoice( this, -1,  wxDefaultPosition, wxDefaultSize, MainWindow::GetTabNames() );
    m_start_tab->SetSelection( sett().GetStartTab() );
    wxStaticText* m_start_tab_label = new wxStaticText ( this, -1, _("Select which tab to show at startup") );
    m_start_tab_sizer->Add( m_start_tab_label  , 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 5 );
    m_start_tab_sizer->Add( m_start_tab , 0,  wxALIGN_CENTER_VERTICAL , 5 );
    m_main_sizer->Add( m_start_tab_sizer, 0, wxALL, 5 );

	//dummy event that updates controls to correct state
	wxCommandEvent evt;
	OnRestore( evt );

    SetScrollRate( SCROLL_RATE, SCROLL_RATE );
    SetSizer( m_main_sizer );
    Layout();
}
示例#5
0
LoginForm::LoginForm(wxWindow* parent) 
	: gcFrame(parent, wxID_ANY, Managers::GetString(L"#LF_TITLE"), wxDefaultPosition, wxSize(420,246), wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxWANTS_CHARS|wxMINIMIZE_BOX, true)
{
	m_comboProvider = nullptr;

	m_bAutoLogin = false;
	m_pNewAccount = nullptr;

	Bind(wxEVT_COMMAND_TEXT_ENTER, &LoginForm::onTextBoxEnter, this);
	Bind(wxEVT_CLOSE_WINDOW, &LoginForm::onClose, this);
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onButtonClick, this);
	Bind(wxEVT_MOVE, &LoginForm::onMove, this);


	m_imgLogo = new gcImageControl(this, wxID_ANY, wxDefaultPosition, wxSize( 253,81 ));
	m_imgAvatar = new gcImageControl(this, wxID_ANY, wxDefaultPosition, wxSize( 66,66 ));

	m_imgLogo->setImage("#login_logo");
	m_imgAvatar->setImage("#login_default_avatar");

	m_tbUsername = new gcTextCtrl(this, wxID_ANY, Managers::GetString(L"#LF_USER"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxWANTS_CHARS);
	m_tbPassword = new gcTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxWANTS_CHARS|wxTE_PASSWORD);
	m_tbPasswordDisp = new gcTextCtrl(this, wxID_ANY, Managers::GetString(L"#LF_PASS"));

	gcString strStagingUrl(gc_login_stage_url.getString());
	gcString strStagingLast(gc_login_stage_last.getString());

	if (strStagingUrl.size() > 0)
	{
		wxArrayString choices;
		choices.Add("Prod");
		choices.Add("Test");

		m_comboProvider = new gcChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices);

		if (strStagingLast == "Test")
			m_comboProvider->SetSelection(1);
		else
			m_comboProvider->SetSelection(0);
	}

	m_cbRemPass = new gcCheckBox(this, wxID_ANY, Managers::GetString(L"#LF_AUTO"));
	m_cbRemPass->SetToolTip(Managers::GetString(L"#LF_AUTO_TOOLTIP"));

	m_butSignin = new gcButton(this, wxID_ANY, Managers::GetString(L"#LOGIN"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
	m_butCancel = new gcButton(this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);

	m_linkOffline = new LoginLink(this, Managers::GetString(L"#LF_OFFLINE"), wxALIGN_LEFT);
	m_linkNewAccount = new LoginLink(this, Managers::GetString(L"#LF_NEWACCOUNT"), wxALIGN_CENTER);
	m_linkLostPassword = new LoginLink( this, Managers::GetString(L"#LF_LOSTPASS"), wxALIGN_RIGHT);


	m_butTwitter = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
	m_butSteam = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
	m_butFacebook = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
	m_butGoogle = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));

	m_butTwitter->setDefaultImage("#login_twitter");
	m_butSteam->setDefaultImage("#login_steam");
	m_butFacebook->setDefaultImage("#login_facebook");
	m_butGoogle->setDefaultImage("#login_google");

	m_butTwitter->SetCursor(wxCursor(wxCURSOR_HAND));
	m_butSteam->SetCursor(wxCursor(wxCURSOR_HAND));
	m_butFacebook->SetCursor(wxCursor(wxCURSOR_HAND));
	m_butGoogle->SetCursor(wxCursor(wxCURSOR_HAND));

	m_butTwitter->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
	m_butSteam->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
	m_butFacebook->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
	m_butGoogle->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);


	//focus gets set to the first child. Redirect input to username box
	m_imgLogo->Bind(wxEVT_CHAR, &LoginForm::onFormChar, this);
	m_imgAvatar->Bind(wxEVT_CHAR, &LoginForm::onFormChar, this);

#ifdef WIN32
	Bind(wxEVT_LEFT_UP, &LoginForm::onMouseUp, this);
	Bind(wxEVT_LEFT_DOWN, &LoginForm::onMouseDown, this);
	Bind(wxEVT_MOTION, &LoginForm::onMouseMove, this);

	m_imgLogo->Bind(wxEVT_LEFT_UP, &LoginForm::onMouseUp, this);
	m_imgLogo->Bind(wxEVT_LEFT_DOWN, &LoginForm::onMouseDown, this);
	m_imgLogo->Bind(wxEVT_MOTION, &LoginForm::onMouseMove, this);

	m_imgAvatar->Bind(wxEVT_LEFT_UP, &LoginForm::onMouseUp, this);
	m_imgAvatar->Bind(wxEVT_LEFT_DOWN, &LoginForm::onMouseDown, this);
	m_imgAvatar->Bind(wxEVT_MOTION, &LoginForm::onMouseMove, this);
#endif

	m_tbUsername->Bind(wxEVT_COMMAND_TEXT_UPDATED, &LoginForm::onTextChange, this);
	m_tbUsername->Bind(wxEVT_CHAR, &LoginForm::onChar, this);
	m_tbUsername->Bind(wxEVT_KILL_FOCUS, &LoginForm::onBlur, this);
	m_tbUsername->Bind(wxEVT_SET_FOCUS, &LoginForm::onFocus, this);

	m_tbPassword->Bind(wxEVT_CHAR, &LoginForm::onChar, this);
	m_tbPassword->Bind(wxEVT_KILL_FOCUS, &LoginForm::onBlur, this);

	m_tbPasswordDisp->Bind(wxEVT_COMMAND_TEXT_UPDATED, &LoginForm::onTextChange, this);
	m_tbPasswordDisp->Bind(wxEVT_SET_FOCUS, &LoginForm::onFocus, this);

	m_cbRemPass->Bind(wxEVT_CHAR, &LoginForm::onChar, this);

	m_linkOffline->Bind(wxEVT_CHAR, &LoginForm::onChar, this);
	m_linkNewAccount->Bind(wxEVT_CHAR, &LoginForm::onChar, this);
	m_linkLostPassword->Bind(wxEVT_CHAR, &LoginForm::onChar, this);

	m_linkOffline->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onLinkClick, this);
	m_linkNewAccount->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onLinkClick, this);
	m_linkLostPassword->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onLinkClick, this);


	m_butCancel->Bind(wxEVT_CHAR, &LoginForm::onChar, this);
	m_butSignin->Bind(wxEVT_CHAR, &LoginForm::onChar, this);

	m_tbUsername->SetValue(Managers::GetString(L"#LF_USER"));
	m_tbPasswordDisp->SetValue(Managers::GetString(L"#LF_PASS"));

	m_tbPassword->Show(false);
	m_tbPasswordDisp->Show(true);


	wxFlexGridSizer* fgSizer4 = new wxFlexGridSizer( 1, 3, 0, 0 );
	fgSizer4->AddGrowableCol( 0 );
	fgSizer4->SetFlexibleDirection( wxBOTH );
	fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	fgSizer4->Add( m_cbRemPass, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

	fgSizer4->Add( m_butSignin, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	fgSizer4->Add( m_butCancel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );

	
	wxFlexGridSizer* fgSizer5 = new wxFlexGridSizer( 1, 3, 0, 0 );
	fgSizer5->AddGrowableCol( 0 );
	fgSizer5->AddGrowableCol( 1 );
	fgSizer5->AddGrowableCol( 2 );
	fgSizer5->AddGrowableRow( 0 );
	fgSizer5->SetFlexibleDirection( wxBOTH );
	fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	fgSizer5->Add( m_linkOffline, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
	fgSizer5->Add( m_linkNewAccount, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
	fgSizer5->Add( m_linkLostPassword, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
	

	wxFlexGridSizer* fgSizer6 = new wxFlexGridSizer( 4, 1, 0, 0 );
	fgSizer6->AddGrowableCol( 0 );
	fgSizer6->SetFlexibleDirection( wxBOTH );
	fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	if (m_comboProvider)
	{
		wxFlexGridSizer* fgSizer10 = new wxFlexGridSizer(1, 2, 0, 0);
		fgSizer10->AddGrowableCol(0);
		fgSizer10->Add(m_tbUsername, 0, wxEXPAND, 5);
		fgSizer10->Add(m_comboProvider, 0, wxLEFT, 5);

		fgSizer6->Add(fgSizer10, 0, wxEXPAND | wxLEFT, 5);
	}
	else
	{
		fgSizer6->Add(m_tbUsername, 0, wxEXPAND | wxLEFT, 5);
	}

	fgSizer6->Add( m_tbPassword, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
	fgSizer6->Add( m_tbPasswordDisp, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
	fgSizer6->Add( fgSizer4, 1, wxEXPAND, 5 );

	wxFlexGridSizer* fgSizer3 = new wxFlexGridSizer( 1, 2, 0, 0 );
	fgSizer3->AddGrowableCol( 1 );
	fgSizer3->SetFlexibleDirection( wxBOTH );
	fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	fgSizer3->Add( m_imgAvatar, 0, 0, 5 );
	fgSizer3->Add( fgSizer6, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );

	wxFlexGridSizer* fgSizerAltLogin = new wxFlexGridSizer(1, 9, 0, 0);
	fgSizerAltLogin->AddGrowableCol(2);
	fgSizerAltLogin->AddGrowableCol(4);
	fgSizerAltLogin->AddGrowableCol(6);
	fgSizerAltLogin->AddGrowableRow(0);
	fgSizerAltLogin->Add(15, 0, 1, wxEXPAND, 5);
	fgSizerAltLogin->Add(m_butTwitter, 0, 0, 5);
	fgSizerAltLogin->Add(0, 0, 1, wxEXPAND, 5);
	fgSizerAltLogin->Add(m_butSteam, 0, 0, 5);
	fgSizerAltLogin->Add(0, 0, 1, wxEXPAND, 5);
	fgSizerAltLogin->Add(m_butFacebook, 0, 0, 5);
	fgSizerAltLogin->Add(0, 0, 1, wxEXPAND, 5);
	fgSizerAltLogin->Add(m_butGoogle, 0, 0, 5);
	fgSizerAltLogin->Add(15, 0, 1, wxEXPAND, 5);

	wxFlexGridSizer* fgSizer2 = new wxFlexGridSizer( 6, 1, 0, 0 );
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	fgSizer2->Add( m_imgLogo, 1, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5 );
	fgSizer2->Add( fgSizer3, 1, wxEXPAND, 5 );
	fgSizer2->Add(0, 9, 1, wxEXPAND, 5);
	fgSizer2->Add(fgSizer5, 1, wxEXPAND, 5);
	fgSizer2->Add(0, 9, 1, wxEXPAND, 5);
	fgSizer2->Add(fgSizerAltLogin, 1, wxEXPAND, 5);



	wxFlexGridSizer* fgSizer1 = new wxFlexGridSizer( 1, 3, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableCol( 2 );
	fgSizer1->AddGrowableRow( 0 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	fgSizer1->Add( fgSizer2, 1, wxEXPAND, 5 );
	fgSizer1->Add( 0, 15, 1, wxEXPAND|wxBOTTOM, 15 );

	this->SetSizer( fgSizer1 );
	this->Layout();


	m_bSavePos = false;

	m_vTabOrder.push_back(m_tbUsername);
	m_vTabOrder.push_back(m_tbPasswordDisp);
	m_vTabOrder.push_back(m_tbPassword);
	m_vTabOrder.push_back(m_cbRemPass);
	m_vTabOrder.push_back(m_butSignin);
	m_vTabOrder.push_back(m_butCancel);
	m_vTabOrder.push_back(m_linkOffline);
	m_vTabOrder.push_back(m_linkNewAccount);
	m_vTabOrder.push_back(m_linkLostPassword);

	Centre(wxCENTRE_ON_SCREEN);
	SetFocus();

	if (gc_login_x.getInt() == -1 || gc_login_y.getInt() == -1)
	{
		int x = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
		int y = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);

		int w=0;
		int h=0;
		GetSize(&w, &h);

		int newX = (x-w)/2;
		int newY = (y-h)/2;

		if (newX>0 && newY>0)
			SetSize(newX, newY, -1, -1);
	}
	else
	{
#ifdef NIX
		if (! gc_allow_wm_positioning.getBool())
#endif
			setSavedWindowPos(gc_login_x.getInt(), gc_login_y.getInt(), UINT_MAX, UINT_MAX);
	}

	if (gc_savelogin.getBool())
		m_cbRemPass->SetValue(true);

	if (gc_saveusername.getBool())
	{
		const char* str = gc_lastusername.getString();
		const char* avatar = gc_lastavatar.getString();

		if (gcString(str) != "")
		{
			m_tbUsername->SetValue(str);

			m_tbPasswordDisp->Show(false);
			m_tbPassword->Show();
			m_tbPassword->SetFocus();
			Layout();
		}

		if (avatar && UTIL::FS::isValidFile(UTIL::FS::PathWithFile(avatar)))
			m_imgAvatar->setImage(avatar);
	}

	m_pLogThread = nullptr;
	m_bSavePos = true;
	m_bMouseDrag = false;

	onLoginEvent += guiDelegate(this, &LoginForm::onLogin);
	onLoginErrorEvent += guiDelegate(this, &LoginForm::onLoginError);
	onStartLoginEvent += guiDelegate(this, &LoginForm::onStartLogin);

	Managers::LoadTheme(this, "formlogin");

	Managers::LoadTheme(m_cbRemPass, "formlogin");

#ifdef WIN32
	SetSize(wxSize(420,316));
#endif

	setFrameRegion();
}
示例#6
0
SingleOptionDialog::SingleOptionDialog( IBattle& battle, const wxString& optiontag )
    : m_battle( battle ),
    m_tag( optiontag ),
    m_checkbox( 0 ),
    m_combobox( 0 ),
    m_spinctrl( 0 ),
    m_textctrl( 0 )
{
	OptionsWrapper& optWrap = m_battle.CustomBattleOptions();
	OptionsWrapper::GameOption optFlag = ( OptionsWrapper::GameOption )s2l( optiontag.BeforeFirst( '_' ) );
	wxString key = optiontag.AfterFirst( '_' );
	OptionType type = optWrap.GetSingleOptionType( key );
	Create( (wxWindow*)&ui().mw(), wxID_ANY, _( "Change option" ), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T( "OptionDialog" ) );
	if ( !optWrap.keyExists( key, optFlag, false, type ) )
	{
		EndModal( wxID_CANCEL );
		return;
	}

	wxBoxSizer* m_main_sizer = new wxBoxSizer( wxVERTICAL );

	// wxStaticText* m_labelctrl = wxStaticText();

	switch ( type )
	{
		case opt_bool:
			{
				mmOptionBool opt = optWrap.m_opts[optFlag].bool_map[key];
				m_checkbox = new wxCheckBox( this, wxID_ANY, opt.name );
				m_checkbox->SetToolTip( TE( opt.description ) );
				m_checkbox->SetValue( opt.value );
				m_main_sizer->Add( m_checkbox, 0, wxEXPAND );
				break;
			}
		case opt_float:
			{
				mmOptionFloat opt = optWrap.m_opts[optFlag].float_map[key];
				m_spinctrl = new SlSpinCtrlDouble<SingleOptionDialog>();
				m_spinctrl->Create( this, wxID_ANY, _T( "" ), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, double( opt.min ), double( opt.max ), double( opt.value ), double( opt.stepping ), opt.key );
				m_spinctrl->SetToolTip( TE( opt.description ) );
				m_main_sizer->Add( m_spinctrl, 0, wxEXPAND );
				break;
			}
		case opt_string:
			{
				mmOptionString opt = optWrap.m_opts[optFlag].string_map[key];
				m_textctrl = new wxTextCtrl( this, wxID_ANY, opt.value, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, opt.key );
				m_textctrl->SetToolTip( TE( opt.description ) );
				m_main_sizer->Add( m_textctrl, 0, wxEXPAND );
				break;
			}
		case opt_list:
			{
				mmOptionList opt = optWrap.m_opts[optFlag].list_map[key];
				int temp = int( opt.cbx_choices.GetCount() - 1 );
				int index = clamp( opt.cur_choice_index, 0, temp );
				m_combobox = new wxComboBox( this, wxID_ANY, opt.cbx_choices[index], wxDefaultPosition, wxDefaultSize, opt.cbx_choices, wxCB_READONLY, wxDefaultValidator );
				wxString tooltip = opt.description + _T( "\n" );
				for ( ListItemVec::iterator itor = opt.listitems.begin(); itor != opt.listitems.end(); itor++ )
				{
					tooltip += _T( "\n" ) + itor->name + _T( ": " ) + itor->desc;
				}
				m_combobox->SetToolTip( TE( tooltip ) );
				m_main_sizer->Add( m_combobox, 0, wxEXPAND );
				break;
			}
		default:
			{
				EndModal( wxID_CANCEL );
				return;
				break;
			}
	}

	wxSize __SpacerSize_1 = wxDLG_UNIT( this, wxSize( 0, 0 ) );
	m_main_sizer->Add( __SpacerSize_1.GetWidth(), __SpacerSize_1.GetHeight(), 0, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5 );
	wxStaticLine* m_separator1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxSize( 10, -1 ), wxLI_HORIZONTAL, _T( "ID_STATICLINE1" ) );
	m_main_sizer->Add( m_separator1, 0, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5 );
	wxBoxSizer* m_buttons_sizer = new wxBoxSizer( wxHORIZONTAL );
	m_cancel_button = new wxButton( this, ID_CANCEL, _( "Cancel" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CANCEL" ) );
	m_buttons_sizer->Add( m_cancel_button, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 5 );
	m_buttons_sizer->Add( 0, 0, 1, wxALL | wxEXPAND | wxSHAPED | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 0 );
	m_ok_button = new wxButton( this, ID_OK, _( "Ok" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_OK" ) );
	m_buttons_sizer->Add( m_ok_button, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5 );
	m_main_sizer->Add( m_buttons_sizer, 0, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 0 );


	m_main_sizer->Fit( this );
	m_main_sizer->SetSizeHints( this );

	SetSizer( m_main_sizer );
	Layout();

	Connect( ID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, ( wxObjectEventFunction )&SingleOptionDialog::OnCancel );
	Connect( ID_OK, wxEVT_COMMAND_BUTTON_CLICKED, ( wxObjectEventFunction )&SingleOptionDialog::OnOk );
}
CPageAuto::CPageAuto(
  CDialogExportSetup *parent, 
  wxWizardPageSimple *prev, 
  CXSLExportFileType *pExportEdit,
  bool bReadOnly) :
    wxWizardPageSimple(parent,prev,NULL),
    m_pExportEdit(pExportEdit),
    m_pCheckActive(NULL),
    m_pCheckAppendDate(NULL),
    m_pComboLocation(NULL),
    m_pComboFileName(NULL),
    m_pComboFileExt(NULL),
    m_pTextLocation(NULL),
    m_pTextFileName(NULL),
    m_pTextFileExt(NULL),
    m_pButtonBrowse(NULL),
    m_bReadOnly(bReadOnly)
{

  // m_pCheckActive

  prev->SetNext(this);
  m_pCheckActive = new wxCheckBox(
    this,wxID_ANY,_T("Create export file after each analysis"));

  // m_pComboLocation

  wxStaticText *pTextLocation = new wxStaticText(
    this,wxID_ANY,_T("Location"));

  wxWindow *pWinLocation = _CreateLocationWindow();
  wxBoxSizer *pSizerLocation = new wxBoxSizer(wxHORIZONTAL);
  if(!m_bReadOnly)
  {
    m_pButtonBrowse = new wxButton(
      this,IDbrowseOutput,_T("Browse..."),
      wxDefaultPosition, wxDefaultSize,
      wxBU_EXACTFIT);
    pSizerLocation->Add(pWinLocation,1,wxEXPAND | wxRIGHT , ID_BORDER);
    pSizerLocation->Add(m_pButtonBrowse,0,wxALIGN_CENTER_VERTICAL,0);
  }
  else
  {
    pSizerLocation->Add(pWinLocation,1,wxEXPAND,0);
  }
  // m_pComboFileName

  wxArrayString as;
  if(!m_bReadOnly)
  {
    as.Alloc(1);
    as.Add(ANALYSIS_FILE_NAME);
  }

  wxStaticText *pTextFileName = new wxStaticText(
    this,wxID_ANY,_T("File name"));
  wxWindow *pWinFileName = _CreateFileNameWindow(as);
  m_pCheckAppendDate = new wxCheckBox(
    this,wxID_ANY,_T("Append date to file name"));

  // m_pComboFileExt

  wxStaticText *pTextExt = new wxStaticText(
    this,wxID_ANY,_T("File extension"));
  wxWindow *pWinFileExt = _CreateFileExtWindow();

  // layout

  wxBoxSizer *pSizerAll = new wxBoxSizer(wxVERTICAL);
  wxFlexGridSizer *pGridSizer = new wxFlexGridSizer(3,2,ID_BORDER,ID_BORDER);
  wxBoxSizer *pSizerFileName = new wxBoxSizer(wxVERTICAL);
  pGridSizer->SetFlexibleDirection(wxBOTH);
  pGridSizer->AddGrowableCol(1,1);
  pGridSizer->Add(pTextLocation,0,
    wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
  pGridSizer->Add(pSizerLocation,1,
    wxEXPAND | wxALIGN_CENTRE_VERTICAL | wxEXPAND);
  pGridSizer->Add(pTextFileName,0,
    wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
  pSizerFileName->Add(pWinFileName,0,wxALIGN_LEFT | wxEXPAND,0);
  pSizerFileName->Add(m_pCheckAppendDate,0,wxTOP | wxALIGN_LEFT,1);
  pGridSizer->Add(pSizerFileName,1,
    wxEXPAND | wxALIGN_CENTRE_VERTICAL | wxEXPAND);
  pGridSizer->Add(pTextExt,0,
    wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
  pGridSizer->Add(pWinFileExt,1,
    wxEXPAND | wxALIGN_CENTRE_VERTICAL | wxEXPAND,0);
  pSizerAll->Add(m_pCheckActive,0, wxALIGN_LEFT | wxBOTTOM, ID_BORDER);
  pSizerAll->Add(pGridSizer, 0, wxEXPAND);
  pSizerAll->AddStretchSpacer(1);
  SetSizer(pSizerAll);
  Layout();
}
示例#8
0
LabelDialog::LabelDialog(wxWindow *parent,
                         DirManager *dirmanager,
                         TrackList *tracks,
                         ViewInfo &viewinfo,
                         double rate)
: wxDialog(parent,
           wxID_ANY,
           _NoAcc("&Edit Labels"),
           wxDefaultPosition,
           wxSize(800, 600),
           wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
  mDirManager(dirmanager),
  mTracks(tracks),
  mViewInfo(&viewinfo),
  mRate(rate)
{
   // Create the main sizer
   wxBoxSizer *vs = new wxBoxSizer(wxVERTICAL);

   // A little instruction
   vs->Add(new wxStaticText(this,
                            wxID_ANY,
                            _("Press F2 or double click to edit cell contents.")),
                            0,
                            wxALIGN_LEFT | wxALL,
                            5);

   // Create the main sizer
   mGrid = new Grid(this, wxID_ANY);
   vs->Add(mGrid, 1, wxEXPAND | wxALL, 5);

   // Create the action buttons
   wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
   hs->Add(new wxButton(this, ID_INSERTA, _("Insert &After")), 1, wxCENTER | wxALL, 5);
   hs->Add(new wxButton(this, ID_INSERTB, _("Insert &Before")), 1, wxCENTER | wxALL, 5);
   hs->Add(new wxButton(this, ID_REMOVE,  _("&Remove")), 1, wxCENTER | wxALL, 5);
   hs->Add(new wxButton(this, ID_IMPORT,  _("&Import...")), 1, wxCENTER | wxALL, 5);
   hs->Add(new wxButton(this, ID_EXPORT,  _("&Export...")), 1, wxCENTER | wxALL, 5);
   vs->Add(hs, 0, wxEXPAND | wxCENTER | wxALL, 5);

   // Create the exit buttons
   vs->Add(CreateStdButtonSizer(this, eCancelButton|eOkButton), 0, wxEXPAND);

   // Make it so
   SetSizer(vs);

   // Build the initial (empty) grid
   mGrid->CreateGrid(0, Col_Max);
   mGrid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER);

   int i;
   for (i = 0; i < Col_Max; i++) {
      mGrid->SetColLabelValue(i, headers[i]);
   }

   // Create and remember editors.  No need to delete these as the wxGrid will
   // do it for us.
   mChoiceEditor = (ChoiceEditor *) mGrid->GetDefaultEditorForType(GRID_VALUE_CHOICE);
   mTimeEditor = (TimeEditor *) mGrid->GetDefaultEditorForType(GRID_VALUE_TIME);

   // Initialize and set the track name column attributes
   wxGridCellAttr *attr = new wxGridCellAttr();
   attr->SetEditor(mChoiceEditor);
   mGrid->SetColAttr(Col_Track, attr);
   mTrackNames.Add(_("New..."));

   // Initialize and set the time column attributes
   attr = new wxGridCellAttr();
   attr->SetRenderer(mGrid->GetDefaultRendererForType(GRID_VALUE_TIME));
   attr->SetEditor(mTimeEditor);
   attr->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER);
   mGrid->SetColAttr(Col_Stime, attr);
   mGrid->SetColAttr(Col_Etime, attr->Clone());

   // Seems there's a bug in wxGrid.  Adding only 1 row does not
   // allow SetCellSize() to work properly and you will not get
   // the expected 1 row by 4 column cell.
   //
   // So, we set the minimum row height to 0 and basically hide
   // the extra row by setting its height to 0.  And not allowing the
   // rows to be manually resized prevents the user from ever seeing
   // the extra row.
   mGrid->SetRowMinimalAcceptableHeight(0);
   mGrid->EnableDragRowSize(false);

   // Locate all labels in current track list
   FindAllLabels();

   // Populate the grid
   TransferDataToWindow();

   // Resize the label name column and ensure it doesn't go below an
   // arbitrary width.
   //
   // This should not be in TransferDataToWindow() since a user might
   // resize the column and we'd resize it back to the minimum.
   mGrid->AutoSizeColumn(Col_Label, false );
   mGrid->SetColSize(Col_Label, wxMax(150, mGrid->GetColSize(Col_Label)));
   mGrid->SetColMinimalWidth(Col_Label, mGrid->GetColSize(Col_Label));

   // Layout the works
   Layout();

   // Resize width based on width of columns and the vertical scrollbar
   wxRect r = mGrid->GetGridColLabelWindow()->GetRect();
   wxScrollBar sb(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL);
   r.width += sb.GetSize().GetWidth() + 6;
   SetClientSize(r.width, 300);

   // Make sure it doesn't go below this size
   r = GetRect();
   SetSizeHints(r.GetWidth(), r.GetHeight());

   // Center on display
   Center();
}
示例#9
0
menu_layout
TExpandoMenuBar::MenuLayout() const
{
	return Layout();
}
    PromptDlgPassword(wxWindow* parent)
                         : wxDialog(parent,
                                    -1,
                                    _("Authentication Required"),
                                    wxDefaultPosition,
                                    wxSize(400, 200),
                                    wxDEFAULT_DIALOG_STYLE |
                                    wxCENTER)
    {
        // create the username sizer
        
        wxStaticText* label_username = new wxStaticText(this,
                                                        -1,
                                                        _("User Name:"),
                                                        wxDefaultPosition,
                                                        wxDefaultSize);
        m_username_ctrl = new wxTextCtrl(this, ID_UsernameTextCtrl, m_username);
        
        wxBoxSizer* username_sizer = new wxBoxSizer(wxHORIZONTAL);
        username_sizer->Add(label_username, 0, wxALIGN_CENTER);
        username_sizer->Add(m_username_ctrl, 1, wxEXPAND);
        
        
        // create the password sizer
        
        wxStaticText* label_password = new wxStaticText(this,
                                                        -1,
                                                        _("Password:"),
                                                        wxDefaultPosition,
                                                        wxDefaultSize);
        m_password_ctrl = new wxTextCtrl(this,
                                         ID_PasswordTextCtrl,
                                         wxEmptyString,
                                         wxDefaultPosition,
                                         wxDefaultSize,
                                         wxTE_PASSWORD);
        
        wxBoxSizer* password_sizer = new wxBoxSizer(wxHORIZONTAL);
        password_sizer->Add(label_password, 0, wxALIGN_CENTER);
        password_sizer->Add(m_password_ctrl, 1, wxEXPAND);


        // create a platform standards-compliant OK/Cancel sizer
        
        wxButton* ok_button = new wxButton(this, wxID_OK);
        wxButton* cancel_button = new wxButton(this, wxID_CANCEL);
        
        wxStdDialogButtonSizer* ok_cancel_sizer = new wxStdDialogButtonSizer;
        ok_cancel_sizer->AddButton(ok_button);
        ok_cancel_sizer->AddButton(cancel_button);
        ok_cancel_sizer->Realize();
        ok_cancel_sizer->AddSpacer(5);
        
        ok_button->SetDefault();
        
        // this code is necessary to get the sizer's bottom margin to 8
        wxSize min_size = ok_cancel_sizer->GetMinSize();
        min_size.SetHeight(min_size.GetHeight()+16);
        ok_cancel_sizer->SetMinSize(min_size);
        
        
        // code to allow us to line up the static text elements
        wxSize s1 = label_username->GetSize();
        wxSize s2 = label_password->GetSize();
        wxSize max_size = wxSize(wxMax(s1.x, s2.x), wxMax(s1.y, s2.y));
        max_size.x += 10;
        username_sizer->SetItemMinSize(label_username, max_size);
        password_sizer->SetItemMinSize(label_password, max_size);


        // create username/password sizer
        
        wxBitmap bmp = wxArtProvider::GetBitmap(wxART_QUESTION, wxART_MESSAGE_BOX);
        wxStaticBitmap* bitmap_question = new wxStaticBitmap(this, -1, bmp);
        m_message_ctrl = new wxStaticText(this, -1, m_message);
        
        wxBoxSizer* vert_sizer = new wxBoxSizer(wxVERTICAL);
        vert_sizer->Add(m_message_ctrl, 0, wxEXPAND);
        vert_sizer->AddSpacer(16);
        vert_sizer->Add(username_sizer, 0, wxEXPAND);
        vert_sizer->AddSpacer(8);
        vert_sizer->Add(password_sizer, 0, wxEXPAND);
        
        // create top sizer
        
        wxBoxSizer* top_sizer = new wxBoxSizer(wxHORIZONTAL);
        top_sizer->AddSpacer(7);
        top_sizer->Add(bitmap_question, 0, wxTOP, 7);
        top_sizer->AddSpacer(15);
        top_sizer->Add(vert_sizer, 1, wxEXPAND | wxTOP, 7);

        // create main sizer
        
        wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
        main_sizer->AddSpacer(8);
        main_sizer->Add(top_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, 8);
        main_sizer->AddStretchSpacer();
        main_sizer->Add(ok_cancel_sizer, 0, wxEXPAND);

        SetSizer(main_sizer);
        Layout();
    }
示例#11
0
ChatOptionsTab::ChatOptionsTab( wxWindow* parent )
    : wxScrolledWindow( parent, -1 )
{
	GetAui().manager->AddPane( this, wxLEFT, _T( "chatoptionstab" ) );

	wxBoxSizer* bMainSizerV;
	bMainSizerV = new wxBoxSizer( wxVERTICAL );

	wxStaticBoxSizer* sbColorsSizer;
	sbColorsSizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, _( "Colors and font" ) ), wxHORIZONTAL );

	wxBoxSizer* bColorsVSizer;
	bColorsVSizer = new wxBoxSizer( wxVERTICAL );

	m_use_sys_colors = new wxCheckBox( this, ID_SYSCOLS, _( "Use system colors" ), wxDefaultPosition, wxDefaultSize, 0 );

	m_use_sys_colors->Enable( false );

	bColorsVSizer->Add( m_use_sys_colors, 0, wxALL, 5 );

	m_custom_colors = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxTAB_TRAVERSAL );
	m_custom_colors->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );

	wxBoxSizer* bCustomColorsSizer;
	bCustomColorsSizer = new wxBoxSizer( wxHORIZONTAL );

	wxBoxSizer* bColorSizer;
	bColorSizer = new wxBoxSizer( wxHORIZONTAL );

	wxBoxSizer* bColorsSizer1;
	bColorsSizer1 = new wxBoxSizer( wxVERTICAL );

	wxBoxSizer* bNormlColorSizer;
	bNormlColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_normal_color = new ColorButton( m_custom_colors, ID_NORMAL, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_normal_color->SetColor( wxColour( 0, 0, 0 ) );

	bNormlColorSizer->Add( m_normal_color, 0, wxALL, 5 );

	m_normal_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Normal" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_normal_label->Wrap( -1 );
	bNormlColorSizer->Add( m_normal_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorsSizer1->Add( bNormlColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bBGColorSizer;
	bBGColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_bg_color = new ColorButton( m_custom_colors, ID_BG, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_bg_color->SetColor( wxColour( 255, 255, 255 ) );

	bBGColorSizer->Add( m_bg_color, 0, wxALL, 5 );

	m_bg_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Background" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_bg_label->Wrap( -1 );
	bBGColorSizer->Add( m_bg_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorsSizer1->Add( bBGColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bActionColorSizer;
	bActionColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_action_color = new ColorButton( m_custom_colors, ID_ACTION, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_action_color->SetColor( wxColour( 255, 0, 249 ) );

	bActionColorSizer->Add( m_action_color, 0, wxALL, 5 );

	m_action_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Action" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_action_label->Wrap( -1 );
	bActionColorSizer->Add( m_action_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorsSizer1->Add( bActionColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bHighlightColorSizer;
	bHighlightColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_highlight_color = new ColorButton( m_custom_colors, ID_HIGHLIGHT, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_highlight_color->SetColor( wxColour( 255, 0, 44 ) );

	bHighlightColorSizer->Add( m_highlight_color, 0, wxALL, 5 );

	m_highlight_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Highlight" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_highlight_label->Wrap( -1 );
	bHighlightColorSizer->Add( m_highlight_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorsSizer1->Add( bHighlightColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bJoinLeaveColorSizer;
	bJoinLeaveColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_joinleave_color = new ColorButton( m_custom_colors, ID_JOINLEAVE, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_joinleave_color->SetColor( wxColour( 24, 255, 0 ) );

	bJoinLeaveColorSizer->Add( m_joinleave_color, 0, wxALL, 5 );

	m_joinleave_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Join/Leave" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_joinleave_label->Wrap( -1 );
	bJoinLeaveColorSizer->Add( m_joinleave_label, 1, wxALIGN_CENTER_VERTICAL |  wxALL, 5 );

	bColorsSizer1->Add( bJoinLeaveColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bMyColorSizer;
	bMyColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_my_color = new ColorButton( m_custom_colors, ID_MYMESS, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_my_color->SetColor( wxColour( 160, 160, 160 ) );

	bMyColorSizer->Add( m_my_color, 0, wxALL, 5 );

	m_my_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "My messages" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_my_label->Wrap( -1 );
	bMyColorSizer->Add( m_my_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorsSizer1->Add( bMyColorSizer, 1, wxEXPAND, 5 );

	bColorSizer->Add( bColorsSizer1, 1, wxEXPAND, 5 );

	wxBoxSizer* bColorSizer2;
	bColorSizer2 = new wxBoxSizer( wxVERTICAL );

	wxBoxSizer* bServerColorSizer;
	bServerColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_server_color = new ColorButton( m_custom_colors, ID_SERVER, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_server_color->SetColor( wxColour( 255, 189, 0 ) );

	bServerColorSizer->Add( m_server_color, 0, wxALL, 5 );

	m_server_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Server" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_server_label->Wrap( -1 );
	bServerColorSizer->Add( m_server_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorSizer2->Add( bServerColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bClientolorSizer;
	bClientolorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_client_color = new ColorButton( m_custom_colors, ID_CLIENT, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_client_color->SetColor( wxColour( 255, 189, 0 ) );

	bClientolorSizer->Add( m_client_color, 0, wxALL, 5 );

	m_client_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Client" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_client_label->Wrap( -1 );
	bClientolorSizer->Add( m_client_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorSizer2->Add( bClientolorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bErrorColorSizer;
	bErrorColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_error_color = new ColorButton( m_custom_colors, ID_ERROR, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_error_color->SetColor( wxColour( 255, 0, 0 ) );

	bErrorColorSizer->Add( m_error_color, 0, wxALL, 5 );

	m_error_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Error" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_error_label->Wrap( -1 );
	bErrorColorSizer->Add( m_error_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorSizer2->Add( bErrorColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bTSColorSizer;
	bTSColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_ts_color = new ColorButton( m_custom_colors, ID_TIMESTAMP, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_ts_color->SetColor( wxColour( 160, 160, 160 ) );

	bTSColorSizer->Add( m_ts_color, 0, wxALL, 5 );

	m_ts_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Timestamp" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_ts_label->Wrap( -1 );
	bTSColorSizer->Add( m_ts_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorSizer2->Add( bTSColorSizer, 0, wxEXPAND, 5 );

	wxBoxSizer* bNoteColorSizer;
	bNoteColorSizer = new wxBoxSizer( wxHORIZONTAL );

	m_note_color = new ColorButton( m_custom_colors, ID_NOTIFICATION, wxBitmap(), wxDefaultPosition, wxSize( 20, 20 ), 0 );
	m_note_color->SetColor( wxColour( 255, 191, 0 ) );

	bNoteColorSizer->Add( m_note_color, 0, wxALL, 5 );

	m_note_label = new wxStaticText( m_custom_colors, wxID_ANY, _( "Notification" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_note_label->Wrap( -1 );
	bNoteColorSizer->Add( m_note_label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );

	bColorSizer2->Add( bNoteColorSizer, 0, wxEXPAND, 5 );

	bColorSizer->Add( bColorSizer2, 1, wxEXPAND, 5 );

	bCustomColorsSizer->Add( bColorSizer, 1, wxEXPAND, 5 );

	m_test_text = new wxTextCtrl( m_custom_colors, wxID_ANY, _( "[19:35] ** Server ** Connected to Server.\n[22:30] <Dude> hi everyone\n[22:30] ** Dude2 joined the channel.\n[22:30] * Dude2 thinks his colors looks nice\n[22:45] <Dude> Dude2: orl?\n[22:46] <Dude2> But could be better, should tweak them some more...\n" ), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH );
	bCustomColorsSizer->Add( m_test_text, 1, wxALL | wxEXPAND, 5 );

	m_custom_colors->SetSizer( bCustomColorsSizer );
	m_custom_colors->Layout();
	bCustomColorsSizer->Fit( m_custom_colors );
	bColorsVSizer->Add( m_custom_colors, 1, wxEXPAND | wxALL, 0 );

	wxBoxSizer* bFontNameSizer;
	bFontNameSizer = new wxBoxSizer( wxHORIZONTAL );

	m_font_label = new wxStaticText( this, wxID_ANY, _( "Font:" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_font_label->Wrap( -1 );
	bFontNameSizer->Add( m_font_label, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );

	m_fontname = new wxStaticText( this, wxID_ANY, _( "default" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_fontname->Wrap( -1 );
	bFontNameSizer->Add( m_fontname, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );

	m_select_font = new wxButton( this, ID_SELFONT, _( "Select..." ), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
	bFontNameSizer->Add( m_select_font, 0, wxALL, 5 );

	bColorsVSizer->Add( bFontNameSizer, 0, wxEXPAND, 5 );

	sbColorsSizer->Add( bColorsVSizer, 1, wxEXPAND, 5 );

	bMainSizerV->Add( sbColorsSizer, 0, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT | wxTOP, 5 );


	wxStaticBoxSizer* sbBehaviorSizer;
	sbBehaviorSizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, _( "Behavior" ) ), wxHORIZONTAL );

	m_irc_colors = new wxCheckBox( this, wxID_ANY, _( "Enable Irc colors in chat messages" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_irc_colors->SetValue( sett().GetUseIrcColors() );

	sbBehaviorSizer->Add( m_irc_colors, 0, wxALL, 5 );
#ifndef DISABLE_SOUND
	m_play_sounds = new wxCheckBox( this, ID_PLAY_SOUNDS, _( "Play notification sounds" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_play_sounds->SetValue( sett().GetChatPMSoundNotificationEnabled() );
	sbBehaviorSizer->Add( m_play_sounds, 0, wxALL, 5 );
#endif

	m_broadcast_check = new wxCheckBox( this, wxID_ANY, _( "Copy server messages in current channel" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_broadcast_check->SetValue(cfg().ReadBool(_T("/Chat/BroadcastEverywhere")));
	sbBehaviorSizer->Add( m_broadcast_check, 0, wxALL, 5 );

	bMainSizerV->Add( sbBehaviorSizer, 0, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 );

	wxBoxSizer* bBotomSizer;
	bBotomSizer = new wxBoxSizer( wxHORIZONTAL );

	wxStaticBoxSizer* sbChatLogSizer;
	wxStaticBox*  sbChatLog = new wxStaticBox( this, -1, _( "Chat logs" ) );
	sbChatLogSizer = new wxStaticBoxSizer( sbChatLog, wxVERTICAL );

	m_save_logs = new wxCheckBox( this, wxID_ANY, _( "Save chat logs" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_save_logs->SetValue( sett().GetChatLogEnable() );

	sbChatLogSizer->Add( m_save_logs, 0, wxALL, 5 );

    wxBoxSizer* m_num_lines_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_num_lines = new wxSpinCtrl( this, wxID_ANY );
    m_num_lines_lbl =  new wxStaticText( this, wxID_ANY, _( "approx. number of lines loaded from log into chat" ), wxDefaultPosition, wxDefaultSize, 0 );
    m_num_lines_sizer->Add( m_num_lines );
    m_num_lines_sizer->Add( m_num_lines_lbl, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
    sbChatLogSizer->Add( m_num_lines_sizer, 0, wxALL, 5 );

	bBotomSizer->Add( sbChatLogSizer, 1, wxEXPAND | wxRIGHT, 5 );

	wxStaticBoxSizer* sbHighlightSizer;
	sbHighlightSizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, _( "Highlight words" ) ), wxVERTICAL );

	m_hilight_words_label = new wxStaticText( this, wxID_ANY, _( "Words to highlight in chat:" ), wxDefaultPosition, wxDefaultSize, 0 );
	m_hilight_words_label->Wrap( -1 );

	sbHighlightSizer->Add( m_hilight_words_label, 0, wxALL, 5 );


	sbHighlightSizer->Add( 0, 0, 1, wxEXPAND, 5 );

	m_highlight_words = new wxTextCtrl( this, ID_HIWORDS, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_highlight_words->SetToolTip ( TE( _( "enter a ; seperated list" ) ) );

	sbHighlightSizer->Add( m_highlight_words, 0, wxALL | wxEXPAND, 5 );

	m_highlight_req = new wxCheckBox( this, ID_HL_REQ, _( "Additionally play sound/flash titlebar " ), wxDefaultPosition, wxDefaultSize, 0 );
	sbHighlightSizer->Add( m_highlight_req , 0, wxALL | wxEXPAND, 5 );

	bBotomSizer->Add( sbHighlightSizer, 1, wxEXPAND, 5 );

	bMainSizerV->Add( bBotomSizer, 0, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 );

	bMainSizerV->Add( 0, 0, 1, wxEXPAND | wxALL, 5 );

	SetScrollRate( SCROLL_RATE, SCROLL_RATE );

	SetSizer( bMainSizerV );
	Layout();

	DoRestore();
	UpdateTextSample();
}
示例#12
0
void GameSettings::readConfiguration()
{
    wxString value;
    int index;
    // Open the Configfile
    conf = new wxFileConfig(wxEmptyString, wxEmptyString, wxT("keeperfx.cfg"),
        wxEmptyString, wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);

    // There's no point in editing these
    value = conf->Read(wxT("INSTALL_PATH"), wxT("./"));
    installPath = value;
    value = conf->Read(wxT("INSTALL_TYPE"), wxT("MAX"));
    installType = value;
    value = conf->Read(wxT("KEYBOARD"), wxT("101"));
    keybLayout = value;

    value = conf->Read(wxT("LANGUAGE"), supported_languages_code[0]);
    index = optionIndexInArray(supported_languages_code, WXSIZEOF(supported_languages_code), value);
    langRadio->SetSelection((index>=0)?index:0);

    value = conf->Read(wxT("SCREENSHOT"), supported_scrshotfmt_code[0]);
    index = optionIndexInArray(supported_scrshotfmt_code, WXSIZEOF(supported_scrshotfmt_code), value);
    scrshotRadio->SetSelection((index>=0)?index:0);

    int res_full_num = 0, res_wind_num = 0;
    value = conf->Read(wxT("FRONTEND_RES"), wxT("640x480x32 640x480x32 640x480x32"));
    {
        wxStringTokenizer tokenz(value, wxT(" \t\r\n"));
        index = 0;
        while ( tokenz.HasMoreTokens() )
        {
            wxString param = tokenz.GetNextToken();
            if (param.rfind('w') != wxString::npos)
                res_wind_num++;
            else
                res_full_num++;
            switch (index)
            {
            case 0:
                resFailCombo->SetValue(param);
                break;
            case 1:
                resMovieCombo->SetValue(param);
                break;
            case 2:
                resMenuCombo->SetValue(param);
                break;
            }
            index++;
        }
    }

    value = conf->Read(wxT("INGAME_RES"), wxT("640x480x32 1024x768x32"));
    {
        wxString selected_resolutions[5];
        size_t selected_num;
        wxString disabled_resolution;
        wxStringTokenizer tokenz(value, wxT(" \t\r\n"));
        disabled_resolution = resFailCombo->GetValue();
        selected_num=0;
        while ( tokenz.HasMoreTokens() && (selected_num < 5) )
        {
            wxString param = tokenz.GetNextToken();
            if (param.rfind('w') != wxString::npos)
                res_wind_num++;
            else
                res_full_num++;
            if (param.CmpNoCase(disabled_resolution) != 0)
            {
                selected_resolutions[selected_num] = param;
                selected_num++;
            }
        }
        // Now we have the amount of fullscreen and windowed resolutions ready
        if ((res_wind_num > 0) && (res_full_num > 0))
            index = 2;
        else if (res_wind_num > 0)
            index = 1;
        else
            index = 0;
        scrnControlRadio->SetSelection(index);
        // SetSelection() doesn't generate event to update resolution options, so lrt's call it:
        ChangeResolutionOptions(index);
        Layout();
        // Set in-game resolutions
        resIngameBox->SetSelected(4, selected_resolutions, selected_num);

    }

    index = conf->Read(wxT("POINTER_SENSITIVITY"), 100);
    value = wxString::Format(wxT("%d"), (int)index);
    mouseSensitvTxtCtrl->SetValue(value);

    value = conf->Read(wxT("CENSORSHIP"), supported_boolean_code[0]);
    index = optionIndexInArray(supported_boolean_code, WXSIZEOF(supported_boolean_code), value);
    censorChkBx->SetValue((index>=0)?index:0);
}
示例#13
0
void GameSettings::OnScreenCtrlChange(wxCommandEvent& event)
{
    // Change screen control
    ChangeResolutionOptions(event.GetInt());
    Layout();
}
示例#14
0
void CLogWindow::PopulateBottom()
{
	sBottom->Add(m_Log, 1, wxEXPAND | wxSHRINK);
	sBottom->Add(m_cmdline, 0, wxEXPAND);
	Layout();
}
vector_layer_settings_control::vector_layer_settings_control(unsigned int index_, layer_control* parent, wxWindowID id, const wxString& title, long style, const wxPoint& pos, const wxSize& size) :
layer_settings_control(parent, id, title, pos, size, style), m_parent(parent)
{
    index(index_);
    m_colourPickerPoints = NULL;
    m_colourPickerRingsPolygons = NULL;
    m_colourPickerInsidePolygons = NULL;
    m_colourPickerLines = NULL;
    m_sliderWidthPoints = NULL;
    m_sliderWidthLines = NULL;
    m_sliderWidthRings = NULL;
    m_choicePoints = NULL;
    m_choicePolygons = NULL;
    m_choiceLines = NULL;
    m_choiceLabels = NULL;

    wxColour bgcolor(220, 220, 220);
    SetBackgroundColour(bgcolor);
    ClearBackground();

#if ((wxMAJOR_VERSION == 2 && wxMINOR_VERSION > 8) || wxMAJOR_VERSION > 2)
    m_main_sizer = new wxFlexGridSizer(1,0,0);
#else
    m_main_sizer = new wxFlexGridSizer(3,1,0,0);
#endif
    m_main_sizer->AddGrowableCol(0);
    m_main_sizer->AddGrowableRow(0);
    m_main_sizer->AddGrowableRow(1);
    m_main_sizer->AddGrowableRow(2);

    ////////////////////////
    ///
    ///  Points settings
    ///
    ////////////////////////
    {
        wxStaticBoxSizer *boxSizerPoints = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Points settings"));
        m_colourPickerPoints = new wxColourPickerCtrl(this, wxID_ANY, *wxRED, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE);
        wxStaticBoxSizer *boxSizerWidthPoints = new wxStaticBoxSizer(wxVERTICAL, this, _("Width"));
        m_sliderWidthPoints = new wxSlider(this, wxID_ANY, 3, 1, 10, wxDefaultPosition, wxSize(100, 40));
        boxSizerWidthPoints->Add(m_sliderWidthPoints, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSizerPoints->Add(m_colourPickerPoints, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSizerPoints->Add(boxSizerWidthPoints, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);

        //m_choicePoints = new wxRadioBox( this, wxID_ANY, _("Points style"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(VectorLayerSettingsControl::choices_points), VectorLayerSettingsControl::choices_points, 1, wxRA_SPECIFY_COLS );
        m_choicePoints = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, WXSIZEOF(vector_layer_settings_control::choices_points), vector_layer_settings_control::choices_points);
        m_choicePoints->SetSelection(0);
        m_choicePoints->Enable(false);
        boxSizerPoints->Add(m_choicePoints, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        m_main_sizer->Add(boxSizerPoints, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
    }

    ////////////////////////
    ///
    ///  Lines settings
    ///
    ////////////////////////
    {
        wxStaticBoxSizer *boxSizerLines = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Lines settings"));
        m_colourPickerLines = new wxColourPickerCtrl(this, wxID_ANY, *wxRED, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE);
        wxStaticBoxSizer *boxSizerWidthLines = new wxStaticBoxSizer(wxVERTICAL, this, _("Width"));
        m_sliderWidthLines = new wxSlider(this, wxID_ANY, 1, 1, 10, wxDefaultPosition, wxSize(100, 40));
        boxSizerWidthLines->Add(m_sliderWidthLines, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSizerLines->Add(m_colourPickerLines, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSizerLines->Add(boxSizerWidthLines, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);

        m_choiceLines = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, WXSIZEOF(vector_layer_settings_control::choices_lines), vector_layer_settings_control::choices_lines);
        m_choiceLines->SetSelection(0);
        boxSizerLines->Add(m_choiceLines, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        m_main_sizer->Add(boxSizerLines, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
    }

    ////////////////////////
    ///
    ///  Polygons settings
    ///
    ////////////////////////
    {
        wxStaticBoxSizer *boxSizerPolygons = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Polygons settings"));
        wxBoxSizer *boxColorPickersPolygons = new wxBoxSizer(wxVERTICAL);
        wxStaticBoxSizer *boxSizerRingsColour = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Rings colour"));
        wxStaticBoxSizer *boxSizerInsideColour = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Inside colour"));
        m_colourPickerRingsPolygons = new wxColourPickerCtrl(this, wxID_ANY, *wxRED, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE);
        m_colourPickerInsidePolygons = new wxColourPickerCtrl(this, wxID_ANY, *wxBLUE, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE);
        boxSizerRingsColour->Add(m_colourPickerRingsPolygons, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSizerInsideColour->Add(m_colourPickerInsidePolygons, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxColorPickersPolygons->Add(boxSizerRingsColour, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxColorPickersPolygons->Add(boxSizerInsideColour, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        wxBoxSizer *boxSlidersPolygons = new wxBoxSizer(wxVERTICAL);
        wxStaticBoxSizer *boxSizerRingsWidth = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Rings width"));
        // Ring width
        m_sliderWidthRings = new wxSlider(this, wxID_ANY, 1, 1, 10, wxDefaultPosition, wxSize(100, 40));
        boxSizerRingsWidth->Add(m_sliderWidthRings, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSlidersPolygons->Add(boxSizerRingsWidth, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);

        boxSizerPolygons->Add(boxColorPickersPolygons, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        boxSizerPolygons->Add(boxSlidersPolygons, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);

        m_choicePolygons = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, WXSIZEOF(vector_layer_settings_control::choices_inside_polygons), vector_layer_settings_control::choices_inside_polygons);
        m_choicePolygons->SetSelection(0);
        boxSizerPolygons->Add(m_choicePolygons, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        m_main_sizer->Add(boxSizerPolygons, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
    }

    ////////////////////////
    ///
    ///  DBF : etiquettes
    ///
    ////////////////////////
    /*
    if (ogr_vectorLayer || (vectorLayer && (vectorLayer->LayerContent()->FlagDBF())))
    {
        wxStaticBoxSizer *boxSizerLabels = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Labels"));

        wxArrayString attributesNames;
        // On parcourt le vecteur et on recupere les valeurs (on met une chaine vide en premier --> permet de ne rien afficher)
        attributesNames.Add(wxT(""));
        for (unsigned int i = 0; i < vectorLayer->LayerContent()->m_dbfAttributesNames.size(); ++i)
            attributesNames.Add(vectorLayer->LayerContent()->m_dbfAttributesNames[i]);
        // Pffffffffffffffff
        wxCArrayString temp(attributesNames);
        m_choiceLabels = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, attributesNames.GetCount(), temp.GetStrings());
        boxSizerLabels->Add(m_choiceLabels, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        m_main_sizer->Add(boxSizerLabels, 1, wxEXPAND | wxALL, 5);
    }
    */

    ////////////////////////
    ///
    ///  Texts
    ///
    ////////////////////////

    wxStaticBoxSizer *boxSizerTexts = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Texts settings"));
    // texts color
    wxStaticBoxSizer *boxSizerTextsColor = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Texts color"));
    boxSizerTexts->Add(boxSizerTextsColor, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
    m_colourPickerTexts = new wxColourPickerCtrl(this, wxID_ANY, *wxRED, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE);
    boxSizerTextsColor->Add(m_colourPickerTexts, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
    /*
	// texts font
	wxStaticBoxSizer *boxSizerTextsFont = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Texts font"));
	boxSizerTexts->Add(boxSizerTextsFont, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
	m_fontPickerTexts = new wxFontPickerCtrl(this, wxID_ANY, wxNullFont, wxDefaultPosition, wxDefaultSize, wxFNTP_USE_TEXTCTRL);
	boxSizerTextsFont->Add(m_fontPickerTexts, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
        */
    // texts visibility
    wxStaticBoxSizer *boxSizerTextsVisibility = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Texts visibility"));
    boxSizerTexts->Add(boxSizerTextsVisibility, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
    m_checkShowTexts = new wxCheckBox(this, wxID_ANY, _("Show texts"));
    m_checkShowTexts->SetValue(true);
    boxSizerTextsVisibility->Add(m_checkShowTexts, 1, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);

    m_main_sizer->Add(boxSizerTexts, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL | wxALL, 5);

    ////////////////////////
    ///
    ///  Buttons
    ///
    ////////////////////////
    wxStdDialogButtonSizer *buttons_sizer = new wxStdDialogButtonSizer();
    buttons_sizer->AddButton(new wxButton(this, wxID_OK, wxT("OK")));
    buttons_sizer->AddButton(new wxButton(this, wxID_APPLY, wxT("Apply")));
    buttons_sizer->AddButton(new wxButton(this, wxID_CANCEL, wxT("Cancel")));
    buttons_sizer->Realize();
    m_main_sizer->Add(buttons_sizer, 0, wxALIGN_RIGHT | wxALL, 5);

    m_main_sizer->SetSizeHints(this);
    SetSizer(m_main_sizer);
    Layout();
    Centre();
}
示例#16
0
InterpreterDisAsmFrame::InterpreterDisAsmFrame(wxWindow* parent)
	: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(500, 700), wxTAB_TRAVERSAL)
	, PC(0)
	, CPU(nullptr)
	, m_item_count(30)
	, decoder(nullptr)
	, disasm(nullptr)
{
	wxBoxSizer* s_p_main = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer* s_b_main = new wxBoxSizer(wxHORIZONTAL);

	m_list = new wxListView(this);
	m_choice_units = new wxChoice(this, wxID_ANY);

	wxButton* b_go_to_addr = new wxButton(this, wxID_ANY, "Go To Address");
	wxButton* b_go_to_pc = new wxButton(this, wxID_ANY, "Go To PC");

	m_btn_step  = new wxButton(this, wxID_ANY, "Step");
	m_btn_run   = new wxButton(this, wxID_ANY, "Run");
	m_btn_pause = new wxButton(this, wxID_ANY, "Pause");

	s_b_main->Add(b_go_to_addr,   wxSizerFlags().Border(wxALL, 5));
	s_b_main->Add(b_go_to_pc,     wxSizerFlags().Border(wxALL, 5));
	s_b_main->Add(m_btn_step,     wxSizerFlags().Border(wxALL, 5));
	s_b_main->Add(m_btn_run,      wxSizerFlags().Border(wxALL, 5));
	s_b_main->Add(m_btn_pause,    wxSizerFlags().Border(wxALL, 5));
	s_b_main->Add(m_choice_units, wxSizerFlags().Border(wxALL, 5));

	//Registers
	m_regs = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
		wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_DONTWRAP|wxNO_BORDER|wxTE_RICH2);
	m_regs->SetEditable(false);

	//Call Stack
	m_calls = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
		wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_DONTWRAP|wxNO_BORDER|wxTE_RICH2);
	m_calls->SetEditable(false);

	m_list ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	m_regs ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	m_calls->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));

	wxBoxSizer* s_w_list = new wxBoxSizer(wxHORIZONTAL);
	s_w_list->Add(m_list, 2, wxEXPAND | wxLEFT | wxDOWN, 5);
	s_w_list->Add(m_regs, 1, wxEXPAND | wxRIGHT | wxDOWN, 5);
	s_w_list->Add(m_calls,1, wxEXPAND | wxRIGHT | wxDOWN, 5);

	s_p_main->Add(s_b_main, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
	s_p_main->Add(s_w_list, 1, wxEXPAND | wxDOWN, 5);

	SetSizer(s_p_main);
	Layout();

	m_list->InsertColumn(0, "ASM");
	for(uint i=0; i<m_item_count; ++i)
	{
		m_list->InsertItem(m_list->GetItemCount(), wxEmptyString);
	}

	m_regs        ->Bind(wxEVT_TEXT,                &InterpreterDisAsmFrame::OnUpdate, this);
	b_go_to_addr  ->Bind(wxEVT_BUTTON,              &InterpreterDisAsmFrame::Show_Val, this);
	b_go_to_pc    ->Bind(wxEVT_BUTTON,              &InterpreterDisAsmFrame::Show_PC, this);
	m_btn_step    ->Bind(wxEVT_BUTTON,              &InterpreterDisAsmFrame::DoStep, this);
	m_btn_run     ->Bind(wxEVT_BUTTON,              &InterpreterDisAsmFrame::DoRun, this);
	m_btn_pause   ->Bind(wxEVT_BUTTON,              &InterpreterDisAsmFrame::DoPause, this);
	m_list        ->Bind(wxEVT_LIST_KEY_DOWN,       &InterpreterDisAsmFrame::InstrKey, this);
	m_list        ->Bind(wxEVT_LIST_ITEM_ACTIVATED, &InterpreterDisAsmFrame::DClick, this);
	m_list        ->Bind(wxEVT_MOUSEWHEEL,          &InterpreterDisAsmFrame::MouseWheel, this);
	m_choice_units->Bind(wxEVT_CHOICE,              &InterpreterDisAsmFrame::OnSelectUnit, this);

	Bind(wxEVT_SIZE, &InterpreterDisAsmFrame::OnResize, this);
	Bind(wxEVT_KEY_DOWN, &InterpreterDisAsmFrame::OnKeyDown, this);
	wxGetApp().Bind(wxEVT_DBG_COMMAND, &InterpreterDisAsmFrame::HandleCommand, this);

	ShowAddr(CentrePc(PC));
	UpdateUnitList();
}
示例#17
0
void ObjectBottomBar::ShowActorViewer(bool show)
{
	m_ViewerPanel->Show(show);
	Layout();
}
示例#18
0
MapDisplayPrefsPanel::MapDisplayPrefsPanel(wxWindow* parent) : PrefsPanelBase(parent)
{
	// Create sizer
	wxBoxSizer* psizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(psizer);

	// Create frame+sizer
	wxStaticBox* frame = new wxStaticBox(this, -1, "Map Editor Display Preferences");
	wxStaticBoxSizer* fsizer = new wxStaticBoxSizer(frame, wxVERTICAL);
	psizer->Add(fsizer, 1, wxEXPAND|wxALL, 4);

	// Create notebook
	nb_pages = new wxNotebook(this, -1);
	fsizer->Add(nb_pages, 1, wxEXPAND|wxALL, 4);


	// General tab
	wxPanel* panel = new wxPanel(nb_pages, -1);
	nb_pages->AddPage(panel, "General", true);
	wxBoxSizer* sz_border = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sz_border);
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	sz_border->Add(sizer, 1, wxEXPAND|wxALL, 4);

	// Dashed grid
	cb_grid_dashed = new wxCheckBox(panel, -1, "Dashed grid");
	sizer->Add(cb_grid_dashed, 0, wxEXPAND|wxALL, 4);

	// Always show line direction tabs
	cb_line_tabs_always = new wxCheckBox(panel, -1, "Always show line direction tabs");
	sizer->Add(cb_line_tabs_always, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Animate hilighted object
	cb_animate_hilight = new wxCheckBox(panel, -1, "Animated hilight");
	sizer->Add(cb_animate_hilight, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Animate selected objects
	cb_animate_selection = new wxCheckBox(panel, -1, "Animated selection");
	sizer->Add(cb_animate_selection, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Animate tagged objects
	cb_animate_tagged = new wxCheckBox(panel, -1, "Animated tag indicator");
	sizer->Add(cb_animate_tagged, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Crosshair
	string ch[] ={ "None", "Small", "Full" };
	choice_crosshair = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 3, ch);
	wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);
	hbox->Add(new wxStaticText(panel, -1, "Cursor Crosshair:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
	hbox->Add(choice_crosshair, 1, wxEXPAND);


	// Vertices tab
	panel = new wxPanel(nb_pages, -1);
	nb_pages->AddPage(panel, "Vertices");
	sz_border = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sz_border);
	sizer = new wxBoxSizer(wxVERTICAL);
	sz_border->Add(sizer, 1, wxEXPAND|wxALL, 4);

	// Vertex size
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "Vertex size: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	slider_vertex_size = new wxSlider(panel, -1, vertex_size, 2, 16, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
	hbox->Add(slider_vertex_size, 1, wxEXPAND);

	// Round vertices
	cb_vertex_round = new wxCheckBox(panel, -1, "Round vertices");
	sizer->Add(cb_vertex_round, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// When not in vertices mode
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "When not in vertices mode: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	string nonmodeshow[] = { "Hide", "Show", "Fade" };
	choice_vertices_always = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 3, nonmodeshow);
	hbox->Add(choice_vertices_always, 1, wxEXPAND);


	// Lines tab
	panel = new wxPanel(nb_pages, -1);
	nb_pages->AddPage(panel, "Lines");
	sz_border = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sz_border);
	sizer = new wxBoxSizer(wxVERTICAL);
	sz_border->Add(sizer, 1, wxEXPAND|wxALL, 4);

	// Line width
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "Line width: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	slider_line_width = new wxSlider(panel, -1, line_width*10, 10, 30, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
	hbox->Add(slider_line_width, 1, wxEXPAND);

	// Smooth lines
	cb_line_smooth = new wxCheckBox(panel, -1, "Smooth lines");
	sizer->Add(cb_line_smooth, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Fade when not in lines mode
	cb_line_fade = new wxCheckBox(panel, -1, "Fade when not in lines mode");
	sizer->Add(cb_line_fade, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);


	// Things tab
	panel = new wxPanel(nb_pages, -1);
	nb_pages->AddPage(panel, "Things");
	sz_border = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sz_border);
	sizer = new wxBoxSizer(wxVERTICAL);
	sz_border->Add(sizer, 1, wxEXPAND|wxALL, 4);

	// Thing style
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "Thing style: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	string t_types[] = { "Square", "Round", "Sprite", "Square + Sprite", "Framed Sprite" };
	choice_thing_drawtype = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 5, t_types);
	hbox->Add(choice_thing_drawtype, 1, wxEXPAND);

	// Always show angles
	cb_thing_force_dir = new wxCheckBox(panel, -1, "Always show thing angles");
	sizer->Add(cb_thing_force_dir, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Colour angle arrows
	cb_thing_arrow_colour = new wxCheckBox(panel, -1, "Colour thing angle arrows");
	sizer->Add(cb_thing_arrow_colour, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Force square hilight/selection
	cb_thing_overlay_square = new wxCheckBox(panel, -1, "Force square thing hilight/selection overlay");
	sizer->Add(cb_thing_overlay_square, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Shadow opacity
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "Thing shadow opacity: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	slider_thing_shadow = new wxSlider(panel, -1, thing_shadow*10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
	hbox->Add(slider_thing_shadow, 1, wxEXPAND);

	// Arrow opacity
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "Thing angle arrow opacity: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	slider_thing_arrow_alpha = new wxSlider(panel, -1, thing_shadow*10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
	hbox->Add(slider_thing_arrow_alpha, 1, wxEXPAND);

	// When not in things mode
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "When not in things mode: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	choice_things_always = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 3, nonmodeshow);
	hbox->Add(choice_things_always, 1, wxEXPAND);


	// Sectors tab
	panel = new wxPanel(nb_pages, -1);
	nb_pages->AddPage(panel, "Sectors");
	sz_border = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sz_border);
	sizer = new wxBoxSizer(wxVERTICAL);
	sz_border->Add(sizer, 1, wxEXPAND|wxALL, 4);

	// Flat brightness
	hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);
	hbox->Add(new wxStaticText(panel, -1, "Flat brightness: "), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
	slider_flat_brightness = new wxSlider(panel, -1, flat_brightness*10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
	hbox->Add(slider_flat_brightness, 1, wxEXPAND);

	// Ignore sector light
	cb_flat_ignore_light = new wxCheckBox(panel, -1, "Flats ignore sector brightness");
	sizer->Add(cb_flat_ignore_light, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Fill sector hilight
	cb_sector_hilight_fill = new wxCheckBox(panel, -1, "Filled sector hilight");
	sizer->Add(cb_sector_hilight_fill, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Fade when not in sectors mode
	cb_flat_fade = new wxCheckBox(panel, -1, "Fade flats when not in sectors mode");
	sizer->Add(cb_flat_fade, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	Layout();
}
示例#19
0
void ReportView::Set(Report& p) {
	Init();
	report = &p;
	Refresh();
	Layout();
}
示例#20
0
/* AudioEntryPanel::AudioEntryPanel
 * AudioEntryPanel class constructor
 *******************************************************************/
AudioEntryPanel::AudioEntryPanel(wxWindow* parent) : EntryPanel(parent, "audio")
{
	// Init variables
	timer_seek = new wxTimer(this);
	sound_buffer = NULL;
	audio_type = AUTYPE_INVALID;
	num_tracks = 1;
	subsong = 0;
	song_length = 0;
	sound = new sf::Sound();
	music = new sf::Music();
	mod = new ModMusic();

#ifdef __WXMSW__
	wxRegKey key(wxRegKey::HKLM, "Software\\Microsoft\\Active Setup\\Installed Components\\{6BF52A52-394A-11d3-B153-00C04F79FAA6}");
	long value = 0;
	key.QueryValue("IsInstalled", &value);
	if (value == 0)
	{
		LOG_MESSAGE(1, "Windows Media Player not installed, mp3 playback disabled.");
		media_ctrl = NULL;
	}
	else
	{
		LOG_MESSAGE(3, "Windows Media Player installed, using wxMediaCtrl");
		media_ctrl = new wxMediaCtrl(this, -1);
	}
#else
	// Create wxMediaCtrl
	media_ctrl = new wxMediaCtrl(this, -1);
#endif

	// Setup sizer
	wxGridBagSizer* sizer_gb = new wxGridBagSizer(4, 4);
	sizer_main->AddStretchSpacer();
#ifndef __WXOSX__
	if (media_ctrl) sizer_main->Add(media_ctrl, 0);
#endif
	sizer_main->Add(sizer_gb, 0, wxALIGN_CENTER);
	sizer_main->AddStretchSpacer();

	// Add seekbar
	slider_seek = new wxSlider(this, -1, 0, 0, 100);
	sizer_gb->Add(slider_seek, wxGBPosition(0, 0), wxGBSpan(1, 9), wxEXPAND);

	// Add play controls
	btn_play = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "play"));
	sizer_gb->Add(btn_play, wxGBPosition(1, 0));
	btn_pause = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "pause"));
	sizer_gb->Add(btn_pause, wxGBPosition(1, 1));
	btn_stop = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "stop"));
	sizer_gb->Add(btn_stop, wxGBPosition(1, 2));
	btn_prev = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "prev"));
	sizer_gb->Add(btn_prev, wxGBPosition(1, 3));
	btn_next = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "next"));
	sizer_gb->Add(btn_next, wxGBPosition(1, 4));

	// Add title
	txt_title = new wxStaticText(this, -1, wxEmptyString);
	sizer_gb->Add(txt_title, wxGBPosition(3, 0), wxGBSpan(3, 9));

	// Add info
	txt_info = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_BESTWRAP);
	sizer_gb->Add(txt_info, wxGBPosition(6, 0), wxGBSpan(9, 9), wxEXPAND|wxHORIZONTAL);

	// Add track number
	txt_track = new wxStaticText(this, -1, "1/1");
	sizer_gb->Add(txt_track, wxGBPosition(1, 5), wxDefaultSpan, wxALIGN_CENTER);

	// Separator
	sizer_gb->Add(new wxStaticLine(this, -1, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL), wxGBPosition(1, 6), wxDefaultSpan, wxEXPAND|wxLEFT|wxRIGHT, 8);

	// Add volume slider
	sizer_gb->Add(new wxStaticText(this, -1, "Volume:"), wxGBPosition(1, 7), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	slider_volume = new wxSlider(this, -1, 0, 0, 100, wxDefaultPosition, wxSize(128, -1));
	slider_volume->SetValue(snd_volume);
	sizer_gb->Add(slider_volume, wxGBPosition(1, 8));

	// Set volume
	sound->setVolume(snd_volume);
	music->setVolume(snd_volume);
	theMIDIPlayer->setVolume(snd_volume);
	if (media_ctrl) media_ctrl->SetVolume(snd_volume*0.01);
	mod->setVolume(snd_volume);
	//theGMEPlayer->setVolume(snd_volume);
	//theOPLPlayer->setVolume(snd_volume);

	// Disable general entrypanel buttons
	if (media_ctrl) media_ctrl->Show(false);
	toolbar->Show(false);

	// Bind events
	btn_play->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnPlay, this);
	btn_pause->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnPause, this);
	btn_stop->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnStop, this);
	btn_prev->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnPrev, this);
	btn_next->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnNext, this);
	slider_seek->Bind(wxEVT_SLIDER, &AudioEntryPanel::onSliderSeekChanged, this);
	slider_volume->Bind(wxEVT_SLIDER, &AudioEntryPanel::onSliderVolumeChanged, this);
	Bind(wxEVT_TIMER, &AudioEntryPanel::onTimer, this);

	Layout();
}
示例#21
0
InterpreterDisAsmFrame::InterpreterDisAsmFrame(wxWindow* parent)
	: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(500, 700), wxTAB_TRAVERSAL)
	, PC(0)
	, CPU(nullptr)
	, m_item_count(30)
	, decoder(nullptr)
	, disasm(nullptr)
{
	wxBoxSizer& s_p_main = *new wxBoxSizer(wxVERTICAL);
	wxBoxSizer& s_b_main = *new wxBoxSizer(wxHORIZONTAL);

	m_list = new wxListView(this);
	m_choice_units = new wxChoice(this, wxID_ANY);

	wxButton& b_go_to_addr = *new wxButton(this, wxID_ANY, "Go To Address");
	wxButton& b_go_to_pc = *new wxButton(this, wxID_ANY, "Go To PC");

	m_btn_step	= new wxButton(this, wxID_ANY, "Step");
	m_btn_run	= new wxButton(this, wxID_ANY, "Run");
	m_btn_pause	= new wxButton(this, wxID_ANY, "Pause");

	s_b_main.Add(&b_go_to_addr,		wxSizerFlags().Border(wxALL, 5));
	s_b_main.Add(&b_go_to_pc,		wxSizerFlags().Border(wxALL, 5));
	s_b_main.Add(m_btn_step,		wxSizerFlags().Border(wxALL, 5));
	s_b_main.Add(m_btn_run,			wxSizerFlags().Border(wxALL, 5));
	s_b_main.Add(m_btn_pause,		wxSizerFlags().Border(wxALL, 5));
	s_b_main.Add(m_choice_units,	wxSizerFlags().Border(wxALL, 5));

	m_regs = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
		wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_DONTWRAP|wxNO_BORDER|wxTE_RICH2);
	m_regs->SetMinSize(wxSize(495, 100));
	m_regs->SetEditable(false);

	//Call Stack
	m_calls = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
		wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_DONTWRAP|wxNO_BORDER|wxTE_RICH2);
	m_calls->SetMinSize(wxSize(495, 100));
	m_calls->SetEditable(false);

	m_list ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	m_regs ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	m_calls->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));

	wxBoxSizer& s_w_list = *new wxBoxSizer(wxHORIZONTAL);
	s_w_list.Add(m_list, 2, wxEXPAND | wxLEFT | wxDOWN, 5);
	s_w_list.Add(m_regs, 1, wxEXPAND | wxRIGHT | wxDOWN, 5);
	s_w_list.Add(m_calls,1, wxEXPAND | wxRIGHT | wxDOWN, 5);

	s_p_main.Add(&s_b_main, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
	s_p_main.Add(&s_w_list, 1, wxEXPAND | wxDOWN, 5);

	SetSizer(&s_p_main);
	Layout();

	m_list->InsertColumn(0, "ASM");
	for(uint i=0; i<m_item_count; ++i)
	{
		m_list->InsertItem(m_list->GetItemCount(), wxEmptyString);
	}

	Connect(m_regs->GetId(),		wxEVT_COMMAND_TEXT_UPDATED,		wxCommandEventHandler(InterpreterDisAsmFrame::OnUpdate));
	Connect(b_go_to_addr.GetId(),	wxEVT_COMMAND_BUTTON_CLICKED,	wxCommandEventHandler(InterpreterDisAsmFrame::Show_Val));
	Connect(b_go_to_pc.GetId(),		wxEVT_COMMAND_BUTTON_CLICKED,	wxCommandEventHandler(InterpreterDisAsmFrame::Show_PC));
	Connect(m_btn_step->GetId(),	wxEVT_COMMAND_BUTTON_CLICKED,	wxCommandEventHandler(InterpreterDisAsmFrame::DoStep));
	Connect(m_btn_run->GetId(),		wxEVT_COMMAND_BUTTON_CLICKED,	wxCommandEventHandler(InterpreterDisAsmFrame::DoRun));
	Connect(m_btn_pause->GetId(),	wxEVT_COMMAND_BUTTON_CLICKED,	wxCommandEventHandler(InterpreterDisAsmFrame::DoPause));
	Connect(m_list->GetId(),		wxEVT_COMMAND_LIST_KEY_DOWN,	wxListEventHandler(InterpreterDisAsmFrame::InstrKey));
	Connect(m_list->GetId(),		wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(InterpreterDisAsmFrame::DClick));
	Connect(m_choice_units->GetId(),wxEVT_COMMAND_CHOICE_SELECTED,	wxCommandEventHandler(InterpreterDisAsmFrame::OnSelectUnit));
	Connect(wxEVT_SIZE, wxSizeEventHandler(InterpreterDisAsmFrame::OnResize));
	m_app_connector.Connect(m_list->GetId(), wxEVT_MOUSEWHEEL, wxMouseEventHandler(InterpreterDisAsmFrame::MouseWheel), (wxObject*)0, this);
	m_app_connector.Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(InterpreterDisAsmFrame::OnKeyDown), (wxObject*)0, this);
	m_app_connector.Connect(wxEVT_DBG_COMMAND, wxCommandEventHandler(InterpreterDisAsmFrame::HandleCommand), (wxObject*)0, this);

	ShowAddr(CentrePc(PC));
	UpdateUnitList();
}
示例#22
0
abstract_panel::abstract_panel(wxWindow *parent, wxWindowID id , const wxString &title , const wxPoint& pos , const wxSize& size, long style)
                : wxScrolledWindow(parent, id, pos, size, style|wxTAB_TRAVERSAL|wxHSCROLL,title) {
//	abstract_panel::expertModeEnadbled = false;
	SetScrollbars( 10, 10, 62, 62 );
	Layout();
}
示例#23
0
void ConfigDialogBase::do_layout()
{
    // begin wxGlade: ConfigDialogBase::do_layout
    wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL);
    wxBoxSizer* sizer_6 = new wxBoxSizer(wxHORIZONTAL);
    wxStaticBoxSizer* importExclusionSizer = new wxStaticBoxSizer(importExclusionSizer_staticbox, wxVERTICAL);
    wxBoxSizer* sizer_5 = new wxBoxSizer(wxHORIZONTAL);
    wxFlexGridSizer* grid_sizer_2 = new wxFlexGridSizer(3, 1, 8, 8);
    wxStaticBoxSizer* hotKeyGroupSizer = new wxStaticBoxSizer(hotKeyGroupSizer_staticbox, wxHORIZONTAL);
    wxFlexGridSizer* grid_sizer_3 = new wxFlexGridSizer(1, 4, 8, 8);
    wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL);
    wxFlexGridSizer* grid_sizer_1 = new wxFlexGridSizer(3, 2, 8, 8);
    wxBoxSizer* sizer_3 = new wxBoxSizer(wxHORIZONTAL);
    wxFlexGridSizer* generalGridSizer = new wxFlexGridSizer(6, 2, 8, 8);
    generalGridSizer->Add(languageLabel, 0, wxALIGN_CENTER_VERTICAL, 0);
    generalGridSizer->Add(languageComboBox, 0, wxEXPAND, 0);
    generalGridSizer->Add(label_1, 0, 0, 0);
    generalGridSizer->Add(alwaysOnTopCheckBox, 0, 0, 0);
    generalGridSizer->Add(label_2, 0, 0, 0);
    generalGridSizer->Add(oneInstanceCheckBox, 0, 0, 0);
    generalGridSizer->Add(label_5, 0, 0, 0);
    generalGridSizer->Add(installAutorunButton, 0, wxEXPAND, 0);
    generalGridSizer->Add(label_3, 0, 0, 0);
    generalGridSizer->Add(checkForUpdateButton, 0, wxEXPAND, 0);
    generalGridSizer->AddGrowableCol(1);
    sizer_3->Add(generalGridSizer, 1, wxALL|wxEXPAND, 10);
    notebook_1_pane_1->SetSizer(sizer_3);
    grid_sizer_1->Add(iconSizeLabel, 0, wxALIGN_CENTER_VERTICAL, 0);
    grid_sizer_1->Add(iconSizeComboBox, 0, wxEXPAND, 0);
    grid_sizer_1->Add(orientationLabel, 0, wxALIGN_CENTER_VERTICAL, 0);
    grid_sizer_1->Add(orientationComboBox, 0, wxEXPAND, 0);
    grid_sizer_1->Add(skinLabel, 0, wxALIGN_CENTER_VERTICAL, 0);
    grid_sizer_1->Add(skinComboBox, 0, wxEXPAND, 0);
    grid_sizer_1->AddGrowableCol(1);
    sizer_4->Add(grid_sizer_1, 1, wxALL|wxEXPAND, 10);
    notebook_pane_2->SetSizer(sizer_4);
    grid_sizer_2->Add(autohideCheckBox, 0, wxEXPAND, 0);
    grid_sizer_2->Add(multiLaunchAutoRunCheckBox, 0, wxEXPAND, 0);
    grid_sizer_3->Add(hotKeyCtrlCheckBox, 0, 0, 0);
    grid_sizer_3->Add(hotKeyAltCheckBox, 0, 0, 0);
    grid_sizer_3->Add(hotKeyShiftCheckBox, 0, 0, 0);
    grid_sizer_3->Add(hotKeyComboBox, 0, 0, 0);
    hotKeyGroupSizer->Add(grid_sizer_3, 1, wxALL|wxEXPAND, 6);
    grid_sizer_2->Add(hotKeyGroupSizer, 1, wxEXPAND, 0);
    grid_sizer_2->AddGrowableCol(0);
    sizer_5->Add(grid_sizer_2, 1, wxALL|wxEXPAND, 10);
    notebook_pane_3->SetSizer(sizer_5);
    importExclusionSizer->Add(importExclusionTextBox, 1, wxALL|wxEXPAND, 8);
    sizer_6->Add(importExclusionSizer, 1, wxALL|wxEXPAND, 8);
    notebook_pane_4->SetSizer(sizer_6);
    notebook->AddPage(notebook_1_pane_1, wxT("General"));
    notebook->AddPage(notebook_pane_2, wxT("Appearance"));
    notebook->AddPage(notebook_pane_3, wxT("Operations"));
    notebook->AddPage(notebook_pane_4, wxT("#Import#"));
    sizer_1->Add(notebook, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 4);
    sizer_2->Add(saveButton, 0, wxRIGHT|wxALIGN_BOTTOM, 8);
    sizer_2->Add(cancelButton, 0, wxALIGN_BOTTOM, 0);
    sizer_1->Add(sizer_2, 0, wxALL|wxALIGN_RIGHT, 10);
    SetSizer(sizer_1);
    Layout();
    // end wxGlade
}
示例#24
0
void CBOINCBaseView::PostUpdateSelection(){
    wxASSERT(m_pTaskPane);
    m_pTaskPane->UpdateControls();
    Layout();
}
示例#25
0
// Define a constructor for my canvas
ConsoleCanvas::ConsoleCanvas( wxWindow *frame )
{
    pbackBrush = NULL;
    m_bNeedClear = false;

long style = wxSIMPLE_BORDER | wxCLIP_CHILDREN;
#ifdef __WXOSX__
    style |= wxSTAY_ON_TOP;
#endif

    wxDialog::Create( frame, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, style );
    
    m_pParent = frame;

    m_pitemBoxSizerLeg = new wxBoxSizer( wxVERTICAL );

    pThisLegText = new wxStaticText( this, -1, _("This Leg") );
    pThisLegText->Fit();
    m_pitemBoxSizerLeg->Add( pThisLegText, 0, wxALIGN_CENTER_HORIZONTAL, 2 );


    wxFont *qFont = GetOCPNScaledFont(_("Dialog"));
    
    wxFont *pThisLegFont = FontMgr::Get().FindOrCreateFont( 10, wxFONTFAMILY_DEFAULT,
                                                          qFont->GetStyle(), wxFONTWEIGHT_BOLD, false,
                                                          qFont->GetFaceName() );
    pThisLegText->SetFont( *pThisLegFont );

    pXTE = new AnnunText( this, -1, _("Console Legend"), _("Console Value") );
    pXTE->SetALabel( _T("XTE") );
    m_pitemBoxSizerLeg->Add( pXTE, 1, wxALIGN_LEFT | wxALL, 2 );

    pBRG = new AnnunText( this, -1, _("Console Legend"), _("Console Value") );
    pBRG->SetALabel( _T("BRG") );
    m_pitemBoxSizerLeg->Add( pBRG, 1, wxALIGN_LEFT | wxALL, 2 );

    pVMG = new AnnunText( this, -1, _("Console Legend"), _("Console Value") );
    pVMG->SetALabel( _T("VMG") );
    m_pitemBoxSizerLeg->Add( pVMG, 1, wxALIGN_LEFT | wxALL, 2 );

    pRNG = new AnnunText( this, -1, _("Console Legend"), _("Console Value") );
    pRNG->SetALabel( _T("RNG") );
    m_pitemBoxSizerLeg->Add( pRNG, 1, wxALIGN_LEFT | wxALL, 2 );

    pTTG = new AnnunText( this, -1, _("Console Legend"), _("Console Value") );
    pTTG->SetALabel( _T("TTG") );
    m_pitemBoxSizerLeg->Add( pTTG, 1, wxALIGN_LEFT | wxALL, 2 );

//    Create CDI Display Window

    pCDI = new CDI( this, -1, wxSIMPLE_BORDER, _T("CDI") );
    m_pitemBoxSizerLeg->AddSpacer( 5 );
    m_pitemBoxSizerLeg->Add( pCDI, 0, wxALL | wxEXPAND, 2 );

    SetSizer( m_pitemBoxSizerLeg );      // use the sizer for layout
    m_pitemBoxSizerLeg->SetSizeHints( this );
    Layout();
    Fit();

    if( g_bShowRouteTotal )
        pThisLegText->SetLabel( _("Route") );
    else
        pThisLegText->SetLabel( _("This Leg") );
    
    Hide();
}
示例#26
0
EffectAutoDuckDialog::EffectAutoDuckDialog(EffectAutoDuck* effect,
   wxWindow *parent) : wxDialog(parent, -1, _("Auto Duck"),
                                wxDefaultPosition, wxDefaultSize)
{
   mEffect = effect;
   wxTextValidator vld(wxFILTER_NUMERIC);

   ShuttleGui S(this, eIsCreating);
   
   S.SetBorder(5);
   S.StartVerticalLay(true);
   {
      S.StartHorizontalLay(wxCENTER, false);
      {
         S.AddTitle(_("Auto Duck by Markus Meyer"));
      }
      S.EndHorizontalLay();

      S.StartHorizontalLay(wxCENTER, false);
      {
         // Add a little space
      }
      S.EndHorizontalLay();
      
      mPanel = (EffectAutoDuckPanel*)
         S.AddWindow(new EffectAutoDuckPanel(this, ID_PANEL));

      S.StartHorizontalLay(wxCENTER, false);
      {
         // Add a little space
      }
      S.EndHorizontalLay();

      S.StartMultiColumn(6, wxCENTER);
      {
         mDuckAmountDbBox = S.Id(ID_DUCK_AMOUNT_DB).AddTextBox(
            _("Duck amount:"),
            Internat::ToDisplayString(mEffect->mDuckAmountDb), 10);
         S.AddUnits(_("dB"));
         mDuckAmountDbBox->SetValidator(vld);
        
         mMaximumPauseBox = S.Id(ID_MAXIMUM_PAUSE).AddTextBox(
            _("Maximum pause:"),
            Internat::ToDisplayString(mEffect->mMaximumPause), 10);
         S.AddUnits(_("seconds"));
         mMaximumPauseBox->SetValidator(vld);

         mOuterFadeDownLenBox = S.Id(ID_OUTER_FADE_DOWN_LEN).AddTextBox(
            _("Outer fade down length:"),
            Internat::ToDisplayString(mEffect->mOuterFadeDownLen), 10);
         S.AddUnits(_("seconds"));
         mOuterFadeDownLenBox->SetValidator(vld);
         
         mOuterFadeUpLenBox = S.Id(ID_OUTER_FADE_UP_LEN).AddTextBox(
            _("Outer fade up length:"),
            Internat::ToDisplayString(mEffect->mOuterFadeUpLen), 10);
         S.AddUnits(_("seconds"));
         mOuterFadeUpLenBox->SetValidator(vld);

         mInnerFadeDownLenBox = S.Id(ID_INNER_FADE_DOWN_LEN).AddTextBox(
            _("Inner fade down length:"),
            Internat::ToDisplayString(mEffect->mInnerFadeDownLen), 10);
         S.AddUnits(_("seconds"));
         mInnerFadeDownLenBox->SetValidator(vld);
         
         mInnerFadeUpLenBox = S.Id(ID_INNER_FADE_UP_LEN).AddTextBox(
            _("Inner fade up length:"),
            Internat::ToDisplayString(mEffect->mInnerFadeUpLen), 10);
         S.AddUnits(_("seconds"));
         mInnerFadeUpLenBox->SetValidator(vld);
      }
      S.EndMultiColumn();
      
      S.StartMultiColumn(3, wxCENTER);
      {
         mThresholdDbBox = S.Id(ID_THRESHOLD_DB).AddTextBox(
            _("Threshold:"),
            Internat::ToDisplayString(mEffect->mThresholdDb), 10);
         S.AddUnits(_("dB"));
         mThresholdDbBox->SetValidator(vld);
      }
      S.EndMultiColumn();

   }
   S.EndVerticalLay();

   S.AddStandardButtons();

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();
}
示例#27
0
void wxRibbonGallery::OnSize(wxSizeEvent& WXUNUSED(evt))
{
    Layout();
}
示例#28
0
void SkeinWindow::SetSkein(Skein* skein)
{
  m_skein = skein;
  m_skein->AddListener(this);
  Layout(false);
}
示例#29
0
ColocalizationDlg::ColocalizationDlg(wxWindow* frame,
	wxWindow* parent) :
wxPanel(parent, wxID_ANY,
wxPoint(500, 150), wxSize(400, 165),
0, "ColocalizationDlg"),
m_frame(parent),
m_view(0),
m_vol_a(0),
m_vol_b(0)
{
	SetEvtHandlerEnabled(false);
	Freeze();

	//validator: integer
	wxIntegerValidator<unsigned int> vald_int;

	wxStaticText *st = 0;

	//operand A
	wxBoxSizer *sizer_1 = new wxBoxSizer(wxHORIZONTAL);
	st = new wxStaticText(this, 0, "Volume A:",
		wxDefaultPosition, wxSize(75, 20));
	m_calc_load_a_btn = new wxButton(this, ID_CalcLoadABtn, "Load",
		wxDefaultPosition,wxSize(75, 20));
	m_calc_a_text = new wxTextCtrl(this, ID_CalcAText, "",
		wxDefaultPosition, wxSize(200, 20));
	sizer_1->Add(10, 10);
	sizer_1->Add(st, 0, wxALIGN_CENTER);
	sizer_1->Add(m_calc_load_a_btn, 0, wxALIGN_CENTER);
	sizer_1->Add(m_calc_a_text, 1, wxEXPAND);
	sizer_1->Add(10, 10);
	//operand B
	wxBoxSizer *sizer_2 = new wxBoxSizer(wxHORIZONTAL);
	st = new wxStaticText(this, 0, "Volume B:",
		wxDefaultPosition, wxSize(75, 20));
	m_calc_load_b_btn = new wxButton(this, ID_CalcLoadBBtn, "Load",
		wxDefaultPosition, wxSize(75, 20));
	m_calc_b_text = new wxTextCtrl(this, ID_CalcBText, "",
		wxDefaultPosition, wxSize(75, 20));
	sizer_2->Add(10, 10);
	sizer_2->Add(st, 0, wxALIGN_CENTER);
	sizer_2->Add(m_calc_load_b_btn, 0, wxALIGN_CENTER);
	sizer_2->Add(m_calc_b_text, 1, wxEXPAND);
	sizer_2->Add(10, 10);
	//min size
	wxBoxSizer *sizer_3 = new wxBoxSizer(wxHORIZONTAL);
	st = new wxStaticText(this, 0, "Min Size:",
		wxDefaultPosition, wxSize(75, 20));
	m_min_size_sldr = new wxSlider(this, ID_MinSizeSldr, 10, 0, 100,
		wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL);
	m_min_size_text = new wxTextCtrl(this, ID_MinSizeText, "10",
		wxDefaultPosition, wxSize(75, 20), 0, vald_int);
	sizer_3->Add(10, 10);
	sizer_3->Add(st, 0, wxALIGN_CENTER);
	sizer_3->Add(m_min_size_sldr, 1, wxEXPAND);
	sizer_3->Add(m_min_size_text, 0, wxALIGN_CENTER);
	sizer_3->Add(10, 10);
	//max size
	wxBoxSizer *sizer_4 = new wxBoxSizer(wxHORIZONTAL);
	st = new wxStaticText(this, 0, "Max Size:",
		wxDefaultPosition, wxSize(75, 20));
	m_max_size_sldr = new wxSlider(this, ID_MaxSizeSldr, 101, 1, 101,
		wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL);
	m_max_size_text = new wxTextCtrl(this, ID_MaxSizeText, "Ignored",
		wxDefaultPosition, wxSize(75, 20), 0, vald_int);
	sizer_4->Add(10, 10);
	sizer_4->Add(st, 0, wxALIGN_CENTER);
	sizer_4->Add(m_max_size_sldr, 1, wxEXPAND);
	sizer_4->Add(m_max_size_text, 0, wxALIGN_CENTER);
	sizer_4->Add(10, 10);
	//select and calculate
	wxBoxSizer *sizer_5 = new wxBoxSizer(wxHORIZONTAL);
	m_select_both_chk = new wxCheckBox(this, ID_BrushSelectBothChk, "Select Both: ",
		wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
	m_colocalization_btn = new wxButton(this, ID_CalcColocalizationBtn, "Colocalization",
		wxDefaultPosition, wxDefaultSize);
	sizer_5->Add(10, 10);
	sizer_5->Add(m_select_both_chk, 0, wxALIGN_CENTER);
	sizer_5->AddStretchSpacer(1);
	sizer_5->Add(m_colocalization_btn, 0, wxALIGN_CENTER);
	sizer_5->Add(10, 10);

	wxBoxSizer *sizerV = new wxBoxSizer(wxVERTICAL);
	sizerV->Add(10, 10);
	sizerV->Add(sizer_1, 0, wxEXPAND);
	sizerV->Add(10, 10);
	sizerV->Add(sizer_2, 0, wxEXPAND);
	sizerV->Add(10, 10);
	sizerV->Add(sizer_3, 0, wxEXPAND);
	sizerV->Add(10, 10);
	sizerV->Add(sizer_4, 0, wxEXPAND);
	sizerV->Add(10, 10);
	sizerV->Add(sizer_5, 0, wxEXPAND);
	
	SetSizer(sizerV);
	Layout();

	Thaw();
	SetEvtHandlerEnabled(true);
}
示例#30
0
SpringOptionsTab::SpringOptionsTab( wxWindow* parent )
    : wxScrolledWindow( parent, -1 )
{
	m_dontsearch_chkbox = new wxCheckBox( this, SPRING_DONTSEARCH, _("Search only in current installed path"), wxDefaultPosition, wxSize(-1,CONTROL_HEIGHT) );
	m_dontsearch_chkbox->SetValue( sett().GetSearchSpringOnlyInSLPath() );
	m_oldlaunch_chkbox = new wxCheckBox( this, SPRING_DONTSEARCH, _("Use old launch method"), wxDefaultPosition, wxSize(-1,CONTROL_HEIGHT) );
	m_oldlaunch_chkbox->SetValue( sett().UseOldSpringLaunchMethod() );
#ifndef __WXMSW__
	m_dontsearch_chkbox->Disable();
	m_oldlaunch_chkbox->Disable();
#endif
	/* ================================
	 * Spring executable
	 */
	m_exec_box = new wxStaticBox( this, -1, _( "Spring executable" ) );

	m_exec_loc_text = new wxStaticText( this, -1, _( "Location" ) );
	m_exec_edit = new wxTextCtrl( this, -1, sett().GetCurrentUsedSpringBinary() );
	m_exec_browse_btn = new wxButton( this, SPRING_EXECBROWSE, _( "Browse" ) );
	m_exec_find_btn = new wxButton( this, SPRING_EXECFIND, _( "Find" ) );

	/* ================================
	 * UnitSync
	 */
	m_sync_box = new wxStaticBox( this, -1, _( "UnitSync library" ) );

	m_sync_edit = new wxTextCtrl( this, -1, sett().GetCurrentUsedUnitSync() );
	m_sync_loc_text = new wxStaticText( this, -1, _( "Location" ) );
	m_sync_browse_btn = new wxButton( this, SPRING_SYNCBROWSE, _( "Browse" ) );
	m_sync_find_btn = new wxButton( this, SPRING_SYNCFIND, _( "Find" ) );

	m_auto_btn = new wxButton( this, SPRING_AUTOCONF, _( "Auto Configure" ) );
	m_datadir_btn = new wxButton( this, SPRING_DATADIR, _( "Change Datadir path" ) );

	m_main_sizer = new wxBoxSizer( wxVERTICAL );
	m_aconf_sizer = new wxBoxSizer( wxVERTICAL );
	m_exec_loc_sizer = new wxBoxSizer( wxHORIZONTAL );
	m_sync_loc_sizer = new wxBoxSizer( wxHORIZONTAL );

	m_exec_loc_sizer->Add( m_exec_loc_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2 );
	m_exec_loc_sizer->Add( m_exec_edit, 1, wxEXPAND );
	m_exec_loc_sizer->Add( m_exec_browse_btn );
	m_exec_loc_sizer->Add( m_exec_find_btn );

	m_sync_loc_sizer->Add( m_sync_loc_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2 );
	m_sync_loc_sizer->Add( m_sync_edit, 1, wxEXPAND );
	m_sync_loc_sizer->Add( m_sync_browse_btn );
	m_sync_loc_sizer->Add( m_sync_find_btn );

	m_exec_box_sizer = new wxStaticBoxSizer( m_exec_box, wxVERTICAL );
	m_sync_box_sizer = new wxStaticBoxSizer( m_sync_box, wxVERTICAL );

	m_exec_box_sizer->Add( m_exec_loc_sizer, 0, wxEXPAND | wxALL, 2 );

	m_sync_box_sizer->Add( m_sync_loc_sizer, 0, wxEXPAND | wxALL, 2 );

	m_aconf_sizer->AddStretchSpacer();
	m_aconf_sizer->Add( m_auto_btn );
	m_aconf_sizer->Add( m_datadir_btn );

	m_main_sizer->Add( m_dontsearch_chkbox, 0, wxEXPAND | wxALL, 5 );
	m_main_sizer->Add( m_exec_box_sizer, 0, wxEXPAND | wxALL, 5 );
	m_main_sizer->Add( m_sync_box_sizer, 0, wxEXPAND | wxALL, 5 );
	m_main_sizer->Add( m_oldlaunch_chkbox, 0, wxEXPAND | wxALL, 5 );
	m_main_sizer->Add( m_aconf_sizer, 0, wxEXPAND | wxALL, 5 );
	m_main_sizer->AddStretchSpacer();

	SetSizer( m_main_sizer );

	SetScrollRate( SCROLL_RATE, SCROLL_RATE );

	Layout();

	DoRestore();

	if ( sett().IsPortableMode() || sett().GetSearchSpringOnlyInSLPath() )
	{
		m_exec_box->Disable();
		m_sync_box->Disable();
		m_auto_btn->Disable();
		m_datadir_btn->Disable();
	}

	if ( sett().IsFirstRun() )
	{
		sett().SetSpringBinary( sett().GetCurrentUsedSpringIndex(), m_exec_edit->GetValue() );
		sett().SetUnitSync( sett().GetCurrentUsedSpringIndex(), m_sync_edit->GetValue() );
		sett().SetSearchSpringOnlyInSLPath( m_dontsearch_chkbox->IsChecked() );
	}

}