]> git.saurik.com Git - wxWidgets.git/commitdiff
Reverted renderer changes and just use window variant within renderer functions
authorJulian Smart <julian@anthemion.co.uk>
Fri, 9 Feb 2007 14:05:11 +0000 (14:05 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 9 Feb 2007 14:05:11 +0000 (14:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/renderer.tex
include/wx/renderer.h
src/common/combocmn.cpp
src/mac/carbon/renderer.cpp

index 3013dcb734e9d80a984783a0db82de08a2656ea1..d0fa0b0ec99768f2212d85b86dc9a84f9c0d5cb8 100644 (file)
@@ -74,10 +74,6 @@ enum
     wxCONTROL_SELECTED   = 0x00000020,  // selected item in e.g. listbox
     wxCONTROL_CHECKED    = 0x00000040,  // (check/radio button) is checked
     wxCONTROL_CHECKABLE  = 0x00000080,  // (menu) item can be checked
-    wxCONTROL_SIZE_NORMAL = 0x00000100,
-    wxCONTROL_SIZE_LARGE  = 0x00000200,
-    wxCONTROL_SIZE_SMALL  = 0x00000400,
-    wxCONTROL_SIZE_MINI   = 0x00000800,
     wxCONTROL_UNDETERMINED = wxCONTROL_CHECKABLE  // (check) undetermined state
 };
 \end{verbatim}
index 448539d79caab4a7facceaf7d61b8d4498586a5a..a270f0848edb6e835ba98fd718a2b68d35137e3d 100644 (file)
@@ -62,12 +62,7 @@ enum
     wxCONTROL_CHECKABLE  = 0x00000080,  // (menu) item can be checked
     wxCONTROL_UNDETERMINED = wxCONTROL_CHECKABLE, // (check) undetermined state
 
-    wxCONTROL_SIZE_NORMAL = 0x00000100,
-    wxCONTROL_SIZE_LARGE  = 0x00000200,
-    wxCONTROL_SIZE_SMALL  = 0x00000400,
-    wxCONTROL_SIZE_MINI   = 0x00000800,
-
-    wxCONTROL_FLAGS_MASK = 0x00000fff,
+    wxCONTROL_FLAGS_MASK = 0x000000ff,
 
     // this is a pseudo flag not used directly by wxRenderer but rather by some
     // controls internally
index 82345122b808fabe662fc75af57153ec8771a98b..2595b6ad92ace1787abfa67ff16d40f82bb3fa68 100644 (file)
@@ -1347,11 +1347,6 @@ void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int paintBg )
         }
 
         // Draw standard button
-        if (GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL)
-            drawState |= wxCONTROL_SIZE_SMALL;
-        else if (GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI)
-            drawState |= wxCONTROL_SIZE_MINI;
-        
         wxRendererNative::Get().DrawComboBoxDropButton(this,
                                                        dc,
                                                        drawRect,
@@ -1385,11 +1380,6 @@ void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int paintBg )
                 dc.DrawRectangle(rect);
             }
 
-            if (GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL)
-                drawState |= wxCONTROL_SIZE_SMALL;
-            else if (GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI)
-                drawState |= wxCONTROL_SIZE_MINI;
-
             wxRendererNative::Get().DrawPushButton(this,
                                                    dc,
                                                    drawRect,
@@ -1865,7 +1855,7 @@ void wxComboCtrlBase::ShowPopup()
     }
 
     winPopup->Enable();
-    
+
     wxASSERT( !m_popup || m_popup == popup ); // Consistency check.
 
     wxSize adjustedSize = m_popupInterface->GetAdjustedSize(widthPopup,
index 2c390637b2c969b33412526c7432fc782e17e212..849f287b025c2f6f4a99197db6257db66dab3cbe 100644 (file)
@@ -42,7 +42,7 @@ public:
         wxHeaderButtonParams* params = NULL );
 
     virtual int GetHeaderButtonHeight(wxWindow *win);
-    
+
     // draw the expanded/collapsed icon for a tree control item
     virtual void DrawTreeItemButton( wxWindow *win,
         wxDC& dc,
@@ -61,12 +61,12 @@ public:
                                         wxDC& dc,
                                         const wxRect& rect,
                                         int flags = 0);
-    
+
     virtual void DrawPushButton(wxWindow *win,
                                 wxDC& dc,
                                 const wxRect& rect,
                                 int flags = 0);
-    
+
     virtual void DrawItemSelectionRect(wxWindow *win,
                                        wxDC& dc,
                                        const wxRect& rect,
@@ -79,7 +79,7 @@ private:
                             int flags,
                             int kind,
                             int adornment);
-        
+
     // the tree buttons
     wxBitmap m_bmpTreeExpanded;
     wxBitmap m_bmpTreeCollapsed;
@@ -168,7 +168,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
             // The down arrow is drawn automatically, change it to an up arrow if needed.
             if ( sortArrow == wxHDR_SORT_ICON_UP )
                 drawInfo.adornment = kThemeAdornmentHeaderButtonSortUp;
-                
+
             HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
 
             // If we don't want any arrows we need to draw over the one already there
@@ -181,7 +181,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
                 headerRect.size.width += 25;
                 HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
                 CGContextRestoreGState( cgContext );
-            }                
+            }
         }
 
 #if wxMAC_USE_CORE_GRAPHICS
@@ -233,7 +233,7 @@ void wxRendererMac::DrawTreeItemButton( wxWindow *win,
     const wxCoord y = rect.y;
     const wxCoord w = rect.width;
     const wxCoord h = rect.height;
-#endif    
+#endif
 
     dc.SetBrush( *wxTRANSPARENT_BRUSH );
 
@@ -283,10 +283,10 @@ void wxRendererMac::DrawTreeItemButton( wxWindow *win,
             // Apple mailing list posts say to use the arrow adornment constants, but those don't work.
             // We need to set the value using the 'old' DrawThemeButton constants instead.
             drawInfo.value = (flags & wxCONTROL_EXPANDED) ? kThemeDisclosureDown : kThemeDisclosureRight;
-            drawInfo.adornment = kThemeAdornmentNone; 
+            drawInfo.adornment = kThemeAdornmentNone;
 
             HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
-            
+
         }
 
 #if wxMAC_USE_CORE_GRAPHICS
@@ -370,7 +370,7 @@ wxRendererMac::DrawItemSelectionRect(wxWindow *win,
                                      const wxRect& rect,
                                      int flags )
 {
-    RGBColor selColor; 
+    RGBColor selColor;
     if (flags & wxCONTROL_SELECTED)
     {
         if (flags & wxCONTROL_FOCUSED)
@@ -378,7 +378,7 @@ wxRendererMac::DrawItemSelectionRect(wxWindow *win,
         else
             GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, 32, true, &selColor);
     }
-    
+
     wxBrush selBrush = wxBrush( wxColour( selColor.red, selColor.green, selColor.blue ), wxSOLID );
 
     dc.SetPen( *wxTRANSPARENT_PEN );
@@ -474,17 +474,17 @@ wxRendererMac::DrawComboBoxDropButton(wxWindow *win,
                               int flags)
 {
     int kind;
-    if (flags & wxCONTROL_SIZE_SMALL)
+    if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
         kind = kThemeArrowButtonSmall;
-    else if (flags & wxCONTROL_SIZE_MINI)
+    else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
         kind = kThemeArrowButtonMini;
     else
         kind = kThemeArrowButton;
-    
+
     DrawMacThemeButton(win, dc, rect, flags,
                        kind, kThemeAdornmentArrowDownArrow);
 }
-    
+
 void
 wxRendererMac::DrawPushButton(wxWindow *win,
                               wxDC& dc,
@@ -492,7 +492,10 @@ wxRendererMac::DrawPushButton(wxWindow *win,
                               int flags)
 {
     int kind;
-    if (flags & wxCONTROL_SIZE_SMALL)
+    if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
+        kind = kThemeBevelButtonSmall;
+    // There is no kThemeBevelButtonMini, but in this case, use Small
+    else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
         kind = kThemeBevelButtonSmall;
     else
         kind = kThemeBevelButton;
@@ -500,4 +503,4 @@ wxRendererMac::DrawPushButton(wxWindow *win,
     DrawMacThemeButton(win, dc, rect, flags,
                        kind, kThemeAdornmentNone);
 }
-    
+