📄 renderer.h
字号:
///////////////////////////////////////////////////////////////////////////////// Name: wx/univ/renderer.h// Purpose: wxRenderer class declaration// Author: Vadim Zeitlin// Modified by:// Created: 06.08.00// RCS-ID: $Id: renderer.h,v 1.42 2006/11/30 23:44:49 RD Exp $// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)// Licence: wxWindows licence///////////////////////////////////////////////////////////////////////////////#ifndef _WX_UNIV_RENDERER_H_#define _WX_UNIV_RENDERER_H_/* wxRenderer class is used to draw all wxWidgets controls. This is an ABC and the look of the application is determined by the concrete derivation of wxRenderer used in the program. It also contains a few static methods which may be used by the concrete renderers and provide the functionality which is often similar or identical in all renderers (using inheritance here would be more restrictive as the given concrete renderer may need an arbitrary subset of the base class methods). Finally note that wxRenderer supersedes wxRendererNative in wxUniv build and includes the latters functionality (which it may delegate to the generic implementation of the latter or reimplement itself). */#include "wx/renderer.h"class WXDLLEXPORT wxWindow;class WXDLLEXPORT wxDC;class WXDLLEXPORT wxCheckListBox;#if wxUSE_LISTBOX class WXDLLEXPORT wxListBox;#endif // wxUSE_LISTBOX#if wxUSE_MENUS class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxMenuGeometryInfo;#endif // wxUSE_MENUSclass WXDLLEXPORT wxScrollBar;#if wxUSE_TEXTCTRL class WXDLLEXPORT wxTextCtrl;#endif#if wxUSE_GAUGE class WXDLLEXPORT wxGauge;#endif // wxUSE_GAUGE#include "wx/string.h"#include "wx/gdicmn.h"#include "wx/icon.h"// helper class used by wxMenu-related functionsclass WXDLLEXPORT wxMenuGeometryInfo{public: // get the total size of the menu virtual wxSize GetSize() const = 0; virtual ~wxMenuGeometryInfo();};// ----------------------------------------------------------------------------// wxRenderer: abstract renderers interface// ----------------------------------------------------------------------------class WXDLLEXPORT wxRenderer : public wxDelegateRendererNative{public: // drawing functions // ----------------- // draw the controls background virtual void DrawBackground(wxDC& dc, const wxColour& col, const wxRect& rect, int flags, wxWindow *window = NULL) = 0; // draw the button surface virtual void DrawButtonSurface(wxDC& dc, const wxColour& col, const wxRect& rect, int flags) = 0; // draw the focus rectangle around the label contained in the given rect // // only wxCONTROL_SELECTED makes sense in flags here virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw the label inside the given rectangle with the specified alignment // and optionally emphasize the character with the given index 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) = 0; // same but also draw a bitmap if it is valid virtual void DrawButtonLabel(wxDC& dc, const wxString& label, const wxBitmap& image, const wxRect& rect, int flags = 0, int alignment = wxALIGN_LEFT | wxALIGN_TOP, int indexAccel = -1, wxRect *rectBounds = NULL) = 0; // draw the border and optionally return the rectangle containing the // region inside the border virtual void DrawBorder(wxDC& dc, wxBorder border, const wxRect& rect, int flags = 0, wxRect *rectIn = (wxRect *)NULL) = 0; // draw text control border (I hate to have a separate method for this but // it is needed to accommodate GTK+) virtual void DrawTextBorder(wxDC& dc, wxBorder border, const wxRect& rect, int flags = 0, wxRect *rectIn = (wxRect *)NULL) = 0; // draw push button border and return the rectangle left for the label virtual void DrawButtonBorder(wxDC& dc, const wxRect& rect, int flags = 0, wxRect *rectIn = (wxRect *)NULL) = 0; // draw a horizontal line virtual void DrawHorizontalLine(wxDC& dc, wxCoord y, wxCoord x1, wxCoord x2) = 0; // draw a vertical line virtual void DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2) = 0; // draw a frame with the label (horizontal alignment can be specified) virtual void DrawFrame(wxDC& dc, const wxString& label, const wxRect& rect, int flags = 0, int alignment = wxALIGN_LEFT, int indexAccel = -1) = 0; // draw an arrow in the given direction virtual void DrawArrow(wxDC& dc, wxDirection dir, const wxRect& rect, int flags = 0) = 0; // draw a scrollbar arrow (may be the same as arrow but may be not) virtual void DrawScrollbarArrow(wxDC& dc, wxDirection dir, const wxRect& rect, int flags = 0) = 0; // draw the scrollbar thumb virtual void DrawScrollbarThumb(wxDC& dc, wxOrientation orient, const wxRect& rect, int flags = 0) = 0; // draw a (part of) scrollbar shaft virtual void DrawScrollbarShaft(wxDC& dc, wxOrientation orient, const wxRect& rect, int flags = 0) = 0; // draw the rectangle in the corner between two scrollbars virtual void DrawScrollCorner(wxDC& dc, const wxRect& rect) = 0; // draw an item of a wxListBox virtual void DrawItem(wxDC& dc, const wxString& label, const wxRect& rect, int flags = 0) = 0; // draw an item of a wxCheckListBox virtual void DrawCheckItem(wxDC& dc, const wxString& label, const wxBitmap& bitmap, const wxRect& rect, int flags = 0) = 0; // draw a checkbutton (bitmap may be invalid to use default one) virtual void DrawCheckButton(wxDC& dc, const wxString& label, const wxBitmap& bitmap, const wxRect& rect, int flags = 0, wxAlignment align = wxALIGN_LEFT, int indexAccel = -1) = 0; // draw a radio button virtual void DrawRadioButton(wxDC& dc, const wxString& label, const wxBitmap& bitmap, const wxRect& rect, int flags = 0, wxAlignment align = wxALIGN_LEFT, int indexAccel = -1) = 0;#if wxUSE_TOOLBAR // draw a toolbar button (label may be empty, bitmap may be invalid, if // both conditions are true this function draws a separator) virtual void DrawToolBarButton(wxDC& dc, const wxString& label, const wxBitmap& bitmap, const wxRect& rect, int flags = 0, long style = 0, int tbarStyle = 0) = 0;#endif // wxUSE_TOOLBAR#if wxUSE_TEXTCTRL // draw a (part of) line in the text control virtual void DrawTextLine(wxDC& dc, const wxString& text, const wxRect& rect, int selStart = -1, int selEnd = -1, int flags = 0) = 0; // draw a line wrap indicator virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect) = 0;#endif // wxUSE_TEXTCTRL#if wxUSE_NOTEBOOK // draw a notebook tab virtual void DrawTab(wxDC& dc, const wxRect& rect, wxDirection dir, const wxString& label, const wxBitmap& bitmap = wxNullBitmap, int flags = 0, int indexAccel = -1) = 0;#endif // wxUSE_NOTEBOOK#if wxUSE_SLIDER // draw the slider shaft virtual void DrawSliderShaft(wxDC& dc, const wxRect& rect, int lenThumb, wxOrientation orient, int flags = 0, long style = 0, wxRect *rectShaft = NULL) = 0; // draw the slider thumb virtual void DrawSliderThumb(wxDC& dc, const wxRect& rect, wxOrientation orient, int flags = 0, long style = 0) = 0; // draw the slider ticks virtual void DrawSliderTicks(wxDC& dc, const wxRect& rect, int lenThumb, wxOrientation orient, int start, int end, int step = 1, int flags = 0, long style = 0) = 0;#endif // wxUSE_SLIDER#if wxUSE_MENUS // draw a menu bar item virtual void DrawMenuBarItem(wxDC& dc, const wxRect& rect, const wxString& label, int flags = 0, int indexAccel = -1) = 0; // draw a menu item (also used for submenus if flags has ISSUBMENU flag) // // the geometryInfo is calculated by GetMenuGeometry() function from below virtual void DrawMenuItem(wxDC& dc, wxCoord y, const wxMenuGeometryInfo& geometryInfo, const wxString& label, const wxString& accel, const wxBitmap& bitmap = wxNullBitmap, int flags = 0, int indexAccel = -1) = 0; // draw a menu bar separator virtual void DrawMenuSeparator(wxDC& dc, wxCoord y, const wxMenuGeometryInfo& geomInfo) = 0;#endif // wxUSE_MENUS#if wxUSE_STATUSBAR // draw a status bar field: wxCONTROL_ISDEFAULT bit in the flags is // interpreted specially and means "draw the status bar grip" here
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -