]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/win32.cpp
make sure we are feeding coordinates of HIView instances, not wx-dimensions back...
[wxWidgets.git] / src / univ / themes / win32.cpp
index 6d0a72fffb27fe97329c41931ea5d9dbc34f448a..2558a59fe1375de450f99ac4b780add2a518b674 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        univ/themes/win32.cpp
+// Name:        src/univ/themes/win32.cpp
 // Purpose:     wxUniversal theme implementing Win32-like LNF
 // Author:      Vadim Zeitlin
 // Modified by:
@@ -40,7 +40,6 @@
     #include "wx/scrolbar.h"
     #include "wx/slider.h"
     #include "wx/textctrl.h"
-    #include "wx/listbox.h"
     #include "wx/toolbar.h"
     #include "wx/statusbr.h"
 
         // for COLOR_* constants
         #include "wx/msw/private.h"
     #endif
+    #include "wx/menu.h"
+    #include "wx/settings.h"
+    #include "wx/toplevel.h"
+    #include "wx/image.h"
 #endif // WX_PRECOMP
 
 #include "wx/notebook.h"
 #include "wx/spinbutt.h"
-#include "wx/settings.h"
-#include "wx/menu.h"
 #include "wx/artprov.h"
-#include "wx/toplevel.h"
-#include "wx/image.h"
+#ifdef wxUSE_TOGGLEBTN
+#include "wx/tglbtn.h"
+#endif // wxUSE_TOGGLEBTN
 
 #include "wx/univ/scrtimer.h"
 #include "wx/univ/renderer.h"
@@ -241,12 +243,15 @@ public:
                                  int flags = 0,
                                  wxAlignment align = wxALIGN_LEFT,
                                  int indexAccel = -1);
+#if wxUSE_TOOLBAR
     virtual void DrawToolBarButton(wxDC& dc,
                                    const wxString& label,
                                    const wxBitmap& bitmap,
                                    const wxRect& rect,
                                    int flags = 0,
-                                   long style = 0);
+                                   long style = 0,
+                                   int tbarStyle = 0);
+#endif // wxUSE_TOOLBAR
     virtual void DrawTextLine(wxDC& dc,
                               const wxString& text,
                               const wxRect& rect,
@@ -262,6 +267,7 @@ public:
                          int flags = 0,
                          int indexAccel = -1);
 
+#if wxUSE_SLIDER
     virtual void DrawSliderShaft(wxDC& dc,
                                  const wxRect& rect,
                                  int lenThumb,
@@ -283,7 +289,9 @@ public:
                                  int step = 1,
                                  int flags = 0,
                                  long style = 0);
+#endif // wxUSE_SLIDER
 
+#if wxUSE_MENUS
     virtual void DrawMenuBarItem(wxDC& dc,
                                  const wxRect& rect,
                                  const wxString& label,
@@ -300,11 +308,14 @@ public:
     virtual void DrawMenuSeparator(wxDC& dc,
                                    wxCoord y,
                                    const wxMenuGeometryInfo& geomInfo);
+#endif // wxUSE_MENUS
 
+#if wxUSE_STATUSBAR
     virtual void DrawStatusField(wxDC& dc,
                                  const wxRect& rect,
                                  const wxString& label,
                                  int flags = 0, int style = 0);
+#endif // wxUSE_STATUSBAR
 
     // titlebars
     virtual void DrawFrameTitleBar(wxDC& dc,
@@ -349,6 +360,8 @@ public:
 
     virtual wxSize GetScrollbarArrowSize() const
         { return m_sizeScrollbarArrow; }
+
+#if wxUSE_SCROLLBAR
     virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar,
                                     wxScrollBar::Element elem,
                                     int thumbPos = -1) const;
@@ -358,6 +371,8 @@ public:
     virtual wxCoord ScrollbarToPixel(const wxScrollBar *scrollbar,
                                      int thumbPos = -1);
     virtual int PixelToScrollbar(const wxScrollBar *scrollbar, wxCoord coord);
+#endif // wxUSE_SCROLLBAR
+
     virtual wxCoord GetListboxItemHeight(wxCoord fontHeight)
         { return fontHeight + 2; }
     virtual wxSize GetCheckBitmapSize() const
@@ -372,15 +387,19 @@ public:
     virtual wxSize GetToolBarMargin() const
         { return wxSize(4, 4); }
 
+#if wxUSE_TEXTCTRL
     virtual wxRect GetTextTotalArea(const wxTextCtrl *text,
                                     const wxRect& rect) const;
     virtual wxRect GetTextClientArea(const wxTextCtrl *text,
                                      const wxRect& rect,
                                      wxCoord *extraSpaceBeyond) const;
+#endif // wxUSE_TEXTCTRL
 
     virtual wxSize GetTabIndent() const { return wxSize(2, 2); }
     virtual wxSize GetTabPadding() const { return wxSize(6, 5); }
 
+#if wxUSE_SLIDER
+
     virtual wxCoord GetSliderDim() const { return SLIDER_THUMB_LENGTH + 2*BORDER_THICKNESS; }
     virtual wxCoord GetSliderTickLen() const { return SLIDER_TICK_LENGTH; }
     virtual wxRect GetSliderShaftRect(const wxRect& rect,
@@ -390,13 +409,19 @@ public:
     virtual wxSize GetSliderThumbSize(const wxRect& rect,
                                       int lenThumb,
                                       wxOrientation orient) const;
+#endif // wxUSE_SLIDER
+
     virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
 
+#if wxUSE_MENUS
     virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
     virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
                                                 const wxMenu& menu) const;
+#endif // wxUSE_MENUS
 
+#if wxUSE_STATUSBAR
     virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const;
+#endif // wxUSE_STATUSBAR
 
 protected:
     // helper of DrawLabel() and DrawCheckOrRadioButton()
@@ -540,6 +565,7 @@ protected:
     wxWin32Renderer *m_renderer;
 };
 
+#if wxUSE_SCROLLBAR
 class wxWin32ScrollBarInputHandler : public wxStdScrollBarInputHandler
 {
 public:
@@ -571,7 +597,9 @@ protected:
     // we remember the interval of the timer to be able to restart it
     int m_interval;
 };
+#endif // wxUSE_SCROLLBAR
 
+#if wxUSE_CHECKBOX
 class wxWin32CheckboxInputHandler : public wxStdCheckboxInputHandler
 {
 public:
@@ -582,7 +610,9 @@ public:
                            const wxKeyEvent& event,
                            bool pressed);
 };
+#endif // wxUSE_CHECKBOX
 
+#if wxUSE_TEXTCTRL
 class wxWin32TextCtrlInputHandler : public wxStdTextCtrlInputHandler
 {
 public:
@@ -593,6 +623,7 @@ public:
                            const wxKeyEvent& event,
                            bool pressed);
 };
+#endif // wxUSE_TEXTCTRL
 
 class wxWin32StatusBarInputHandler : public wxStdInputHandler
 {
@@ -630,7 +661,9 @@ public:
 
     virtual bool HandleActivation(wxInputConsumer *consumer, bool activated);
 
+#if wxUSE_MENUS
     void PopupSystemMenu(wxTopLevelWindow *window, const wxPoint& pos) const;
+#endif // wxUSE_MENUS
 
 private:
     // was the mouse over the grip last time we checked?
@@ -1294,14 +1327,18 @@ wxInputHandler *wxWin32Theme::GetDefaultInputHandler()
 
 wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control)
 {
-    wxInputHandler *handler;
+    wxInputHandler *handler = NULL;
     int n = m_handlerNames.Index(control);
     if ( n == wxNOT_FOUND )
     {
         // create a new handler
         if ( control == wxINP_HANDLER_SCROLLBAR )
+        {
+#if wxUSE_SCROLLBAR
             handler = new wxWin32ScrollBarInputHandler(m_renderer,
                                                        GetDefaultInputHandler());
+#endif // wxUSE_SCROLLBAR
+        }
 #if wxUSE_BUTTON
         else if ( control == wxINP_HANDLER_BUTTON )
             handler = new wxStdButtonInputHandler(GetDefaultInputHandler());
@@ -1348,7 +1385,8 @@ wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control)
 #endif // wxUSE_TOOLBAR
         else if ( control == wxINP_HANDLER_TOPLEVEL )
             handler = new wxWin32FrameInputHandler(GetDefaultInputHandler());
-        else
+
+        if(!handler)
             handler = GetDefaultInputHandler();
 
         n = m_handlerNames.Add(control);
@@ -1386,10 +1424,14 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const
 
     if ( !win->ShouldInheritColours() )
     {
+#if wxUSE_TEXTCTRL
         wxTextCtrl *text = wxDynamicCast(win, wxTextCtrl);
+#endif // wxUSE_TEXTCTRL
 #if wxUSE_LISTBOX
         wxListBox* listBox = wxDynamicCast(win, wxListBox);
-#endif
+#endif // wxUSE_LISTBOX
+
+#if wxUSE_TEXTCTRL
         if ( text
 #if wxUSE_LISTBOX
          || listBox
@@ -1407,6 +1449,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const
                 }
             }
         }
+#endif // wxUSE_TEXTCTRL
 
         if (!col.Ok())
             col = Get(CONTROL); // Most controls should be this colour, not WINDOW
@@ -1419,10 +1462,12 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const
         // and for the states for which we don't have any specific colours
         if ( !col.Ok() || (flags & wxCONTROL_PRESSED) != 0 )
         {
+#if wxUSE_SCROLLBAR
             if ( wxDynamicCast(win, wxScrollBar) )
                 col = Get(flags & wxCONTROL_PRESSED ? SCROLLBAR_PRESSED
                                                     : SCROLLBAR);
             else
+#endif // wxUSE_SCROLLBAR
                 col = Get(CONTROL);
         }
     }
@@ -2472,12 +2517,14 @@ void wxWin32Renderer::DrawCheckButton(wxDC& dc,
                            0); // no focus rect offset for checkboxes
 }
 
+#if wxUSE_TOOLBAR
 void wxWin32Renderer::DrawToolBarButton(wxDC& dc,
                                         const wxString& label,
                                         const wxBitmap& bitmap,
                                         const wxRect& rectOrig,
                                         int flags,
-                                        long style)
+                                        long style,
+                                        int tbarStyle)
 {
     if (style == wxTOOL_STYLE_BUTTON)
     {
@@ -2493,18 +2540,46 @@ void wxWin32Renderer::DrawToolBarButton(wxDC& dc,
             DrawBorder(dc, wxBORDER_RAISED, rect, flags);
         }
 
-        dc.DrawLabel(label, bitmap, rect, wxALIGN_CENTRE);
+        if(tbarStyle & wxTB_TEXT)
+        {
+            if(tbarStyle & wxTB_HORIZONTAL)
+            {
+                dc.DrawLabel(label, bitmap, rect, wxALIGN_CENTRE);
+            }
+            else
+            {
+                dc.DrawLabel(label, bitmap, rect, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
+            }
+        }
+        else
+        {
+            int xpoint = (rect.GetLeft() + rect.GetRight() + 1 - bitmap.GetWidth()) / 2;
+            int ypoint = (rect.GetTop() + rect.GetBottom() + 1 - bitmap.GetHeight()) / 2;
+            dc.DrawBitmap(bitmap, xpoint, ypoint);
+        }
     }
     else if (style == wxTOOL_STYLE_SEPARATOR)
     {
         // leave a small gap aroudn the line, also account for the toolbar
         // border itself
-        DrawVerticalLine(dc, rectOrig.x + rectOrig.width/2,
-                         rectOrig.y + 2*BORDER_THICKNESS,
-                         rectOrig.GetBottom() - BORDER_THICKNESS);
+        if(rectOrig.height > rectOrig.width)
+        {
+            // horizontal
+            DrawVerticalLine(dc, rectOrig.x + rectOrig.width/2,
+                             rectOrig.y + 2*BORDER_THICKNESS,
+                             rectOrig.GetBottom() - BORDER_THICKNESS);
+        }
+        else
+        {
+            // vertical
+            DrawHorizontalLine(dc, rectOrig.y + rectOrig.height/2,
+                         rectOrig.x + 2*BORDER_THICKNESS,
+                         rectOrig.GetRight() - BORDER_THICKNESS);
+        }
     }
     // don't draw wxTOOL_STYLE_CONTROL
 }
+#endif // wxUSE_TOOLBAR
 
 // ----------------------------------------------------------------------------
 // text control
@@ -2596,12 +2671,20 @@ void wxWin32Renderer::DrawTab(wxDC& dc,
         dcMem.SetFont(dc.GetFont());
         dcMem.SetTextForeground(dc.GetTextForeground());
         dcMem.Clear();
-        bitmapRotated = wxBitmap( wxImage( bitmap.ConvertToImage() ).Rotate90(dir==wxLEFT) );
+        bitmapRotated =
+#if wxUSE_IMAGE
+                        wxBitmap( wxImage( bitmap.ConvertToImage() ).Rotate90(dir==wxLEFT) )
+#else
+                        bitmap
+#endif // wxUSE_IMAGE
+                        ;
         DrawButtonLabel(dcMem, label, bitmapRotated, rectLabel,
                         flags, wxALIGN_CENTRE, indexAccel);
         dcMem.SelectObject(wxNullBitmap);
         bitmapMem = bitmapMem.GetSubBitmap(rectLabel);
+#if wxUSE_IMAGE
         bitmapMem = wxBitmap(wxImage(bitmapMem.ConvertToImage()).Rotate90(dir==wxRIGHT));
+#endif // wxUSE_IMAGE
         dc.DrawBitmap(bitmapMem, rectLabel.y, rectLabel.x, false);
     }
     else
@@ -2706,6 +2789,8 @@ void wxWin32Renderer::DrawTab(wxDC& dc,
     #undef REVERSE_FOR_VERTICAL
 }
 
+#if wxUSE_SLIDER
+
 // ----------------------------------------------------------------------------
 // slider
 // ----------------------------------------------------------------------------
@@ -3055,6 +3140,10 @@ void wxWin32Renderer::DrawSliderTicks(wxDC& dc,
     }
 }
 
+#endif // wxUSE_SLIDER
+
+#if wxUSE_MENUS
+
 // ----------------------------------------------------------------------------
 // menu and menubar
 // ----------------------------------------------------------------------------
@@ -3317,6 +3406,10 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win,
     return gi;
 }
 
+#endif // wxUSE_MENUS
+
+#if wxUSE_STATUSBAR
+
 // ----------------------------------------------------------------------------
 // status bar
 // ----------------------------------------------------------------------------
@@ -3409,6 +3502,8 @@ void wxWin32Renderer::DrawStatusField(wxDC& dc,
     DrawLabel(dc, label, rectIn, flags, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
 }
 
+#endif // wxUSE_STATUSBAR
+
 // ----------------------------------------------------------------------------
 // combobox
 // ----------------------------------------------------------------------------
@@ -3569,6 +3664,8 @@ void wxWin32Renderer::DrawScrollCorner(wxDC& dc, const wxRect& rect)
     DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect);
 }
 
+#if wxUSE_SCROLLBAR
+
 wxRect wxWin32Renderer::GetScrollbarRect(const wxScrollBar *scrollbar,
                                          wxScrollBar::Element elem,
                                          int thumbPos) const
@@ -3600,6 +3697,8 @@ int wxWin32Renderer::PixelToScrollbar(const wxScrollBar *scrollbar,
     return StandardPixelToScrollbar(scrollbar, coord, m_sizeScrollbarArrow);
 }
 
+#endif // wxUSE_SCROLLBAR
+
 // ----------------------------------------------------------------------------
 // top level windows
 // ----------------------------------------------------------------------------
@@ -3974,168 +4073,274 @@ wxSize wxWin32Renderer::GetFrameIconSize() const
 // standard icons
 // ----------------------------------------------------------------------------
 
+/* Copyright (c) Julian Smart */
 static char *error_xpm[]={
-"32 32 5 1",
-". c None",
-"# c #800000",
-"b c #808080",
-"a c #ff0000",
-"c c #ffffff",
-"...........########.............",
-"........###aaaaaaaa###..........",
-".......#aaaaaaaaaaaaaa#.........",
-".....##aaaaaaaaaaaaaaaa##.......",
-"....#aaaaaaaaaaaaaaaaaaaa#......",
-"...#aaaaaaaaaaaaaaaaaaaaaa#.....",
-"...#aaaaaaaaaaaaaaaaaaaaaa#b....",
-"..#aaaaaacaaaaaaaaaacaaaaaa#b...",
-".#aaaaaacccaaaaaaaacccaaaaaa#...",
-".#aaaaacccccaaaaaacccccaaaaa#b..",
-".#aaaaaacccccaaaacccccaaaaaa#bb.",
-"#aaaaaaaacccccaacccccaaaaaaaa#b.",
-"#aaaaaaaaaccccccccccaaaaaaaaa#b.",
-"#aaaaaaaaaaccccccccaaaaaaaaaa#bb",
-"#aaaaaaaaaaaccccccaaaaaaaaaaa#bb",
-"#aaaaaaaaaaaccccccaaaaaaaaaaa#bb",
-"#aaaaaaaaaaccccccccaaaaaaaaaa#bb",
-"#aaaaaaaaaccccccccccaaaaaaaaa#bb",
-"#aaaaaaaacccccaacccccaaaaaaaa#bb",
-".#aaaaaacccccaaaacccccaaaaaa#bbb",
-".#aaaaacccccaaaaaacccccaaaaa#bbb",
-".#aaaaaacccaaaaaaaacccaaaaaa#bb.",
-"..#aaaaaacaaaaaaaaaacaaaaaa#bbb.",
-"...#aaaaaaaaaaaaaaaaaaaaaa#bbbb.",
-"...#aaaaaaaaaaaaaaaaaaaaaa#bbb..",
-"....#aaaaaaaaaaaaaaaaaaaa#bbb...",
-".....##aaaaaaaaaaaaaaaa##bbbb...",
-"......b#aaaaaaaaaaaaaa#bbbbb....",
-".......b###aaaaaaaa###bbbbb.....",
-".........bb########bbbbbb.......",
-"..........bbbbbbbbbbbbbb........",
-".............bbbbbbbb..........."};
+/* columns rows colors chars-per-pixel */
+"32 32 70 1",
+"- c #BF0101",
+"b c #361F1F",
+"& c #C08484",
+"X c #BF3333",
+"# c #C08181",
+"% c #C01111",
+"d c #C51515",
+"s c #551818",
+"O c #C07E7E",
+": c #C00E0E",
+"u c #E28A8A",
+"2 c #C81F1F",
+"8 c #FFFFFF",
+"p c #E59494",
+"< c #BB0101",
+"y c #DA6A6A",
+"A c #4C4C4C",
+"9 c #F7DFDF",
+"@ c #BF5353",
+"w c #FAE9E9",
+"F c #272727",
+"5 c #D24A4A",
+". c #C06363",
+"n c #BF8282",
+"7 c #F2C9C9",
+"t c #C09292",
+"M c #3E3E3E",
+"x c #4D4D4D",
+"4 c #CA2A2A",
+"h c #E79F9F",
+"* c #C05454",
+"D c #711212",
+"V c #737373",
+"$ c #BF3232",
+"N c #900B0B",
+"6 c #BD0303",
+"3 c #DF7F7F",
+"K c #6F1212",
+"C c #BD0000",
+"m c #950909",
+"P c #8A8A8A",
+"j c #D75F5F",
+"  c None",
+"e c #F4D4D4",
+"S c #BF2020",
+"L c #747474",
+"G c #842C2C",
+"c c #ECB4B4",
+"l c #2E2121",
+"g c #BF7E7E",
+"k c #9B0808",
+"= c #BF0505",
+"a c #B10303",
+"q c #7E2020",
+"1 c #642222",
+"J c #676767",
+"B c #322020",
+"; c #C00303",
+"i c #242424",
+"o c #C00000",
+"> c #BF1F1F",
+", c #842B2B",
+"f c #701212",
+"0 c #BE0000",
+"r c #960909",
+"H c #686868",
+"v c #BC0000",
+"Z c #671414",
+"+ c #C02020",
+"z c #CD3535",
+/* pixels */
+"                                ",
+"                                ",
+"            .XoooOO             ",
+"         .+ooooooooo@#          ",
+"        $oooooooooooo%&         ",
+"      *=-ooooooooooooo;:        ",
+"     *oooooooooooooooooo>       ",
+"     =ooooooooooooooooooo,      ",
+"    $-ooooooooooooooooooo<1     ",
+"   .oooooo2334ooo533oooooo6     ",
+"   +ooooooo789oo2883oooooo0q    ",
+"   oooooooo2w83o78eoooooooor    ",
+"  toooooooooy88u884oooooooori   ",
+"  Xooooooooooe888poooooooooas   ",
+"  ooooooooooo4889doooooooooof   ",
+"  ooooooooooo588w2oooooooooofi  ",
+"  oooooooooodw8887oooooooooofi  ",
+"  goooooooooh8w588jooooooookli  ",
+"  tooooooooz885op8wdooooooorix  ",
+"   oooooood98cood98cooooooori   ",
+"   @oooooop8w2ooo5885ooooovbi   ",
+"   n%ooooooooooooooooooooomiM   ",
+"    &;oooooooooooooooooooNBiV   ",
+"     :ooooooooooooooooooCZiA    ",
+"     nSooooooooooooooooCDiF     ",
+"      nG<oooooooooooooNZiiH     ",
+"        160ooooooooovmBiFH      ",
+"         nqrraoookrrbiiA        ",
+"          nJisKKKliiiML         ",
+"             nPiiix             ",
+"                                ",
+"                                "
+};
 
+/* Copyright (c) Julian Smart */
 static char *info_xpm[]={
-"32 32 6 1",
-". c None",
-"d c #000000",
-"c c #0000ff",
-"# c #808080",
-"a c #c0c0c0",
-"b c #ffffff",
-"...........########.............",
-"........###abbbbbba###..........",
-"......##abbbbbbbbbbbba##........",
-".....#abbbbbbbbbbbbbbbba#.......",
-"....#bbbbbbbaccccabbbbbbbd......",
-"...#bbbbbbbbccccccbbbbbbbbd.....",
-"..#bbbbbbbbbccccccbbbbbbbbbd....",
-".#abbbbbbbbbaccccabbbbbbbbbad...",
-".#bbbbbbbbbbbbbbbbbbbbbbbbbbd#..",
-"#abbbbbbbbbbbbbbbbbbbbbbbbbbad#.",
-"#bbbbbbbbbbcccccccbbbbbbbbbbbd#.",
-"#bbbbbbbbbbbbcccccbbbbbbbbbbbd##",
-"#bbbbbbbbbbbbcccccbbbbbbbbbbbd##",
-"#bbbbbbbbbbbbcccccbbbbbbbbbbbd##",
-"#bbbbbbbbbbbbcccccbbbbbbbbbbbd##",
-"#abbbbbbbbbbbcccccbbbbbbbbbbad##",
-".#bbbbbbbbbbbcccccbbbbbbbbbbd###",
-".#abbbbbbbbbbcccccbbbbbbbbbad###",
-"..#bbbbbbbbcccccccccbbbbbbbd###.",
-"...dbbbbbbbbbbbbbbbbbbbbbbd####.",
-"....dbbbbbbbbbbbbbbbbbbbbd####..",
-".....dabbbbbbbbbbbbbbbbad####...",
-"......ddabbbbbbbbbbbbadd####....",
-".......#dddabbbbbbaddd#####.....",
-"........###dddabbbd#######......",
-"..........####dbbbd#####........",
-".............#dbbbd##...........",
-"...............dbbd##...........",
-"................dbd##...........",
-".................dd##...........",
-"..................###...........",
-"...................##..........."};
+/* columns rows colors chars-per-pixel */
+"32 32 17 1",
+"* c #A1A3FB",
+"X c #FFFFFF",
+"O c #191EF4",
+"= c #777AF9",
+": c #4D51F7",
+"  c None",
+"- c #2328F5",
+"+ c #4247F6",
+"; c #C1C2FC",
+". c #C0C0C0",
+"& c #E0E1FE",
+"% c #242424",
+"> c #2D32F5",
+"o c #CBCCFD",
+"# c #0309F3",
+"@ c #8C8FFA",
+"$ c #EAEBFE",
+/* pixels */
+"          .......               ",
+"       ...XXXXXXX...            ",
+"     ..XXXXXXXXXXXXX..          ",
+"    .XXXXXXXXXXXXXXXXX.         ",
+"   .XXXXXXXXoO+XXXXXXXX.        ",
+"  .XXXXXXXXX@#OXXXXXXXXX.       ",
+" .XXXXXXXXXX$@oXXXXXXXXXX.      ",
+" .XXXXXXXXXXXXXXXXXXXXXXX.%     ",
+" .XXXXXXXXX&*=-XXXXXXXXXX.%%    ",
+".XXXXXXXXXX;:#>XXXXXXXXXXX.%    ",
+".XXXXXXXXXXX;#+XXXXXXXXXXX.%    ",
+".XXXXXXXXXXX;#+XXXXXXXXXXX.%%   ",
+" .XXXXXXXXXX;#+XXXXXXXXXX.%%%   ",
+" .XXXXXXXXXX;#+XXXXXXXXXX.%%%   ",
+" .XXXXXXXXXX;#+XXXXXXXXXX.%%    ",
+"  .XXXXXXXX*-##+XXXXXXXX.%%%    ",
+"   .XXXXXXXXXXXXXXXXXXX.%%%%    ",
+"    .XXXXXXXXXXXXXXXXX.%%%%     ",
+"     ..XXXXXXXXXXXXX..%%%%      ",
+"      %...XXXXXXXX..%%%%%       ",
+"       %%%..XXXXXX.%%%%%        ",
+"         %%%.XXXXX.%%%          ",
+"            %.XXXX.%%           ",
+"              .XXX.%%           ",
+"               .XX.%%           ",
+"                .X.%%           ",
+"                 ..%%           ",
+"                  .%%           ",
+"                   %%           ",
+"                    %           ",
+"                                ",
+"                                "
+};
 
+/* Copyright (c) Julian Smart */
 static char *question_xpm[]={
-"32 32 6 1",
-". c None",
-"c c #000000",
-"d c #0000ff",
-"# c #808080",
-"a c #c0c0c0",
-"b c #ffffff",
-"...........########.............",
-"........###abbbbbba###..........",
-"......##abbbbbbbbbbbba##........",
-".....#abbbbbbbbbbbbbbbba#.......",
-"....#bbbbbbbbbbbbbbbbbbbbc......",
-"...#bbbbbbbaddddddabbbbbbbc.....",
-"..#bbbbbbbadabbddddabbbbbbbc....",
-".#abbbbbbbddbbbbddddbbbbbbbac...",
-".#bbbbbbbbddddbbddddbbbbbbbbc#..",
-"#abbbbbbbbddddbaddddbbbbbbbbac#.",
-"#bbbbbbbbbaddabddddbbbbbbbbbbc#.",
-"#bbbbbbbbbbbbbadddbbbbbbbbbbbc##",
-"#bbbbbbbbbbbbbdddbbbbbbbbbbbbc##",
-"#bbbbbbbbbbbbbddabbbbbbbbbbbbc##",
-"#bbbbbbbbbbbbbddbbbbbbbbbbbbbc##",
-"#abbbbbbbbbbbbbbbbbbbbbbbbbbac##",
-".#bbbbbbbbbbbaddabbbbbbbbbbbc###",
-".#abbbbbbbbbbddddbbbbbbbbbbac###",
-"..#bbbbbbbbbbddddbbbbbbbbbbc###.",
-"...cbbbbbbbbbaddabbbbbbbbbc####.",
-"....cbbbbbbbbbbbbbbbbbbbbc####..",
-".....cabbbbbbbbbbbbbbbbac####...",
-"......ccabbbbbbbbbbbbacc####....",
-".......#cccabbbbbbaccc#####.....",
-"........###cccabbbc#######......",
-"..........####cbbbc#####........",
-".............#cbbbc##...........",
-"...............cbbc##...........",
-"................cbc##...........",
-".................cc##...........",
-"..................###...........",
-"...................##..........."};
+/* columns rows colors chars-per-pixel */
+"32 32 16 1",
+"O c #A3A3FF",
+"X c #FFFFFF",
+"% c #CACAFF",
+"- c #4141FF",
+"= c #6060FF",
+"* c #2B2BFF",
+"@ c #B5B5FF",
+"  c None",
+"# c #1616FF",
+"+ c #8181FF",
+"$ c #0000FF",
+". c #C0C0C0",
+"; c #5555FF",
+": c #242424",
+"o c #E7E7FF",
+"& c #7575FF",
+/* pixels */
+"          .......               ",
+"       ...XXXXXXX...            ",
+"     ..XXXXXXXXXXXXX..          ",
+"    .XXXXXXoO++@XXXXXX.         ",
+"   .XXXXXXO#$$$$#%XXXXX.        ",
+"  .XXXXXX@$$#&&#$#oXXXXX.       ",
+" .XXXXXXX*$$%XX%$$=XXXXXX.      ",
+" .XXXXXXX+-;XXXX$$-XXXXXX.:     ",
+" .XXXXXXXXXXXXX+$$&XXXXXX.::    ",
+".XXXXXXXXXXXXo;$$*oXXXXXXX.:    ",
+".XXXXXXXXXXXo*$$*oXXXXXXXX.:    ",
+".XXXXXXXXXXX+$$*oXXXXXXXXX.::   ",
+" .XXXXXXXXXX-$$oXXXXXXXXX.:::   ",
+" .XXXXXXXXXXX--XXXXXXXXXX.:::   ",
+" .XXXXXXXXXXXXXXXXXXXXXXX.::    ",
+"  .XXXXXXXXX-$$XXXXXXXXX.:::    ",
+"   .XXXXXXXX-$$XXXXXXXX.::::    ",
+"    .XXXXXXXO++XXXXXXX.::::     ",
+"     ..XXXXXXXXXXXXX..::::      ",
+"      :...XXXXXXXX..:::::       ",
+"       :::..XXXXXX.:::::        ",
+"         :::.XXXXX.:::          ",
+"            :.XXXX.::           ",
+"              .XXX.::           ",
+"               .XX.::           ",
+"                .X.::           ",
+"                 ..::           ",
+"                  .::           ",
+"                   ::           ",
+"                    :           ",
+"                                ",
+"                                "
+};
 
+/* Copyright (c) Julian Smart */
 static char *warning_xpm[]={
-"32 32 6 1",
-". c None",
-"c c #000000",
-"# c #808000",
-"d c #808080",
-"b c #c0c0c0",
-"a c #ffff00",
-".............###................",
-"............#aabc...............",
-"...........#aaaabcd.............",
-"...........#aaaaacdd............",
-"..........#aaaaaabcdd...........",
-"..........#aaaaaaacdd...........",
-".........#aaaaaaaabcdd..........",
-".........#aaaaaaaaacdd..........",
-"........#aaaaaaaaaabcdd.........",
-"........#aaabcccbaaacdd.........",
-".......#aaaacccccaaabcdd........",
-".......#aaaacccccaaaacdd........",
-"......#aaaaacccccaaaabcdd.......",
-"......#aaaaacccccaaaaacdd.......",
-".....#aaaaaacccccaaaaabcdd......",
-".....#aaaaaa#ccc#aaaaaacdd......",
-"....#aaaaaaabcccbaaaaaabcdd.....",
-"....#aaaaaaaacccaaaaaaaacdd.....",
-"...#aaaaaaaaa#c#aaaaaaaabcdd....",
-"...#aaaaaaaaabcbaaaaaaaaacdd....",
-"..#aaaaaaaaaaacaaaaaaaaaabcdd...",
-"..#aaaaaaaaaaaaaaaaaaaaaaacdd...",
-".#aaaaaaaaaaabccbaaaaaaaaabcdd..",
-".#aaaaaaaaaaaccccaaaaaaaaaacdd..",
-"#aaaaaaaaaaaaccccaaaaaaaaaabcdd.",
-"#aaaaaaaaaaaabccbaaaaaaaaaaacdd.",
-"#aaaaaaaaaaaaaaaaaaaaaaaaaaacddd",
-"#aaaaaaaaaaaaaaaaaaaaaaaaaabcddd",
-".#aaaaaaaaaaaaaaaaaaaaaaaabcdddd",
-"..#ccccccccccccccccccccccccddddd",
-"....ddddddddddddddddddddddddddd.",
-".....ddddddddddddddddddddddddd.."};
+/* columns rows colors chars-per-pixel */
+"32 32 9 1",
+"@ c Black",
+"o c #A6A800",
+"+ c #8A8C00",
+"$ c #B8BA00",
+"  c None",
+"O c #6E7000",
+"X c #DCDF00",
+". c #C00000",
+"# c #373800",
+/* pixels */
+"                                ",
+"                                ",
+"                                ",
+"                .               ",
+"               ...              ",
+"               ...              ",
+"              .....             ",
+"             ...X..             ",
+"             ..XXX..            ",
+"            ...XXX...           ",
+"            ..XXXXX..           ",
+"           ..XXXXXX...          ",
+"          ...XXoO+XX..          ",
+"          ..XXXO@#XXX..         ",
+"         ..XXXXO@#XXX...        ",
+"        ...XXXXO@#XXXX..        ",
+"        ..XXXXXO@#XXXX...       ",
+"       ...XXXXXo@OXXXXX..       ",
+"      ...XXXXXXo@OXXXXXX..      ",
+"      ..XXXXXXX$@OXXXXXX...     ",
+"     ...XXXXXXXX@XXXXXXXX..     ",
+"    ...XXXXXXXXXXXXXXXXXX...    ",
+"    ..XXXXXXXXXXOXXXXXXXXX..    ",
+"   ...XXXXXXXXXO@#XXXXXXXXX..   ",
+"   ..XXXXXXXXXXX#XXXXXXXXXX...  ",
+"  ...XXXXXXXXXXXXXXXXXXXXXXX..  ",
+" ...XXXXXXXXXXXXXXXXXXXXXXXX... ",
+" .............................. ",
+" .............................. ",
+"                                ",
+"                                ",
+"                                "
+};
+
 
 wxBitmap wxWin32ArtProvider::CreateBitmap(const wxArtID& id,
                                           const wxArtClient& WXUNUSED(client),
@@ -4153,6 +4358,8 @@ wxBitmap wxWin32ArtProvider::CreateBitmap(const wxArtID& id,
 }
 
 
+#if wxUSE_TEXTCTRL
+
 // ----------------------------------------------------------------------------
 // text control geometry
 // ----------------------------------------------------------------------------
@@ -4197,6 +4404,8 @@ wxWin32Renderer::GetTextClientArea(const wxTextCtrl * WXUNUSED(text),
     return rectText;
 }
 
+#endif // wxUSE_TEXTCTRL
+
 // ----------------------------------------------------------------------------
 // size adjustments
 // ----------------------------------------------------------------------------
@@ -4224,8 +4433,15 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window)
         // do nothing
     } else
 #endif // wxUSE_BMPBUTTON
-#if wxUSE_BUTTON
-    if ( wxDynamicCast(window, wxButton) )
+#if wxUSE_BUTTON || wxUSE_TOGGLEBTN
+    if ( 0
+#  if wxUSE_BUTTON
+         || wxDynamicCast(window, wxButton)
+#  endif // wxUSE_BUTTON
+#  if wxUSE_TOGGLEBTN
+         || wxDynamicCast(window, wxToggleButton)
+#  endif // wxUSE_TOGGLEBTN
+        )
     {
         if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
         {
@@ -4254,7 +4470,7 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window)
         // no border width adjustments for buttons
         return;
     }
-#endif // wxUSE_BUTTON
+#endif // wxUSE_BUTTON || wxUSE_TOGGLEBTN
 
     // take into account the border width
     wxRect rectBorder = GetBorderDimensions(window->GetBorder());
@@ -4302,6 +4518,8 @@ bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
     return false;
 }
 
+#if wxUSE_SCROLLBAR
+
 // ----------------------------------------------------------------------------
 // wxWin32ScrollBarInputHandler
 // ----------------------------------------------------------------------------
@@ -4484,6 +4702,10 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
     return wxStdScrollBarInputHandler::HandleMouseMove(control, event);
 }
 
+#endif // wxUSE_SCROLLBAR
+
+#if wxUSE_CHECKBOX
+
 // ----------------------------------------------------------------------------
 // wxWin32CheckboxInputHandler
 // ----------------------------------------------------------------------------
@@ -4525,6 +4747,10 @@ bool wxWin32CheckboxInputHandler::HandleKey(wxInputConsumer *control,
     return false;
 }
 
+#endif // wxUSE_CHECKBOX
+
+#if wxUSE_TEXTCTRL
+
 // ----------------------------------------------------------------------------
 // wxWin32TextCtrlInputHandler
 // ----------------------------------------------------------------------------
@@ -4563,6 +4789,10 @@ bool wxWin32TextCtrlInputHandler::HandleKey(wxInputConsumer *control,
     return wxStdTextCtrlInputHandler::HandleKey(control, event, pressed);
 }
 
+#endif // wxUSE_TEXTCTRL
+
+#if wxUSE_STATUSBAR
+
 // ----------------------------------------------------------------------------
 // wxWin32StatusBarInputHandler
 // ----------------------------------------------------------------------------
@@ -4656,6 +4886,8 @@ bool wxWin32StatusBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
     return wxStdInputHandler::HandleMouseMove(consumer, event);
 }
 
+#endif // wxUSE_STATUSBAR
+
 // ----------------------------------------------------------------------------
 // wxWin32FrameInputHandler
 // ----------------------------------------------------------------------------
@@ -4739,7 +4971,9 @@ void wxWin32SystemMenuEvtHandler::OnSystemMenu(wxCommandEvent &WXUNUSED(event))
     m_wnd->SetAcceleratorTable(wxNullAcceleratorTable);
 #endif
 
+#if wxUSE_MENUS
     m_inputHnd->PopupSystemMenu(m_wnd, pt);
+#endif // wxUSE_MENUS
 
 #if wxUSE_ACCEL
     m_wnd->SetAcceleratorTable(table);
@@ -4798,7 +5032,9 @@ bool wxWin32FrameInputHandler::HandleMouse(wxInputConsumer *consumer,
                       (hit == wxHT_TOPLEVEL_TITLEBAR ||
                        hit == wxHT_TOPLEVEL_ICON)) )
             {
+#if wxUSE_MENUS
                 PopupSystemMenu(tlw, event.GetPosition());
+#endif // wxUSE_MENUS
                 return true;
             }
         }
@@ -4807,6 +5043,8 @@ bool wxWin32FrameInputHandler::HandleMouse(wxInputConsumer *consumer,
     return wxStdFrameInputHandler::HandleMouse(consumer, event);
 }
 
+#if wxUSE_MENUS
+
 void wxWin32FrameInputHandler::PopupSystemMenu(wxTopLevelWindow *window,
                                                const wxPoint& pos) const
 {
@@ -4841,6 +5079,8 @@ void wxWin32FrameInputHandler::PopupSystemMenu(wxTopLevelWindow *window,
     delete menu;
 }
 
+#endif // wxUSE_MENUS
+
 bool wxWin32FrameInputHandler::HandleActivation(wxInputConsumer *consumer,
                                                 bool activated)
 {