From: <ma...@us...> - 2003-12-30 13:33:39
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv1295 Modified Files: Images.cpp MBitmapButton.cpp MBitmapButton.h Log Message: Use breeding buttons on wxMac also in addition to wxMSW. Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- Images.cpp 30 Dec 2003 11:34:31 -0000 1.50 +++ Images.cpp 30 Dec 2003 13:33:36 -0000 1.51 @@ -59,7 +59,6 @@ /* TODO: Put names into temporary wxString array and use for-loop to load 'em.*/ /******************************************************************************/ void CImages::LoadImages() { -TIMER_START(wxT("CImages::LoadImages")); wxString path; tool_img_width = 32; @@ -248,7 +247,6 @@ wxT("quit"), new wxBitmap(path+wxT("quit.png"), wxBITMAP_TYPE_ANY) ); -TIMER_STOP(); } /******************************************************************* GetImage */ @@ -284,7 +282,7 @@ GetImage(parent->GetName()) ); } -#ifndef __WXMSW__ +#if !defined(__WXMSW__) && !defined(__WXMAC__) if (parent->GetClassInfo()->IsKindOf(CLASSINFO(MBitmapButton))) { ((MBitmapButton*)parent)->GenImage(); } @@ -449,7 +447,7 @@ } else { wxLogDebug(wxT("Images were not found in %s."), path.c_str()); - path = wxT("../images/default"); + path = wxT("../images/default/"); if (wxDirExists(path)) { wxLogDebug( wxT("Found possible images dir at %s instead."), @@ -458,7 +456,7 @@ return path; } - path = wxT("../src/images/default"); + path = wxT("../src/images/default/"); if (wxDirExists(path)) { wxLogDebug( wxT("Found possible images dir at %s instead."), Index: MBitmapButton.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MBitmapButton.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- MBitmapButton.cpp 27 Dec 2003 08:39:04 -0000 1.10 +++ MBitmapButton.cpp 30 Dec 2003 13:33:36 -0000 1.11 @@ -30,7 +30,11 @@ #include "MBitmapButton.h" -#if defined(__WXMSW__) /* On wxMSW, use wxButton as base */ +/** + * wxMac and wxMSW buttons can have children, use wxButton as base and put + * a static bitmap in there. + */ +#if defined(__WXMSW__) || defined(__WXMAC__) BEGIN_EVENT_TABLE(MBitmapButton, wxButton) EVT_BUTTON(-1, MBitmapButton::OnClick) END_EVENT_TABLE() @@ -86,7 +90,8 @@ event.Skip(); } -#else /* Use wxBitmapButton on other platforms */ +/* Other (GTK) buttons can't breed, thus we do it in wxBitmapButton */ +#else IMPLEMENT_DYNAMIC_CLASS(MBitmapButton, wxBitmapButton) Index: MBitmapButton.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MBitmapButton.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MBitmapButton.h 27 Dec 2003 08:39:04 -0000 1.8 +++ MBitmapButton.h 30 Dec 2003 13:33:36 -0000 1.9 @@ -67,8 +67,11 @@ #error Need MBitmapButton constants for your port. #endif - -#if defined(__WXMSW__) /* Need to use wxButton on MSW */ +/** + * wxMac and wxMSW buttons can have children, use wxButton as base and put + * a static bitmap in there. + */ +#if defined(__WXMSW__) || defined(__WXMAC__) /******************************************************** class MBitmapButton */ /* This class provides functionality of having image AND text on the same */ /* button. This is done by attaching a sizer into the button, with */ @@ -87,7 +90,8 @@ void OnClick(wxCommandEvent &event); /* Skips the events */ }; -#else // !__WXMSW__ /* Use wxBitmapButton elsewhere */ +/* Other (GTK) buttons can't breed, thus we do it in wxBitmapButton */ +#else // !__WXMSW__ && !__WXMAC__ /******************************************************** class MBitmapButton */ /* This class provides functionality of having image AND text on the same */ /* button. This is done by generating a new wxBitmap image from the arguments */ |