From b6a20a20d010d643e52914f51aa0700df0da925f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 10 Aug 2004 04:07:32 +0000 Subject: [PATCH] Give wxListBox a GetClassDefaultAttributes so wxCalendarCtrl (and others) can use the right set of attributes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/listbox.h | 4 ++++ src/mac/carbon/listbox.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/wx/mac/carbon/listbox.h b/include/wx/mac/carbon/listbox.h index 54d17f73fb..f94cff95b9 100644 --- a/include/wx/mac/carbon/listbox.h +++ b/include/wx/mac/carbon/listbox.h @@ -125,6 +125,10 @@ public: int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); } #endif // wxUSE_OWNER_DRAWN + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + // Windows callbacks #if !__WXMAC_OSX__ void OnChar(wxKeyEvent& event); diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 7be9b0d4b1..755ddbad6e 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -622,6 +622,18 @@ wxOwnerDrawn *wxListBox::CreateItem(size_t n) #endif //USE_OWNER_DRAWN + +// Some custom controls depend on this +/* static */ wxVisualAttributes +wxListBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) +{ + wxVisualAttributes attr; + attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); + attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX); + attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); + return attr; +} + // ============================================================================ // list box control implementation // ============================================================================ -- 2.45.2