Give wxListBox a GetClassDefaultAttributes so wxCalendarCtrl (and
authorRobin Dunn <robin@alldunn.com>
Tue, 10 Aug 2004 04:07:32 +0000 (04:07 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 10 Aug 2004 04:07:32 +0000 (04:07 +0000)
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
src/mac/carbon/listbox.cpp

index 54d17f73fbd7ab5887be7bc41840d050d6bbffb0..f94cff95b9c781dc719c9651a1fa0e76d7441568 100644 (file)
@@ -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);
index 7be9b0d4b1835cc39ca8a819b0578f312274ff5a..755ddbad6e0a2e44b9cd8768e859f3e0212604af 100644 (file)
@@ -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
 // ============================================================================