You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(102) |
Dec
(255) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(38) |
Feb
(16) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ma...@us...> - 2003-11-24 15:27:27
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv9349 Modified Files: Changelog Log Message: Statusbar Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- Changelog 24 Nov 2003 07:44:32 -0000 1.96 +++ Changelog 24 Nov 2003 15:27:23 -0000 1.97 @@ -22,6 +22,7 @@ 2003/11/24 Alo Sarv * New splashscreen by Avi Vahl. + * New statusbar that works and looks the same on all platforms. 2003/11/23 Alo Sarv * ToolBar images are now generated during runtime and texts added |
From: <ma...@us...> - 2003-11-24 14:23:15
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv28880 Modified Files: wxInterface.wdr wxInterface_wdr.cpp Log Message: These shouldnt be translatable strings. Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Binary files /tmp/cvsi90Azn and /tmp/cvs84WeLA differ Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wxInterface_wdr.cpp 24 Nov 2003 14:21:58 -0000 1.4 +++ wxInterface_wdr.cpp 24 Nov 2003 14:23:10 -0000 1.5 @@ -1340,7 +1340,7 @@ wxStaticBitmap *item5 = new wxStaticBitmap( parent, ID_BMP_STATUS_USERS, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); item2->Add( item5, 0, wxALIGN_CENTER, 5 ); - wxStaticText *item6 = new wxStaticText( parent, ID_STATUS_USERS, _("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText *item6 = new wxStaticText( parent, ID_STATUS_USERS, wxT("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); item2->Add( item6, 0, wxALIGN_CENTER, 5 ); wxStaticLine *item7 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); @@ -1349,7 +1349,7 @@ wxStaticBitmap *item8 = new wxStaticBitmap( parent, ID_BMP_STATUS_FILES, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); item2->Add( item8, 0, wxALIGN_CENTER, 5 ); - wxStaticText *item9 = new wxStaticText( parent, ID_STATUS_FILES, _("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText *item9 = new wxStaticText( parent, ID_STATUS_FILES, wxT("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); item2->Add( item9, 0, wxALIGN_CENTER, 5 ); wxStaticLine *item10 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); @@ -1358,7 +1358,7 @@ wxStaticBitmap *item11 = new wxStaticBitmap( parent, ID_BMP_STATUS_UPLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); item2->Add( item11, 0, wxALIGN_CENTER, 5 ); - wxStaticText *item12 = new wxStaticText( parent, ID_STATUS_UPLOAD, _("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText *item12 = new wxStaticText( parent, ID_STATUS_UPLOAD, wxT("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); item2->Add( item12, 0, wxALIGN_CENTER, 5 ); wxStaticLine *item13 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); |
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv28594 Modified Files: MainDlg.cpp MainDlg.h Makefile ServerWnd.cpp wxInterface.wdr wxInterface_wdr.cpp wxInterface_wdr.h Removed Files: StatusBar.cpp StatusBar.h Log Message: New statusbar that works good and looks same on all platforms. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- MainDlg.cpp 24 Nov 2003 11:18:33 -0000 1.10 +++ MainDlg.cpp 24 Nov 2003 14:21:58 -0000 1.11 @@ -63,10 +63,6 @@ int height, width, posx, posy; start_up = true; - /* Create status bar */ - statusbar = new CStatusBar(this); - SetStatusBar(statusbar); - /* Set application icon */ wxIcon icon; icon.CopyFromBitmap(img->mule); @@ -101,12 +97,24 @@ Move(posx, posy); } + /* Create status bar */ + wxPanel *statusbar = new wxPanel(this, -1); + StatusBar(statusbar, true, true); + m_mainsizer->Add(statusbar, 0, wxGROW|wxEXPAND, 0); + wxASSERT_MSG(statusbar, wxT("CMainDlg::CMainDlg() - StatusBar object not ready for accessing.")); + + GetBmpStatusConnection()->SetBitmap(img->disconnected); + GetBmpStatusUsers()->SetBitmap(img->user); + GetBmpStatusFiles()->SetBitmap(img->files); + GetBmpStatusUpload()->SetBitmap(img->upload); + GetBmpStatusDload()->SetBitmap(img->download); + /* Load dialog pages */ LoadAndShowDialogPages(); /* Generate images for toolbar */ #if !defined(__WXGTK__) - img->MakeToolImages(); + img->MakeToolImages(); #endif /** @@ -200,7 +208,7 @@ activewnd->Show(FALSE); m_mainsizer->Remove(activewnd); } - m_mainsizer->Add(dlg,1,wxALIGN_LEFT|wxEXPAND|wxALL); + m_mainsizer->Prepend(dlg,1,wxALIGN_LEFT|wxEXPAND|wxALL); dlg->Show(TRUE); activewnd=dlg; Layout(); Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MainDlg.h 23 Nov 2003 12:14:53 -0000 1.4 +++ MainDlg.h 24 Nov 2003 14:21:58 -0000 1.5 @@ -32,7 +32,6 @@ /* Include local headers */ #include "wxInterface_wdr.h" #include "defines.h" -#include "StatusBar.h" #include "ServerWnd.h" #include "TransferWnd.h" #include "SearchWnd.h" @@ -66,6 +65,29 @@ void CreateMyMenuBar(); wxLocale &m_locale; + + /** + * These need to be publically available, other classes + * might need to access them. + */ + wxStaticText* GetStatusText() { + return (wxStaticText*) FindWindow( ID_STATUS_TXT ); + } + wxStaticText* GetStatusUsers() { + return (wxStaticText*) FindWindow( ID_STATUS_USERS ); + } + wxStaticText* GetStatusFiles() { + return (wxStaticText*) FindWindow( ID_STATUS_FILES ); + } + wxStaticText* GetStatusUpload() { + return (wxStaticText*) FindWindow( ID_STATUS_UPLOAD ); + } + wxStaticText* GetStatusDload() { + return (wxStaticText*) FindWindow( ID_STATUS_DLOAD ); + } + wxStaticText* GetStatusConnection() { + return (wxStaticText*) FindWindow( ID_STATUS_CONNECTION ); + } private: DECLARE_EVENT_TABLE() @@ -91,6 +113,11 @@ wxMenuItem* GetViewToolBar() { return GetMenuBar()->FindItem(ID_VIEW_TOOLBAR); } + wxStaticBitmap* GetBmpStatusConnection() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_CONNECTION ); } + wxStaticBitmap* GetBmpStatusDload() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_DLOAD ); } + wxStaticBitmap* GetBmpStatusUpload() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_UPLOAD ); } + wxStaticBitmap* GetBmpStatusFiles() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_FILES ); } + wxStaticBitmap* GetBmpStatusUsers() { return (wxStaticBitmap*) FindWindow( ID_BMP_STATUS_USERS ); } /* Member variables */ bool show_tool; // Wether toolbar should be shown or not. Index: Makefile =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Makefile 21 Nov 2003 09:08:11 -0000 1.29 +++ Makefile 24 Nov 2003 14:21:58 -0000 1.30 @@ -59,7 +59,7 @@ # Our own defines. Only one of meaning is -D__HAVE_REMOVE_GROWABLE_COL__, # which should only be enabled if you have patched wxWindows with # flexgridsizer.patch -DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ +#DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ # Output colours. Comment out to disable output colouring. DEFAULTCOLOR =\33[0;40;37;22m @@ -112,13 +112,12 @@ SharedFilesWnd.o \ StatisticsWnd.o \ StatisticsTreeCtrl.o \ - StatusBar.o \ SysTray.o \ TransferWnd.o \ UploadListCtrl.o \ wxInterface.o \ wxInterface_wdr.o \ -# $(RES) \ + $(RES) \ # File suffixes .SUFFIXES: .o .cpp .rc .res Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- ServerWnd.cpp 21 Nov 2003 12:46:10 -0000 1.38 +++ ServerWnd.cpp 24 Nov 2003 14:21:58 -0000 1.39 @@ -109,23 +109,23 @@ */ void CServerWnd::AddDebugLine(wxString text, bool status) { if (status) { - statusbar->SetLogText(text); + mainframe->GetStatusText()->SetLabel(text); } wxDateTime now = wxDateTime::Now(); text = wxString::Format( wxT("[%s] %s\n"), now.Format(wxT("%c")).c_str(), text.c_str() ); - + GetDebugLog()->AppendText(text); GetDebugLog()->ShowPosition(GetDebugLog()->GetLastPosition()); } void CServerWnd::AddLogLine(wxString text, bool status) { if (status) { - statusbar->SetLogText(text); + mainframe->GetStatusText()->SetLabel(text); } - + wxDateTime now = wxDateTime::Now(); text = wxString::Format( wxT("[%s] %s\n"), now.Format(wxT("%c")).c_str(), text.c_str() Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsiioOzg and /tmp/cvsADaqMm differ Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wxInterface_wdr.cpp 23 Nov 2003 12:14:53 -0000 1.3 +++ wxInterface_wdr.cpp 24 Nov 2003 14:21:58 -0000 1.4 @@ -1321,6 +1321,80 @@ return item0; } +wxSizer *StatusBar( wxWindow *parent, bool call_fit, bool set_sizer ) +{ + wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); + + wxStaticLine *item1 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL ); + item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); + + wxFlexGridSizer *item2 = new wxFlexGridSizer( 1, 0, 0, 0 ); + item2->AddGrowableCol( 0 ); + + wxStaticText *item3 = new wxStaticText( parent, ID_STATUS_TXT, _("ShareDaemon wxInterface ready!"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); + item2->Add( item4, 0, wxALIGN_CENTER, 5 ); + + wxStaticBitmap *item5 = new wxStaticBitmap( parent, ID_BMP_STATUS_USERS, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item2->Add( item5, 0, wxALIGN_CENTER, 5 ); + + wxStaticText *item6 = new wxStaticText( parent, ID_STATUS_USERS, _("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item6, 0, wxALIGN_CENTER, 5 ); + + wxStaticLine *item7 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); + item2->Add( item7, 0, wxALIGN_CENTER, 5 ); + + wxStaticBitmap *item8 = new wxStaticBitmap( parent, ID_BMP_STATUS_FILES, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item2->Add( item8, 0, wxALIGN_CENTER, 5 ); + + wxStaticText *item9 = new wxStaticText( parent, ID_STATUS_FILES, _("0(0)"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item9, 0, wxALIGN_CENTER, 5 ); + + wxStaticLine *item10 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); + item2->Add( item10, 0, wxALIGN_CENTER, 5 ); + + wxStaticBitmap *item11 = new wxStaticBitmap( parent, ID_BMP_STATUS_UPLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item2->Add( item11, 0, wxALIGN_CENTER, 5 ); + + wxStaticText *item12 = new wxStaticText( parent, ID_STATUS_UPLOAD, _("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item12, 0, wxALIGN_CENTER, 5 ); + + wxStaticLine *item13 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); + item2->Add( item13, 0, wxALIGN_CENTER, 5 ); + + wxStaticBitmap *item14 = new wxStaticBitmap( parent, ID_BMP_STATUS_DLOAD, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item2->Add( item14, 0, wxALIGN_CENTER, 5 ); + + wxStaticText *item15 = new wxStaticText( parent, ID_STATUS_DLOAD, _("0 kb/s"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item15, 0, wxALIGN_CENTER, 5 ); + + wxStaticLine *item16 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL ); + item2->Add( item16, 0, wxALIGN_CENTER, 5 ); + + wxStaticBitmap *item17 = new wxStaticBitmap( parent, ID_BMP_STATUS_CONNECTION, Icons( 0 ), wxDefaultPosition, wxDefaultSize ); + item2->Add( item17, 0, wxALIGN_CENTER, 5 ); + + wxStaticText *item18 = new wxStaticText( parent, ID_STATUS_CONNECTION, _("Disconnected"), wxDefaultPosition, wxDefaultSize, 0 ); + item2->Add( item18, 0, wxALIGN_CENTER, 5 ); + + item0->Add( item2, 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; +} + // Implement menubar functions // Implement toolbar functions Index: wxInterface_wdr.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wxInterface_wdr.h 21 Nov 2003 12:46:10 -0000 1.2 +++ wxInterface_wdr.h 24 Nov 2003 14:21:58 -0000 1.3 @@ -158,13 +158,26 @@ #define ID_BTN_ADDICONSET_CANCEL 10088 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 +wxSizer *StatusBar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE ); + // Declare menubar functions // Declare toolbar functions // Declare bitmap functions -#define ID_NULL_BMP 10089 +#define ID_NULL_BMP 10100 wxBitmap Icons( size_t index ); #endif --- StatusBar.cpp DELETED --- --- StatusBar.h DELETED --- |
From: <ma...@us...> - 2003-11-24 11:18:36
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv27948 Modified Files: MainDlg.cpp Log Message: Use same style tb on all platforms. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- MainDlg.cpp 24 Nov 2003 06:18:21 -0000 1.9 +++ MainDlg.cpp 24 Nov 2003 11:18:33 -0000 1.10 @@ -232,11 +232,9 @@ /* Construct the toolbar object */ wxToolBar *tb = new wxToolBar( this, -1, wxDefaultPosition, wxDefaultSize, - tool_align|wxNO_BORDER|wxTB_3DBUTTONS + tool_align|wxNO_BORDER|wxTB_3DBUTTONS|wxTB_FLAT #if defined(__WXGTK__) |wxTB_TEXT - #else - |wxTB_FLAT #endif ); |
From: <ma...@us...> - 2003-11-24 11:18:05
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv27799 Modified Files: Images.cpp Log Message: Removed the rectangle around tool button images, doesnt look too good afterall. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Images.cpp 24 Nov 2003 06:18:21 -0000 1.19 +++ Images.cpp 24 Nov 2003 11:18:01 -0000 1.20 @@ -165,6 +165,7 @@ tool_img_width = width+6; mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); + mdc.SetPen(*wxTRANSPARENT_PEN); tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); |
From: <ma...@us...> - 2003-11-24 07:44:35
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv26335 Modified Files: Changelog Log Message: New splashscreen by Avi Vahl Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- Changelog 23 Nov 2003 15:54:19 -0000 1.95 +++ Changelog 24 Nov 2003 07:44:32 -0000 1.96 @@ -20,6 +20,9 @@ # ALWAYS keep line lenghts UNDER/AT 80 characters. # ############################################################################### +2003/11/24 Alo Sarv + * New splashscreen by Avi Vahl. + 2003/11/23 Alo Sarv * ToolBar images are now generated during runtime and texts added as neccesery. This fixes wxMac and wxX11 toolbar and |
From: <ma...@us...> - 2003-11-24 07:44:04
|
Update of /cvsroot/sharedaemon/ui-wx/src/images/emule_inverted In directory sc8-pr-cvs1:/tmp/cvs-serv26227/emule_inverted Modified Files: splashscreen.png Log Message: New splashscreen by Avi Vahl Index: splashscreen.png =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/images/emule_inverted/splashscreen.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs6iAlJy and /tmp/cvsiepxjY differ |
From: <ma...@us...> - 2003-11-24 07:44:04
|
Update of /cvsroot/sharedaemon/ui-wx/src/images/default In directory sc8-pr-cvs1:/tmp/cvs-serv26227/default Modified Files: splashscreen.png Log Message: New splashscreen by Avi Vahl Index: splashscreen.png =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/images/default/splashscreen.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsDIdzue and /tmp/cvs0pLmTj differ |
From: <ma...@us...> - 2003-11-24 07:44:04
|
Update of /cvsroot/sharedaemon/ui-wx/src/images/emule_greyscale In directory sc8-pr-cvs1:/tmp/cvs-serv26227/emule_greyscale Modified Files: splashscreen.png Log Message: New splashscreen by Avi Vahl Index: splashscreen.png =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/images/emule_greyscale/splashscreen.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsFAIWPn and /tmp/cvsOFHrMA differ |
From: <ma...@us...> - 2003-11-24 06:18:24
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv15598 Modified Files: Images.cpp MainDlg.cpp Log Message: Well, toolbar now looks decent both in WinXP and SuSE9. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Images.cpp 23 Nov 2003 20:15:28 -0000 1.18 +++ Images.cpp 24 Nov 2003 06:18:21 -0000 1.19 @@ -40,6 +40,7 @@ void CImages::LoadImages() { wxString path, apppath; wxChar sep; + tool_img_width = 32; /** * We get the application binary path from argv[0], remove the binary Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MainDlg.cpp 23 Nov 2003 20:15:28 -0000 1.8 +++ MainDlg.cpp 24 Nov 2003 06:18:21 -0000 1.9 @@ -105,7 +105,9 @@ LoadAndShowDialogPages(); /* Generate images for toolbar */ + #if !defined(__WXGTK__) img->MakeToolImages(); + #endif /** * Toolbar and Menubar must be created AFTER loading dialog pages, @@ -231,6 +233,11 @@ wxToolBar *tb = new wxToolBar( this, -1, wxDefaultPosition, wxDefaultSize, tool_align|wxNO_BORDER|wxTB_3DBUTTONS + #if defined(__WXGTK__) + |wxTB_TEXT + #else + |wxTB_FLAT + #endif ); tb->SetToolBitmapSize(wxSize(img->tool_img_width, 52)); |
From: <ma...@us...> - 2003-11-23 20:17:37
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv11445 Modified Files: defines.h Log Message: Fixed version string Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- defines.h 23 Nov 2003 12:14:53 -0000 1.36 +++ defines.h 23 Nov 2003 20:17:34 -0000 1.37 @@ -22,7 +22,7 @@ /* Version strings for easier modification */ #define APPVER wxT("0.1.8") -#define APPVER_LONG wxT("ShareDaemon wxInterface v0.1.8)") +#define APPVER_LONG wxT("ShareDaemon wxInterface CVS Version") /* Include wx headers */ #include <wx/confbase.h> |
From: <ma...@us...> - 2003-11-23 20:16:46
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv11173 Added Files: Makefile.win Log Message: A _working_ win32 makefile. |
From: <ma...@us...> - 2003-11-23 20:15:32
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv10956 Modified Files: Images.cpp Images.h MainDlg.cpp Log Message: Fixed toolbar images for win32. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Images.cpp 23 Nov 2003 18:55:08 -0000 1.17 +++ Images.cpp 23 Nov 2003 20:15:28 -0000 1.18 @@ -161,6 +161,9 @@ width = x; } } + tool_img_width = width+6; + + mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID)); tmp_new = wxBitmap(width+6, y+36); mdc.SelectObject(tmp_new); Index: Images.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Images.h 23 Nov 2003 15:53:17 -0000 1.12 +++ Images.h 23 Nov 2003 20:15:28 -0000 1.13 @@ -43,6 +43,7 @@ btn_statistics, btn_guisettings, btn_preferences, logo, leftarrow, rightarrow; void MakeToolImages(); + int tool_img_width; private: void LoadImages(); }; Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- MainDlg.cpp 23 Nov 2003 15:53:17 -0000 1.7 +++ MainDlg.cpp 23 Nov 2003 20:15:28 -0000 1.8 @@ -233,7 +233,7 @@ tool_align|wxNO_BORDER|wxTB_3DBUTTONS ); - tb->SetToolBitmapSize(wxSize(40, 40)); + tb->SetToolBitmapSize(wxSize(img->tool_img_width, 52)); tb->SetMargins(2, 2); /* Add the buttons */ |
From: <ma...@us...> - 2003-11-23 18:55:11
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv28874/src Modified Files: wxInterface.cpp Images.cpp Log Message: Fixed two endless loops on win32 due to different path separator. Index: wxInterface.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- wxInterface.cpp 21 Nov 2003 11:05:55 -0000 1.5 +++ wxInterface.cpp 23 Nov 2003 18:55:08 -0000 1.6 @@ -109,6 +109,7 @@ */ void wxInterface::Localize() { wxString curlang, path; + wxChar sep; /** * Get application binary path from argv[0] and remove the binary file- @@ -117,7 +118,12 @@ * resources. */ path = wxTheApp->argv[0]; - while (path.Last() != *wxT("/")) { + #if defined(__WXMSW__) + sep = '\\'; + #else + sep = '/'; + #endif + while ((path.Last() != sep) && (path.Length()>1)) { path.RemoveLast(); } Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Images.cpp 23 Nov 2003 15:53:17 -0000 1.16 +++ Images.cpp 23 Nov 2003 18:55:08 -0000 1.17 @@ -39,6 +39,7 @@ */ void CImages::LoadImages() { wxString path, apppath; + wxChar sep; /** * We get the application binary path from argv[0], remove the binary @@ -47,7 +48,12 @@ * prevent us from accessing resources. */ apppath = wxTheApp->argv[0]; - while (apppath.Last() != *wxT("/")) { + #if defined(__WXMSW__) + sep = '\\'; + #else + sep = '/'; + #endif + while ((apppath.Last() != sep) && (apppath.Length()>1)) { apppath.RemoveLast(); } @@ -149,7 +155,7 @@ /* Temporary bitmap for measuring text lengths. 100 pixels should be enuff. */ tmp = wxBitmap(100, 100); mdc.SelectObject(tmp); - for (uint i=0;i<btntxt.GetCount();i++) { + for (unsigned int i=0;i<btntxt.GetCount();i++) { mdc.GetTextExtent(btntxt.Item(i), &x, &y); if (x > width) { width = x; |
From: <ma...@us...> - 2003-11-23 15:54:23
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv27285 Modified Files: Changelog Log Message: Toolbar images change Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- Changelog 23 Nov 2003 12:19:42 -0000 1.94 +++ Changelog 23 Nov 2003 15:54:19 -0000 1.95 @@ -21,6 +21,9 @@ ############################################################################### 2003/11/23 Alo Sarv + * ToolBar images are now generated during runtime and texts added + as neccesery. This fixes wxMac and wxX11 toolbar and + improves the visual quality of the whole interface. * MenuBar View menu improved: Added some controls and now uses Radio/Check items (except for wxMac where Radio Menu items aren't supported) |
From: <ma...@us...> - 2003-11-23 15:53:21
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv27124 Modified Files: Images.cpp Images.h MainDlg.cpp Log Message: Toolbar images are now generated during runtime and texts added as necessery. This fixes wxMac and wxX11 toolbar and improves visual quality of the whole interface. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Images.cpp 21 Nov 2003 11:01:31 -0000 1.15 +++ Images.cpp 23 Nov 2003 15:53:17 -0000 1.16 @@ -120,3 +120,104 @@ leftarrow.LoadFile(path+wxT("leftarrow.png"), wxBITMAP_TYPE_PNG); rightarrow.LoadFile(path+wxT("rightarrow.png"), wxBITMAP_TYPE_PNG); } + +/** + * Here we generate new toolbar button images. First we find out which of + * our texts is longest, and make the bitmap size according to that. Then + * we draw each bitmap with corresponding image and text and save to the + * corresponding image object (note that we should never save it to disc!). + * The main reason for this was wxMac where toolbar button texts were not + * supported, but eventually, this approach proves nicer quality because of + * added background colour and surrounding border to button images. + */ +void CImages::MakeToolImages() { + wxBitmap tmp, tmp_new; + wxMemoryDC mdc; + wxCoord x, y, width = 0; + wxArrayString btntxt; + + /* List of button names */ + btntxt.Add(_("Connect")); + btntxt.Add(_("Servers")); + btntxt.Add(_("Search")); + btntxt.Add(_("Transfer")); + btntxt.Add(_("Shared Files")); + btntxt.Add(_("Messaging")); + btntxt.Add(_("Statistics")); + btntxt.Add(_("Preferences")); + + /* Temporary bitmap for measuring text lengths. 100 pixels should be enuff. */ + tmp = wxBitmap(100, 100); + mdc.SelectObject(tmp); + for (uint i=0;i<btntxt.GetCount();i++) { + mdc.GetTextExtent(btntxt.Item(i), &x, &y); + if (x > width) { + width = x; + } + } + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_connect, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(0), &x, &y); + mdc.DrawText(btntxt.Item(0), (tmp_new.GetWidth()-x)/2, 34); + btn_connect = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_servers, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(1), &x, &y); + mdc.DrawText(btntxt.Item(1), (tmp_new.GetWidth()-x)/2, 34); + btn_servers = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_search, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(2), &x, &y); + mdc.DrawText(btntxt.Item(2), (tmp_new.GetWidth()-x)/2, 34); + btn_search = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_transfer, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(3), &x, &y); + mdc.DrawText(btntxt.Item(3), (tmp_new.GetWidth()-x)/2, 34); + btn_transfer = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_shared, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(4), &x, &y); + mdc.DrawText(btntxt.Item(4), (tmp_new.GetWidth()-x)/2, 34); + btn_shared = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_messages, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(5), &x, &y); + mdc.DrawText(btntxt.Item(5), (tmp_new.GetWidth()-x)/2, 34); + btn_messages = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_statistics, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(6), &x, &y); + mdc.DrawText(btntxt.Item(6), (tmp_new.GetWidth()-x)/2, 34); + btn_statistics = tmp_new; + + tmp_new = wxBitmap(width+6, y+36); + mdc.SelectObject(tmp_new); + mdc.DrawRectangle(0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()); + mdc.DrawBitmap(btn_guisettings, (tmp_new.GetWidth()-32)/2, 2, true); + mdc.GetTextExtent(btntxt.Item(7), &x, &y); + mdc.DrawText(btntxt.Item(7), (tmp_new.GetWidth()-x)/2, 34); + btn_guisettings = tmp_new; + +} Index: Images.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Images.h 21 Nov 2003 10:26:50 -0000 1.11 +++ Images.h 23 Nov 2003 15:53:17 -0000 1.12 @@ -36,19 +36,13 @@ CImages(); wxBitmap frienduser, messages, search, provider, servers, newserver, updateserver, info, serverinfo, log, files, updown11, updown00, - connected, - disconnected, - timer, - user, - server, - arrow, - stats, + connected, disconnected, timer, user, server, arrow, stats, upload, download, part, full, exclamation, connection, daily, monthly, yearly, mule, btn_connect, btn_servers, btn_transfer, btn_search, btn_shared, btn_messages, btn_statistics, btn_guisettings, btn_preferences, logo, leftarrow, rightarrow; - + void MakeToolImages(); private: void LoadImages(); }; Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MainDlg.cpp 23 Nov 2003 12:14:53 -0000 1.6 +++ MainDlg.cpp 23 Nov 2003 15:53:17 -0000 1.7 @@ -104,6 +104,9 @@ /* Load dialog pages */ LoadAndShowDialogPages(); + /* Generate images for toolbar */ + img->MakeToolImages(); + /** * Toolbar and Menubar must be created AFTER loading dialog pages, * since they do calls to GetCurPage() which results in crash @@ -227,10 +230,10 @@ /* Construct the toolbar object */ wxToolBar *tb = new wxToolBar( this, -1, wxDefaultPosition, wxDefaultSize, - tool_align|wxNO_BORDER|wxTB_TEXT|wxTB_FLAT|wxTB_3DBUTTONS + tool_align|wxNO_BORDER|wxTB_3DBUTTONS ); - tb->SetToolBitmapSize(wxSize(32, 32)); + tb->SetToolBitmapSize(wxSize(40, 40)); tb->SetMargins(2, 2); /* Add the buttons */ @@ -271,6 +274,7 @@ /* And go live */ tb->Realize(); SetToolBar(tb); + tb->Refresh(); /** * Last, but not least, we tell the toolbar which button should |
From: <ma...@us...> - 2003-11-23 12:19:45
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv25053 Modified Files: Changelog Log Message: View menu updates Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- Changelog 23 Nov 2003 09:56:09 -0000 1.93 +++ Changelog 23 Nov 2003 12:19:42 -0000 1.94 @@ -21,6 +21,9 @@ ############################################################################### 2003/11/23 Alo Sarv + * MenuBar View menu improved: Added some controls and now uses + Radio/Check items (except for wxMac where Radio Menu items + aren't supported) * Cleaned up ToolBar/MenuBar event handling mess. Altough not completely dynamic yet, its a cleaner now. * Use mainframe->Close() instead of delete operator to exit app from |
From: <ma...@us...> - 2003-11-23 12:14:56
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv24381 Modified Files: GUISettingsDlg.cpp MainDlg.cpp MainDlg.h defines.h wxInterface.wdr wxInterface_wdr.cpp Log Message: MenuBar View menu improved: Added some controls and now uses Radio/Check items (except wxMac where Radio items arent supported) Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- GUISettingsDlg.cpp 23 Nov 2003 09:52:42 -0000 1.19 +++ GUISettingsDlg.cpp 23 Nov 2003 12:14:52 -0000 1.20 @@ -89,9 +89,9 @@ m_config->Read(wxT("Icon set"), &iconset, 0); m_config->Read(wxT("Show splashscreen"), &show_splash, true); m_config->Read(wxT("Prompt on exit"), &prompt_exit, true); - m_config->Read(wxT("Show toolbar"), &show_toolbar, true); - m_config->Read(wxT("Toolbar alignment"), &tool_align, 0); - m_config->Read(wxT("Show menubar"), &show_menubar, false); + m_config->Read(wxT("Show ToolBar"), &show_toolbar, true); + m_config->Read(wxT("Toolbar Alignment"), &tool_align, wxTB_HORIZONTAL); + m_config->Read(wxT("Show MenuBar"), &show_menubar, false); m_config->Read(wxT("Start page"), &startpage, 0); m_config->Read(wxT("Remember last"), &remember_last, true); @@ -170,11 +170,11 @@ * were changed - if so, we display a messagebox notifying that user * needs to restart the GUI for changes to take effect. */ - notfirstload = m_config->Read(wxT("Toolbar alignment"), &old_tool_align) + notfirstload = m_config->Read(wxT("Toolbar Alignment"), &old_tool_align) && notfirstload; - notfirstload = m_config->Read(wxT("Show toolbar"), &old_show_tool) + notfirstload = m_config->Read(wxT("Show ToolBar"), &old_show_tool) && notfirstload; - notfirstload = m_config->Read(wxT("Show menubar"), &old_show_menu) + notfirstload = m_config->Read(wxT("Show MenuBar"), &old_show_menu) && notfirstload; show_tool = GetShowTool()->GetValue(); tool_align = GetToolAlign()->GetSelection(); @@ -195,9 +195,9 @@ m_config->Write(wxT("Icon set"), GetIconSet()->GetSelection()); m_config->Write(wxT("Show splashscreen"), GetShowSplash()->GetValue()); m_config->Write(wxT("Prompt on exit"), GetPromptExit()->GetValue()); - m_config->Write(wxT("Show toolbar"), GetShowTool()->GetValue()); - m_config->Write(wxT("Toolbar alignment"), tool_align); - m_config->Write(wxT("Show menubar"), GetShowMenu()->GetValue()); + m_config->Write(wxT("Show ToolBar"), GetShowTool()->GetValue()); + m_config->Write(wxT("Toolbar Alignment"), tool_align); + m_config->Write(wxT("Show MenuBar"), GetShowMenu()->GetValue()); m_config->Write(wxT("Start page"), GetStartPage()->GetSelection()); m_config->Write(wxT("Remember last"), GetRememberLast()->GetValue()); Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MainDlg.cpp 23 Nov 2003 10:11:00 -0000 1.5 +++ MainDlg.cpp 23 Nov 2003 12:14:53 -0000 1.6 @@ -216,12 +216,12 @@ /* Read configuration data */ bool show_tool = true; - m_config->Read(wxT("/General/Show toolbar"), &show_tool, true); + m_config->Read(wxT("/General/Show ToolBar"), &show_tool, true); if (!show_tool) { return; } m_config->Read( - wxT("/General/Toolbar alignment"), &tool_align, wxTB_HORIZONTAL + wxT("/General/Toolbar Alignment"), &tool_align, wxTB_HORIZONTAL ); /* Construct the toolbar object */ @@ -261,7 +261,7 @@ ); tb->AddTool( ID_BTN_STATISTICS, _("Statistics"), img->btn_statistics, - img->btn_statistics, wxITEM_CHECK, _("Show live statistics") ); + img->btn_statistics, wxITEM_CHECK, _("Show live statistics")); tb->AddSeparator(); tb->AddTool( ID_BTN_GUISETTINGS, _("Preferences"), img->btn_guisettings, @@ -276,12 +276,24 @@ * Last, but not least, we tell the toolbar which button should * initially toggled. */ - if (activewnd == serverwnd) tb->ToggleTool(ID_BTN_SERVERS, true); - if (activewnd == searchwnd) tb->ToggleTool(ID_BTN_SEARCH, true); - if (activewnd == transferwnd) tb->ToggleTool(ID_BTN_TRANSFER, true); - if (activewnd == sharedfileswnd) tb->ToggleTool(ID_BTN_SHARED_FILES, true); - if (activewnd == messageswnd) tb->ToggleTool(ID_BTN_MESSAGES, true); - if (activewnd == statisticswnd) tb->ToggleTool(ID_BTN_STATISTICS, true); + if (activewnd == serverwnd) { + tb->ToggleTool(ID_BTN_SERVERS, true); + } + if (activewnd == searchwnd) { + tb->ToggleTool(ID_BTN_SEARCH, true); + } + if (activewnd == transferwnd) { + tb->ToggleTool(ID_BTN_TRANSFER, true); + } + if (activewnd == sharedfileswnd) { + tb->ToggleTool(ID_BTN_SHARED_FILES, true); + } + if (activewnd == messageswnd) { + tb->ToggleTool(ID_BTN_MESSAGES, true); + } + if (activewnd == statisticswnd) { + tb->ToggleTool(ID_BTN_STATISTICS, true); + } } /** @@ -358,38 +370,84 @@ */ void CMainDlg::CreateMyMenuBar() { bool show_menu = false; + int tmp; + wxMenuBar *menubar = GetMenuBar(); if (menubar != NULL) { SetMenuBar(NULL); delete menubar; } - m_config->Read(wxT("/General/Show menubar"), &show_menu, false); + m_config->Read(wxT("/General/Show MenuBar"), &show_menu, false); if (!show_menu) { return; } menubar = new wxMenuBar(); + /* FILE MENU */ wxMenu *file_menu = new wxMenu(); file_menu->Append(ID_FILE_CONNECT, _("Connect")); file_menu->Append(ID_FILE_EXIT, _("Quit")); + /* EDIT MENU */ wxMenu *edit_menu = new wxMenu(); edit_menu->Append(ID_EDIT_GUI_SETTINGS, _("Preferences")); + /* VIEW MENU */ wxMenu *view_menu = new wxMenu(); + #ifdef wxHAS_RADIO_MENU_ITEMS + view_menu->AppendRadioItem(ID_VIEW_SERVERS, _("Servers")); + view_menu->AppendRadioItem(ID_VIEW_SEARCH, _("Search")); + view_menu->AppendRadioItem(ID_VIEW_TRANSFER, _("Transfer")); + view_menu->AppendRadioItem(ID_VIEW_SHARED_FILES, _("Shared Files")); + view_menu->AppendRadioItem(ID_VIEW_MESSAGES, _("Messages")); + view_menu->AppendRadioItem(ID_VIEW_STATISTICS, _("Statistics")); + #else view_menu->Append(ID_VIEW_SERVERS, _("Servers")); view_menu->Append(ID_VIEW_SEARCH, _("Search")); view_menu->Append(ID_VIEW_TRANSFER, _("Transfer")); view_menu->Append(ID_VIEW_SHARED_FILES, _("Shared Files")); view_menu->Append(ID_VIEW_MESSAGES, _("Messages")); view_menu->Append(ID_VIEW_STATISTICS, _("Statistics")); + #endif + view_menu->AppendSeparator(); + + view_menu->AppendCheckItem(ID_VIEW_MENUBAR, _("Show MenuBar")); + m_config->Read(wxT("/General/Show MenuBar"), &tmp, false); + view_menu->FindItem(ID_VIEW_MENUBAR)->Check(tmp); + + view_menu->AppendCheckItem(ID_VIEW_TOOLBAR, _("Show ToolBar")); + m_config->Read(wxT("/General/Show ToolBar"), &tmp, true); + view_menu->FindItem(ID_VIEW_TOOLBAR)->Check(tmp); + + wxMenu *view_tbar_menu = new wxMenu(); + #ifdef wxHAS_RADIO_MENU_ITEMS + view_tbar_menu->AppendRadioItem( + ID_VIEW_TBAR_ALIGN_HOR, _("Horizontal") + ); + view_tbar_menu->AppendRadioItem( + ID_VIEW_TBAR_ALIGN_VER, _("Vertical") + ); + m_config->Read(wxT("/General/Toolbar Alignment"), &tmp, 0); + if (tmp) { + view_tbar_menu->FindItem(ID_VIEW_TBAR_ALIGN_HOR)->Check(); + } else { + view_tbar_menu->FindItem(ID_VIEW_TBAR_ALIGN_VER)->Check(); + } + #else + view_tbar_menu->Append(ID_VIEW_TBAR_ALIGN_HOR, _("Horizontal")); + view_tbar_menu->Append(ID_VIEW_TBAR_ALIGN_VER, _("Vertical")); + #endif + + view_menu->Append(ID_VIEW_TBAR, _("ToolBar Alignment"), view_tbar_menu); + /* HELP MENU */ wxMenu *help_menu = new wxMenu(); help_menu->Append(ID_HELP_HELP, _("Help")); help_menu->Append(ID_HELP_ABOUT, _("About...")); + /* Tie everything together and set as menubar */ menubar->Append(file_menu, _("File")); menubar->Append(edit_menu, _("Edit")); menubar->Append(view_menu, _("View")); @@ -502,6 +560,56 @@ break; case ID_VIEW_STATISTICS: ShowPage(statisticswnd); + break; + case ID_VIEW_MENUBAR: + if ( + !(GetViewMenuBar()->IsChecked()) && + !(GetViewToolBar()->IsChecked()) + ) { + GetViewToolBar()->Check(true); + m_config->Write( + wxT("/General/Show ToolBar"), + GetViewToolBar()->IsChecked() + ); + CreateMyToolBar(); + } + m_config->Write( + wxT("/General/Show MenuBar"), + GetViewMenuBar()->IsChecked() + ); + CreateMyMenuBar(); + break; + case ID_VIEW_TOOLBAR: + if ( + !(GetViewMenuBar()->IsChecked()) && + !(GetViewToolBar()->IsChecked()) + ) { + GetViewMenuBar()->Check(true); + m_config->Write( + wxT("/General/Show MenuBar"), + GetViewMenuBar()->IsChecked() + ); + CreateMyMenuBar(); + } + m_config->Write( + wxT("/General/Show ToolBar"), + GetViewToolBar()->IsChecked() + ); + CreateMyToolBar(); + break; + case ID_VIEW_TBAR_ALIGN_HOR: + m_config->Write( + wxT("/General/ToolBar Alignment"), + wxTB_HORIZONTAL + ); + CreateMyToolBar(); + break; + case ID_VIEW_TBAR_ALIGN_VER: + m_config->Write( + wxT("/General/ToolBar Alignment"), + wxTB_VERTICAL + ); + CreateMyToolBar(); break; default: event.Skip(); Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MainDlg.h 23 Nov 2003 09:52:43 -0000 1.3 +++ MainDlg.h 23 Nov 2003 12:14:53 -0000 1.4 @@ -84,6 +84,14 @@ void UpdateToolButtons(); wxWindow* GetCurPage() { return activewnd; } + /* Getters */ + wxMenuItem* GetViewMenuBar() { + return GetMenuBar()->FindItem(ID_VIEW_MENUBAR); + } + wxMenuItem* GetViewToolBar() { + return GetMenuBar()->FindItem(ID_VIEW_TOOLBAR); + } + /* Member variables */ bool show_tool; // Wether toolbar should be shown or not. bool start_up; // Should we remember last page Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- defines.h 23 Nov 2003 09:52:08 -0000 1.35 +++ defines.h 23 Nov 2003 12:14:53 -0000 1.36 @@ -82,6 +82,11 @@ ID_VIEW_SHARED_FILES, ID_VIEW_MESSAGES, ID_VIEW_STATISTICS, + ID_VIEW_MENUBAR, + ID_VIEW_TOOLBAR, + ID_VIEW_TBAR, + ID_VIEW_TBAR_ALIGN_HOR, + ID_VIEW_TBAR_ALIGN_VER, ID_HELP_HELP, ID_HELP_ABOUT, Index: wxInterface.wdr =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsHnSzh2 and /tmp/cvscAmoxW differ Index: wxInterface_wdr.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wxInterface_wdr.cpp 21 Nov 2003 12:46:10 -0000 1.2 +++ wxInterface_wdr.cpp 23 Nov 2003 12:14:53 -0000 1.3 @@ -850,7 +850,7 @@ wxBoxSizer *item26 = new wxBoxSizer( wxHORIZONTAL ); - wxCheckBox *item27 = new wxCheckBox( parent, ID_SHOWTOOL, _("Show toolbar"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); @@ -866,7 +866,7 @@ item23->Add( item26, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxCheckBox *item29 = new wxCheckBox( parent, ID_SHOWMENU, _("Show menubar"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); |
From: <ma...@us...> - 2003-11-23 10:11:04
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv2514 Modified Files: MainDlg.cpp Log Message: Forgot to deallocate memory after removing menubar - fixed. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MainDlg.cpp 23 Nov 2003 09:52:43 -0000 1.4 +++ MainDlg.cpp 23 Nov 2003 10:11:00 -0000 1.5 @@ -358,14 +358,18 @@ */ void CMainDlg::CreateMyMenuBar() { bool show_menu = false; - SetMenuBar(NULL); + wxMenuBar *menubar = GetMenuBar(); + if (menubar != NULL) { + SetMenuBar(NULL); + delete menubar; + } m_config->Read(wxT("/General/Show menubar"), &show_menu, false); if (!show_menu) { return; } - wxMenuBar *menubar = new wxMenuBar(); + menubar = new wxMenuBar(); wxMenu *file_menu = new wxMenu(); file_menu->Append(ID_FILE_CONNECT, _("Connect")); |
From: <ma...@us...> - 2003-11-23 09:56:12
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv628 Modified Files: Changelog Log Message: 3 updates Index: Changelog =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/Changelog,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- Changelog 21 Nov 2003 14:15:34 -0000 1.92 +++ Changelog 23 Nov 2003 09:56:09 -0000 1.93 @@ -20,6 +20,13 @@ # ALWAYS keep line lenghts UNDER/AT 80 characters. # ############################################################################### +2003/11/23 Alo Sarv + * Cleaned up ToolBar/MenuBar event handling mess. Altough not + completely dynamic yet, its a cleaner now. + * Use mainframe->Close() instead of delete operator to exit app from + systray (cleaner this way) + * Global class declarations moved to defines.h where they belong. + 2003/11/21 Alo Sarv * Toolbar/Menubar displayment/orientation can now be changed w/o restarting the interface. |
From: <ma...@us...> - 2003-11-23 09:52:48
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv32729 Modified Files: GUISettingsDlg.cpp MainDlg.cpp MainDlg.h ServerWnd.h Log Message: * Cleaned up ToolBar/MenuBar event handling mess. Altough not completely dynamic yet, its a cleaner now. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- GUISettingsDlg.cpp 21 Nov 2003 14:18:10 -0000 1.18 +++ GUISettingsDlg.cpp 23 Nov 2003 09:52:42 -0000 1.19 @@ -234,7 +234,7 @@ } if (old_show_menu != show_menu) { - mainframe->CreateMenuBar(); + mainframe->CreateMyMenuBar(); } } Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MainDlg.cpp 21 Nov 2003 14:13:36 -0000 1.3 +++ MainDlg.cpp 23 Nov 2003 09:52:43 -0000 1.4 @@ -41,35 +41,13 @@ class CSysTray *systray; #endif class CStatusBar *statusbar; -/* - * MainDlg class. The main dialog functions like Toolbar and Statusbar - * stuff go in here. - */ +class CToolBar *toolbar; BEGIN_EVENT_TABLE(CMainDlg,wxFrame) - /* Shutdown events */ + /* Shutdown event */ EVT_CLOSE(CMainDlg::OnCloseWindow) - - /* Main toolbar button events */ - EVT_TOOL(ID_BTN_CONNECT, CMainDlg::ConnectToAnyServer) - EVT_TOOL(ID_BTN_SERVERS, CMainDlg::ShowServerWnd) - EVT_TOOL(ID_BTN_TRANSFER, CMainDlg::ShowTransferWnd) - EVT_TOOL(ID_BTN_SEARCH, CMainDlg::ShowSearchWnd) - EVT_TOOL(ID_BTN_SHARED_FILES, CMainDlg::ShowSharedFilesWnd) - EVT_TOOL(ID_BTN_MESSAGES, CMainDlg::ShowMessagesWnd) - EVT_TOOL(ID_BTN_STATISTICS, CMainDlg::ShowStatisticsWnd) - EVT_TOOL(ID_BTN_GUISETTINGS, CMainDlg::ShowGUISettingsDlg) - - /* Menubar events */ - EVT_MENU(ID_FILE_CONNECT, CMainDlg::ConnectToAnyServer) - EVT_MENU(ID_FILE_EXIT, CMainDlg::OnCloseWindow) - EVT_MENU(ID_EDIT_GUI_SETTINGS, CMainDlg::ShowGUISettingsDlg) - EVT_MENU(ID_VIEW_SERVERS, CMainDlg::ShowServerWnd) - EVT_MENU(ID_VIEW_TRANSFER, CMainDlg::ShowTransferWnd) - EVT_MENU(ID_VIEW_SEARCH, CMainDlg::ShowSearchWnd) - EVT_MENU(ID_VIEW_SHARED_FILES, CMainDlg::ShowSharedFilesWnd) - EVT_MENU(ID_VIEW_MESSAGES, CMainDlg::ShowMessagesWnd) - EVT_MENU(ID_VIEW_STATISTICS, CMainDlg::ShowStatisticsWnd) + /* Menu/Toolbar events */ + EVT_TOOL(-1, CMainDlg::MenuOrToolEvent) END_EVENT_TABLE() /* @@ -85,15 +63,10 @@ int height, width, posx, posy; start_up = true; - CreateMyToolBar(); - /* Create status bar */ statusbar = new CStatusBar(this); SetStatusBar(statusbar); - /* Create menu bar */ - CreateMenuBar(); - /* Set application icon */ wxIcon icon; icon.CopyFromBitmap(img->mule); @@ -128,9 +101,16 @@ Move(posx, posy); } - /* Everything else should be done now, finally load the pages itself. */ + /* Load dialog pages */ LoadAndShowDialogPages(); + /** + * Toolbar and Menubar must be created AFTER loading dialog pages, + * since they do calls to GetCurPage() which results in crash + * if pages haven't been loaded yet. + */ + CreateMyToolBar(); + CreateMyMenuBar(); } /* @@ -159,9 +139,17 @@ * from CGUISettingsDlg class. */ int remember_last; - m_config->Read(wxT("/General/Remember last"), &remember_last, true); + m_config->SetPath(wxT("/General")); + m_config->Read(wxT("Remember last"), &remember_last, true); if (remember_last) { - m_config->Write(wxT("/General/Start page"), m_lastbtn-1001); + short startpage; + if (GetCurPage() == serverwnd) startpage = 0; + if (GetCurPage() == searchwnd) startpage = 1; + if (GetCurPage() == transferwnd) startpage = 2; + if (GetCurPage() == sharedfileswnd) startpage = 3; + if (GetCurPage() == messageswnd) startpage = 4; + if (GetCurPage() == statisticswnd) startpage = 5; + m_config->Write(wxT("Start page"), startpage); } #ifdef wxHAS_TASK_BAR_ICON @@ -176,15 +164,29 @@ delete sharedfileswnd; delete messageswnd; delete statisticswnd; + wxMenuBar *mb = GetMenuBar(); + if (mb != NULL) { + SetMenuBar(NULL); + delete mb; + } + wxToolBar *tb = GetToolBar(); + if (tb != NULL) { + SetToolBar(NULL); + delete tb; + } } /* * Changes content of the main frame by removing the old panel from m_mainsizer * and attaching new one. [start_up] defaults to false, and is required true * if we are calling this function on application start-up (don't hide old - * (nonexistent) frame then). + * (nonexistent) frame then). Returns true if the page was changed, false + * otherwise. */ -void CMainDlg::SetActiveDialog(wxWindow* dlg) { +bool CMainDlg::ShowPage(wxWindow* dlg) { + if (activewnd == dlg) { + return false; + } /** * On startup, we don't have activewnd * here yet, so don't hide anything. @@ -198,6 +200,7 @@ activewnd=dlg; Layout(); start_up = false; + return true; } /* @@ -206,177 +209,115 @@ void CMainDlg::CreateMyToolBar() { int tool_align; - wxToolBar *tb = GetToolBar(); - delete tb; + /* Just in case we have some old toolbar hanging around, delete it. */ + wxToolBar *toolbar = GetToolBar(); + delete toolbar; SetToolBar(NULL); - /* Create toolbar */ + /* Read configuration data */ bool show_tool = true; m_config->Read(wxT("/General/Show toolbar"), &show_tool, true); if (!show_tool) { return; } - m_config->Read( wxT("/General/Toolbar alignment"), &tool_align, wxTB_HORIZONTAL ); + /* Construct the toolbar object */ - tb = CreateToolBar( - tool_align|wxNO_BORDER|wxTB_TEXT|wxTB_FLAT|wxTB_3DBUTTONS - ); + wxToolBar *tb = new wxToolBar( + this, -1, wxDefaultPosition, wxDefaultSize, + tool_align|wxNO_BORDER|wxTB_TEXT|wxTB_FLAT|wxTB_3DBUTTONS + ); + tb->SetToolBitmapSize(wxSize(32, 32)); - tb->SetMargins( 2, 2 ); + tb->SetMargins(2, 2); /* Add the buttons */ tb->AddTool( ID_BTN_CONNECT, _("Connect"), img->btn_connect, - wxNullBitmap, wxITEM_NORMAL, _("Connect to any server") + img->btn_connect, wxITEM_NORMAL, _("Connect to any server") ); tb->AddSeparator(); tb->AddTool( - ID_BTN_SERVERS, _("Servers"), img->btn_servers, - wxNullBitmap, wxITEM_CHECK, _("Server list") + ID_BTN_SERVERS, _("Servers"), img->btn_servers, + img->btn_servers, wxITEM_CHECK, _("Server list") ); - tb->AddTool( - ID_BTN_SEARCH, _("Search"), img->btn_search, - wxNullBitmap, wxITEM_CHECK, _("Search files") + tb->AddTool( + ID_BTN_SEARCH, _("Search"), img->btn_search, + img->btn_search, wxITEM_CHECK, _("Search files") ); tb->AddTool( - ID_BTN_TRANSFER, _("Transfer"), img->btn_transfer, - wxNullBitmap, wxITEM_CHECK, _("File Transfer") + ID_BTN_TRANSFER, _("Transfer"), img->btn_transfer, + img->btn_transfer, wxITEM_CHECK, _("File Transfer") ); tb->AddTool( - ID_BTN_SHARED_FILES, _("Shared Files"), img->btn_shared, - wxNullBitmap, wxITEM_CHECK, _("Show shared files") + ID_BTN_SHARED_FILES, _("Shared Files"), img->btn_shared, + img->btn_shared, wxITEM_CHECK, _("Show shared files") ); tb->AddTool( - ID_BTN_MESSAGES, _("Messages"), img->btn_messages, - wxNullBitmap, wxITEM_CHECK, _("Chatting") + ID_BTN_MESSAGES, _("Messages"), img->btn_messages, + img->btn_messages, wxITEM_CHECK, _("Chatting") ); tb->AddTool( - ID_BTN_STATISTICS, _("Statistics"), img->btn_statistics, - wxNullBitmap, wxITEM_CHECK, _("Show live statistics") ); + ID_BTN_STATISTICS, _("Statistics"), img->btn_statistics, + img->btn_statistics, wxITEM_CHECK, _("Show live statistics") ); tb->AddSeparator(); tb->AddTool( - ID_BTN_GUISETTINGS, _("Preferences"), img->btn_guisettings, - wxNullBitmap, wxITEM_NORMAL, _("Modify settings") + ID_BTN_GUISETTINGS, _("Preferences"), img->btn_guisettings, + img->btn_guisettings, wxITEM_NORMAL, _("Modify settings") ); /* And go live */ tb->Realize(); SetToolBar(tb); + + /** + * Last, but not least, we tell the toolbar which button should + * initially toggled. + */ + if (activewnd == serverwnd) tb->ToggleTool(ID_BTN_SERVERS, true); + if (activewnd == searchwnd) tb->ToggleTool(ID_BTN_SEARCH, true); + if (activewnd == transferwnd) tb->ToggleTool(ID_BTN_TRANSFER, true); + if (activewnd == sharedfileswnd) tb->ToggleTool(ID_BTN_SHARED_FILES, true); + if (activewnd == messageswnd) tb->ToggleTool(ID_BTN_MESSAGES, true); + if (activewnd == statisticswnd) tb->ToggleTool(ID_BTN_STATISTICS, true); } -/* - * CloseWindow event function. This should destroy all open dialogs. +/** + * CloseWindow event function. Actual data deletion is done in destructor. */ void CMainDlg::OnCloseWindow( wxCloseEvent &event ){ /* Read from config if we should ask for permission before closing. */ bool prompt_exit; - m_config->Read(wxT("/General/Prompt on exit"), &prompt_exit, true); + m_config->Read(wxT("/General/Prompt on exit"), &prompt_exit, true); if (prompt_exit) { - if (wxMessageBox(_("Close xmule2-ui-wx?"), _("Question"), - wxYES_NO|wxCENTRE|wxICON_QUESTION) == wxNO) - { + if ( + wxMessageBox( + _("Close ShareDaemon wxInterface?"), + _("Question"), wxYES_NO|wxCENTRE|wxICON_QUESTION + ) == wxNO) { return; } } - /* We reach this line if prompt_exit was false, - * or Yes was clicked in messagebox - */ - Destroy(); -} -/** - * Shows server page - */ -void CMainDlg::ShowServerWnd(wxCommandEvent &event) { - if (show_tool) { - GetToolBar()->ToggleTool(m_lastbtn, false); - GetToolBar()->ToggleTool(ID_BTN_SERVERS, true); - } - m_lastbtn = ID_BTN_SERVERS; - SetActiveDialog(serverwnd); - /** - * We send the server page a sizeevent to get the log boxes columns get - * correct column widths (they are calculated dynamically according to - * listctrl width. + /* We reach this line if prompt_exit was false, + * or Yes was clicked in messagebox */ - wxSizeEvent null_event; - serverwnd->OnSize(null_event); -} - -/** - * Shows transfer page - */ -void CMainDlg::ShowTransferWnd(wxCommandEvent &event) { - if (show_tool) { - GetToolBar()->ToggleTool(m_lastbtn, false); - GetToolBar()->ToggleTool(ID_BTN_TRANSFER, true); - } - m_lastbtn = ID_BTN_TRANSFER; - SetActiveDialog(transferwnd); -} - -/** - * Shows search page - */ -void CMainDlg::ShowSearchWnd(wxCommandEvent &event) { - if (show_tool) { - GetToolBar()->ToggleTool(m_lastbtn, false); - GetToolBar()->ToggleTool(ID_BTN_SEARCH, true); - } - m_lastbtn = ID_BTN_SEARCH; - SetActiveDialog(searchwnd); -} - -/** - * Shows shared files page - */ -void CMainDlg::ShowSharedFilesWnd(wxCommandEvent &event) { - if (show_tool) { - GetToolBar()->ToggleTool(m_lastbtn, false); - GetToolBar()->ToggleTool(ID_BTN_SHARED_FILES, true); - } - m_lastbtn = ID_BTN_SHARED_FILES; - SetActiveDialog(sharedfileswnd); -} - -/** - * Shows messages page - */ -void CMainDlg::ShowMessagesWnd(wxCommandEvent &event) { - if (show_tool) { - GetToolBar()->ToggleTool(m_lastbtn, false); - GetToolBar()->ToggleTool(ID_BTN_MESSAGES, true); - } - m_lastbtn = ID_BTN_MESSAGES; - SetActiveDialog(messageswnd); -} - -/** - * Shows statistics page - */ -void CMainDlg::ShowStatisticsWnd(wxCommandEvent &event) { - if (show_tool) { - GetToolBar()->ToggleTool(m_lastbtn, false); - GetToolBar()->ToggleTool(ID_BTN_STATISTICS, true); - } - m_lastbtn = ID_BTN_STATISTICS; - SetActiveDialog(statisticswnd); + Destroy(); } /** * Sends command to core to connect to any server */ -void CMainDlg::ConnectToAnyServer(wxCommandEvent &event) { +void CMainDlg::ConnectToAnyServer() { } /** * Displays GUI settings dialog */ -void CMainDlg::ShowGUISettingsDlg(wxCommandEvent &event) { +void CMainDlg::ShowGUISettingsDlg() { CGUISettingsDlg *guisettings = new CGUISettingsDlg( NULL, -1, _("Preferences"), wxDefaultPosition, wxDefaultSize @@ -402,20 +343,20 @@ m_config->Read(wxT("/General/Start page"), &start_page, 0); wxCommandEvent null_event; switch (start_page) { - case 0: ShowServerWnd(null_event); break; - case 1: ShowTransferWnd(null_event); break; - case 2: ShowSearchWnd(null_event); break; - case 3: ShowSharedFilesWnd(null_event); break; - case 4: ShowMessagesWnd(null_event); break; - case 5: ShowStatisticsWnd(null_event); break; - default: ShowServerWnd(null_event); break; + case 0: ShowPage(serverwnd); break; + case 1: ShowPage(searchwnd); break; + case 2: ShowPage(transferwnd); break; + case 3: ShowPage(sharedfileswnd); break; + case 4: ShowPage(messageswnd); break; + case 5: ShowPage(statisticswnd); break; + default: ShowPage(serverwnd); break; } } /** * Generates our menubar. */ -void CMainDlg::CreateMenuBar() { +void CMainDlg::CreateMyMenuBar() { bool show_menu = false; SetMenuBar(NULL); @@ -424,6 +365,8 @@ return; } + wxMenuBar *menubar = new wxMenuBar(); + wxMenu *file_menu = new wxMenu(); file_menu->Append(ID_FILE_CONNECT, _("Connect")); file_menu->Append(ID_FILE_EXIT, _("Quit")); @@ -433,8 +376,8 @@ wxMenu *view_menu = new wxMenu(); view_menu->Append(ID_VIEW_SERVERS, _("Servers")); - view_menu->Append(ID_VIEW_TRANSFER, _("Transfer")); view_menu->Append(ID_VIEW_SEARCH, _("Search")); + view_menu->Append(ID_VIEW_TRANSFER, _("Transfer")); view_menu->Append(ID_VIEW_SHARED_FILES, _("Shared Files")); view_menu->Append(ID_VIEW_MESSAGES, _("Messages")); view_menu->Append(ID_VIEW_STATISTICS, _("Statistics")); @@ -443,11 +386,139 @@ help_menu->Append(ID_HELP_HELP, _("Help")); help_menu->Append(ID_HELP_ABOUT, _("About...")); - wxMenuBar *menubar = new wxMenuBar(); menubar->Append(file_menu, _("File")); menubar->Append(edit_menu, _("Edit")); menubar->Append(view_menu, _("View")); menubar->Append(help_menu, _("Help")); SetMenuBar(menubar); +} + +/** + * We handle toolbar button events here. If default section of the switch + * statement is reached, there is nothing wrong, probably the event was + * menu event instead, and it will be handler there. + */ +void CMainDlg::ToolEvent(wxCommandEvent &event) { + switch (event.GetId()) { + case ID_BTN_CONNECT: + ConnectToAnyServer(); + break; + case ID_BTN_SERVERS: + ShowPage(serverwnd); + break; + case ID_BTN_SEARCH: + ShowPage(searchwnd); + break; + case ID_BTN_TRANSFER: + ShowPage(transferwnd); + break; + case ID_BTN_SHARED_FILES: + ShowPage(sharedfileswnd); + break; + case ID_BTN_MESSAGES: + ShowPage(messageswnd); + break; + case ID_BTN_STATISTICS: + ShowPage(statisticswnd); + break; + case ID_BTN_GUISETTINGS: + ShowGUISettingsDlg(); + break; + default: + event.Skip(); + break; + } +} + +/** + * The easy way - go through our buttons, find those that are toggled + * on, toggle them off, and then toggle the one being clicked back on. + * Other way to do it would be to keep track of which button was toggled + * the last time we were here, but its messy and can easily cause + * errors. This should be quite failsafe. + */ +void CMainDlg::UpdateToolButtons() { + if (GetToolBar() == NULL) { + return; + } + for (int i=ID_BTN_SERVERS;i<=ID_BTN_STATISTICS;i++) { + GetToolBar()->ToggleTool(i, false); + } + + /** + * We need to ask the main dialog about which page is currently online + * so we can reflect it on toolbar. Since there is no nice way to do it + * w/o rewriting toolbar handling to be generated dynamically (TODO!) + * we do it the ugly way now. + */ + if (GetCurPage() == serverwnd) { + GetToolBar()->ToggleTool(ID_BTN_SERVERS, true); + } else if (GetCurPage() == searchwnd) { + GetToolBar()->ToggleTool(ID_BTN_SEARCH, true); + } else if (GetCurPage() == transferwnd) { + GetToolBar()->ToggleTool(ID_BTN_TRANSFER, true); + } else if (GetCurPage() == sharedfileswnd) { + GetToolBar()->ToggleTool(ID_BTN_SHARED_FILES, true); + } else if (GetCurPage() == messageswnd) { + GetToolBar()->ToggleTool(ID_BTN_MESSAGES, true); + } else if (GetCurPage() == statisticswnd) { + GetToolBar()->ToggleTool(ID_BTN_STATISTICS, true); + } +} + +/** + * We handle menubar events here. + */ +void CMainDlg::MenuEvent(wxCommandEvent &event) { + switch (event.GetId()) { + case ID_FILE_CONNECT: + ConnectToAnyServer(); + break; + case ID_FILE_EXIT: + Close(); + break; + case ID_EDIT_GUI_SETTINGS: + ShowGUISettingsDlg(); + break; + case ID_VIEW_SERVERS: + ShowPage(serverwnd); + break; + case ID_VIEW_SEARCH: + ShowPage(searchwnd); + break; + case ID_VIEW_TRANSFER: + ShowPage(transferwnd); + break; + case ID_VIEW_MESSAGES: + ShowPage(messageswnd); + break; + case ID_VIEW_SHARED_FILES: + ShowPage(sharedfileswnd); + break; + case ID_VIEW_STATISTICS: + ShowPage(statisticswnd); + break; + default: + event.Skip(); + break; + } + +} + +/** + * Since EVT_TOOL and EVT_MENU are synonyms, we can't use event table to + * call the right functions for toolbar or menubar events. Instead, we use + * this helper function to call them both. Both methods then check if the + * event belongs to them, and abort if not, resulting the event being + * passed to other one. + */ +void CMainDlg::MenuOrToolEvent(wxCommandEvent &event) { + if (event.GetEventType() == wxEVT_COMMAND_TOOL_CLICKED) { + ToolEvent(event); + MenuEvent(event); + UpdateToolButtons(); + } else { + event.Skip(); + } } Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MainDlg.h 21 Nov 2003 14:13:36 -0000 1.2 +++ MainDlg.h 23 Nov 2003 09:52:43 -0000 1.3 @@ -62,33 +62,27 @@ long style, wxLocale &m_locale ); ~CMainDlg(); - - wxLocale &m_locale; void CreateMyToolBar(); - void CreateMenuBar(); + void CreateMyMenuBar(); + wxLocale &m_locale; private: DECLARE_EVENT_TABLE() /* Member event handler functions */ - void OnCloseWindow( wxCloseEvent &event ); - void OnBtnGUIOk(wxCommandEvent &event); - void OnBtnGUICancel(wxCommandEvent &event); + void MenuOrToolEvent(wxCommandEvent &event); + void MenuEvent(wxCommandEvent &event); + void ToolEvent(wxCommandEvent &event); + void OnCloseWindow(wxCloseEvent &event); /* Member functions */ - void SetActiveDialog(wxWindow* dlg); void CreateSysTray(); void LoadAndShowDialogPages(); - - void ConnectToAnyServer(wxCommandEvent &event); - - void ShowServerWnd(wxCommandEvent &event); - void ShowTransferWnd(wxCommandEvent &event); - void ShowSearchWnd(wxCommandEvent &event); - void ShowSharedFilesWnd(wxCommandEvent &event); - void ShowMessagesWnd(wxCommandEvent &event); - void ShowStatisticsWnd(wxCommandEvent &event); - void ShowGUISettingsDlg(wxCommandEvent &event); + void ConnectToAnyServer(); + bool ShowPage(wxWindow* dlg); + void ShowGUISettingsDlg(); + void UpdateToolButtons(); + wxWindow* GetCurPage() { return activewnd; } /* Member variables */ bool show_tool; // Wether toolbar should be shown or not. Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ServerWnd.h 21 Nov 2003 12:46:10 -0000 1.27 +++ ServerWnd.h 23 Nov 2003 09:52:43 -0000 1.28 @@ -41,7 +41,6 @@ /* * CServerWnd class. */ -extern class CServerWnd *serverwnd; class CServerWnd: public wxPanel { friend class CServerListCtrl; |
From: <ma...@us...> - 2003-11-23 09:52:11
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv32681 Modified Files: defines.h Log Message: * Global class declarations moved to defines.h where they belong. Index: defines.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- defines.h 21 Nov 2003 04:44:52 -0000 1.34 +++ defines.h 23 Nov 2003 09:52:08 -0000 1.35 @@ -50,17 +50,17 @@ #define wxHAS_TASK_BAR_ICON #endif +extern class CServerWnd *serverwnd; +extern class CSearchWnd *searchwnd; +extern class CTransferWnd *transferwnd; +extern class CMessagesWnd *messageswnd; +extern class CSharedFilesWnd *sharedfileswnd; +extern class CStatisticsWnd *statisticswnd; +extern class CToolBar *toolbar; extern wxConfigBase *m_config; /* ID codes for our controls */ enum { - /** - * Main Toolbar - * DO NOT change these values, saving last open page between sessions - * depends on these values being 1000-x, if you do change these values, - * strange things might start to happen (like last open page is - * forgotten!) - */ ID_BTN_CONNECT = 1000, ID_BTN_SERVERS, ID_BTN_TRANSFER, |
From: <ma...@us...> - 2003-11-23 09:51:49
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv32627 Modified Files: SysTray.cpp Log Message: Use mainframe->Close() instead of delete operator to exit app from systray (cleaner this way) Index: SysTray.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SysTray.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- SysTray.cpp 20 Nov 2003 12:02:20 -0000 1.9 +++ SysTray.cpp 23 Nov 2003 09:51:46 -0000 1.10 @@ -100,13 +100,7 @@ * This method will force the application to exit. */ void CSysTray::Quit(wxCommandEvent &event) { - /** - * Altough wxWindows documentation recommends using Destroy() for - * deleting frames, we use delete operator here, simply because - * Destroy() can take up to several seconds to take effect, and - * it might look the quit command didn't have any effect - */ - delete mainframe; + mainframe->Close(); } void CSysTray::OnLButtonDClick() { |
From: <bo...@us...> - 2003-11-22 03:22:59
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv11726 Modified Files: Makefile.cvs README Log Message: Hopefully fixed all compilation problems caused by the Makefile.cvs. Updated information in README to reflect the changes. Index: Makefile.cvs =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Makefile.cvs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.cvs 21 Nov 2003 19:31:02 -0000 1.10 +++ Makefile.cvs 22 Nov 2003 03:22:56 -0000 1.11 @@ -20,14 +20,44 @@ all: test -#CXX = /usr/i686-mingw32msvc/bin/g++ -#CC = /usr/i686-mingw32msvc/bin/gcc +CPPFLAGS = -CFLAGS = -g -Wall -O3 -std=c99 -CXXFLAGS = -g -Wall -O3 -CPPFLAGS = -DXMULE2 -# You may set -DHAVE_ANSI_COLORS to get colored output -LDFLAGS += -g -lm -lwsock32 +# Ok, you have to tell me, what OS you are using + +# If you have a Linux system, uncomment the following lines by removing +# the hash signs ('#'). If you don't have a Linux system. Comment them +# out by prefixing them by a hash sign. + +# LINUX = true + +# If you have a Win32 system, behave like for Linux, but with the following +# line + +WIN32 = true + +# If you have a Mac OS X system, ... + +# MAXOSX = true + + +# Do you want colored debug output? If yes, uncomment the following line. + +# CPPFLAGS += -DHAVE_ANSI_COLORS + +# ###################### +# +# You shouldn't need to change anything below. + +ifdef WIN32 +CXX = g++ -b i686-mingw32msvc +CC = gcc -b i686-mingw32msvc +LDFLAGS += -lwsock32 +endif + +CFLAGS += -g -Wall -O3 -std=c99 +CXXFLAGS += -g -Wall -O3 +CPPFLAGS += -DXMULE2 +LDFLAGS += -g -lm # -lstdc++ OBJS = ClientList.oo Client.oo test.oo ClientShadow.oo Socket.oo osdep.oo \ Index: README =================================================================== RCS file: /cvsroot/sharedaemon/core/src/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 22 Nov 2003 02:51:07 -0000 1.1 +++ README 22 Nov 2003 03:22:56 -0000 1.2 @@ -1,28 +1,8 @@ The code for the core should compile fine for Linux, Mac OS X and Win32 (using the MingW32 version of the compiler gcc). -Linux ------ - - No changes are needed. - - Simply type "make -f Makefile.cvs" and everything should be ok. - - -Windows 95, 98, ME, NT, 2K, XP (and whatever will follow) ---------------------------------------------------------- - - Edit Makefile.cvs so that the Line starting with CPPFLAGS - also contains the option -DWIN32. - - Afterwards, type "make -f Makefile.cvs" and everything should be ok. - -Mac OS X --------- - - Edit Makefile.cvs so that the Line starting with CPPFLAGS - also contains the option -DMACOSX. - - Type "make -f Makefile.cvs" after that, and everything should be ok. - +For informations on how to change the Makefile.cvs to fit your system, read +the comments there. +After you have done this, type "make -f Makefile.cvs" and everything should +work fine. |
From: <bo...@us...> - 2003-11-22 02:56:10
|
Update of /cvsroot/sharedaemon/core/src In directory sc8-pr-cvs1:/tmp/cvs-serv8324 Modified Files: Ed2kSocket.cpp Log Message: Fixed return statment missing the return code in non-void function Index: Ed2kSocket.cpp =================================================================== RCS file: /cvsroot/sharedaemon/core/src/Ed2kSocket.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Ed2kSocket.cpp 22 Nov 2003 02:39:23 -0000 1.6 +++ Ed2kSocket.cpp 22 Nov 2003 02:56:06 -0000 1.7 @@ -190,7 +190,7 @@ in_SumPacketSizes-=in_Ed2kPacketSize+5; if (!in_Ed2kPacketSize) { - return; + return false; /* * FIXME: throw an exception, close the socket, let * the computer explode etc. ... |