/*---------------------------------------------------------------------------*/
void wxPrefDlg::CreatePanelSyntax()
{
   wxPanel* panelSyntax = new wxPanel(GetBookCtrl(), ID_PANEL_SYNTAX,
                                      wxDefaultPosition, wxDefaultSize,
                                      wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
   wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
   panelSyntax->SetSizer(bSizer1);

   wxBoxSizer* bSizer2 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer2, 0, wxGROW, 0);
   wxStaticText* sText1 = new wxStaticText(panelSyntax, wxID_STATIC,
                                           _("Font : "), wxDefaultPosition,
                                           wxDefaultSize, 0);
   bSizer2->Add(sText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_Font = new wxFontPickerCtrl(panelSyntax, ID_FONT,
                                 wxFont(8, wxSWISS, wxNORMAL, wxNORMAL,
                                        false, wxT("Courier New")),
                                 wxDefaultPosition, wxDefaultSize,
                                 wxFNTP_DEFAULT_STYLE);
   bSizer2->Add(m_Font, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   // bSizer2->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer3, 0, wxALIGN_LEFT, 0);
   wxStaticText* sText2 = new wxStaticText(panelSyntax, wxID_STATIC,
                                           _("Items : "), wxDefaultPosition,
                                           wxDefaultSize, 0);
   bSizer3->Add(sText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxArrayString m_EdItemsStrings;
   m_EdItemsStrings.Add(_("Default"));
   m_EdItemsStrings.Add(_("Comment"));
   m_EdItemsStrings.Add(_("Comment One Line"));
   m_EdItemsStrings.Add(_("Number"));
   m_EdItemsStrings.Add(_("Key Word 1"));
   m_EdItemsStrings.Add(_("String"));
   m_EdItemsStrings.Add(_("Characters"));
   m_EdItemsStrings.Add(_("Operator"));
   m_EdItemsStrings.Add(_("Identifier"));
   m_EdItemsStrings.Add(_("Key Word 2"));
   m_EdItemsStrings.Add(_("Key Word 3"));
   m_EdItemsStrings.Add(_("Key Word 4"));
   m_EdItems = new wxChoice(panelSyntax, ID_ITEMS, wxDefaultPosition,
                            wxDefaultSize, m_EdItemsStrings, 0);
   m_EdItems->SetStringSelection(_("Default"));
   bSizer3->Add(m_EdItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxBoxSizer* bSizer4 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer4, 0, wxGROW, 0);
   m_Bold = new wxCheckBox(panelSyntax, ID_BOLD, _("Bold"), wxDefaultPosition,
                           wxDefaultSize, 0);
   m_Bold->SetValue(false);
   bSizer4->Add(m_Bold, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_Italic = new wxCheckBox(panelSyntax, ID_ITALIC, _("Italic"),
                             wxDefaultPosition, wxDefaultSize, 0);
   m_Italic->SetValue(false);
   bSizer4->Add(m_Italic, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_Underline = new wxCheckBox(panelSyntax, ID_UNDERLINE, _("Underline"),
                                wxDefaultPosition, wxDefaultSize, 0);
   m_Underline->SetValue(false);
   bSizer4->Add(m_Underline, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   //bSizer4->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxBoxSizer* bSizer5 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer5, 0, wxALIGN_LEFT, 0);
   wxStaticText* sText3 = new wxStaticText(panelSyntax, wxID_STATIC,
                                           _("Foreground :"), wxDefaultPosition,
                                           wxDefaultSize, 0);
   bSizer5->Add(sText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_ItemFG = new wxColourPickerCtrl(panelSyntax, ID_ITEMFORE,
                                     wxColour(0, 0, 0), wxDefaultPosition,
                                     wxDefaultSize,
                                     wxCLRP_DEFAULT_STYLE|wxCLRP_SHOW_LABEL);
   bSizer5->Add(m_ItemFG, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxStaticText* sText4 = new wxStaticText(panelSyntax, wxID_STATIC,
                                           _("Background  :"),
                                           wxDefaultPosition, wxDefaultSize, 0);
   bSizer5->Add(sText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_ItemBG = new wxColourPickerCtrl(panelSyntax, ID_ITEMBACK,
                                     wxColour(255, 255, 255), wxDefaultPosition,
                                     wxDefaultSize,
                                     wxCLRP_DEFAULT_STYLE|wxCLRP_SHOW_LABEL);
   bSizer5->Add(m_ItemBG, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxBoxSizer* bSizer6 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer6, 0, wxALIGN_LEFT, 0);
   m_CaseMixed = new wxRadioButton(panelSyntax, ID_CASEMIXED, _("Case Mixed"),
                                   wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
   m_CaseMixed->SetValue(true);
   bSizer6->Add(m_CaseMixed, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_CaseUpper = new wxRadioButton(panelSyntax, ID_CASEUPPER, _("Case Upper"),
                                   wxDefaultPosition, wxDefaultSize, 0);
   m_CaseUpper->SetValue(false);
   bSizer6->Add(m_CaseUpper, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   m_CaseLower = new wxRadioButton(panelSyntax, ID_CASELOWER, _("Case Lower"),
                                   wxDefaultPosition, wxDefaultSize, 0);
   m_CaseLower->SetValue(false);
   bSizer6->Add(m_CaseLower, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   wxBoxSizer* bSizer7 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
   m_EdSample = new wxSQLEditorBase(panelSyntax, ID_EDITSAMPLE,
                                    wxDefaultPosition, wxSize(350, 200));

   m_EdSample->SetText(_T("-- comment\nPRAGMA short_column_names = 1; \n/* comment */\nselect rowid, e.name, max(salary)\nfrom \"emp\" e\nwhere dept in (2, 4)\n\tand e.name <> 'Smith'\ngroup by dept;"));
   m_EdSample->SetReadOnly(true);
   bSizer7->Add(m_EdSample, 1, wxGROW|wxRIGHT, 0);

   // bSizer7->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   bSizer1->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

   wxBoxSizer* bSizer8 = new wxBoxSizer(wxHORIZONTAL);
   bSizer1->Add(bSizer8, 0, wxALIGN_RIGHT|wxALL, 5);
   wxButton* resetBtn = new wxButton(panelSyntax, ID_DEFAULTSYNTAX,
                                     _("Reset Default"), wxDefaultPosition,
                                     wxDefaultSize, 0);
   bSizer8->Add(resetBtn, 0, wxALIGN_CENTER_VERTICAL, 0);

   // bSizer8->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

   GetBookCtrl()->AddPage(panelSyntax, _("Syntax Highlight"));
}
Exemple #2
0
BattleRoomTab::BattleRoomTab( wxWindow* parent, Battle* battle )
    : wxScrolledWindow( parent, -1 ),
      m_battle( battle ),
      m_BattleActionSink( this, &UiEvents::GetUiEventSender( UiEvents::OnBattleActionEvent ))
{
    GetAui().manager->AddPane( this, wxLEFT, _T( "battleroomtab" ) );

    // Create all widgets
    m_splitter = new wxSplitterWindow( this, -1, wxDefaultPosition, wxSize( 100, 60 ) );

    m_player_panel = new wxScrolledWindow( m_splitter , -1 );
    m_player_panel->SetScrollRate( SCROLL_RATE, SCROLL_RATE );
    m_team_sel = new wxComboBox( m_player_panel, BROOM_TEAMSEL, _T( "1" ), wxDefaultPosition, wxSize( 50, CONTROL_HEIGHT ), team_choices );
    m_team_sel->SetToolTip( TE( _( "Players with the same team number share control of their units." ) ) );
    m_ally_sel = new wxComboBox( m_player_panel, BROOM_ALLYSEL, _T( "1" ), wxDefaultPosition, wxSize( 50, CONTROL_HEIGHT ), ally_choices );
    m_ally_sel->SetToolTip( TE( _( "Players with the same ally number work together to achieve victory." ) ) );
    m_color_sel = new ColorButton( m_player_panel, BROOM_COLOURSEL, wxColour (0,0,0), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_color_sel->SetToolTip( TE( _( "Select a color to identify your units in-game" ) ) );
    m_side_sel = new wxBitmapComboBox( m_player_panel, BROOM_SIDESEL, _T( "" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_side_sel->SetToolTip( TE( _( "Select your faction" ) ) );
    m_spec_chk = new wxCheckBox( m_player_panel, BROOM_SPEC, _( "Spectator" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_spec_chk->SetToolTip( TE( _( "Spectate (watch) the battle instead of playing" ) ) );
    m_ready_chk = new wxCheckBox( m_player_panel, BROOM_IMREADY, _( "I'm ready" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_ready_chk->SetToolTip( TE( _( "Click this if you are content with the battle settings." ) ) );

    m_team_lbl = new wxStaticText( m_player_panel, -1, _( "Team" ) );
    m_ally_lbl = new wxStaticText( m_player_panel, -1, _( "Ally" ) );
    m_color_lbl = new wxStaticText( m_player_panel, -1, _( "Color" ) );
    m_side_lbl = new wxStaticText( m_player_panel, -1, _( "Side" ) );

    m_player_count_lbl = new wxStaticText( m_player_panel, -1, wxString::Format( _( "Players: %d" ), 0 ) );
    m_spec_count_lbl = new wxStaticText( m_player_panel, -1, wxString::Format( _( "Spectators: %d" ), 0 ) );
    m_ally_setup_lbl = new wxStaticText( m_player_panel, -1, wxString::Format( _( "Setup: %s" ), _T("") ) );
    m_ok_count_lbl = new wxStaticText( m_player_panel, -1, wxString::Format( _( "Unready/Unsynced: %d" ), 0 ) );

    m_size_lbl = new wxStaticText( this, -1, _T( "" ) );
    m_wind_lbl = new wxStaticText( this, -1, _T( "" ) );
    m_tidal_lbl = new wxStaticText( this, -1, _T( "" ) );

    m_map_combo = new wxComboBox( this, BROOM_MAP_SEL, _T( "" ), wxDefaultPosition, wxDefaultSize );

    m_minimap = new MapCtrl( this, 162, m_battle, true, true, true, false );
    m_minimap->SetToolTip( TE( _( "A preview of the selected map.  You can see the starting positions, or (if set) starting boxes." ) ) );

    m_browse_map_btn = new wxButton( this, BROOM_MAP_BROWSE, _( "Map" ), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
    m_browse_map_btn->SetSize( m_browse_map_btn->GetSize().GetWidth() * 2 , m_browse_map_btn->GetSize().GetHeight() ) ; // has 0 effect

    m_players = new BattleroomListCtrl( m_player_panel, m_battle, false, true );
    m_chat = new ChatPanel( m_splitter, m_battle );

    m_command_line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );

    m_leave_btn = new wxButton( this, BROOM_LEAVE, _( "Leave" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_leave_btn->SetToolTip( TE( _( "Leave the battle and return to the battle list" ) ) );
    m_start_btn = new wxButton( this, BROOM_START, _( "Start" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_start_btn->SetToolTip( TE( _( "Start the battle" ) ) );

    m_manage_players_btn = new wxButton( this, BROOM_MANAGE_MENU, _( "Player Management" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_manage_players_btn->SetToolTip( TE( _( "Various functions to make team games simplers to setup" ) ) );

    m_addbot_btn = new wxButton( this, BROOM_ADDBOT, _( "Add Bot..." ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_addbot_btn->SetToolTip( TE( _( "Add a computer-controlled player to the game" ) ) );
    m_autolock_chk = new wxCheckBox( this, BROOM_AUTOLOCK, _( "Autolock on start" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_autolock_chk->SetToolTip( TE( _( "Automatically locks the battle when the game starts and unlock when it's finished." ) ) );
    m_autolock_chk->SetValue( sett().GetLastAutolockStatus() );

    m_lock_chk = new wxCheckBox( this, BROOM_LOCK, _( "Locked" ), wxDefaultPosition, wxSize( -1, CONTROL_HEIGHT ) );
    m_lock_chk->SetToolTip( TE( _( "Prevent additional players from joining the battle" ) ) );

    m_manage_users_mnu = new wxMenu();

    m_autohost_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_AUTOHOST, _( "Autohost" ), _( "Toggle autohost mode.  This allows players to control your battle using commands like '!balance' and '!start'." ), wxITEM_CHECK );
    m_manage_users_mnu->Append( m_autohost_mnu );
    m_autohost_mnu->Check( false );


    m_autopaste_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_AUTOPASTE, _( "AutoPaste Description" ), _( "Automatically paste battle's descriptoin when a new user joins" ), wxITEM_CHECK );
    m_manage_users_mnu->Append( m_autopaste_mnu );
    m_autopaste_mnu->Check( sett().GetBattleLastAutoAnnounceDescription() );
    m_autospec_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_AUTOSPECT, _( "AutoSpect" ), _( "Automatically spectate players that don't ready up or become synced within x seconds." ), wxITEM_CHECK );
    m_manage_users_mnu->Append( m_autospec_mnu );
    m_autospec_mnu->Check( sett().GetBattleLastAutoSpectTime() > 0 );
    m_autocontrol_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_AUTOCONTROL, _( "AutoControlBalance" ), _( "Automatically balance teams and allies and fix colors when all players are ready and synced" ), wxITEM_CHECK );
    m_manage_users_mnu->Append( m_autocontrol_mnu );
    m_autocontrol_mnu->Check( sett().GetBattleLastAutoControlState() );
    m_autostart_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_AUTOSTART, _( "AutoStart" ), _( "Automatically start the battle when all players are ready and synced" ), wxITEM_CHECK );
    m_manage_users_mnu->Append( m_autostart_mnu );
    m_autostart_mnu->Check( sett().GetBattleLastAutoStartState() );

    m_lock_balance_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_LOCK_BALANCE, _( "Lock Balance" ), _( "When activated, prevents anyone but the host to change team and ally" ), wxITEM_CHECK );
    m_manage_users_mnu->Append( m_lock_balance_mnu );
    m_lock_balance_mnu->Check( false );

    wxMenu* ring_menu = new wxMenu;
    wxMenuItem* ring_unready = new wxMenuItem( ring_menu, BROOM_RING_UNREADY, _( "Ring unready" ), _( "Rings all players that don't have ready status and aren't spectators" ) );
    ring_menu->Append( ring_unready );
    wxMenuItem* ring_unsynced = new wxMenuItem( ring_menu, BROOM_RING_UNSYNC, _( "Ring unsynced" ), _( "Rings all players that don't have sync status and aren't spectators" ) );
    ring_menu->Append( ring_unsynced );
    wxMenuItem* ring_unready_unsynced = new wxMenuItem( ring_menu, BROOM_RING_UNREADY_UNSYNC, _( "Ring unready and unsynced" ), _( "Rings all players that don't have sync status or don't have ready status and aren't spectators" ) );
    ring_menu->Append( ring_unready_unsynced );
    m_manage_users_mnu->Append( wxID_ANY, _( "Ring ..." ), ring_menu );

    wxMenu* spect_menu = new wxMenu;
    wxMenuItem* spect_unready = new wxMenuItem( spect_menu, BROOM_SPECT_UNREADY, _( "Spect unready" ), _( "Force to spectate all players that don't have ready status" ) );
    spect_menu->Append( spect_unready );
    wxMenuItem* spect_unsynced = new wxMenuItem( spect_menu, BROOM_SPECT_UNSYNC, _( "Spect unsynced" ), _( "Force to spectate all players that don't have sync status" ) );
    spect_menu->Append( spect_unsynced );
    wxMenuItem* spect_unready_unsynced = new wxMenuItem( spect_menu, BROOM_SPECT_UNREADY_UNSYNC, _( "Force to spectate unready and unsynced" ), _( "Rings all players that don't have sync status or don't have ready status" ) );
    spect_menu->Append( spect_unready_unsynced );
    m_manage_users_mnu->Append( wxID_ANY, _( "Force spectate ..." ), spect_menu );

    wxMenuItem* m_balance_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_BALANCE, _( "Balance alliances" ), _( "Automatically balance players into two or more alliances" ) );
    m_manage_users_mnu->Append( m_balance_mnu );

    wxMenuItem* m_fix_colours_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_FIXCOLOURS, _( "Fix colours" ), _( "Make player colors unique" ) );
    m_manage_users_mnu->Append( m_fix_colours_mnu );

    wxMenuItem* m_fix_team_mnu = new wxMenuItem( m_manage_users_mnu, BROOM_FIXID, _( "Balance teams" ), _( "Automatically balance players into control teams, by default none shares control" ) );
    m_manage_users_mnu->Append( m_fix_team_mnu );

    wxStaticBoxSizer* m_preset_sizer;
    m_preset_sizer = new wxStaticBoxSizer( new wxStaticBox( this, 0, _( "Manage Presets" ) ), wxVERTICAL );

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

    m_options_preset_sel = new wxComboBox( this, BROOM_PRESETSEL, _T(""), wxDefaultPosition, wxDefaultSize,  sett().GetPresetList(), wxCB_READONLY );
    m_options_preset_sel->SetToolTip( TE( _( "Load battle preset" ) ) );

    m_preset_sizer->Add( m_options_preset_sel, 0, wxEXPAND | wxALL );

    m_save_btn = new wxButton( this, BROOM_SAVEPRES, _( "Save" ), wxDefaultPosition, wxDefaultSize );
    m_save_btn->SetToolTip( TE( _( "Save a set of options." ) ) );

    m_preset_btns_sizer->Add( m_save_btn, 0, wxEXPAND );

    m_delete_btn = new wxButton( this, BROOM_DELETEPRES, _( "Delete" ), wxDefaultPosition, wxDefaultSize );
    m_delete_btn->SetToolTip( TE( _( "Delete a set of options." ) ) );

    m_preset_btns_sizer->Add( m_delete_btn, 0, wxEXPAND );

    m_default_btn = new wxButton( this, BROOM_SETDEFAULTPRES, _( "Set default" ), wxDefaultPosition, wxDefaultSize );
    m_default_btn->SetToolTip( TE( _( "Use the current set of options as mod's default." ) ) );

    m_preset_btns_sizer->Add( m_default_btn, 0, wxEXPAND );

    m_preset_sizer->Add( m_preset_btns_sizer, 0, wxEXPAND );


    m_opts_list = new wxListCtrl( this, BROOM_OPTIONLIST, wxDefaultPosition, wxDefaultSize, wxLC_NO_HEADER | wxLC_REPORT );
    //m_opts_list->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
    m_opts_list->SetFont( wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT ) );
    m_opts_list->SetToolTip( TE( _( "Activate an element to quickly change it" ) ) );
    wxListItem col;

    col.SetText( _( "Option" ) );
    m_opts_list->InsertColumn( 0, col );
    col.SetText( _( "Value" ) );
    m_opts_list->InsertColumn( 1, col );

    // Create Sizers
    m_players_sizer = new wxBoxSizer( wxVERTICAL );
    m_player_sett_sizer = new wxBoxSizer( wxHORIZONTAL );
    wxBoxSizer* m_map_select_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_info_sizer = new wxBoxSizer( wxVERTICAL );
    m_top_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_buttons_sizer = new wxBoxSizer( wxHORIZONTAL );
    //m_info1_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_main_sizer = new wxBoxSizer( wxVERTICAL );

    int side_sel_width = m_side_sel->GetWidestItemWidth();
    wxBoxSizer* m_side_sel_sizer = new wxBoxSizer( wxHORIZONTAL );
    m_side_sel_sizer->SetMinSize( side_sel_width, CONTROL_HEIGHT );
    m_side_sel_sizer->Add( m_side_sel, 1, wxEXPAND );

    // Put widgets in place
    m_player_sett_sizer->Add( m_team_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
    m_player_sett_sizer->Add( m_team_sel, 0, wxEXPAND | wxALL, 2 );
    m_player_sett_sizer->Add( m_ally_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
    m_player_sett_sizer->Add( m_ally_sel, 0, wxEXPAND | wxALL, 2 );
    m_player_sett_sizer->Add( m_color_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
    m_player_sett_sizer->Add( m_color_sel, 0, wxEXPAND | wxALL, 2 );
    m_player_sett_sizer->Add( m_side_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
    m_player_sett_sizer->Add( m_side_sel_sizer, 0, wxEXPAND | wxALL, 2 );
    m_player_sett_sizer->Add( m_spec_chk, 0, wxEXPAND | wxALL, 2 );
    m_player_sett_sizer->Add( m_ready_chk, 0, wxEXPAND | wxALL, 2 );
    m_player_sett_sizer->AddStretchSpacer();
    m_player_sett_sizer->Add( m_ally_setup_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 2 );
    m_player_sett_sizer->Add( m_player_count_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT  | wxALL, 2 );
    m_player_sett_sizer->Add( m_spec_count_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 2 );
    m_player_sett_sizer->Add( m_ok_count_lbl, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 2 );

    m_players_sizer->Add( m_players, 1, wxEXPAND );
    m_players_sizer->Add( m_player_sett_sizer, 0, wxEXPAND );

    m_player_panel->SetSizer( m_players_sizer );

    SplitSizerHorizontally( sett().GetSplitBRoomHorizontally() );

    //m_info1_sizer->Add( m_wind_lbl, 1, wxEXPAND );
    //m_info1_sizer->Add( m_size_lbl, 1, wxEXPAND );

    m_info_sizer->Add( m_minimap, 0, wxEXPAND );
    m_map_select_sizer->Add( m_map_combo, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL );
    m_map_select_sizer->Add( m_browse_map_btn, 0, wxALIGN_RIGHT );
    m_info_sizer->Add( m_map_select_sizer, 0, wxALL );
    //m_info_sizer->Add( m_info1_sizer, 0, wxEXPAND );
    //m_info_sizer->Add( m_tidal_lbl, 0, wxEXPAND );
    m_info_sizer->Add( m_opts_list, 1, wxEXPAND | wxTOP, 4 );
    m_info_sizer->Add( m_preset_sizer, 0, wxEXPAND, 4 );


    m_top_sizer->Add( m_splitter, 1, wxEXPAND | wxALL, 2 );
    m_top_sizer->Add( m_info_sizer, 0, wxEXPAND | wxALL, 2 );

    m_buttons_sizer->AddStretchSpacer();
    m_buttons_sizer->Add( m_leave_btn, 0, wxEXPAND | wxALL, 2 );
    m_buttons_sizer->Add( m_addbot_btn, 0, wxEXPAND | wxALL, 2 );
    m_buttons_sizer->Add( m_autolock_chk, 0, wxEXPAND | wxALL, 2 );
    m_buttons_sizer->Add( m_lock_chk, 0, wxEXPAND | wxALL, 2 );
    m_buttons_sizer->Add( m_manage_players_btn, 0, wxEXPAND | wxALL, 2 );
    m_buttons_sizer->Add( m_start_btn, 0, wxEXPAND | wxALL, 2 );

    m_main_sizer->Add( m_top_sizer, 1, wxEXPAND );
    m_main_sizer->Add( m_command_line, 0, wxEXPAND );
    m_main_sizer->Add( m_buttons_sizer, 0, wxEXPAND );

    m_splitter->SetMinimumPaneSize( 240 );

    SetBattle( battle );

    SetScrollRate( SCROLL_RATE, SCROLL_RATE );
    SetSizer( m_main_sizer );
    Layout();
    unsigned int widthfraction = m_opts_list->GetClientSize().GetWidth() / 3;
    m_opts_list->SetColumnWidth( 0, widthfraction * 1.95 );
    m_opts_list->SetColumnWidth( 1, widthfraction * 0.95 );

}
Exemple #3
0
MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent) 
	: wxFrame(parent, wxID_ANY, "Memory Viewer", wxDefaultPosition, wxSize(700, 450))
{
	exit = false;
	m_addr = 0;
	m_colcount = 16;
	m_rowcount = 16;

	this->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
	wxBoxSizer* s_panel = new wxBoxSizer(wxVERTICAL);

	//Tools
	wxBoxSizer* s_tools = new wxBoxSizer(wxHORIZONTAL);

	//Tools: Memory Viewer Options
	wxStaticBoxSizer* s_tools_mem = new wxStaticBoxSizer(wxHORIZONTAL, this, "Memory Viewer Options");

	wxStaticBoxSizer* s_tools_mem_addr = new wxStaticBoxSizer(wxHORIZONTAL, this, "Address");
	t_addr = new wxTextCtrl(this, wxID_ANY, "00000000", wxDefaultPosition, wxSize(60,-1));
	t_addr->SetMaxLength(8);
	s_tools_mem_addr->Add(t_addr);

	wxStaticBoxSizer* s_tools_mem_bytes = new wxStaticBoxSizer(wxHORIZONTAL, this, "Bytes");
	sc_bytes = new wxSpinCtrl(this, wxID_ANY, "16", wxDefaultPosition, wxSize(44,-1));
	sc_bytes->SetRange(1, 16);
	s_tools_mem_bytes->Add(sc_bytes);

	wxStaticBoxSizer* s_tools_mem_buttons = new wxStaticBoxSizer(wxHORIZONTAL, this, "Control");
	wxButton* b_fprev = new wxButton(this, wxID_ANY, "<<", wxDefaultPosition, wxSize(21, 21));
	wxButton* b_prev  = new wxButton(this, wxID_ANY, "<", wxDefaultPosition, wxSize(21, 21));
	wxButton* b_next  = new wxButton(this, wxID_ANY, ">", wxDefaultPosition, wxSize(21, 21));
	wxButton* b_fnext = new wxButton(this, wxID_ANY, ">>", wxDefaultPosition, wxSize(21, 21));
	s_tools_mem_buttons->Add(b_fprev);
	s_tools_mem_buttons->Add(b_prev);
	s_tools_mem_buttons->Add(b_next);
	s_tools_mem_buttons->Add(b_fnext);

	s_tools_mem->Add(s_tools_mem_addr);
	s_tools_mem->Add(s_tools_mem_bytes);
	s_tools_mem->Add(s_tools_mem_buttons);

	//Tools: Raw Image Preview Options
	wxStaticBoxSizer* s_tools_img = new wxStaticBoxSizer(wxHORIZONTAL, this, "Raw Image Preview");

	wxStaticBoxSizer* s_tools_img_size = new wxStaticBoxSizer(wxHORIZONTAL, this, "Size");
	sc_img_size_x = new wxSpinCtrl(this, wxID_ANY, "256", wxDefaultPosition, wxSize(60,-1));
	sc_img_size_y = new wxSpinCtrl(this, wxID_ANY, "256", wxDefaultPosition, wxSize(60,-1));
	s_tools_img_size->Add(sc_img_size_x);
	s_tools_img_size->Add(new wxStaticText(this, wxID_ANY, " x "));
	s_tools_img_size->Add(sc_img_size_y);

	sc_img_size_x->SetRange(1, 8192);
	sc_img_size_y->SetRange(1, 8192);

	wxStaticBoxSizer* s_tools_img_mode = new wxStaticBoxSizer(wxHORIZONTAL, this, "Mode");
	cbox_img_mode = new wxComboBox(this, wxID_ANY);
	cbox_img_mode->Append("RGB");
	cbox_img_mode->Append("ARGB");
	cbox_img_mode->Append("RGBA");
	cbox_img_mode->Append("ABGR");
	cbox_img_mode->Select(1); //ARGB
	s_tools_img_mode->Add(cbox_img_mode);

	s_tools_img->Add(s_tools_img_size);
	s_tools_img->Add(s_tools_img_mode);

	//Tools: Run tools
	wxStaticBoxSizer* s_tools_buttons = new wxStaticBoxSizer(wxVERTICAL, this, "Tools");
	wxButton* b_img = new wxButton(this, wxID_ANY, "View\nimage", wxDefaultPosition, wxSize(52,-1));
	s_tools_buttons->Add(b_img);

	//Tools: Tools = Memory Viewer Options + Raw Image Preview Options + Buttons
	s_tools->AddSpacer(10);
	s_tools->Add(s_tools_mem);
	s_tools->AddSpacer(10);
	s_tools->Add(s_tools_img);
	s_tools->AddSpacer(10);
	s_tools->Add(s_tools_buttons);
	s_tools->AddSpacer(10);

	//Memory Panel
	wxBoxSizer* s_mem_panel = new wxBoxSizer(wxHORIZONTAL);
	t_mem_addr  = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER|wxTE_READONLY);
	t_mem_hex   = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER|wxTE_READONLY);
	t_mem_ascii = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER|wxTE_READONLY);
	t_mem_addr->SetMinSize(wxSize(68, 228));
	t_mem_addr->SetForegroundColour(wxColour(75, 135, 150));
	
	t_mem_addr->SetScrollbar(wxVERTICAL, 0, 0, 0);
	t_mem_hex ->SetScrollbar(wxVERTICAL, 0, 0, 0);
	t_mem_ascii->SetScrollbar(wxVERTICAL, 0, 0, 0);
	t_mem_addr ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	t_mem_hex  ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	t_mem_ascii->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));

	s_mem_panel->AddSpacer(10);
	s_mem_panel->Add(t_mem_addr);
	s_mem_panel->Add(t_mem_hex);
	s_mem_panel->Add(t_mem_ascii);
	s_mem_panel->AddSpacer(10);

	//Memory Panel: Set size of the wxTextCtrl's
	int x, y;
	t_mem_hex->GetTextExtent(wxT("T"), &x, &y);
	t_mem_hex->SetMinSize(wxSize(x * 3*m_colcount + 6, 228));
	t_mem_hex->SetMaxSize(wxSize(x * 3*m_colcount + 6, 228));
	t_mem_ascii->SetMinSize(wxSize(x * m_colcount + 6, 228));
	t_mem_ascii->SetMaxSize(wxSize(x * m_colcount + 6, 228));

	//Merge and display everything
	s_panel->AddSpacer(10);
	s_panel->Add(s_tools);
	s_panel->AddSpacer(10);
	s_panel->Add(s_mem_panel, 0, 0, 100);
	s_panel->AddSpacer(10);
	SetSizerAndFit(s_panel);

	//Events
	t_addr  ->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsAddr, this);
	sc_bytes->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsBytes, this);
	t_addr  ->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsAddr, this);
	sc_bytes->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsBytes, this);
	sc_bytes->Bind(wxEVT_SPINCTRL,   &MemoryViewerPanel::OnChangeToolsBytes, this);

	b_prev ->Bind(wxEVT_BUTTON, &MemoryViewerPanel::Prev, this);
	b_next ->Bind(wxEVT_BUTTON, &MemoryViewerPanel::Next, this);
	b_fprev->Bind(wxEVT_BUTTON, &MemoryViewerPanel::fPrev, this);
	b_fnext->Bind(wxEVT_BUTTON, &MemoryViewerPanel::fNext, this);
	b_img  ->Bind(wxEVT_BUTTON, &MemoryViewerPanel::OnShowImage, this);

	t_mem_addr ->Bind(wxEVT_MOUSEWHEEL, &MemoryViewerPanel::OnScrollMemory, this);
	t_mem_hex  ->Bind(wxEVT_MOUSEWHEEL, &MemoryViewerPanel::OnScrollMemory, this);
	t_mem_ascii->Bind(wxEVT_MOUSEWHEEL, &MemoryViewerPanel::OnScrollMemory, this);
	
	//Fill the wxTextCtrl's
	ShowMemory();
};
Exemple #4
0
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#include <wx/font.h>
#include "DolphinWX/Debugger/DebuggerUIUtil.h"

// The default font
wxFont DebuggerFont = wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false, "monospace");

Exemple #5
0
void CDlgAbout::CreateControls() {    
////@begin CDlgAbout content construction
    CDlgAbout* itemDialog1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemDialog1->SetSizer(itemBoxSizer2);

    m_AboutBOINCTitleCtrl = new wxStaticText;
    m_AboutBOINCTitleCtrl->Create( itemDialog1, wxID_STATIC, _("BOINC Manager"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    m_AboutBOINCTitleCtrl->SetFont(wxFont(16, wxDEFAULT, wxNORMAL, wxBOLD, false, _T("")));
    itemBoxSizer2->Add(m_AboutBOINCTitleCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer4->Add(itemBoxSizer5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBitmap m_AboutBOINCLogoCtrlBitmap(wxNullBitmap);
    m_AboutBOINCLogoCtrl = new wxStaticBitmap;
    m_AboutBOINCLogoCtrl->Create( itemDialog1, wxID_STATIC, m_AboutBOINCLogoCtrlBitmap, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer5->Add(m_AboutBOINCLogoCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer7 = new wxFlexGridSizer(3, 2, 0, 0);
    itemBoxSizer4->Add(itemFlexGridSizer7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText8 = new wxStaticText;
    itemStaticText8->Create( itemDialog1, wxID_STATIC, _("Version:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

    wxStaticText* itemStaticText9 = new wxStaticText;
    itemStaticText9->Create( itemDialog1, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

    wxStaticText* itemStaticText10 = new wxStaticText;
    itemStaticText10->Create( itemDialog1, wxID_STATIC, _("wxWidgets Version:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

    wxStaticText* itemStaticText11 = new wxStaticText;
    itemStaticText11->Create( itemDialog1, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText11, 11, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

    wxStaticText* itemStaticText12 = new wxStaticText;
    itemStaticText12->Create( itemDialog1, wxID_STATIC, _("Copyright:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText12, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxLEFT|wxRIGHT, 5);

    wxStaticText* itemStaticText13 = new wxStaticText;
    itemStaticText13->Create( itemDialog1, wxID_STATIC, _("(C) 2003-2012 University of California, Berkeley.\nAll Rights Reserved."), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText13, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

    m_AboutBOINCSloganCtrl = new wxStaticText;
    m_AboutBOINCSloganCtrl->Create( itemDialog1, wxID_STATIC, _("Berkeley Open Infrastructure for Network Computing"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer2->Add(m_AboutBOINCSloganCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticText* itemStaticText14 = new wxStaticText;
    itemStaticText14->Create( itemDialog1, wxID_STATIC, _("Berkeley Open Infrastructure for Network Computing"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer2->Add(itemStaticText14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    m_AboutBOINCURLCtrl = new wxHyperlinkCtrl;
    m_AboutBOINCURLCtrl->Create( itemDialog1, ID_ABOUTBOINCLINK, wxT("http://boinc.berkeley.edu/"), wxT("http://boinc.berkeley.edu/"), wxDefaultPosition, wxDefaultSize, wxNO_BORDER | wxHL_ALIGN_CENTRE | wxHL_CONTEXTMENU );
    itemBoxSizer2->Add(m_AboutBOINCURLCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticLine* itemStaticLine15 = new wxStaticLine;
    itemStaticLine15->Create( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    itemBoxSizer2->Add(itemStaticLine15, 0, wxGROW|wxALL, 5);

    wxButton* itemButton16 = new wxButton;
    itemButton16->Create( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
    itemButton16->SetDefault();
    itemBoxSizer2->Add(itemButton16, 0, wxALIGN_RIGHT|wxALL, 5);

    // Set validators
    itemStaticText9->SetValidator( wxGenericValidator(& m_strVersion) );
    itemStaticText11->SetValidator( wxGenericValidator(& m_strWidgetsVersion) );
////@end CDlgAbout content construction
}
Exemple #6
0
void GRIBTable::InitGribTable( int zone, ArrayOfGribRecordSets *rsa )
{
    //init fonts and colours
    wxFont labelfont = wxFont( 10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
    wxFont timefont = wxFont( 9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
    wxFont datafont = wxFont( 9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL );

    wxColour colour, colour0, colour1;
    GetGlobalColor(_T("DILG1"), &colour);
    GetGlobalColor(_T("DILG0"), &colour0);
    GetGlobalColor(_T("DILG2"), &colour1);

    //populate "cursor position" display

    wxString l;
    l.Append(toSDMM_PlugIn(1, m_cursor_lat)).Append(_T("   "))
        .Append(toSDMM_PlugIn(2, m_cursor_lon));
    m_pCursorPosition->SetLabel(l);
    m_pCursorPosition->SetFont(wxFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
    m_pPositionText->SetFont(wxFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));

    //init row attr
    wxGridCellAttr *daysrow = new wxGridCellAttr();
    daysrow->SetFont(timefont);
    daysrow->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);

    wxGridCellAttr *timerow = new wxGridCellAttr();
    timerow->SetFont(timefont);
    timerow->SetBackgroundColour(colour);
    timerow->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);

    wxGridCellAttr *singledatarow = new wxGridCellAttr();
    singledatarow->SetFont(datafont);
    singledatarow->SetAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);

    wxGridCellAttr *doubledatarow = new wxGridCellAttr();
    doubledatarow->SetFont(datafont);
    doubledatarow->SetAlignment(wxALIGN_CENTRE, -1);

    //init labels
    m_pGribTable->SetLabelFont(labelfont);
    m_pGribTable->SetLabelBackgroundColour(colour);

    //create as columns as necessary
    m_pGribTable->AppendCols(rsa->GetCount());
    m_pGribTable->SetSelectionBackground(colour);
    m_pGribTable->SetSelectionForeground(m_pGribTable->GetDefaultCellTextColour());

    //init days row
    m_pGribTable->SetRowLabelValue(0, wxEmptyString);
    m_pGribTable->SetRowAttr(0, daysrow);

    //init time row
    m_pGribTable->SetRowLabelValue(1, wxEmptyString);
    m_pGribTable->SetRowAttr(1, timerow);

    //populate grib
    wxDateTime time, day, ptime;
    int nrows,dcol = 0;
    bool color = false;

    for(unsigned i = 0; i < rsa->GetCount(); i++ ) {
        time = rsa->Item(i).m_Reference_Time;
        day = time;
        if( i == 0 ) ptime = time;

        //populate and color 'day' row
        if( ptime.GetDateOnly() != day.GetDateOnly() ) {
            ptime = time;
            color = !color;
        }
        if( !color )
            m_pGribTable->SetCellBackgroundColour(0, i, colour0);
        else
            m_pGribTable->SetCellBackgroundColour(0, i, colour1);

        m_pGribTable->SetCellValue(0, i, GetTimeRowsStrings( day, zone , 1) );

        //populate 'time' row
        m_pGribTable->SetCellValue(1, i, GetTimeRowsStrings( rsa->Item(i).m_Reference_Time, zone , 0) );

        nrows = 2;

        m_pTimeset = m_pGDialog->GetTimeLineRecordSet(time);
        GribRecord **RecordArray = m_pTimeset->m_GribRecordPtrArray;

        //create and polulate wind data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_WIND_VX) != wxNOT_FOUND &&
            m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_WIND_VY) != wxNOT_FOUND) {
                AddDataRow( nrows, i, _("Wind"), doubledatarow );
                wxString wc(GetWind(RecordArray));
                //wind is a special case: if current unit is not bf ==> double speed display (current unit + bf)
                if(m_pGDialog->m_OverlaySettings.Settings[GribOverlaySettings::WIND].m_Units != GribOverlaySettings::BFS)
                    if(!wc.IsEmpty()) wc.Append(_T("\n")).Append(GetWindBf(RecordArray));
                //
                m_pGribTable->SetCellValue(nrows, i, wc);
                m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
                nrows++;
        }
        //create and polulate Pressure data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_PRESSURE) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("Pressure"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetPressure(RecordArray));
            nrows++;
        }
        //create and polulate Wind gusts data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_WIND_GUST) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("Wind Gust"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetWindGust(RecordArray));
            m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
            nrows++;
        }
        //create and polulate Waves data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_HTSIGW) != wxNOT_FOUND ||
            m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_WVDIR) != wxNOT_FOUND) {
                AddDataRow( nrows, i, _("Waves"), doubledatarow );
                m_pGribTable->SetCellValue(nrows, i, GetWaves(RecordArray));
                m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
                nrows++;
        }
        //create and polulate total rainfall data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_PRECIP_TOT) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("Rainfall"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetRainfall(RecordArray));
            m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
            nrows++;
        }
        //create and polulate total cloud control
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_CLOUD_TOT) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("Cloud Cover"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetCloudCover(RecordArray));
            m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
            nrows++;
        }
        //create and polulate the Air Temperature data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_AIR_TEMP) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("Air\nTemperature"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetAirTemp(RecordArray));
            m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
            nrows++;
        }
        //create and polulate the Sea Surface Temperature data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_SEA_TEMP) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("Sea\nTemperature"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetSeaTemp(RecordArray));
            m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
            nrows++;
        }
        //create and polulate the Convective Available Potential Energy (CAPE) data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_CAPE) != wxNOT_FOUND) {
            AddDataRow( nrows, i, _("CAPE"), singledatarow );
            m_pGribTable->SetCellValue(nrows, i, GetCAPE(RecordArray));
            m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
            nrows++;
        }
        //create and polulate the current data row
        if(m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_SEACURRENT_VX) != wxNOT_FOUND &&
            m_pGDialog->m_bGRIBActiveFile->m_GribIdxArray.Index(Idx_SEACURRENT_VY) != wxNOT_FOUND) {
                AddDataRow( nrows, i, _("Current"), doubledatarow );
                m_pGribTable->SetCellValue(nrows, i, GetCurrent(RecordArray));
                m_pGribTable->SetCellBackgroundColour(nrows, i, m_pDataCellsColour);
                nrows++;
        }

        m_pGribTable->AutoSizeColumn(i, false);

    }
    AutoSizeDataRows();
    m_pGribTable->SetGridCursor( m_pGribTable->GetNumberRows(), 0);     //put cursor outside the grid

    this->Fit();
    this->Refresh();
}
Exemple #7
0
InfoWindow::InfoWindow(const wxString& title, const wxString& message, unsigned int delay, unsigned int hysteresis)
            : wxInfoWindowBase(Manager::Get()->GetAppWindow(),
#if !wxUSE_POPUPWIN
              wxID_ANY, wxEmptyString, wxPoint(-21,-21), wxSize(20,20),
#endif
              wxSIMPLE_BORDER | wxWS_EX_TRANSIENT | wxCLIP_CHILDREN),
              m_timer(new wxTimer(this, 0)), status(0), m_delay(delay), ks(2)
    {
        my_message_iterator = active_messages.insert(active_messages.begin(), message);

        wxBoxSizer *bs = new wxBoxSizer(wxVERTICAL);

        wxWindow* o = 0;

        ForwardingTextControl *titleC = 0;

        if(platform::gtk)
        {
            wxBoxSizer *pbs = new wxBoxSizer(wxVERTICAL);
            wxPanel* pnl = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
            pnl->SetBackgroundColour(titleBackground);
            titleC = new ForwardingTextControl(pnl, -1, title, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
            pbs->Add(titleC, 0, wxALL|wxALIGN_CENTER, 5);
            pnl->SetSizer(pbs);
            pbs->SetSizeHints(pnl);
            o = pnl;
        }
        else
        {
            titleC = new ForwardingTextControl(this, -1, title, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
            titleC->SetBackgroundColour(titleBackground);
            o = titleC;
        }

        titleC->SetForegroundColour(*wxWHITE);
        titleC->SetFont(wxFont(11, wxSWISS, wxNORMAL, wxBOLD));
        bs->Add(o, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);

        ForwardingTextControl *text = new ForwardingTextControl(this, -1, message, wxDefaultPosition, wxDefaultSize, 0);
        text->SetBackgroundColour(textBackground);
        text->SetForegroundColour(textForeground);
        bs->Add(text, 0, wxALIGN_CENTER|wxALL, 12);
        SetBackgroundColour(textBackground);
        SetSizer(bs);
        bs->SetSizeHints(this);
        Layout();

        if(!platform::gtk)
        {
            // since we used a panel, no more bitmap :(
            new wxStaticBitmap(this, -1, wxBitmap(iBitmap), wxPoint(4, o->GetRect().GetBottom() - 9));
        }
        wxCoord w, h;
        GetClientSize(&w, &h);

        pos = stacker.StackMe(w);

        // setup variables first time we enter here
        if (screenWidth == -1)
            screenWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
        if (screenHeight == -1)
            screenHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);

        left = screenWidth - pos;
        hMin = screenHeight - h;
        top = screenHeight;

        Move(left, top);

        Show();
        m_timer->Start(hysteresis, false);
    };
RuleWizardContextExceptionPageBase::RuleWizardContextExceptionPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Context settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Programs been started by this application have the\nsame permissions / restrictions as the main application."), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( -1 );
	mainSizer->Add( questionLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	exceptionListLabel = new wxStaticText( this, wxID_ANY, _("Exceptions (programs started with own polcies):"), wxDefaultPosition, wxDefaultSize, 0 );
	exceptionListLabel->Wrap( -1 );
	mainSizer->Add( exceptionListLabel, 0, wxALL, 5 );
	
	exceptionList = new AnListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VIRTUAL );
	mainSizer->Add( exceptionList, 1, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* buttonSizer;
	buttonSizer = new wxBoxSizer( wxHORIZONTAL );
	
	addButton = new wxButton( this, wxID_ANY, _("Add..."), wxDefaultPosition, wxDefaultSize, 0 );
	addButton->SetToolTip( _("opens a file-choose-dialog and\nadds the result to the list") );
	
	buttonSizer->Add( addButton, 0, wxALL, 5 );
	
	
	buttonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	deleteButton = new wxButton( this, wxID_ANY, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
	deleteButton->SetToolTip( _("removes the selected entry from the list") );
	
	buttonSizer->Add( deleteButton, 0, wxALL, 5 );
	
	mainSizer->Add( buttonSizer, 0, wxEXPAND, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardContextExceptionPageBase::onAddButton ), NULL, this );
	deleteButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardContextExceptionPageBase::onDeleteButton ), NULL, this );
}
RuleWizardAlfPermissionPageBase::RuleWizardAlfPermissionPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Application Level Firewall settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	wxBoxSizer* inputSizer;
	inputSizer = new wxBoxSizer( wxVERTICAL );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Allow the application \"...\" the usage\nof network services (... functionality)?"), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( 400 );
	inputSizer->Add( questionLabel, 0, wxALL, 5 );
	
	
	inputSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	yesRadioButton = new wxRadioButton( this, wxID_ANY, _("Yes (without restrictions)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
	inputSizer->Add( yesRadioButton, 0, wxALL, 5 );
	
	defaultRadioButton = new wxRadioButton( this, wxID_ANY, _("restricted (default)"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( defaultRadioButton, 0, wxALL, 5 );
	
	wxBoxSizer* defaultSizer;
	defaultSizer = new wxBoxSizer( wxHORIZONTAL );
	
	
	defaultSizer->Add( 30, 0, 0, wxEXPAND, 5 );
	
	defaultLabel = new wxStaticText( this, wxID_ANY, _("Default services are allowed, any other network\naccess is asked on demand."), wxPoint( -1,-1 ), wxDefaultSize, 0 );
	defaultLabel->Wrap( -1 );
	defaultSizer->Add( defaultLabel, 0, wxALL, 5 );
	
	inputSizer->Add( defaultSizer, 0, wxEXPAND, 5 );
	
	restrictedRadioButton = new wxRadioButton( this, wxID_ANY, _("restricted"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( restrictedRadioButton, 0, wxALL, 5 );
	
	wxBoxSizer* restrictedSizer;
	restrictedSizer = new wxBoxSizer( wxHORIZONTAL );
	
	
	restrictedSizer->Add( 30, 0, 0, wxEXPAND, 5 );
	
	restrictedLabel = new wxStaticText( this, wxID_ANY, _("Settings may be configured on the next page."), wxPoint( -1,-1 ), wxDefaultSize, 0 );
	restrictedLabel->Wrap( -1 );
	restrictedSizer->Add( restrictedLabel, 0, wxALL, 5 );
	
	inputSizer->Add( restrictedSizer, 0, wxEXPAND, 5 );
	
	noRadioButton = new wxRadioButton( this, wxID_ANY, _("No (deny access of network resources)"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( noRadioButton, 0, wxALL, 5 );
	
	mainSizer->Add( inputSizer, 0, wxEXPAND, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	yesRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardAlfPermissionPageBase::onYesRadioButton ), NULL, this );
	defaultRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardAlfPermissionPageBase::onDefaultRadioButton ), NULL, this );
	restrictedRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardAlfPermissionPageBase::onRestrictedRadioButton ), NULL, this );
	noRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardAlfPermissionPageBase::onNoRadioButton ), NULL, this );
}
RuleWizardContextPageBase::RuleWizardContextPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Context settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	helpPage = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	helpPage->SetBackgroundColour( wxColour( 179, 177, 174 ) );
	
	wxBoxSizer* helpSizer;
	helpSizer = new wxBoxSizer( wxVERTICAL );
	
	helpLabel = new wxStaticText( helpPage, wxID_ANY, _("The context of an application is the conjunction of it's calling environment. This is the program which runs another one.\n\nIf you are creating policies for a laucher-application or a command shell we suggest the answer: \"no\".\n\nBut in case of the most applications \"yes' seems to be the best fit. "), wxDefaultPosition, wxDefaultSize, 0 );
	helpLabel->Wrap( 500 );
	helpSizer->Add( helpLabel, 0, wxALL, 5 );
	
	helpPage->SetSizer( helpSizer );
	helpPage->Layout();
	helpSizer->Fit( helpPage );
	mainSizer->Add( helpPage, 0, wxEXPAND | wxALL, 5 );
	
	wxBoxSizer* inputSizer;
	inputSizer = new wxBoxSizer( wxVERTICAL );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Programs started by this application have the same permissions / restrictions as the main program."), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( 400 );
	inputSizer->Add( questionLabel, 0, wxALL, 5 );
	
	
	inputSizer->Add( 0, 30, 1, wxEXPAND, 5 );
	
	yesRadioButton = new wxRadioButton( this, wxID_ANY, _("Yes (same permissions / restrictions)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
	inputSizer->Add( yesRadioButton, 0, wxALL, 5 );
	
	wxBoxSizer* exceptionSizer;
	exceptionSizer = new wxBoxSizer( wxHORIZONTAL );
	
	
	exceptionSizer->Add( 30, 0, 0, wxEXPAND, 5 );
	
	exceptionsCheckBox = new wxCheckBox( this, wxID_ANY, _("allow exceptions (-> next page)"), wxDefaultPosition, wxDefaultSize, 0 );
	
	exceptionsCheckBox->Enable( false );
	
	exceptionSizer->Add( exceptionsCheckBox, 0, wxALL, 5 );
	
	inputSizer->Add( exceptionSizer, 0, wxEXPAND, 5 );
	
	noRadioButton = new wxRadioButton( this, wxID_ANY, _("No (each executed program has its own policies)"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( noRadioButton, 0, wxALL, 5 );
	
	mainSizer->Add( inputSizer, 0, wxEXPAND, 5 );
	
	
	mainSizer->Add( 0, 0, 2, wxEXPAND, 5 );
	
	detailsPanel = new AnDetails( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("Details...") );
	wxBoxSizer* bSizer56;
	bSizer56 = new wxBoxSizer( wxVERTICAL );
	
	noSfsCheckbox = new wxCheckBox( detailsPanel, wxID_ANY, _("Disable SFS"), wxDefaultPosition, wxDefaultSize, 0 );
	
	noSfsCheckbox->SetToolTip( _("Activate it, if SFS should be disabled for this binary.") );
	
	bSizer56->Add( noSfsCheckbox, 0, wxALL, 5 );
	
	detailsPanel->SetSizer( bSizer56 );
	detailsPanel->Layout();
	bSizer56->Fit( detailsPanel );
	mainSizer->Add( detailsPanel, 1, wxEXPAND | wxALL, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	yesRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardContextPageBase::onYesRadioButton ), NULL, this );
	exceptionsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( RuleWizardContextPageBase::onExceptionsCheckBox ), NULL, this );
	noRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardContextPageBase::onNoRadioButton ), NULL, this );
	noSfsCheckbox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( RuleWizardContextPageBase::onSfsDisable ), NULL, this );
}
RuleWizardOverwritePolicyPageBase::RuleWizardOverwritePolicyPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("... settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	helpPage = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	helpPage->SetBackgroundColour( wxColour( 179, 177, 174 ) );
	
	wxBoxSizer* helpSizer;
	helpSizer = new wxBoxSizer( wxVERTICAL );
	
	helpLabel = new wxStaticText( helpPage, wxID_ANY, _("This is the mandatory help text ..."), wxDefaultPosition, wxDefaultSize, 0 );
	helpLabel->Wrap( 400 );
	helpSizer->Add( helpLabel, 1, wxALL|wxEXPAND, 5 );
	
	helpPage->SetSizer( helpSizer );
	helpPage->Layout();
	helpSizer->Fit( helpPage );
	mainSizer->Add( helpPage, 5, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* splitSizer;
	splitSizer = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* questionSizer;
	questionSizer = new wxBoxSizer( wxVERTICAL );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Overwrite existing policies?"), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( -1 );
	questionSizer->Add( questionLabel, 0, wxALL, 5 );
	
	yesRadioButton = new wxRadioButton( this, wxID_ANY, _("Yes (create new policies)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
	questionSizer->Add( yesRadioButton, 0, wxALL, 5 );
	
	noRadioButton = new wxRadioButton( this, wxID_ANY, _("No (keep existing policies)"), wxDefaultPosition, wxDefaultSize, 0 );
	questionSizer->Add( noRadioButton, 0, wxALL, 5 );
	
	splitSizer->Add( questionSizer, 45, wxEXPAND, 5 );
	
	alertIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
	splitSizer->Add( alertIcon, 10, wxALL|wxEXPAND, 5 );
	
	alertLabel = new wxStaticText( this, wxID_ANY, _("For this application\n... policies\nalready exists."), wxDefaultPosition, wxDefaultSize, 0 );
	alertLabel->Wrap( -1 );
	splitSizer->Add( alertLabel, 44, wxALL, 5 );
	
	mainSizer->Add( splitSizer, 0, wxEXPAND, 5 );
	
	
	mainSizer->Add( 0, 30, 1, wxEXPAND, 5 );
	
	policyLabel = new wxStaticText( this, wxID_ANY, _("existing policy for \"...\":"), wxDefaultPosition, wxDefaultSize, 0 );
	policyLabel->Wrap( -1 );
	mainSizer->Add( policyLabel, 0, wxALL, 5 );
	
	policyTextCtrl = new wxTextCtrl( this, wxID_ANY, _("/* apn policy */"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
	mainSizer->Add( policyTextCtrl, 6, wxALL|wxEXPAND, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	yesRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardOverwritePolicyPageBase::onYesRadioButton ), NULL, this );
	noRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardOverwritePolicyPageBase::onNoRadioButton ), NULL, this );
}
Exemple #12
0
OutputConsole::OutputConsole(const char *title, int style,
                             MenuBarMaker *menuBarMaker)
    : wxFrame(NULL, wxID_ANY, title, wxPoint(50, 50), wxDefaultSize,
              wxDEFAULT_FRAME_STYLE) {
  menuBarMaker_ = menuBarMaker;
  outerSizer_ = new wxBoxSizer(wxVERTICAL);
  output_ = new wxTextCtrl(this, wxID_ANY, "", wxPoint(0, 0),
      wxSize(650, 450), wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP,
      wxDefaultValidator);
  outerSizer_->Add(output_, 1, wxEXPAND);
  style_ = style;
  gfxCheckBox_ = 0;
  abortButton_ = 0;
  if (style != CONSOLE_PLAIN) {
    wxBoxSizer *bottomSizer = new wxBoxSizer(wxHORIZONTAL);
    wxPanel *bottomPanel = new wxPanel(this);
    bottomSizer->AddStretchSpacer(1);
    if (style == CONSOLE_SHIP_STAGE) {
      gfxCheckBox_ = new wxCheckBox(bottomPanel, wxID_ANY, "Enable Gfx");
      bottomSizer->Add(gfxCheckBox_, 0, wxALIGN_RIGHT | wxALL, 4);
    } else if (style == CONSOLE_RUNNER) {
      // On Windows/Mac, it's not picking up the cmd/alt up to hide the hotkey,
      // so just displaying it all the time for now.
#ifdef __WXOSX__
      abortButton_ = new wxButton(bottomPanel, wxID_ANY, "Abo&rt \u2318R");
#elif defined(__WINDOWS__)
      abortButton_ = new wxButton(bottomPanel, wxID_ANY, "Abo&rt  alt-R");
#else
      abortButton_ = new wxButton(bottomPanel, wxID_ANY, "    Abo&rt    ");
#endif
      bottomSizer->Add(abortButton_, 0, wxALIGN_RIGHT | wxALL, 4);
    }
    bottomPanel->SetSizerAndFit(bottomSizer);
    outerSizer_->Add(bottomPanel, 0, wxEXPAND);
  }
  listener_ = 0;
  menusInitialized_ = false;

#ifdef __WINDOWS__
  SetIcon(wxIcon(resourcePath() + BERRYBOTS_ICO, wxBITMAP_TYPE_ICO));
#elif defined(__WXGTK__)
  SetIcon(wxIcon(resourcePath() + BBICON_128, wxBITMAP_TYPE_PNG));
#endif

#ifdef __WXOSX__
  defaultFontSize_ = 12;
#elif defined(__WINDOWS__)
  defaultFontSize_ = 9;
#else
  defaultFontSize_ = 10;
#endif

  fontSize_ = defaultFontSize_;
  output_->SetFont(wxFont(fontSize_, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
                          wxFONTWEIGHT_NORMAL));
  SetSizerAndFit(outerSizer_);


  Connect(this->GetId(), wxEVT_ACTIVATE,
          wxActivateEventHandler(OutputConsole::onActivate));
  Connect(this->GetId(), wxEVT_CLOSE_WINDOW,
          wxCommandEventHandler(OutputConsole::onClose));
  if (style == CONSOLE_SHIP_STAGE) {
    Connect(gfxCheckBox_->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED,
            wxCommandEventHandler(OutputConsole::onCheck));
  } else if (style == CONSOLE_RUNNER) {
    Connect(abortButton_->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
            wxCommandEventHandler(OutputConsole::onAbort));
  }
  
  eventFilter_ = new OutputConsoleEventFilter(this);
  this->GetEventHandler()->AddFilter(eventFilter_);
}
BattleMapTab::BattleMapTab( wxWindow* parent, IBattle* battle )
    : wxScrolledWindow( parent, -1 ),
	m_battle( battle )
{
	GetAui().manager->AddPane( this, wxLEFT, _T( "battlemaptab" ) );

	wxBoxSizer* m_main_sizer = new wxBoxSizer( wxHORIZONTAL );
	wxBoxSizer* m_map_sizer = new wxBoxSizer( wxVERTICAL );

	m_map_sizer->SetMinSize( wxSize( 352, -1 ) );
	m_minimap = new MapCtrl( this, 352, m_battle, true, true, false );

	m_minimap->SetMinSize( wxSize( 352, 352 ) );

	m_map_sizer->Add( m_minimap, 1, wxALL | wxEXPAND, 2 );

	wxBoxSizer* m_selmap_sizer = new wxBoxSizer( wxHORIZONTAL );

	m_map_combo = new wxChoice( this, BMAP_MAP_SEL, wxDefaultPosition, wxDefaultSize );
	m_selmap_sizer->Add( m_map_combo, 1, wxALL, 2 );

	m_browse_btn = new wxButton( this, BMAP_MAP_BROWSE, _( "Select" ), wxDefaultPosition, wxDefaultSize, 0 );

	m_selmap_sizer->Add( m_browse_btn, 0, wxALL, 2 );

	m_map_sizer->Add( m_selmap_sizer, 0, wxEXPAND, 5 );

	m_main_sizer->Add( m_map_sizer, 1, wxEXPAND, 5 );

	wxBoxSizer* m_opts_sizer = new wxBoxSizer( wxVERTICAL );

	//m_opts_sizer->SetMinSize(wxSize( 200,-1 ));
	m_map_opts_list = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxSize( 150, 160 ), wxLC_NO_HEADER | wxLC_REPORT );
	m_map_opts_list->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
	m_map_opts_list->SetFont( wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT ) );

	wxListItem col;

	col.SetText( _( "Option" ) );
	m_map_opts_list->InsertColumn( 0, col );
	col.SetText( _( "Value" ) );
	m_map_opts_list->InsertColumn( 1, col );
	m_map_opts_list->SetColumnWidth( 0, 90 );
	m_map_opts_list->SetColumnWidth( 1, 50 );

	m_map_opts_list->InsertItem( 0, _( "Size" ) );
	m_map_opts_list->InsertItem( 1, _( "Windspeed" ) );
	m_map_opts_list->InsertItem( 2, _( "Tidal strength" ) );
	m_map_opts_list->InsertItem( 3, _( "Gravity" ) );
	m_map_opts_list->InsertItem( 4, _( "Extractor radius" ) );
	m_map_opts_list->InsertItem( 5, _( "Max metal" ) );

	m_opts_sizer->Add( m_map_opts_list, 0, wxALL, 2 );


	wxString m_start_radiosChoices[] = { _( "Fixed" ), _( "Random" ), _( "Choose in game" ), _( "Chose before game" ) };
	int m_start_radiosNChoices = sizeof( m_start_radiosChoices ) / sizeof( wxString );
	//TODO these need to be tooltipped, no idea how yet
	m_start_radios = new wxRadioBox( this, BMAP_START_TYPE, _( "Startpositions" ), wxDefaultPosition, wxSize( 150, -1 ), m_start_radiosNChoices, m_start_radiosChoices, 1, wxRA_SPECIFY_COLS );

	m_opts_sizer->Add( m_start_radios, 0, wxALL, 2 );

	m_map_desc = new wxStaticText(this,-1,wxEmptyString);
    m_map_desc->Wrap(160);

    m_opts_sizer->Add( m_map_desc, 0, wxALL, 2 );

	m_main_sizer->Add( m_opts_sizer, 0, wxEXPAND, 5 );
	//m_main_sizer->AddStretchSpacer();
	SetSizer( m_main_sizer );
	Layout();

	SetBattle( battle );

	SetScrollRate( SCROLL_RATE, SCROLL_RATE );
	Layout();
	ConnectGlobalEvent(this, GlobalEvent::OnUnitsyncReloaded, wxObjectEventFunction(&BattleMapTab::OnUnitsyncReloaded));
}
Exemple #14
0
void
MyApp::SetupConfig()
{
    wxFileName configFile(GetConfigFile());
    wxLogDebug(_T("Config file: %s"), configFile.GetFullPath().c_str());

    /*
    // Create a blank file it it doesn't exist
    if (! configFile.FileExists())
        wxFile(configFile.GetFullPath(), wxFile::write);
    */

    // Setup wxFileConfig
    if (configFile.FileExists())
    {
        wxFileInputStream fileStream(configFile.GetFullPath());
        wxFileConfig::Set( new wxFileConfig(fileStream) );
    }
    else
    {
        wxFileConfig::Set( new wxFileConfig() );
    }

    // Setup our config manager
    //-------------------------
    m_config.SetConfig(wxFileConfig::Get());

    // Window size/position defaults
    m_config.SetPath(_T("/Window"));
    m_config.AddLong(_T("top"),       20);
    m_config.AddLong(_T("left"),      20);
    m_config.AddLong(_T("width"),     500);
    m_config.AddLong(_T("height"),    500);
    m_config.AddBool(_T("maximized"), false);

    // Grid style, fonts, and colors
    m_config.SetPath(_T("/Grid"));
    m_config.AddBool(_T("fit"),       false);
    m_config.AddLong(_T("style"),     DEFAULT_GRID_STYLE);
    m_config.AddFont(_T("letterFont"),      *wxSWISS_FONT);
    m_config.AddFont(_T("numberFont"),      *wxSWISS_FONT);
    m_config.AddLong(_T("lineThickness"), 1);
    m_config.AddColor(_T("focusedLetterColor"),     *wxGREEN);
    m_config.AddColor(_T("focusedWordColor"),       *wxLIGHT_GREY);
    m_config.AddColor(_T("whiteSquareColor"),       *wxWHITE);
    m_config.AddColor(_T("blackSquareColor"),       *wxBLACK);
    m_config.AddColor(_T("penColor"),               *wxBLACK);
    m_config.AddColor(_T("pencilColor"),            wxColor(200,200,200));
    m_config.AddLong(_T("numberScale"),             42);
    m_config.AddLong(_T("letterScale"),             75);

    // Clue box
    m_config.SetPath(_T("/Clue"));
    m_config.AddFont(_T("font"),
                     wxFont(12, wxFONTFAMILY_SWISS,
                            wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
    m_config.AddPoint(_T("spacing"),    wxPoint(5, 5));

    m_config.AddColor(_T("listForegroundColor"),        *wxBLACK);
    m_config.AddColor(_T("listBackgroundColor"),        *wxWHITE);
    m_config.AddColor(_T("selectedForegroundColor"),
        wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) );
    m_config.AddColor(_T("selectedBackgroundColor"),
        wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT) );
    m_config.AddColor(_T("crossingForegroundColor"),
        m_config.GetDefaultColor(_T("selectedBackgroundColor")));
    // Using the selected foreground color here can make the list look
    // really ugly.  If, for example, the default selected text color
    // is black, this would make the crossing clue's background color
    // to default to black, which draws too much attention to that clue.
    m_config.AddColor(_T("crossingBackgroundColor"),    *wxWHITE);

    m_config.AddFont(_T("headingFont"),
            wxFont(14, wxFONTFAMILY_SWISS,
                   wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
    m_config.AddColor(_T("headingForegroundColor"),
        wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT ) );
    m_config.AddColor(_T("headingBackgroundColor"),
        wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE ) );


    // Clue prompt
    m_config.SetPath(_T("/Clue Prompt"));
    m_config.AddFont(_T("font"),      *wxSWISS_FONT);
    m_config.AddColor(_T("foregroundColor"), *wxBLACK);
    m_config.AddColor(_T("backgroundColor"), *wxWHITE);
    m_config.AddString(_T("displayFormat"), _T("%N. %T"));


    // Printing
    m_config.SetPath(_T("/Printing"));
    m_config.AddLong(_T("blackSquareBrightness"), 0);
    m_config.AddLong(_T("gridAlignment"), wxALIGN_TOP | wxALIGN_RIGHT);
    m_config.AddLong(_T("paperID"), wxPAPER_LETTER);
    m_config.AddLong(_T("orientation"), wxPORTRAIT);
    m_config.SetPath(_T("/Printing/Margins"));
    m_config.AddLong(_T("left"), 15);
    m_config.AddLong(_T("right"), 15);
    m_config.AddLong(_T("top"), 15);
    m_config.AddLong(_T("bottom"), 15);
    m_config.SetPath(_T("/Printing/Fonts"));
    m_config.AddBool(_T("useCustomFonts"), false);
    m_config.AddFont(_T("gridLetterFont"), *wxSWISS_FONT);
    m_config.AddFont(_T("gridNumberFont"), *wxSWISS_FONT);
    m_config.AddFont(_T("clueFont"),       *wxSWISS_FONT);
}
Exemple #15
0
RibbonFrameBase::RibbonFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	m_mgr.SetManagedWindow(this);
	m_mgr.SetFlags(wxAUI_MGR_DEFAULT);
	
	m_ribbonBar1 = new wxRibbonBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRIBBON_BAR_DEFAULT_STYLE );
	m_ribbonBar1->SetArtProvider(new wxRibbonDefaultArtProvider); 
	m_mgr.AddPane( m_ribbonBar1, wxAuiPaneInfo() .Top() .CaptionVisible( false ).CloseButton( false ).PaneBorder( false ).Movable( false ).Dock().Fixed().DockFixed( false ).BottomDockable( false ).LeftDockable( false ).RightDockable( false ).Floatable( false ).BestSize( wxSize( -1,130 ) ).MinSize( wxSize( -1,130 ) ).Layer( 1000 ) );
	
	m_ribbonPage3 = new wxRibbonPage( m_ribbonBar1, wxID_ANY, wxT("NF05Lab") , wxNullBitmap , 0 );
	m_ribbonBar1->SetActivePage( m_ribbonPage3 ); 
	m_ribbonPanel7 = new wxRibbonPanel( m_ribbonPage3, wxID_ANY, wxT("Fichier") , wxNullBitmap , wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE );
	m_ribbonButtonBar6 = new wxRibbonButtonBar( m_ribbonPanel7, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_ribbonButtonBar6->AddButton( OUVRIR_BOUTTON, wxT("Ouvrir"), open127_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonButtonBar6->AddButton( ENREGISTRER_BOUTTON, wxT("Enregistrer"), save15_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonPanel3 = new wxRibbonPanel( m_ribbonPage3, wxID_ANY, wxT("Exécution") , wxNullBitmap , wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE );
	m_ribbonButtonBar3 = new wxRibbonButtonBar( m_ribbonPanel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_ribbonButtonBar3->AddButton( EXECUTER_COMMANDE_BOUTON_ID, wxT("Exécuter la commande"), right133_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonButtonBar3->AddButton( EFFACER_RESULTAT_BOUTON_ID, wxT("Effacer les résultats"), left37_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonPanel2 = new wxRibbonPanel( m_ribbonPage3, wxID_ANY, wxT("Gestion des variables") , wxNullBitmap , wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE );
	m_ribbonButtonBar2 = new wxRibbonButtonBar( m_ribbonPanel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_ribbonButtonBar2->AddButton( AJOUTER_VARIABLE_BOUTON_ID, wxT("Ajouter..."), add196_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonButtonBar2->AddButton( EDITER_VARIABLE_BOUTON_ID, wxT("Editer..."), edit45_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonButtonBar2->AddButton( SUPPRIMER_VARIABLE_BOUTON_ID, wxT("Supprimer"), delete99_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonButtonBar2->AddButton( BOUTTON_VIDER_VARIABLES, wxT("Supprimer toutes les variables"), trash30_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonPanel6 = new wxRibbonPanel( m_ribbonPage3, wxID_ANY, wxT("Fenêtres") , wxNullBitmap , wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE );
	m_barreBoutonsAffichage = new wxRibbonButtonBar( m_ribbonPanel6, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_barreBoutonsAffichage->AddToggleButton( BOUTON_AFFICHAGE_VARIABLES, wxT("Afficher la liste des variables"), list1_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonPanel5 = new wxRibbonPanel( m_ribbonPage3, wxID_ANY, wxT("Systèmes") , wxNullBitmap , wxDefaultPosition, wxDefaultSize, wxRIBBON_PANEL_DEFAULT_STYLE );
	m_ribbonButtonBar5 = new wxRibbonButtonBar( m_ribbonPanel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_ribbonButtonBar5->AddButton( RESOUDRE_SYTEME, wxT("Résoudre système"), settings48_png_to_wx_bitmap(), wxEmptyString);
	m_ribbonPage5 = new wxRibbonPage( m_ribbonBar1, wxID_ANY, wxT("?") , wxNullBitmap , 0 );
	m_ribbonPage5->Hide();
	
	m_ribbonBar1->Realize();
	
	m_panneauPrincipal = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_mgr.AddPane( m_panneauPrincipal, wxAuiPaneInfo() .Center() .CaptionVisible( false ).CloseButton( false ).PaneBorder( false ).Movable( false ).Dock().Resizable().FloatingSize( wxDefaultSize ).DockFixed( false ).BottomDockable( false ).TopDockable( false ).LeftDockable( false ).RightDockable( false ).Floatable( false ) );
	
	wxFlexGridSizer* fgSizer3;
	fgSizer3 = new wxFlexGridSizer( 0, 1, 0, 0 );
	fgSizer3->AddGrowableCol( 0 );
	fgSizer3->AddGrowableRow( 0 );
	fgSizer3->SetFlexibleDirection( wxBOTH );
	fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_zoneResultats = new wxTextCtrl( m_panneauPrincipal, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
	m_zoneResultats->SetFont( wxFont( 12, 75, 90, 90, false, wxT("Consolas") ) );
	
	fgSizer3->Add( m_zoneResultats, 0, wxALL|wxEXPAND, 5 );
	
	m_zoneCommande = new wxTextCtrl( m_panneauPrincipal, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
	m_zoneCommande->SetFont( wxFont( 12, 75, 90, 90, false, wxT("Consolas") ) );
	
	fgSizer3->Add( m_zoneCommande, 0, wxALL|wxEXPAND, 5 );
	
	
	m_panneauPrincipal->SetSizer( fgSizer3 );
	m_panneauPrincipal->Layout();
	fgSizer3->Fit( m_panneauPrincipal );
	m_panneauVariables = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_mgr.AddPane( m_panneauVariables, wxAuiPaneInfo() .Name( wxT("panneauVariables") ).Left() .Caption( wxT("Variables") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( 400,250 ) ).DockFixed( false ).BestSize( wxSize( 200,100 ) ).MinSize( wxSize( 200,100 ) ) );
	
	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 0, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 0 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_arbreVariables = new wxTreeCtrl( m_panneauVariables, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE );
	fgSizer1->Add( m_arbreVariables, 0, wxALL|wxEXPAND, 0 );
	
	
	m_panneauVariables->SetSizer( fgSizer1 );
	m_panneauVariables->Layout();
	fgSizer1->Fit( m_panneauVariables );
	m_arbreSyntaxe = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE );
	m_mgr.AddPane( m_arbreSyntaxe, wxAuiPaneInfo() .Right() .Caption( wxT("Arbre syntaxique") ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).DockFixed( false ).BestSize( wxSize( 200,-1 ) ).MinSize( wxSize( 200,-1 ) ) );
	
	
	m_mgr.Update();
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( RibbonFrameBase::OnExit ) );
	this->Connect( wxID_ANY, wxEVT_COMMAND_RIBBONBAR_PAGE_CHANGED, wxRibbonBarEventHandler( RibbonFrameBase::SurChangementOngletRuban ) );
	this->Connect( OUVRIR_BOUTTON, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicOuvrir ) );
	this->Connect( ENREGISTRER_BOUTTON, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicEnregistrer ) );
	this->Connect( EXECUTER_COMMANDE_BOUTON_ID, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicExecuterCommande ) );
	this->Connect( EFFACER_RESULTAT_BOUTON_ID, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicEffacerResultats ) );
	this->Connect( AJOUTER_VARIABLE_BOUTON_ID, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicAjouterVariable ) );
	this->Connect( EDITER_VARIABLE_BOUTON_ID, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicEditerVariable ) );
	this->Connect( SUPPRIMER_VARIABLE_BOUTON_ID, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicSupprimerVariable ) );
	this->Connect( BOUTTON_VIDER_VARIABLES, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicViderVariables ) );
	this->Connect( BOUTON_AFFICHAGE_VARIABLES, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxCommandEventHandler( RibbonFrameBase::SurClicAffichageVariables ) );
	this->Connect( RESOUDRE_SYTEME, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler( RibbonFrameBase::SurClicBouttonResoudreSysteme ) );
	m_zoneCommande->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( RibbonFrameBase::SurValidationCommande ), NULL, this );
}
RuleWizardAlfServicePageBase::RuleWizardAlfServicePageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Application Level Firewall settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Options for restricted network access\nfor application \"...\":"), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( -1 );
	mainSizer->Add( questionLabel, 0, wxALL, 5 );
	
	portListLabel = new wxStaticText( this, wxID_ANY, _("List of allowed services:"), wxDefaultPosition, wxDefaultSize, 0 );
	portListLabel->Wrap( -1 );
	mainSizer->Add( portListLabel, 0, wxALL, 5 );
	
	portListCtrl = new AnListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL );
	mainSizer->Add( portListCtrl, 1, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* buttonSizer;
	buttonSizer = new wxBoxSizer( wxHORIZONTAL );
	
	addButton = new wxButton( this, wxID_ANY, _(" Add..."), wxDefaultPosition, wxDefaultSize, 0 );
	addButton->SetToolTip( _("opens a service-choose-dialog\nand adds the result to the list") );
	
	buttonSizer->Add( addButton, 0, wxALL, 5 );
	
	
	buttonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	defaultsButton = new wxButton( this, wxID_ANY, _("Add default Services"), wxDefaultPosition, wxDefaultSize, 0 );
	defaultsButton->Enable( false );
	defaultsButton->SetToolTip( _("adds the default services to the list") );
	
	buttonSizer->Add( defaultsButton, 0, wxALL, 5 );
	
	
	buttonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	deleteButton = new wxButton( this, wxID_ANY, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
	deleteButton->Enable( false );
	deleteButton->SetToolTip( _("removes the selected items from the list") );
	
	buttonSizer->Add( deleteButton, 0, wxALL, 5 );
	
	mainSizer->Add( buttonSizer, 0, wxEXPAND, 5 );
	
	detailsPanel = new AnDetails( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("Details...") );
	wxBoxSizer* detailsSizer;
	detailsSizer = new wxBoxSizer( wxVERTICAL );
	
	askCheckBox = new wxCheckBox( detailsPanel, wxID_ANY, _("ask on any other network access"), wxDefaultPosition, wxDefaultSize, 0 );
	askCheckBox->SetValue(true);
	
	detailsSizer->Add( askCheckBox, 0, wxALL, 5 );
	
	rawCheckBox = new wxCheckBox( detailsPanel, wxID_ANY, _("allow raw network access"), wxDefaultPosition, wxDefaultSize, 0 );
	
	detailsSizer->Add( rawCheckBox, 0, wxALL, 5 );
	
	detailsPanel->SetSizer( detailsSizer );
	detailsPanel->Layout();
	detailsSizer->Fit( detailsPanel );
	mainSizer->Add( detailsPanel, 0, wxEXPAND | wxALL, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	portListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( RuleWizardAlfServicePageBase::onPortListDeselect ), NULL, this );
	portListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( RuleWizardAlfServicePageBase::onPortListSelect ), NULL, this );
	addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardAlfServicePageBase::onAddButton ), NULL, this );
	defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardAlfServicePageBase::onDefaultsButton ), NULL, this );
	deleteButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardAlfServicePageBase::onDeleteButton ), NULL, this );
	askCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( RuleWizardAlfServicePageBase::onAskCheckBox ), NULL, this );
	rawCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( RuleWizardAlfServicePageBase::onRawCheckBox ), NULL, this );
}
MemoryViewFrameDecl::MemoryViewFrameDecl( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
    this->SetSizeHints( wxDefaultSize, wxDefaultSize );

    menu = new wxMenuBar( 0 );
    menuView1 = new wxMenu();
    wxMenuItem* menuViewGoto;
    menuViewGoto = new wxMenuItem( menuView1, ID_GOTO_ADDRESS, wxString( _("Goto Address") ) + wxT('\t') + wxT("Ctrl+G"), _("Moves memory to a specific address."), wxITEM_NORMAL );
    menuView1->Append( menuViewGoto );

    menuViewHideAddresses = new wxMenu();
    wxMenuItem* menuViewHideAddressesItem = new wxMenuItem( menuView1, wxID_ANY, _("Hide Addresses"), wxEmptyString, wxITEM_NORMAL, menuViewHideAddresses );
    menuViewHideAddressesShowAll = new wxMenuItem( menuViewHideAddresses, ID_SHOW_ALL, wxString( _("Show All") ) , _("Shows all memory addresses"), wxITEM_RADIO );
    menuViewHideAddresses->Append( menuViewHideAddressesShowAll );

    menuViewHideAddressesShowNonZero = new wxMenuItem( menuViewHideAddresses, ID_SHOW_NON_ZERO, wxString( _("Show Non Zero") ) , _("Show all memory addresses that have a value other than 0"), wxITEM_RADIO );
    menuViewHideAddresses->Append( menuViewHideAddressesShowNonZero );

    menuViewHideAddressesShowOnlyCodeData = new wxMenuItem( menuViewHideAddresses, ID_SHOW_ONLY_CODEDATA, wxString( _("Show Only Code/Data") ) , _("Shows addresses modified when your program was loaded."), wxITEM_RADIO );
    menuViewHideAddresses->Append( menuViewHideAddressesShowOnlyCodeData );

    menuViewHideAddressesCustom = new wxMenuItem( menuViewHideAddresses, ID_CUSTOM, wxString( _("Custom...") ) + wxT('\t') + wxT("Ctrl+H"), _("Allows you to show/hide memory address ranges"), wxITEM_RADIO );
    menuViewHideAddresses->Append( menuViewHideAddressesCustom );

    menuView1->Append( menuViewHideAddressesItem );

    menuViewDisassemble = new wxMenu();
    wxMenuItem* menuViewDisassembleItem = new wxMenuItem( menuView1, wxID_ANY, _("Disassemble"), wxEmptyString, wxITEM_NORMAL, menuViewDisassemble );
    menuViewBasic = new wxMenuItem( menuViewDisassemble, ID_BASIC, wxString( _("Basic") ) , _("Disassembles ignoring symbols"), wxITEM_RADIO );
    menuViewDisassemble->Append( menuViewBasic );

    menuViewNormal = new wxMenuItem( menuViewDisassemble, ID_NORMAL, wxString( _("Normal") ) , _("Disassembles with symbol info."), wxITEM_RADIO );
    menuViewDisassemble->Append( menuViewNormal );

    menuViewHighLevel = new wxMenuItem( menuViewDisassemble, ID_HIGH_LEVEL, wxString( _("High Level") ) , _("Disassembles into C-like statements"), wxITEM_RADIO );
    menuViewDisassemble->Append( menuViewHighLevel );
    menuViewHighLevel->Check( true );

    menuView1->Append( menuViewDisassembleItem );

    menuViewInstructionHighlighting = new wxMenuItem( menuView1, ID_INSTRUCTION_HIGHLIGHTING, wxString( _("Instruction Highlighting") ) , _("Highlights bits of the instruction."), wxITEM_CHECK );
    menuView1->Append( menuViewInstructionHighlighting );
    menuViewInstructionHighlighting->Check( true );

    menuViewMemoryFlip = new wxMenuItem( menuView1, ID_FLIP_MEMORY, wxString( _("Memory Flip") ) , _("Reverses memory such that high addresses come first."), wxITEM_CHECK );
    menuView1->Append( menuViewMemoryFlip );

    menu->Append( menuView1, _("View") );

    this->SetMenuBar( menu );

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

    memory = new MemoryGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );

    // Grid
    memory->CreateGrid( 5, 5 );
    memory->EnableEditing( true );
    memory->EnableGridLines( false );
    memory->EnableDragGridSize( false );
    memory->SetMargins( 0, 0 );

    // Columns
    memory->EnableDragColMove( true );
    memory->EnableDragColSize( true );
    memory->SetColLabelSize( 20 );
    memory->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

    // Rows
    memory->EnableDragRowSize( false );
    memory->SetRowLabelSize( 0 );
    memory->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

    // Label Appearance
    memory->SetLabelFont( wxFont( 10, 70, 90, 90, false, wxT("Courier New") ) );

    // Cell Defaults
    memory->SetDefaultCellFont( wxFont( 10, 70, 90, 90, false, wxT("Courier New") ) );
    memory->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
    bSizer13->Add( memory, 1, wxALL|wxEXPAND, 5 );


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

    this->Centre( wxBOTH );

    // Connect Events
    this->Connect( menuViewGoto->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnGoto ) );
    this->Connect( menuViewHideAddressesShowAll->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnUpdateHideAddresses ) );
    this->Connect( menuViewHideAddressesShowNonZero->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnUpdateHideAddresses ) );
    this->Connect( menuViewHideAddressesShowOnlyCodeData->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnUpdateHideAddresses ) );
    this->Connect( menuViewHideAddressesCustom->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnHideAddressesCustom ) );
    this->Connect( menuViewBasic->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnDumbDisassemble ) );
    this->Connect( menuViewNormal->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnNormalDisassemble ) );
    this->Connect( menuViewHighLevel->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnCDisassemble ) );
    this->Connect( menuViewInstructionHighlighting->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnInstructionHighlight ) );
    this->Connect( menuViewMemoryFlip->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MemoryViewFrameDecl::OnFlipMemory ) );
}
RuleWizardSandboxPageBase::RuleWizardSandboxPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Sandbox settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	helpPage = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	helpPage->SetBackgroundColour( wxColour( 179, 177, 174 ) );
	
	wxBoxSizer* helpSizer;
	helpSizer = new wxBoxSizer( wxVERTICAL );
	
	helpLabel = new wxStaticText( helpPage, wxID_ANY, _("With the sandbox you can confine an application.\nThis is done by specifying which files it may read, write or execute."), wxDefaultPosition, wxDefaultSize, 0 );
	helpLabel->Wrap( 500 );
	helpSizer->Add( helpLabel, 0, wxALL, 5 );
	
	helpPage->SetSizer( helpSizer );
	helpPage->Layout();
	helpSizer->Fit( helpPage );
	mainSizer->Add( helpPage, 1, wxEXPAND | wxALL, 5 );
	
	wxBoxSizer* inputSizer;
	inputSizer = new wxBoxSizer( wxVERTICAL );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Create sandbox policies?"), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( 400 );
	inputSizer->Add( questionLabel, 0, wxALL, 5 );
	
	
	inputSizer->Add( 0, 30, 1, wxEXPAND, 5 );
	
	yesWizardRadioButton = new wxRadioButton( this, wxID_ANY, _("Yes, create policies (wizard guided)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
	inputSizer->Add( yesWizardRadioButton, 0, wxALL, 5 );
	
	yesDefaultsRadioButton = new wxRadioButton( this, wxID_ANY, _("Yes, load default policies (skip wizard)"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( yesDefaultsRadioButton, 0, wxALL, 5 );
	
	noRadioButton = new wxRadioButton( this, wxID_ANY, _("No, do not  create sandbox policies"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( noRadioButton, 0, wxALL, 5 );
	
	mainSizer->Add( inputSizer, 0, wxEXPAND, 5 );
	
	
	mainSizer->Add( 0, 0, 2, wxEXPAND, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	yesWizardRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardSandboxPageBase::onYesWizardRadioButton ), NULL, this );
	yesDefaultsRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardSandboxPageBase::onYesDefaultsRadioButton ), NULL, this );
	noRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardSandboxPageBase::onNoRadioButton ), NULL, this );
}
Exemple #19
0
void PreferencesDialog::TransferTo(wxConfigBase *cfg)
{
    XRCCTRL(*this, "user_name", wxTextCtrl)->SetValue(
                cfg->Read("translator_name", wxEmptyString));
    XRCCTRL(*this, "user_email", wxTextCtrl)->SetValue(
                cfg->Read("translator_email", wxEmptyString));
    XRCCTRL(*this, "compile_mo", wxCheckBox)->SetValue(
                cfg->ReadBool("compile_mo", true));
    XRCCTRL(*this, "show_summary", wxCheckBox)->SetValue(
                cfg->ReadBool("show_summary", true));
    XRCCTRL(*this, "manager_startup", wxCheckBox)->SetValue(
                cfg->ReadBool("manager_startup", false));
    XRCCTRL(*this, "focus_to_text", wxCheckBox)->SetValue(
                cfg->ReadBool("focus_to_text", false));
    XRCCTRL(*this, "comment_window_editable", wxCheckBox)->SetValue(
                cfg->ReadBool("comment_window_editable", false));
    XRCCTRL(*this, "keep_crlf", wxCheckBox)->SetValue(
                cfg->ReadBool("keep_crlf", true));
#ifdef USE_SPELLCHECKING
    XRCCTRL(*this, "enable_spellchecking", wxCheckBox)->SetValue(
                cfg->ReadBool("enable_spellchecking", true));
#endif

    XRCCTRL(*this, "use_font_list", wxCheckBox)->SetValue(
                cfg->ReadBool("custom_font_list_use", false));
    XRCCTRL(*this, "use_font_text", wxCheckBox)->SetValue(
                cfg->ReadBool("custom_font_text_use", false));
    XRCCTRL(*this, "font_list", wxFontPickerCtrl)->SetSelectedFont(
            wxFont(cfg->Read("custom_font_list_name", wxEmptyString)));
    XRCCTRL(*this, "font_text", wxFontPickerCtrl)->SetSelectedFont(
            wxFont(cfg->Read("custom_font_text_name", wxEmptyString)));

    wxString format = cfg->Read("crlf_format", "unix");
    int sel;
    if (format == "win") sel = 1;
    else /* "unix" or obsolete settings */ sel = 0;

    XRCCTRL(*this, "crlf_format", wxChoice)->SetSelection(sel);

    m_parsers.Read(cfg);               
    
    wxListBox *list = XRCCTRL(*this, "parsers_list", wxListBox);
    for (unsigned i = 0; i < m_parsers.GetCount(); i++)
        list->Append(m_parsers[i].Name);
    
    if (m_parsers.GetCount() == 0)
    {
        XRCCTRL(*this, "parser_edit", wxButton)->Enable(false);
        XRCCTRL(*this, "parser_delete", wxButton)->Enable(false);
    }
    else
        list->SetSelection(0);

#ifdef USE_TRANSMEM        
    wxStringTokenizer tkn(cfg->Read("TM/languages", wxEmptyString), ":");
    wxArrayString langs;
    while (tkn.HasMoreTokens()) langs.Add(tkn.GetNextToken());
    XRCCTRL(*this, "tm_langs", wxEditableListBox)->SetStrings(langs);

    XRCCTRL(*this, "tm_omits", wxSpinCtrl)->SetValue(
                (int)cfg->Read("TM/max_omitted", 2));
    XRCCTRL(*this, "tm_delta", wxSpinCtrl)->SetValue(
                (int)cfg->Read("TM/max_delta", 2));
    XRCCTRL(*this, "tm_automatic", wxCheckBox)->SetValue(
                (int)cfg->Read("use_tm_when_updating", true));
#endif

#ifdef USE_SPARKLE
    XRCCTRL(*this, "auto_updates", wxCheckBox)->SetValue(
                (bool)UserDefaults_GetBoolValue("SUEnableAutomaticChecks"));
#endif // USE_SPARKLE
#ifdef __WXMSW__
    XRCCTRL(*this, "auto_updates", wxCheckBox)->SetValue(
                win_sparkle_get_automatic_check_for_updates() != 0);
#endif
}
RuleWizardSandboxPermissionPageBase::RuleWizardSandboxPermissionPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Sandbox settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	wxBoxSizer* inputSizer;
	inputSizer = new wxBoxSizer( wxVERTICAL );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Select permissions of application \"...\"\nfor ... file access:"), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( 400 );
	inputSizer->Add( questionLabel, 0, wxALL, 5 );
	
	
	inputSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	allowAllRadioButton = new wxRadioButton( this, wxID_ANY, _("unrestricted"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
	inputSizer->Add( allowAllRadioButton, 0, wxALL, 5 );
	
	defaultRadioButton = new wxRadioButton( this, wxID_ANY, _("restricted (default)"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( defaultRadioButton, 0, wxALL, 5 );
	
	wxBoxSizer* defaultSizer;
	defaultSizer = new wxBoxSizer( wxHORIZONTAL );
	
	
	defaultSizer->Add( 30, 0, 0, wxEXPAND, 5 );
	
	defaultLabel = new wxStaticText( this, wxID_ANY, _("Default permissions are allowed, any other\naccess is asked on demand."), wxPoint( -1,-1 ), wxDefaultSize, 0 );
	defaultLabel->Wrap( -1 );
	defaultSizer->Add( defaultLabel, 0, wxALL, 5 );
	
	inputSizer->Add( defaultSizer, 0, wxEXPAND, 5 );
	
	restrictedRadioButton = new wxRadioButton( this, wxID_ANY, _("restricted"), wxDefaultPosition, wxDefaultSize, 0 );
	inputSizer->Add( restrictedRadioButton, 0, wxALL, 5 );
	
	wxBoxSizer* restrictedSizer;
	restrictedSizer = new wxBoxSizer( wxHORIZONTAL );
	
	
	restrictedSizer->Add( 30, 0, 0, wxEXPAND, 5 );
	
	restrictedLabel = new wxStaticText( this, wxID_ANY, _("Settings may be configured on the next page."), wxPoint( -1,-1 ), wxDefaultSize, 0 );
	restrictedLabel->Wrap( -1 );
	restrictedSizer->Add( restrictedLabel, 0, wxALL, 5 );
	
	inputSizer->Add( restrictedSizer, 0, wxEXPAND, 5 );
	
	mainSizer->Add( inputSizer, 0, wxEXPAND, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	allowAllRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardSandboxPermissionPageBase::onAllowAllRadioButton ), NULL, this );
	defaultRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardSandboxPermissionPageBase::onDefaultRadioButton ), NULL, this );
	restrictedRadioButton->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( RuleWizardSandboxPermissionPageBase::onRestrictedRadioButton ), NULL, this );
}
SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : KIWAY_PLAYER( parent, id, title, pos, size, style, name )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_mainMenu = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* m_newPlot;
	m_newPlot = new wxMenuItem( m_fileMenu, wxID_NEW, wxString( _("New Plot") ) , wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_newPlot );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_openWorkbook;
	m_openWorkbook = new wxMenuItem( m_fileMenu, wxID_OPEN, wxString( _("Open Workbook") ) , wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_openWorkbook );
	
	wxMenuItem* m_saveWorkbook;
	m_saveWorkbook = new wxMenuItem( m_fileMenu, wxID_SAVE, wxString( _("Save Workbook") ) , wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_saveWorkbook );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_saveImage;
	m_saveImage = new wxMenuItem( m_fileMenu, wxID_ANY, wxString( _("Save as image") ) , wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_saveImage );
	
	wxMenuItem* m_saveCsv;
	m_saveCsv = new wxMenuItem( m_fileMenu, wxID_ANY, wxString( _("Save as .csv file") ) , wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_saveCsv );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_exitSim;
	m_exitSim = new wxMenuItem( m_fileMenu, wxID_CLOSE, wxString( _("Exit Simulation") ) , wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_exitSim );
	
	m_mainMenu->Append( m_fileMenu, _("File") ); 
	
	m_simulationMenu = new wxMenu();
	m_runSimulation = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Run Simulation") ) , wxEmptyString, wxITEM_NORMAL );
	m_simulationMenu->Append( m_runSimulation );
	
	m_simulationMenu->AppendSeparator();
	
	m_addSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Add signals...") ) , wxEmptyString, wxITEM_NORMAL );
	m_simulationMenu->Append( m_addSignals );
	
	m_probeSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Probe from schematics") ) , wxEmptyString, wxITEM_NORMAL );
	m_simulationMenu->Append( m_probeSignals );
	
	m_tuneValue = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Tune component value") ) , wxEmptyString, wxITEM_NORMAL );
	m_simulationMenu->Append( m_tuneValue );
	
	m_simulationMenu->AppendSeparator();
	
	m_settings = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL );
	m_simulationMenu->Append( m_settings );
	
	m_mainMenu->Append( m_simulationMenu, _("Simulation") ); 
	
	m_viewMenu = new wxMenu();
	wxMenuItem* m_zoomIn;
	m_zoomIn = new wxMenuItem( m_viewMenu, wxID_ZOOM_IN, wxString( _("Zoom In") ) , wxEmptyString, wxITEM_NORMAL );
	m_viewMenu->Append( m_zoomIn );
	
	wxMenuItem* m_zoomOut;
	m_zoomOut = new wxMenuItem( m_viewMenu, wxID_ZOOM_OUT, wxString( _("Zoom Out") ) , wxEmptyString, wxITEM_NORMAL );
	m_viewMenu->Append( m_zoomOut );
	
	wxMenuItem* m_zoomFit;
	m_zoomFit = new wxMenuItem( m_viewMenu, wxID_ZOOM_FIT, wxString( _("Fit on Screen") ) , wxEmptyString, wxITEM_NORMAL );
	m_viewMenu->Append( m_zoomFit );
	
	m_viewMenu->AppendSeparator();
	
	wxMenuItem* m_showGrid;
	m_showGrid = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &grid") ) , wxEmptyString, wxITEM_CHECK );
	m_viewMenu->Append( m_showGrid );
	
	wxMenuItem* m_showLegend;
	m_showLegend = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &legend") ) , wxEmptyString, wxITEM_CHECK );
	m_viewMenu->Append( m_showLegend );
	
	m_mainMenu->Append( m_viewMenu, _("View") ); 
	
	this->SetMenuBar( m_mainMenu );
	
	m_sizer1 = new wxBoxSizer( wxVERTICAL );
	
	m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT ); 
	m_toolBar->Realize(); 
	
	m_sizer1->Add( m_toolBar, 0, wxEXPAND, 5 );
	
	m_splitterPlot = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitterPlot->SetSashGravity( 0.8 );
	m_splitterPlot->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotOnIdle ), NULL, this );
	
	m_panel2 = new wxPanel( m_splitterPlot, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_sizer11 = new wxBoxSizer( wxVERTICAL );
	
	m_splitterConsole = new wxSplitterWindow( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitterConsole->SetSashGravity( 0.8 );
	m_splitterConsole->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterConsoleOnIdle ), NULL, this );
	
	m_plotPanel = new wxPanel( m_splitterConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_sizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	m_plotNotebook = new wxAuiNotebook( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT|wxAUI_NB_TOP );
	m_welcomePanel = new wxPanel( m_plotNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_sizer8 = new wxBoxSizer( wxVERTICAL );
	
	
	m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer81;
	bSizer81 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_staticText2 = new wxStaticText( m_welcomePanel, wxID_ANY, _("Start the simulation by clicking the Run Simulation button"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText2->Wrap( -1 );
	m_staticText2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
	m_staticText2->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
	
	bSizer81->Add( m_staticText2, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
	
	
	bSizer81->Add( 0, 0, 1, wxEXPAND, 5 );
	
	
	m_sizer8->Add( bSizer81, 0, wxEXPAND, 5 );
	
	
	m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 );
	
	
	m_welcomePanel->SetSizer( m_sizer8 );
	m_welcomePanel->Layout();
	m_sizer8->Fit( m_welcomePanel );
	m_plotNotebook->AddPage( m_welcomePanel, _("a page"), false, wxNullBitmap );
	
	m_sizer5->Add( m_plotNotebook, 1, wxEXPAND | wxALL, 5 );
	
	
	m_plotPanel->SetSizer( m_sizer5 );
	m_plotPanel->Layout();
	m_sizer5->Fit( m_plotPanel );
	m_panel5 = new wxPanel( m_splitterConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_sizer13 = new wxBoxSizer( wxVERTICAL );
	
	m_simConsole = new wxTextCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY );
	m_simConsole->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
	
	m_sizer13->Add( m_simConsole, 1, wxALL|wxEXPAND, 5 );
	
	
	m_panel5->SetSizer( m_sizer13 );
	m_panel5->Layout();
	m_sizer13->Fit( m_panel5 );
	m_splitterConsole->SplitHorizontally( m_plotPanel, m_panel5, 500 );
	m_sizer11->Add( m_splitterConsole, 1, wxEXPAND, 5 );
	
	
	m_panel2->SetSizer( m_sizer11 );
	m_panel2->Layout();
	m_sizer11->Fit( m_panel2 );
	m_sidePanel = new wxPanel( m_splitterPlot, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_sideSizer = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* sbSizer1;
	sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_sidePanel, wxID_ANY, _("Signals") ), wxVERTICAL );
	
	m_signals = new wxListView( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_SMALL_ICON );
	sbSizer1->Add( m_signals, 1, wxALL|wxEXPAND, 5 );
	
	
	m_sideSizer->Add( sbSizer1, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer3;
	sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_sidePanel, wxID_ANY, _("Cursors") ), wxVERTICAL );
	
	m_cursors = new wxListCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL );
	sbSizer3->Add( m_cursors, 1, wxALL|wxEXPAND, 5 );
	
	
	m_sideSizer->Add( sbSizer3, 1, wxEXPAND, 5 );
	
	sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_sidePanel, wxID_ANY, _("Tune") ), wxVERTICAL );
	
	m_tuneSizer = new wxBoxSizer( wxHORIZONTAL );
	
	
	sbSizer4->Add( m_tuneSizer, 1, wxEXPAND, 5 );
	
	
	m_sideSizer->Add( sbSizer4, 1, wxEXPAND, 5 );
	
	
	m_sidePanel->SetSizer( m_sideSizer );
	m_sidePanel->Layout();
	m_sideSizer->Fit( m_sidePanel );
	m_splitterPlot->SplitVertically( m_panel2, m_sidePanel, 700 );
	m_sizer1->Add( m_splitterPlot, 1, wxEXPAND, 5 );
	
	
	this->SetSizer( m_sizer1 );
	this->Layout();
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( m_newPlot->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ) );
	this->Connect( m_openWorkbook->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ) );
	this->Connect( m_saveWorkbook->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ) );
	this->Connect( m_saveImage->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ) );
	this->Connect( m_saveCsv->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ) );
	this->Connect( m_exitSim->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ) );
	this->Connect( m_zoomIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ) );
	this->Connect( m_zoomOut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ) );
	this->Connect( m_zoomFit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ) );
	this->Connect( m_showGrid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ) );
	this->Connect( m_showGrid->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) );
	this->Connect( m_showLegend->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ) );
	this->Connect( m_showLegend->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) );
	m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this );
	m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this );
	m_signals->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( SIM_PLOT_FRAME_BASE::onSignalDblClick ), NULL, this );
	m_signals->Connect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( SIM_PLOT_FRAME_BASE::onSignalRClick ), NULL, this );
}
RuleWizardSandboxFilesPageBase::RuleWizardSandboxFilesPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* pageSizer;
	pageSizer = new wxBoxSizer( wxHORIZONTAL );
	
	naviSizer = new wxBoxSizer( wxVERTICAL );
	
	pageSizer->Add( naviSizer, 3, wxEXPAND, 5 );
	
	naviMainDelimiter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
	pageSizer->Add( naviMainDelimiter, 0, wxEXPAND | wxALL, 5 );
	
	
	pageSizer->Add( 20, 0, 0, wxEXPAND, 5 );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	headLineLabel = new wxStaticText( this, wxID_ANY, _("Sandbox settings:"), wxDefaultPosition, wxDefaultSize, 0 );
	headLineLabel->Wrap( -1 );
	headLineLabel->SetFont( wxFont( 18, 70, 90, 92, false, wxEmptyString ) );
	
	mainSizer->Add( headLineLabel, 0, wxALL, 5 );
	
	
	mainSizer->Add( 0, 50, 0, wxEXPAND, 5 );
	
	questionLabel = new wxStaticText( this, wxID_ANY, _("Options for ... access of \"...\":"), wxDefaultPosition, wxDefaultSize, 0 );
	questionLabel->Wrap( -1 );
	mainSizer->Add( questionLabel, 0, wxALL, 5 );
	
	fileListLabel = new wxStaticText( this, wxID_ANY, _("... grant access:"), wxDefaultPosition, wxDefaultSize, 0 );
	fileListLabel->Wrap( -1 );
	mainSizer->Add( fileListLabel, 0, wxALL, 5 );
	
	fileListCtrl = new AnListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL );
	mainSizer->Add( fileListCtrl, 1, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* buttonSizer;
	buttonSizer = new wxBoxSizer( wxHORIZONTAL );
	
	add_label = new wxStaticText( this, wxID_ANY, _("Add:"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
	add_label->Wrap( -1 );
	buttonSizer->Add( add_label, 0, wxALIGN_CENTER|wxALL, 5 );
	
	addFileButton = new wxButton( this, wxID_ANY, _("File"), wxDefaultPosition, wxDefaultSize, 0 );
	addFileButton->SetToolTip( _("opens a file-choose-dialog\nand adds the result to the list") );
	
	buttonSizer->Add( addFileButton, 0, wxALL, 5 );
	
	addDirectoryButton = new wxButton( this, wxID_ANY, _("Directory"), wxDefaultPosition, wxDefaultSize, 0 );
	addDirectoryButton->SetToolTip( _("opens a directory-choose-dialog\nand adds the result to the list") );
	
	buttonSizer->Add( addDirectoryButton, 0, wxALL, 5 );
	
	defaultsButton = new wxButton( this, wxID_ANY, _("Default Permissions"), wxDefaultPosition, wxDefaultSize, 0 );
	defaultsButton->Enable( false );
	defaultsButton->SetToolTip( _("adds the default services to the list") );
	
	buttonSizer->Add( defaultsButton, 0, wxALL, 5 );
	
	
	buttonSizer->Add( 40, 0, 1, wxEXPAND, 5 );
	
	deleteButton = new wxButton( this, wxID_ANY, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
	deleteButton->Enable( false );
	deleteButton->SetToolTip( _("removes the selected items from the list") );
	
	buttonSizer->Add( deleteButton, 0, wxALL, 5 );
	
	mainSizer->Add( buttonSizer, 0, wxEXPAND, 5 );
	
	detailsPanel = new AnDetails( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("Details...") );
	wxBoxSizer* detailsSizer;
	detailsSizer = new wxBoxSizer( wxVERTICAL );
	
	askCheckBox = new wxCheckBox( detailsPanel, wxID_ANY, _("ask on any other access"), wxDefaultPosition, wxDefaultSize, 0 );
	askCheckBox->SetValue(true);
	
	detailsSizer->Add( askCheckBox, 0, wxALL, 5 );
	
	validCheckBox = new wxCheckBox( detailsPanel, wxID_ANY, _("always allow access on valid checksum / signature"), wxDefaultPosition, wxDefaultSize, 0 );
	
	detailsSizer->Add( validCheckBox, 0, wxALL, 5 );
	
	detailsPanel->SetSizer( detailsSizer );
	detailsPanel->Layout();
	detailsSizer->Fit( detailsPanel );
	mainSizer->Add( detailsPanel, 0, wxEXPAND | wxALL, 5 );
	
	pageSizer->Add( mainSizer, 7, wxEXPAND, 5 );
	
	this->SetSizer( pageSizer );
	this->Layout();
	
	// Connect Events
	fileListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( RuleWizardSandboxFilesPageBase::onFileListDeselect ), NULL, this );
	fileListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( RuleWizardSandboxFilesPageBase::onFileListSelect ), NULL, this );
	addFileButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardSandboxFilesPageBase::onAddFileButton ), NULL, this );
	addDirectoryButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardSandboxFilesPageBase::onAddDirectoryButton ), NULL, this );
	defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardSandboxFilesPageBase::onDefaultsButton ), NULL, this );
	deleteButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( RuleWizardSandboxFilesPageBase::onDeleteButton ), NULL, this );
	askCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( RuleWizardSandboxFilesPageBase::onAskCheckBox ), NULL, this );
	validCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( RuleWizardSandboxFilesPageBase::onValidCheckBox ), NULL, this );
}
MainFrame::MainFrame(wxWindow* parent,wxWindowID id)
	: my::employer(L"MainFrame_employer", false)
	, Cartographer(0)
	, Anchor_(NoAnchor)
	, WiFi_data_(NULL)
	, WiFi_relative_mode_(true)
	, WiFi_min_power_(-100)
	, WiFi_max_power_(10)
	, WiFi_min_power_abs_(-100)
	, WiFi_max_power_abs_(10)
	, MY_MUTEX_DEF(WiFi_mutex_,true)
	, big_font_(0)
	, small_font_(0)
	, gps_tracker_id_(0)
	, green_mark_id_(0)
	, red_mark_id_(0)
	, yellow_mark_id_(0)
	, pg_conn_(NULL)
	, MY_MUTEX_DEF(pg_mutex_,true)
	, Gps_test_(false)
	, MY_MUTEX_DEF(Gps_mutex_,true)
{
	#undef _
	#define _(s) (L##s)

	//(*Initialize(MainFrame)
	wxMenu* MenuHelp;
	wxMenuItem* MenuAbout;
	wxMenuBar* MainMenu;
	wxMenu* MenuFile;
	wxMenuItem* MenuQuit;

	Create(parent, wxID_ANY, _("Scan Analitics"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
	SetClientSize(wxSize(626,293));
	SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
	FlexGridSizer1 = new wxFlexGridSizer(1, 1, 0, 0);
	FlexGridSizer1->AddGrowableCol(0);
	FlexGridSizer1->AddGrowableRow(0);
	Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxSize(616,331), wxTAB_TRAVERSAL, _T("ID_PANEL1"));
	FlexGridSizer1->Add(Panel1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	SetSizer(FlexGridSizer1);
	MainMenu = new wxMenuBar();
	MenuFile = new wxMenu();
	MenuSettings = new wxMenuItem(MenuFile, ID_SETTINGS, _("Настройки..."), wxEmptyString, wxITEM_NORMAL);
	MenuFile->Append(MenuSettings);
	MenuFile->AppendSeparator();
	MenuQuit = new wxMenuItem(MenuFile, ID_QUIT, _("Выход\tAlt-F4"), wxEmptyString, wxITEM_NORMAL);
	MenuFile->Append(MenuQuit);
	MainMenu->Append(MenuFile, _("Файл"));
	MenuView = new wxMenu();
	MenuMaps = new wxMenu();
	MenuMapsNull = new wxMenuItem(MenuMaps, 0, _("Нет карт"), wxEmptyString, wxITEM_RADIO);
	MenuMaps->Append(MenuMapsNull);
	MenuView->Append(ID_MENUMAPS, _("Карты"), MenuMaps, wxEmptyString);
	MenuView->AppendSeparator();
	MenuZoomIn = new wxMenuItem(MenuView, ID_ZOOMIN, _("Увеличить масштаб"), wxEmptyString, wxITEM_NORMAL);
	MenuView->Append(MenuZoomIn);
	MenuZoomOut = new wxMenuItem(MenuView, ID_ZOOMOUT, _("Уменьшить масштаб"), wxEmptyString, wxITEM_NORMAL);
	MenuView->Append(MenuZoomOut);
	MenuView->AppendSeparator();
	MenuGpsTracker = new wxMenuItem(MenuView, ID_GPSTRACKER, _("Загружать данные с Gps"), wxEmptyString, wxITEM_CHECK);
	MenuView->Append(MenuGpsTracker);
	MenuGpsAnchor = new wxMenuItem(MenuView, ID_GPSANCHOR, _("Следить за Gps"), wxEmptyString, wxITEM_CHECK);
	MenuView->Append(MenuGpsAnchor);
	MenuView->AppendSeparator();
	MenuWifiScan = new wxMenuItem(MenuView, ID_WIFISCAN, _("Загружать данные с WiFi-сканера"), wxEmptyString, wxITEM_CHECK);
	MenuView->Append(MenuWifiScan);
	MenuWiFiAnchor = new wxMenuItem(MenuView, ID_WIFIANCHOR, _("Следить за данными WiFi-сканера"), wxEmptyString, wxITEM_CHECK);
	MenuView->Append(MenuWiFiAnchor);
	MainMenu->Append(MenuView, _("Вид"));
	MenuHelp = new wxMenu();
	MenuAbout = new wxMenuItem(MenuHelp, ID_ABOUT, _("О программе...\tF1"), wxEmptyString, wxITEM_NORMAL);
	MenuHelp->Append(MenuAbout);
	MainMenu->Append(MenuHelp, _("Помощь"));
	SetMenuBar(MainMenu);
	StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
	int __wxStatusBarWidths_1[1] = { -1 };
	int __wxStatusBarStyles_1[1] = { wxSB_NORMAL };
	StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1);
	StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1);
	SetStatusBar(StatusBar1);
	FlexGridSizer1->SetSizeHints(this);

	Connect(ID_SETTINGS,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnSettings);
	Connect(ID_QUIT,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnQuit);
	Connect(ID_ZOOMIN,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnZoomIn);
	Connect(ID_ZOOMOUT,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnZoomOut);
	Connect(ID_GPSTRACKER,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnGpsTracker);
	Connect(ID_GPSANCHOR,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnGpsAnchor);
	Connect(ID_WIFISCAN,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnWiFiScan);
	Connect(ID_WIFIANCHOR,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnWiFiAnchor);
	Connect(ID_ABOUT,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnAbout);
	//*)

	setlocale(LC_NUMERIC, "C");

	{
		wxIcon FrameIcon;
		FrameIcon.CopyFromBitmap(LoadBitmapFromC(images::cartographer));
		SetIcon(FrameIcon);
	}

	MainToolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER);
	MainToolBar->AddTool(ID_ZOOMIN, L"ZoomIn", LoadBitmapFromC(images::zoom_in), L"Увеличить");
	MainToolBar->AddTool(ID_ZOOMOUT, L"ZoomOut", LoadBitmapFromC(images::zoom_out), L"Уменьшить");
	MainToolBar->AddSeparator();
	MainToolBar->AddTool(ID_GPSTRACKER, L"GpsTracker", LoadBitmapFromC(images::gps_tracker), L"Gps", wxITEM_CHECK);
	MainToolBar->AddTool(ID_GPSANCHOR, L"GpsAnchor", LoadBitmapFromC(images::anchor), L"Следить за Gps", wxITEM_CHECK);
	MainToolBar->AddSeparator();
	MainToolBar->AddTool(ID_WIFISCAN, L"WiFiScan", LoadBitmapFromC(images::wifi), L"WiFi", wxITEM_CHECK);
	MainToolBar->AddTool(ID_WIFIANCHOR, L"WiFiAnchor", LoadBitmapFromC(images::anchor), L"Следить за WiFi", wxITEM_CHECK);
	MainToolBar->Realize();
	SetToolBar(MainToolBar);

	ReloadSettings();

	{
		int w, h;
		bool maximized;

		MyConfig->Read(L"/MainFrame/Width", &w, 400);
		MyConfig->Read(L"/MainFrame/Height", &h, 400);
		MyConfig->Read(L"/MainFrame/Maximized", &maximized, true);

		SetClientSize(w, h);
		Maximize(maximized);
	}

	Show(true);

	/* Создание Картографа на месте Panel1 */
	{
		delete Panel1;

		std::wstring error;

		bool only_cache
			= MyConfig->ReadBool(L"/Cartographer/OnlyCache", false);

		if (!only_cache)
		{
			wxString str = MyConfig->Read(L"/Cartographer/ServerAddr", L"");
			try
			{
				Cartographer = new cartographer::Painter(this,
					(const wchar_t*)str.c_str());
			}
			catch (my::exception &e)
			{
				/* Не удалось создать Картограф - возможно
					не получилось соединиться с сервером */
				error = e.message();
				only_cache = true;
			}
		}

		if (only_cache)
		{
			try
			{
				Cartographer = new cartographer::Painter(this, L"cache");
			}
			catch (my::exception &e)
			{
				if (error.empty())
					throw e;
				else
					throw my::exception(error);
			}
		}

		FlexGridSizer1->Add(Cartographer, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
		SetSizer(FlexGridSizer1);

		if (!error.empty())
		{
			wxMessageBox(L"Не удалось запустить Картограф"
				L" с заданными настройками. Картограф запущен"
				L" в режиме работы с кэшем.\n\nТекст ошибки:\n\n"
				+ error, L"Ошибка", wxOK | wxICON_ERROR,
				this);
		}

	} /* Создание Картографа */

	Cartographer->Bind(wxEVT_MOTION, &MainFrame::OnMapMouseMove, this, wxID_ANY);

	/* Создаём шрифты */
	big_font_ = Cartographer->CreateFont(
		wxFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD) );
	small_font_ = Cartographer->CreateFont(
		wxFont(8, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD) );

	/* Загружаем список карт */
	{
		MenuMaps->Delete(MenuMapsNull);
		cartographer::map_info active_map = Cartographer->GetActiveMapInfo();

		long maps_count = Cartographer->GetMapsCount();

		for(long i = 0; i < maps_count; ++i)
		{
			cartographer::map_info map = Cartographer->GetMapInfo(i);

			wxMenuItem *item = new wxMenuItem(MenuMaps, i,
				map.name + L"\t" + my::num::to_wstring(i + 1),
				wxEmptyString, wxITEM_RADIO);

			MenuMaps->Append(item);

			if (active_map.sid == map.sid)
				item->Check();

			MenuMaps->Bind(wxEVT_COMMAND_MENU_SELECTED, &MainFrame::OnMapChange, this, i);
		}
	}

	/* Изображения */
	gps_tracker_id_ = Cartographer->LoadImageFromC(images::gps_tracker);
	Cartographer->SetImageCentralPoint(gps_tracker_id_, 15.5, 19.0);

	green_mark_id_ = Cartographer->LoadImageFromC(images::green_mark);
	red_mark_id_ = Cartographer->LoadImageFromC(images::red_mark);
	yellow_mark_id_ = Cartographer->LoadImageFromC(images::yellow_mark);


	/* Запускаем собственную прорисовку */
	Cartographer->SetPainter(
		boost::bind(&MainFrame::OnMapPaint, this, _1, _2));

	Cartographer->SetStatusHandler(
		boost::bind(&MainFrame::StatusHandler, this, _1));

	Cartographer->MoveTo(13,
		cartographer::DMSToDD( 48,28,48.77, 135,4,19.04 ));

	//UpdateWiFiData( macaddr(0, 0x10, 0xE7, 0xA4, 0x46, 0x9D) );
	WiFiScan_worker_ = new_worker( L"WiFiScan_worker");

	GpsTracker_worker_ = new_worker( L"GpsTracker_worker");

	boost::thread( boost::bind(
		&MainFrame::CheckerProc, this, new_worker(L"Checker_worker")) );
}
Exemple #24
0
FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
                           const wxString & title,
                           const wxPoint & pos)
:  wxDialogWrapper(parent, id, title, pos, wxDefaultSize,
            wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX),
   mData(NULL),
   mAnalyst(std::make_unique<SpectrumAnalyst>())
{
   SetName(GetTitle());

   mMouseX = 0;
   mMouseY = 0;
   mRate = 0;
   mDataLen = 0;

   p = GetActiveProject();
   if (!p)
      return;

   wxArrayString algChoices;
   algChoices.Add(_("Spectrum"));
   algChoices.Add(_("Standard Autocorrelation"));
   algChoices.Add(_("Cuberoot Autocorrelation"));
   algChoices.Add(_("Enhanced Autocorrelation"));
     /* i18n-hint: This is a technical term, derived from the word
      * "spectrum".  Do not translate it unless you are sure you
      * know the correct technical word in your language. */
   algChoices.Add(_("Cepstrum"));

   wxArrayString sizeChoices;
   sizeChoices.Add(wxT("128"));
   sizeChoices.Add(wxT("256"));
   sizeChoices.Add(wxT("512"));
   sizeChoices.Add(wxT("1024"));
   sizeChoices.Add(wxT("2048"));
   sizeChoices.Add(wxT("4096"));
   sizeChoices.Add(wxT("8192"));
   sizeChoices.Add(wxT("16384"));
   sizeChoices.Add(wxT("32768"));
   sizeChoices.Add(wxT("65536"));

   wxArrayString funcChoices;
   for (int i = 0, cnt = NumWindowFuncs(); i < cnt; i++)
   {
      /* i18n-hint: This refers to a "window function", used in the
       * Frequency analyze dialog box. */
      funcChoices.Add(wxString(WindowFuncName(i)) + wxT(" ") + _("window"));
   }

   wxArrayString axisChoices;
   axisChoices.Add(_("Linear frequency"));
   axisChoices.Add(_("Log frequency"));

   mFreqFont = wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
   mArrowCursor = std::make_unique<wxCursor>(wxCURSOR_ARROW);
   mCrossCursor = std::make_unique<wxCursor>(wxCURSOR_CROSS);

   gPrefs->Read(wxT("/FreqWindow/DrawGrid"), &mDrawGrid, true);

   long size;
   gPrefs->Read(wxT("/FreqWindow/SizeChoice"), &mSize, 3);
   sizeChoices[mSize].ToLong(&size);
   mWindowSize = size;

   int alg;
   gPrefs->Read(wxT("/FreqWindow/AlgChoice"), &alg, 0);
   mAlg = static_cast<SpectrumAnalyst::Algorithm>(alg);

   gPrefs->Read(wxT("/FreqWindow/FuncChoice"), &mFunc, 3);
   gPrefs->Read(wxT("/FreqWindow/AxisChoice"), &mAxis, 1);
   gPrefs->Read(ENV_DB_KEY, &dBRange, ENV_DB_RANGE);
   if(dBRange < 90.)
      dBRange = 90.;

   ShuttleGui S(this, eIsCreating);

   S.SetBorder(0);

   S.AddSpace(5);

   S.SetSizerProportion(1);
   S.StartMultiColumn(3, wxEXPAND);
   {
      S.SetStretchyCol(1);
      S.SetStretchyRow(0);

      // -------------------------------------------------------------------
      // ROW 1: Freq response panel and sliders for vertical scale
      // -------------------------------------------------------------------

      S.StartVerticalLay(2);
      {
         vRuler = safenew RulerPanel(this, wxID_ANY);
         vRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
         vRuler->ruler.SetOrientation(wxVERTICAL);
         vRuler->ruler.SetRange(0.0, -dBRange);
         vRuler->ruler.SetFormat(Ruler::LinearDBFormat);
         vRuler->ruler.SetUnits(_("dB"));
         vRuler->ruler.SetLabelEdges(true);
         int w;
         vRuler->ruler.GetMaxSize(&w, NULL);
         vRuler->SetMinSize(wxSize(w, 150));  // height needed for wxGTK

         S.AddSpace(wxDefaultCoord, 1);
         S.Prop(1);
         S.AddWindow(vRuler, wxALIGN_RIGHT | wxALIGN_TOP);
         S.AddSpace(wxDefaultCoord, 1);
      }
      S.EndVerticalLay();

      mFreqPlot = safenew FreqPlot(this);
      mFreqPlot->SetMinSize(wxSize(wxDefaultCoord, FREQ_WINDOW_HEIGHT));
      S.Prop(1);
      S.AddWindow(mFreqPlot, wxEXPAND);

      S.StartHorizontalLay(wxEXPAND, 0);
      {
         S.StartVerticalLay();
         {
            mPanScroller = safenew wxScrollBar(this, FreqPanScrollerID,
               wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL);
            mPanScroller->SetName(_("Scroll"));
            S.Prop(1);
            S.AddWindow(mPanScroller, wxALIGN_LEFT | wxTOP);
         }
         S.EndVerticalLay();

         S.StartVerticalLay();
         {
            wxStaticBitmap *zi = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomIn));
            S.AddWindow((wxWindow *) zi, wxALIGN_CENTER);

            S.AddSpace(5);

            mZoomSlider = safenew wxSlider(this, FreqZoomSliderID, 100, 1, 100,
               wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL);
            S.Prop(1);
            S.AddWindow(mZoomSlider, wxALIGN_CENTER_HORIZONTAL);
            mZoomSlider->SetName(_("Zoom"));

            S.AddSpace(5);

            wxStaticBitmap *zo = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomOut));
            S.AddWindow((wxWindow *) zo, wxALIGN_CENTER);
         }
         S.EndVerticalLay();

         S.AddSpace(5, wxDefaultCoord);
      }
      S.EndHorizontalLay();

      // -------------------------------------------------------------------
      // ROW 2: Frequency ruler
      // -------------------------------------------------------------------

      S.AddSpace(1);

      S.StartHorizontalLay(wxEXPAND, 0);
      {
         hRuler  = safenew RulerPanel(this, wxID_ANY);
         hRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
         hRuler->ruler.SetOrientation(wxHORIZONTAL);
         hRuler->ruler.SetLog(true);
         hRuler->ruler.SetRange(10, 20000);
         hRuler->ruler.SetFormat(Ruler::RealFormat);
         hRuler->ruler.SetUnits(wxT("Hz"));
         hRuler->ruler.SetFlip(true);
         hRuler->ruler.SetLabelEdges(true);
         int h;
         hRuler->ruler.GetMaxSize(NULL, &h);
         hRuler->SetMinSize(wxSize(wxDefaultCoord, h));

         S.AddSpace(1, wxDefaultCoord);
         S.Prop(1);
         S.AddWindow(hRuler, wxALIGN_LEFT | wxALIGN_TOP);
         S.AddSpace(1, wxDefaultCoord);
      }
      S.EndHorizontalLay();

      S.AddSpace(1);

      // -------------------------------------------------------------------
      // ROW 3: Spacer
      // -------------------------------------------------------------------
      S.AddSpace(5);
      S.AddSpace(5);
      S.AddSpace(5);

      // -------------------------------------------------------------------
      // ROW 4: Info
      // -------------------------------------------------------------------

      S.AddSpace(1);

      S.StartHorizontalLay(wxEXPAND);
      {
         S.SetSizerProportion(1);
         S.StartMultiColumn(4);
         S.SetStretchyCol(1);
         S.SetStretchyCol(3);
         {
            S.AddPrompt(wxT("Cursor:"));

            S.SetStyle(wxTE_READONLY);
            mCursorText = S.AddTextBox(wxT(""), wxT(""), 10);

            S.AddPrompt(wxT("Peak:"));

            S.SetStyle(wxTE_READONLY);
            mPeakText = S.AddTextBox(wxT(""), wxT(""), 10);
         }
         S.EndMultiColumn();
      }
      S.EndHorizontalLay();

      S.AddSpace(1);
   }
   S.EndMultiColumn();

   // -------------------------------------------------------------------
   // ROW 5: Spacer
   // -------------------------------------------------------------------
   
   S.AddSpace(5);

   S.SetBorder(2);
   S.SetSizerProportion(0);
   S.StartMultiColumn(11, wxALIGN_CENTER);
   {
      // ----------------------------------------------------------------
      // ROW 6: Algorithm, Size, Export, Replot
      // ----------------------------------------------------------------

      S.AddSpace(5);

      mAlgChoice = S.Id(FreqAlgChoiceID).AddChoice(_("&Algorithm:"), wxT(""), &algChoices);
      mAlgChoice->SetSelection(mAlg);
      S.SetSizeHints(wxDefaultCoord, wxDefaultCoord);

      S.AddSpace(5);

      mSizeChoice = S.Id(FreqSizeChoiceID).AddChoice(_("&Size:"), wxT(""), &sizeChoices);
      mSizeChoice->SetSelection(mSize);
      S.SetSizeHints(wxDefaultCoord, wxDefaultCoord);

      S.AddSpace(5);

      mExportButton = S.Id(FreqExportButtonID).AddButton(_("&Export..."));

      S.AddSpace(5);

      mReplotButton = S.Id(ReplotButtonID).AddButton(_("&Replot..."));

      S.AddSpace(5);

      // ----------------------------------------------------------------
      // ROW 7: Function, Axix, Grids, Close
      // ----------------------------------------------------------------

      S.AddSpace(5);

      mFuncChoice = S.Id(FreqFuncChoiceID).AddChoice(_("&Function:"), wxT(""), &funcChoices);
      mFuncChoice->SetSelection(mFunc);
      S.SetSizeHints(wxDefaultCoord, wxDefaultCoord);
      mFuncChoice->MoveAfterInTabOrder(mSizeChoice);

      S.AddSpace(5);

      mAxisChoice = S.Id(FreqAxisChoiceID).AddChoice(_("&Axis:"), wxT(""), &axisChoices);
      mAxisChoice->SetSelection(mAxis);
      S.SetSizeHints(wxDefaultCoord, wxDefaultCoord);
      mAxisChoice->MoveAfterInTabOrder(mFuncChoice);

      S.AddSpace(5);

      mGridOnOff = S.Id(GridOnOffID).AddCheckBox(_("&Grids"), wxT("false"));
      mGridOnOff->SetValue(mDrawGrid);

      S.AddSpace(5);

      mCloseButton = S.Id(wxID_CANCEL).AddButton(_("&Close"));

      S.AddSpace(5);
   }
   S.EndMultiColumn();

   // -------------------------------------------------------------------
   // ROW 8: Spacer
   // -------------------------------------------------------------------

   S.AddSpace(5);

   mProgress = safenew FreqGauge(this); //, wxID_ANY, wxST_SIZEGRIP);
   S.AddWindow(mProgress, wxEXPAND);

   // Log-frequency axis works for spectrum plots only.
   if (mAlg != SpectrumAnalyst::Spectrum)
   {
      mAxis = 0;
      mAxisChoice->Disable();
   }
   mLogAxis = mAxis != 0;

   mCloseButton->SetDefault();
   mCloseButton->SetFocus();

   Layout();
   Fit();
   SetMinSize(GetSize());
   mAlgChoice->SetFocus();

#if defined(__WXGTK__)
   // This should be rechecked with wx3.
   //
   // The scrollbar (focus some reason) doesn't allow tabbing past it
   // because it can't receive focus.  So, convince it otherwise.
   //
   // Unfortunately, this still doesn't let you adjust the scrollbar
   // from the keyboard.  Near as I can tell, wxWGTK is capturing the
   // keyboard input, so the GTK widget doesn't see it, preventing
   // the normal scroll events from being generated.
   //
   // I guess the only way round it would be to handle key actions
   // ourselves, but we'll leave that for a future date.
//   gtk_widget_set_can_focus(mPanScroller->m_widget, true);
#endif
}
void wxRichTextMarginsPage::CreateControls()
{
////@begin wxRichTextMarginsPage content construction
    wxRichTextMarginsPage* itemRichTextDialogPage1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemRichTextDialogPage1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5);

    wxStaticText* itemStaticText5 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Margins"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText5->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT("")));
    itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticLine* itemStaticLine6 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    itemBoxSizer4->Add(itemStaticLine6, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer7, 0, wxGROW, 5);

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

    wxFlexGridSizer* itemFlexGridSizer9 = new wxFlexGridSizer(0, 4, 0, 0);
    itemBoxSizer7->Add(itemFlexGridSizer9, 0, wxALIGN_CENTER_VERTICAL, 5);

    m_leftMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_MARGIN_CHECKBOX, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_leftMarginCheckbox->SetValue(false);
    itemFlexGridSizer9->Add(m_leftMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer9->Add(itemBoxSizer11, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_marginLeft = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_marginLeft->SetHelpText(_("The left margin size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_marginLeft->SetToolTip(_("The left margin size."));
    itemBoxSizer11->Add(m_marginLeft, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsMarginLeftStrings;
    m_unitsMarginLeftStrings.Add(_("px"));
    m_unitsMarginLeftStrings.Add(_("cm"));
    m_unitsMarginLeft = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginLeftStrings, wxCB_READONLY );
    m_unitsMarginLeft->SetStringSelection(_("px"));
    m_unitsMarginLeft->SetHelpText(_("Units for the left margin."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsMarginLeft->SetToolTip(_("Units for the left margin."));
    itemBoxSizer11->Add(m_unitsMarginLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

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

    m_rightMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_MARGIN_CHECKBOX, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_rightMarginCheckbox->SetValue(false);
    itemFlexGridSizer9->Add(m_rightMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer9->Add(itemBoxSizer16, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_marginRight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_marginRight->SetHelpText(_("The right margin size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_marginRight->SetToolTip(_("The right margin size."));
    itemBoxSizer16->Add(m_marginRight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsMarginRightStrings;
    m_unitsMarginRightStrings.Add(_("px"));
    m_unitsMarginRightStrings.Add(_("cm"));
    m_unitsMarginRight = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginRightStrings, wxCB_READONLY );
    m_unitsMarginRight->SetStringSelection(_("px"));
    m_unitsMarginRight->SetHelpText(_("Units for the right margin."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsMarginRight->SetToolTip(_("Units for the right margin."));
    itemBoxSizer16->Add(m_unitsMarginRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_topMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_MARGIN_CHECKBOX, _("&Top:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_topMarginCheckbox->SetValue(false);
    itemFlexGridSizer9->Add(m_topMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer9->Add(itemBoxSizer20, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_marginTop = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_TOP_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_marginTop->SetHelpText(_("The top margin size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_marginTop->SetToolTip(_("The top margin size."));
    itemBoxSizer20->Add(m_marginTop, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsMarginTopStrings;
    m_unitsMarginTopStrings.Add(_("px"));
    m_unitsMarginTopStrings.Add(_("cm"));
    m_unitsMarginTop = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginTopStrings, wxCB_READONLY );
    m_unitsMarginTop->SetStringSelection(_("px"));
    m_unitsMarginTop->SetHelpText(_("Units for the top margin."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsMarginTop->SetToolTip(_("Units for the top margin."));
    itemBoxSizer20->Add(m_unitsMarginTop, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

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

    m_bottomMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_MARGIN_CHECKBOX, _("&Bottom:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_bottomMarginCheckbox->SetValue(false);
    itemFlexGridSizer9->Add(m_bottomMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer9->Add(itemBoxSizer25, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_marginBottom = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_marginBottom->SetHelpText(_("The bottom margin size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_marginBottom->SetToolTip(_("The bottom margin size."));
    itemBoxSizer25->Add(m_marginBottom, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsMarginBottomStrings;
    m_unitsMarginBottomStrings.Add(_("px"));
    m_unitsMarginBottomStrings.Add(_("cm"));
    m_unitsMarginBottom = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginBottomStrings, wxCB_READONLY );
    m_unitsMarginBottom->SetStringSelection(_("px"));
    m_unitsMarginBottom->SetHelpText(_("Units for the bottom margin."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsMarginBottom->SetToolTip(_("Units for the bottom margin."));
    itemBoxSizer25->Add(m_unitsMarginBottom, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer28, 0, wxGROW, 5);

    wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Padding"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText29->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT("")));
    itemBoxSizer28->Add(itemStaticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticLine* itemStaticLine30 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    itemBoxSizer28->Add(itemStaticLine30, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer31, 0, wxGROW, 5);

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

    wxFlexGridSizer* itemFlexGridSizer33 = new wxFlexGridSizer(0, 4, 0, 0);
    itemBoxSizer31->Add(itemFlexGridSizer33, 0, wxALIGN_CENTER_VERTICAL, 5);

    m_leftPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_PADDING_CHECKBOX, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_leftPaddingCheckbox->SetValue(false);
    itemFlexGridSizer33->Add(m_leftPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer35 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer33->Add(itemBoxSizer35, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_paddingLeft = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_paddingLeft->SetHelpText(_("The left padding size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_paddingLeft->SetToolTip(_("The left padding size."));
    itemBoxSizer35->Add(m_paddingLeft, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsPaddingLeftStrings;
    m_unitsPaddingLeftStrings.Add(_("px"));
    m_unitsPaddingLeftStrings.Add(_("cm"));
    m_unitsPaddingLeft = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingLeftStrings, wxCB_READONLY );
    m_unitsPaddingLeft->SetStringSelection(_("px"));
    m_unitsPaddingLeft->SetHelpText(_("Units for the left padding."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsPaddingLeft->SetToolTip(_("Units for the left padding."));
    itemBoxSizer35->Add(m_unitsPaddingLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

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

    m_rightPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_PADDING_CHECKBOX, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_rightPaddingCheckbox->SetValue(false);
    itemFlexGridSizer33->Add(m_rightPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer40 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer33->Add(itemBoxSizer40, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_paddingRight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_paddingRight->SetHelpText(_("The right padding size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_paddingRight->SetToolTip(_("The right padding size."));
    itemBoxSizer40->Add(m_paddingRight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsPaddingRightStrings;
    m_unitsPaddingRightStrings.Add(_("px"));
    m_unitsPaddingRightStrings.Add(_("cm"));
    m_unitsPaddingRight = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingRightStrings, wxCB_READONLY );
    m_unitsPaddingRight->SetStringSelection(_("px"));
    m_unitsPaddingRight->SetHelpText(_("Units for the right padding."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsPaddingRight->SetToolTip(_("Units for the right padding."));
    itemBoxSizer40->Add(m_unitsPaddingRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_topPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_PADDING_CHECKBOX, _("&Top:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_topPaddingCheckbox->SetValue(false);
    itemFlexGridSizer33->Add(m_topPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer33->Add(itemBoxSizer44, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_paddingTop = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_TOP_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_paddingTop->SetHelpText(_("The top padding size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_paddingTop->SetToolTip(_("The top padding size."));
    itemBoxSizer44->Add(m_paddingTop, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsPaddingTopStrings;
    m_unitsPaddingTopStrings.Add(_("px"));
    m_unitsPaddingTopStrings.Add(_("cm"));
    m_unitsPaddingTop = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingTopStrings, wxCB_READONLY );
    m_unitsPaddingTop->SetStringSelection(_("px"));
    m_unitsPaddingTop->SetHelpText(_("Units for the top padding."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsPaddingTop->SetToolTip(_("Units for the top padding."));
    itemBoxSizer44->Add(m_unitsPaddingTop, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

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

    m_bottomPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_PADDING_CHECKBOX, _("&Bottom:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_bottomPaddingCheckbox->SetValue(false);
    itemFlexGridSizer33->Add(m_bottomPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer49 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer33->Add(itemBoxSizer49, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);

    m_paddingBottom = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
    m_paddingBottom->SetHelpText(_("The bottom padding size."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_paddingBottom->SetToolTip(_("The bottom padding size."));
    itemBoxSizer49->Add(m_paddingBottom, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxArrayString m_unitsPaddingBottomStrings;
    m_unitsPaddingBottomStrings.Add(_("px"));
    m_unitsPaddingBottomStrings.Add(_("cm"));
    m_unitsPaddingBottom = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingBottomStrings, wxCB_READONLY );
    m_unitsPaddingBottom->SetStringSelection(_("px"));
    m_unitsPaddingBottom->SetHelpText(_("Units for the bottom padding."));
    if (wxRichTextMarginsPage::ShowToolTips())
        m_unitsPaddingBottom->SetToolTip(_("Units for the bottom padding."));
    itemBoxSizer49->Add(m_unitsPaddingBottom, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

////@end wxRichTextMarginsPage content construction
}
Exemple #26
0
void DialogEditLevelIDMrow::CreateControls()
{    
    DialogEditLevelIDMrow* itemDialog1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemDialog1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticText* itemStaticText4 = new wxStaticText;
    itemStaticText4->Create( itemDialog1, wxID_STATIC, _("Decision Matrix row"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText4->SetForegroundColour(wxColour(0, 128, 255));
#if  wxCHECK_VERSION(2, 9, 5)    
    itemStaticText4->SetFont( wxFont( wxFontInfo(8).FaceName("Tahoma").Bold() ) );
#else
    itemStaticText4->SetFont( wxFont( 8, wxSWISS, wxNORMAL, wxBOLD, false, wxT( "Tahoma" ) ) );
#endif    
    itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText6 = new wxStaticText;
    itemStaticText6->Create( itemDialog1, wxID_STATIC, _("Originating nickname :"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);

    m_oaddr = new wxTextCtrl;
    m_oaddr->Create( itemDialog1, ID_TEXTCTRL_ORIGINATING_ADDRESS, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer5->Add(m_oaddr, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);

    itemBoxSizer5->Add(75, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer9, 0, wxALIGN_RIGHT|wxALL, 1);

    wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer9->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);

    m_chkEnableDMRow = new wxCheckBox;
    m_chkEnableDMRow->Create( itemDialog1, 
                                ID_CHECKBOX_ENABLE_ROW, 
                                _("Enable DM row"), 
                                wxDefaultPosition, 
                                wxDefaultSize, 
                                wxALIGN_RIGHT );
    m_chkEnableDMRow->SetValue(false);
    itemBoxSizer10->Add(m_chkEnableDMRow, 0, wxALIGN_RIGHT|wxALL, 5);

    m_chkCheckOAddr = new wxCheckBox;
    m_chkCheckOAddr->Create( itemDialog1, 
                                ID_CHECKBOX_CHECK_OADDR, 
                                _("Check originating address"), 
                                wxDefaultPosition, 
                                wxDefaultSize, 
                                wxALIGN_RIGHT );
    m_chkCheckOAddr->SetValue(false);
    itemBoxSizer10->Add(m_chkCheckOAddr, 0, wxALIGN_RIGHT|wxALL, 5);

    m_chkHardOAddr = new wxCheckBox;
    m_chkHardOAddr->Create( itemDialog1, 
                                ID_CHECKBOX_HARDCODED_OADDR, 
                                _("Originating address should be hardcoded"), 
                                wxDefaultPosition, wxDefaultSize, 
                                wxALIGN_RIGHT );
    m_chkHardOAddr->SetValue(false);
    itemBoxSizer10->Add(m_chkHardOAddr, 0, wxALIGN_RIGHT|wxALL, 5);

    m_chkMatchZone = new wxCheckBox;
    m_chkMatchZone->Create( itemDialog1, 
                                ID_CHECKBOX_MATCH_ZONE, 
                                _("Zone should match"), 
                                wxDefaultPosition, 
                                wxDefaultSize, 
                                wxALIGN_RIGHT );
    m_chkMatchZone->SetValue(false);
    itemBoxSizer10->Add(m_chkMatchZone, 0, wxALIGN_RIGHT|wxALL, 5);

    m_chkMatchSubzone = new wxCheckBox;
    m_chkMatchSubzone->Create( itemDialog1, 
                                    ID_CHECKBOX_MATCH_SUBZONE, 
                                    _("Subzone should match"), 
                                    wxDefaultPosition, 
                                    wxDefaultSize, 
                                    wxALIGN_RIGHT );
    m_chkMatchSubzone->SetValue(false);
    itemBoxSizer10->Add(m_chkMatchSubzone, 0, wxALIGN_RIGHT|wxALL, 5);

    itemBoxSizer9->Add(80, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer17, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText18 = new wxStaticText;
    itemStaticText18->Create( itemDialog1, wxID_STATIC, _("Class Mask: "), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    m_classMask = new wxTextCtrl;
    m_classMask->Create( itemDialog1, ID_TEXTCTRL_CLASS_MASK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    m_classMask->SetBackgroundColour(wxColour(255, 192, 203));
    itemBoxSizer17->Add(m_classMask, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    wxButton* itemButton20 = new wxButton;
    itemButton20->Create( itemDialog1, ID_BUTTON_SELECT_EVENTS, _("..."), wxDefaultPosition, wxSize(20, -1), 0 );
    itemButton20->SetHelpText(_("Set filter/mask for events thatshould  trigger the DM row"));
    if (DialogEditLevelIDMrow::ShowToolTips())
        itemButton20->SetToolTip(_("Set filter/mask for events thatshould  trigger the DM row"));
    itemBoxSizer17->Add(itemButton20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer17->Add(50, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer22, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText23 = new wxStaticText;
    itemStaticText23->Create( itemDialog1, wxID_STATIC, _("Class Filter: "), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer22->Add(itemStaticText23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    m_classFilter = new wxTextCtrl;
    m_classFilter->Create( itemDialog1, ID_TEXTCTRL_CLASS_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    m_classFilter->SetBackgroundColour(wxColour(255, 192, 203));
    itemBoxSizer22->Add(m_classFilter, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    itemBoxSizer22->Add(80, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer26, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText27 = new wxStaticText;
    itemStaticText27->Create( itemDialog1, wxID_STATIC, _("Type Mask: "), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer26->Add(itemStaticText27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    m_typeMask = new wxTextCtrl;
    m_typeMask->Create( itemDialog1, ID_TEXTCTRL_TYPE_MASK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    m_typeMask->SetBackgroundColour(wxColour(144, 238, 144));
    itemBoxSizer26->Add(m_typeMask, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    itemBoxSizer26->Add(80, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer30, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText31 = new wxStaticText;
    itemStaticText31->Create( itemDialog1, wxID_STATIC, _("Type Filter: "), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer30->Add(itemStaticText31, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    m_typeFilter = new wxTextCtrl;
    m_typeFilter->Create( itemDialog1, ID_TEXTCTRL_TYPE_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    m_typeFilter->SetBackgroundColour(wxColour(144, 238, 144));
    itemBoxSizer30->Add(m_typeFilter, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    itemBoxSizer30->Add(80, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer34, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText35 = new wxStaticText;
    itemStaticText35->Create( itemDialog1, wxID_STATIC, _("Action :"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer34->Add(itemStaticText35, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);

    wxArrayString m_comboActionStrings;
    m_comboAction = new wxComboBox;
    m_comboAction->Create( itemDialog1, 
                            ID_COMBOCTRL_ACTION, 
                            wxEmptyString, 
                            wxDefaultPosition, 
                            wxSize(250, -1), 
                            m_comboActionStrings, 
                            wxCB_READONLY );
    itemBoxSizer34->Add(m_comboAction, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer34->Add(76, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer38 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer38, 0, wxALIGN_RIGHT|wxALL, 5);

    wxStaticText* itemStaticText39 = new wxStaticText;
    itemStaticText39->Create( itemDialog1, wxID_STATIC, _("Action parameter : "), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer38->Add(itemStaticText39, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    m_actionParam = new wxTextCtrl;
    m_actionParam->Create( itemDialog1, ID_TEXTCTRL_ACTION_PARAMETER, wxEmptyString, wxDefaultPosition, wxSize(100, -1), 0 );
    itemBoxSizer38->Add(m_actionParam, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

    itemBoxSizer38->Add(82, 1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer42 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxButton* itemButton43 = new wxButton;
    itemButton43->Create( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer42->Add(itemButton43, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton44 = new wxButton;
    itemButton44->Create( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer42->Add(itemButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

}
Exemple #27
0
void BattleRoomTab::UpdateBattleInfo( const wxString& Tag )
{
    if ( !m_battle ) return;

    long index = m_opt_list_map[ Tag ];
    OptionsWrapper::GameOption type = ( OptionsWrapper::GameOption )s2l( Tag.BeforeFirst( '_' ) );
    wxString key = Tag.AfterFirst( '_' );
    wxString value;
    if ( ( type == OptionsWrapper::MapOption ) || ( type == OptionsWrapper::ModOption ) || ( type == OptionsWrapper::EngineOption ) )
    {
        OptionType DataType = m_battle->CustomBattleOptions().GetSingleOptionType( key );
        value = m_battle->CustomBattleOptions().getSingleValue( key, ( OptionsWrapper::GameOption )type );
        if ( m_battle->CustomBattleOptions().getDefaultValue( key, type ) == value ) m_opts_list->SetItemFont( index, wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT ) );
        else m_opts_list->SetItemFont( index, wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD ) );
        if ( DataType == opt_bool )
        {
            value =  bool2yn( s2l( value ) ); // convert from 0/1 to literal Yes/No
        }
        else if ( DataType == opt_list )
        {
            value = m_battle->CustomBattleOptions().GetNameListOptValue( key, type ); // get the key full name not short key
        }
        m_opts_list->SetItem( index, 1, value );
    }
    else if ( type == OptionsWrapper::PrivateOptions )
    {
        if ( key == _T( "mapname" ) ) // the map has been changed
        {
            try   // updates map info summary
            {
                ASSERT_EXCEPTION( m_battle->MapExists(), _( "Map does not exist." ) );
                UnitSyncMap map = m_battle->LoadMap();
                m_opts_list->SetItem( m_opt_list_map[ _( "Size" ) ] , 1, wxString::Format( _T( "%.0fx%.0f" ), map.info.width / 512.0, map.info.height / 512.0 ) );
                m_opts_list->SetItem( m_opt_list_map[ _( "Windspeed" ) ], 1, wxString::Format( _T( "%d-%d" ), map.info.minWind, map.info.maxWind ) );
                m_opts_list->SetItem( m_opt_list_map[ _( "Tidal strength" ) ], 1, wxString::Format( _T( "%d" ), map.info.tidalStrength ) );
                //    m_opts_list->SetItem( 0, 1,  );
            }
            catch ( ... )
            {
                m_opts_list->SetItem( m_opt_list_map[ _( "Size" ) ], 1, _T( "?x?" ) );
                m_opts_list->SetItem( m_opt_list_map[ _( "Windspeed" ) ], 1, _T( "?-?" ) );
                m_opts_list->SetItem( m_opt_list_map[ _( "Tidal strength" ) ], 1, _T( "?" ) );
            }
            wxString mapname =m_battle->GetHostMapName();
            int index_ = m_map_combo->FindString( mapname );
            if ( index_ != wxNOT_FOUND )
                m_map_combo->SetSelection( index_ );
            else
                m_map_combo->SetValue( mapname );

            //delete any eventual map option from the list and add options of the new map
            for ( long i = m_map_opts_index; i < m_opts_list->GetItemCount(); i++ )
                m_opts_list->DeleteItem( i );
            AddMMOptionsToList( m_map_opts_index, OptionsWrapper::MapOption );

            m_minimap->UpdateMinimap();

        }
        else if ( key == _T( "restrictions" ) )
        {
            m_opts_list->SetItem( index, 1, bool2yn( m_battle->RestrictedUnits().size() > 0 ) );
        }
    }
}
DIALOG_LIB_EDIT_DRAW_ITEM_BASE::DIALOG_LIB_EDIT_DRAW_ITEM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* dlgBorderSizer;
	dlgBorderSizer = new wxBoxSizer( wxVERTICAL );
	
	m_staticText1 = new wxStaticText( this, wxID_ANY, _("General"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	m_staticText1->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	dlgBorderSizer->Add( m_staticText1, 0, wxALIGN_LEFT, 3 );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer3->Add( 12, 0, 0, wxEXPAND, 3 );
	
	m_staticWidth = new wxStaticText( this, wxID_ANY, _("&Width:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticWidth->Wrap( -1 );
	bSizer3->Add( m_staticWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	
	bSizer3->Add( 0, 0, 1, wxEXPAND, 3 );
	
	m_textWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer3->Add( m_textWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	m_staticWidthUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticWidthUnits->Wrap( -1 );
	bSizer3->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	dlgBorderSizer->Add( bSizer3, 0, wxALL|wxEXPAND, 0 );
	
	m_staticTextSharing = new wxStaticText( this, ID_M_STATICTEXTSHARING, _("Sharing"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextSharing->Wrap( -1 );
	m_staticTextSharing->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	dlgBorderSizer->Add( m_staticTextSharing, 0, wxTOP|wxBOTTOM, 5 );
	
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer4->Add( 12, 0, 0, wxEXPAND, 3 );
	
	m_checkApplyToAllUnits = new wxCheckBox( this, wxID_ANY, _("Shared by all &parts in component"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer4->Add( m_checkApplyToAllUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	dlgBorderSizer->Add( bSizer4, 0, wxALL|wxEXPAND, 0 );
	
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer5->Add( 12, 0, 0, wxEXPAND, 3 );
	
	m_checkApplyToAllConversions = new wxCheckBox( this, wxID_ANY, _("Shared by all body &styles (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer5->Add( m_checkApplyToAllConversions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	dlgBorderSizer->Add( bSizer5, 0, wxEXPAND, 3 );
	
	
	dlgBorderSizer->Add( 0, 0, 0, wxALL|wxEXPAND, 10 );
	
	m_staticText4 = new wxStaticText( this, wxID_ANY, _("Fill Style"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	m_staticText4->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	dlgBorderSizer->Add( m_staticText4, 0, wxALIGN_LEFT|wxBOTTOM, 3 );
	
	wxBoxSizer* bSizer6;
	bSizer6 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer6->Add( 12, 0, 0, wxEXPAND, 3 );
	
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxVERTICAL );
	
	m_radioFillNone = new wxRadioButton( this, wxID_ANY, _("Do &not fill"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
	m_radioFillNone->SetValue( true ); 
	bSizer7->Add( m_radioFillNone, 0, wxALL, 3 );
	
	m_radioFillForeground = new wxRadioButton( this, wxID_ANY, _("Fill &foreground"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( m_radioFillForeground, 0, wxALL, 3 );
	
	m_radioFillBackground = new wxRadioButton( this, wxID_ANY, _("Fill &background"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( m_radioFillBackground, 0, wxALL, 3 );
	
	bSizer6->Add( bSizer7, 0, wxEXPAND, 0 );
	
	dlgBorderSizer->Add( bSizer6, 1, wxALL|wxEXPAND, 0 );
	
	
	dlgBorderSizer->Add( 0, 0, 0, wxALL|wxEXPAND, 10 );
	
	m_sdbSizer1 = new wxStdDialogButtonSizer();
	m_sdbSizer1OK = new wxButton( this, wxID_OK );
	m_sdbSizer1->AddButton( m_sdbSizer1OK );
	m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
	m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
	m_sdbSizer1->Realize();
	dlgBorderSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 0 );
	
	mainSizer->Add( dlgBorderSizer, 1, wxALL|wxEXPAND, 12 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	mainSizer->Fit( this );
	
	this->Centre( wxBOTH );
}
bool TimeTextCtrl::Layout()
{
   unsigned int i, j;
   int x, pos;

   wxMemoryDC memDC;
   if (mBackgroundBitmap) {
      delete mBackgroundBitmap;
      mBackgroundBitmap = NULL;
   }
   // Placeholder bitmap so the memDC has something to reference
   mBackgroundBitmap = new wxBitmap(1, 1);
   memDC.SelectObject(*mBackgroundBitmap);

   mDigits.Clear();

   mBorderLeft = 1;
   mBorderTop = 1;
   mBorderRight = 1;
   mBorderBottom = 1;

   int fontSize = 4;
   wxCoord strW, strH;
   wxString exampleText = wxT("0");

   // Keep making the font bigger until it's too big, then subtract one.
   memDC.SetFont(wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL));
   memDC.GetTextExtent(exampleText, &strW, &strH);
   while(strW <= mDigitBoxW && strH <= mDigitBoxH) {
      fontSize++;
      memDC.SetFont(wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL));
      memDC.GetTextExtent(exampleText, &strW, &strH);
   }
   fontSize--;

   if (mDigitFont)
      delete mDigitFont;
   mDigitFont = new wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL);
   memDC.SetFont(*mDigitFont);
   memDC.GetTextExtent(exampleText, &strW, &strH);
   mDigitW = strW;
   mDigitH = strH;

   // The label font should be a little smaller
   fontSize--;
   if (mLabelFont)
      delete mLabelFont;
   mLabelFont = new wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL);

   // Figure out the x-position of each field and label in the box
   x = mBorderLeft;
   pos = 0;

   memDC.SetFont(*mLabelFont);
   memDC.GetTextExtent(mPrefix, &strW, &strH);
   x += strW;
   pos += mPrefix.Length();

   for(i=0; i<mFields.GetCount(); i++) {
      mFields[i].fieldX = x;
      for(j=0; j<(unsigned int)mFields[i].digits; j++) {
         mDigits.Add(DigitInfo(i, j, pos, wxRect(x, mBorderTop,
                                                 mDigitBoxW, mDigitBoxH)));
         x += mDigitBoxW;
         pos++;
      }

      mFields[i].labelX = x;
      memDC.GetTextExtent(mFields[i].label, &strW, &strH);
      pos += mFields[i].label.Length();
      x += strW;
      mFields[i].fieldW = x;
   }

   mWidth = x + mBorderRight;
   mHeight = mDigitBoxH + mBorderTop + mBorderBottom;

   // Draw the background bitmap - it contains black boxes where
   // all of the digits go and all of the other text

   wxBrush Brush;

   delete mBackgroundBitmap; // Delete placeholder
   mBackgroundBitmap = new wxBitmap(mWidth + mButtonWidth, mHeight);
   memDC.SelectObject(*mBackgroundBitmap);

   memDC.SetBrush(*wxLIGHT_GREY_BRUSH);
   memDC.SetPen(*wxTRANSPARENT_PEN);
   memDC.DrawRectangle(0, 0, mWidth + mButtonWidth, mHeight);

   int numberBottom = mBorderTop + (mDigitBoxH - mDigitH)/2 + mDigitH;

   memDC.GetTextExtent(wxT("0"), &strW, &strH);
   int labelTop = numberBottom - strH;

   memDC.SetTextForeground(*wxBLACK);
   memDC.SetTextBackground(*wxLIGHT_GREY);
   memDC.DrawText(mPrefix, mBorderLeft, labelTop);

   theTheme.SetBrushColour( Brush, clrTimeBack );
   memDC.SetBrush(Brush);
   memDC.SetBrush(*wxLIGHT_GREY_BRUSH);
   for(i=0; i<mDigits.GetCount(); i++)
      memDC.DrawRectangle(mDigits[i].digitBox);
   memDC.SetBrush( wxNullBrush );

   for(i=0; i<mFields.GetCount(); i++)
      memDC.DrawText(mFields[i].label,
                     mFields[i].labelX, labelTop);

   if (mMenuEnabled) {
      wxRect r(mWidth, 0, mButtonWidth - 1, mHeight - 1);
      AColor::Bevel(memDC, true, r);
      memDC.SetBrush(*wxBLACK_BRUSH);
      memDC.SetPen(*wxBLACK_PEN);
      AColor::Arrow(memDC,
                    mWidth + 1,
                    (mHeight / 2) - 2,
                    mButtonWidth - 2);
   }
   return true;
}
Exemple #30
0
void wxFontDialog::SetChosenFont(const char *fontname)
{
    m_fontData.SetChosenFont(wxFont( wxString::FromAscii(fontname) ));
}