Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv18724 Modified Files: DownloadListCtrl.h GUISettingsDlg.cpp GUISettingsDlg.h KnownListCtrl.h MainDlg.h MessagesWnd.h QueueListCtrl.h SearchListCtrl.h ServerListCtrl.h ServerWnd.cpp ServerWnd.h SharedFilesListCtrl.h SharedFilesWnd.h StatisticsTreeCtrl.h TransferWnd.h UploadListCtrl.h defines.h wxInterface.wdr wxInterface_wdr.cpp wxInterface_wdr.h Log Message: Finally fixed win32 checkboxes by moving relevant control generation functions out from wxDesigner generated code and ifdefing flags as neccesery. Now works perfectly on wxMSW and wxX11. Index: DownloadListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/DownloadListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DownloadListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ DownloadListCtrl.h 24 Nov 2003 16:06:31 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CDownloadListCtrl: public CMListCtrl { Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- GUISettingsDlg.cpp 23 Nov 2003 12:14:52 -0000 1.20 +++ GUISettingsDlg.cpp 24 Nov 2003 16:06:31 -0000 1.21 @@ -52,7 +52,7 @@ wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize &size, long style ) : wxDialog(parent, id, title, position, size, style) { - Dlg_GUI_Settings(this, true, true); + CreateControls(); Center(); LoadSettings(); @@ -348,6 +348,182 @@ GetIconSet()->Delete(GetIconSet()->GetSelection()); } GetIconSet()->SetSelection(0); +} + +void CGUISettingsDlg::CreateControls() { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxGridSizer *item1 = new wxGridSizer( 2, 0, 0, 0 ); + + wxStaticBox *item3 = new wxStaticBox( this, -1, _("Language") ); + wxStaticBoxSizer *item2 = new wxStaticBoxSizer( item3, wxVERTICAL ); + + wxString *strs4 = (wxString*) NULL; + wxChoice *item4 = new wxChoice( this, ID_LANG, wxDefaultPosition, wxSize(100,-1), 0, strs4, 0 ); +#ifndef __WXX11__ + item4->SetToolTip( _("Change the language of the interface. Requires interface restart to take effect") ); +#endif + item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxGridSizer *item5 = new wxGridSizer( 2, 0, 0 ); + + wxButton *item6 = new wxButton( this, ID_BTN_ADDLANG, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item6->SetToolTip( _("Add new language") ); +#endif + item5->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxButton *item7 = new wxButton( this, ID_BTN_REMOVELANG, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item7->SetToolTip( _("Remove currently selected language") ); +#endif + item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 ); + + item2->Add( item5, 0, wxALIGN_CENTER, 5 ); + + item1->Add( item2, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); + + wxStaticBox *item9 = new wxStaticBox( this, -1, _("Icon set") ); + wxStaticBoxSizer *item8 = new wxStaticBoxSizer( item9, wxVERTICAL ); + + wxString *strs10 = (wxString*) NULL; + wxChoice *item10 = new wxChoice( this, ID_ICONSET, wxDefaultPosition, wxSize(100,-1), 0, strs10, 0 ); +#ifndef __WXX11__ + item10->SetToolTip( _("Change the iconet the interface should use. Requires restart to take effect") ); +#endif + item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxGridSizer *item11 = new wxGridSizer( 2, 0, 0 ); + + wxButton *item12 = new wxButton( this, ID_BTN_ADDICONSET, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item12->SetToolTip( _("Add new iconset") ); +#endif + item11->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxButton *item13 = new wxButton( this, ID_BTN_REMOVEICONSET, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item13->SetToolTip( _("Remove currently selected iconset") ); +#endif + item11->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 ); + + item8->Add( item11, 0, wxALIGN_CENTER, 5 ); + + item1->Add( item8, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); + + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxFlexGridSizer *item14 = new wxFlexGridSizer( 2, 0, 0 ); + + wxStaticBox *item16 = new wxStaticBox( this, -1, _("Font") ); + wxStaticBoxSizer *item15 = new wxStaticBoxSizer( item16, wxVERTICAL ); + + wxString strs17[] = { + _("Default") + }; + wxChoice *item17 = new wxChoice( this, ID_FONT, wxDefaultPosition, wxSize(100,-1), 1, strs17, 0 ); +#ifndef __WXX11__ + item17->SetToolTip( _("Change the font") ); +#endif + item15->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxStaticText *item18 = new wxStaticText( this, ID_TEXT, _("Font Test :)"), wxDefaultPosition, wxDefaultSize, 0 ); + item15->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 ); + + item14->Add( item15, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); + + wxStaticBox *item20 = new wxStaticBox( this, -1, _("Startup page") ); + wxStaticBoxSizer *item19 = new wxStaticBoxSizer( item20, wxVERTICAL ); + + wxString strs21[] = { + _("Server"), + _("Transfer"), + _("Search"), + _("Shared Files"), + _("Messages"), + _("Statistics") + }; + wxChoice *item21 = new wxChoice( this, ID_STARTPAGE, wxDefaultPosition, wxSize(100,-1), 6, strs21, 0 ); +#ifndef __WXX11__ + item21->SetToolTip( _("Set which page will be displayed on program startup") ); +#endif + item19->Add( item21, 0, wxGROW|border_style, 5 ); + + wxCheckBox *item22 = new wxCheckBox( this, ID_REMEMBER_LAST, _("Remember last"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item22->SetToolTip( _("Automatically remember which page was open between sessions") ); +#endif + item19->Add( item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + item14->Add( item19, 0, wxLEFT|wxRIGHT, 5 ); + + item0->Add( item14, 0, 0, 5 ); + + wxBoxSizer *item23 = new wxBoxSizer( wxVERTICAL ); + + wxCheckBox *item24 = new wxCheckBox( this, ID_SHOWSPLASH, _("Show splashscreen"), wxDefaultPosition, wxDefaultSize, 0 ); + item24->SetValue( TRUE ); +#ifndef __WXX11__ + item24->SetToolTip( _("Toggle wether splashscreen should be shown on program startup or not. Speeds up application starting if turned off. Default: On") ); +#endif + item23->Add( item24, 0, wxGROW|wxLEFT|border_style, 5 ); + + wxCheckBox *item25 = new wxCheckBox( this, ID_PROMPTEXIT, _("Prompt on exit"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item25->SetToolTip( _("Toggle wether confirmation is requested when closing program.") ); +#endif + item23->Add( item25, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); + + wxBoxSizer *item26 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item27 = new wxCheckBox( this, ID_SHOWTOOL, _("Show ToolBar"), wxDefaultPosition, wxDefaultSize, 0 ); + item27->SetValue( TRUE ); +#ifndef __WXX11__ + item27->SetToolTip( _("Toggle wether toolbar is shown or not. Requires restart to take effect.") ); +#endif + item26->Add( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); + + wxString strs28[] = { + _("Horizontal"), + _("Vertical") + }; + wxChoice *item28 = new wxChoice( this, ID_TOOLALIGN, wxDefaultPosition, wxSize(100,-1), 2, strs28, 0 ); +#ifndef __WXX11__ + item28->SetToolTip( _("Horizontal tooltip is shown on top of window (default), vertical is shown on the left side of window. Requires restart to take effect.") ); +#endif + item26->Add( item28, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + item23->Add( item26, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxCheckBox *item29 = new wxCheckBox( this, ID_SHOWMENU, _("Show MenuBar"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item29->SetToolTip( _("Toggle wether menubar (file/view etc) should be shown or not. Requires restart to take effect.") ); +#endif + item23->Add( item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|border_style, 5 ); + + item0->Add( item23, 0, wxGROW, 5 ); + + wxBoxSizer *item30 = new wxBoxSizer( wxHORIZONTAL ); + + wxButton *item31 = new wxButton( this, GUI_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); + item31->SetDefault(); +#ifndef __WXX11__ + item31->SetToolTip( _("Save settings and close dialog") ); +#endif + item30->Add( item31, 0, wxALIGN_CENTER|wxALL, 5 ); + + wxButton *item32 = new wxButton( this, GUI_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item32->SetToolTip( _("Abort changes and close dialog") ); +#endif + item30->Add( item32, 0, wxALIGN_CENTER|wxALL, 5 ); + + item0->Add( item30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + SetAutoLayout( TRUE ); + SetSizer( item0 ); + item0->Fit( this ); + item0->SetSizeHints( this ); } /******************** Index: GUISettingsDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- GUISettingsDlg.h 20 Nov 2003 01:27:26 -0000 1.11 +++ GUISettingsDlg.h 24 Nov 2003 16:06:31 -0000 1.12 @@ -55,6 +55,7 @@ /* Other functions */ void SaveSettings(); void LoadSettings(); + void CreateControls(); /* Getters for dialog controls */ wxCheckBox* GetShowMenu() { Index: KnownListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/KnownListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- KnownListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ KnownListCtrl.h 24 Nov 2003 16:06:31 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CKnownListCtrl: public CMListCtrl { Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MainDlg.h 24 Nov 2003 14:21:58 -0000 1.5 +++ MainDlg.h 24 Nov 2003 16:06:31 -0000 1.6 @@ -39,6 +39,8 @@ #include "MessagesWnd.h" #include "StatisticsWnd.h" #include "SysTray.h" +#include "Images.h" +#include "GUISettingsDlg.h" /* * Constants for MainDlg Index: MessagesWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MessagesWnd.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- MessagesWnd.h 20 Nov 2003 01:27:26 -0000 1.7 +++ MessagesWnd.h 24 Nov 2003 16:06:32 -0000 1.8 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "Images.h" class CMessagesWnd: public wxPanel { public: Index: QueueListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/QueueListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- QueueListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ QueueListCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CQueueListCtrl: public CMListCtrl { Index: SearchListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchListCtrl.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SearchListCtrl.h 20 Nov 2003 01:27:26 -0000 1.5 +++ SearchListCtrl.h 24 Nov 2003 16:06:32 -0000 1.6 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CSearchListCtrl: public CMListCtrl { Index: ServerListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerListCtrl.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ServerListCtrl.h 20 Nov 2003 01:27:26 -0000 1.7 +++ ServerListCtrl.h 24 Nov 2003 16:06:32 -0000 1.8 @@ -30,6 +30,8 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" +#include "Images.h" #include "ServerWnd.h" extern class CServerListCtrl *serverlistctrl; Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- ServerWnd.cpp 24 Nov 2003 14:21:58 -0000 1.39 +++ ServerWnd.cpp 24 Nov 2003 16:06:32 -0000 1.40 @@ -49,7 +49,7 @@ */ CServerWnd::CServerWnd( wxWindow *parent, wxWindowID id, const wxPoint &position, - const wxSize& size, long style ) + const wxSize& size, long style ) : wxPanel( parent, id, position, size, style ) { bool show_sidebar; @@ -191,7 +191,7 @@ sidebar, -1, _("Add new server"), wxT("SideBar_AddServer") ); wxPanel *addserver_cnt = new wxPanel(addserver, -1); - Server_AddServerPanel(addserver_cnt); + AddServerPanel(addserver_cnt); addserver->SetContent(addserver_cnt); sbmain->Add(addserver, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -199,7 +199,7 @@ sidebar, -1, _("Update from URL"), wxT("SideBar_UpdateServer") ); wxPanel *updatelist_cnt = new wxPanel(updatelist, -1); - Server_UpdatePanel(updatelist_cnt); + UpdatePanel(updatelist_cnt); updatelist->SetContent(updatelist_cnt); sbmain->Add(updatelist, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -207,7 +207,7 @@ sidebar, -1, _("Server settings"), wxT("SideBar_ServerSettings") ); wxPanel *serversettings_cnt = new wxPanel(serversettings, -1); - Server_SettingsPanel(serversettings_cnt); + SettingsPanel(serversettings_cnt); serversettings->SetContent(serversettings_cnt); sbmain->Add(serversettings, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -215,7 +215,7 @@ sidebar, -1, _("Port settings"), wxT("SideBar_PortSettings") ); wxPanel *portsettings_cnt = new wxPanel(portsettings, -1); - Server_PortSettingsPanel(portsettings_cnt); + PortSettingsPanel(portsettings_cnt); portsettings->SetContent(portsettings_cnt); sbmain->Add(portsettings, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -223,7 +223,7 @@ sidebar, -1, _("Log options"), wxT("SideBar_LoggingOptions") ); wxPanel *logoptions_cnt = new wxPanel(logoptions, -1); - Server_LogOptionsPanel(logoptions_cnt); + LogOptionsPanel(logoptions_cnt); logoptions->SetContent(logoptions_cnt); sbmain->Add(logoptions, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 0); @@ -299,4 +299,262 @@ Layout(); Refresh(); #endif +} + +/** + * Control generation for Server Page SideBar Settings Panel. Moved here from + * wxInterface_wdr.cpp to fix wxCheckBox borders (need wxALL on wxMSW and none + * on wxGTK. + */ +wxSizer* CServerWnd::SettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxCheckBox *item1 = new wxCheckBox( parent, ID_SS_AUTO_CONNECT, _("Autoconnect"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item1->SetToolTip( _("Toggle wether application should automatically connect to any server on startup") ); +#endif + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item3 = new wxCheckBox( parent, ID_SS_AC_STATIC_ONLY, _("To static only"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item3->SetToolTip( _("Toggle wether application should connect to servers marked as \"static\" only") ); +#endif + item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 15 ); + + wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); + item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer *item5 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBitmap *item6 = new wxStaticBitmap( parent, ID_SS_SERVER_IMG, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item5->Add( item6, 0, wxALIGN_CENTER|wxLEFT, 5 ); + + wxStaticText *item7 = new wxStaticText( parent, ID_SS_SERVER_NAME, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); + item5->Add( item7, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); + + item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); + + wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item10 = new wxCheckBox( parent, ID_CHECK_SS_STATIC, _("Static"), wxDefaultPosition, wxSize(130,-1), 0 ); +#ifndef __WXX11__ + item10->SetToolTip( _("Set server static. Static servers are not removed from list if they do not respond") ); +#endif + item9->Add( item10, 0, wxALIGN_CENTER|border_style, 5 ); + + item8->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer *item11 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticText *item12 = new wxStaticText( parent, ID_TEXT, _("Priority:"), wxDefaultPosition, wxDefaultSize, 0 ); + item11->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxString strs13[] = { + _("High"), + _("Normal"), + _("Low") + }; + wxChoice *item13 = new wxChoice( parent, ID_SS_PRIO, wxDefaultPosition, wxSize(80,-1), 3, strs13, 0 ); +#ifndef __WXX11__ + item13->SetToolTip( _("Change server priority") ); +#endif + item11->Add( item13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + item8->Add( item11, 0, wxALIGN_CENTER, 5 ); + + item0->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +/** + * Control generation for Server SideBar Page Log Options Panel. Moved here from + * wxInterface_wdr.cpp to fix wxCheckBox borders (need wxALL on wxMSW and none + * on wxGTK. + */ +wxSizer* CServerWnd::LogOptionsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); + + wxCheckBox *item2 = new wxCheckBox( parent, ID_CHECK_LINE_LIMIT, _("Line limit"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item2->SetToolTip( _("Toggle wether there should be a line limit for log boxes (saves memory)") ); +#endif + item1->Add( item2, 0, wxGROW|border_style, 5 ); + + wxTextCtrl *item3 = new wxTextCtrl( parent, ID_TXT_LINE_LIMIT, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); +#ifndef __WXX11__ + item3->SetToolTip( _("Maximum number of lines in log boxes") ); +#endif + item1->Add( item3, 0, wxALIGN_CENTER|wxRIGHT, 5 ); + + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxCheckBox *item4 = new wxCheckBox( parent, ID_CHECK_SAVE_TO_DISK, _("Save to disk"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item4->SetToolTip( _("Save logs to disc also") ); +#endif + item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 ); + + wxButton *item5 = new wxButton( parent, ID_BTN_CLEAR_LOGS, _("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item5->SetToolTip( _("Clear all logs") ); +#endif + item0->Add( item5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +wxSizer* CServerWnd::AddServerPanel( wxWindow *parent, bool call_fit, bool set_sizer ) +{ + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer *item1 = new wxFlexGridSizer( 4, 0, 0, 0 ); + item1->AddGrowableCol( 0 ); + + wxStaticText *item2 = new wxStaticText( parent, ID_SERVER_IP, _("IP address:Port"), wxDefaultPosition, wxDefaultSize, 0 ); + item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + wxTextCtrl *item3 = new wxTextCtrl( parent, ID_SERVER_IP, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); +#ifndef __WXX11__ + item3->SetToolTip( _("Type in the ip address and port of the new server, separated by :") ); +#endif + item1->Add( item3, 0, wxGROW, 5 ); + + wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); + item1->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + wxTextCtrl *item5 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 ); +#ifndef __WXX11__ + item5->SetToolTip( _("Optional: Enter the name of the new server") ); +#endif + item1->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + item0->Add( item1, 0, wxGROW|wxRIGHT, 5 ); + + wxButton *item6 = new wxButton( parent, ID_ADDTOLIST, _("Add to List"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item6->SetToolTip( _("Add the server to list") ); +#endif + item0->Add( item6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +wxSizer* CServerWnd::UpdatePanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxTextCtrl *item1 = new wxTextCtrl( parent, ID_SERVERLISTURL, wxT("http://ocbmaurice.dyndns.org/pl/slist.pl/server.met?download/server-best.met"), wxDefaultPosition, wxSize(-1,100), wxTE_MULTILINE|wxTE_PROCESS_TAB ); +#ifndef __WXX11__ + item1->SetToolTip( wxT("Enter the URL or .met file location to update list from") ); +#endif + item0->Add( item1, 0, wxGROW, 5 ); + + wxButton *item2 = new wxButton( parent, ID_UPDATE, _("Update"), wxDefaultPosition, wxDefaultSize, 0 ); + item0->Add( item2, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; +} + +wxSizer* CServerWnd::PortSettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) { + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer *item2 = new wxBoxSizer( wxVERTICAL ); + + wxStaticText *item3 = new wxStaticText( parent, ID_TEXT, wxT("TCP"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); + + wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, wxT("UDP"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); + + item1->Add( item2, 0, wxALIGN_CENTER, 5 ); + + wxBoxSizer *item5 = new wxBoxSizer( wxVERTICAL ); + + wxTextCtrl *item6 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); +#ifndef __WXX11__ + item6->SetToolTip( _("Enter the TCP port for connections (default: 4662)") ); +#endif + item5->Add( item6, 0, wxALIGN_CENTER, 5 ); + + wxTextCtrl *item7 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); +#ifndef __WXX11__ + item7->SetToolTip( _("Enter the UDP port for connections (default: 4672)") ); +#endif + item5->Add( item7, 0, wxALIGN_CENTER, 5 ); + + item1->Add( item5, 0, wxALIGN_CENTER, 5 ); + + wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); + + item8->Add( 10, 20, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); + + wxCheckBox *item9 = new wxCheckBox( parent, ID_CHECK_DISABLE_UDP, _("Disable"), wxDefaultPosition, wxDefaultSize, 0 ); +#ifndef __WXX11__ + item9->SetToolTip( _("Disable UDP port. This can somewhat lower traffic, but also results in less sources as client<->client source exchange is done via UDP") ); +#endif + item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 ); + + item1->Add( item8, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 ); + + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxButton *item10 = new wxButton( parent, ID_BUTTON, _("Apply changes"), wxDefaultPosition, wxDefaultSize, 0 ); + item0->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 ); + + if (set_sizer) { + parent->SetAutoLayout( TRUE ); + parent->SetSizer( item0 ); + if (call_fit) { + item0->Fit( parent ); + item0->SetSizeHints( parent ); + } + } + + return item0; } Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ServerWnd.h 23 Nov 2003 09:52:43 -0000 1.28 +++ ServerWnd.h 24 Nov 2003 16:06:32 -0000 1.29 @@ -68,6 +68,21 @@ void AddNewServer(); void UpdateFromURL(); void CreateControls(); + wxSizer* SettingsPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* LogOptionsPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* AddServerPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* UpdatePanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); + wxSizer* PortSettingsPanel( + wxWindow *parent, bool call_fit = true, bool set_sizer = true + ); /* Member variable declarations */ wxImageList *m_imagelist; @@ -102,7 +117,7 @@ return (wxButton*) FindWindow( ID_ADDTOLIST ); } wxTextCtrl* GetServerip() { - return (wxTextCtrl*) FindWindow( ID_SERVERIP ); + return (wxTextCtrl*) FindWindow( ID_SERVER_IP ); } wxSplitterWindow* GetHorizontalSplitter() { return (wxSplitterWindow*) Index: SharedFilesListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SharedFilesListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SharedFilesListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ SharedFilesListCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CSharedFilesListCtrl: public CMListCtrl { Index: SharedFilesWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SharedFilesWnd.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SharedFilesWnd.h 20 Nov 2003 01:27:26 -0000 1.8 +++ SharedFilesWnd.h 24 Nov 2003 16:06:32 -0000 1.9 @@ -31,6 +31,7 @@ #include "wxInterface_wdr.h" #include "defines.h" #include "SharedFilesListCtrl.h" +#include "Images.h" class CSharedFilesWnd: public wxPanel { public: Index: StatisticsTreeCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/StatisticsTreeCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- StatisticsTreeCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ StatisticsTreeCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "Images.h" class CStatisticsTreeCtrl: public wxTreeCtrl { public: Index: TransferWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/TransferWnd.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TransferWnd.h 20 Nov 2003 01:27:26 -0000 1.11 +++ TransferWnd.h 24 Nov 2003 16:06:32 -0000 1.12 @@ -31,6 +31,7 @@ /* Global includes for resources */ #include "wxInterface_wdr.h" #include "defines.h" +#include "Images.h" /* Private includes for list control classes */ #include "DownloadListCtrl.h" Index: UploadListCtrl.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/UploadListCtrl.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- UploadListCtrl.h 20 Nov 2003 01:27:26 -0000 1.6 +++ UploadListCtrl.h 24 Nov 2003 16:06:32 -0000 1.7 @@ -30,6 +30,7 @@ #include "wxInterface_wdr.h" #include "defines.h" +#include "MListCtrl.h" // WDR: class declarations class CUploadListCtrl: public CMListCtrl { Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- defines.h 23 Nov 2003 20:17:34 -0000 1.37 +++ defines.h 24 Nov 2003 16:06:32 -0000 1.38 @@ -30,11 +30,6 @@ #include <wx/splash.h> #include <wx/taskbar.h> -/* Include local headers */ -#include "MListCtrl.h" -#include "GUISettingsDlg.h" -#include "Images.h" - /* Some defines to make accessing dialog controls easier */ #define GetDlgItem(X) ((wxTextCtrl*)FindWindowById(X)) #define m_logbook ((wxNotebook*)FindWindowById(ID_LOGBOOK)) @@ -50,6 +45,17 @@ #define wxHAS_TASK_BAR_ICON #endif +/** + * On wxMSW and wxX11, we need to use wxALL border flag on various controls + * (wxCheckBox is best example), while on wxGTK and wxMac, no border flag is + * required. Thus we define it here and use where needed. + */ +#if defined(__WXMSW__) || defined (__WXX11__) + #define border_style wxALL +#else + #define border_style 0 +#endif + extern class CServerWnd *serverwnd; extern class CSearchWnd *searchwnd; extern class CTransferWnd *transferwnd; @@ -89,7 +95,26 @@ ID_VIEW_TBAR_ALIGN_VER, ID_HELP_HELP, ID_HELP_ABOUT, - + + /* Server page */ + ID_SERVER_SPLITTER_HORIZONTAL, + ID_BTN_TOGGLE_SIDEBAR, + ID_SS_SERVER_IMG , + ID_SS_SERVER_NAME, + ID_CHECK_SS_STATIC, + ID_SS_AUTO_CONNECT, + ID_SS_AC_STATIC_ONLY, + ID_SS_PRIO, + ID_CHECK_LINE_LIMIT, + ID_TXT_LINE_LIMIT, + ID_CHECK_SAVE_TO_DISK, + ID_BTN_CLEAR_LOGS, + ID_ADDTOLIST, + ID_SERVER_IP, + ID_UPDATE, + ID_SERVERLISTURL, + ID_CHECK_DISABLE_UDP, + /* Transfer page */ ID_SPLITTER, ID_CATEGORY, @@ -97,10 +122,24 @@ ID_QUEUE, ID_KNOWN, - /* Server page */ - ID_SERVER_SPLITTER_HORIZONTAL, - ID_BTN_TOGGLE_SIDEBAR, - + /* GUI Settings Dialog */ + ID_SHOWMENU, + ID_TOOLALIGN, + ID_STARTPAGE, + ID_REMEMBER_LAST, + ID_SHOWTOOL, + ID_PROMPTEXIT, + ID_SHOWSPLASH, + ID_ICONSET, + ID_FONT, + ID_LANG, + GUI_OK, + GUI_CANCEL, + ID_BTN_ADDLANG, + ID_BTN_REMOVELANG, + ID_BTN_ADDICONSET, + ID_BTN_REMOVEICONSET, + /* Systray context menu entries */ MENU_TRAY_HIDESHOW_GUI, MENU_TRAY_CHANGE_GUI_SETTINGS, Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvsVx5Xio and /tmp/cvskeKtyE differ Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- wxInterface_wdr.cpp 24 Nov 2003 14:23:10 -0000 1.5 +++ wxInterface_wdr.cpp 24 Nov 2003 16:06:32 -0000 1.6 @@ -743,162 +743,6 @@ return item0; } -wxSizer *Dlg_GUI_Settings( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxGridSizer *item1 = new wxGridSizer( 2, 0, 0, 0 ); - - wxStaticBox *item3 = new wxStaticBox( parent, -1, _("Language") ); - wxStaticBoxSizer *item2 = new wxStaticBoxSizer( item3, wxVERTICAL ); - - wxString *strs4 = (wxString*) NULL; - wxChoice *item4 = new wxChoice( parent, ID_LANG, wxDefaultPosition, wxSize(100,-1), 0, strs4, 0 ); - item4->SetToolTip( _("Change the language of the interface. Requires interface restart to take effect") ); - item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxGridSizer *item5 = new wxGridSizer( 2, 0, 0 ); - - wxButton *item6 = new wxButton( parent, ID_BTN_ADDLANG, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - item6->SetToolTip( _("Add new language") ); - item5->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxButton *item7 = new wxButton( parent, ID_BTN_REMOVELANG, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - item7->SetToolTip( _("Remove currently selected language") ); - item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 ); - - item2->Add( item5, 0, wxALIGN_CENTER, 5 ); - - item1->Add( item2, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); - - wxStaticBox *item9 = new wxStaticBox( parent, -1, _("Icon set") ); - wxStaticBoxSizer *item8 = new wxStaticBoxSizer( item9, wxVERTICAL ); - - wxString *strs10 = (wxString*) NULL; - wxChoice *item10 = new wxChoice( parent, ID_ICONSET, wxDefaultPosition, wxSize(100,-1), 0, strs10, 0 ); - item10->SetToolTip( _("Change the iconet the interface should use. Requires restart to take effect") ); - item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxGridSizer *item11 = new wxGridSizer( 2, 0, 0 ); - - wxButton *item12 = new wxButton( parent, ID_BTN_ADDICONSET, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - item12->SetToolTip( _("Add new iconset") ); - item11->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxButton *item13 = new wxButton( parent, ID_BTN_REMOVEICONSET, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - item13->SetToolTip( _("Remove currently selected iconset") ); - item11->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 ); - - item8->Add( item11, 0, wxALIGN_CENTER, 5 ); - - item1->Add( item8, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxFlexGridSizer *item14 = new wxFlexGridSizer( 2, 0, 0 ); - - wxStaticBox *item16 = new wxStaticBox( parent, -1, _("Font") ); - wxStaticBoxSizer *item15 = new wxStaticBoxSizer( item16, wxVERTICAL ); - - wxString strs17[] = - { - _("Default") - }; - wxChoice *item17 = new wxChoice( parent, ID_FONT, wxDefaultPosition, wxSize(100,-1), 1, strs17, 0 ); - item17->SetToolTip( _("Change the font") ); - item15->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxStaticText *item18 = new wxStaticText( parent, ID_TEXT, _("Font Test :)"), wxDefaultPosition, wxDefaultSize, 0 ); - item15->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 ); - - item14->Add( item15, 0, wxGROW|wxLEFT|wxRIGHT, 5 ); - - wxStaticBox *item20 = new wxStaticBox( parent, -1, _("Startup page") ); - wxStaticBoxSizer *item19 = new wxStaticBoxSizer( item20, wxVERTICAL ); - - wxString strs21[] = - { - _("Server"), - _("Transfer"), - _("Search"), - _("Shared Files"), - _("Messages"), - _("Statistics") - }; - wxChoice *item21 = new wxChoice( parent, ID_STARTPAGE, wxDefaultPosition, wxSize(100,-1), 6, strs21, 0 ); - item21->SetToolTip( _("Set which page will be displayed on program startup") ); - item19->Add( item21, 0, wxGROW|wxALL, 5 ); - - wxCheckBox *item22 = new wxCheckBox( parent, ID_REMEMBER_LAST, _("Remember last"), wxDefaultPosition, wxDefaultSize, 0 ); - item22->SetToolTip( _("Automatically remember which page was open between sessions") ); - item19->Add( item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item14->Add( item19, 0, wxLEFT|wxRIGHT, 5 ); - - item0->Add( item14, 0, 0, 5 ); - - wxBoxSizer *item23 = new wxBoxSizer( wxVERTICAL ); - - wxCheckBox *item24 = new wxCheckBox( parent, ID_SHOWSPLASH, _("Show splashscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - item24->SetValue( TRUE ); - item24->SetToolTip( _("Toggle wether splashscreen should be shown on program startup or not. Speeds up application starting if turned off. Default: On") ); - item23->Add( item24, 0, wxGROW|wxLEFT, 5 ); - - wxCheckBox *item25 = new wxCheckBox( parent, ID_PROMPTEXIT, _("Prompt on exit"), wxDefaultPosition, wxDefaultSize, 0 ); - item25->SetToolTip( _("Toggle wether confirmation is requested when closing program.") ); - item23->Add( item25, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxBoxSizer *item26 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item27 = new wxCheckBox( parent, ID_SHOWTOOL, _("Show ToolBar"), wxDefaultPosition, wxDefaultSize, 0 ); - item27->SetValue( TRUE ); - item27->SetToolTip( _("Toggle wether toolbar is shown or not. Requires restart to take effect.") ); - item26->Add( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxString strs28[] = - { - _("Horizontal"), - _("Vertical") - }; - wxChoice *item28 = new wxChoice( parent, ID_TOOLALIGN, wxDefaultPosition, wxSize(100,-1), 2, strs28, 0 ); - item28->SetToolTip( _("Horizontal tooltip is shown on top of window (default), vertical is shown on the left side of window. Requires restart to take effect.") ); - item26->Add( item28, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - item23->Add( item26, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxCheckBox *item29 = new wxCheckBox( parent, ID_SHOWMENU, _("Show MenuBar"), wxDefaultPosition, wxDefaultSize, 0 ); - item29->SetToolTip( _("Toggle wether menubar (file/view etc) should be shown or not. Requires restart to take effect.") ); - item23->Add( item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - item0->Add( item23, 0, wxGROW, 5 ); - - wxBoxSizer *item30 = new wxBoxSizer( wxHORIZONTAL ); - - wxButton *item31 = new wxButton( parent, GUI_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - item31->SetDefault(); - item31->SetToolTip( _("Save settings and close dialog") ); - item30->Add( item31, 0, wxALIGN_CENTER|wxALL, 5 ); - - wxButton *item32 = new wxButton( parent, GUI_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - item32->SetToolTip( _("Abort changes and close dialog") ); - item30->Add( item32, 0, wxALIGN_CENTER|wxALL, 5 ); - - item0->Add( item30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - wxSizer *Server_Logs( wxWindow *parent, bool call_fit, bool set_sizer ) { wxFlexGridSizer *item0 = new wxFlexGridSizer( 2, 0, 0 ); @@ -932,256 +776,6 @@ return item0; } -wxSizer *sizer_updateserver; -wxSizer *sizer_serversettings; -wxSizer *sizer_portsettings; -wxSizer *sizer_addserver; -wxSizer *sizer_logoptions; -wxSizer *Server_Sidebar( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxFlexGridSizer *item0 = new wxFlexGridSizer( 1, 0, 0 ); - item0->AddGrowableCol( 0 ); - - wxFlexGridSizer *item1 = new wxFlexGridSizer( 1, 0, 0 ); - item1->AddGrowableCol( 0 ); - sizer_updateserver = item1; - - wxButton *item2 = new wxButton( parent, ID_BTN_SHOW_UPDATELIST, wxT("Update from URL"), wxDefaultPosition, wxSize(150,-1), 0 ); - item2->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item1->Add( item2, 0, wxGROW, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxFlexGridSizer *item3 = new wxFlexGridSizer( 1, 0, 0 ); - item3->AddGrowableCol( 0 ); - sizer_serversettings = item3; - - wxButton *item4 = new wxButton( parent, ID_BTN_SHOW_SERVERSETTINGS, wxT("Server settings"), wxDefaultPosition, wxSize(140,-1), 0 ); - item4->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item3->Add( item4, 0, wxGROW, 5 ); - - item0->Add( item3, 0, wxGROW|wxLEFT, 5 ); - - wxFlexGridSizer *item5 = new wxFlexGridSizer( 1, 0, 0 ); - item5->AddGrowableCol( 0 ); - sizer_portsettings = item5; - - wxButton *item6 = new wxButton( parent, ID_BTN_SHOW_PORT_OPTIONS, _("Port settings"), wxDefaultPosition, wxSize(140,-1), 0 ); - item6->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item5->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxFlexGridSizer *item7 = new wxFlexGridSizer( 1, 0, 0 ); - item7->AddGrowableCol( 0 ); - sizer_addserver = item7; - - wxButton *item8 = new wxButton( parent, ID_BTN_SHOW_ADDSERVER, wxT("Add a server"), wxDefaultPosition, wxSize(140,-1), 0 ); - item8->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item7->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item7, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxFlexGridSizer *item9 = new wxFlexGridSizer( 1, 0, 0 ); - item9->AddGrowableCol( 0 ); - sizer_logoptions = item9; - - wxButton *item10 = new wxButton( parent, ID_BTN_SHOW_LOGGINGOPTIONS, wxT("Logging options"), wxDefaultPosition, wxSize(140,-1), 0 ); - item10->SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) ); - item9->Add( item10, 0, wxGROW, 5 ); - - item0->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_AddServerPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer *item1 = new wxFlexGridSizer( 4, 0, 0, 0 ); - item1->AddGrowableCol( 0 ); - - wxStaticText *item2 = new wxStaticText( parent, ID_SERVER_IP, _("IP address:Port"), wxDefaultPosition, wxDefaultSize, 0 ); - item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - - wxTextCtrl *item3 = new wxTextCtrl( parent, ID_SERVERIP, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); - item3->SetToolTip( _("Type in the ip address and port of the new server, separated by :") ); - item1->Add( item3, 0, wxGROW, 5 ); - - wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); - item1->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); - - wxTextCtrl *item5 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 ); - item5->SetToolTip( _("Optional: Enter the name of the new server") ); - item1->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item1, 0, wxGROW|wxRIGHT, 5 ); - - wxButton *item6 = new wxButton( parent, ID_ADDTOLIST, _("Add to List"), wxDefaultPosition, wxDefaultSize, 0 ); - item6->SetToolTip( _("Add the server to list") ); - item0->Add( item6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_UpdatePanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxTextCtrl *item1 = new wxTextCtrl( parent, ID_SERVERLISTURL, wxT("http://ocbmaurice.dyndns.org/pl/slist.pl/server.met?download/server-best.met"), wxDefaultPosition, wxSize(-1,100), wxTE_MULTILINE|wxTE_PROCESS_TAB ); - item1->SetToolTip( wxT("Enter the URL or .met file location to update list from") ); - item0->Add( item1, 0, wxGROW, 5 ); - - wxButton *item2 = new wxButton( parent, ID_UPDATE, _("Update"), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( item2, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_SettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxCheckBox *item1 = new wxCheckBox( parent, ID_SS_AUTO_CONNECT, _("Autoconnect"), wxDefaultPosition, wxDefaultSize, 0 ); - item1->SetToolTip( _("Toggle wether application should automatically connect to any server on startup") ); - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item3 = new wxCheckBox( parent, ID_SS_AC_STATIC_ONLY, _("To static only"), wxDefaultPosition, wxDefaultSize, 0 ); - item3->SetToolTip( _("Toggle wether application should connect to servers marked as \"static\" only") ); - item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 15 ); - - wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); - item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer *item5 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBitmap *item6 = new wxStaticBitmap( parent, ID_SS_SERVER_IMG, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); - item5->Add( item6, 0, wxALIGN_CENTER|wxLEFT, 5 ); - - wxStaticText *item7 = new wxStaticText( parent, ID_SS_SERVER_NAME, wxT(""), wxDefaultPosition, wxSize(110,-1), 0 ); - item5->Add( item7, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 ); - - item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); - - wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item10 = new wxCheckBox( parent, ID_CHECK_SS_STATIC, _("Static"), wxDefaultPosition, wxSize(130,-1), 0 ); - item10->SetToolTip( _("Set server static. Static servers are not removed from list if they do not respond") ); - item9->Add( item10, 0, wxALIGN_CENTER, 5 ); - - item8->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer *item11 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticText *item12 = new wxStaticText( parent, ID_TEXT, _("Priority:"), wxDefaultPosition, wxDefaultSize, 0 ); - item11->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxString strs13[] = - { - _("High"), - _("Normal"), - _("Low") - }; - wxChoice *item13 = new wxChoice( parent, ID_SS_PRIO, wxDefaultPosition, wxSize(80,-1), 3, strs13, 0 ); - item13->SetToolTip( _("Change server priority") ); - item11->Add( item13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - item8->Add( item11, 0, wxALIGN_CENTER, 5 ); - - item0->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_LogOptionsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); - - wxCheckBox *item2 = new wxCheckBox( parent, ID_CHECK_LINE_LIMIT, _("Line limit"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->SetToolTip( _("Toggle wether there should be a line limit for log boxes (saves memory)") ); - item1->Add( item2, 0, wxGROW, 5 ); - - wxTextCtrl *item3 = new wxTextCtrl( parent, ID_TXT_LINE_LIMIT, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); - item3->SetToolTip( _("Maximum number of lines in log boxes") ); - item1->Add( item3, 0, wxALIGN_CENTER|wxRIGHT, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxCheckBox *item4 = new wxCheckBox( parent, ID_CHECK_SAVE_TO_DISK, _("Save to disk"), wxDefaultPosition, wxDefaultSize, 0 ); - item4->SetToolTip( _("Save logs to disc also") ); - item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxButton *item5 = new wxButton( parent, ID_BTN_CLEAR_LOGS, _("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); - item5->SetToolTip( _("Clear all logs") ); - item0->Add( item5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - wxSizer *Dlg_AddLanguage( wxWindow *parent, bool call_fit, bool set_sizer ) { wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); @@ -1207,63 +801,6 @@ item3->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 ); item0->Add( item3, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - if (set_sizer) - { - parent->SetAutoLayout( TRUE ); - parent->SetSizer( item0 ); - if (call_fit) - { - item0->Fit( parent ); - item0->SetSizeHints( parent ); - } - } - - return item0; -} - -wxSizer *Server_PortSettingsPanel( wxWindow *parent, bool call_fit, bool set_sizer ) -{ - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer *item2 = new wxBoxSizer( wxVERTICAL ); - - wxStaticText *item3 = new wxStaticText( parent, ID_TEXT, wxT("TCP"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - - wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, wxT("UDP"), wxDefaultPosition, wxDefaultSize, 0 ); - item2->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - - item1->Add( item2, 0, wxALIGN_CENTER, 5 ); - - wxBoxSizer *item5 = new wxBoxSizer( wxVERTICAL ); - - wxTextCtrl *item6 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); - item6->SetToolTip( _("Enter the TCP port for connections (default: 4662)") ); - item5->Add( item6, 0, wxALIGN_CENTER, 5 ); - - wxTextCtrl *item7 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(40,-1), 0 ); - item7->SetToolTip( _("Enter the UDP port for connections (default: 4672)") ); - item5->Add( item7, 0, wxALIGN_CENTER, 5 ); - - item1->Add( item5, 0, wxALIGN_CENTER, 5 ); - - wxBoxSizer *item8 = new wxBoxSizer( wxVERTICAL ); - - item8->Add( 10, 20, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 ); - - wxCheckBox *item9 = new wxCheckBox( parent, ID_CHECKBOX, _("Disable"), wxDefaultPosition, wxDefaultSize, 0 ); - item9->SetToolTip( _("Disable UDP port. This can somewhat lower traffic, but also results in less sources as client<->client source exchange is done via UDP") ); - item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 ); - - item1->Add( item8, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 ); - - item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - wxButton *item10 = new wxButton( parent, ID_BUTTON, _("Apply changes"), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 ); if (set_sizer) { Index: wxInterface_wdr.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wxInterface_wdr.h 24 Nov 2003 14:21:58 -0000 1.3 +++ wxInterface_wdr.h 24 Nov 2003 16:06:32 -0000 1.4 @@ -89,86 +89,30 @@ #define ID_UL_GRAPH 10044 wxSizer *StatisticsWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_LANG 10045 -#define ID_BTN_ADDLANG 10046 -#define ID_BTN_REMOVELANG 10047 -#define ID_ICONSET 10048 -#define ID_BTN_ADDICONSET 10049 -#define ID_BTN_REMOVEICONSET 10050 -#define ID_FONT 10051 -#define ID_STARTPAGE 10052 -#define ID_REMEMBER_LAST 10053 -#define ID_SHOWSPLASH 10054 -#define ID_PROMPTEXIT 10055 -#define ID_SHOWTOOL 10056 -#define ID_TOOLALIGN 10057 -#define ID_SHOWMENU 10058 -#define GUI_OK 10059 -#define GUI_CANCEL 10060 -wxSizer *Dlg_GUI_Settings( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_LOGBOOK 10061 +#define ID_LOGBOOK 10045 wxSizer *Server_Logs( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -extern wxSizer *sizer_updateserver; -#define ID_BTN_SHOW_UPDATELIST 10062 -extern wxSizer *sizer_serversettings; -#define ID_BTN_SHOW_SERVERSETTINGS 10063 -extern wxSizer *sizer_portsettings; -#define ID_BTN_SHOW_PORT_OPTIONS 10064 -extern wxSizer *sizer_addserver; -#define ID_BTN_SHOW_ADDSERVER 10065 -extern wxSizer *sizer_logoptions; -#define ID_BTN_SHOW_LOGGINGOPTIONS 10066 -wxSizer *Server_Sidebar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_SERVER_IP 10067 -#define ID_SERVERIP 10068 -#define ID_ADDTOLIST 10069 -wxSizer *Server_AddServerPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_SERVERLISTURL 10070 -#define ID_UPDATE 10071 -wxSizer *Server_UpdatePanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_SS_AUTO_CONNECT 10072 -#define ID_SS_AC_STATIC_ONLY 10073 -#define ID_LINE 10074 -#define ID_SS_SERVER_IMG 10075 -#define ID_SS_SERVER_NAME 10076 -#define ID_CHECK_SS_STATIC 10077 -#define ID_SS_PRIO 10078 -wxSizer *Server_SettingsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_CHECK_LINE_LIMIT 10079 -#define ID_TXT_LINE_LIMIT 10080 -#define ID_CHECK_SAVE_TO_DISK 10081 -#define ID_BTN_CLEAR_LOGS 10082 -wxSizer *Server_LogOptionsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_LANG_NAME 10083 -#define ID_BTN_ADD_LANG_OK 10084 -#define ID_BTN_ADD_LANG_CANCEL 10085 +#define ID_LANG_NAME 10046 +#define ID_BTN_ADD_LANG_OK 10047 +#define ID_BTN_ADD_LANG_CANCEL 10048 wxSizer *Dlg_AddLanguage( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_CHECKBOX 10086 -wxSizer *Server_PortSettingsPanel( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); - -#define ID_BTN_ADDICONSET_OK 10087 -#define ID_BTN_ADDICONSET_CANCEL 10088 +#define ID_BTN_ADDICONSET_OK 10049 +#define ID_BTN_ADDICONSET_CANCEL 10050 wxSizer *Dlg_AddIconSet( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); -#define ID_STATUS_TXT 10089 -#define ID_BMP_STATUS_USERS 10090 -#define ID_STATUS_USERS 10091 -#define ID_BMP_STATUS_FILES 10092 -#define ID_STATUS_FILES 10093 -#define ID_BMP_STATUS_UPLOAD 10094 -#define ID_STATUS_UPLOAD 10095 -#define ID_BMP_STATUS_DLOAD 10096 -#define ID_STATUS_DLOAD 10097 -#define ID_BMP_STATUS_CONNECTION 10098 -#define ID_STATUS_CONNECTION 10099 +#define ID_LINE 10051 +#define ID_STATUS_TXT 10052 +#define ID_BMP_STATUS_USERS 10053 +#define ID_STATUS_USERS 10054 +#define ID_BMP_STATUS_FILES 10055 +#define ID_STATUS_FILES 10056 +#define ID_BMP_STATUS_UPLOAD 10057 +#define ID_STATUS_UPLOAD 10058 +#define ID_BMP_STATUS_DLOAD 10059 +#define ID_STATUS_DLOAD 10060 +#define ID_BMP_STATUS_CONNECTION 10061 +#define ID_STATUS_CONNECTION 10062 wxSizer *StatusBar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); // Declare menubar functions @@ -177,7 +121,7 @@ // Declare bitmap functions -#define ID_NULL_BMP 10100 +#define ID_NULL_BMP 10063 wxBitmap Icons( size_t index ); #endif |