X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/147b8a4ab5ef1546015c9f1c40cf701d1ac4376a..44d0f703f9cba47009e33cd248f78bef941ba99b:/src/univ/themes/mono.cpp diff --git a/src/univ/themes/mono.cpp b/src/univ/themes/mono.cpp index 057a39ecf8..93cf4b94f8 100644 --- a/src/univ/themes/mono.cpp +++ b/src/univ/themes/mono.cpp @@ -24,13 +24,19 @@ #pragma hdrstop #endif +#include "wx/univ/theme.h" + +#if wxUSE_THEME_MONO + #ifndef WX_PRECOMP + #include "wx/window.h" + #include "wx/dc.h" #endif // WX_PRECOMP -#include "wx/univ/renderer.h" +#include "wx/artprov.h" +#include "wx/univ/stdrend.h" #include "wx/univ/inphand.h" #include "wx/univ/colschem.h" -#include "wx/univ/theme.h" class wxMonoColourScheme; @@ -48,20 +54,6 @@ class wxMonoRenderer : public wxStdRenderer public: wxMonoRenderer(const wxColourScheme *scheme); - virtual void DrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags, - wxWindow *window = NULL); - - virtual void DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL); - virtual void DrawButtonLabel(wxDC& dc, const wxString& label, const wxBitmap& image, @@ -71,17 +63,7 @@ public: int indexAccel = -1, wxRect *rectBounds = NULL); - virtual void DrawBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - - virtual void DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); + virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0); virtual void DrawButtonBorder(wxDC& dc, const wxRect& rect, @@ -94,63 +76,19 @@ public: virtual void DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2); - virtual void DrawFrame(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT, - int indexAccel = -1); - virtual void DrawArrow(wxDC& dc, wxDirection dir, const wxRect& rect, int flags = 0); - - virtual void DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarThumb(wxDC& dc, wxOrientation orient, const wxRect& rect, int flags = 0); - virtual void DrawScrollbarShaft(wxDC& dc, wxOrientation orient, const wxRect& rect, int flags = 0); - virtual void DrawScrollCorner(wxDC& dc, - const wxRect& rect); - - virtual void DrawItem(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0); - - virtual void DrawCheckItem(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0); - - virtual void DrawCheckButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1); - - virtual void DrawRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1); - #if wxUSE_TOOLBAR virtual void DrawToolBarButton(wxDC& dc, const wxString& label, @@ -161,17 +99,6 @@ public: int tbarStyle = 0); #endif // wxUSE_TOOLBAR -#if wxUSE_TEXTCTRL - virtual void DrawTextLine(wxDC& dc, - const wxString& text, - const wxRect& rect, - int selStart = -1, - int selEnd = -1, - int flags = 0); - - virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect); -#endif // wxUSE_TEXTCTRL - #if wxUSE_NOTEBOOK virtual void DrawTab(wxDC& dc, const wxRect& rect, @@ -183,7 +110,6 @@ public: #endif // wxUSE_NOTEBOOK #if wxUSE_SLIDER - virtual void DrawSliderShaft(wxDC& dc, const wxRect& rect, int lenThumb, @@ -230,95 +156,28 @@ public: 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 - - virtual void DrawFrameTitleBar(wxDC& dc, - const wxRect& rect, - const wxString& title, - const wxIcon& icon, - int flags, - int specialButton = 0, - int specialButtonFlags = 0); - - virtual void DrawFrameBorder(wxDC& dc, - const wxRect& rect, - int flags); - - virtual void DrawFrameBackground(wxDC& dc, - const wxRect& rect, - int flags); - - virtual void DrawFrameTitle(wxDC& dc, - const wxRect& rect, - const wxString& title, - int flags); - - virtual void DrawFrameIcon(wxDC& dc, - const wxRect& rect, - const wxIcon& icon, - int flags); - - virtual void DrawFrameButton(wxDC& dc, - wxCoord x, wxCoord y, - int button, - int flags = 0); - - +#if wxUSE_COMBOBOX virtual void GetComboBitmaps(wxBitmap *bmpNormal, wxBitmap *bmpFocus, wxBitmap *bmpPressed, wxBitmap *bmpDisabled); +#endif // wxUSE_COMBOBOX virtual wxRect GetBorderDimensions(wxBorder border) const; - virtual bool AreScrollbarsInsideBorder() const; - - virtual void AdjustSize(wxSize *size, const wxWindow *window); - #if wxUSE_SCROLLBAR - - virtual wxSize GetScrollbarArrowSize() const; - - virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar, - wxScrollBar::Element elem, - int thumbPos = -1) const; - - virtual wxCoord GetScrollbarSize(const wxScrollBar *scrollbar); - - virtual wxHitTest HitTestScrollbar(const wxScrollBar *scrollbar, - const wxPoint& pt) const; - - virtual wxCoord ScrollbarToPixel(const wxScrollBar *scrollbar, - int thumbPos = -1); - virtual int PixelToScrollbar(const wxScrollBar *scrollbar, - wxCoord coord); - + virtual wxSize GetScrollbarArrowSize() const { return GetStdBmpSize(); } #endif // wxUSE_SCROLLBAR - virtual wxCoord GetListboxItemHeight(wxCoord fontHeight); - - virtual wxSize GetCheckBitmapSize() const; - virtual wxSize GetRadioBitmapSize() const; - virtual wxCoord GetCheckItemMargin() const; + virtual wxSize GetCheckBitmapSize() const { return GetStdBmpSize(); } + virtual wxSize GetRadioBitmapSize() const { return GetStdBmpSize(); } +#if wxUSE_TOOLBAR virtual wxSize GetToolBarButtonSize(wxCoord *separator) const; virtual wxSize GetToolBarMargin() const; - -#if wxUSE_TEXTCTRL - virtual wxRect GetTextTotalArea(const wxTextCtrl *text, - const wxRect& rectText) const; - - virtual wxRect GetTextClientArea(const wxTextCtrl *text, - const wxRect& rectTotal, - wxCoord *extraSpaceBeyond) const; -#endif // wxUSE_TEXTCTRL +#endif // wxUSE_TOOLBAR #if wxUSE_NOTEBOOK virtual wxSize GetTabIndent() const; @@ -351,145 +210,244 @@ public: #endif // wxUSE_MENUS #if wxUSE_STATUSBAR - virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const; + virtual wxCoord GetStatusBarBorderBetweenFields() const; + + virtual wxSize GetStatusBarFieldMargins() const; #endif // wxUSE_STATUSBAR - virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const; +protected: + // override base class border drawing routines: we always draw just a + // single simple border + void DrawSimpleBorder(wxDC& dc, wxRect *rect) + { DrawRect(dc, rect, m_penFg); } + + virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect) + { DrawSimpleBorder(dc, rect); } + virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect) + { DrawSimpleBorder(dc, rect); } + virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect) + { DrawSimpleBorder(dc, rect); } + virtual void DrawBoxBorder(wxDC& dc, wxRect *rect) + { DrawSimpleBorder(dc, rect); } + virtual void DrawStaticBorder(wxDC& dc, wxRect *rect) + { DrawSimpleBorder(dc, rect); } + virtual void DrawExtraBorder(wxDC& WXUNUSED(dc), wxRect * WXUNUSED(rect)) + { /* no extra borders for us */ } + + // all our XPMs are of this size + static wxSize GetStdBmpSize() { return wxSize(8, 8); } + + wxBitmap GetIndicator(IndicatorType indType, int flags); + virtual wxBitmap GetCheckBitmap(int flags) + { return GetIndicator(IndicatorType_Check, flags); } + virtual wxBitmap GetRadioBitmap(int flags) + { return GetIndicator(IndicatorType_Radio, flags); } + + virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type); + virtual int GetFrameBorderWidth(int flags) const; - virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const; +private: + // the bitmaps returned by GetIndicator() + wxBitmap m_bmpIndicators[IndicatorType_MaxCtrl] + [IndicatorState_MaxCtrl] + [IndicatorStatus_Max]; - virtual wxSize GetFrameMinSize(int flags) const; + static const char **ms_xpmIndicators[IndicatorType_MaxCtrl] + [IndicatorState_MaxCtrl] + [IndicatorStatus_Max]; - virtual wxSize GetFrameIconSize() const; + // the arrow bitmaps used by DrawArrow() + wxBitmap m_bmpArrows[Arrow_Max]; - virtual int HitTestFrame(const wxRect& rect, - const wxPoint& pt, - int flags = 0) const; + static const char **ms_xpmArrows[Arrow_Max]; -protected: - // draw the background with any colour, not only the default one(s) - void DoDrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - wxWindow *window = NULL); + // the close bitmap for the frame for GetFrameButtonBitmap() + wxBitmap m_bmpFrameClose; - // DrawBorder() helpers: all of them shift and clip the DC after drawing - // the border + // pen used for foreground drawing + wxPen m_penFg; +}; - // just draw a rectangle with the given pen - void DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen); +// ---------------------------------------------------------------------------- +// standard bitmaps +// ---------------------------------------------------------------------------- - // draw an opened rect for the arrow in given direction - void DrawArrowBorder(wxDC& dc, - wxRect *rect, - wxDirection dir); +static const char *xpmUnchecked[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +"XXXXXXXX", +"X X", +"X X", +"X X", +"X X", +"X X", +"X X", +"XXXXXXXX", +}; - // draw two sides of the rectangle - void DrawThumbBorder(wxDC& dc, - wxRect *rect, - wxOrientation orient); +static const char *xpmChecked[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +"XXXXXXXX", +"X X", +"X X X X", +"X XX X", +"X XX X", +"X X X X", +"X X", +"XXXXXXXX", +}; -#if wxUSE_SCROLLBAR - // returns the size of the arrow for the scrollbar (depends on - // orientation) - wxSize GetScrollbarArrowSize(const wxScrollBar *scrollbar) const - { - wxSize size; - if ( scrollbar->IsVertical() ) - { - size = m_sizeScrollbarArrow; - } - else - { - size.x = m_sizeScrollbarArrow.y; - size.y = m_sizeScrollbarArrow.x; - } +static const char *xpmUndeterminate[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +"XXXXXXXX", +"X X X XX", +"XX X X X", +"X X X XX", +"XX X X X", +"X X X XX", +"XX X X X", +"XXXXXXXX", +}; - return size; - } -#endif // wxUSE_SCROLLBAR +static const char *xpmRadioUnchecked[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +"XXXXXXXX", +"X X", +"X XX X", +"X X X X", +"X X X X", +"X XX X", +"X X", +"XXXXXXXX", +}; - // DrawCheckBitmap and DrawRadioBitmap helpers - - // draw the check bitmaps once and cache them for later use - wxBitmap GetCheckBitmap(int flags); - - // draw a /\ or \/ line from (x1, y1) to (x2, y1) passing by the point - // ((x1 + x2)/2, y2) - void DrawUpZag(wxDC& dc, - wxCoord x1, wxCoord x2, - wxCoord y1, wxCoord y2); - void DrawDownZag(wxDC& dc, - wxCoord x1, wxCoord x2, - wxCoord y1, wxCoord y2); - - // draw the radio button bitmap for the given state - void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags); - - // draw check/radio - the bitmap must be a valid one by now - void DoDrawCheckOrRadioBitmap(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rectTotal, - int flags, - wxAlignment align, - int indexAccel); - - // common part of DrawMenuItem() and DrawMenuBarItem() - void DoDrawMenuItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags, - int indexAccel, - const wxString& accel = wxEmptyString, - const wxBitmap& bitmap = wxNullBitmap, - const wxMonoMenuGeometryInfo *geometryInfo = NULL); +static const char *xpmRadioChecked[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +"XXXXXXXX", +"X X", +"X XX X", +"X XXXX X", +"X XXXX X", +"X XX X", +"X X", +"XXXXXXXX", +}; -#if wxUSE_COMBOBOX - // initialize the combo bitmaps - void InitComboBitmaps(); -#endif // wxUSE_COMBOBOX +const char **wxMonoRenderer::ms_xpmIndicators[IndicatorType_MaxCtrl] + [IndicatorState_MaxCtrl] + [IndicatorStatus_Max] = +{ + // checkboxes first + { + // normal state + { xpmChecked, xpmUnchecked, xpmUndeterminate }, -private: - // data - wxSize m_sizeScrollbarArrow; + // pressed state + { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, - // the checkbox bitmaps: first row is for the normal, second for the - // pressed state and the columns are for checked, unchecked and - // undeterminated respectively - wxBitmap m_bitmapsCheckbox[2][3]; + // disabled state + { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, + }, - // the combobox bitmaps - enum + // radio { - ComboState_Normal, - ComboState_Focus, - ComboState_Pressed, - ComboState_Disabled, - ComboState_Max - }; - - wxBitmap m_bitmapsCombo[ComboState_Max]; + // normal state + { xpmRadioChecked, xpmRadioUnchecked, xpmUndeterminate }, + + // pressed state + { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, + + // disabled state + { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, + }, }; -// ---------------------------------------------------------------------------- -// wxMonoInputHandler -// ---------------------------------------------------------------------------- +static const char *xpmLeftArrow[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +" X ", +" XX ", +" XXX ", +"XXXX ", +"XXXX ", +" XXX ", +" XX ", +" X ", +}; -class wxMonoInputHandler : public wxInputHandler -{ -public: - wxMonoInputHandler(wxMonoRenderer *renderer); +static const char *xpmRightArrow[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +" X ", +" XX ", +" XXX ", +" XXXX", +" XXXX", +" XXX ", +" XX ", +" X ", +}; + +static const char *xpmUpArrow[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +" ", +" XX ", +" XXXX ", +" XXXXXX ", +"XXXXXXXX", +" ", +" ", +" ", +}; - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *control, const wxMouseEvent& event); +static const char *xpmDownArrow[] = { +/* columns rows colors chars-per-pixel */ +"8 8 2 1", +" c white", +"X c black", +/* pixels */ +" ", +" ", +" ", +"XXXXXXXX", +" XXXXXX ", +" XXXX ", +" XX ", +" ", +}; -protected: - wxMonoRenderer *m_renderer; +const char **wxMonoRenderer::ms_xpmArrows[Arrow_Max] = +{ + xpmLeftArrow, xpmRightArrow, xpmUpArrow, xpmDownArrow, }; // ---------------------------------------------------------------------------- @@ -525,8 +483,6 @@ protected: // wxMonoTheme // ---------------------------------------------------------------------------- -WX_DEFINE_ARRAY_PTR(wxInputHandler *, wxArrayHandlers); - class wxMonoTheme : public wxTheme { public: @@ -535,7 +491,8 @@ public: virtual wxRenderer *GetRenderer(); virtual wxArtProvider *GetArtProvider(); - virtual wxInputHandler *GetInputHandler(const wxString& control); + virtual wxInputHandler *GetInputHandler(const wxString& control, + wxInputConsumer *consumer); virtual wxColourScheme *GetColourScheme(); private: @@ -543,7 +500,7 @@ private: wxMonoArtProvider *m_artProvider; wxMonoColourScheme *m_scheme; - WX_DECLARE_THEME(gtk) + WX_DECLARE_THEME(mono) }; // ============================================================================ @@ -567,7 +524,7 @@ wxMonoTheme::~wxMonoTheme() { delete m_renderer; delete m_scheme; - wxArtProvider::RemoveProvider(m_artProvider); + delete m_artProvider; } wxRenderer *wxMonoTheme::GetRenderer() @@ -625,6 +582,8 @@ wxColour wxMonoColourScheme::GetBackground(wxWindow *win) const { col = GetBg(); } + + return col; } wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const @@ -638,10 +597,11 @@ wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const case SCROLLBAR: case SCROLLBAR_PRESSED: case GAUGE: - case HIGHLIGHT: case TITLEBAR: case TITLEBAR_ACTIVE: + case HIGHLIGHT_TEXT: case DESKTOP: + case FRAME: return GetBg(); case MAX: @@ -656,9 +616,9 @@ wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const case CONTROL_TEXT: case CONTROL_TEXT_DISABLED: case CONTROL_TEXT_DISABLED_SHADOW: - case HIGHLIGHT_TEXT: case TITLEBAR_TEXT: case TITLEBAR_ACTIVE_TEXT: + case HIGHLIGHT: return GetFg(); } @@ -675,32 +635,55 @@ wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const wxMonoRenderer::wxMonoRenderer(const wxColourScheme *scheme) : wxStdRenderer(scheme) { - m_penFg = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_OUT)); + m_penFg = wxPen(wxMONO_FG_COL); } // ---------------------------------------------------------------------------- -// border stuff -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// special borders +// borders // ---------------------------------------------------------------------------- -void wxMonoRenderer::DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rectOrig, - int flags, - wxRect *rectIn) +wxRect wxMonoRenderer::GetBorderDimensions(wxBorder border) const { - DrawBorder(dc, border, rectOrig, flags, rectIn); + wxCoord width; + switch ( border ) + { + case wxBORDER_SIMPLE: + case wxBORDER_STATIC: + case wxBORDER_RAISED: + case wxBORDER_SUNKEN: + case wxBORDER_THEME: + width = 1; + break; + /* + case wxBORDER_DOUBLE: + width = 2; + break; + */ + default: + wxFAIL_MSG(_T("unknown border type")); + // fall through + + case wxBORDER_DEFAULT: + case wxBORDER_NONE: + width = 0; + break; + } + + wxRect rect; + rect.x = + rect.y = + rect.width = + rect.height = width; + + return rect; } void wxMonoRenderer::DrawButtonBorder(wxDC& dc, - const wxRect& rectTotal, + const wxRect& rect, int flags, wxRect *rectIn) { - DrawBorder(dc, wxBORDER_SIMPLE, rectOrig, flags, rectIn); + DrawBorder(dc, wxBORDER_SIMPLE, rect, flags, rectIn); } // ---------------------------------------------------------------------------- @@ -721,43 +704,15 @@ wxMonoRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2) dc.DrawLine(x, y1, x, y2 + 1); } -void wxMonoRenderer::DrawFrame(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags, - int alignment, - int indexAccel) +void wxMonoRenderer::DrawFocusRect(wxWindow* WXUNUSED(win), wxDC& dc, const wxRect& rect, int flags) { - wxCoord height = 0; // of the label - wxRect rectFrame = rect; - if ( !label.empty() ) + // no need to draw the focus rect for selected items, it would be invisible + // anyhow + if ( !(flags & wxCONTROL_SELECTED) ) { - // the text should touch the top border of the rect, so the frame - // itself should be lower - dc.GetTextExtent(label, NULL, &height); - rectFrame.y += height / 2; - rectFrame.height -= height / 2; - - // TODO: the +4 should be customizable - - wxRect rectText; - rectText.x = rectFrame.x + 4; - rectText.y = rect.y; - rectText.width = rectFrame.width - 8; - rectText.height = height; - - wxRect rectLabel; - DrawLabel(dc, label, rectText, flags, alignment, indexAccel, &rectLabel); - rectLabel.x -= 1; - rectLabel.width += 2; - - StandardDrawFrame(dc, rectFrame, rectLabel); - } - else // no label - { - // just draw the complete frame - DrawShadedRect(dc, &rectFrame, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, &rectFrame, m_penHighlight, m_penDarkGrey); + dc.SetPen(m_penFg); + dc.SetBrush(*wxTRANSPARENT_BRUSH); + dc.DrawRectangle(rect); } } @@ -765,497 +720,148 @@ void wxMonoRenderer::DrawFrame(wxDC& dc, // label // ---------------------------------------------------------------------------- -void wxMonoRenderer::DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - DrawButtonLabel(dc, label, wxNullBitmap, rect, flags, - alignment, indexAccel, rectBounds); -} - void wxMonoRenderer::DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) + const wxString& label, + const wxBitmap& image, + const wxRect& rect, + int flags, + int alignment, + int indexAccel, + wxRect *rectBounds) { - dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, CONTROL_TEXT)); dc.DrawLabel(label, image, rect, alignment, indexAccel, rectBounds); if ( flags & wxCONTROL_DISABLED ) { // this is ugly but I don't know how to show disabled button visually - // in monochrome theme otherwise + // in monochrome theme otherwise, so cross it out dc.SetPen(m_penFg); dc.DrawLine(rect.GetTopLeft(), rect.GetBottomRight()); dc.DrawLine(rect.GetTopRight(), rect.GetBottomLeft()); } } -void wxMonoRenderer::DrawItem(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags) -{ - wxColour colFg; - if ( flags & wxCONTROL_SELECTED ) - { - dc.SetBrush(wxBrush(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT), wxSOLID)); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); - - colFg = dc.GetTextForeground(); - dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT_TEXT)); - } - - if ( flags & wxCONTROL_FOCUSED ) - { - dc.SetBrush(*wxTRANSPARENT_BRUSH); - wxRect rectFocus = rect; - DrawRect(dc, &rectFocus, m_penBlack); - } - - wxRect rectText = rect; - rectText.x += 2; - rectText.y++; - dc.DrawLabel(label, wxNullBitmap, rectText); - - if ( flags & wxCONTROL_SELECTED ) - { - dc.SetBackgroundMode(wxTRANSPARENT); - } - - // restore the text colour - if ( colFg.Ok() ) - { - dc.SetTextForeground(colFg); - } -} - -void wxMonoRenderer::DrawCheckItem(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags) -{ - wxRect rectBitmap = rect; - rectBitmap.x -= 1; - rectBitmap.width = GetCheckBitmapSize().x; - - // never draw the focus rect around the check indicators here - DrawCheckButton(dc, wxEmptyString, bitmap, rectBitmap, flags & ~wxCONTROL_FOCUSED); - - wxRect rectLabel = rect; - wxCoord shift = rectBitmap.width + 2*GetCheckItemMargin(); - rectLabel.x += shift; - rectLabel.width -= shift; - DrawItem(dc, label, rectLabel, flags); -} - // ---------------------------------------------------------------------------- -// check/radion buttons +// bitmaps // ---------------------------------------------------------------------------- -void wxMonoRenderer::DrawUndeterminedBitmap(wxDC& dc, - const wxRect& rectTotal, - bool isPressed) +wxBitmap wxMonoRenderer::GetIndicator(IndicatorType indType, int flags) { - // FIXME: For sure it is not Mono look but it is better than nothing. - // Show me correct look and I will immediatelly make it better (ABX) - wxRect rect = rectTotal; - - wxColour col1, col2; + IndicatorState indState; + IndicatorStatus indStatus; + GetIndicatorsFromFlags(flags, indState, indStatus); - if ( isPressed ) + wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus]; + if ( !bmp.Ok() ) { - col1 = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK); - col2 = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); - } - else - { - col1 = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK); - col2 = wxSCHEME_COLOUR(m_scheme, SHADOW_IN); - } - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxBrush(col1, wxSOLID)); - dc.DrawRectangle(rect); - rect.Deflate(1); - dc.SetBrush(wxBrush(col2, wxSOLID)); - dc.DrawRectangle(rect); -} - -void wxMonoRenderer::DrawUncheckBitmap(wxDC& dc, - const wxRect& rectTotal, - bool isPressed) -{ - wxRect rect = rectTotal; - DrawAntiRaisedBorder(dc, &rect); - - wxColour col = wxSCHEME_COLOUR(m_scheme, SHADOW_IN); - dc.SetPen(wxPen(col, 0, wxSOLID)); - dc.DrawPoint(rect.GetRight() - 1, rect.GetBottom() - 1); - - if ( isPressed ) - col = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); - //else: it is SHADOW_IN, leave as is - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxBrush(col, wxSOLID)); - dc.DrawRectangle(rect); -} - -void wxMonoRenderer::DrawCheckBitmap(wxDC& dc, const wxRect& rectTotal) -{ - wxRect rect = rectTotal; - DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey); - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), wxSOLID)); - dc.DrawRectangle(rect); -} - -void wxMonoRenderer::DrawRadioBitmap(wxDC& dc, - const wxRect& rect, - int flags) -{ - wxCoord x = rect.x, - y = rect.y, - xRight = rect.GetRight(), - yBottom = rect.GetBottom(); - - wxCoord yMid = (y + yBottom) / 2; - - // this looks ugly when the background colour of the control is not the - // same ours - radiobox is not transparent as it should be -#if 0 - // first fill the middle: as FloodFill() is not implemented on all - // platforms, this is the only thing to do - wxColour colBg = flags & wxCONTROL_CURRENT - ? wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT) - : wxSCHEME_COLOUR(m_scheme, SHADOW_IN); - dc.SetBrush(wxBrush(colBg, wxSOLID)); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); -#endif // 0 - - // then draw the upper half - dc.SetPen(flags & wxCONTROL_CHECKED ? m_penDarkGrey : m_penHighlight); - DrawUpZag(dc, x, xRight, yMid, y); - DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1); - - bool drawIt = true; - if ( flags & wxCONTROL_CHECKED ) - dc.SetPen(m_penBlack); - else if ( flags & wxCONTROL_PRESSED ) - dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID)); - else // unchecked and unpressed - drawIt = false; - - if ( drawIt ) - DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2); - - // and then the lower one - dc.SetPen(flags & wxCONTROL_CHECKED ? m_penHighlight : m_penBlack); - DrawDownZag(dc, x, xRight, yMid, yBottom); - if ( !(flags & wxCONTROL_CHECKED) ) - dc.SetPen(m_penDarkGrey); - DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1); - - if ( !(flags & wxCONTROL_CHECKED) ) - drawIt = true; // with the same pen - else if ( flags & wxCONTROL_PRESSED ) - { - dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID)); - drawIt = true; + const char **xpm = ms_xpmIndicators[indType][indState][indStatus]; + if ( xpm ) + { + // create and cache it + bmp = wxBitmap(xpm); + } } - else // checked and unpressed - drawIt = false; - - if ( drawIt ) - DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2); -} - -void wxMonoRenderer::DrawUpZag(wxDC& dc, - wxCoord x1, - wxCoord x2, - wxCoord y1, - wxCoord y2) -{ - wxCoord xMid = (x1 + x2) / 2; - dc.DrawLine(x1, y1, xMid, y2); - dc.DrawLine(xMid, y2, x2 + 1, y1 + 1); -} -void wxMonoRenderer::DrawDownZag(wxDC& dc, - wxCoord x1, - wxCoord x2, - wxCoord y1, - wxCoord y2) -{ - wxCoord xMid = (x1 + x2) / 2; - dc.DrawLine(x1 + 1, y1 + 1, xMid, y2); - dc.DrawLine(xMid, y2, x2, y1); + return bmp; } -wxBitmap wxMonoRenderer::GetCheckBitmap(int flags) +wxBitmap wxMonoRenderer::GetFrameButtonBitmap(FrameButtonType type) { - if ( !m_bitmapsCheckbox[0][0].Ok() ) + if ( type == FrameButton_Close ) { - // init the bitmaps once only - wxRect rect; - wxSize size = GetCheckBitmapSize(); - rect.width = size.x; - rect.height = size.y; - for ( int i = 0; i < 2; i++ ) + if ( !m_bmpFrameClose.Ok() ) { - for ( int j = 0; j < 3; j++ ) - m_bitmapsCheckbox[i][j].Create(rect.width, rect.height); + static const char *xpmFrameClose[] = { + /* columns rows colors chars-per-pixel */ + "8 8 2 1", + " c white", + "X c black", + /* pixels */ + " ", + " XX XX ", + " X X ", + " XX ", + " XX ", + " X X ", + " XX XX ", + " ", + }; + + m_bmpFrameClose = wxBitmap(xpmFrameClose); } - wxMemoryDC dc; - - // normal checked - dc.SelectObject(m_bitmapsCheckbox[0][0]); - DrawCheckBitmap(dc, rect); - - // normal unchecked - dc.SelectObject(m_bitmapsCheckbox[0][1]); - DrawUncheckBitmap(dc, rect, false); - - // normal undeterminated - dc.SelectObject(m_bitmapsCheckbox[0][2]); - DrawUndeterminedBitmap(dc, rect, false); - - // pressed checked - m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0]; - - // pressed unchecked - dc.SelectObject(m_bitmapsCheckbox[1][1]); - DrawUncheckBitmap(dc, rect, true); - - // pressed undeterminated - dc.SelectObject(m_bitmapsCheckbox[1][2]); - DrawUndeterminedBitmap(dc, rect, true); + return m_bmpFrameClose; } - int row = flags & wxCONTROL_PRESSED - ? 1 - : 0; - int col = flags & wxCONTROL_CHECKED - ? 0 - : ( flags & wxCONTROL_UNDETERMINED - ? 2 - : 1 ); - - return m_bitmapsCheckbox[row][col]; + // we don't show any other buttons than close + return wxNullBitmap; } -void wxMonoRenderer::DrawCheckButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmapOrig, - const wxRect& rectTotal, - int flags, - wxAlignment align, - int indexAccel) -{ - wxBitmap bitmap; - if ( bitmapOrig.Ok() ) - { - bitmap = bitmapOrig; - } - else - { - bitmap = GetCheckBitmap(flags); - } +// ---------------------------------------------------------------------------- +// toolbar +// ---------------------------------------------------------------------------- - DoDrawCheckOrRadioBitmap(dc, label, bitmap, rectTotal, - flags, align, indexAccel); -} +#if wxUSE_TOOLBAR -void wxMonoRenderer::DoDrawCheckOrRadioBitmap(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rectTotal, - int flags, - wxAlignment align, - int indexAccel) +void wxMonoRenderer::DrawToolBarButton(wxDC& WXUNUSED(dc), + const wxString& WXUNUSED(label), + const wxBitmap& WXUNUSED(bitmap), + const wxRect& WXUNUSED(rect), + int WXUNUSED(flags), + long WXUNUSED(style), + int WXUNUSED(tbarStyle)) { - wxRect rect = rectTotal; - - if ( flags & wxCONTROL_FOCUSED ) - { - // draw the focus border around everything - DrawRect(dc, &rect, m_penBlack); - } - else - { - // the border does not offset the string under Mono - rect.Inflate(-1); - } - - // calculate the position of the bitmap and of the label - wxCoord xBmp, - yBmp = rect.y + (rect.height - bitmap.GetHeight()) / 2; - - wxRect rectLabel; - dc.GetMultiLineTextExtent(label, NULL, &rectLabel.height); - rectLabel.y = rect.y + (rect.height - rectLabel.height) / 2; - - if ( align == wxALIGN_RIGHT ) - { - xBmp = rect.GetRight() - bitmap.GetWidth(); - rectLabel.x = rect.x + 2; - rectLabel.SetRight(xBmp); - } - else // normal (checkbox to the left of the text) case - { - xBmp = rect.x + 2; - rectLabel.x = xBmp + bitmap.GetWidth() + 4; - rectLabel.SetRight(rect.GetRight()); - } - - dc.DrawBitmap(bitmap, xBmp, yBmp, true /* use mask */); - - DrawLabel(dc, label, rectLabel, flags, - wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, indexAccel); + wxFAIL_MSG(_T("TODO")); } -void wxMonoRenderer::DrawRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmapOrig, - const wxRect& rectTotal, - int flags, - wxAlignment align, - int indexAccel) +wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *WXUNUSED(separator)) const { - wxBitmap bitmap; - if ( bitmapOrig.Ok() ) - { - bitmap = bitmapOrig; - } - else - { - wxRect rect; - wxSize size = GetRadioBitmapSize(); - rect.width = size.x; - rect.height = size.y; - bitmap.Create(rect.width, rect.height); - wxMemoryDC dc; - dc.SelectObject(bitmap); - dc.SetBackground(*wxLIGHT_GREY_BRUSH); - dc.Clear(); - DrawRadioBitmap(dc, rect, flags); - - // must unselect the bitmap before setting a mask for it because of the - // MSW limitations - dc.SelectObject(wxNullBitmap); - bitmap.SetMask(new wxMask(bitmap, *wxLIGHT_GREY)); - } + wxFAIL_MSG(_T("TODO")); - DoDrawCheckOrRadioBitmap(dc, label, bitmap, rectTotal, - flags, align, indexAccel); + return wxSize(); } -#if wxUSE_TOOLBAR -void wxMonoRenderer::DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rectOrig, - int flags, - long WXUNUSED(style), - int tbarStyle) +wxSize wxMonoRenderer::GetToolBarMargin() const { - // we don't draw the separators at all - if ( !label.empty() || bitmap.Ok() ) - { - wxRect rect = rectOrig; - rect.Deflate(BORDER_THICKNESS); - - if ( flags & wxCONTROL_PRESSED ) - { - DrawBorder(dc, wxBORDER_SUNKEN, rect, flags, &rect); - - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), rect); - } - else if ( flags & wxCONTROL_CURRENT ) - { - DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rect); + wxFAIL_MSG(_T("TODO")); - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT), rect); - } - - 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); - } - } + return wxSize(); } + #endif // wxUSE_TOOLBAR // ---------------------------------------------------------------------------- -// text control +// notebook // ---------------------------------------------------------------------------- -#if wxUSE_TEXTCTRL +#if wxUSE_NOTEBOOK -wxRect wxMonoRenderer::GetTextTotalArea(const wxTextCtrl * WXUNUSED(text), - const wxRect& rect) const +void wxMonoRenderer::DrawTab(wxDC& WXUNUSED(dc), + const wxRect& WXUNUSED(rect), + wxDirection WXUNUSED(dir), + const wxString& WXUNUSED(label), + const wxBitmap& WXUNUSED(bitmap), + int WXUNUSED(flags), + int WXUNUSED(indexAccel)) { - wxRect rectTotal = rect; - rectTotal.Inflate(2*BORDER_THICKNESS); - return rectTotal; + wxFAIL_MSG(_T("TODO")); } -wxRect wxMonoRenderer::GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const +wxSize wxMonoRenderer::GetTabIndent() const { - wxRect rectText = rect; - rectText.Deflate(2*BORDER_THICKNESS); + wxFAIL_MSG(_T("TODO")); - return rectText; + return wxSize(); } -void wxMonoRenderer::DrawTextLine(wxDC& dc, - const wxString& text, - const wxRect& rect, - int selStart, - int selEnd, - int flags) +wxSize wxMonoRenderer::GetTabPadding() const { - StandardDrawTextLine(dc, text, rect, selStart, selEnd, flags); -} + wxFAIL_MSG(_T("TODO")); -void -wxMonoRenderer::DrawLineWrapMark(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect)) -{ - // no line wrapping indicators + return wxSize(); } -#endif // wxUSE_TEXTCTRL +#endif // wxUSE_NOTEBOOK // ---------------------------------------------------------------------------- // combobox @@ -1263,891 +869,237 @@ wxMonoRenderer::DrawLineWrapMark(wxDC& WXUNUSED(dc), #if wxUSE_COMBOBOX -void wxMonoRenderer::InitComboBitmaps() -{ - wxSize sizeArrow = m_sizeScrollbarArrow; - sizeArrow.x -= 2; - sizeArrow.y -= 2; - - size_t n; - - for ( n = ComboState_Normal; n < ComboState_Max; n++ ) - { - m_bitmapsCombo[n].Create(sizeArrow.x, sizeArrow.y); - } - - static const int comboButtonFlags[ComboState_Max] = - { - 0, - wxCONTROL_CURRENT, - wxCONTROL_PRESSED, - wxCONTROL_DISABLED, - }; - - wxRect rect(sizeArrow); - - wxMemoryDC dc; - for ( n = ComboState_Normal; n < ComboState_Max; n++ ) - { - int flags = comboButtonFlags[n]; - - dc.SelectObject(m_bitmapsCombo[n]); - DoDrawBackground(dc, GetBackgroundColour(flags), rect); - DrawArrow(dc, wxDOWN, rect, flags); - } -} - -void wxMonoRenderer::GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled) +void wxMonoRenderer::GetComboBitmaps(wxBitmap *WXUNUSED(bmpNormal), + wxBitmap *WXUNUSED(bmpFocus), + wxBitmap *WXUNUSED(bmpPressed), + wxBitmap *WXUNUSED(bmpDisabled)) { - if ( !m_bitmapsCombo[ComboState_Normal].Ok() ) - { - InitComboBitmaps(); - } - - if ( bmpNormal ) - *bmpNormal = m_bitmapsCombo[ComboState_Normal]; - if ( bmpFocus ) - *bmpFocus = m_bitmapsCombo[ComboState_Focus]; - if ( bmpPressed ) - *bmpPressed = m_bitmapsCombo[ComboState_Pressed]; - if ( bmpDisabled ) - *bmpDisabled = m_bitmapsCombo[ComboState_Disabled]; + wxFAIL_MSG(_T("TODO")); } #endif // wxUSE_COMBOBOX // ---------------------------------------------------------------------------- -// background +// menus // ---------------------------------------------------------------------------- -void wxMonoRenderer::DoDrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - wxWindow * WXUNUSED(window)) +#if wxUSE_MENUS + +void wxMonoRenderer::DrawMenuBarItem(wxDC& WXUNUSED(dc), + const wxRect& WXUNUSED(rect), + const wxString& WXUNUSED(label), + int WXUNUSED(flags), + int WXUNUSED(indexAccel)) { - wxBrush brush(col, wxSOLID); - dc.SetBrush(brush); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); + wxFAIL_MSG(_T("TODO")); } -void wxMonoRenderer::DrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int WXUNUSED(flags), - wxWindow *window) +void wxMonoRenderer::DrawMenuItem(wxDC& WXUNUSED(dc), + wxCoord WXUNUSED(y), + const wxMenuGeometryInfo& WXUNUSED(geometryInfo), + const wxString& WXUNUSED(label), + const wxString& WXUNUSED(accel), + const wxBitmap& WXUNUSED(bitmap), + int WXUNUSED(flags), + int WXUNUSED(indexAccel)) { + wxFAIL_MSG(_T("TODO")); } -// ---------------------------------------------------------------------------- -// scrollbar -// ---------------------------------------------------------------------------- - -void wxMonoRenderer::DrawArrowBorder(wxDC& dc, - wxRect *rect, - wxDirection dir) +void wxMonoRenderer::DrawMenuSeparator(wxDC& WXUNUSED(dc), + wxCoord WXUNUSED(y), + const wxMenuGeometryInfo& WXUNUSED(geomInfo)) { - static const wxDirection sides[] = - { - wxUP, wxLEFT, wxRIGHT, wxDOWN - }; - - wxRect rect1, rect2, rectInner; - rect1 = - rect2 = - rectInner = *rect; - - rect2.Inflate(-1); - rectInner.Inflate(-2); - - DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), *rect); - - // find the side not to draw and also adjust the rectangles to compensate - // for it - wxDirection sideToOmit; - switch ( dir ) - { - case wxUP: - sideToOmit = wxDOWN; - rect2.height += 1; - rectInner.height += 1; - break; - - case wxDOWN: - sideToOmit = wxUP; - rect2.y -= 1; - rect2.height += 1; - rectInner.y -= 2; - rectInner.height += 1; - break; - - case wxLEFT: - sideToOmit = wxRIGHT; - rect2.width += 1; - rectInner.width += 1; - break; - - case wxRIGHT: - sideToOmit = wxLEFT; - rect2.x -= 1; - rect2.width += 1; - rectInner.x -= 2; - rectInner.width += 1; - break; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - return; - } - - // the outer rect first - size_t n; - for ( n = 0; n < WXSIZEOF(sides); n++ ) - { - wxDirection side = sides[n]; - if ( side == sideToOmit ) - continue; - - DrawAntiShadedRectSide(dc, rect1, m_penDarkGrey, m_penHighlight, side); - } - - // and then the inner one - for ( n = 0; n < WXSIZEOF(sides); n++ ) - { - wxDirection side = sides[n]; - if ( side == sideToOmit ) - continue; - - DrawAntiShadedRectSide(dc, rect2, m_penBlack, m_penGrey, side); - } - - *rect = rectInner; + wxFAIL_MSG(_T("TODO")); } -void wxMonoRenderer::DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rectArrow, - int flags) +wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& WXUNUSED(sizeText)) const { - // first of all, draw the border around it - but we don't want the border - // on the side opposite to the arrow point - wxRect rect = rectArrow; - DrawArrowBorder(dc, &rect, dir); + wxFAIL_MSG(_T("TODO")); - // then the arrow itself - DrawArrow(dc, dir, rect, flags); + return wxSize(); } -// gtk_default_draw_arrow() takes ~350 lines and we can't do much better here -// these people are just crazy :-( -void wxMonoRenderer::DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags) +wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *WXUNUSED(win), + const wxMenu& WXUNUSED(menu)) const { - enum - { - Point_First, - Point_Second, - Point_Third, - Point_Max - }; - - wxPoint ptArrow[Point_Max]; + wxFAIL_MSG(_T("TODO")); - wxColour colInside = GetBackgroundColour(flags); - wxPen penShadow[4]; - if ( flags & wxCONTROL_DISABLED ) - { - penShadow[0] = m_penDarkGrey; - penShadow[1] = m_penDarkGrey; - penShadow[2] = wxNullPen; - penShadow[3] = wxNullPen; - } - else if ( flags & wxCONTROL_PRESSED ) - { - penShadow[0] = m_penDarkGrey; - penShadow[1] = m_penHighlight; - penShadow[2] = wxNullPen; - penShadow[3] = m_penBlack; - } - else // normal arrow - { - penShadow[0] = m_penHighlight; - penShadow[1] = m_penBlack; - penShadow[2] = m_penDarkGrey; - penShadow[3] = wxNullPen; - } - - wxCoord middle; - if ( dir == wxUP || dir == wxDOWN ) - { - // horz middle - middle = (rect.GetRight() + rect.GetLeft() + 1) / 2; - } - else // horz arrow - { - middle = (rect.GetTop() + rect.GetBottom() + 1) / 2; - } - - // draw the arrow interior - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxBrush(colInside, wxSOLID)); - - switch ( dir ) - { - case wxUP: - ptArrow[Point_First].x = rect.GetLeft(); - ptArrow[Point_First].y = rect.GetBottom(); - ptArrow[Point_Second].x = middle; - ptArrow[Point_Second].y = rect.GetTop(); - ptArrow[Point_Third].x = rect.GetRight(); - ptArrow[Point_Third].y = rect.GetBottom(); - break; - - case wxDOWN: - ptArrow[Point_First] = rect.GetPosition(); - ptArrow[Point_Second].x = middle; - ptArrow[Point_Second].y = rect.GetBottom(); - ptArrow[Point_Third].x = rect.GetRight(); - ptArrow[Point_Third].y = rect.GetTop(); - break; - - case wxLEFT: - ptArrow[Point_First].x = rect.GetRight(); - ptArrow[Point_First].y = rect.GetTop(); - ptArrow[Point_Second].x = rect.GetLeft(); - ptArrow[Point_Second].y = middle; - ptArrow[Point_Third].x = rect.GetRight(); - ptArrow[Point_Third].y = rect.GetBottom(); - break; - - case wxRIGHT: - ptArrow[Point_First] = rect.GetPosition(); - ptArrow[Point_Second].x = rect.GetRight(); - ptArrow[Point_Second].y = middle; - ptArrow[Point_Third].x = rect.GetLeft(); - ptArrow[Point_Third].y = rect.GetBottom(); - break; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - } + return NULL; +} - dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow); +#endif // wxUSE_MENUS - // draw the arrow border - dc.SetPen(penShadow[0]); - switch ( dir ) - { - case wxUP: - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); - dc.DrawPoint(ptArrow[Point_First]); - if ( penShadow[3].Ok() ) - { - dc.SetPen(penShadow[3]); - dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y, - ptArrow[Point_Second].x, ptArrow[Point_Second].y); - } - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Second].x + 1, ptArrow[Point_Second].y + 1, - ptArrow[Point_Third].x, ptArrow[Point_Third].y); - dc.DrawPoint(ptArrow[Point_Third]); - dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y, - ptArrow[Point_First].x + 1, ptArrow[Point_First].y); - if ( penShadow[2].Ok() ) - { - dc.SetPen(penShadow[2]); - dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, - ptArrow[Point_Second].x, ptArrow[Point_Second].y + 1); - dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y - 1, - ptArrow[Point_First].x + 2, ptArrow[Point_First].y - 1); - } - break; +// ---------------------------------------------------------------------------- +// slider +// ---------------------------------------------------------------------------- - case wxDOWN: - dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]); - dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y, - ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); - if ( penShadow[2].Ok() ) - { - dc.SetPen(penShadow[2]); - dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1, - ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y - 1); - } - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_Third]); - dc.DrawPoint(ptArrow[Point_Third]); - break; +#if wxUSE_SLIDER - case wxLEFT: - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); - dc.DrawPoint(ptArrow[Point_First]); - if ( penShadow[2].Ok() ) - { - dc.SetPen(penShadow[2]); - dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, - ptArrow[Point_First].x - 1, ptArrow[Point_First].y + 2); - dc.DrawLine(ptArrow[Point_Third].x, ptArrow[Point_Third].y, - ptArrow[Point_Second].x + 2, ptArrow[Point_Second].y + 1); - } - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Third].x, ptArrow[Point_Third].y, - ptArrow[Point_First].x, ptArrow[Point_First].y + 1); - dc.DrawLine(ptArrow[Point_Second].x + 1, ptArrow[Point_Second].y + 1, - ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); - break; +void wxMonoRenderer::DrawSliderShaft(wxDC& WXUNUSED(dc), + const wxRect& WXUNUSED(rect), + int WXUNUSED(lenThumb), + wxOrientation WXUNUSED(orient), + int WXUNUSED(flags), + long WXUNUSED(style), + wxRect *WXUNUSED(rectShaft)) +{ + wxFAIL_MSG(_T("TODO")); +} - case wxRIGHT: - dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Third]); - dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y + 1, - ptArrow[Point_Second].x, ptArrow[Point_Second].y); - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_Third]); - dc.DrawPoint(ptArrow[Point_Third]); - break; - default: - wxFAIL_MSG(_T("unknown arrow direction")); - return; - } +void wxMonoRenderer::DrawSliderThumb(wxDC& WXUNUSED(dc), + const wxRect& WXUNUSED(rect), + wxOrientation WXUNUSED(orient), + int WXUNUSED(flags), + long WXUNUSED(style)) +{ + wxFAIL_MSG(_T("TODO")); } -void wxMonoRenderer::DrawThumbBorder(wxDC& dc, - wxRect *rect, - wxOrientation orient) -{ - if ( orient == wxVERTICAL ) - { - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxLEFT); - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxRIGHT); - rect->Inflate(-1, 0); - - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxLEFT); - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxRIGHT); - rect->Inflate(-1, 0); - } - else - { - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxUP); - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxDOWN); - rect->Inflate(0, -1); - - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxUP); - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxDOWN); - rect->Inflate(0, -1); - } +void wxMonoRenderer::DrawSliderTicks(wxDC& WXUNUSED(dc), + const wxRect& WXUNUSED(rect), + int WXUNUSED(lenThumb), + wxOrientation WXUNUSED(orient), + int WXUNUSED(start), + int WXUNUSED(end), + int WXUNUSED(step), + int WXUNUSED(flags), + long WXUNUSED(style)) +{ + wxFAIL_MSG(_T("TODO")); } -void wxMonoRenderer::DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags) +wxCoord wxMonoRenderer::GetSliderDim() const { - // the thumb is never pressed never has focus border under Mono and the - // scrollbar background never changes at all - int flagsThumb = flags & ~(wxCONTROL_PRESSED | wxCONTROL_FOCUSED); - - // we don't want the border in the direction of the scrollbar movement - wxRect rectThumb = rect; - DrawThumbBorder(dc, &rectThumb, orient); + wxFAIL_MSG(_T("TODO")); - DrawButtonBorder(dc, rectThumb, flagsThumb, &rectThumb); - DrawBackground(dc, wxNullColour, rectThumb, flagsThumb); + return 0; } -void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int WXUNUSED(flags)) +wxCoord wxMonoRenderer::GetSliderTickLen() const { - wxRect rectBar = rect; - DrawThumbBorder(dc, &rectBar, orient); - DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar); -} + wxFAIL_MSG(_T("TODO")); -void wxMonoRenderer::DrawScrollCorner(wxDC& dc, const wxRect& rect) -{ - DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect); + return 0; } -#if wxUSE_SCROLLBAR -wxRect wxMonoRenderer::GetScrollbarRect(const wxScrollBar *scrollbar, - wxScrollBar::Element elem, - int thumbPos) const + +wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& WXUNUSED(rect), + int WXUNUSED(lenThumb), + wxOrientation WXUNUSED(orient), + long WXUNUSED(style)) const { - // as Mono scrollbars can't be disabled, it makes no sense to remove the - // thumb for a scrollbar with range 0 - instead, make it fill the entire - // scrollbar shaft - if ( (elem == wxScrollBar::Element_Thumb) && !scrollbar->GetRange() ) - { - elem = wxScrollBar::Element_Bar_2; - } + wxFAIL_MSG(_T("TODO")); - return StandardGetScrollbarRect(scrollbar, elem, - thumbPos, - GetScrollbarArrowSize(scrollbar)); + return wxRect(); } -wxCoord wxMonoRenderer::GetScrollbarSize(const wxScrollBar *scrollbar) +wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& WXUNUSED(rect), + int WXUNUSED(lenThumb), + wxOrientation WXUNUSED(orient)) const { - return StandardScrollBarSize(scrollbar, GetScrollbarArrowSize(scrollbar)); -} + wxFAIL_MSG(_T("TODO")); -wxHitTest wxMonoRenderer::HitTestScrollbar(const wxScrollBar *scrollbar, - const wxPoint& pt) const -{ - return StandardHitTestScrollbar(scrollbar, pt, - GetScrollbarArrowSize(scrollbar)); + return wxSize(); } -wxCoord wxMonoRenderer::ScrollbarToPixel(const wxScrollBar *scrollbar, - int thumbPos) -{ - return StandardScrollbarToPixel(scrollbar, thumbPos, - GetScrollbarArrowSize(scrollbar)); -} +#endif // wxUSE_SLIDER -int wxMonoRenderer::PixelToScrollbar(const wxScrollBar *scrollbar, - wxCoord coord) +wxSize wxMonoRenderer::GetProgressBarStep() const { - return StandardPixelToScrollbar(scrollbar, coord, - GetScrollbarArrowSize(scrollbar)); + wxFAIL_MSG(_T("TODO")); + + return wxSize(); } -#endif // wxUSE_SCROLLBAR + // ---------------------------------------------------------------------------- -// size adjustments +// scrollbar // ---------------------------------------------------------------------------- -void wxMonoRenderer::AdjustSize(wxSize *size, const wxWindow *window) +void wxMonoRenderer::DrawArrow(wxDC& dc, + wxDirection dir, + const wxRect& rect, + int WXUNUSED(flags)) { -#if wxUSE_BMPBUTTON - if ( wxDynamicCast(window, wxBitmapButton) ) - { - size->x += 4; - size->y += 4; - } else -#endif // wxUSE_BMPBUTTON -#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) ) - { - // TODO: this is ad hoc... - size->x += 3*window->GetCharWidth(); - wxCoord minBtnHeight = 18; - if ( size->y < minBtnHeight ) - size->y = minBtnHeight; - - // button border width - size->y += 4; - } - } else -#endif // wxUSE_BUTTON || wxUSE_TOGGLEBTN -#if wxUSE_SCROLLBAR - if ( wxDynamicCast(window, wxScrollBar) ) - { - // we only set the width of vert scrollbars and height of the - // horizontal ones - if ( window->GetWindowStyle() & wxSB_HORIZONTAL ) - size->y = m_sizeScrollbarArrow.x; - else - size->x = m_sizeScrollbarArrow.x; - } - else -#endif // wxUSE_SCROLLBAR + ArrowDirection arrowDir = GetArrowDirection(dir); + wxCHECK_RET( arrowDir != Arrow_Max, _T("invalid arrow direction") ); + + wxBitmap& bmp = m_bmpArrows[arrowDir]; + if ( !bmp.Ok() ) { - // take into account the border width - wxRect rectBorder = GetBorderDimensions(window->GetBorder()); - size->x += rectBorder.x + rectBorder.width; - size->y += rectBorder.y + rectBorder.height; + bmp = wxBitmap(ms_xpmArrows[arrowDir]); } -} -// ---------------------------------------------------------------------------- -// top level windows -// ---------------------------------------------------------------------------- - -void wxMonoRenderer::DrawFrameTitleBar(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - const wxString& WXUNUSED(title), - const wxIcon& WXUNUSED(icon), - int WXUNUSED(flags), - int WXUNUSED(specialButton), - int WXUNUSED(specialButtonFlag)) -{ -} - -void wxMonoRenderer::DrawFrameBorder(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - int WXUNUSED(flags)) -{ + wxRect rectArrow(0, 0, bmp.GetWidth(), bmp.GetHeight()); + dc.DrawBitmap(bmp, rectArrow.CentreIn(rect).GetPosition(), true /* use mask */); } -void wxMonoRenderer::DrawFrameBackground(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), +void wxMonoRenderer::DrawScrollbarThumb(wxDC& dc, + wxOrientation WXUNUSED(orient), + const wxRect& rect, int WXUNUSED(flags)) { -} + DrawSolidRect(dc, wxMONO_BG_COL, rect); -void wxMonoRenderer::DrawFrameTitle(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - const wxString& WXUNUSED(title), - int WXUNUSED(flags)) -{ + // manually draw stipple pattern (wxDFB doesn't implement the wxSTIPPLE + // brush style): + dc.SetPen(m_penFg); + for ( wxCoord y = rect.GetTop(); y <= rect.GetBottom(); y++ ) + { + for ( wxCoord x = rect.GetLeft() + (y % 2); x <= rect.GetRight(); x+=2 ) + { + dc.DrawPoint(x, y); + } + } } -void wxMonoRenderer::DrawFrameIcon(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - const wxIcon& WXUNUSED(icon), - int WXUNUSED(flags)) +void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc, + wxOrientation WXUNUSED(orient), + const wxRect& rect, + int WXUNUSED(flags)) { + DrawSolidRect(dc, wxMONO_BG_COL, rect); } -void wxMonoRenderer::DrawFrameButton(wxDC& WXUNUSED(dc), - wxCoord WXUNUSED(x), - wxCoord WXUNUSED(y), - int WXUNUSED(button), - int WXUNUSED(flags)) -{ -} +// ---------------------------------------------------------------------------- +// status bar +// ---------------------------------------------------------------------------- -wxRect -wxMonoRenderer::GetFrameClientArea(const wxRect& rect, - int WXUNUSED(flags)) const -{ - return rect; -} +#if wxUSE_STATUSBAR -wxSize -wxMonoRenderer::GetFrameTotalSize(const wxSize& clientSize, - int WXUNUSED(flags)) const +wxCoord wxMonoRenderer::GetStatusBarBorderBetweenFields() const { - return clientSize; + return 1; } -wxSize wxMonoRenderer::GetFrameMinSize(int WXUNUSED(flags)) const +wxSize wxMonoRenderer::GetStatusBarFieldMargins() const { - return wxSize(0,0); + return wxSize(1, 1); } -wxSize wxMonoRenderer::GetFrameIconSize() const -{ - return wxSize(wxDefaultCoord, wxDefaultCoord); -} +#endif // wxUSE_STATUSBAR -int -wxMonoRenderer::HitTestFrame(const wxRect& WXUNUSED(rect), - const wxPoint& WXUNUSED(pt), - int WXUNUSED(flags)) const +// ---------------------------------------------------------------------------- +// top level windows +// ---------------------------------------------------------------------------- + +int wxMonoRenderer::GetFrameBorderWidth(int WXUNUSED(flags)) const { - return wxHT_TOPLEVEL_CLIENT_AREA; + // all our borders are simple + return 1; } - // ---------------------------------------------------------------------------- -// standard icons +// wxMonoArtProvider // ---------------------------------------------------------------------------- -/* Copyright (c) Julian Smart */ -static const char *error_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 4 1", -" c None", -"X c #242424", -"o c #DCDF00", -". c #C00000", -/* pixels */ -" ", -" ", -" ", -" ", -" ", -" ..... ", -" ............. ", -" ................. ", -" ................... ", -" ....................... ", -" ......................... ", -" ........................... ", -" ...........................X ", -" .............................X ", -" ............................... ", -" ...............................X ", -" .................................X ", -" .................................X ", -" .................................XX ", -" ...ooooooooooooooooooooooooooo...XX ", -" ....ooooooooooooooooooooooooooo....X ", -" ....ooooooooooooooooooooooooooo....X ", -" ....ooooooooooooooooooooooooooo....XX ", -" ....ooooooooooooooooooooooooooo....XX ", -" ....ooooooooooooooooooooooooooo....XX ", -" ...ooooooooooooooooooooooooooo...XXX ", -" ...ooooooooooooooooooooooooooo...XXX ", -" .................................XX ", -" .................................XX ", -" ...............................XXX ", -" ...............................XXX ", -" .............................XXX ", -" ...........................XXXX ", -" ...........................XXX ", -" .........................XXX ", -" .......................XXXX ", -" X...................XXXXX ", -" X.................XXXXX ", -" X.............XXXXX ", -" XXXX.....XXXXXXXX ", -" XXXXXXXXXXXXX ", -" XXXXX ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static const char *info_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 9 1", -"$ c Black", -"O c #FFFFFF", -"@ c #808080", -"+ c #000080", -"o c #E8EB01", -" c None", -"X c #FFFF40", -"# c #C0C0C0", -". c #ABAD01", -/* pixels */ -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ..... ", -" ..XXXXX.. ", -" ..XXXXXXXXo.. ", -" .XXXOXXXXXXXoo. ", -" .XOOXXX+XXXXXo. ", -" .XOOOXX+++XXXXoo. ", -" .XOOXXX+++XXXXXo. ", -" .XOOOXXX+++XXXXXXo. ", -" .XOOXXXX+++XXXXXXo. ", -" .XXXXXXX+++XXXXXXX. ", -" .XXXXXXX+++XXXXXXo. ", -" .XXXXXXX+++XXXXXoo. ", -" .XXXXXX+++XXXXXo. ", -" .XXXXXXX+XXXXXXo. ", -" .XXXXXXXXXXXXo. ", -" .XXXXX+++XXXoo. ", -" .XXXX+++XXoo. ", -" .XXXXXXXXo. ", -" ..XXXXXXo.. ", -" .XXXXXo.. ", -" @#######@ ", -" @@@@@@@@@ ", -" @#######@ ", -" @@@@@@@@@ ", -" @#######@ ", -" @@@@@@@ ", -" ### ", -" $$$ ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static const char *warning_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 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... ", -" .............................. ", -" .............................. ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static const char *question_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 21 1", -". c Black", -"> c #696969", -"O c #1F1F00", -"+ c #181818", -"o c #F6F900", -"; c #3F3F00", -"$ c #111111", -" c None", -"& c #202020", -"X c #AAAA00", -"@ c #949400", -": c #303030", -"1 c #383838", -"% c #2A2A00", -", c #404040", -"= c #B4B400", -"- c #484848", -"# c #151500", -"< c #9F9F00", -"2 c #6A6A00", -"* c #353500", -/* pixels */ -" ", -" ", -" ", -" ", -" ......... ", -" ...XXXXXXX.. ", -" ..XXXXoooooXXXO+ ", -" ..XXooooooooooooX@.. ", -" ..XoooooooooooooooXX#. ", -" $%XoooooooooooooooooXX#. ", -" &.XoooooooXXXXXXooooooXX.. ", -" .XooooooXX.$...$XXoooooX*. ", -" $.XoooooX%.$ .*oooooo=.. ", -" .XooooooX.. -.XoooooX.. ", -" .XoooooX..+ .XoooooX;. ", -" ...XXXX..: .XoooooX;. ", -" ........ >.XoooooX;. ", -" +.XoooooX.. ", -" ,.Xoooooo<.. ", -" 1#XooooooXO.. ", -" &#XooooooX2.. ", -" $%XooooooXX.. ", -" $%XooooooXX.. ", -" $%XooooooXX.. ", -" &.XooooooXX.. ", -" .XooooooXX.. ", -" &.XoooooXX.. ", -" ..XooooXX.. ", -" ..XooooX... ", -" ..XXooXX..& ", -" ...XXXXX.. ", -" ........ ", -" ", -" ", -" ....... ", -" ..XXXXX.. ", -" ..XXoooXX.. ", -" ..XoooooX.. ", -" ..XoooooX.. ", -" ..XXoooXX.. ", -" ..XXXXX.. ", -" ....... ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -wxBitmap wxMonoArtProvider::CreateBitmap(const wxArtID& id, - const wxArtClient& WXUNUSED(client), - const wxSize& WXUNUSED(size)) +wxBitmap wxMonoArtProvider::CreateBitmap(const wxArtID& WXUNUSED(id), + const wxArtClient& WXUNUSED(client), + const wxSize& WXUNUSED(size)) { - if ( id == wxART_INFORMATION ) - return wxBitmap(info_xpm); - if ( id == wxART_ERROR ) - return wxBitmap(error_xpm); - if ( id == wxART_WARNING ) - return wxBitmap(warning_xpm); - if ( id == wxART_QUESTION ) - return wxBitmap(question_xpm); return wxNullBitmap; } - -// ============================================================================ -// wxInputHandler -// ============================================================================ - +#endif // wxUSE_THEME_MONO