|
| 1 | +diff --git a/include/wx/osx/choice.h b/include/wx/osx/choice.h |
| 2 | +index 37486f8a7c..d80bf53766 100644 |
| 3 | +--- a/include/wx/osx/choice.h |
| 4 | ++++ b/include/wx/osx/choice.h |
| 5 | +@@ -73,6 +73,7 @@ public: |
| 6 | + virtual int FindString(const wxString& s, bool bCase = false) const wxOVERRIDE; |
| 7 | + virtual wxString GetString(unsigned int n) const wxOVERRIDE; |
| 8 | + virtual void SetString(unsigned int pos, const wxString& s) wxOVERRIDE; |
| 9 | ++ void SetItemBitmap(unsigned int n, const wxBitmap& bitmap); |
| 10 | + // osx specific event handling common for all osx-ports |
| 11 | + |
| 12 | + virtual bool OSXHandleClicked(double timestampsec) wxOVERRIDE; |
| 13 | +diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h |
| 14 | +index 429c8f7401..cae9f9eebe 100644 |
| 15 | +--- a/include/wx/osx/core/private.h |
| 16 | ++++ b/include/wx/osx/core/private.h |
| 17 | +@@ -820,6 +820,7 @@ public : |
| 18 | + } |
| 19 | + |
| 20 | + virtual void SetItem(int pos, const wxString& item) = 0; |
| 21 | ++ virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) = 0; |
| 22 | + }; |
| 23 | + |
| 24 | + |
| 25 | +diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp |
| 26 | +index 6df17b34e5..1fcb2a5fc4 100644 |
| 27 | +--- a/src/osx/choice_osx.cpp |
| 28 | ++++ b/src/osx/choice_osx.cpp |
| 29 | +@@ -217,6 +217,13 @@ wxString wxChoice::GetString(unsigned int n) const |
| 30 | + return m_strings[n] ; |
| 31 | + } |
| 32 | + |
| 33 | ++void wxChoice::SetItemBitmap(unsigned int n, const wxBitmap& bitmap) |
| 34 | ++{ |
| 35 | ++ wxCHECK_RET( IsValid(n), wxT("wxChoice::SetItemBitmap(): invalid index") ); |
| 36 | ++ |
| 37 | ++ dynamic_cast<wxChoiceWidgetImpl*>(GetPeer())->SetItemBitmap(n, bitmap); |
| 38 | ++} |
| 39 | ++ |
| 40 | + // ---------------------------------------------------------------------------- |
| 41 | + // client data |
| 42 | + // ---------------------------------------------------------------------------- |
| 43 | +diff --git a/src/osx/cocoa/choice.mm b/src/osx/cocoa/choice.mm |
| 44 | +index 2f0eb4ba51..52eb85c17d 100644 |
| 45 | +--- a/src/osx/cocoa/choice.mm |
| 46 | ++++ b/src/osx/cocoa/choice.mm |
| 47 | +@@ -93,6 +93,12 @@ public: |
| 48 | + m_popUpMenu->FindItemByPosition( pos )->SetItemLabel( s ) ; |
| 49 | + } |
| 50 | + |
| 51 | ++ void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) |
| 52 | ++ { |
| 53 | ++ if ( bitmap.Ok() ) |
| 54 | ++ m_popUpMenu->FindItemByPosition( n )->SetBitmap( bitmap ); ; |
| 55 | ++ } |
| 56 | ++ |
| 57 | + private: |
| 58 | + wxMenu* m_popUpMenu; |
| 59 | + }; |
0 commit comments