Changeset 73

Show
Ignore:
Timestamp:
10/19/07 20:01:00 (4 years ago)
Author:
uncle_fungus
Message:

Fixed #7 and fixed correct bug with proxy username box

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mactest/src/benchmarksDialog.cpp

    r38 r73  
    7575        mSplitter->SetMinimumPaneSize(20); 
    7676 
     77        #ifndef __WXMAC__ 
    7778        mBenchmarksInformation->SetFont(wxFont(8, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); 
     79        #else 
     80        mBenchmarksInformation->SetFont(wxFont(9, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); 
     81        #endif 
     82         
    7883 
    7984        _PrefsGetUint(PREF_BENCHMARKSDIALOG_COLUMNWIDTH, columnWidth); 
     
    8691        mainSizer->Add(mSplitter, 1, wxEXPAND); 
    8792        mainSizer->AddSpacer(FMC_GUI_SPACING_HIGH); 
     93        #ifndef __WXMAC__ 
    8894        mainSizer->Add(new wxButton(this, wxID_CLOSE), 0, wxALIGN_CENTER_HORIZONTAL); 
     95        #endif 
    8996 
    9097        // --- 
  • branches/mactest/src/include/preferencesDialog.h

    r43 r73  
    2222#include "wx/dialog.h" 
    2323#include "wx/choice.h" 
     24#ifndef __WXMAC__ 
    2425#include "wx/notebook.h" 
     26#else 
     27#include "wx/choicebk.h" 
     28#endif 
    2529#include "wx/textctrl.h" 
    2630#include "wx/checkbox.h" 
     
    121125        ~PreferencesDialog(void); 
    122126 
    123         wxPanel* CreateGeneralTab(wxNotebook* parent); 
    124         wxPanel* CreateMonitoringTab(wxNotebook* parent); 
    125         wxPanel* CreateNetworkingTab(wxNotebook* parent); 
    126         wxPanel* CreateAdvancedTab(wxNotebook* parent); 
    127         wxPanel* CreateSystemTab(wxNotebook* parent); 
    128         //wxPanel* CreateFahinfoTab(wxNotebook* parent); 
    129         wxPanel* CreateWebAppTab(wxNotebook* parent); 
     127        wxPanel* CreateGeneralTab(wxBookCtrlBase* parent); 
     128        wxPanel* CreateMonitoringTab(wxBookCtrlBase* parent); 
     129        wxPanel* CreateNetworkingTab(wxBookCtrlBase* parent); 
     130        wxPanel* CreateAdvancedTab(wxBookCtrlBase* parent); 
     131        wxPanel* CreateSystemTab(wxBookCtrlBase* parent); 
     132        //wxPanel* CreateFahinfoTab(wxBookCtrlBase* parent); 
     133        wxPanel* CreateWebAppTab(wxBookCtrlBase* parent); 
    130134 
    131135        void LoadPreferences(void); 
     
    139143        void OnCheckboxes(wxCommandEvent& event); 
    140144        void OnChoices(wxCommandEvent& event); 
    141  
     145        #ifdef __WXMAC__ 
     146        void OnClose(wxCloseEvent& event); 
     147        #endif 
    142148 
    143149public: 
  • branches/mactest/src/preferencesDialog.cpp

    r72 r73  
    7575        EVT_CHOICE(CHC_FILEMANAGER,                 PreferencesDialog::OnChoices) 
    7676        // EVT_CHOICE(CHK_PPDTYPE, PreferencesDialog::OnChoices) 
     77         
     78        #ifdef __WXMAC__ 
     79        EVT_CLOSE(PreferencesDialog::OnClose) 
     80        #endif 
    7781 
    7882END_EVENT_TABLE() 
     
    9094        wxBoxSizer *topLevelSizer; 
    9195        wxBoxSizer *mainSizer; 
     96        #ifndef __WXMAC__ 
    9297        wxBoxSizer *buttonsSizer; 
    9398        wxNotebook *noteBook; 
    94  
     99        #else 
     100        wxChoicebook *noteBook; 
     101        #endif 
     102         
    95103        // Preferences are divided into groups, thanks to a wxNoteBook (tabbed control) 
     104        #ifndef __WXMAC__ 
    96105        noteBook = new wxNotebook(this, wxID_ANY); 
     106        #else 
     107        noteBook = new wxChoicebook(this, wxID_ANY); 
     108        #endif 
     109         
     110        //this.SetFont(wxSMALL_FONT); 
     111         
     112        //noteBook.SetFont(wxSMALL_FONT); 
    97113 
    98114        noteBook->AddPage(CreateGeneralTab(noteBook),    _("General")); 
     
    104120        noteBook->AddPage(CreateWebAppTab(noteBook),     _("WebApp")); 
    105121 
     122#ifndef __WXMAC__ 
    106123        // Buttons 'Ok' and 'Cancel' are right-aligned 
    107124        buttonsSizer = new wxBoxSizer(wxHORIZONTAL); 
     
    110127        buttonsSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
    111128        buttonsSizer->Add(new wxButton(this, wxID_OK), 0, wxALIGN_RIGHT); 
    112  
     129#endif 
    113130        // Construct the dialog 
    114131        mainSizer = new wxBoxSizer(wxVERTICAL); 
     
    116133        mainSizer->Add(noteBook, 1, wxEXPAND); 
    117134        mainSizer->AddSpacer(FMC_GUI_SPACING_HIGH); 
     135#ifndef __WXMAC__ 
    118136        mainSizer->Add(buttonsSizer, 0, wxALIGN_RIGHT); 
     137#endif 
    119138 
    120139        // The final sizer 
     
    163182* Create the tab containing general preferences 
    164183**/ 
    165 inline wxPanel* PreferencesDialog::CreateGeneralTab(wxNotebook* parent) 
     184inline wxPanel* PreferencesDialog::CreateGeneralTab(wxBookCtrlBase* parent) 
    166185{ 
    167186        wxPanel    *panel; 
     
    201220* Create the tab containing monitoring preferences 
    202221**/ 
    203 inline wxPanel* PreferencesDialog::CreateMonitoringTab(wxNotebook* parent) 
     222inline wxPanel* PreferencesDialog::CreateMonitoringTab(wxBookCtrlBase* parent) 
    204223{ 
    205224        wxPanel    *panel; 
     
    264283* Create the tab containing networking preferences 
    265284**/ 
    266 inline wxPanel* PreferencesDialog::CreateNetworkingTab(wxNotebook* parent) 
     285inline wxPanel* PreferencesDialog::CreateNetworkingTab(wxBookCtrlBase* parent) 
    267286{ 
    268287        wxPanel    *panel; 
     
    282301        mNetworkingProxyPort              = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC)); 
    283302        mNetworkingUseProxyAuthentication = new wxCheckBox(panel, CHK_PROXYAUTHENTICATION, _("Proxy requires authentication")); 
    284         mNetworkingProxyUsername          = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 
     303        mNetworkingProxyUsername          = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize); 
    285304        mNetworkingProxyPassword          = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); 
    286305        mNetworkingLabelAddress           = new wxStaticText(panel, wxID_ANY, _("Address:")); 
    287306        mNetworkingLabelPort              = new wxStaticText(panel, wxID_ANY, _("Port:")); 
    288         mNetworkingLabelUsername          = new wxStaticText(panel, wxID_ANY, _("Proxy\nUsername:")); 
    289         mNetworkingLabelPassword          = new wxStaticText(panel, wxID_ANY, _("Proxy\nPassword:")); 
     307        mNetworkingLabelUsername          = new wxStaticText(panel, wxID_ANY, _("Username:")); 
     308        mNetworkingLabelPassword          = new wxStaticText(panel, wxID_ANY, _("Password:")); 
    290309 
    291310        proxyAddressSizer->Add(mNetworkingLabelAddress, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     
    296315 
    297316        proxyAuthenticationSizer->Add(mNetworkingLabelUsername, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
    298         proxyAuthenticationSizer->Add(mNetworkingProxyUsername, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND); 
     317        proxyAuthenticationSizer->Add(mNetworkingProxyUsername, 1, wxALIGN_CENTER_VERTICAL); 
    299318        proxyAuthenticationSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
    300319        proxyAuthenticationSizer->Add(mNetworkingLabelPassword, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     
    320339* Create the tab containing networking preferences 
    321340**/ 
    322 inline wxPanel* PreferencesDialog::CreateAdvancedTab(wxNotebook* parent) 
     341inline wxPanel* PreferencesDialog::CreateAdvancedTab(wxBookCtrlBase* parent) 
    323342{ 
    324343        wxPanel    *panel; 
     
    387406* Create the tab containing general preferences 
    388407**/ 
    389 inline wxPanel* PreferencesDialog::CreateSystemTab(wxNotebook* parent) 
     408inline wxPanel* PreferencesDialog::CreateSystemTab(wxBookCtrlBase* parent) 
    390409{ 
    391410        wxPanel    *panel; 
     
    464483* Create the tab containing fahinfo.org integration preferences 
    465484**/ 
    466 /*inline wxPanel* PreferencesDialog::CreateFahinfoTab(wxNotebook* parent) 
     485/*inline wxPanel* PreferencesDialog::CreateFahinfoTab(wxBookCtrlBase* parent) 
    467486{ 
    468487        wxPanel    *panel; 
     
    477496* Create the tab containing web application preferences 
    478497**/ 
    479 inline wxPanel* PreferencesDialog::CreateWebAppTab(wxNotebook* parent) 
     498inline wxPanel* PreferencesDialog::CreateWebAppTab(wxBookCtrlBase* parent) 
    480499{ 
    481500        wxPanel    *panel; 
     
    941960} 
    942961 
     962#ifdef __WXMAC__ 
     963/** 
     964* Mac Specific close routine to save the preferences: no close button 
     965**/ 
     966void PreferencesDialog::OnClose(wxCloseEvent& event) 
     967{ 
     968        SavePreferences(); 
     969        PreferencesManager::GetInstance()->Save(); 
     970        event.Skip(); 
     971} 
     972#endif 
    943973 
    944974/**