Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv5475/src Modified Files: GUISettingsDlg.cpp Images.cpp MainDlg.cpp MainDlg.h Makefile.am wxInterface_private.rc Log Message: wxMSW: Fixed registry issues, statusbar flickering, toolbar images and resource compilation. General: Now uses `which` to detect wx-config. Index: GUISettingsDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- GUISettingsDlg.cpp 19 Dec 2003 03:01:14 -0000 1.28 +++ GUISettingsDlg.cpp 19 Dec 2003 23:50:11 -0000 1.29 @@ -78,10 +78,10 @@ * Loads settings from config object and sets up dialog controls values. */ void CGUISettingsDlg::LoadSettings() { - int font, iconset, tool_align, startpage, numlang, numiconsets; + int font, iconset, tool_align, numlang, numiconsets; bool show_splash, prompt_exit, show_toolbar, show_menubar, remember_last; - wxString tmpname; + wxString tmpname, startpage; /* Read from config. If no value found, &<field> remains unchanged */ m_config->SetPath(wxT("/General")); @@ -92,7 +92,7 @@ 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("Start Page"), &startpage, wxT("Servers")); m_config->Read(wxT("Remember last"), &remember_last, true); /* Load iconset data */ @@ -131,7 +131,7 @@ GetShowTool()->SetValue(show_toolbar); GetShowMenu()->SetValue(show_menubar); GetRememberLast()->SetValue(remember_last); - GetStartPage()->SetSelection(startpage); + GetStartPage()->SetStringSelection(startpage); switch (tool_align) { case wxTB_HORIZONTAL: tool_align = 0; break; @@ -194,7 +194,9 @@ 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("Start Page"), GetStartPage()->GetStringSelection() + ); m_config->Write(wxT("Remember last"), GetRememberLast()->GetValue()); /* Iconsets data */ @@ -484,9 +486,9 @@ wxStaticBoxSizer *item19 = new wxStaticBoxSizer( item20, wxVERTICAL ); wxString strs21[] = { - _("Server"), - _("Transfer"), + _("Servers"), _("Search"), + _("Transfer"), _("Shared Files"), _("Messages"), _("Statistics") Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- Images.cpp 18 Dec 2003 04:25:36 -0000 1.33 +++ Images.cpp 19 Dec 2003 23:50:11 -0000 1.34 @@ -326,10 +326,15 @@ mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); #endif mdc.GetTextExtent(name, &x, &y); + x+=6; + y+=36; - tmp_new = wxBitmap(x+6, y+36); - mdc.SelectObject(tmp_new); + x>tool_img_width ? tool_img_width=x : x=tool_img_width; + y>tool_img_height ? tool_img_height=y : y=tool_img_width; + + tmp_new = wxBitmap(x, y); + mdc.SelectObject(tmp_new); mdc.BeginDrawing(); #ifdef __WXMSW__ /* This gives transparent image on wxMSW */ mdc.SetPen(*wxTRANSPARENT_PEN); Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- MainDlg.cpp 19 Dec 2003 03:01:14 -0000 1.28 +++ MainDlg.cpp 19 Dec 2003 23:50:11 -0000 1.29 @@ -96,7 +96,7 @@ s->AddGrowableCol(0); s->AddGrowableRow(0); cnt->content->Reparent(this); - s->Add(cnt->content, 0, wxGROW|wxEXPAND|wxALL, 5); + s->Add(cnt->content, 0, wxGROW|wxEXPAND); SetSizer(s); Layout(); Show(); @@ -186,7 +186,10 @@ Move(posx, posy); } - wxPanel *statusbar = new wxPanel(this, -1); + wxPanel *statusbar = new wxPanel( + this, -1, wxDefaultPosition, wxDefaultSize, + wxNO_FULL_REPAINT_ON_RESIZE + ); StatusBar(statusbar, true, true); m_mainsizer->Add(statusbar, 0, wxGROW|wxEXPAND, 0); wxASSERT_MSG( @@ -209,7 +212,7 @@ LoadAndShowDialogPages(); img->MakeToolImage(_("Connect"), wxT("btn_connect")); - img->MakeToolImage(_("Prefenreces"), wxT("btn_guisettings")); + img->MakeToolImage(_("Preferences"), wxT("btn_guisettings")); CreateMyToolBar(); CreateMyMenuBar(); @@ -236,7 +239,7 @@ m_config->SetPath(wxT("/General")); m_config->Read(wxT("Remember last"), &remember_last, true); if (remember_last) { - m_config->Write(wxT("Start page"), GetCurPage()->short_title); + m_config->Write(wxT("Start Page"), GetCurPage()->short_title); } #ifdef wxHAS_TASK_BAR_ICON @@ -266,12 +269,15 @@ /* full name of the page, eg "Servers" or "Transfer" */ /******************************************************************************/ bool CMainDlg::SetActivePage(const wxString &to_show) { - if (cur_page == NULL) { /* Assume startup */ - start_up = true; - } else if (cur_page->short_title == to_show) { /* Already shown */ - return false; + if (cur_page == NULL) { + start_up = true; /* Assume startup */ + } else if (to_show == wxEmptyString) { + return false; /* Nothing to show */ + } else if (to_show == wxT("")) { + return false; /* Nothing to show */ + } else if (cur_page->short_title == to_show) { + return false; /* Already shown */ } - Page *new_page = pages.Find(to_show)->GetData(); if (new_page == NULL) { wxFAIL_MSG(wxString::Format( @@ -316,6 +322,7 @@ SetToolBar(NULL); show_tool = true; + m_config->Read(wxT("/General/Show ToolBar"), &show_tool, true); if (!show_tool) { return; @@ -473,8 +480,7 @@ wxT("btn_statistics"), ID_STATISTICSWND ); - m_config->Read(wxT("/General/Start page"), &start_page, wxT("Servers")); - + m_config->Read(wxT("/General/Start Page"), &start_page, wxT("Servers")); if (start_page.ToLong(&tmp)) { /* Old_style (<0.2.0) conf file */ switch (tmp) { case 0: start_page = wxT("Servers"); break; @@ -485,7 +491,9 @@ case 5: start_page = wxT("Statistics"); break; default: start_page = wxT("Servers"); break; } - } + } else if (start_page == wxT("")) { /* Windows registry returns "" if */ + start_page = wxT("Servers"); /* int was stored but wxString */ + } /* was read */ SetActivePage(start_page); /* Error-checking is done there */ } Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- MainDlg.h 18 Dec 2003 04:25:36 -0000 1.12 +++ MainDlg.h 19 Dec 2003 23:50:12 -0000 1.13 @@ -68,7 +68,7 @@ ); /* Constructor */ private: DECLARE_EVENT_TABLE() /* Event table declaration */ - void RightClick(wxMouseEvent &event); + void RightClick(wxMouseEvent &event); /* Right mouse clicks events */ }; /* This very small class usually shows a frame with one dialog page as content*/ Index: Makefile.am =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 19 Dec 2003 03:01:14 -0000 1.5 +++ Makefile.am 19 Dec 2003 23:50:12 -0000 1.6 @@ -23,7 +23,7 @@ UploadListCtrl.o \ wxInterface.o \ wxInterface_wdr.o\ - $(RES) \ + @RES@ \ all: $(PROGRAM) @@ -47,7 +47,7 @@ false; \ fi; -.cpp.o : +.cpp.o: @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to " @echo -e -n "$(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)" @if @CXX@ @CXX_FLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $< 2>.err; then \ @@ -70,9 +70,20 @@ .rc.res: @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to " @echo -e -n "$(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" - @if @WINDRES@ -i $< -I rc -o $@ -O coff --include-dir=@INCLUDE@; then \ - echo -e "$(WELLCOLOR)ok.$(ACTIONCOLOR)"; \ + @if windres -i $< -I rc -o $@ -O coff --include-dir=/local/include 2>.err; then \ + if test -s .err; then \ + echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ + cat .err; \ + rm -f .err; \ + echo -e "$(DEFAULTCOLOR)"; \ + else \ + echo -e "$(WELLCOLOR)ok.$(ACTIONCOLOR)"; \ + fi; \ else \ + echo -e "failed:"; \ + cat .err; \ + rm -f .err; \ + echo -e "$(DEFAULTCOLOR)"; \ false; \ fi; Index: wxInterface_private.rc =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_private.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wxInterface_private.rc 29 Nov 2003 09:16:40 -0000 1.3 +++ wxInterface_private.rc 19 Dec 2003 23:50:12 -0000 1.4 @@ -1,13 +1,9 @@ -// THIS FILE WILL BE OVERWRITTEN BY DEV-C++! -// DO NOT EDIT! - -//#include "xmule2-ui-wx_private.rc" -#include <wx/msw/wx.rc> -A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "wxInterface.ico" - -// -// SUPPORT FOR WINDOWS XP THEMES: -// THIS WILL MAKE THE PROGRAM USE THE COMMON CONTROLS -// LIBRARY VERSION 6.0 (IF IT IS AVAILABLE) -// -1 24 "wxInterface.Manifest" +#include <wx/msw/wx.rc> +A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "wxInterface.ico" + +// +// SUPPORT FOR WINDOWS XP THEMES: +// THIS WILL MAKE THE PROGRAM USE THE COMMON CONTROLS +// LIBRARY VERSION 6.0 (IF IT IS AVAILABLE) +// +1 24 "wxInterface.Manifest" |