repo_name
stringclasses
10 values
file_path
stringlengths
29
222
content
stringlengths
24
926k
extention
stringclasses
5 values
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/addremovectrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/addremovectrl.h // Purpose: Generic wxAddRemoveImpl implementation, also used in wxMSW // Author: Vadim Zeitlin // Created: 2015-02-05 // Copyright: (c) 2015 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_PRIVATE_ADDREMOVECTRL_H_ #define _WX_GENERIC_PRIVATE_ADDREMOVECTRL_H_ // ---------------------------------------------------------------------------- // wxAddRemoveImpl // ---------------------------------------------------------------------------- class wxAddRemoveImpl : public wxAddRemoveImplWithButtons { public: wxAddRemoveImpl(wxAddRemoveAdaptor* adaptor, wxAddRemoveCtrl* parent, wxWindow* ctrlItems) : wxAddRemoveImplWithButtons(adaptor, parent, ctrlItems) { m_btnAdd = new wxButton(parent, wxID_ADD, GetAddButtonLabel(), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT | wxBORDER_NONE); m_btnRemove = new wxButton(parent, wxID_REMOVE, GetRemoveButtonLabel(), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT | wxBORDER_NONE); wxSizer* const sizerBtns = new wxBoxSizer(wxVERTICAL); sizerBtns->Add(m_btnAdd, wxSizerFlags().Expand()); sizerBtns->Add(m_btnRemove, wxSizerFlags().Expand()); wxSizer* const sizerTop = new wxBoxSizer(wxHORIZONTAL); sizerTop->Add(ctrlItems, wxSizerFlags(1).Expand()); sizerTop->Add(sizerBtns, wxSizerFlags().Centre().Border(wxLEFT)); parent->SetSizer(sizerTop); SetUpEvents(); } private: static wxString GetAddButtonLabel() { #if wxUSE_UNICODE return wchar_t(0xFF0B); // FULLWIDTH PLUS SIGN #else return "+"; #endif } static wxString GetRemoveButtonLabel() { #if wxUSE_UNICODE return wchar_t(0x2012); // FIGURE DASH #else return "-"; #endif } }; #endif // _WX_GENERIC_PRIVATE_ADDREMOVECTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/notifmsg.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/notifmsg.h // Purpose: wxGenericNotificationMessage declarations // Author: Tobias Taschner // Created: 2015-08-04 // Copyright: (c) 2015 wxWidgets development team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_PRIVATE_NOTIFMSG_H_ #define _WX_GENERIC_PRIVATE_NOTIFMSG_H_ #include "wx/private/notifmsg.h" class wxGenericNotificationMessageImpl : public wxNotificationMessageImpl { public: wxGenericNotificationMessageImpl(wxNotificationMessageBase* notification); virtual ~wxGenericNotificationMessageImpl(); virtual bool Show(int timeout) wxOVERRIDE; virtual bool Close() wxOVERRIDE; virtual void SetTitle(const wxString& title) wxOVERRIDE; virtual void SetMessage(const wxString& message) wxOVERRIDE; virtual void SetParent(wxWindow *parent) wxOVERRIDE; virtual void SetFlags(int flags) wxOVERRIDE; virtual void SetIcon(const wxIcon& icon) wxOVERRIDE; virtual bool AddAction(wxWindowID actionid, const wxString &label) wxOVERRIDE; // get/set the default timeout (used if Timeout_Auto is specified) static int GetDefaultTimeout() { return ms_timeout; } static void SetDefaultTimeout(int timeout); private: // default timeout static int ms_timeout; // notification message is represented by a frame in this implementation class wxNotificationMessageWindow *m_window; wxDECLARE_NO_COPY_CLASS(wxGenericNotificationMessageImpl); }; #endif // _WX_GENERIC_PRIVATE_NOTIFMSG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/widthcalc.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/widthcalc.h // Purpose: wxMaxWidthCalculatorBase helper class. // Author: Václav Slavík, Kinaou Hervé // Copyright: (c) 2015 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_PRIVATE_WIDTHCALC_H_ #define _WX_GENERIC_PRIVATE_WIDTHCALC_H_ #include "wx/defs.h" #if wxUSE_DATAVIEWCTRL || wxUSE_LISTCTRL #include "wx/log.h" #include "wx/timer.h" // ---------------------------------------------------------------------------- // wxMaxWidthCalculatorBase: base class for calculating max column width // ---------------------------------------------------------------------------- class wxMaxWidthCalculatorBase { public: // column of which calculate the width explicit wxMaxWidthCalculatorBase(size_t column) : m_column(column), m_width(0) { } void UpdateWithWidth(int width) { m_width = wxMax(m_width, width); } // Update the max with for the expected row virtual void UpdateWithRow(int row) = 0; int GetMaxWidth() const { return m_width; } size_t GetColumn() const { return m_column; } void ComputeBestColumnWidth(size_t count, size_t first_visible, size_t last_visible) { // The code below deserves some explanation. For very large controls, we // simply can't afford to calculate sizes for all items, it takes too // long. So the best we can do is to check the first and the last N/2 // items in the control for some sufficiently large N and calculate best // sizes from that. That can result in the calculated best width being too // small for some outliers, but it's better to get slightly imperfect // result than to wait several seconds after every update. To avoid highly // visible miscalculations, we also include all currently visible items // no matter what. Finally, the value of N is determined dynamically by // measuring how much time we spent on the determining item widths so far. #if wxUSE_STOPWATCH size_t top_part_end = count; static const long CALC_TIMEOUT = 20/*ms*/; // don't call wxStopWatch::Time() too often static const unsigned CALC_CHECK_FREQ = 100; wxStopWatch timer; #else // use some hard-coded limit, that's the best we can do without timer size_t top_part_end = wxMin(500, count); #endif // wxUSE_STOPWATCH/!wxUSE_STOPWATCH size_t row = 0; for ( row = 0; row < top_part_end; row++ ) { #if wxUSE_STOPWATCH if ( row % CALC_CHECK_FREQ == CALC_CHECK_FREQ-1 && timer.Time() > CALC_TIMEOUT ) break; #endif // wxUSE_STOPWATCH UpdateWithRow(row); } // row is the first unmeasured item now; that's our value of N/2 if ( row < count ) { top_part_end = row; // add bottom N/2 items now: const size_t bottom_part_start = wxMax(row, count - row); for ( row = bottom_part_start; row < count; row++ ) { UpdateWithRow(row); } // finally, include currently visible items in the calculation: first_visible = wxMax(first_visible, top_part_end); last_visible = wxMin(bottom_part_start, last_visible); for ( row = first_visible; row < last_visible; row++ ) { UpdateWithRow(row); } wxLogTrace("items container", "determined best size from %zu top, %zu bottom " "plus %zu more visible items out of %zu total", top_part_end, count - bottom_part_start, last_visible - first_visible, count); } } private: const size_t m_column; int m_width; wxDECLARE_NO_COPY_CLASS(wxMaxWidthCalculatorBase); }; #endif // wxUSE_DATAVIEWCTRL || wxUSE_LISTCTRL #endif // _WX_GENERIC_PRIVATE_WIDTHCALC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/richtooltip.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/richtooltip.h // Purpose: wxRichToolTipGenericImpl declaration. // Author: Vadim Zeitlin // Created: 2011-10-18 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_PRIVATE_RICHTOOLTIP_H_ #define _WX_GENERIC_PRIVATE_RICHTOOLTIP_H_ #include "wx/icon.h" #include "wx/colour.h" // ---------------------------------------------------------------------------- // wxRichToolTipGenericImpl: defines generic wxRichToolTip implementation. // ---------------------------------------------------------------------------- class wxRichToolTipGenericImpl : public wxRichToolTipImpl { public: wxRichToolTipGenericImpl(const wxString& title, const wxString& message) : m_title(title), m_message(message) { m_tipKind = wxTipKind_Auto; // This is pretty arbitrary, we could follow MSW and use some multiple // of double-click time here. m_timeout = 5000; m_delay = 0; } virtual void SetBackgroundColour(const wxColour& col, const wxColour& colEnd) wxOVERRIDE; virtual void SetCustomIcon(const wxIcon& icon) wxOVERRIDE; virtual void SetStandardIcon(int icon) wxOVERRIDE; virtual void SetTimeout(unsigned milliseconds, unsigned millisecondsDelay = 0) wxOVERRIDE; virtual void SetTipKind(wxTipKind tipKind) wxOVERRIDE; virtual void SetTitleFont(const wxFont& font) wxOVERRIDE; virtual void ShowFor(wxWindow* win, const wxRect* rect = NULL) wxOVERRIDE; protected: wxString m_title, m_message; private: wxIcon m_icon; wxColour m_colStart, m_colEnd; unsigned m_timeout, m_delay; wxTipKind m_tipKind; wxFont m_titleFont; }; #endif // _WX_GENERIC_PRIVATE_RICHTOOLTIP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/grid.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/grid.h // Purpose: Private wxGrid structures // Author: Michael Bedward (based on code by Julian Smart, Robin Dunn) // Modified by: Santiago Palacios // Created: 1/08/1999 // Copyright: (c) Michael Bedward // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_GRID_PRIVATE_H_ #define _WX_GENERIC_GRID_PRIVATE_H_ #include "wx/defs.h" #if wxUSE_GRID // Internally used (and hence intentionally not exported) event telling wxGrid // to hide the currently shown editor. wxDECLARE_EVENT( wxEVT_GRID_HIDE_EDITOR, wxCommandEvent ); // ---------------------------------------------------------------------------- // array classes // ---------------------------------------------------------------------------- WX_DEFINE_ARRAY_WITH_DECL_PTR(wxGridCellAttr *, wxArrayAttrs, class WXDLLIMPEXP_ADV); struct wxGridCellWithAttr { wxGridCellWithAttr(int row, int col, wxGridCellAttr *attr_) : coords(row, col), attr(attr_) { wxASSERT( attr ); } wxGridCellWithAttr(const wxGridCellWithAttr& other) : coords(other.coords), attr(other.attr) { attr->IncRef(); } wxGridCellWithAttr& operator=(const wxGridCellWithAttr& other) { coords = other.coords; if (attr != other.attr) { attr->DecRef(); attr = other.attr; attr->IncRef(); } return *this; } void ChangeAttr(wxGridCellAttr* new_attr) { if (attr != new_attr) { // "Delete" (i.e. DecRef) the old attribute. attr->DecRef(); attr = new_attr; // Take ownership of the new attribute, i.e. no IncRef. } } ~wxGridCellWithAttr() { attr->DecRef(); } wxGridCellCoords coords; wxGridCellAttr *attr; }; WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellWithAttr, wxGridCellWithAttrArray, class WXDLLIMPEXP_ADV); // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- // header column providing access to the column information stored in wxGrid // via wxHeaderColumn interface class wxGridHeaderColumn : public wxHeaderColumn { public: wxGridHeaderColumn(wxGrid *grid, int col) : m_grid(grid), m_col(col) { } virtual wxString GetTitle() const wxOVERRIDE { return m_grid->GetColLabelValue(m_col); } virtual wxBitmap GetBitmap() const wxOVERRIDE { return wxNullBitmap; } virtual int GetWidth() const wxOVERRIDE { return m_grid->GetColSize(m_col); } virtual int GetMinWidth() const wxOVERRIDE { return 0; } virtual wxAlignment GetAlignment() const wxOVERRIDE { int horz, vert; m_grid->GetColLabelAlignment(&horz, &vert); return static_cast<wxAlignment>(horz); } virtual int GetFlags() const wxOVERRIDE { // we can't know in advance whether we can sort by this column or not // with wxGrid API so suppose we can by default int flags = wxCOL_SORTABLE; if ( m_grid->CanDragColSize(m_col) ) flags |= wxCOL_RESIZABLE; if ( m_grid->CanDragColMove() ) flags |= wxCOL_REORDERABLE; if ( GetWidth() == 0 ) flags |= wxCOL_HIDDEN; return flags; } virtual bool IsSortKey() const wxOVERRIDE { return m_grid->IsSortingBy(m_col); } virtual bool IsSortOrderAscending() const wxOVERRIDE { return m_grid->IsSortOrderAscending(); } private: // these really should be const but are not because the column needs to be // assignable to be used in a wxVector (in STL build, in non-STL build we // avoid the need for this) wxGrid *m_grid; int m_col; }; // header control retreiving column information from the grid class wxGridHeaderCtrl : public wxHeaderCtrl { public: wxGridHeaderCtrl(wxGrid *owner) : wxHeaderCtrl(owner, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHD_ALLOW_HIDE | (owner->CanDragColMove() ? wxHD_ALLOW_REORDER : 0)) { } protected: virtual const wxHeaderColumn& GetColumn(unsigned int idx) const wxOVERRIDE { return m_columns[idx]; } private: wxGrid *GetOwner() const { return static_cast<wxGrid *>(GetParent()); } static wxMouseEvent GetDummyMouseEvent() { // make up a dummy event for the grid event to use -- unfortunately we // can't do anything else here wxMouseEvent e; e.SetState(wxGetMouseState()); return e; } // override the base class method to update our m_columns array virtual void OnColumnCountChanging(unsigned int count) wxOVERRIDE { const unsigned countOld = m_columns.size(); if ( count < countOld ) { // just discard the columns which don't exist any more (notice that // we can't use resize() here as it would require the vector // value_type, i.e. wxGridHeaderColumn to be default constructible, // which it is not) m_columns.erase(m_columns.begin() + count, m_columns.end()); } else // new columns added { // add columns for the new elements for ( unsigned n = countOld; n < count; n++ ) m_columns.push_back(wxGridHeaderColumn(GetOwner(), n)); } } // override to implement column auto sizing virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle) wxOVERRIDE { // TODO: currently grid doesn't support computing the column best width // from its contents so we just use the best label width as is GetOwner()->SetColSize(idx, widthTitle); return true; } // overridden to react to the actions using the columns popup menu virtual void UpdateColumnVisibility(unsigned int idx, bool show) wxOVERRIDE { GetOwner()->SetColSize(idx, show ? wxGRID_AUTOSIZE : 0); // as this is done by the user we should notify the main program about // it GetOwner()->SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, idx, GetDummyMouseEvent()); } // overridden to react to the columns order changes in the customization // dialog virtual void UpdateColumnsOrder(const wxArrayInt& order) wxOVERRIDE { GetOwner()->SetColumnsOrder(order); } // event handlers forwarding wxHeaderCtrl events to wxGrid void OnClick(wxHeaderCtrlEvent& event) { GetOwner()->SendEvent(wxEVT_GRID_LABEL_LEFT_CLICK, -1, event.GetColumn(), GetDummyMouseEvent()); GetOwner()->DoColHeaderClick(event.GetColumn()); } void OnDoubleClick(wxHeaderCtrlEvent& event) { if ( !GetOwner()->SendEvent(wxEVT_GRID_LABEL_LEFT_DCLICK, -1, event.GetColumn(), GetDummyMouseEvent()) ) { event.Skip(); } } void OnRightClick(wxHeaderCtrlEvent& event) { if ( !GetOwner()->SendEvent(wxEVT_GRID_LABEL_RIGHT_CLICK, -1, event.GetColumn(), GetDummyMouseEvent()) ) { event.Skip(); } } void OnBeginResize(wxHeaderCtrlEvent& event) { GetOwner()->DoStartResizeCol(event.GetColumn()); event.Skip(); } void OnResizing(wxHeaderCtrlEvent& event) { GetOwner()->DoUpdateResizeColWidth(event.GetWidth()); } void OnEndResize(wxHeaderCtrlEvent& event) { // we again need to pass a mouse event to be used for the grid event // generation but we don't have it here so use a dummy one as in // UpdateColumnVisibility() wxMouseEvent e; e.SetState(wxGetMouseState()); GetOwner()->DoEndDragResizeCol(e); event.Skip(); } void OnBeginReorder(wxHeaderCtrlEvent& event) { GetOwner()->DoStartMoveCol(event.GetColumn()); } void OnEndReorder(wxHeaderCtrlEvent& event) { GetOwner()->DoEndMoveCol(event.GetNewOrder()); } wxVector<wxGridHeaderColumn> m_columns; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxGridHeaderCtrl); }; // common base class for various grid subwindows class WXDLLIMPEXP_ADV wxGridSubwindow : public wxWindow { public: wxGridSubwindow(wxGrid *owner, int additionalStyle = 0, const wxString& name = wxPanelNameStr) : wxWindow(owner, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | additionalStyle, name) { m_owner = owner; } virtual wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE { return m_owner; } virtual bool AcceptsFocus() const wxOVERRIDE { return false; } wxGrid *GetOwner() { return m_owner; } protected: void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); wxGrid *m_owner; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxGridSubwindow); }; class WXDLLIMPEXP_ADV wxGridRowLabelWindow : public wxGridSubwindow { public: wxGridRowLabelWindow(wxGrid *parent) : wxGridSubwindow(parent) { } private: void OnPaint( wxPaintEvent& event ); void OnMouseEvent( wxMouseEvent& event ); void OnMouseWheel( wxMouseEvent& event ); wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxGridRowLabelWindow); }; class WXDLLIMPEXP_ADV wxGridColLabelWindow : public wxGridSubwindow { public: wxGridColLabelWindow(wxGrid *parent) : wxGridSubwindow(parent) { } private: void OnPaint( wxPaintEvent& event ); void OnMouseEvent( wxMouseEvent& event ); void OnMouseWheel( wxMouseEvent& event ); wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxGridColLabelWindow); }; class WXDLLIMPEXP_ADV wxGridCornerLabelWindow : public wxGridSubwindow { public: wxGridCornerLabelWindow(wxGrid *parent) : wxGridSubwindow(parent) { } private: void OnMouseEvent( wxMouseEvent& event ); void OnMouseWheel( wxMouseEvent& event ); void OnPaint( wxPaintEvent& event ); wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxGridCornerLabelWindow); }; class WXDLLIMPEXP_ADV wxGridWindow : public wxGridSubwindow { public: wxGridWindow(wxGrid *parent) : wxGridSubwindow(parent, wxWANTS_CHARS | wxCLIP_CHILDREN, "GridWindow") { } virtual void ScrollWindow( int dx, int dy, const wxRect *rect ) wxOVERRIDE; virtual bool AcceptsFocus() const wxOVERRIDE { return true; } private: void OnPaint( wxPaintEvent &event ); void OnMouseWheel( wxMouseEvent& event ); void OnMouseEvent( wxMouseEvent& event ); void OnKeyDown( wxKeyEvent& ); void OnKeyUp( wxKeyEvent& ); void OnChar( wxKeyEvent& ); void OnEraseBackground( wxEraseEvent& ); void OnFocus( wxFocusEvent& ); wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxGridWindow); }; // ---------------------------------------------------------------------------- // the internal data representation used by wxGridCellAttrProvider // ---------------------------------------------------------------------------- // this class stores attributes set for cells class WXDLLIMPEXP_ADV wxGridCellAttrData { public: void SetAttr(wxGridCellAttr *attr, int row, int col); wxGridCellAttr *GetAttr(int row, int col) const; void UpdateAttrRows( size_t pos, int numRows ); void UpdateAttrCols( size_t pos, int numCols ); private: // searches for the attr for given cell, returns wxNOT_FOUND if not found int FindIndex(int row, int col) const; wxGridCellWithAttrArray m_attrs; }; // this class stores attributes set for rows or columns class WXDLLIMPEXP_ADV wxGridRowOrColAttrData { public: // empty ctor to suppress warnings wxGridRowOrColAttrData() {} ~wxGridRowOrColAttrData(); void SetAttr(wxGridCellAttr *attr, int rowOrCol); wxGridCellAttr *GetAttr(int rowOrCol) const; void UpdateAttrRowsOrCols( size_t pos, int numRowsOrCols ); private: wxArrayInt m_rowsOrCols; wxArrayAttrs m_attrs; }; // NB: this is just a wrapper around 3 objects: one which stores cell // attributes, and 2 others for row/col ones class WXDLLIMPEXP_ADV wxGridCellAttrProviderData { public: wxGridCellAttrData m_cellAttrs; wxGridRowOrColAttrData m_rowAttrs, m_colAttrs; }; // ---------------------------------------------------------------------------- // operations classes abstracting the difference between operating on rows and // columns // ---------------------------------------------------------------------------- // This class allows to write a function only once because by using its methods // it will apply to both columns and rows. // // This is an abstract interface definition, the two concrete implementations // below should be used when working with rows and columns respectively. class wxGridOperations { public: // Returns the operations in the other direction, i.e. wxGridRowOperations // if this object is a wxGridColumnOperations and vice versa. virtual wxGridOperations& Dual() const = 0; // Return the number of rows or columns. virtual int GetNumberOfLines(const wxGrid *grid) const = 0; // Return the selection mode which allows selecting rows or columns. virtual wxGrid::wxGridSelectionModes GetSelectionMode() const = 0; // Make a wxGridCellCoords from the given components: thisDir is row or // column and otherDir is column or row virtual wxGridCellCoords MakeCoords(int thisDir, int otherDir) const = 0; // Calculate the scrolled position of the given abscissa or ordinate. virtual int CalcScrolledPosition(wxGrid *grid, int pos) const = 0; // Selects the horizontal or vertical component from the given object. virtual int Select(const wxGridCellCoords& coords) const = 0; virtual int Select(const wxPoint& pt) const = 0; virtual int Select(const wxSize& sz) const = 0; virtual int Select(const wxRect& r) const = 0; virtual int& Select(wxRect& r) const = 0; // Returns width or height of the rectangle virtual int& SelectSize(wxRect& r) const = 0; // Make a wxSize such that Select() applied to it returns first component virtual wxSize MakeSize(int first, int second) const = 0; // Sets the row or column component of the given cell coordinates virtual void Set(wxGridCellCoords& coords, int line) const = 0; // Draws a line parallel to the row or column, i.e. horizontal or vertical: // pos is the horizontal or vertical position of the line and start and end // are the coordinates of the line extremities in the other direction virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const = 0; // Draw a horizontal or vertical line across the given rectangle // (this is implemented in terms of above and uses Select() to extract // start and end from the given rectangle) void DrawParallelLineInRect(wxDC& dc, const wxRect& rect, int pos) const { const int posStart = Select(rect.GetPosition()); DrawParallelLine(dc, posStart, posStart + Select(rect.GetSize()), pos); } // Return the index of the row or column at the given pixel coordinate. virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const = 0; // Get the top/left position, in pixels, of the given row or column virtual int GetLineStartPos(const wxGrid *grid, int line) const = 0; // Get the bottom/right position, in pixels, of the given row or column virtual int GetLineEndPos(const wxGrid *grid, int line) const = 0; // Get the height/width of the given row/column virtual int GetLineSize(const wxGrid *grid, int line) const = 0; // Get wxGrid::m_rowBottoms/m_colRights array virtual const wxArrayInt& GetLineEnds(const wxGrid *grid) const = 0; // Get default height row height or column width virtual int GetDefaultLineSize(const wxGrid *grid) const = 0; // Return the minimal acceptable row height or column width virtual int GetMinimalAcceptableLineSize(const wxGrid *grid) const = 0; // Return the minimal row height or column width virtual int GetMinimalLineSize(const wxGrid *grid, int line) const = 0; // Set the row height or column width virtual void SetLineSize(wxGrid *grid, int line, int size) const = 0; // Set the row default height or column default width virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const = 0; // Return the index of the line at the given position // // NB: currently this is always identity for the rows as reordering is only // implemented for the lines virtual int GetLineAt(const wxGrid *grid, int pos) const = 0; // Return the display position of the line with the given index. // // NB: As GetLineAt(), currently this is always identity for rows. virtual int GetLinePos(const wxGrid *grid, int line) const = 0; // Return the index of the line just before the given one or wxNOT_FOUND. virtual int GetLineBefore(const wxGrid* grid, int line) const = 0; // Get the row or column label window virtual wxWindow *GetHeaderWindow(wxGrid *grid) const = 0; // Get the width or height of the row or column label window virtual int GetHeaderWindowSize(wxGrid *grid) const = 0; // This class is never used polymorphically but give it a virtual dtor // anyhow to suppress g++ complaints about it virtual ~wxGridOperations() { } }; class wxGridRowOperations : public wxGridOperations { public: virtual wxGridOperations& Dual() const wxOVERRIDE; virtual int GetNumberOfLines(const wxGrid *grid) const wxOVERRIDE { return grid->GetNumberRows(); } virtual wxGrid::wxGridSelectionModes GetSelectionMode() const wxOVERRIDE { return wxGrid::wxGridSelectRows; } virtual wxGridCellCoords MakeCoords(int thisDir, int otherDir) const wxOVERRIDE { return wxGridCellCoords(thisDir, otherDir); } virtual int CalcScrolledPosition(wxGrid *grid, int pos) const wxOVERRIDE { return grid->CalcScrolledPosition(wxPoint(pos, 0)).x; } virtual int Select(const wxGridCellCoords& c) const wxOVERRIDE { return c.GetRow(); } virtual int Select(const wxPoint& pt) const wxOVERRIDE { return pt.x; } virtual int Select(const wxSize& sz) const wxOVERRIDE { return sz.x; } virtual int Select(const wxRect& r) const wxOVERRIDE { return r.x; } virtual int& Select(wxRect& r) const wxOVERRIDE { return r.x; } virtual int& SelectSize(wxRect& r) const wxOVERRIDE { return r.width; } virtual wxSize MakeSize(int first, int second) const wxOVERRIDE { return wxSize(first, second); } virtual void Set(wxGridCellCoords& coords, int line) const wxOVERRIDE { coords.SetRow(line); } virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const wxOVERRIDE { dc.DrawLine(start, pos, end, pos); } virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const wxOVERRIDE { return grid->YToRow(pos, clip); } virtual int GetLineStartPos(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetRowTop(line); } virtual int GetLineEndPos(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetRowBottom(line); } virtual int GetLineSize(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetRowHeight(line); } virtual const wxArrayInt& GetLineEnds(const wxGrid *grid) const wxOVERRIDE { return grid->m_rowBottoms; } virtual int GetDefaultLineSize(const wxGrid *grid) const wxOVERRIDE { return grid->GetDefaultRowSize(); } virtual int GetMinimalAcceptableLineSize(const wxGrid *grid) const wxOVERRIDE { return grid->GetRowMinimalAcceptableHeight(); } virtual int GetMinimalLineSize(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetRowMinimalHeight(line); } virtual void SetLineSize(wxGrid *grid, int line, int size) const wxOVERRIDE { grid->SetRowSize(line, size); } virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const wxOVERRIDE { grid->SetDefaultRowSize(size, resizeExisting); } virtual int GetLineAt(const wxGrid * WXUNUSED(grid), int pos) const wxOVERRIDE { return pos; } // TODO: implement row reordering virtual int GetLinePos(const wxGrid * WXUNUSED(grid), int line) const wxOVERRIDE { return line; } // TODO: implement row reordering virtual int GetLineBefore(const wxGrid* WXUNUSED(grid), int line) const wxOVERRIDE { return line - 1; } virtual wxWindow *GetHeaderWindow(wxGrid *grid) const wxOVERRIDE { return grid->GetGridRowLabelWindow(); } virtual int GetHeaderWindowSize(wxGrid *grid) const wxOVERRIDE { return grid->GetRowLabelSize(); } }; class wxGridColumnOperations : public wxGridOperations { public: virtual wxGridOperations& Dual() const wxOVERRIDE; virtual int GetNumberOfLines(const wxGrid *grid) const wxOVERRIDE { return grid->GetNumberCols(); } virtual wxGrid::wxGridSelectionModes GetSelectionMode() const wxOVERRIDE { return wxGrid::wxGridSelectColumns; } virtual wxGridCellCoords MakeCoords(int thisDir, int otherDir) const wxOVERRIDE { return wxGridCellCoords(otherDir, thisDir); } virtual int CalcScrolledPosition(wxGrid *grid, int pos) const wxOVERRIDE { return grid->CalcScrolledPosition(wxPoint(0, pos)).y; } virtual int Select(const wxGridCellCoords& c) const wxOVERRIDE { return c.GetCol(); } virtual int Select(const wxPoint& pt) const wxOVERRIDE { return pt.y; } virtual int Select(const wxSize& sz) const wxOVERRIDE { return sz.y; } virtual int Select(const wxRect& r) const wxOVERRIDE { return r.y; } virtual int& Select(wxRect& r) const wxOVERRIDE { return r.y; } virtual int& SelectSize(wxRect& r) const wxOVERRIDE { return r.height; } virtual wxSize MakeSize(int first, int second) const wxOVERRIDE { return wxSize(second, first); } virtual void Set(wxGridCellCoords& coords, int line) const wxOVERRIDE { coords.SetCol(line); } virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const wxOVERRIDE { dc.DrawLine(pos, start, pos, end); } virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const wxOVERRIDE { return grid->XToCol(pos, clip); } virtual int GetLineStartPos(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetColLeft(line); } virtual int GetLineEndPos(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetColRight(line); } virtual int GetLineSize(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetColWidth(line); } virtual const wxArrayInt& GetLineEnds(const wxGrid *grid) const wxOVERRIDE { return grid->m_colRights; } virtual int GetDefaultLineSize(const wxGrid *grid) const wxOVERRIDE { return grid->GetDefaultColSize(); } virtual int GetMinimalAcceptableLineSize(const wxGrid *grid) const wxOVERRIDE { return grid->GetColMinimalAcceptableWidth(); } virtual int GetMinimalLineSize(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetColMinimalWidth(line); } virtual void SetLineSize(wxGrid *grid, int line, int size) const wxOVERRIDE { grid->SetColSize(line, size); } virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const wxOVERRIDE { grid->SetDefaultColSize(size, resizeExisting); } virtual int GetLineAt(const wxGrid *grid, int pos) const wxOVERRIDE { return grid->GetColAt(pos); } virtual int GetLinePos(const wxGrid *grid, int line) const wxOVERRIDE { return grid->GetColPos(line); } virtual int GetLineBefore(const wxGrid* grid, int line) const wxOVERRIDE { int posBefore = grid->GetColPos(line) - 1; return posBefore >= 0 ? grid->GetColAt(posBefore) : wxNOT_FOUND; } virtual wxWindow *GetHeaderWindow(wxGrid *grid) const wxOVERRIDE { return grid->GetGridColLabelWindow(); } virtual int GetHeaderWindowSize(wxGrid *grid) const wxOVERRIDE { return grid->GetColLabelSize(); } }; // This class abstracts the difference between operations going forward // (down/right) and backward (up/left) and allows to use the same code for // functions which differ only in the direction of grid traversal. // // Notice that all operations in this class work with display positions and not // internal indices which can be different if the columns were reordered. // // Like wxGridOperations it's an ABC with two concrete subclasses below. Unlike // it, this is a normal object and not just a function dispatch table and has a // non-default ctor. // // Note: the explanation of this discrepancy is the existence of (very useful) // Dual() method in wxGridOperations which forces us to make wxGridOperations a // function dispatcher only. class wxGridDirectionOperations { public: // The oper parameter to ctor selects whether we work with rows or columns wxGridDirectionOperations(wxGrid *grid, const wxGridOperations& oper) : m_grid(grid), m_oper(oper) { } // Check if the component of this point in our direction is at the // boundary, i.e. is the first/last row/column virtual bool IsAtBoundary(const wxGridCellCoords& coords) const = 0; // Increment the component of this point in our direction virtual void Advance(wxGridCellCoords& coords) const = 0; // Find the line at the given distance, in pixels, away from this one // (this uses clipping, i.e. anything after the last line is counted as the // last one and anything before the first one as 0) // // TODO: Implementation of this method currently doesn't support column // reordering as it mixes up indices and positions. But this doesn't // really matter as it's only called for rows (Page Up/Down only work // vertically) and row reordering is not currently supported. We'd // need to fix it if this ever changes however. virtual int MoveByPixelDistance(int line, int distance) const = 0; // This class is never used polymorphically but give it a virtual dtor // anyhow to suppress g++ complaints about it virtual ~wxGridDirectionOperations() { } protected: // Get the position of the row or column from the given coordinates pair. // // This is just a shortcut to avoid repeating m_oper and m_grid multiple // times in the derived classes code. int GetLinePos(const wxGridCellCoords& coords) const { return m_oper.GetLinePos(m_grid, m_oper.Select(coords)); } // Get the index of the row or column from the position. int GetLineAt(int pos) const { return m_oper.GetLineAt(m_grid, pos); } // Check if the given line is visible, i.e. has non 0 size. bool IsLineVisible(int line) const { return m_oper.GetLineSize(m_grid, line) != 0; } wxGrid * const m_grid; const wxGridOperations& m_oper; }; class wxGridBackwardOperations : public wxGridDirectionOperations { public: wxGridBackwardOperations(wxGrid *grid, const wxGridOperations& oper) : wxGridDirectionOperations(grid, oper) { } virtual bool IsAtBoundary(const wxGridCellCoords& coords) const wxOVERRIDE { wxASSERT_MSG( m_oper.Select(coords) >= 0, "invalid row/column" ); int pos = GetLinePos(coords); while ( pos ) { // Check the previous line. int line = GetLineAt(--pos); if ( IsLineVisible(line) ) { // There is another visible line before this one, hence it's // not at boundary. return false; } } // We reached the boundary without finding any visible lines. return true; } virtual void Advance(wxGridCellCoords& coords) const wxOVERRIDE { int pos = GetLinePos(coords); for ( ;; ) { // This is not supposed to happen if IsAtBoundary() returned false. wxCHECK_RET( pos, "can't advance when already at boundary" ); int line = GetLineAt(--pos); if ( IsLineVisible(line) ) { m_oper.Set(coords, line); break; } } } virtual int MoveByPixelDistance(int line, int distance) const wxOVERRIDE { int pos = m_oper.GetLineStartPos(m_grid, line); return m_oper.PosToLine(m_grid, pos - distance + 1, true); } }; // Please refer to the comments above when reading this class code, it's // absolutely symmetrical to wxGridBackwardOperations. class wxGridForwardOperations : public wxGridDirectionOperations { public: wxGridForwardOperations(wxGrid *grid, const wxGridOperations& oper) : wxGridDirectionOperations(grid, oper), m_numLines(oper.GetNumberOfLines(grid)) { } virtual bool IsAtBoundary(const wxGridCellCoords& coords) const wxOVERRIDE { wxASSERT_MSG( m_oper.Select(coords) < m_numLines, "invalid row/column" ); int pos = GetLinePos(coords); while ( pos < m_numLines - 1 ) { int line = GetLineAt(++pos); if ( IsLineVisible(line) ) return false; } return true; } virtual void Advance(wxGridCellCoords& coords) const wxOVERRIDE { int pos = GetLinePos(coords); for ( ;; ) { wxCHECK_RET( pos < m_numLines - 1, "can't advance when already at boundary" ); int line = GetLineAt(++pos); if ( IsLineVisible(line) ) { m_oper.Set(coords, line); break; } } } virtual int MoveByPixelDistance(int line, int distance) const wxOVERRIDE { int pos = m_oper.GetLineStartPos(m_grid, line); return m_oper.PosToLine(m_grid, pos + distance, true); } private: const int m_numLines; }; // ---------------------------------------------------------------------------- // data structures used for the data type registry // ---------------------------------------------------------------------------- struct wxGridDataTypeInfo { wxGridDataTypeInfo(const wxString& typeName, wxGridCellRenderer* renderer, wxGridCellEditor* editor) : m_typeName(typeName), m_renderer(renderer), m_editor(editor) {} ~wxGridDataTypeInfo() { wxSafeDecRef(m_renderer); wxSafeDecRef(m_editor); } wxString m_typeName; wxGridCellRenderer* m_renderer; wxGridCellEditor* m_editor; wxDECLARE_NO_COPY_CLASS(wxGridDataTypeInfo); }; WX_DEFINE_ARRAY_WITH_DECL_PTR(wxGridDataTypeInfo*, wxGridDataTypeInfoArray, class WXDLLIMPEXP_ADV); class WXDLLIMPEXP_ADV wxGridTypeRegistry { public: wxGridTypeRegistry() {} ~wxGridTypeRegistry(); void RegisterDataType(const wxString& typeName, wxGridCellRenderer* renderer, wxGridCellEditor* editor); // find one of already registered data types int FindRegisteredDataType(const wxString& typeName); // try to FindRegisteredDataType(), if this fails and typeName is one of // standard typenames, register it and return its index int FindDataType(const wxString& typeName); // try to FindDataType(), if it fails see if it is not one of already // registered data types with some params in which case clone the // registered data type and set params for it int FindOrCloneDataType(const wxString& typeName); wxGridCellRenderer* GetRenderer(int index); wxGridCellEditor* GetEditor(int index); private: wxGridDataTypeInfoArray m_typeinfo; }; #endif // wxUSE_GRID #endif // _WX_GENERIC_GRID_PRIVATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/textmeasure.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/textmeasure.h // Purpose: Generic wxTextMeasure declaration. // Author: Vadim Zeitlin // Created: 2012-10-17 // Copyright: (c) 1997-2012 wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_PRIVATE_TEXTMEASURE_H_ #define _WX_GENERIC_PRIVATE_TEXTMEASURE_H_ // ---------------------------------------------------------------------------- // wxTextMeasure for the platforms without native support. // ---------------------------------------------------------------------------- class wxTextMeasure : public wxTextMeasureBase { public: explicit wxTextMeasure(const wxDC *dc, const wxFont *font = NULL) : wxTextMeasureBase(dc, font) {} explicit wxTextMeasure(const wxWindow *win, const wxFont *font = NULL) : wxTextMeasureBase(win, font) {} protected: virtual void DoGetTextExtent(const wxString& string, wxCoord *width, wxCoord *height, wxCoord *descent = NULL, wxCoord *externalLeading = NULL); virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths, double scaleX); wxDECLARE_NO_COPY_CLASS(wxTextMeasure); }; #endif // _WX_GENERIC_PRIVATE_TEXTMEASURE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/generic/private/timer.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/generic/private/timer.h // Purpose: Generic implementation of wxTimer class // Author: Vaclav Slavik // Copyright: (c) Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERIC_PRIVATE_TIMER_H_ #define _WX_GENERIC_PRIVATE_TIMER_H_ #if wxUSE_TIMER #include "wx/private/timer.h" //----------------------------------------------------------------------------- // wxTimer //----------------------------------------------------------------------------- class wxTimerDesc; class WXDLLIMPEXP_BASE wxGenericTimerImpl : public wxTimerImpl { public: wxGenericTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { Init(); } virtual ~wxGenericTimerImpl(); virtual bool Start(int millisecs = -1, bool oneShot = false); virtual void Stop(); virtual bool IsRunning() const; // implementation static void NotifyTimers(); protected: void Init(); private: wxTimerDesc *m_desc; }; #endif // wxUSE_TIMER #endif // _WX_GENERIC_PRIVATE_TIMER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextprint.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextprint.h // Purpose: Rich text printing classes // Author: Julian Smart // Created: 2006-10-23 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTPRINT_H_ #define _WX_RICHTEXTPRINT_H_ #include "wx/defs.h" #if wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE #include "wx/richtext/richtextbuffer.h" #include "wx/print.h" #include "wx/printdlg.h" #define wxRICHTEXT_PRINT_MAX_PAGES 99999 // Header/footer page identifiers enum wxRichTextOddEvenPage { wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_ALL }; // Header/footer text locations enum wxRichTextPageLocation { wxRICHTEXT_PAGE_LEFT, wxRICHTEXT_PAGE_CENTRE, wxRICHTEXT_PAGE_RIGHT }; /*! * Header/footer data */ class WXDLLIMPEXP_RICHTEXT wxRichTextHeaderFooterData: public wxObject { public: wxRichTextHeaderFooterData() { Init(); } wxRichTextHeaderFooterData(const wxRichTextHeaderFooterData& data): wxObject() { Copy(data); } /// Initialise void Init() { m_headerMargin = 20; m_footerMargin = 20; m_showOnFirstPage = true; } /// Copy void Copy(const wxRichTextHeaderFooterData& data); /// Assignment void operator= (const wxRichTextHeaderFooterData& data) { Copy(data); } /// Set/get header text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT void SetHeaderText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); wxString GetHeaderText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; /// Set/get footer text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT void SetFooterText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); wxString GetFooterText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; /// Set/get text void SetText(const wxString& text, int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location); wxString GetText(int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location) const; /// Set/get margins between text and header or footer, in tenths of a millimeter void SetMargins(int headerMargin, int footerMargin) { m_headerMargin = headerMargin; m_footerMargin = footerMargin; } int GetHeaderMargin() const { return m_headerMargin; } int GetFooterMargin() const { return m_footerMargin; } /// Set/get whether to show header or footer on first page void SetShowOnFirstPage(bool showOnFirstPage) { m_showOnFirstPage = showOnFirstPage; } bool GetShowOnFirstPage() const { return m_showOnFirstPage; } /// Clear all text void Clear(); /// Set/get font void SetFont(const wxFont& font) { m_font = font; } const wxFont& GetFont() const { return m_font; } /// Set/get colour void SetTextColour(const wxColour& col) { m_colour = col; } const wxColour& GetTextColour() const { return m_colour; } wxDECLARE_CLASS(wxRichTextHeaderFooterData); private: // Strings for left, centre, right, top, bottom, odd, even wxString m_text[12]; wxFont m_font; wxColour m_colour; int m_headerMargin; int m_footerMargin; bool m_showOnFirstPage; }; /*! * wxRichTextPrintout */ class WXDLLIMPEXP_RICHTEXT wxRichTextPrintout : public wxPrintout { public: wxRichTextPrintout(const wxString& title = wxGetTranslation("Printout")); virtual ~wxRichTextPrintout(); /// The buffer to print void SetRichTextBuffer(wxRichTextBuffer* buffer) { m_richTextBuffer = buffer; } wxRichTextBuffer* GetRichTextBuffer() const { return m_richTextBuffer; } /// Set/get header/footer data void SetHeaderFooterData(const wxRichTextHeaderFooterData& data) { m_headerFooterData = data; } const wxRichTextHeaderFooterData& GetHeaderFooterData() const { return m_headerFooterData; } /// Sets margins in 10ths of millimetre. Defaults to 1 inch for margins. void SetMargins(int top = 254, int bottom = 254, int left = 254, int right = 254); /// Calculate scaling and rectangles, setting the device context scaling void CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& headerRect, wxRect& footerRect); // wxPrintout virtual functions virtual bool OnPrintPage(int page) wxOVERRIDE; virtual bool HasPage(int page) wxOVERRIDE; virtual void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) wxOVERRIDE; virtual bool OnBeginDocument(int startPage, int endPage) wxOVERRIDE; virtual void OnPreparePrinting() wxOVERRIDE; private: /// Renders one page into dc void RenderPage(wxDC *dc, int page); /// Substitute keywords static bool SubstituteKeywords(wxString& str, const wxString& title, int pageNum, int pageCount); private: wxRichTextBuffer* m_richTextBuffer; int m_numPages; wxArrayInt m_pageBreaksStart; wxArrayInt m_pageBreaksEnd; wxArrayInt m_pageYOffsets; int m_marginLeft, m_marginTop, m_marginRight, m_marginBottom; wxRichTextHeaderFooterData m_headerFooterData; wxDECLARE_NO_COPY_CLASS(wxRichTextPrintout); }; /* *! wxRichTextPrinting * A simple interface to perform wxRichTextBuffer printing. */ class WXDLLIMPEXP_RICHTEXT wxRichTextPrinting : public wxObject { public: wxRichTextPrinting(const wxString& name = wxGetTranslation("Printing"), wxWindow *parentWindow = NULL); virtual ~wxRichTextPrinting(); /// Preview the file or buffer #if wxUSE_FFILE && wxUSE_STREAMS bool PreviewFile(const wxString& richTextFile); #endif bool PreviewBuffer(const wxRichTextBuffer& buffer); /// Print the file or buffer #if wxUSE_FFILE && wxUSE_STREAMS bool PrintFile(const wxString& richTextFile, bool showPrintDialog = true); #endif bool PrintBuffer(const wxRichTextBuffer& buffer, bool showPrintDialog = true); /// Shows page setup dialog void PageSetup(); /// Set/get header/footer data void SetHeaderFooterData(const wxRichTextHeaderFooterData& data) { m_headerFooterData = data; } const wxRichTextHeaderFooterData& GetHeaderFooterData() const { return m_headerFooterData; } /// Set/get header text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT void SetHeaderText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); wxString GetHeaderText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; /// Set/get footer text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT void SetFooterText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); wxString GetFooterText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; /// Show header/footer on first page, or not void SetShowOnFirstPage(bool show) { m_headerFooterData.SetShowOnFirstPage(show); } /// Set the font void SetHeaderFooterFont(const wxFont& font) { m_headerFooterData.SetFont(font); } /// Set the colour void SetHeaderFooterTextColour(const wxColour& font) { m_headerFooterData.SetTextColour(font); } /// Get print and page setup data wxPrintData *GetPrintData(); wxPageSetupDialogData *GetPageSetupData() { return m_pageSetupData; } /// Set print and page setup data void SetPrintData(const wxPrintData& printData); void SetPageSetupData(const wxPageSetupDialogData& pageSetupData); /// Set the rich text buffer pointer, deleting the existing object if present void SetRichTextBufferPreview(wxRichTextBuffer* buf); wxRichTextBuffer* GetRichTextBufferPreview() const { return m_richTextBufferPreview; } void SetRichTextBufferPrinting(wxRichTextBuffer* buf); wxRichTextBuffer* GetRichTextBufferPrinting() const { return m_richTextBufferPrinting; } /// Set/get the parent window void SetParentWindow(wxWindow* parent) { m_parentWindow = parent; } wxWindow* GetParentWindow() const { return m_parentWindow; } /// Set/get the title void SetTitle(const wxString& title) { m_title = title; } const wxString& GetTitle() const { return m_title; } /// Set/get the preview rect void SetPreviewRect(const wxRect& rect) { m_previewRect = rect; } const wxRect& GetPreviewRect() const { return m_previewRect; } protected: virtual wxRichTextPrintout *CreatePrintout(); virtual bool DoPreview(wxRichTextPrintout *printout1, wxRichTextPrintout *printout2); virtual bool DoPrint(wxRichTextPrintout *printout, bool showPrintDialog); private: wxPrintData* m_printData; wxPageSetupDialogData* m_pageSetupData; wxRichTextHeaderFooterData m_headerFooterData; wxString m_title; wxWindow* m_parentWindow; wxRichTextBuffer* m_richTextBufferPreview; wxRichTextBuffer* m_richTextBufferPrinting; wxRect m_previewRect; wxDECLARE_NO_COPY_CLASS(wxRichTextPrinting); }; #endif // wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE #endif // _WX_RICHTEXTPRINT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextmarginspage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextmarginspage.h // Purpose: Declares the rich text formatting dialog margins page. // Author: Julian Smart // Modified by: // Created: 20/10/2010 10:27:34 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTMARGINSPAGE_H_ #define _RICHTEXTMARGINSPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes #include "wx/statline.h" ////@end includes /*! * Forward declarations */ ////@begin forward declarations ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTMARGINSPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTMARGINSPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTMARGINSPAGE_IDNAME ID_WXRICHTEXTMARGINSPAGE #define SYMBOL_WXRICHTEXTMARGINSPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTMARGINSPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextMarginsPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextMarginsPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextMarginsPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextMarginsPage(); wxRichTextMarginsPage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTMARGINSPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTMARGINSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTMARGINSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTMARGINSPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTMARGINSPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTMARGINSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTMARGINSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTMARGINSPAGE_STYLE ); /// Destructor ~wxRichTextMarginsPage(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); /// Gets the attributes from the formatting dialog wxRichTextAttr* GetAttributes(); /// Data transfer virtual bool TransferDataToWindow() wxOVERRIDE; virtual bool TransferDataFromWindow() wxOVERRIDE; ////@begin wxRichTextMarginsPage event handler declarations /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_MARGIN void OnRichtextLeftMarginUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_MARGIN void OnRichtextRightMarginUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_MARGIN void OnRichtextTopMarginUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_MARGIN void OnRichtextBottomMarginUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_PADDING void OnRichtextLeftPaddingUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_PADDING void OnRichtextRightPaddingUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_PADDING void OnRichtextTopPaddingUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_PADDING void OnRichtextBottomPaddingUpdate( wxUpdateUIEvent& event ); ////@end wxRichTextMarginsPage event handler declarations ////@begin wxRichTextMarginsPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextMarginsPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextMarginsPage member variables wxCheckBox* m_leftMarginCheckbox; wxTextCtrl* m_marginLeft; wxComboBox* m_unitsMarginLeft; wxCheckBox* m_rightMarginCheckbox; wxTextCtrl* m_marginRight; wxComboBox* m_unitsMarginRight; wxCheckBox* m_topMarginCheckbox; wxTextCtrl* m_marginTop; wxComboBox* m_unitsMarginTop; wxCheckBox* m_bottomMarginCheckbox; wxTextCtrl* m_marginBottom; wxComboBox* m_unitsMarginBottom; wxCheckBox* m_leftPaddingCheckbox; wxTextCtrl* m_paddingLeft; wxComboBox* m_unitsPaddingLeft; wxCheckBox* m_rightPaddingCheckbox; wxTextCtrl* m_paddingRight; wxComboBox* m_unitsPaddingRight; wxCheckBox* m_topPaddingCheckbox; wxTextCtrl* m_paddingTop; wxComboBox* m_unitsPaddingTop; wxCheckBox* m_bottomPaddingCheckbox; wxTextCtrl* m_paddingBottom; wxComboBox* m_unitsPaddingBottom; /// Control identifiers enum { ID_WXRICHTEXTMARGINSPAGE = 10750, ID_RICHTEXT_LEFT_MARGIN_CHECKBOX = 10751, ID_RICHTEXT_LEFT_MARGIN = 10752, ID_RICHTEXT_LEFT_MARGIN_UNITS = 10753, ID_RICHTEXT_RIGHT_MARGIN_CHECKBOX = 10754, ID_RICHTEXT_RIGHT_MARGIN = 10755, ID_RICHTEXT_RIGHT_MARGIN_UNITS = 10756, ID_RICHTEXT_TOP_MARGIN_CHECKBOX = 10757, ID_RICHTEXT_TOP_MARGIN = 10758, ID_RICHTEXT_TOP_MARGIN_UNITS = 10759, ID_RICHTEXT_BOTTOM_MARGIN_CHECKBOX = 10760, ID_RICHTEXT_BOTTOM_MARGIN = 10761, ID_RICHTEXT_BOTTOM_MARGIN_UNITS = 10762, ID_RICHTEXT_LEFT_PADDING_CHECKBOX = 10763, ID_RICHTEXT_LEFT_PADDING = 10764, ID_RICHTEXT_LEFT_PADDING_UNITS = 10765, ID_RICHTEXT_RIGHT_PADDING_CHECKBOX = 10766, ID_RICHTEXT_RIGHT_PADDING = 10767, ID_RICHTEXT_RIGHT_PADDING_UNITS = 10768, ID_RICHTEXT_TOP_PADDING_CHECKBOX = 10769, ID_RICHTEXT_TOP_PADDING = 10770, ID_RICHTEXT_TOP_PADDING_UNITS = 10771, ID_RICHTEXT_BOTTOM_PADDING_CHECKBOX = 10772, ID_RICHTEXT_BOTTOM_PADDING = 10773, ID_RICHTEXT_BOTTOM_PADDING_UNITS = 10774 }; ////@end wxRichTextMarginsPage member variables bool m_ignoreUpdates; }; #endif // _RICHTEXTMARGINSPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextformatdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextformatdlg.h // Purpose: Formatting dialog for wxRichTextCtrl // Author: Julian Smart // Modified by: // Created: 2006-10-01 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTFORMATDLG_H_ #define _WX_RICHTEXTFORMATDLG_H_ /*! * Includes */ #include "wx/defs.h" #if wxUSE_RICHTEXT #include "wx/propdlg.h" #include "wx/bookctrl.h" #include "wx/withimages.h" #include "wx/colourdata.h" #if wxUSE_HTML #include "wx/htmllbox.h" #endif #include "wx/richtext/richtextbuffer.h" #include "wx/richtext/richtextstyles.h" #include "wx/richtext/richtextuicustomization.h" class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFormattingDialog; class WXDLLIMPEXP_FWD_CORE wxComboBox; class WXDLLIMPEXP_FWD_CORE wxCheckBox; /*! * Flags determining the pages and buttons to be created in the dialog */ #define wxRICHTEXT_FORMAT_STYLE_EDITOR 0x0001 #define wxRICHTEXT_FORMAT_FONT 0x0002 #define wxRICHTEXT_FORMAT_TABS 0x0004 #define wxRICHTEXT_FORMAT_BULLETS 0x0008 #define wxRICHTEXT_FORMAT_INDENTS_SPACING 0x0010 #define wxRICHTEXT_FORMAT_LIST_STYLE 0x0020 #define wxRICHTEXT_FORMAT_MARGINS 0x0040 #define wxRICHTEXT_FORMAT_SIZE 0x0080 #define wxRICHTEXT_FORMAT_BORDERS 0x0100 #define wxRICHTEXT_FORMAT_BACKGROUND 0x0200 #define wxRICHTEXT_FORMAT_HELP_BUTTON 0x1000 /*! * Indices for bullet styles in list control */ enum { wxRICHTEXT_BULLETINDEX_NONE = 0, wxRICHTEXT_BULLETINDEX_ARABIC, wxRICHTEXT_BULLETINDEX_UPPER_CASE, wxRICHTEXT_BULLETINDEX_LOWER_CASE, wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN, wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN, wxRICHTEXT_BULLETINDEX_OUTLINE, wxRICHTEXT_BULLETINDEX_SYMBOL, wxRICHTEXT_BULLETINDEX_BITMAP, wxRICHTEXT_BULLETINDEX_STANDARD }; /*! * Shorthand for common combinations of pages */ #define wxRICHTEXT_FORMAT_PARAGRAPH (wxRICHTEXT_FORMAT_INDENTS_SPACING | wxRICHTEXT_FORMAT_BULLETS | wxRICHTEXT_FORMAT_TABS | wxRICHTEXT_FORMAT_FONT) #define wxRICHTEXT_FORMAT_CHARACTER (wxRICHTEXT_FORMAT_FONT) #define wxRICHTEXT_FORMAT_STYLE (wxRICHTEXT_FORMAT_PARAGRAPH | wxRICHTEXT_FORMAT_STYLE_EDITOR) /*! * Factory for formatting dialog */ class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialogFactory: public wxObject { public: wxRichTextFormattingDialogFactory() {} virtual ~wxRichTextFormattingDialogFactory() {} // Overridables /// Create all pages, under the dialog's book control, also calling AddPage virtual bool CreatePages(long pages, wxRichTextFormattingDialog* dialog); /// Create a page, given a page identifier virtual wxPanel* CreatePage(int page, wxString& title, wxRichTextFormattingDialog* dialog); /// Enumerate all available page identifiers virtual int GetPageId(int i) const; /// Get the number of available page identifiers virtual int GetPageIdCount() const; /// Get the image index for the given page identifier virtual int GetPageImage(int WXUNUSED(id)) const { return -1; } /// Invoke help for the dialog virtual bool ShowHelp(int page, wxRichTextFormattingDialog* dialog); /// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create virtual bool SetSheetStyle(wxRichTextFormattingDialog* dialog); /// Create the main dialog buttons virtual bool CreateButtons(wxRichTextFormattingDialog* dialog); }; /*! * Formatting dialog for a wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog, public wxWithImages { wxDECLARE_CLASS(wxRichTextFormattingDialog); DECLARE_HELP_PROVISION() public: enum { Option_AllowPixelFontSize = 0x0001 }; wxRichTextFormattingDialog() { Init(); } wxRichTextFormattingDialog(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE) { Init(); Create(flags, parent, title, id, pos, sz, style); } ~wxRichTextFormattingDialog(); void Init(); bool Create(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); /// Get attributes from the given range virtual bool GetStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range); /// Set the attributes and optionally update the display virtual bool SetStyle(const wxRichTextAttr& style, bool update = true); /// Set the style definition and optionally update the display virtual bool SetStyleDefinition(const wxRichTextStyleDefinition& styleDef, wxRichTextStyleSheet* sheet, bool update = true); /// Get the style definition, if any virtual wxRichTextStyleDefinition* GetStyleDefinition() const { return m_styleDefinition; } /// Get the style sheet, if any virtual wxRichTextStyleSheet* GetStyleSheet() const { return m_styleSheet; } /// Update the display virtual bool UpdateDisplay(); /// Apply attributes to the given range virtual bool ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE); /// Apply attributes to the object being edited, if any virtual bool ApplyStyle(wxRichTextCtrl* ctrl, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); /// Gets and sets the attributes const wxRichTextAttr& GetAttributes() const { return m_attributes; } wxRichTextAttr& GetAttributes() { return m_attributes; } void SetAttributes(const wxRichTextAttr& attr) { m_attributes = attr; } /// Sets the dialog options, determining what the interface presents to the user. /// Currently the only option is Option_AllowPixelFontSize. void SetOptions(int options) { m_options = options; } /// Gets the dialog options, determining what the interface presents to the user. /// Currently the only option is Option_AllowPixelFontSize. int GetOptions() const { return m_options; } /// Returns @true if the given option is present. bool HasOption(int option) const { return (m_options & option) != 0; } /// If editing the attributes for a particular object, such as an image, /// set the object so the code can initialize attributes such as size correctly. wxRichTextObject* GetObject() const { return m_object; } void SetObject(wxRichTextObject* obj) { m_object = obj; } /// Transfers the data and from to the window virtual bool TransferDataToWindow() wxOVERRIDE; virtual bool TransferDataFromWindow() wxOVERRIDE; /// Apply the styles when a different tab is selected, so the previews are /// up to date void OnTabChanged(wxBookCtrlEvent& event); /// Respond to help command void OnHelp(wxCommandEvent& event); void OnUpdateHelp(wxUpdateUIEvent& event); /// Get/set formatting factory object static void SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory); static wxRichTextFormattingDialogFactory* GetFormattingDialogFactory() { return ms_FormattingDialogFactory; } /// Helper for pages to get the top-level dialog static wxRichTextFormattingDialog* GetDialog(wxWindow* win); /// Helper for pages to get the attributes static wxRichTextAttr* GetDialogAttributes(wxWindow* win); /// Helper for pages to get the reset attributes static wxRichTextAttr* GetDialogResetAttributes(wxWindow* win); /// Helper for pages to get the style static wxRichTextStyleDefinition* GetDialogStyleDefinition(wxWindow* win); /// Should we show tooltips? static bool ShowToolTips() { return sm_showToolTips; } /// Determines whether tooltips will be shown static void SetShowToolTips(bool show) { sm_showToolTips = show; } /// Set the dimension into the value and units controls. Optionally pass units to /// specify the ordering of units in the combobox. static void SetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox, wxArrayInt* units = NULL); /// Get the dimension from the value and units controls Optionally pass units to /// specify the ordering of units in the combobox. static void GetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox, wxArrayInt* units = NULL); /// Convert from a string to a dimension integer. static bool ConvertFromString(const wxString& str, int& ret, int unit); /// Map book control page index to our page id void AddPageId(int id) { m_pageIds.Add(id); } /// Find a page by class wxWindow* FindPage(wxClassInfo* info) const; /// Whether to restore the last-selected page. static bool GetRestoreLastPage() { return sm_restoreLastPage; } static void SetRestoreLastPage(bool b) { sm_restoreLastPage = b; } /// The page identifier of the last page selected (not the control id) static int GetLastPage() { return sm_lastPage; } static void SetLastPage(int lastPage) { sm_lastPage = lastPage; } /// Sets the custom colour data for use by the colour dialog. static void SetColourData(const wxColourData& colourData) { sm_colourData = colourData; } /// Returns the custom colour data for use by the colour dialog. static wxColourData GetColourData() { return sm_colourData; } protected: wxRichTextAttr m_attributes; wxRichTextStyleDefinition* m_styleDefinition; wxRichTextStyleSheet* m_styleSheet; wxRichTextObject* m_object; wxArrayInt m_pageIds; // mapping of book control indexes to page ids int m_options; // UI options bool m_ignoreUpdates; static wxColourData sm_colourData; static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory; static bool sm_showToolTips; static bool sm_restoreLastPage; static int sm_lastPage; wxDECLARE_EVENT_TABLE(); }; //----------------------------------------------------------------------------- // helper class - wxRichTextFontPreviewCtrl //----------------------------------------------------------------------------- class WXDLLIMPEXP_RICHTEXT wxRichTextFontPreviewCtrl : public wxWindow { public: wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0); void SetTextEffects(int effects) { m_textEffects = effects; } int GetTextEffects() const { return m_textEffects; } private: int m_textEffects; void OnPaint(wxPaintEvent& event); wxDECLARE_EVENT_TABLE(); }; /* * A control for displaying a small preview of a colour or bitmap */ class WXDLLIMPEXP_RICHTEXT wxRichTextColourSwatchCtrl: public wxControl { wxDECLARE_CLASS(wxRichTextColourSwatchCtrl); public: wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); ~wxRichTextColourSwatchCtrl(); void OnMouseEvent(wxMouseEvent& event); void SetColour(const wxColour& colour) { m_colour = colour; SetBackgroundColour(m_colour); } wxColour& GetColour() { return m_colour; } virtual wxSize DoGetBestSize() const wxOVERRIDE { return GetSize(); } protected: wxColour m_colour; wxDECLARE_EVENT_TABLE(); }; /*! * wxRichTextFontListBox class declaration * A listbox to display fonts. */ class WXDLLIMPEXP_RICHTEXT wxRichTextFontListBox: public wxHtmlListBox { wxDECLARE_CLASS(wxRichTextFontListBox); wxDECLARE_EVENT_TABLE(); public: wxRichTextFontListBox() { Init(); } wxRichTextFontListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); virtual ~wxRichTextFontListBox(); void Init() { } bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Creates a suitable HTML fragment for a font wxString CreateHTML(const wxString& facename) const; /// Get font name for index wxString GetFaceName(size_t i) const ; /// Set selection for string, returning the index. int SetFaceNameSelection(const wxString& name); /// Updates the font list void UpdateFonts(); /// Does this face name exist? bool HasFaceName(const wxString& faceName) const { return m_faceNames.Index(faceName) != wxNOT_FOUND; } /// Returns the array of face names const wxArrayString& GetFaceNames() const { return m_faceNames; } protected: /// Returns the HTML for this item virtual wxString OnGetItem(size_t n) const wxOVERRIDE; private: wxArrayString m_faceNames; }; #endif // wxUSE_RICHTEXT #endif // _WX_RICHTEXTFORMATDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtexthtml.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtexthtml.h // Purpose: HTML I/O for wxRichTextCtrl // Author: Julian Smart // Modified by: // Created: 2005-09-30 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTHTML_H_ #define _WX_RICHTEXTHTML_H_ /*! * Includes */ #include "wx/richtext/richtextbuffer.h" // Use CSS styles where applicable, otherwise use non-CSS workarounds #define wxRICHTEXT_HANDLER_USE_CSS 0x1000 /*! * wxRichTextHTMLHandler */ class WXDLLIMPEXP_RICHTEXT wxRichTextHTMLHandler: public wxRichTextFileHandler { wxDECLARE_DYNAMIC_CLASS(wxRichTextHTMLHandler); public: wxRichTextHTMLHandler(const wxString& name = wxT("HTML"), const wxString& ext = wxT("html"), int type = wxRICHTEXT_TYPE_HTML); /// Can we save using this handler? virtual bool CanSave() const wxOVERRIDE { return true; } /// Can we load using this handler? virtual bool CanLoad() const wxOVERRIDE { return false; } /// Can we handle this filename (if using files)? By default, checks the extension. virtual bool CanHandle(const wxString& filename) const wxOVERRIDE; // Accessors and operations unique to this handler /// Set and get the list of image locations generated by the last operation void SetTemporaryImageLocations(const wxArrayString& locations) { m_imageLocations = locations; } const wxArrayString& GetTemporaryImageLocations() const { return m_imageLocations; } /// Clear the image locations generated by the last operation void ClearTemporaryImageLocations() { m_imageLocations.Clear(); } /// Delete the in-memory or temporary files generated by the last operation bool DeleteTemporaryImages(); /// Delete the in-memory or temporary files generated by the last operation. This is a static /// function that can be used to delete the saved locations from an earlier operation, /// for example after the user has viewed the HTML file. static bool DeleteTemporaryImages(int flags, const wxArrayString& imageLocations); /// Reset the file counter, in case, for example, the same names are required each time static void SetFileCounter(int counter) { sm_fileCounter = counter; } /// Set and get the directory for storing temporary files. If empty, the system /// temporary directory will be used. void SetTempDir(const wxString& tempDir) { m_tempDir = tempDir; } const wxString& GetTempDir() const { return m_tempDir; } /// Set and get mapping from point size to HTML font size. There should be 7 elements, /// one for each HTML font size, each element specifying the maximum point size for that /// HTML font size. E.g. 8, 10, 13, 17, 22, 29, 100 void SetFontSizeMapping(const wxArrayInt& fontSizeMapping) { m_fontSizeMapping = fontSizeMapping; } wxArrayInt GetFontSizeMapping() const { return m_fontSizeMapping; } protected: // Implementation #if wxUSE_STREAMS virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) wxOVERRIDE; virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) wxOVERRIDE; /// Output character formatting void BeginCharacterFormatting(const wxRichTextAttr& currentStyle, const wxRichTextAttr& thisStyle, const wxRichTextAttr& paraStyle, wxTextOutputStream& stream ); void EndCharacterFormatting(const wxRichTextAttr& currentStyle, const wxRichTextAttr& thisStyle, const wxRichTextAttr& paraStyle, wxTextOutputStream& stream ); /// Output paragraph formatting void BeginParagraphFormatting(const wxRichTextAttr& currentStyle, const wxRichTextAttr& thisStyle, wxTextOutputStream& stream); void EndParagraphFormatting(const wxRichTextAttr& currentStyle, const wxRichTextAttr& thisStyle, wxTextOutputStream& stream); /// Output font tag void OutputFont(const wxRichTextAttr& style, wxTextOutputStream& stream); /// Closes lists to level (-1 means close all) void CloseLists(int level, wxTextOutputStream& str); /// Writes an image to its base64 equivalent, or to the memory filesystem, or to a file void WriteImage(wxRichTextImage* image, wxOutputStream& stream); /// Converts from pt to size property compatible height long PtToSize(long size); /// Typical base64 encoder wxChar* b64enc(unsigned char* input, size_t in_len); /// Gets the mime type of the given wxBITMAP_TYPE const wxChar* GetMimeType(int imageType); /// Gets the html equivalent of the specified value wxString GetAlignment(const wxRichTextAttr& thisStyle); /// Generates &nbsp; array for indentations wxString SymbolicIndent(long indent); /// Finds the html equivalent of the specified bullet int TypeOfList(const wxRichTextAttr& thisStyle, wxString& tag); #endif // Data members wxRichTextBuffer* m_buffer; /// Indentation values of the table tags wxArrayInt m_indents; /// Stack of list types: 0 = ol, 1 = ul wxArrayInt m_listTypes; /// Is there any opened font tag? bool m_font; /// Are we in a table? bool m_inTable; /// A list of the image files or in-memory images created by the last operation. wxArrayString m_imageLocations; /// A location for the temporary files wxString m_tempDir; /// A mapping from point size to HTML font size wxArrayInt m_fontSizeMapping; /// A counter for generating filenames static int sm_fileCounter; }; #endif // _WX_RICHTEXTXML_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextstyles.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextstyles.h // Purpose: Style management for wxRichTextCtrl // Author: Julian Smart // Modified by: // Created: 2005-09-30 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTSTYLES_H_ #define _WX_RICHTEXTSTYLES_H_ /*! * Includes */ #include "wx/defs.h" #if wxUSE_RICHTEXT #include "wx/richtext/richtextbuffer.h" #if wxUSE_HTML #include "wx/htmllbox.h" #endif #if wxUSE_COMBOCTRL #include "wx/combo.h" #endif #include "wx/choice.h" /*! * Forward declarations */ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; /*! * wxRichTextStyleDefinition class declaration * A base class for paragraph and character styles. */ class WXDLLIMPEXP_RICHTEXT wxRichTextStyleDefinition: public wxObject { wxDECLARE_CLASS(wxRichTextStyleDefinition); public: /// Copy constructors wxRichTextStyleDefinition(const wxRichTextStyleDefinition& def) : wxObject() { Init(); Copy(def); } /// Default constructor wxRichTextStyleDefinition(const wxString& name = wxEmptyString) { Init(); m_name = name; } /// Destructor virtual ~wxRichTextStyleDefinition() {} /// Initialises members void Init() {} /// Copies from def void Copy(const wxRichTextStyleDefinition& def); /// Equality test bool Eq(const wxRichTextStyleDefinition& def) const; /// Assignment operator void operator =(const wxRichTextStyleDefinition& def) { Copy(def); } /// Equality operator bool operator ==(const wxRichTextStyleDefinition& def) const { return Eq(def); } /// Override to clone the object virtual wxRichTextStyleDefinition* Clone() const = 0; /// Sets and gets the name of the style void SetName(const wxString& name) { m_name = name; } const wxString& GetName() const { return m_name; } /// Sets and gets the style description void SetDescription(const wxString& descr) { m_description = descr; } const wxString& GetDescription() const { return m_description; } /// Sets and gets the name of the style that this style is based on void SetBaseStyle(const wxString& name) { m_baseStyle = name; } const wxString& GetBaseStyle() const { return m_baseStyle; } /// Sets and gets the style void SetStyle(const wxRichTextAttr& style) { m_style = style; } const wxRichTextAttr& GetStyle() const { return m_style; } wxRichTextAttr& GetStyle() { return m_style; } /// Gets the style combined with the base style virtual wxRichTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const; /** Returns the definition's properties. */ wxRichTextProperties& GetProperties() { return m_properties; } /** Returns the definition's properties. */ const wxRichTextProperties& GetProperties() const { return m_properties; } /** Sets the definition's properties. */ void SetProperties(const wxRichTextProperties& props) { m_properties = props; } protected: wxString m_name; wxString m_baseStyle; wxString m_description; wxRichTextAttr m_style; wxRichTextProperties m_properties; }; /*! * wxRichTextCharacterStyleDefinition class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextCharacterStyleDefinition: public wxRichTextStyleDefinition { wxDECLARE_DYNAMIC_CLASS(wxRichTextCharacterStyleDefinition); public: /// Copy constructor wxRichTextCharacterStyleDefinition(const wxRichTextCharacterStyleDefinition& def): wxRichTextStyleDefinition(def) {} /// Default constructor wxRichTextCharacterStyleDefinition(const wxString& name = wxEmptyString): wxRichTextStyleDefinition(name) {} /// Destructor virtual ~wxRichTextCharacterStyleDefinition() {} /// Clones the object virtual wxRichTextStyleDefinition* Clone() const wxOVERRIDE { return new wxRichTextCharacterStyleDefinition(*this); } protected: }; /*! * wxRichTextParagraphStyleDefinition class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextParagraphStyleDefinition: public wxRichTextStyleDefinition { wxDECLARE_DYNAMIC_CLASS(wxRichTextParagraphStyleDefinition); public: /// Copy constructor wxRichTextParagraphStyleDefinition(const wxRichTextParagraphStyleDefinition& def): wxRichTextStyleDefinition(def) { m_nextStyle = def.m_nextStyle; } /// Default constructor wxRichTextParagraphStyleDefinition(const wxString& name = wxEmptyString): wxRichTextStyleDefinition(name) {} // Destructor virtual ~wxRichTextParagraphStyleDefinition() {} /// Sets and gets the next style void SetNextStyle(const wxString& name) { m_nextStyle = name; } const wxString& GetNextStyle() const { return m_nextStyle; } /// Copies from def void Copy(const wxRichTextParagraphStyleDefinition& def); /// Assignment operator void operator =(const wxRichTextParagraphStyleDefinition& def) { Copy(def); } /// Equality operator bool operator ==(const wxRichTextParagraphStyleDefinition& def) const; /// Clones the object virtual wxRichTextStyleDefinition* Clone() const wxOVERRIDE { return new wxRichTextParagraphStyleDefinition(*this); } protected: /// The next style to use when adding a paragraph after this style. wxString m_nextStyle; }; /*! * wxRichTextListStyleDefinition class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextListStyleDefinition: public wxRichTextParagraphStyleDefinition { wxDECLARE_DYNAMIC_CLASS(wxRichTextListStyleDefinition); public: /// Copy constructor wxRichTextListStyleDefinition(const wxRichTextListStyleDefinition& def): wxRichTextParagraphStyleDefinition(def) { Init(); Copy(def); } /// Default constructor wxRichTextListStyleDefinition(const wxString& name = wxEmptyString): wxRichTextParagraphStyleDefinition(name) { Init(); } /// Destructor virtual ~wxRichTextListStyleDefinition() {} /// Copies from def void Copy(const wxRichTextListStyleDefinition& def); /// Assignment operator void operator =(const wxRichTextListStyleDefinition& def) { Copy(def); } /// Equality operator bool operator ==(const wxRichTextListStyleDefinition& def) const; /// Clones the object virtual wxRichTextStyleDefinition* Clone() const wxOVERRIDE { return new wxRichTextListStyleDefinition(*this); } /// Sets/gets the attributes for the given level void SetLevelAttributes(int i, const wxRichTextAttr& attr); wxRichTextAttr* GetLevelAttributes(int i); const wxRichTextAttr* GetLevelAttributes(int i) const; /// Convenience function for setting the major attributes for a list level specification void SetAttributes(int i, int leftIndent, int leftSubIndent, int bulletStyle, const wxString& bulletSymbol = wxEmptyString); /// Finds the level corresponding to the given indentation int FindLevelForIndent(int indent) const; /// Combine the base and list style with a paragraph style, using the given indent (from which /// an appropriate level is found) wxRichTextAttr CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle, wxRichTextStyleSheet* styleSheet = NULL); /// Combine the base and list style, using the given indent (from which /// an appropriate level is found) wxRichTextAttr GetCombinedStyle(int indent, wxRichTextStyleSheet* styleSheet = NULL); /// Combine the base and list style, using the given level from which /// an appropriate level is found) wxRichTextAttr GetCombinedStyleForLevel(int level, wxRichTextStyleSheet* styleSheet = NULL); /// Gets the number of available levels int GetLevelCount() const { return 10; } /// Is this a numbered list? bool IsNumbered(int i) const; protected: /// The styles for each level (up to 10) wxRichTextAttr m_levelStyles[10]; }; /*! * wxRichTextBoxStyleDefinition class declaration, for box attributes in objects such as wxRichTextBox. */ class WXDLLIMPEXP_RICHTEXT wxRichTextBoxStyleDefinition: public wxRichTextStyleDefinition { wxDECLARE_DYNAMIC_CLASS(wxRichTextBoxStyleDefinition); public: /// Copy constructor wxRichTextBoxStyleDefinition(const wxRichTextBoxStyleDefinition& def): wxRichTextStyleDefinition(def) { Copy(def); } /// Default constructor wxRichTextBoxStyleDefinition(const wxString& name = wxEmptyString): wxRichTextStyleDefinition(name) {} // Destructor virtual ~wxRichTextBoxStyleDefinition() {} /// Copies from def void Copy(const wxRichTextBoxStyleDefinition& def); /// Assignment operator void operator =(const wxRichTextBoxStyleDefinition& def) { Copy(def); } /// Equality operator bool operator ==(const wxRichTextBoxStyleDefinition& def) const; /// Clones the object virtual wxRichTextStyleDefinition* Clone() const wxOVERRIDE { return new wxRichTextBoxStyleDefinition(*this); } protected: }; /*! * The style sheet */ class WXDLLIMPEXP_RICHTEXT wxRichTextStyleSheet: public wxObject { wxDECLARE_CLASS(wxRichTextStyleSheet); public: /// Constructors wxRichTextStyleSheet(const wxRichTextStyleSheet& sheet) : wxObject() { Init(); Copy(sheet); } wxRichTextStyleSheet() { Init(); } virtual ~wxRichTextStyleSheet(); /// Initialisation void Init(); /// Copy void Copy(const wxRichTextStyleSheet& sheet); /// Assignment void operator=(const wxRichTextStyleSheet& sheet) { Copy(sheet); } /// Equality bool operator==(const wxRichTextStyleSheet& sheet) const; /// Add a definition to the character style list bool AddCharacterStyle(wxRichTextCharacterStyleDefinition* def); /// Add a definition to the paragraph style list bool AddParagraphStyle(wxRichTextParagraphStyleDefinition* def); /// Add a definition to the list style list bool AddListStyle(wxRichTextListStyleDefinition* def); /// Add a definition to the box style list bool AddBoxStyle(wxRichTextBoxStyleDefinition* def); /// Add a definition to the appropriate style list bool AddStyle(wxRichTextStyleDefinition* def); /// Remove a character style bool RemoveCharacterStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_characterStyleDefinitions, def, deleteStyle); } /// Remove a paragraph style bool RemoveParagraphStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_paragraphStyleDefinitions, def, deleteStyle); } /// Remove a list style bool RemoveListStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_listStyleDefinitions, def, deleteStyle); } /// Remove a box style bool RemoveBoxStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_boxStyleDefinitions, def, deleteStyle); } /// Remove a style bool RemoveStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false); /// Find a character definition by name wxRichTextCharacterStyleDefinition* FindCharacterStyle(const wxString& name, bool recurse = true) const { return (wxRichTextCharacterStyleDefinition*) FindStyle(m_characterStyleDefinitions, name, recurse); } /// Find a paragraph definition by name wxRichTextParagraphStyleDefinition* FindParagraphStyle(const wxString& name, bool recurse = true) const { return (wxRichTextParagraphStyleDefinition*) FindStyle(m_paragraphStyleDefinitions, name, recurse); } /// Find a list definition by name wxRichTextListStyleDefinition* FindListStyle(const wxString& name, bool recurse = true) const { return (wxRichTextListStyleDefinition*) FindStyle(m_listStyleDefinitions, name, recurse); } /// Find a box definition by name wxRichTextBoxStyleDefinition* FindBoxStyle(const wxString& name, bool recurse = true) const { return (wxRichTextBoxStyleDefinition*) FindStyle(m_boxStyleDefinitions, name, recurse); } /// Find any definition by name wxRichTextStyleDefinition* FindStyle(const wxString& name, bool recurse = true) const; /// Return the number of character styles size_t GetCharacterStyleCount() const { return m_characterStyleDefinitions.GetCount(); } /// Return the number of paragraph styles size_t GetParagraphStyleCount() const { return m_paragraphStyleDefinitions.GetCount(); } /// Return the number of list styles size_t GetListStyleCount() const { return m_listStyleDefinitions.GetCount(); } /// Return the number of box styles size_t GetBoxStyleCount() const { return m_boxStyleDefinitions.GetCount(); } /// Return the nth character style wxRichTextCharacterStyleDefinition* GetCharacterStyle(size_t n) const { return (wxRichTextCharacterStyleDefinition*) m_characterStyleDefinitions.Item(n)->GetData(); } /// Return the nth paragraph style wxRichTextParagraphStyleDefinition* GetParagraphStyle(size_t n) const { return (wxRichTextParagraphStyleDefinition*) m_paragraphStyleDefinitions.Item(n)->GetData(); } /// Return the nth list style wxRichTextListStyleDefinition* GetListStyle(size_t n) const { return (wxRichTextListStyleDefinition*) m_listStyleDefinitions.Item(n)->GetData(); } /// Return the nth box style wxRichTextBoxStyleDefinition* GetBoxStyle(size_t n) const { return (wxRichTextBoxStyleDefinition*) m_boxStyleDefinitions.Item(n)->GetData(); } /// Delete all styles void DeleteStyles(); /// Insert into list of style sheets bool InsertSheet(wxRichTextStyleSheet* before); /// Append to list of style sheets bool AppendSheet(wxRichTextStyleSheet* after); /// Unlink from the list of style sheets void Unlink(); /// Get/set next sheet wxRichTextStyleSheet* GetNextSheet() const { return m_nextSheet; } void SetNextSheet(wxRichTextStyleSheet* sheet) { m_nextSheet = sheet; } /// Get/set previous sheet wxRichTextStyleSheet* GetPreviousSheet() const { return m_previousSheet; } void SetPreviousSheet(wxRichTextStyleSheet* sheet) { m_previousSheet = sheet; } /// Sets and gets the name of the style sheet void SetName(const wxString& name) { m_name = name; } const wxString& GetName() const { return m_name; } /// Sets and gets the style description void SetDescription(const wxString& descr) { m_description = descr; } const wxString& GetDescription() const { return m_description; } /** Returns the sheet's properties. */ wxRichTextProperties& GetProperties() { return m_properties; } /** Returns the sheet's properties. */ const wxRichTextProperties& GetProperties() const { return m_properties; } /** Sets the sheet's properties. */ void SetProperties(const wxRichTextProperties& props) { m_properties = props; } /// Implementation /// Add a definition to one of the style lists bool AddStyle(wxList& list, wxRichTextStyleDefinition* def); /// Remove a style bool RemoveStyle(wxList& list, wxRichTextStyleDefinition* def, bool deleteStyle); /// Find a definition by name wxRichTextStyleDefinition* FindStyle(const wxList& list, const wxString& name, bool recurse = true) const; protected: wxString m_description; wxString m_name; wxList m_characterStyleDefinitions; wxList m_paragraphStyleDefinitions; wxList m_listStyleDefinitions; wxList m_boxStyleDefinitions; wxRichTextStyleSheet* m_previousSheet; wxRichTextStyleSheet* m_nextSheet; wxRichTextProperties m_properties; }; #if wxUSE_HTML /*! * wxRichTextStyleListBox class declaration * A listbox to display styles. */ class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListBox: public wxHtmlListBox { wxDECLARE_CLASS(wxRichTextStyleListBox); wxDECLARE_EVENT_TABLE(); public: /// Which type of style definition is currently showing? enum wxRichTextStyleType { wxRICHTEXT_STYLE_ALL, wxRICHTEXT_STYLE_PARAGRAPH, wxRICHTEXT_STYLE_CHARACTER, wxRICHTEXT_STYLE_LIST, wxRICHTEXT_STYLE_BOX }; wxRichTextStyleListBox() { Init(); } wxRichTextStyleListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); virtual ~wxRichTextStyleListBox(); void Init() { m_styleSheet = NULL; m_richTextCtrl = NULL; m_applyOnSelection = false; m_styleType = wxRICHTEXT_STYLE_PARAGRAPH; m_autoSetSelection = true; } bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Creates a suitable HTML fragment for a definition wxString CreateHTML(wxRichTextStyleDefinition* def) const; /// Associates the control with a style sheet void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { m_styleSheet = styleSheet; } wxRichTextStyleSheet* GetStyleSheet() const { return m_styleSheet; } /// Associates the control with a wxRichTextCtrl void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_richTextCtrl = ctrl; } wxRichTextCtrl* GetRichTextCtrl() const { return m_richTextCtrl; } /// Get style for index wxRichTextStyleDefinition* GetStyle(size_t i) const ; /// Get index for style name int GetIndexForStyle(const wxString& name) const ; /// Set selection for string, returning the index. int SetStyleSelection(const wxString& name); /// Updates the list void UpdateStyles(); /// Apply the style void ApplyStyle(int i); /// Left click void OnLeftDown(wxMouseEvent& event); /// Left double-click void OnLeftDoubleClick(wxMouseEvent& event); /// Auto-select from style under caret in idle time void OnIdle(wxIdleEvent& event); /// Convert units in tends of a millimetre to device units int ConvertTenthsMMToPixels(wxDC& dc, int units) const; /// Can we set the selection based on the editor caret position? /// Need to override this if being used in a combobox popup virtual bool CanAutoSetSelection() { return m_autoSetSelection; } virtual void SetAutoSetSelection(bool autoSet) { m_autoSetSelection = autoSet; } /// Set whether the style should be applied as soon as the item is selected (the default) void SetApplyOnSelection(bool applyOnSel) { m_applyOnSelection = applyOnSel; } bool GetApplyOnSelection() const { return m_applyOnSelection; } /// Set the style type to display void SetStyleType(wxRichTextStyleType styleType) { m_styleType = styleType; UpdateStyles(); } wxRichTextStyleType GetStyleType() const { return m_styleType; } /// Helper for listbox and combo control static wxString GetStyleToShowInIdleTime(wxRichTextCtrl* ctrl, wxRichTextStyleType styleType); protected: /// Returns the HTML for this item virtual wxString OnGetItem(size_t n) const wxOVERRIDE; private: wxRichTextStyleSheet* m_styleSheet; wxRichTextCtrl* m_richTextCtrl; bool m_applyOnSelection; // if true, applies style on selection wxRichTextStyleType m_styleType; // style type to display bool m_autoSetSelection; wxArrayString m_styleNames; }; /*! * wxRichTextStyleListCtrl class declaration * This is a container for the list control plus a combobox to switch between * style types. */ #define wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR 0x1000 class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListCtrl: public wxControl { wxDECLARE_CLASS(wxRichTextStyleListCtrl); wxDECLARE_EVENT_TABLE(); public: /// Constructors wxRichTextStyleListCtrl() { Init(); } wxRichTextStyleListCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Constructors virtual ~wxRichTextStyleListCtrl(); /// Member initialisation void Init() { m_styleListBox = NULL; m_styleChoice = NULL; m_dontUpdate = false; } /// Creates the windows bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Updates the style list box void UpdateStyles(); /// Associates the control with a style sheet void SetStyleSheet(wxRichTextStyleSheet* styleSheet); wxRichTextStyleSheet* GetStyleSheet() const; /// Associates the control with a wxRichTextCtrl void SetRichTextCtrl(wxRichTextCtrl* ctrl); wxRichTextCtrl* GetRichTextCtrl() const; /// Set/get the style type to display void SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType); wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const; /// Get the choice index for style type int StyleTypeToIndex(wxRichTextStyleListBox::wxRichTextStyleType styleType); /// Get the style type for choice index wxRichTextStyleListBox::wxRichTextStyleType StyleIndexToType(int i); /// Get the listbox wxRichTextStyleListBox* GetStyleListBox() const { return m_styleListBox; } /// Get the choice wxChoice* GetStyleChoice() const { return m_styleChoice; } /// React to style type choice void OnChooseType(wxCommandEvent& event); /// Lay out the controls void OnSize(wxSizeEvent& event); private: wxRichTextStyleListBox* m_styleListBox; wxChoice* m_styleChoice; bool m_dontUpdate; }; #if wxUSE_COMBOCTRL /*! * Style drop-down for a wxComboCtrl */ class wxRichTextStyleComboPopup : public wxRichTextStyleListBox, public wxComboPopup { public: virtual void Init() wxOVERRIDE { m_itemHere = -1; // hot item in list m_value = -1; } virtual bool Create( wxWindow* parent ) wxOVERRIDE; virtual wxWindow *GetControl() wxOVERRIDE { return this; } virtual void SetStringValue( const wxString& s ) wxOVERRIDE; virtual wxString GetStringValue() const wxOVERRIDE; /// Can we set the selection based on the editor caret position? // virtual bool CanAutoSetSelection() { return ((m_combo == NULL) || !m_combo->IsPopupShown()); } virtual bool CanAutoSetSelection() wxOVERRIDE { return false; } // // Popup event handlers // // Mouse hot-tracking void OnMouseMove(wxMouseEvent& event); // On mouse left, set the value and close the popup void OnMouseClick(wxMouseEvent& WXUNUSED(event)); protected: int m_itemHere; // hot item in popup int m_value; private: wxDECLARE_EVENT_TABLE(); }; /*! * wxRichTextStyleComboCtrl * A combo for applying styles. */ class WXDLLIMPEXP_RICHTEXT wxRichTextStyleComboCtrl: public wxComboCtrl { wxDECLARE_CLASS(wxRichTextStyleComboCtrl); wxDECLARE_EVENT_TABLE(); public: wxRichTextStyleComboCtrl() { Init(); } wxRichTextStyleComboCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCB_READONLY) { Init(); Create(parent, id, pos, size, style); } virtual ~wxRichTextStyleComboCtrl() {} void Init() { m_stylePopup = NULL; } bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Updates the list void UpdateStyles() { m_stylePopup->UpdateStyles(); } /// Associates the control with a style sheet void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { m_stylePopup->SetStyleSheet(styleSheet); } wxRichTextStyleSheet* GetStyleSheet() const { return m_stylePopup->GetStyleSheet(); } /// Associates the control with a wxRichTextCtrl void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_stylePopup->SetRichTextCtrl(ctrl); } wxRichTextCtrl* GetRichTextCtrl() const { return m_stylePopup->GetRichTextCtrl(); } /// Gets the style popup wxRichTextStyleComboPopup* GetStylePopup() const { return m_stylePopup; } /// Auto-select from style under caret in idle time void OnIdle(wxIdleEvent& event); protected: wxRichTextStyleComboPopup* m_stylePopup; }; #endif // wxUSE_COMBOCTRL #endif // wxUSE_HTML #endif // wxUSE_RICHTEXT #endif // _WX_RICHTEXTSTYLES_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextstylepage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextstylepage.h // Purpose: Declares the rich text formatting dialog style page. // Author: Julian Smart // Modified by: // Created: 10/5/2006 11:34:55 AM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTSTYLEPAGE_H_ #define _RICHTEXTSTYLEPAGE_H_ #include "wx/richtext/richtextdialogpage.h" /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTSTYLEPAGE_IDNAME ID_RICHTEXTSTYLEPAGE #define SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextStylePage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextStylePage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextStylePage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextStylePage( ); wxRichTextStylePage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE ); /// Initialise members void Init(); /// Creates the controls and sizers void CreateControls(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Gets the attributes associated with the main formatting dialog wxRichTextAttr* GetAttributes(); /// Determines whether the style name can be edited bool GetNameIsEditable() const { return m_nameIsEditable; } void SetNameIsEditable(bool editable) { m_nameIsEditable = editable; } ////@begin wxRichTextStylePage event handler declarations /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEPAGE_NEXT_STYLE void OnNextStyleUpdate( wxUpdateUIEvent& event ); ////@end wxRichTextStylePage event handler declarations ////@begin wxRichTextStylePage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextStylePage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextStylePage member variables wxTextCtrl* m_styleName; wxComboBox* m_basedOn; wxComboBox* m_nextStyle; /// Control identifiers enum { ID_RICHTEXTSTYLEPAGE = 10403, ID_RICHTEXTSTYLEPAGE_STYLE_NAME = 10404, ID_RICHTEXTSTYLEPAGE_BASED_ON = 10405, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE = 10406 }; ////@end wxRichTextStylePage member variables bool m_nameIsEditable; }; #endif // _RICHTEXTSTYLEPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextliststylepage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextliststylepage.h // Purpose: Declares the rich text formatting dialog list style page. // Author: Julian Smart // Modified by: // Created: 10/18/2006 11:36:37 AM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTLISTSTYLEPAGE_H_ #define _RICHTEXTLISTSTYLEPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes #include "wx/spinctrl.h" #include "wx/notebook.h" #include "wx/statline.h" ////@end includes /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_IDNAME ID_RICHTEXTLISTSTYLEPAGE #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextListStylePage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextListStylePage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextListStylePage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextListStylePage( ); wxRichTextListStylePage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE ); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); /// Updates the bullets preview void UpdatePreview(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Get attributes for selected level wxRichTextAttr* GetAttributesForSelection(); /// Update for symbol-related controls void OnSymbolUpdate( wxUpdateUIEvent& event ); /// Update for number-related controls void OnNumberUpdate( wxUpdateUIEvent& event ); /// Update for standard bullet-related controls void OnStandardBulletUpdate( wxUpdateUIEvent& event ); /// Just transfer to the window void DoTransferDataToWindow(); /// Transfer from the window and preview void TransferAndPreview(); ////@begin wxRichTextListStylePage event handler declarations /// wxEVT_SPINCTRL event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL void OnLevelUpdated( wxSpinEvent& event ); /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL void OnLevelUp( wxSpinEvent& event ); /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL void OnLevelDown( wxSpinEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL void OnLevelTextUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL void OnLevelUIUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT void OnChooseFontClick( wxCommandEvent& event ); /// wxEVT_LISTBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX void OnStylelistboxSelected( wxCommandEvent& event ); /// wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL void OnPeriodctrlClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL void OnPeriodctrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL void OnParenthesesctrlClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL void OnParenthesesctrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL void OnRightParenthesisCtrlClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL void OnBulletAlignmentCtrlSelected( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC void OnSymbolstaticUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL void OnSymbolctrlSelected( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL void OnSymbolctrlUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL void OnSymbolctrlUIUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL void OnChooseSymbolClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL void OnChooseSymbolUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL void OnSymbolfontctrlSelected( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL void OnSymbolfontctrlUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC void OnNamestaticUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL void OnNamectrlSelected( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL void OnNamectrlUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL void OnNamectrlUIUpdate( wxUpdateUIEvent& event ); /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT void OnRichtextliststylepageAlignleftSelected( wxCommandEvent& event ); /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT void OnRichtextliststylepageAlignrightSelected( wxCommandEvent& event ); /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED void OnRichtextliststylepageJustifiedSelected( wxCommandEvent& event ); /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED void OnRichtextliststylepageCenteredSelected( wxCommandEvent& event ); /// wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE void OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT void OnIndentLeftUpdated( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE void OnIndentFirstLineUpdated( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT void OnIndentRightUpdated( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE void OnSpacingBeforeUpdated( wxCommandEvent& event ); /// wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER void OnSpacingAfterUpdated( wxCommandEvent& event ); /// wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING void OnLineSpacingSelected( wxCommandEvent& event ); ////@end wxRichTextListStylePage event handler declarations ////@begin wxRichTextListStylePage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextListStylePage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextListStylePage member variables wxSpinCtrl* m_levelCtrl; wxListBox* m_styleListBox; wxCheckBox* m_periodCtrl; wxCheckBox* m_parenthesesCtrl; wxCheckBox* m_rightParenthesisCtrl; wxComboBox* m_bulletAlignmentCtrl; wxComboBox* m_symbolCtrl; wxComboBox* m_symbolFontCtrl; wxComboBox* m_bulletNameCtrl; wxRadioButton* m_alignmentLeft; wxRadioButton* m_alignmentRight; wxRadioButton* m_alignmentJustified; wxRadioButton* m_alignmentCentred; wxRadioButton* m_alignmentIndeterminate; wxTextCtrl* m_indentLeft; wxTextCtrl* m_indentLeftFirst; wxTextCtrl* m_indentRight; wxTextCtrl* m_spacingBefore; wxTextCtrl* m_spacingAfter; wxComboBox* m_spacingLine; wxRichTextCtrl* m_previewCtrl; /// Control identifiers enum { ID_RICHTEXTLISTSTYLEPAGE = 10616, ID_RICHTEXTLISTSTYLEPAGE_LEVEL = 10617, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT = 10604, ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK = 10618, ID_RICHTEXTLISTSTYLEPAGE_BULLETS = 10619, ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX = 10620, ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL = 10627, ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL = 10626, ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL = 10602, ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL = 10603, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC = 10621, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL = 10622, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL = 10623, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL = 10625, ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC = 10600, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL = 10601, ID_RICHTEXTLISTSTYLEPAGE_SPACING = 10628, ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT = 10629, ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT = 10630, ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED = 10631, ID_RICHTEXTLISTSTYLEPAGE_CENTERED = 10632, ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE = 10633, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT = 10634, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE = 10635, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT = 10636, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE = 10637, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER = 10638, ID_RICHTEXTLISTSTYLEPAGE_LINESPACING = 10639, ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL = 10640 }; ////@end wxRichTextListStylePage member variables bool m_dontUpdate; int m_currentLevel; }; #endif // _RICHTEXTLISTSTYLEPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextstyledlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextstyledlg.h // Purpose: Declares the rich text style editor dialog. // Author: Julian Smart // Modified by: // Created: 10/5/2006 12:05:31 PM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTSTYLEDLG_H_ #define _RICHTEXTSTYLEDLG_H_ /*! * Includes */ #include "wx/richtext/richtextuicustomization.h" ////@begin includes ////@end includes #include "wx/richtext/richtextbuffer.h" #include "wx/richtext/richtextstyles.h" #include "wx/richtext/richtextctrl.h" /*! * Forward declarations */ ////@begin forward declarations class wxBoxSizer; class wxRichTextStyleListCtrl; class wxRichTextCtrl; class wxStdDialogButtonSizer; ////@end forward declarations class WXDLLIMPEXP_FWD_CORE wxButton; class WXDLLIMPEXP_FWD_CORE wxCheckBox; /*! * Control identifiers */ #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE wxGetTranslation("Style Organiser") #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_IDNAME ID_RICHTEXTSTYLEORGANISERDIALOG #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION wxDefaultPosition /*! * Flags for specifying permitted operations */ #define wxRICHTEXT_ORGANISER_DELETE_STYLES 0x0001 #define wxRICHTEXT_ORGANISER_CREATE_STYLES 0x0002 #define wxRICHTEXT_ORGANISER_APPLY_STYLES 0x0004 #define wxRICHTEXT_ORGANISER_EDIT_STYLES 0x0008 #define wxRICHTEXT_ORGANISER_RENAME_STYLES 0x0010 #define wxRICHTEXT_ORGANISER_OK_CANCEL 0x0020 #define wxRICHTEXT_ORGANISER_RENUMBER 0x0040 // The permitted style types to show #define wxRICHTEXT_ORGANISER_SHOW_CHARACTER 0x0100 #define wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH 0x0200 #define wxRICHTEXT_ORGANISER_SHOW_LIST 0x0400 #define wxRICHTEXT_ORGANISER_SHOW_BOX 0x0800 #define wxRICHTEXT_ORGANISER_SHOW_ALL 0x1000 // Common combinations #define wxRICHTEXT_ORGANISER_ORGANISE (wxRICHTEXT_ORGANISER_SHOW_ALL|wxRICHTEXT_ORGANISER_DELETE_STYLES|wxRICHTEXT_ORGANISER_CREATE_STYLES|wxRICHTEXT_ORGANISER_APPLY_STYLES|wxRICHTEXT_ORGANISER_EDIT_STYLES|wxRICHTEXT_ORGANISER_RENAME_STYLES) #define wxRICHTEXT_ORGANISER_BROWSE (wxRICHTEXT_ORGANISER_SHOW_ALL|wxRICHTEXT_ORGANISER_OK_CANCEL) #define wxRICHTEXT_ORGANISER_BROWSE_NUMBERING (wxRICHTEXT_ORGANISER_SHOW_LIST|wxRICHTEXT_ORGANISER_OK_CANCEL|wxRICHTEXT_ORGANISER_RENUMBER) /*! * wxRichTextStyleOrganiserDialog class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextStyleOrganiserDialog: public wxDialog { wxDECLARE_DYNAMIC_CLASS(wxRichTextStyleOrganiserDialog); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextStyleOrganiserDialog( ); wxRichTextStyleOrganiserDialog( int flags, wxRichTextStyleSheet* sheet, wxRichTextCtrl* ctrl, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE ); /// Creation bool Create( int flags, wxRichTextStyleSheet* sheet, wxRichTextCtrl* ctrl, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE ); /// Creates the controls and sizers void CreateControls(); /// Initialise member variables void Init(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Set/get style sheet void SetStyleSheet(wxRichTextStyleSheet* sheet) { m_richTextStyleSheet = sheet; } wxRichTextStyleSheet* GetStyleSheet() const { return m_richTextStyleSheet; } /// Set/get control void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_richTextCtrl = ctrl; } wxRichTextCtrl* GetRichTextCtrl() const { return m_richTextCtrl; } /// Set/get flags void SetFlags(int flags) { m_flags = flags; } int GetFlags() const { return m_flags; } /// Show preview for given or selected preview void ShowPreview(int sel = -1); /// Clears the preview void ClearPreview(); /// List selection void OnListSelection(wxCommandEvent& event); /// Get/set restart numbering boolean bool GetRestartNumbering() const { return m_restartNumbering; } void SetRestartNumbering(bool restartNumbering) { m_restartNumbering = restartNumbering; } /// Get selected style name or definition wxString GetSelectedStyle() const; wxRichTextStyleDefinition* GetSelectedStyleDefinition() const; /// Apply the style bool ApplyStyle(wxRichTextCtrl* ctrl = NULL); /// Should we show tooltips? static bool ShowToolTips() { return sm_showToolTips; } /// Determines whether tooltips will be shown static void SetShowToolTips(bool show) { sm_showToolTips = show; } ////@begin wxRichTextStyleOrganiserDialog event handler declarations /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR void OnNewCharClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR void OnNewCharUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA void OnNewParaClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA void OnNewParaUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST void OnNewListClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST void OnNewListUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_BOX void OnNewBoxClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_BOX void OnNewBoxUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY void OnApplyClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY void OnApplyUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME void OnRenameClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME void OnRenameUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT void OnEditClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT void OnEditUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE void OnDeleteClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE void OnDeleteUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for wxID_HELP void OnHelpClick( wxCommandEvent& event ); ////@end wxRichTextStyleOrganiserDialog event handler declarations ////@begin wxRichTextStyleOrganiserDialog member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextStyleOrganiserDialog member function declarations ////@begin wxRichTextStyleOrganiserDialog member variables wxBoxSizer* m_innerSizer; wxBoxSizer* m_buttonSizerParent; wxRichTextStyleListCtrl* m_stylesListBox; wxRichTextCtrl* m_previewCtrl; wxBoxSizer* m_buttonSizer; wxButton* m_newCharacter; wxButton* m_newParagraph; wxButton* m_newList; wxButton* m_newBox; wxButton* m_applyStyle; wxButton* m_renameStyle; wxButton* m_editStyle; wxButton* m_deleteStyle; wxButton* m_closeButton; wxBoxSizer* m_bottomButtonSizer; wxCheckBox* m_restartNumberingCtrl; wxStdDialogButtonSizer* m_stdButtonSizer; wxButton* m_okButton; wxButton* m_cancelButton; /// Control identifiers enum { ID_RICHTEXTSTYLEORGANISERDIALOG = 10500, ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES = 10501, ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE = 10510, ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW = 10509, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR = 10504, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA = 10505, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST = 10508, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_BOX = 10512, ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY = 10503, ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME = 10502, ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT = 10506, ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE = 10507, ID_RICHTEXTSTYLEORGANISERDIALOG_RESTART_NUMBERING = 10511 }; ////@end wxRichTextStyleOrganiserDialog member variables private: wxRichTextCtrl* m_richTextCtrl; wxRichTextStyleSheet* m_richTextStyleSheet; bool m_dontUpdate; int m_flags; static bool sm_showToolTips; bool m_restartNumbering; }; #endif // _RICHTEXTSTYLEDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextxml.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextxml.h // Purpose: XML and HTML I/O for wxRichTextCtrl // Author: Julian Smart // Modified by: // Created: 2005-09-30 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTXML_H_ #define _WX_RICHTEXTXML_H_ /*! * Includes */ #include "wx/hashmap.h" #include "wx/richtext/richtextbuffer.h" #include "wx/richtext/richtextstyles.h" #if wxUSE_RICHTEXT && wxUSE_XML /*! @class wxRichTextXMLHelper A utility class to help with XML import/export, that can be used outside saving a buffer if needed. */ class WXDLLIMPEXP_RICHTEXT wxRichTextXMLHelper: public wxObject { public: wxRichTextXMLHelper() { Init(); } wxRichTextXMLHelper(const wxString& enc) { Init(); SetupForSaving(enc); } ~wxRichTextXMLHelper(); void Init(); void SetupForSaving(const wxString& enc); void Clear(); void SetFileEncoding(const wxString& encoding) { m_fileEncoding = encoding; } const wxString& GetFileEncoding() const { return m_fileEncoding; } // Convert a colour to a 6-digit hex string static wxString ColourToHexString(const wxColour& col); // Convert 6-digit hex string to a colour static wxColour HexStringToColour(const wxString& hex); static wxString MakeString(const int& v) { return wxString::Format(wxT("%d"), v); } static wxString MakeString(const long& v) { return wxString::Format(wxT("%ld"), v); } static wxString MakeString(const double& v) { return wxString::Format(wxT("%.2f"), (float) v); } static wxString MakeString(const wxString& s) { return s; } static wxString MakeString(const wxColour& col) { return wxT("#") + ColourToHexString(col); } static bool HasParam(wxXmlNode* node, const wxString& param); static wxXmlNode *GetParamNode(wxXmlNode* node, const wxString& param); static wxString GetNodeContent(wxXmlNode *node); static wxString GetParamValue(wxXmlNode *node, const wxString& param); static wxString GetText(wxXmlNode *node, const wxString& param = wxEmptyString); static wxXmlNode* FindNode(wxXmlNode* node, const wxString& name); static wxString AttributeToXML(const wxString& str); static bool RichTextFixFaceName(wxString& facename); static long ColourStringToLong(const wxString& colStr); static wxTextAttrDimension ParseDimension(const wxString& dimStr); // Make a string from the given property. This can be overridden for custom variants. virtual wxString MakeStringFromProperty(const wxVariant& var); // Create a proprty from the string read from the XML file. virtual wxVariant MakePropertyFromString(const wxString& name, const wxString& value, const wxString& type); // Import properties virtual bool ImportProperties(wxRichTextProperties& properties, wxXmlNode* node); virtual bool ImportStyle(wxRichTextAttr& attr, wxXmlNode* node, bool isPara = false); virtual bool ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node); // Get flags, as per handler flags int GetFlags() const { return m_flags; } void SetFlags(int flags) { m_flags = flags; } #if wxRICHTEXT_HAVE_DIRECT_OUTPUT // write string to output static void OutputString(wxOutputStream& stream, const wxString& str, wxMBConv *convMem, wxMBConv *convFile); static void OutputIndentation(wxOutputStream& stream, int indent); // Same as above, but create entities first. // Translates '<' to "&lt;", '>' to "&gt;" and '&' to "&amp;" static void OutputStringEnt(wxOutputStream& stream, const wxString& str, wxMBConv *convMem, wxMBConv *convFile); void OutputString(wxOutputStream& stream, const wxString& str); void OutputStringEnt(wxOutputStream& stream, const wxString& str); static void AddString(wxString& str, const int& v) { str << wxString::Format(wxT("%d"), v); } static void AddString(wxString& str, const long& v) { str << wxString::Format(wxT("%ld"), v); } static void AddString(wxString& str, const double& v) { str << wxString::Format(wxT("%.2f"), (float) v); } static void AddString(wxString& str, const wxChar* s) { str << s; } static void AddString(wxString& str, const wxString& s) { str << s; } static void AddString(wxString& str, const wxColour& col) { str << wxT("#") << ColourToHexString(col); } static void AddAttribute(wxString& str, const wxString& name, const int& v); static void AddAttribute(wxString& str, const wxString& name, const long& v); static void AddAttribute(wxString& str, const wxString& name, const double& v); static void AddAttribute(wxString& str, const wxString& name, const wxChar* s); static void AddAttribute(wxString& str, const wxString& name, const wxString& s); static void AddAttribute(wxString& str, const wxString& name, const wxColour& col); static void AddAttribute(wxString& str, const wxString& name, const wxTextAttrDimension& dim); static void AddAttribute(wxString& str, const wxString& rootName, const wxTextAttrDimensions& dims); static void AddAttribute(wxString& str, const wxString& rootName, const wxTextAttrBorder& border); static void AddAttribute(wxString& str, const wxString& rootName, const wxTextAttrBorders& borders); /// Create a string containing style attributes static wxString AddAttributes(const wxRichTextAttr& attr, bool isPara = false); /// Create a string containing style attributes, plus further object 'attributes' (shown, id) static wxString AddAttributes(wxRichTextObject* obj, bool isPara = false); virtual bool ExportStyleDefinition(wxOutputStream& stream, wxRichTextStyleDefinition* def, int level); virtual bool WriteProperties(wxOutputStream& stream, const wxRichTextProperties& properties, int level); #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT static void AddAttribute(wxXmlNode* node, const wxString& name, const int& v); static void AddAttribute(wxXmlNode* node, const wxString& name, const long& v); static void AddAttribute(wxXmlNode* node, const wxString& name, const double& v); static void AddAttribute(wxXmlNode* node, const wxString& name, const wxString& s); static void AddAttribute(wxXmlNode* node, const wxString& name, const wxColour& col); static void AddAttribute(wxXmlNode* node, const wxString& name, const wxTextAttrDimension& dim); static void AddAttribute(wxXmlNode* node, const wxString& rootName, const wxTextAttrDimensions& dims); static void AddAttribute(wxXmlNode* node, const wxString& rootName, const wxTextAttrBorder& border); static void AddAttribute(wxXmlNode* node, const wxString& rootName, const wxTextAttrBorders& borders); static bool AddAttributes(wxXmlNode* node, wxRichTextAttr& attr, bool isPara = false); static bool AddAttributes(wxXmlNode* node, wxRichTextObject* obj, bool isPara = false); virtual bool ExportStyleDefinition(wxXmlNode* parent, wxRichTextStyleDefinition* def); // Write the properties virtual bool WriteProperties(wxXmlNode* node, const wxRichTextProperties& properties); #endif public: #if wxRICHTEXT_HAVE_DIRECT_OUTPUT // Used during saving wxMBConv* m_convMem; wxMBConv* m_convFile; bool m_deleteConvFile; #endif wxString m_fileEncoding; int m_flags; }; /*! @class wxRichTextXMLHandler Implements XML loading and saving. Two methods of saving are included: writing directly to a text stream, and populating an wxXmlDocument before writing it. The former method is considerably faster, so we favour that one, even though the code is a little less elegant. */ class WXDLLIMPEXP_FWD_XML wxXmlNode; class WXDLLIMPEXP_FWD_XML wxXmlDocument; class WXDLLIMPEXP_RICHTEXT wxRichTextXMLHandler: public wxRichTextFileHandler { wxDECLARE_DYNAMIC_CLASS(wxRichTextXMLHandler); public: wxRichTextXMLHandler(const wxString& name = wxT("XML"), const wxString& ext = wxT("xml"), int type = wxRICHTEXT_TYPE_XML) : wxRichTextFileHandler(name, ext, type) { Init(); } void Init(); #if wxUSE_STREAMS #if wxRICHTEXT_HAVE_DIRECT_OUTPUT /// Recursively export an object bool ExportXML(wxOutputStream& stream, wxRichTextObject& obj, int level); #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT bool ExportXML(wxXmlNode* parent, wxRichTextObject& obj); #endif /// Recursively import an object bool ImportXML(wxRichTextBuffer* buffer, wxRichTextObject* obj, wxXmlNode* node); #endif /// Creates an object given an XML element name virtual wxRichTextObject* CreateObjectForXMLName(wxRichTextObject* parent, const wxString& name) const; /// Can we save using this handler? virtual bool CanSave() const wxOVERRIDE { return true; } /// Can we load using this handler? virtual bool CanLoad() const wxOVERRIDE { return true; } /// Returns the XML helper object, implementing functionality /// that can be reused elsewhere. wxRichTextXMLHelper& GetHelper() { return m_helper; } // Implementation /** Call with XML node name, C++ class name so that wxRTC can read in the node. If you add a custom object, call this. */ static void RegisterNodeName(const wxString& nodeName, const wxString& className) { sm_nodeNameToClassMap[nodeName] = className; } /** Cleans up the mapping between node name and C++ class. */ static void ClearNodeToClassMap() { sm_nodeNameToClassMap.clear(); } protected: #if wxUSE_STREAMS virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) wxOVERRIDE; virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) wxOVERRIDE; #endif wxRichTextXMLHelper m_helper; static wxStringToStringHashMap sm_nodeNameToClassMap; }; #endif // wxUSE_RICHTEXT && wxUSE_XML #endif // _WX_RICHTEXTXML_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextbulletspage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextbulletspage.h // Purpose: Declares the rich text formatting dialog bullets page. // Author: Julian Smart // Modified by: // Created: 10/4/2006 10:32:31 AM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTBULLETSPAGE_H_ #define _RICHTEXTBULLETSPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" #include "wx/spinbutt.h" // for wxSpinEvent /*! * Forward declarations */ ////@begin forward declarations class wxSpinCtrl; class wxRichTextCtrl; ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextBulletsPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextBulletsPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextBulletsPage( ); wxRichTextBulletsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE ); /// Initialise members void Init(); /// Creates the controls and sizers void CreateControls(); /// Updates the bullets preview void UpdatePreview(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Gets the attributes associated with the main formatting dialog wxRichTextAttr* GetAttributes(); /// Update for symbol-related controls void OnSymbolUpdate( wxUpdateUIEvent& event ); /// Update for number-related controls void OnNumberUpdate( wxUpdateUIEvent& event ); /// Update for standard bullet-related controls void OnStandardBulletUpdate( wxUpdateUIEvent& event ); ////@begin wxRichTextBulletsPage event handler declarations /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX void OnStylelistboxSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL void OnPeriodctrlClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL void OnPeriodctrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL void OnParenthesesctrlClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL void OnParenthesesctrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL void OnRightParenthesisCtrlClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL void OnBulletAlignmentCtrlSelected( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC void OnSymbolstaticUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL void OnSymbolctrlSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL void OnSymbolctrlUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL void OnSymbolctrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL void OnChooseSymbolClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL void OnChooseSymbolUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL void OnSymbolfontctrlSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL void OnSymbolfontctrlUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC void OnNamestaticUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL void OnNamectrlSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL void OnNamectrlUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL void OnNamectrlUIUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC void OnNumberstaticUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL void OnNumberctrlUpdated( wxSpinEvent& event ); /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL void OnNumberctrlUp( wxSpinEvent& event ); /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL void OnNumberctrlDown( wxSpinEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL void OnNumberctrlTextUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL void OnNumberctrlUpdate( wxUpdateUIEvent& event ); ////@end wxRichTextBulletsPage event handler declarations ////@begin wxRichTextBulletsPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextBulletsPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextBulletsPage member variables wxListBox* m_styleListBox; wxCheckBox* m_periodCtrl; wxCheckBox* m_parenthesesCtrl; wxCheckBox* m_rightParenthesisCtrl; wxComboBox* m_bulletAlignmentCtrl; wxComboBox* m_symbolCtrl; wxComboBox* m_symbolFontCtrl; wxComboBox* m_bulletNameCtrl; wxSpinCtrl* m_numberCtrl; wxRichTextCtrl* m_previewCtrl; /// Control identifiers enum { ID_RICHTEXTBULLETSPAGE = 10300, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX = 10305, ID_RICHTEXTBULLETSPAGE_PERIODCTRL = 10313, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL = 10311, ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL = 10306, ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL = 10315, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC = 10301, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL = 10307, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL = 10308, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL = 10309, ID_RICHTEXTBULLETSPAGE_NAMESTATIC = 10303, ID_RICHTEXTBULLETSPAGE_NAMECTRL = 10304, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC = 10302, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL = 10310, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL = 10314 }; ////@end wxRichTextBulletsPage member variables bool m_hasBulletStyle; bool m_hasBulletNumber; bool m_hasBulletSymbol; bool m_dontUpdate; }; #endif // _RICHTEXTBULLETSPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextfontpage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextfontpage.h // Purpose: Font page for wxRichTextFormattingDialog // Author: Julian Smart // Modified by: // Created: 2006-10-02 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTFONTPAGE_H_ #define _RICHTEXTFONTPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes #include "wx/spinbutt.h" ////@end includes /*! * Forward declarations */ ////@begin forward declarations class wxBoxSizer; class wxSpinButton; class wxRichTextFontListBox; class wxRichTextColourSwatchCtrl; class wxRichTextFontPreviewCtrl; ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100) #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextFontPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextFontPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextFontPage( ); wxRichTextFontPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTFONTPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTFONTPAGE_SIZE, long style = SYMBOL_WXRICHTEXTFONTPAGE_STYLE ); /// Initialise members void Init(); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTFONTPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTFONTPAGE_SIZE, long style = SYMBOL_WXRICHTEXTFONTPAGE_STYLE ); /// Creates the controls and sizers void CreateControls(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Updates the font preview void UpdatePreview(); void OnFaceListBoxSelected( wxCommandEvent& event ); void OnColourClicked( wxCommandEvent& event ); /// Gets the attributes associated with the main formatting dialog wxRichTextAttr* GetAttributes(); /// Determines which text effect controls should be shown. /// Currently only wxTEXT_ATTR_EFFECT_RTL and wxTEXT_ATTR_EFFECT_SUPPRESS_HYPHENATION may /// be removed from the page. By default, these effects are not shown as they /// have no effect in the editor. static int GetAllowedTextEffects() { return sm_allowedTextEffects; } /// Sets the allowed text effects in the page. static void SetAllowedTextEffects(int allowed) { sm_allowedTextEffects = allowed; } ////@begin wxRichTextFontPage event handler declarations /// wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE void OnIdle( wxIdleEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL void OnFaceTextCtrlUpdated( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL void OnSizeTextCtrlUpdated( wxCommandEvent& event ); /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS void OnRichtextfontpageSpinbuttonsUp( wxSpinEvent& event ); /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS void OnRichtextfontpageSpinbuttonsDown( wxSpinEvent& event ); /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX void OnSizeListBoxSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL void OnStyleCtrlSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL void OnWeightCtrlSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL void OnUnderliningCtrlSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL void OnStrikethroughctrlClick( wxCommandEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL void OnCapsctrlClick( wxCommandEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT void OnRichtextfontpageSuperscriptClick( wxCommandEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT void OnRichtextfontpageSubscriptClick( wxCommandEvent& event ); ////@end wxRichTextFontPage event handler declarations ////@begin wxRichTextFontPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextFontPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextFontPage member variables wxBoxSizer* m_innerSizer; wxTextCtrl* m_faceTextCtrl; wxTextCtrl* m_sizeTextCtrl; wxSpinButton* m_fontSizeSpinButtons; wxChoice* m_sizeUnitsCtrl; wxBoxSizer* m_fontListBoxParent; wxRichTextFontListBox* m_faceListBox; wxListBox* m_sizeListBox; wxComboBox* m_styleCtrl; wxComboBox* m_weightCtrl; wxComboBox* m_underliningCtrl; wxCheckBox* m_textColourLabel; wxRichTextColourSwatchCtrl* m_colourCtrl; wxCheckBox* m_bgColourLabel; wxRichTextColourSwatchCtrl* m_bgColourCtrl; wxCheckBox* m_strikethroughCtrl; wxCheckBox* m_capitalsCtrl; wxCheckBox* m_smallCapitalsCtrl; wxCheckBox* m_superscriptCtrl; wxCheckBox* m_subscriptCtrl; wxBoxSizer* m_rtlParentSizer; wxCheckBox* m_rtlCtrl; wxCheckBox* m_suppressHyphenationCtrl; wxRichTextFontPreviewCtrl* m_previewCtrl; /// Control identifiers enum { ID_RICHTEXTFONTPAGE = 10000, ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10002, ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10003, ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10004, ID_RICHTEXTFONTPAGE_FACELISTBOX = 10005, ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006, ID_RICHTEXTFONTPAGE_STYLECTRL = 10007, ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10008, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10009, ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL = 10010, ID_RICHTEXTFONTPAGE_COLOURCTRL = 10011, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL = 10012, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10013, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10014, ID_RICHTEXTFONTPAGE_CAPSCTRL = 10015, ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL = 10016, ID_RICHTEXTFONTPAGE_SUPERSCRIPT = 10017, ID_RICHTEXTFONTPAGE_SUBSCRIPT = 10018, ID_RICHTEXTFONTPAGE_RIGHT_TO_LEFT = 10020, ID_RICHTEXTFONTPAGE_SUBSCRIPT_SUPPRESS_HYPHENATION = 10021, ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10019 }; ////@end wxRichTextFontPage member variables bool m_dontUpdate; bool m_colourPresent; bool m_bgColourPresent; static int sm_allowedTextEffects; }; #endif // _RICHTEXTFONTPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextimagedlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextimagedlg.h // Purpose: A dialog for editing image properties. // Author: Mingquan Yang // Modified by: Julian Smart // Created: Wed 02 Jun 2010 11:27:23 CST // Copyright: (c) Mingquan Yang, Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/dialog.h" #ifndef _RICHTEXTIMAGEDLG_H_ #define _RICHTEXTIMAGEDLG_H_ /*! * Forward declarations */ class WXDLLIMPEXP_FWD_CORE wxButton; class WXDLLIMPEXP_FWD_CORE wxComboBox; class WXDLLIMPEXP_FWD_CORE wxCheckBox; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; /*! * Includes */ #include "wx/richtext/richtextbuffer.h" #include "wx/richtext/richtextformatdlg.h" /*! * Control identifiers */ #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE wxGetTranslation("Object Properties") #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME ID_RICHTEXTOBJECTPROPERTIESDIALOG #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION wxDefaultPosition /*! * wxRichTextObjectPropertiesDialog class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextObjectPropertiesDialog: public wxRichTextFormattingDialog { wxDECLARE_DYNAMIC_CLASS(wxRichTextObjectPropertiesDialog); wxDECLARE_EVENT_TABLE(); public: /// Constructors wxRichTextObjectPropertiesDialog(); wxRichTextObjectPropertiesDialog( wxRichTextObject* obj, wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE ); /// Creation bool Create( wxRichTextObject* obj, wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE ); /// Destructor ~wxRichTextObjectPropertiesDialog(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); ////@begin wxRichTextObjectPropertiesDialog event handler declarations ////@end wxRichTextObjectPropertiesDialog event handler declarations ////@begin wxRichTextObjectPropertiesDialog member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextObjectPropertiesDialog member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextObjectPropertiesDialog member variables /// Control identifiers enum { ID_RICHTEXTOBJECTPROPERTIESDIALOG = 10650 }; ////@end wxRichTextObjectPropertiesDialog member variables }; #endif // _RICHTEXTIMAGEDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextdialogpage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextdialogpage.h // Purpose: Formatting dialog page base class for wxRTC // Author: Julian Smart // Modified by: // Created: 2010-11-14 // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTDIALOGPAGE_H_ #define _WX_RICHTEXTDIALOGPAGE_H_ #if wxUSE_RICHTEXT #include "wx/panel.h" #include "wx/richtext/richtextuicustomization.h" /** @class wxRichTextDialogPage The base class for formatting dialog pages. **/ class WXDLLIMPEXP_RICHTEXT wxRichTextDialogPage: public wxPanel { public: wxDECLARE_CLASS(wxRichTextDialogPage); wxRichTextDialogPage() {} wxRichTextDialogPage(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0) { Create(parent, id, pos, size, style); } DECLARE_BASE_CLASS_HELP_PROVISION() }; #endif // wxUSE_RICHTEXT #endif // _WX_RICHTEXTDIALOGPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextsizepage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextsizepage.h // Purpose: Declares the rich text formatting dialog size page. // Author: Julian Smart // Modified by: // Created: 20/10/2010 10:23:24 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTSIZEPAGE_H_ #define _RICHTEXTSIZEPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" #include "wx/sizer.h" ////@begin includes #include "wx/statline.h" #include "wx/valgen.h" ////@end includes #include "wx/stattext.h" /*! * Forward declarations */ /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTSIZEPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTSIZEPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME ID_WXRICHTEXTSIZEPAGE #define SYMBOL_WXRICHTEXTSIZEPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTSIZEPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextSizePage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextSizePage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextSizePage(); wxRichTextSizePage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTSIZEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSIZEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSIZEPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTSIZEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSIZEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSIZEPAGE_STYLE ); /// Destructor ~wxRichTextSizePage(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); /// Gets the attributes from the formatting dialog wxRichTextAttr* GetAttributes(); /// Data transfer virtual bool TransferDataToWindow() wxOVERRIDE; virtual bool TransferDataFromWindow() wxOVERRIDE; /// Show/hide position controls static void ShowPositionControls(bool show) { sm_showPositionControls = show; } /// Show/hide minimum and maximum size controls static void ShowMinMaxSizeControls(bool show) { sm_showMinMaxSizeControls = show; } /// Show/hide position mode controls static void ShowPositionModeControls(bool show) { sm_showPositionModeControls = show; } /// Show/hide right/bottom position controls static void ShowRightBottomPositionControls(bool show) { sm_showRightBottomPositionControls = show; } /// Show/hide floating and alignment controls static void ShowFloatingAndAlignmentControls(bool show) { sm_showFloatingAndAlignmentControls = show; } /// Show/hide floating controls static void ShowFloatingControls(bool show) { sm_showFloatingControls = show; } /// Show/hide alignment controls static void ShowAlignmentControls(bool show) { sm_showAlignmentControls = show; } /// Enable the position and size units static void EnablePositionAndSizeUnits(bool enable) { sm_enablePositionAndSizeUnits = enable; } /// Enable the checkboxes for position and size static void EnablePositionAndSizeCheckboxes(bool enable) { sm_enablePositionAndSizeCheckboxes = enable; } /// Enable the move object controls static void ShowMoveObjectControls(bool enable) { sm_showMoveObjectControls = enable; } ////@begin wxRichTextSizePage event handler declarations /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH void OnRichtextWidthUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_W void OnRichtextWidthUnitsUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT void OnRichtextHeightUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_H void OnRichtextHeightUnitsUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH void OnRichtextMinWidthUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT void OnRichtextMinHeightUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH void OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT void OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT void OnRichtextLeftUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS void OnRichtextLeftUnitsUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP void OnRichtextTopUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS void OnRichtextTopUnitsUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT void OnRichtextRightUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS void OnRichtextRightUnitsUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM void OnRichtextBottomUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS void OnRichtextBottomUnitsUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP void OnRichtextParaUpClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN void OnRichtextParaDownClick( wxCommandEvent& event ); ////@end wxRichTextSizePage event handler declarations ////@begin wxRichTextSizePage member function declarations int GetPositionMode() const { return m_positionMode ; } void SetPositionMode(int value) { m_positionMode = value ; } /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextSizePage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextSizePage member variables wxBoxSizer* m_parentSizer; wxBoxSizer* m_floatingAlignmentSizer; wxBoxSizer* m_floatingSizer; wxChoice* m_float; wxBoxSizer* m_alignmentSizer; wxCheckBox* m_verticalAlignmentCheckbox; wxChoice* m_verticalAlignmentComboBox; wxFlexGridSizer* m_sizeSizer; wxBoxSizer* m_widthSizer; wxCheckBox* m_widthCheckbox; wxStaticText* m_widthLabel; wxTextCtrl* m_width; wxComboBox* m_unitsW; wxBoxSizer* m_heightSizer; wxCheckBox* m_heightCheckbox; wxStaticText* m_heightLabel; wxTextCtrl* m_height; wxComboBox* m_unitsH; wxCheckBox* m_minWidthCheckbox; wxBoxSizer* m_minWidthSizer; wxTextCtrl* m_minWidth; wxComboBox* m_unitsMinW; wxCheckBox* m_minHeightCheckbox; wxBoxSizer* m_minHeightSizer; wxTextCtrl* m_minHeight; wxComboBox* m_unitsMinH; wxCheckBox* m_maxWidthCheckbox; wxBoxSizer* m_maxWidthSizer; wxTextCtrl* m_maxWidth; wxComboBox* m_unitsMaxW; wxCheckBox* m_maxHeightCheckbox; wxBoxSizer* m_maxHeightSizer; wxTextCtrl* m_maxHeight; wxComboBox* m_unitsMaxH; wxBoxSizer* m_positionControls; wxBoxSizer* m_moveObjectParentSizer; wxBoxSizer* m_positionModeSizer; wxChoice* m_positionModeCtrl; wxFlexGridSizer* m_positionGridSizer; wxBoxSizer* m_leftSizer; wxCheckBox* m_positionLeftCheckbox; wxStaticText* m_leftLabel; wxTextCtrl* m_left; wxComboBox* m_unitsLeft; wxBoxSizer* m_topSizer; wxCheckBox* m_positionTopCheckbox; wxStaticText* m_topLabel; wxTextCtrl* m_top; wxComboBox* m_unitsTop; wxBoxSizer* m_rightSizer; wxCheckBox* m_positionRightCheckbox; wxStaticText* m_rightLabel; wxBoxSizer* m_rightPositionSizer; wxTextCtrl* m_right; wxComboBox* m_unitsRight; wxBoxSizer* m_bottomSizer; wxCheckBox* m_positionBottomCheckbox; wxStaticText* m_bottomLabel; wxBoxSizer* m_bottomPositionSizer; wxTextCtrl* m_bottom; wxComboBox* m_unitsBottom; wxBoxSizer* m_moveObjectSizer; int m_positionMode; /// Control identifiers enum { ID_WXRICHTEXTSIZEPAGE = 10700, ID_RICHTEXT_FLOATING_MODE = 10701, ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX = 10708, ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX = 10709, ID_RICHTEXT_WIDTH_CHECKBOX = 10702, ID_RICHTEXT_WIDTH = 10703, ID_RICHTEXT_UNITS_W = 10704, ID_RICHTEXT_HEIGHT_CHECKBOX = 10705, ID_RICHTEXT_HEIGHT = 10706, ID_RICHTEXT_UNITS_H = 10707, ID_RICHTEXT_MIN_WIDTH_CHECKBOX = 10715, ID_RICHTEXT_MIN_WIDTH = 10716, ID_RICHTEXT_UNITS_MIN_W = 10717, ID_RICHTEXT_MIN_HEIGHT_CHECKBOX = 10718, ID_RICHTEXT_MIN_HEIGHT = 10719, ID_RICHTEXT_UNITS_MIN_H = 10720, ID_RICHTEXT_MAX_WIDTH_CHECKBOX = 10721, ID_RICHTEXT_MAX_WIDTH = 10722, ID_RICHTEXT_UNITS_MAX_W = 10723, ID_RICHTEXT_MAX_HEIGHT_CHECKBOX = 10724, ID_RICHTEXT_MAX_HEIGHT = 10725, ID_RICHTEXT_UNITS_MAX_H = 10726, ID_RICHTEXT_POSITION_MODE = 10735, ID_RICHTEXT_LEFT_CHECKBOX = 10710, ID_RICHTEXT_LEFT = 10711, ID_RICHTEXT_LEFT_UNITS = 10712, ID_RICHTEXT_TOP_CHECKBOX = 10710, ID_RICHTEXT_TOP = 10728, ID_RICHTEXT_TOP_UNITS = 10729, ID_RICHTEXT_RIGHT_CHECKBOX = 10727, ID_RICHTEXT_RIGHT = 10730, ID_RICHTEXT_RIGHT_UNITS = 10731, ID_RICHTEXT_BOTTOM_CHECKBOX = 10732, ID_RICHTEXT_BOTTOM = 10733, ID_RICHTEXT_BOTTOM_UNITS = 10734, ID_RICHTEXT_PARA_UP = 10713, ID_RICHTEXT_PARA_DOWN = 10714 }; ////@end wxRichTextSizePage member variables static bool sm_showFloatingControls; static bool sm_showPositionControls; static bool sm_showMinMaxSizeControls; static bool sm_showPositionModeControls; static bool sm_showRightBottomPositionControls; static bool sm_showAlignmentControls; static bool sm_showFloatingAndAlignmentControls; static bool sm_enablePositionAndSizeUnits; static bool sm_enablePositionAndSizeCheckboxes; static bool sm_showMoveObjectControls; }; #endif // _RICHTEXTSIZEPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextbackgroundpage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextbackgroundpage.h // Purpose: Declares the rich text formatting dialog background // properties page. // Author: Julian Smart // Modified by: // Created: 13/11/2010 11:17:25 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTBACKGROUNDPAGE_H_ #define _RICHTEXTBACKGROUNDPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes #include "wx/statline.h" ////@end includes /*! * Forward declarations */ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextColourSwatchCtrl; /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME ID_RICHTEXTBACKGROUNDPAGE #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextBackgroundPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextBackgroundPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextBackgroundPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextBackgroundPage(); wxRichTextBackgroundPage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE ); /// Destructor ~wxRichTextBackgroundPage(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); /// Gets the attributes from the formatting dialog wxRichTextAttr* GetAttributes(); /// Data transfer virtual bool TransferDataToWindow() wxOVERRIDE; virtual bool TransferDataFromWindow() wxOVERRIDE; /// Respond to colour swatch click void OnColourSwatch(wxCommandEvent& event); ////@begin wxRichTextBackgroundPage event handler declarations /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_SHADOW_HORIZONTAL_OFFSET void OnRichtextShadowUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSHADOWCOLOURSWATCHCTRL void OnRichtextshadowcolourswatchctrlUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_SHADOW_SPREAD void OnRichtextShadowSpreadUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_SHADOW_BLUR_DISTANCE void OnRichtextShadowBlurUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_SHADOW_OPACITY void OnRichtextShadowOpacityUpdate( wxUpdateUIEvent& event ); ////@end wxRichTextBackgroundPage event handler declarations ////@begin wxRichTextBackgroundPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextBackgroundPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextBackgroundPage member variables wxCheckBox* m_backgroundColourCheckBox; wxRichTextColourSwatchCtrl* m_backgroundColourSwatch; wxBoxSizer* m_shadowBox; wxCheckBox* m_useShadow; wxTextCtrl* m_offsetX; wxComboBox* m_unitsHorizontalOffset; wxTextCtrl* m_offsetY; wxComboBox* m_unitsVerticalOffset; wxCheckBox* m_shadowColourCheckBox; wxRichTextColourSwatchCtrl* m_shadowColourSwatch; wxCheckBox* m_useShadowSpread; wxTextCtrl* m_spread; wxComboBox* m_unitsShadowSpread; wxCheckBox* m_useBlurDistance; wxTextCtrl* m_blurDistance; wxComboBox* m_unitsBlurDistance; wxCheckBox* m_useShadowOpacity; wxTextCtrl* m_opacity; /// Control identifiers enum { ID_RICHTEXTBACKGROUNDPAGE = 10845, ID_RICHTEXT_BACKGROUND_COLOUR_CHECKBOX = 10846, ID_RICHTEXT_BACKGROUND_COLOUR_SWATCH = 10847, ID_RICHTEXT_USE_SHADOW = 10840, ID_RICHTEXT_SHADOW_HORIZONTAL_OFFSET = 10703, ID_RICHTEXT_SHADOW_HORIZONTAL_OFFSET_UNITS = 10712, ID_RICHTEXT_SHADOW_VERTICAL_OFFSET = 10841, ID_RICHTEXT_SHADOW_VERTICAL_OFFSET_UNITS = 10842, ID_RICHTEXT_USE_SHADOW_COLOUR = 10843, ID_RICHTEXTSHADOWCOLOURSWATCHCTRL = 10844, ID_RICHTEXT_USE_SHADOW_SPREAD = 10851, ID_RICHTEXT_SHADOW_SPREAD = 10848, ID_RICHTEXT_SHADOW_SPREAD_UNITS = 10849, ID_RICHTEXT_USE_BLUR_DISTANCE = 10855, ID_RICHTEXT_SHADOW_BLUR_DISTANCE = 10852, ID_RICHTEXT_SHADOW_BLUR_DISTANCE_UNITS = 10853, ID_RICHTEXT_USE_SHADOW_OPACITY = 10856, ID_RICHTEXT_SHADOW_OPACITY = 10854 }; ////@end wxRichTextBackgroundPage member variables }; #endif // _RICHTEXTBACKGROUNDPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtexttabspage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtexttabspage.h // Purpose: Declares the rich text formatting dialog tabs page. // Author: Julian Smart // Modified by: // Created: 10/4/2006 8:03:20 AM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTTABSPAGE_H_ #define _RICHTEXTTABSPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes ////@end includes /*! * Forward declarations */ ////@begin forward declarations ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTTABSPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTTABSPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTTABSPAGE_IDNAME ID_RICHTEXTTABSPAGE #define SYMBOL_WXRICHTEXTTABSPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTTABSPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextTabsPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextTabsPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextTabsPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextTabsPage( ); wxRichTextTabsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTTABSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTTABSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTTABSPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTTABSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTTABSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTTABSPAGE_STYLE ); /// Creates the controls and sizers void CreateControls(); /// Initialise members void Init(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Sorts the tab array virtual void SortTabs(); /// Gets the attributes associated with the main formatting dialog wxRichTextAttr* GetAttributes(); ////@begin wxRichTextTabsPage event handler declarations /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTTABSPAGE_TABLIST void OnTablistSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_NEW_TAB void OnNewTabClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_NEW_TAB void OnNewTabUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB void OnDeleteTabClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB void OnDeleteTabUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS void OnDeleteAllTabsClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS void OnDeleteAllTabsUpdate( wxUpdateUIEvent& event ); ////@end wxRichTextTabsPage event handler declarations ////@begin wxRichTextTabsPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextTabsPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextTabsPage member variables wxTextCtrl* m_tabEditCtrl; wxListBox* m_tabListCtrl; /// Control identifiers enum { ID_RICHTEXTTABSPAGE = 10200, ID_RICHTEXTTABSPAGE_TABEDIT = 10213, ID_RICHTEXTTABSPAGE_TABLIST = 10214, ID_RICHTEXTTABSPAGE_NEW_TAB = 10201, ID_RICHTEXTTABSPAGE_DELETE_TAB = 10202, ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS = 10203 }; ////@end wxRichTextTabsPage member variables bool m_tabsPresent; }; #endif // _RICHTEXTTABSPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextborderspage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextborderspage.h // Purpose: A border editing page for the wxRTC formatting dialog. // Author: Julian Smart // Modified by: // Created: 21/10/2010 11:34:24 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTBORDERSPAGE_H_ #define _RICHTEXTBORDERSPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes #include "wx/notebook.h" #include "wx/statline.h" ////@end includes /*! * Forward declarations */ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextColourSwatchCtrl; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBorderPreviewCtrl; /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTBORDERSPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTBORDERSPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTBORDERSPAGE_IDNAME ID_RICHTEXTBORDERSPAGE #define SYMBOL_WXRICHTEXTBORDERSPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTBORDERSPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextBordersPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextBordersPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextBordersPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextBordersPage(); wxRichTextBordersPage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBORDERSPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBORDERSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBORDERSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBORDERSPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBORDERSPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBORDERSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBORDERSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBORDERSPAGE_STYLE ); /// Destructor ~wxRichTextBordersPage(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); /// Gets the attributes from the formatting dialog wxRichTextAttr* GetAttributes(); /// Data transfer virtual bool TransferDataToWindow() wxOVERRIDE; virtual bool TransferDataFromWindow() wxOVERRIDE; /// Updates the synchronization checkboxes to reflect the state of the attributes void UpdateSyncControls(); /// Updates the preview void OnCommand(wxCommandEvent& event); /// Fill style combo virtual void FillStyleComboBox(wxComboBox* styleComboBox); /// Set the border controls static void SetBorderValue(wxTextAttrBorder& border, wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox, wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles); /// Get data from the border controls static void GetBorderValue(wxTextAttrBorder& border, wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox, wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles); ////@begin wxRichTextBordersPage event handler declarations /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXT_BORDER_LEFT_CHECKBOX void OnRichtextBorderCheckboxClick( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXT_BORDER_LEFT void OnRichtextBorderLeftValueTextUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_LEFT void OnRichtextBorderLeftUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXT_BORDER_LEFT_UNITS void OnRichtextBorderLeftUnitsSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXT_BORDER_LEFT_STYLE void OnRichtextBorderLeftStyleSelected( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_RIGHT_CHECKBOX void OnRichtextBorderOtherCheckboxUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_RIGHT void OnRichtextBorderRightUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_TOP void OnRichtextBorderTopUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_BOTTOM void OnRichtextBorderBottomUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXT_BORDER_SYNCHRONIZE void OnRichtextBorderSynchronizeClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BORDER_SYNCHRONIZE void OnRichtextBorderSynchronizeUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXT_OUTLINE_LEFT void OnRichtextOutlineLeftTextUpdated( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_LEFT void OnRichtextOutlineLeftUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXT_OUTLINE_LEFT_UNITS void OnRichtextOutlineLeftUnitsSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXT_OUTLINE_LEFT_STYLE void OnRichtextOutlineLeftStyleSelected( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_RIGHT_CHECKBOX void OnRichtextOutlineOtherCheckboxUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_RIGHT void OnRichtextOutlineRightUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_TOP void OnRichtextOutlineTopUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_BOTTOM void OnRichtextOutlineBottomUpdate( wxUpdateUIEvent& event ); /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXT_OUTLINE_SYNCHRONIZE void OnRichtextOutlineSynchronizeClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_OUTLINE_SYNCHRONIZE void OnRichtextOutlineSynchronizeUpdate( wxUpdateUIEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBORDERSPAGE_CORNER_TEXT void OnRichtextborderspageCornerUpdate( wxUpdateUIEvent& event ); ////@end wxRichTextBordersPage event handler declarations ////@begin wxRichTextBordersPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextBordersPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextBordersPage member variables wxCheckBox* m_leftBorderCheckbox; wxTextCtrl* m_leftBorderWidth; wxComboBox* m_leftBorderWidthUnits; wxComboBox* m_leftBorderStyle; wxRichTextColourSwatchCtrl* m_leftBorderColour; wxCheckBox* m_rightBorderCheckbox; wxTextCtrl* m_rightBorderWidth; wxComboBox* m_rightBorderWidthUnits; wxComboBox* m_rightBorderStyle; wxRichTextColourSwatchCtrl* m_rightBorderColour; wxCheckBox* m_topBorderCheckbox; wxTextCtrl* m_topBorderWidth; wxComboBox* m_topBorderWidthUnits; wxComboBox* m_topBorderStyle; wxRichTextColourSwatchCtrl* m_topBorderColour; wxCheckBox* m_bottomBorderCheckbox; wxTextCtrl* m_bottomBorderWidth; wxComboBox* m_bottomBorderWidthUnits; wxComboBox* m_bottomBorderStyle; wxRichTextColourSwatchCtrl* m_bottomBorderColour; wxCheckBox* m_borderSyncCtrl; wxCheckBox* m_leftOutlineCheckbox; wxTextCtrl* m_leftOutlineWidth; wxComboBox* m_leftOutlineWidthUnits; wxComboBox* m_leftOutlineStyle; wxRichTextColourSwatchCtrl* m_leftOutlineColour; wxCheckBox* m_rightOutlineCheckbox; wxTextCtrl* m_rightOutlineWidth; wxComboBox* m_rightOutlineWidthUnits; wxComboBox* m_rightOutlineStyle; wxRichTextColourSwatchCtrl* m_rightOutlineColour; wxCheckBox* m_topOutlineCheckbox; wxTextCtrl* m_topOutlineWidth; wxComboBox* m_topOutlineWidthUnits; wxComboBox* m_topOutlineStyle; wxRichTextColourSwatchCtrl* m_topOutlineColour; wxCheckBox* m_bottomOutlineCheckbox; wxTextCtrl* m_bottomOutlineWidth; wxComboBox* m_bottomOutlineWidthUnits; wxComboBox* m_bottomOutlineStyle; wxRichTextColourSwatchCtrl* m_bottomOutlineColour; wxCheckBox* m_outlineSyncCtrl; wxCheckBox* m_cornerRadiusCheckBox; wxTextCtrl* m_cornerRadiusText; wxComboBox* m_cornerRadiusUnits; wxRichTextBorderPreviewCtrl* m_borderPreviewCtrl; /// Control identifiers enum { ID_RICHTEXTBORDERSPAGE = 10800, ID_RICHTEXTBORDERSPAGE_NOTEBOOK = 10801, ID_RICHTEXTBORDERSPAGE_BORDERS = 10802, ID_RICHTEXT_BORDER_LEFT_CHECKBOX = 10803, ID_RICHTEXT_BORDER_LEFT = 10804, ID_RICHTEXT_BORDER_LEFT_UNITS = 10805, ID_RICHTEXT_BORDER_LEFT_STYLE = 10806, ID_RICHTEXT_BORDER_LEFT_COLOUR = 10807, ID_RICHTEXT_BORDER_RIGHT_CHECKBOX = 10808, ID_RICHTEXT_BORDER_RIGHT = 10809, ID_RICHTEXT_BORDER_RIGHT_UNITS = 10810, ID_RICHTEXT_BORDER_RIGHT_STYLE = 10811, ID_RICHTEXT_BORDER_RIGHT_COLOUR = 10812, ID_RICHTEXT_BORDER_TOP_CHECKBOX = 10813, ID_RICHTEXT_BORDER_TOP = 10814, ID_RICHTEXT_BORDER_TOP_UNITS = 10815, ID_RICHTEXT_BORDER_TOP_STYLE = 10816, ID_RICHTEXT_BORDER_TOP_COLOUR = 10817, ID_RICHTEXT_BORDER_BOTTOM_CHECKBOX = 10818, ID_RICHTEXT_BORDER_BOTTOM = 10819, ID_RICHTEXT_BORDER_BOTTOM_UNITS = 10820, ID_RICHTEXT_BORDER_BOTTOM_STYLE = 10821, ID_RICHTEXT_BORDER_BOTTOM_COLOUR = 10822, ID_RICHTEXT_BORDER_SYNCHRONIZE = 10845, ID_RICHTEXTBORDERSPAGE_OUTLINE = 10823, ID_RICHTEXT_OUTLINE_LEFT_CHECKBOX = 10824, ID_RICHTEXT_OUTLINE_LEFT = 10825, ID_RICHTEXT_OUTLINE_LEFT_UNITS = 10826, ID_RICHTEXT_OUTLINE_LEFT_STYLE = 10827, ID_RICHTEXT_OUTLINE_LEFT_COLOUR = 10828, ID_RICHTEXT_OUTLINE_RIGHT_CHECKBOX = 10829, ID_RICHTEXT_OUTLINE_RIGHT = 10830, ID_RICHTEXT_OUTLINE_RIGHT_UNITS = 10831, ID_RICHTEXT_OUTLINE_RIGHT_STYLE = 10832, ID_RICHTEXT_OUTLINE_RIGHT_COLOUR = 10833, ID_RICHTEXT_OUTLINE_TOP_CHECKBOX = 10834, ID_RICHTEXT_OUTLINE_TOP = 10835, ID_RICHTEXT_OUTLINE_TOP_UNITS = 10836, ID_RICHTEXT_OUTLINE_TOP_STYLE = 10837, ID_RICHTEXT_OUTLINE_TOP_COLOUR = 10838, ID_RICHTEXT_OUTLINE_BOTTOM_CHECKBOX = 10839, ID_RICHTEXT_OUTLINE_BOTTOM = 10840, ID_RICHTEXT_OUTLINE_BOTTOM_UNITS = 10841, ID_RICHTEXT_OUTLINE_BOTTOM_STYLE = 10842, ID_RICHTEXT_OUTLINE_BOTTOM_COLOUR = 10843, ID_RICHTEXT_OUTLINE_SYNCHRONIZE = 10846, ID_RICHTEXTBORDERSPAGE_CORNER = 10847, ID_RICHTEXTBORDERSPAGE_CORNER_CHECKBOX = 10848, ID_RICHTEXTBORDERSPAGE_CORNER_TEXT = 10849, ID_RICHTEXTBORDERSPAGE_CORNER_UNITS = 10850, ID_RICHTEXT_BORDER_PREVIEW = 10844 }; ////@end wxRichTextBordersPage member variables wxArrayInt m_borderStyles; wxArrayString m_borderStyleNames; bool m_ignoreUpdates; }; class WXDLLIMPEXP_RICHTEXT wxRichTextBorderPreviewCtrl : public wxWindow { public: wxRichTextBorderPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0); void SetAttributes(wxRichTextAttr* attr) { m_attributes = attr; } wxRichTextAttr* GetAttributes() const { return m_attributes; } private: wxRichTextAttr* m_attributes; void OnPaint(wxPaintEvent& event); wxDECLARE_EVENT_TABLE(); }; #endif // _RICHTEXTBORDERSPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextbuffer.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextbuffer.h // Purpose: Buffer for wxRichTextCtrl // Author: Julian Smart // Modified by: // Created: 2005-09-30 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTBUFFER_H_ #define _WX_RICHTEXTBUFFER_H_ /* Data structures =============== Data is represented by a hierarchy of objects, all derived from wxRichTextObject. The top of the hierarchy is the buffer, a kind of wxRichTextParagraphLayoutBox. These boxes will allow flexible placement of text boxes on a page, but for now there is a single box representing the document, and this box is a wxRichTextParagraphLayoutBox which contains further wxRichTextParagraph objects, each of which can include text and images. Each object maintains a range (start and end position) measured from the start of the main parent box. A paragraph object knows its range, and a text fragment knows its range too. So, a character or image in a page has a position relative to the start of the document, and a character in an embedded text box has a position relative to that text box. For now, we will not be dealing with embedded objects but it's something to bear in mind for later. Note that internally, a range (5,5) represents a range of one character. In the public wx[Rich]TextCtrl API, this would be passed to e.g. SetSelection as (5,6). A paragraph with one character might have an internal range of (0, 1) since the end of the paragraph takes up one position. Layout ====== When Layout is called on an object, it is given a size which the object must limit itself to, or one or more flexible directions (vertical or horizontal). So for example a centered paragraph is given the page width to play with (minus any margins), but can extend indefinitely in the vertical direction. The implementation of Layout can then cache the calculated size and position within the parent. */ /*! * Includes */ #include "wx/defs.h" #if wxUSE_RICHTEXT #include "wx/list.h" #include "wx/textctrl.h" #include "wx/bitmap.h" #include "wx/image.h" #include "wx/cmdproc.h" #include "wx/txtstrm.h" #include "wx/variant.h" #include "wx/position.h" #if wxUSE_DATAOBJ #include "wx/dataobj.h" #endif // Compatibility //#define wxRichTextAttr wxTextAttr #define wxTextAttrEx wxTextAttr // Setting wxRICHTEXT_USE_OWN_CARET to 1 implements a // caret reliably without using wxClientDC in case there // are platform-specific problems with the generic caret. #if defined(__WXGTK__) || defined(__WXMAC__) #define wxRICHTEXT_USE_OWN_CARET 1 #else #define wxRICHTEXT_USE_OWN_CARET 0 #endif // Switch off for binary compatibility, on for faster drawing // Note: this seems to be buggy (overzealous use of extents) so // don't use for now #define wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING 0 // The following two symbols determine whether an output implementation // is present. To switch the relevant one on, set wxRICHTEXT_USE_XMLDOCUMENT_OUTPUT in // richtextxml.cpp. By default, the faster direct output implementation is used. // Include the wxXmlDocument implementation for output #define wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT 1 // Include the faster, direct implementation for output #define wxRICHTEXT_HAVE_DIRECT_OUTPUT 1 /** The line break character that can be embedded in content. */ extern WXDLLIMPEXP_RICHTEXT const wxChar wxRichTextLineBreakChar; /** File types in wxRichText context. */ enum wxRichTextFileType { wxRICHTEXT_TYPE_ANY = 0, wxRICHTEXT_TYPE_TEXT, wxRICHTEXT_TYPE_XML, wxRICHTEXT_TYPE_HTML, wxRICHTEXT_TYPE_RTF, wxRICHTEXT_TYPE_PDF }; /* * Forward declarations */ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObject; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextImage; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextPlainText; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCacheObject; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObjectList; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextLine; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextParagraph; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFileHandler; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextDrawingHandler; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextField; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFieldType; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleSheet; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextListStyleDefinition; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextEvent; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextRenderer; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextXMLHandler; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextParagraphLayoutBox; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextImageBlock; class WXDLLIMPEXP_FWD_XML wxXmlNode; class wxRichTextFloatCollector; class WXDLLIMPEXP_FWD_BASE wxDataInputStream; class WXDLLIMPEXP_FWD_BASE wxDataOutputStream; /** Flags determining the available space, passed to Layout. */ #define wxRICHTEXT_FIXED_WIDTH 0x01 #define wxRICHTEXT_FIXED_HEIGHT 0x02 #define wxRICHTEXT_VARIABLE_WIDTH 0x04 #define wxRICHTEXT_VARIABLE_HEIGHT 0x08 // Only lay out the part of the buffer that lies within // the rect passed to Layout. #define wxRICHTEXT_LAYOUT_SPECIFIED_RECT 0x10 /** Flags to pass to Draw */ // Ignore paragraph cache optimization, e.g. for printing purposes // where one line may be drawn higher (on the next page) compared // with the previous line #define wxRICHTEXT_DRAW_IGNORE_CACHE 0x01 #define wxRICHTEXT_DRAW_SELECTED 0x02 #define wxRICHTEXT_DRAW_PRINT 0x04 #define wxRICHTEXT_DRAW_GUIDELINES 0x08 /** Flags returned from hit-testing, or passed to hit-test function. */ enum wxRichTextHitTestFlags { // The point was not on this object wxRICHTEXT_HITTEST_NONE = 0x01, // The point was before the position returned from HitTest wxRICHTEXT_HITTEST_BEFORE = 0x02, // The point was after the position returned from HitTest wxRICHTEXT_HITTEST_AFTER = 0x04, // The point was on the position returned from HitTest wxRICHTEXT_HITTEST_ON = 0x08, // The point was on space outside content wxRICHTEXT_HITTEST_OUTSIDE = 0x10, // Only do hit-testing at the current level (don't traverse into top-level objects) wxRICHTEXT_HITTEST_NO_NESTED_OBJECTS = 0x20, // Ignore floating objects wxRICHTEXT_HITTEST_NO_FLOATING_OBJECTS = 0x40, // Don't recurse into objects marked as atomic wxRICHTEXT_HITTEST_HONOUR_ATOMIC = 0x80 }; /** Flags for GetRangeSize. */ #define wxRICHTEXT_FORMATTED 0x01 #define wxRICHTEXT_UNFORMATTED 0x02 #define wxRICHTEXT_CACHE_SIZE 0x04 #define wxRICHTEXT_HEIGHT_ONLY 0x08 /** Flags for SetStyle/SetListStyle. */ #define wxRICHTEXT_SETSTYLE_NONE 0x00 // Specifies that this operation should be undoable #define wxRICHTEXT_SETSTYLE_WITH_UNDO 0x01 // Specifies that the style should not be applied if the // combined style at this point is already the style in question. #define wxRICHTEXT_SETSTYLE_OPTIMIZE 0x02 // Specifies that the style should only be applied to paragraphs, // and not the content. This allows content styling to be // preserved independently from that of e.g. a named paragraph style. #define wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY 0x04 // Specifies that the style should only be applied to characters, // and not the paragraph. This allows content styling to be // preserved independently from that of e.g. a named paragraph style. #define wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY 0x08 // For SetListStyle only: specifies starting from the given number, otherwise // deduces number from existing attributes #define wxRICHTEXT_SETSTYLE_RENUMBER 0x10 // For SetListStyle only: specifies the list level for all paragraphs, otherwise // the current indentation will be used #define wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL 0x20 // Resets the existing style before applying the new style #define wxRICHTEXT_SETSTYLE_RESET 0x40 // Removes the given style instead of applying it #define wxRICHTEXT_SETSTYLE_REMOVE 0x80 /** Flags for SetProperties. */ #define wxRICHTEXT_SETPROPERTIES_NONE 0x00 // Specifies that this operation should be undoable #define wxRICHTEXT_SETPROPERTIES_WITH_UNDO 0x01 // Specifies that the properties should only be applied to paragraphs, // and not the content. #define wxRICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY 0x02 // Specifies that the properties should only be applied to characters, // and not the paragraph. #define wxRICHTEXT_SETPROPERTIES_CHARACTERS_ONLY 0x04 // Resets the existing properties before applying the new properties. #define wxRICHTEXT_SETPROPERTIES_RESET 0x08 // Removes the given properties instead of applying them. #define wxRICHTEXT_SETPROPERTIES_REMOVE 0x10 /** Flags for object insertion. */ #define wxRICHTEXT_INSERT_NONE 0x00 #define wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE 0x01 #define wxRICHTEXT_INSERT_INTERACTIVE 0x02 // A special flag telling the buffer to keep the first paragraph style // as-is, when deleting a paragraph marker. In future we might pass a // flag to InsertFragment and DeleteRange to indicate the appropriate mode. #define wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE 0x20000000 /** Default superscript/subscript font multiplication factor. */ #define wxSCRIPT_MUL_FACTOR 1.5 /** The type for wxTextAttrDimension flags. */ typedef unsigned short wxTextAttrDimensionFlags; /** Miscellaneous text box flags */ enum wxTextBoxAttrFlags { wxTEXT_BOX_ATTR_FLOAT = 0x00000001, wxTEXT_BOX_ATTR_CLEAR = 0x00000002, wxTEXT_BOX_ATTR_COLLAPSE_BORDERS = 0x00000004, wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT = 0x00000008, wxTEXT_BOX_ATTR_BOX_STYLE_NAME = 0x00000010, wxTEXT_BOX_ATTR_WHITESPACE = 0x00000020, wxTEXT_BOX_ATTR_CORNER_RADIUS = 0x00000040 }; /** Whether a value is present, used in dimension flags. */ enum wxTextAttrValueFlags { wxTEXT_ATTR_VALUE_VALID = 0x1000, wxTEXT_ATTR_VALUE_VALID_MASK = 0x1000 }; /** Units, included in the dimension value. */ enum wxTextAttrUnits { wxTEXT_ATTR_UNITS_TENTHS_MM = 0x0001, wxTEXT_ATTR_UNITS_PIXELS = 0x0002, wxTEXT_ATTR_UNITS_PERCENTAGE = 0x0004, wxTEXT_ATTR_UNITS_POINTS = 0x0008, wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT = 0x0100, wxTEXT_ATTR_UNITS_MASK = 0x010F }; /** Position alternatives, included in the dimension flags. */ enum wxTextBoxAttrPosition { wxTEXT_BOX_ATTR_POSITION_STATIC = 0x0000, // Default is static, i.e. as per normal layout wxTEXT_BOX_ATTR_POSITION_RELATIVE = 0x0010, // Relative to the relevant edge wxTEXT_BOX_ATTR_POSITION_ABSOLUTE = 0x0020, // Relative to the parent wxTEXT_BOX_ATTR_POSITION_FIXED = 0x0040, // Relative to the top-level window wxTEXT_BOX_ATTR_POSITION_MASK = 0x00F0 }; /** @class wxTextAttrDimension A class representing a rich text dimension, including units and position. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl, wxTextAttrDimensions */ class WXDLLIMPEXP_RICHTEXT wxTextAttrDimension { public: /** Default constructor. */ wxTextAttrDimension() { Reset(); } /** Constructor taking value and units flag. */ wxTextAttrDimension(int value, wxTextAttrUnits units = wxTEXT_ATTR_UNITS_TENTHS_MM) { m_value = value; m_flags = units|wxTEXT_ATTR_VALUE_VALID; } /** Resets the dimension value and flags. */ void Reset() { m_value = 0; m_flags = 0; } /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a dim are present. If @a weakTest is @false, the function will fail if an attribute is present in @a dim but not in this object. */ bool EqPartial(const wxTextAttrDimension& dim, bool weakTest = true) const; /** Apply the dimension, but not those identical to @a compareWith if present. */ bool Apply(const wxTextAttrDimension& dim, const wxTextAttrDimension* compareWith = NULL); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextAttrDimension& attr, wxTextAttrDimension& clashingAttr, wxTextAttrDimension& absentAttr); /** Equality operator. */ bool operator==(const wxTextAttrDimension& dim) const { return m_value == dim.m_value && m_flags == dim.m_flags; } /** Returns the integer value of the dimension. */ int GetValue() const { return m_value; } /** Returns the floating-pointing value of the dimension in mm. */ float GetValueMM() const { return m_value / 10.0f; } /** Sets the value of the dimension in mm. */ void SetValueMM(float value) { m_value = (int) ((value * 10.0f) + 0.5f); m_flags |= wxTEXT_ATTR_VALUE_VALID; } /** Sets the integer value of the dimension. */ void SetValue(int value) { m_value = value; m_flags |= wxTEXT_ATTR_VALUE_VALID; } /** Sets the integer value of the dimension, passing dimension flags. */ void SetValue(int value, wxTextAttrDimensionFlags flags) { SetValue(value); m_flags = flags; } /** Sets the integer value and units. */ void SetValue(int value, wxTextAttrUnits units) { m_value = value; m_flags = units | wxTEXT_ATTR_VALUE_VALID; } /** Sets the dimension. */ void SetValue(const wxTextAttrDimension& dim) { (*this) = dim; } /** Gets the units of the dimension. */ wxTextAttrUnits GetUnits() const { return (wxTextAttrUnits) (m_flags & wxTEXT_ATTR_UNITS_MASK); } /** Sets the units of the dimension. */ void SetUnits(wxTextAttrUnits units) { m_flags &= ~wxTEXT_ATTR_UNITS_MASK; m_flags |= units; } /** Gets the position flags. */ wxTextBoxAttrPosition GetPosition() const { return (wxTextBoxAttrPosition) (m_flags & wxTEXT_BOX_ATTR_POSITION_MASK); } /** Sets the position flags. */ void SetPosition(wxTextBoxAttrPosition pos) { m_flags &= ~wxTEXT_BOX_ATTR_POSITION_MASK; m_flags |= pos; } /** Returns @true if the dimension is valid. */ bool IsValid() const { return (m_flags & wxTEXT_ATTR_VALUE_VALID) != 0; } /** Sets the valid flag. */ void SetValid(bool b) { m_flags &= ~wxTEXT_ATTR_VALUE_VALID_MASK; m_flags |= (b ? wxTEXT_ATTR_VALUE_VALID : 0); } /** Gets the dimension flags. */ wxTextAttrDimensionFlags GetFlags() const { return m_flags; } /** Sets the dimension flags. */ void SetFlags(wxTextAttrDimensionFlags flags) { m_flags = flags; } int m_value; wxTextAttrDimensionFlags m_flags; }; /** @class wxTextAttrDimensions A class for left, right, top and bottom dimensions. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl, wxTextAttrDimension */ class WXDLLIMPEXP_RICHTEXT wxTextAttrDimensions { public: /** Default constructor. */ wxTextAttrDimensions() {} /** Resets the value and flags for all dimensions. */ void Reset() { m_left.Reset(); m_top.Reset(); m_right.Reset(); m_bottom.Reset(); } /** Equality operator. */ bool operator==(const wxTextAttrDimensions& dims) const { return m_left == dims.m_left && m_top == dims.m_top && m_right == dims.m_right && m_bottom == dims.m_bottom; } /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a dims are present. If @a weakTest is @false, the function will fail if an attribute is present in @a dims but not in this object. */ bool EqPartial(const wxTextAttrDimensions& dims, bool weakTest = true) const; /** Apply to 'this', but not if the same as @a compareWith. */ bool Apply(const wxTextAttrDimensions& dims, const wxTextAttrDimensions* compareWith = NULL); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextAttrDimensions& attr, wxTextAttrDimensions& clashingAttr, wxTextAttrDimensions& absentAttr); /** Remove specified attributes from this object. */ bool RemoveStyle(const wxTextAttrDimensions& attr); /** Gets the left dimension. */ const wxTextAttrDimension& GetLeft() const { return m_left; } wxTextAttrDimension& GetLeft() { return m_left; } /** Gets the right dimension. */ const wxTextAttrDimension& GetRight() const { return m_right; } wxTextAttrDimension& GetRight() { return m_right; } /** Gets the top dimension. */ const wxTextAttrDimension& GetTop() const { return m_top; } wxTextAttrDimension& GetTop() { return m_top; } /** Gets the bottom dimension. */ const wxTextAttrDimension& GetBottom() const { return m_bottom; } wxTextAttrDimension& GetBottom() { return m_bottom; } /** Are all dimensions valid? */ bool IsValid() const { return m_left.IsValid() && m_top.IsValid() && m_right.IsValid() && m_bottom.IsValid(); } wxTextAttrDimension m_left; wxTextAttrDimension m_top; wxTextAttrDimension m_right; wxTextAttrDimension m_bottom; }; /** @class wxTextAttrSize A class for representing width and height. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl, wxTextAttrDimension */ class WXDLLIMPEXP_RICHTEXT wxTextAttrSize { public: /** Default constructor. */ wxTextAttrSize() {} /** Resets the width and height dimensions. */ void Reset() { m_width.Reset(); m_height.Reset(); } /** Equality operator. */ bool operator==(const wxTextAttrSize& size) const { return m_width == size.m_width && m_height == size.m_height ; } /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a size are present. If @a weakTest is @false, the function will fail if an attribute is present in @a size but not in this object. */ bool EqPartial(const wxTextAttrSize& size, bool weakTest = true) const; /** Apply to this object, but not if the same as @a compareWith. */ bool Apply(const wxTextAttrSize& dims, const wxTextAttrSize* compareWith = NULL); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextAttrSize& attr, wxTextAttrSize& clashingAttr, wxTextAttrSize& absentAttr); /** Removes the specified attributes from this object. */ bool RemoveStyle(const wxTextAttrSize& attr); /** Returns the width. */ wxTextAttrDimension& GetWidth() { return m_width; } const wxTextAttrDimension& GetWidth() const { return m_width; } /** Sets the width. */ void SetWidth(int value, wxTextAttrDimensionFlags flags) { m_width.SetValue(value, flags); } /** Sets the width. */ void SetWidth(int value, wxTextAttrUnits units) { m_width.SetValue(value, units); } /** Sets the width. */ void SetWidth(const wxTextAttrDimension& dim) { m_width.SetValue(dim); } /** Gets the height. */ wxTextAttrDimension& GetHeight() { return m_height; } const wxTextAttrDimension& GetHeight() const { return m_height; } /** Sets the height. */ void SetHeight(int value, wxTextAttrDimensionFlags flags) { m_height.SetValue(value, flags); } /** Sets the height. */ void SetHeight(int value, wxTextAttrUnits units) { m_height.SetValue(value, units); } /** Sets the height. */ void SetHeight(const wxTextAttrDimension& dim) { m_height.SetValue(dim); } /** Is the size valid? */ bool IsValid() const { return m_width.IsValid() && m_height.IsValid(); } wxTextAttrDimension m_width; wxTextAttrDimension m_height; }; /** @class wxTextAttrDimensionConverter A class to make it easier to convert dimensions. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl, wxTextAttrDimension */ class WXDLLIMPEXP_RICHTEXT wxTextAttrDimensionConverter { public: /** Constructor. */ wxTextAttrDimensionConverter(wxDC& dc, double scale = 1.0, const wxSize& parentSize = wxDefaultSize); /** Constructor. */ wxTextAttrDimensionConverter(int ppi, double scale = 1.0, const wxSize& parentSize = wxDefaultSize); /** Gets the pixel size for the given dimension. */ int GetPixels(const wxTextAttrDimension& dim, int direction = wxHORIZONTAL) const; /** Gets the mm size for the given dimension. */ int GetTenthsMM(const wxTextAttrDimension& dim) const; /** Converts tenths of a mm to pixels. */ int ConvertTenthsMMToPixels(int units) const; /** Converts pixels to tenths of a mm. */ int ConvertPixelsToTenthsMM(int pixels) const; /** Sets the scale factor. */ void SetScale(double scale) { m_scale = scale; } /** Returns the scale factor. */ double GetScale() const { return m_scale; } /** Sets the ppi. */ void SetPPI(int ppi) { m_ppi = ppi; } /** Returns the ppi. */ int GetPPI() const { return m_ppi; } /** Sets the parent size. */ void SetParentSize(const wxSize& parentSize) { m_parentSize = parentSize; } /** Returns the parent size. */ const wxSize& GetParentSize() const { return m_parentSize; } int m_ppi; double m_scale; wxSize m_parentSize; }; /** Border styles, used with wxTextAttrBorder. */ enum wxTextAttrBorderStyle { wxTEXT_BOX_ATTR_BORDER_NONE = 0, wxTEXT_BOX_ATTR_BORDER_SOLID = 1, wxTEXT_BOX_ATTR_BORDER_DOTTED = 2, wxTEXT_BOX_ATTR_BORDER_DASHED = 3, wxTEXT_BOX_ATTR_BORDER_DOUBLE = 4, wxTEXT_BOX_ATTR_BORDER_GROOVE = 5, wxTEXT_BOX_ATTR_BORDER_RIDGE = 6, wxTEXT_BOX_ATTR_BORDER_INSET = 7, wxTEXT_BOX_ATTR_BORDER_OUTSET = 8 }; /** Border style presence flags, used with wxTextAttrBorder. */ enum wxTextAttrBorderFlags { wxTEXT_BOX_ATTR_BORDER_STYLE = 0x0001, wxTEXT_BOX_ATTR_BORDER_COLOUR = 0x0002 }; /** Border width symbols for qualitative widths, used with wxTextAttrBorder. */ enum wxTextAttrBorderWidth { wxTEXT_BOX_ATTR_BORDER_THIN = -1, wxTEXT_BOX_ATTR_BORDER_MEDIUM = -2, wxTEXT_BOX_ATTR_BORDER_THICK = -3 }; /** Float styles. */ enum wxTextBoxAttrFloatStyle { wxTEXT_BOX_ATTR_FLOAT_NONE = 0, wxTEXT_BOX_ATTR_FLOAT_LEFT = 1, wxTEXT_BOX_ATTR_FLOAT_RIGHT = 2 }; /** Clear styles. */ enum wxTextBoxAttrClearStyle { wxTEXT_BOX_ATTR_CLEAR_NONE = 0, wxTEXT_BOX_ATTR_CLEAR_LEFT = 1, wxTEXT_BOX_ATTR_CLEAR_RIGHT = 2, wxTEXT_BOX_ATTR_CLEAR_BOTH = 3 }; /** Collapse mode styles. */ enum wxTextBoxAttrCollapseMode { wxTEXT_BOX_ATTR_COLLAPSE_NONE = 0, wxTEXT_BOX_ATTR_COLLAPSE_FULL = 1 }; /** Vertical alignment values. */ enum wxTextBoxAttrVerticalAlignment { wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_NONE = 0, wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_TOP = 1, wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_CENTRE = 2, wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_BOTTOM = 3 }; /** Whitespace values mirroring the CSS white-space attribute. Only wxTEXT_BOX_ATTR_WHITESPACE_NO_WRAP is currently implemented, in table cells. */ enum wxTextBoxAttrWhitespaceMode { wxTEXT_BOX_ATTR_WHITESPACE_NONE = 0, wxTEXT_BOX_ATTR_WHITESPACE_NORMAL = 1, wxTEXT_BOX_ATTR_WHITESPACE_NO_WRAP = 2, wxTEXT_BOX_ATTR_WHITESPACE_PREFORMATTED = 3, wxTEXT_BOX_ATTR_WHITESPACE_PREFORMATTED_LINE = 4, wxTEXT_BOX_ATTR_WHITESPACE_PREFORMATTED_WRAP = 5 }; /** @class wxTextAttrBorder A class representing a rich text object border. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl, wxRichTextAttrBorders */ class WXDLLIMPEXP_RICHTEXT wxTextAttrBorder { public: /** Default constructor. */ wxTextAttrBorder() { Reset(); } /** Equality operator. */ bool operator==(const wxTextAttrBorder& border) const { return m_flags == border.m_flags && m_borderStyle == border.m_borderStyle && m_borderColour == border.m_borderColour && m_borderWidth == border.m_borderWidth; } /** Resets the border style, colour, width and flags. */ void Reset() { m_borderStyle = 0; m_borderColour = 0; m_flags = 0; m_borderWidth.Reset(); } /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a border are present. If @a weakTest is @false, the function will fail if an attribute is present in @a border but not in this object. */ bool EqPartial(const wxTextAttrBorder& border, bool weakTest = true) const; /** Applies the border to this object, but not if the same as @a compareWith. */ bool Apply(const wxTextAttrBorder& border, const wxTextAttrBorder* compareWith = NULL); /** Removes the specified attributes from this object. */ bool RemoveStyle(const wxTextAttrBorder& attr); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextAttrBorder& attr, wxTextAttrBorder& clashingAttr, wxTextAttrBorder& absentAttr); /** Sets the border style. */ void SetStyle(int style) { m_borderStyle = style; m_flags |= wxTEXT_BOX_ATTR_BORDER_STYLE; } /** Gets the border style. */ int GetStyle() const { return m_borderStyle; } /** Sets the border colour. */ void SetColour(unsigned long colour) { m_borderColour = colour; m_flags |= wxTEXT_BOX_ATTR_BORDER_COLOUR; } /** Sets the border colour. */ void SetColour(const wxColour& colour) { m_borderColour = colour.GetRGB(); m_flags |= wxTEXT_BOX_ATTR_BORDER_COLOUR; } /** Gets the colour as a long. */ unsigned long GetColourLong() const { return m_borderColour; } /** Gets the colour. */ wxColour GetColour() const { return wxColour(m_borderColour); } /** Gets the border width. */ wxTextAttrDimension& GetWidth() { return m_borderWidth; } const wxTextAttrDimension& GetWidth() const { return m_borderWidth; } /** Sets the border width. */ void SetWidth(const wxTextAttrDimension& width) { m_borderWidth = width; } /** Sets the border width. */ void SetWidth(int value, wxTextAttrUnits units = wxTEXT_ATTR_UNITS_TENTHS_MM) { SetWidth(wxTextAttrDimension(value, units)); } /** True if the border has a valid style. */ bool HasStyle() const { return (m_flags & wxTEXT_BOX_ATTR_BORDER_STYLE) != 0; } /** True if the border has a valid colour. */ bool HasColour() const { return (m_flags & wxTEXT_BOX_ATTR_BORDER_COLOUR) != 0; } /** True if the border has a valid width. */ bool HasWidth() const { return m_borderWidth.IsValid(); } /** True if the border is valid. */ bool IsValid() const { return HasWidth(); } /** Set the valid flag for this border. */ void MakeValid() { m_borderWidth.SetValid(true); } /** True if the border has no attributes set. */ bool IsDefault() const { return (m_flags == 0); } /** Returns the border flags. */ int GetFlags() const { return m_flags; } /** Sets the border flags. */ void SetFlags(int flags) { m_flags = flags; } /** Adds a border flag. */ void AddFlag(int flag) { m_flags |= flag; } /** Removes a border flag. */ void RemoveFlag(int flag) { m_flags &= ~flag; } int m_borderStyle; unsigned long m_borderColour; wxTextAttrDimension m_borderWidth; int m_flags; }; /** @class wxTextAttrBorders A class representing a rich text object's borders. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl, wxRichTextAttrBorder */ class WXDLLIMPEXP_RICHTEXT wxTextAttrBorders { public: /** Default constructor. */ wxTextAttrBorders() { } /** Equality operator. */ bool operator==(const wxTextAttrBorders& borders) const { return m_left == borders.m_left && m_right == borders.m_right && m_top == borders.m_top && m_bottom == borders.m_bottom; } /** Sets the style of all borders. */ void SetStyle(int style); /** Sets colour of all borders. */ void SetColour(unsigned long colour); /** Sets the colour for all borders. */ void SetColour(const wxColour& colour); /** Sets the width of all borders. */ void SetWidth(const wxTextAttrDimension& width); /** Sets the width of all borders. */ void SetWidth(int value, wxTextAttrUnits units = wxTEXT_ATTR_UNITS_TENTHS_MM) { SetWidth(wxTextAttrDimension(value, units)); } /** Resets all borders. */ void Reset() { m_left.Reset(); m_right.Reset(); m_top.Reset(); m_bottom.Reset(); } /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a borders are present. If @a weakTest is @false, the function will fail if an attribute is present in @a borders but not in this object. */ bool EqPartial(const wxTextAttrBorders& borders, bool weakTest = true) const; /** Applies border to this object, but not if the same as @a compareWith. */ bool Apply(const wxTextAttrBorders& borders, const wxTextAttrBorders* compareWith = NULL); /** Removes the specified attributes from this object. */ bool RemoveStyle(const wxTextAttrBorders& attr); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextAttrBorders& attr, wxTextAttrBorders& clashingAttr, wxTextAttrBorders& absentAttr); /** Returns @true if at least one border is valid. */ bool IsValid() const { return m_left.IsValid() || m_right.IsValid() || m_top.IsValid() || m_bottom.IsValid(); } /** Returns @true if no border attributes were set. */ bool IsDefault() const { return m_left.IsDefault() && m_right.IsDefault() && m_top.IsDefault() && m_bottom.IsDefault(); } /** Returns the left border. */ const wxTextAttrBorder& GetLeft() const { return m_left; } wxTextAttrBorder& GetLeft() { return m_left; } /** Returns the right border. */ const wxTextAttrBorder& GetRight() const { return m_right; } wxTextAttrBorder& GetRight() { return m_right; } /** Returns the top border. */ const wxTextAttrBorder& GetTop() const { return m_top; } wxTextAttrBorder& GetTop() { return m_top; } /** Returns the bottom border. */ const wxTextAttrBorder& GetBottom() const { return m_bottom; } wxTextAttrBorder& GetBottom() { return m_bottom; } wxTextAttrBorder m_left, m_right, m_top, m_bottom; }; /** @class wxTextAttrShadow A class representing a shadow. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxTextAttrShadow { public: /** Default constructor. */ wxTextAttrShadow() { Reset(); } /** Equality operator. */ bool operator==(const wxTextAttrShadow& shadow) const; /** Resets the shadow. */ void Reset(); /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a border are present. If @a weakTest is @false, the function will fail if an attribute is present in @a border but not in this object. */ bool EqPartial(const wxTextAttrShadow& shadow, bool weakTest = true) const; /** Applies the border to this object, but not if the same as @a compareWith. */ bool Apply(const wxTextAttrShadow& shadow, const wxTextAttrShadow* compareWith = NULL); /** Removes the specified attributes from this object. */ bool RemoveStyle(const wxTextAttrShadow& attr); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextAttrShadow& attr, wxTextAttrShadow& clashingAttr, wxTextAttrShadow& absentAttr); /** Sets the shadow colour. */ void SetColour(unsigned long colour) { m_shadowColour = colour; m_flags |= wxTEXT_BOX_ATTR_BORDER_COLOUR; } /** Sets the shadow colour. */ #if wxCHECK_VERSION(2,9,0) void SetColour(const wxColour& colour) { m_shadowColour = colour.GetRGB(); m_flags |= wxTEXT_BOX_ATTR_BORDER_COLOUR; } #else void SetColour(const wxColour& colour) { m_shadowColour = (colour.Red() | (colour.Green() << 8) | (colour.Blue() << 16)); m_flags |= wxTEXT_BOX_ATTR_BORDER_COLOUR; } #endif /** Gets the colour as a long. */ unsigned long GetColourLong() const { return m_shadowColour; } /** Gets the colour. */ wxColour GetColour() const { return wxColour(m_shadowColour); } /** True if the shadow has a valid colour. */ bool HasColour() const { return (m_flags & wxTEXT_BOX_ATTR_BORDER_COLOUR) != 0; } /** Gets the shadow horizontal offset. */ wxTextAttrDimension& GetOffsetX() { return m_offsetX; } const wxTextAttrDimension& GetOffsetX() const { return m_offsetX; } /** Sets the shadow horizontal offset. */ void SetOffsetX(const wxTextAttrDimension& offset) { m_offsetX = offset; } /** Gets the shadow vertical offset. */ wxTextAttrDimension& GetOffsetY() { return m_offsetY; } const wxTextAttrDimension& GetOffsetY() const { return m_offsetY; } /** Sets the shadow vertical offset. */ void SetOffsetY(const wxTextAttrDimension& offset) { m_offsetY = offset; } /** Gets the shadow spread size. */ wxTextAttrDimension& GetSpread() { return m_spread; } const wxTextAttrDimension& GetSpread() const { return m_spread; } /** Sets the shadow spread size. */ void SetSpread(const wxTextAttrDimension& spread) { m_spread = spread; } /** Gets the shadow blur distance. */ wxTextAttrDimension& GetBlurDistance() { return m_blurDistance; } const wxTextAttrDimension& GetBlurDistance() const { return m_blurDistance; } /** Sets the shadow blur distance. */ void SetBlurDistance(const wxTextAttrDimension& blur) { m_blurDistance = blur; } /** Gets the shadow opacity. */ wxTextAttrDimension& GetOpacity() { return m_opacity; } const wxTextAttrDimension& GetOpacity() const { return m_opacity; } /** Returns @true if the dimension is valid. */ bool IsValid() const { return (m_flags & wxTEXT_ATTR_VALUE_VALID) != 0; } /** Sets the valid flag. */ void SetValid(bool b) { m_flags &= ~wxTEXT_ATTR_VALUE_VALID_MASK; m_flags |= (b ? wxTEXT_ATTR_VALUE_VALID : 0); } /** Returns the border flags. */ int GetFlags() const { return m_flags; } /** Sets the border flags. */ void SetFlags(int flags) { m_flags = flags; } /** Adds a border flag. */ void AddFlag(int flag) { m_flags |= flag; } /** Removes a border flag. */ void RemoveFlag(int flag) { m_flags &= ~flag; } /** Sets the shadow opacity. */ void SetOpacity(const wxTextAttrDimension& opacity) { m_opacity = opacity; } /** True if the shadow has no attributes set. */ bool IsDefault() const { return !HasColour() && !m_offsetX.IsValid() && !m_offsetY.IsValid() && !m_spread.IsValid() && !m_blurDistance.IsValid() && !m_opacity.IsValid(); } int m_flags; unsigned long m_shadowColour; wxTextAttrDimension m_offsetX; wxTextAttrDimension m_offsetY; wxTextAttrDimension m_spread; wxTextAttrDimension m_blurDistance; wxTextAttrDimension m_opacity; }; /** @class wxTextBoxAttr A class representing the box attributes of a rich text object. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxTextBoxAttr { public: /** Default constructor. */ wxTextBoxAttr() { Init(); } /** Copy constructor. */ wxTextBoxAttr(const wxTextBoxAttr& attr) { Init(); (*this) = attr; } /** Initialises this object. */ void Init() { Reset(); } /** Resets this object. */ void Reset(); // Copy. Unnecessary since we let it do a binary copy //void Copy(const wxTextBoxAttr& attr); // Assignment //void operator= (const wxTextBoxAttr& attr); /** Equality test. */ bool operator== (const wxTextBoxAttr& attr) const; /** Partial equality test, ignoring unset attributes. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a attr are present. If @a weakTest is @false, the function will fail if an attribute is present in @a attr but not in this object. */ bool EqPartial(const wxTextBoxAttr& attr, bool weakTest = true) const; /** Merges the given attributes. If @a compareWith is non-NULL, then it will be used to mask out those attributes that are the same in style and @a compareWith, for situations where we don't want to explicitly set inherited attributes. */ bool Apply(const wxTextBoxAttr& style, const wxTextBoxAttr* compareWith = NULL); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxTextBoxAttr& attr, wxTextBoxAttr& clashingAttr, wxTextBoxAttr& absentAttr); /** Removes the specified attributes from this object. */ bool RemoveStyle(const wxTextBoxAttr& attr); /** Sets the flags. */ void SetFlags(int flags) { m_flags = flags; } /** Returns the flags. */ int GetFlags() const { return m_flags; } /** Is this flag present? */ bool HasFlag(wxTextBoxAttrFlags flag) const { return (m_flags & flag) != 0; } /** Removes this flag. */ void RemoveFlag(wxTextBoxAttrFlags flag) { m_flags &= ~flag; } /** Adds this flag. */ void AddFlag(wxTextBoxAttrFlags flag) { m_flags |= flag; } /** Returns @true if no attributes are set. */ bool IsDefault() const; /** Returns the float mode. */ wxTextBoxAttrFloatStyle GetFloatMode() const { return m_floatMode; } /** Sets the float mode. */ void SetFloatMode(wxTextBoxAttrFloatStyle mode) { m_floatMode = mode; m_flags |= wxTEXT_BOX_ATTR_FLOAT; } /** Returns @true if float mode is active. */ bool HasFloatMode() const { return HasFlag(wxTEXT_BOX_ATTR_FLOAT); } /** Returns @true if this object is floating. */ bool IsFloating() const { return HasFloatMode() && GetFloatMode() != wxTEXT_BOX_ATTR_FLOAT_NONE; } /** Returns the clear mode - whether to wrap text after object. Currently unimplemented. */ wxTextBoxAttrClearStyle GetClearMode() const { return m_clearMode; } /** Set the clear mode. Currently unimplemented. */ void SetClearMode(wxTextBoxAttrClearStyle mode) { m_clearMode = mode; m_flags |= wxTEXT_BOX_ATTR_CLEAR; } /** Returns @true if we have a clear flag. */ bool HasClearMode() const { return HasFlag(wxTEXT_BOX_ATTR_CLEAR); } /** Returns the collapse mode - whether to collapse borders. */ wxTextBoxAttrCollapseMode GetCollapseBorders() const { return m_collapseMode; } /** Sets the collapse mode - whether to collapse borders. */ void SetCollapseBorders(wxTextBoxAttrCollapseMode collapse) { m_collapseMode = collapse; m_flags |= wxTEXT_BOX_ATTR_COLLAPSE_BORDERS; } /** Returns @true if the collapse borders flag is present. */ bool HasCollapseBorders() const { return HasFlag(wxTEXT_BOX_ATTR_COLLAPSE_BORDERS); } /** Returns the whitespace mode. */ wxTextBoxAttrWhitespaceMode GetWhitespaceMode() const { return m_whitespaceMode; } /** Sets the whitespace mode. */ void SetWhitespaceMode(wxTextBoxAttrWhitespaceMode whitespace) { m_whitespaceMode = whitespace; m_flags |= wxTEXT_BOX_ATTR_WHITESPACE; } /** Returns @true if the whitespace flag is present. */ bool HasWhitespaceMode() const { return HasFlag(wxTEXT_BOX_ATTR_WHITESPACE); } /** Returns @true if the corner radius flag is present. */ bool HasCornerRadius() const { return HasFlag(wxTEXT_BOX_ATTR_CORNER_RADIUS); } /** Returns the corner radius value. */ const wxTextAttrDimension& GetCornerRadius() const { return m_cornerRadius; } wxTextAttrDimension& GetCornerRadius() { return m_cornerRadius; } /** Sets the corner radius value. */ void SetCornerRadius(const wxTextAttrDimension& dim) { m_cornerRadius = dim; m_flags |= wxTEXT_BOX_ATTR_CORNER_RADIUS; } /** Returns the vertical alignment. */ wxTextBoxAttrVerticalAlignment GetVerticalAlignment() const { return m_verticalAlignment; } /** Sets the vertical alignment. */ void SetVerticalAlignment(wxTextBoxAttrVerticalAlignment verticalAlignment) { m_verticalAlignment = verticalAlignment; m_flags |= wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT; } /** Returns @true if a vertical alignment flag is present. */ bool HasVerticalAlignment() const { return HasFlag(wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT); } /** Returns the margin values. */ wxTextAttrDimensions& GetMargins() { return m_margins; } const wxTextAttrDimensions& GetMargins() const { return m_margins; } /** Returns the left margin. */ wxTextAttrDimension& GetLeftMargin() { return m_margins.m_left; } const wxTextAttrDimension& GetLeftMargin() const { return m_margins.m_left; } /** Returns the right margin. */ wxTextAttrDimension& GetRightMargin() { return m_margins.m_right; } const wxTextAttrDimension& GetRightMargin() const { return m_margins.m_right; } /** Returns the top margin. */ wxTextAttrDimension& GetTopMargin() { return m_margins.m_top; } const wxTextAttrDimension& GetTopMargin() const { return m_margins.m_top; } /** Returns the bottom margin. */ wxTextAttrDimension& GetBottomMargin() { return m_margins.m_bottom; } const wxTextAttrDimension& GetBottomMargin() const { return m_margins.m_bottom; } /** Returns the position. */ wxTextAttrDimensions& GetPosition() { return m_position; } const wxTextAttrDimensions& GetPosition() const { return m_position; } /** Returns the left position. */ wxTextAttrDimension& GetLeft() { return m_position.m_left; } const wxTextAttrDimension& GetLeft() const { return m_position.m_left; } /** Returns the right position. */ wxTextAttrDimension& GetRight() { return m_position.m_right; } const wxTextAttrDimension& GetRight() const { return m_position.m_right; } /** Returns the top position. */ wxTextAttrDimension& GetTop() { return m_position.m_top; } const wxTextAttrDimension& GetTop() const { return m_position.m_top; } /** Returns the bottom position. */ wxTextAttrDimension& GetBottom() { return m_position.m_bottom; } const wxTextAttrDimension& GetBottom() const { return m_position.m_bottom; } /** Returns the padding values. */ wxTextAttrDimensions& GetPadding() { return m_padding; } const wxTextAttrDimensions& GetPadding() const { return m_padding; } /** Returns the left padding value. */ wxTextAttrDimension& GetLeftPadding() { return m_padding.m_left; } const wxTextAttrDimension& GetLeftPadding() const { return m_padding.m_left; } /** Returns the right padding value. */ wxTextAttrDimension& GetRightPadding() { return m_padding.m_right; } const wxTextAttrDimension& GetRightPadding() const { return m_padding.m_right; } /** Returns the top padding value. */ wxTextAttrDimension& GetTopPadding() { return m_padding.m_top; } const wxTextAttrDimension& GetTopPadding() const { return m_padding.m_top; } /** Returns the bottom padding value. */ wxTextAttrDimension& GetBottomPadding() { return m_padding.m_bottom; } const wxTextAttrDimension& GetBottomPadding() const { return m_padding.m_bottom; } /** Returns the borders. */ wxTextAttrBorders& GetBorder() { return m_border; } const wxTextAttrBorders& GetBorder() const { return m_border; } /** Returns the left border. */ wxTextAttrBorder& GetLeftBorder() { return m_border.m_left; } const wxTextAttrBorder& GetLeftBorder() const { return m_border.m_left; } /** Returns the top border. */ wxTextAttrBorder& GetTopBorder() { return m_border.m_top; } const wxTextAttrBorder& GetTopBorder() const { return m_border.m_top; } /** Returns the right border. */ wxTextAttrBorder& GetRightBorder() { return m_border.m_right; } const wxTextAttrBorder& GetRightBorder() const { return m_border.m_right; } /** Returns the bottom border. */ wxTextAttrBorder& GetBottomBorder() { return m_border.m_bottom; } const wxTextAttrBorder& GetBottomBorder() const { return m_border.m_bottom; } /** Returns the outline. */ wxTextAttrBorders& GetOutline() { return m_outline; } const wxTextAttrBorders& GetOutline() const { return m_outline; } /** Returns the left outline. */ wxTextAttrBorder& GetLeftOutline() { return m_outline.m_left; } const wxTextAttrBorder& GetLeftOutline() const { return m_outline.m_left; } /** Returns the top outline. */ wxTextAttrBorder& GetTopOutline() { return m_outline.m_top; } const wxTextAttrBorder& GetTopOutline() const { return m_outline.m_top; } /** Returns the right outline. */ wxTextAttrBorder& GetRightOutline() { return m_outline.m_right; } const wxTextAttrBorder& GetRightOutline() const { return m_outline.m_right; } /** Returns the bottom outline. */ wxTextAttrBorder& GetBottomOutline() { return m_outline.m_bottom; } const wxTextAttrBorder& GetBottomOutline() const { return m_outline.m_bottom; } /** Returns the object size. */ wxTextAttrSize& GetSize() { return m_size; } const wxTextAttrSize& GetSize() const { return m_size; } /** Returns the object minimum size. */ wxTextAttrSize& GetMinSize() { return m_minSize; } const wxTextAttrSize& GetMinSize() const { return m_minSize; } /** Returns the object maximum size. */ wxTextAttrSize& GetMaxSize() { return m_maxSize; } const wxTextAttrSize& GetMaxSize() const { return m_maxSize; } /** Sets the object size. */ void SetSize(const wxTextAttrSize& sz) { m_size = sz; } /** Sets the object minimum size. */ void SetMinSize(const wxTextAttrSize& sz) { m_minSize = sz; } /** Sets the object maximum size. */ void SetMaxSize(const wxTextAttrSize& sz) { m_maxSize = sz; } /** Returns the object width. */ wxTextAttrDimension& GetWidth() { return m_size.m_width; } const wxTextAttrDimension& GetWidth() const { return m_size.m_width; } /** Returns the object height. */ wxTextAttrDimension& GetHeight() { return m_size.m_height; } const wxTextAttrDimension& GetHeight() const { return m_size.m_height; } /** Returns the box style name. */ const wxString& GetBoxStyleName() const { return m_boxStyleName; } /** Sets the box style name. */ void SetBoxStyleName(const wxString& name) { m_boxStyleName = name; AddFlag(wxTEXT_BOX_ATTR_BOX_STYLE_NAME); } /** Returns @true if the box style name is present. */ bool HasBoxStyleName() const { return HasFlag(wxTEXT_BOX_ATTR_BOX_STYLE_NAME); } /** Returns the box shadow attributes. */ wxTextAttrShadow& GetShadow() { return m_shadow; } const wxTextAttrShadow& GetShadow() const { return m_shadow; } /** Sets the box shadow attributes. */ void SetShadow(const wxTextAttrShadow& shadow) { m_shadow = shadow; } public: int m_flags; wxTextAttrDimensions m_margins; wxTextAttrDimensions m_padding; wxTextAttrDimensions m_position; wxTextAttrSize m_size; wxTextAttrSize m_minSize; wxTextAttrSize m_maxSize; wxTextAttrBorders m_border; wxTextAttrBorders m_outline; wxTextBoxAttrFloatStyle m_floatMode; wxTextBoxAttrClearStyle m_clearMode; wxTextBoxAttrCollapseMode m_collapseMode; wxTextBoxAttrVerticalAlignment m_verticalAlignment; wxTextBoxAttrWhitespaceMode m_whitespaceMode; wxTextAttrDimension m_cornerRadius; wxString m_boxStyleName; wxTextAttrShadow m_shadow; }; /** @class wxRichTextAttr A class representing enhanced attributes for rich text objects. This adds a wxTextBoxAttr member to the basic wxTextAttr class. @library{wxrichtext} @category{richtext} @see wxRichTextAttr, wxTextBoxAttr, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextAttr: public wxTextAttr { public: /** Constructor taking a wxTextAttr. */ wxRichTextAttr(const wxTextAttr& attr) { wxTextAttr::Copy(attr); } /** Copy constructor. */ wxRichTextAttr(const wxRichTextAttr& attr): wxTextAttr() { Copy(attr); } /** Default constructor. */ wxRichTextAttr() {} /** Copy function. */ void Copy(const wxRichTextAttr& attr); /** Assignment operator. */ void operator=(const wxRichTextAttr& attr) { Copy(attr); } /** Assignment operator. */ void operator=(const wxTextAttr& attr) { wxTextAttr::Copy(attr); } /** Equality test. */ bool operator==(const wxRichTextAttr& attr) const; /** Partial equality test. If @a weakTest is @true, attributes of this object do not have to be present if those attributes of @a attr are present. If @a weakTest is @false, the function will fail if an attribute is present in @a attr but not in this object. */ bool EqPartial(const wxRichTextAttr& attr, bool weakTest = true) const; /** Merges the given attributes. If @a compareWith is non-NULL, then it will be used to mask out those attributes that are the same in style and @a compareWith, for situations where we don't want to explicitly set inherited attributes. */ bool Apply(const wxRichTextAttr& style, const wxRichTextAttr* compareWith = NULL); /** Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects. */ void CollectCommonAttributes(const wxRichTextAttr& attr, wxRichTextAttr& clashingAttr, wxRichTextAttr& absentAttr); /** Removes the specified attributes from this object. */ bool RemoveStyle(const wxRichTextAttr& attr); /** Returns the text box attributes. */ wxTextBoxAttr& GetTextBoxAttr() { return m_textBoxAttr; } const wxTextBoxAttr& GetTextBoxAttr() const { return m_textBoxAttr; } /** Set the text box attributes. */ void SetTextBoxAttr(const wxTextBoxAttr& attr) { m_textBoxAttr = attr; } /** Returns @true if no attributes are set. */ bool IsDefault() const { return (GetFlags() == 0) && m_textBoxAttr.IsDefault(); } wxTextBoxAttr m_textBoxAttr; }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxRichTextAttr, wxRichTextAttrArray, WXDLLIMPEXP_RICHTEXT); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxVariant, wxRichTextVariantArray, WXDLLIMPEXP_RICHTEXT); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxRect, wxRichTextRectArray, WXDLLIMPEXP_RICHTEXT); /** @class wxRichTextProperties A simple property class using wxVariants. This is used to give each rich text object the ability to store custom properties that can be used by the application. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextObject, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextProperties: public wxObject { wxDECLARE_DYNAMIC_CLASS(wxRichTextProperties); public: /** Default constructor. */ wxRichTextProperties() {} /** Copy constructor. */ wxRichTextProperties(const wxRichTextProperties& props): wxObject() { Copy(props); } /** Assignment operator. */ void operator=(const wxRichTextProperties& props) { Copy(props); } /** Equality operator. */ bool operator==(const wxRichTextProperties& props) const; /** Copies from @a props. */ void Copy(const wxRichTextProperties& props) { m_properties = props.m_properties; } /** Returns the variant at the given index. */ const wxVariant& operator[](size_t idx) const { return m_properties[idx]; } /** Returns the variant at the given index. */ wxVariant& operator[](size_t idx) { return m_properties[idx]; } /** Clears the properties. */ void Clear() { m_properties.Clear(); } /** Returns the array of variants implementing the properties. */ const wxRichTextVariantArray& GetProperties() const { return m_properties; } /** Returns the array of variants implementing the properties. */ wxRichTextVariantArray& GetProperties() { return m_properties; } /** Sets the array of variants. */ void SetProperties(const wxRichTextVariantArray& props) { m_properties = props; } /** Returns all the property names. */ wxArrayString GetPropertyNames() const; /** Returns a count of the properties. */ size_t GetCount() const { return m_properties.GetCount(); } /** Returns @true if the given property is found. */ bool HasProperty(const wxString& name) const { return Find(name) != -1; } /** Finds the given property. */ int Find(const wxString& name) const; /** Removes the given property. */ bool Remove(const wxString& name); /** Gets the property variant by name. */ const wxVariant& GetProperty(const wxString& name) const; /** Finds or creates a property with the given name, returning a pointer to the variant. */ wxVariant* FindOrCreateProperty(const wxString& name); /** Gets the value of the named property as a string. */ wxString GetPropertyString(const wxString& name) const; /** Gets the value of the named property as a long integer. */ long GetPropertyLong(const wxString& name) const; /** Gets the value of the named property as a boolean. */ bool GetPropertyBool(const wxString& name) const; /** Gets the value of the named property as a double. */ double GetPropertyDouble(const wxString& name) const; /** Sets the property by passing a variant which contains a name and value. */ void SetProperty(const wxVariant& variant); /** Sets a property by name and variant. */ void SetProperty(const wxString& name, const wxVariant& variant); /** Sets a property by name and string value. */ void SetProperty(const wxString& name, const wxString& value); /** Sets a property by name and wxChar* value. */ void SetProperty(const wxString& name, const wxChar* value) { SetProperty(name, wxString(value)); } /** Sets property by name and long integer value. */ void SetProperty(const wxString& name, long value); /** Sets property by name and double value. */ void SetProperty(const wxString& name, double value); /** Sets property by name and boolean value. */ void SetProperty(const wxString& name, bool value); /** Removes the given properties from these properties. */ void RemoveProperties(const wxRichTextProperties& properties); /** Merges the given properties with these properties. */ void MergeProperties(const wxRichTextProperties& properties); protected: wxRichTextVariantArray m_properties; }; /** @class wxRichTextFontTable Manages quick access to a pool of fonts for rendering rich text. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextFontTable: public wxObject { public: /** Default constructor. */ wxRichTextFontTable(); /** Copy constructor. */ wxRichTextFontTable(const wxRichTextFontTable& table); virtual ~wxRichTextFontTable(); /** Returns @true if the font table is valid. */ bool IsOk() const { return m_refData != NULL; } /** Finds a font for the given attribute object. */ wxFont FindFont(const wxRichTextAttr& fontSpec); /** Clears the font table. */ void Clear(); /** Assignment operator. */ void operator= (const wxRichTextFontTable& table); /** Equality operator. */ bool operator == (const wxRichTextFontTable& table) const; /** Inequality operator. */ bool operator != (const wxRichTextFontTable& table) const { return !(*this == table); } /** Set the font scale factor. */ void SetFontScale(double fontScale); protected: double m_fontScale; wxDECLARE_DYNAMIC_CLASS(wxRichTextFontTable); }; /** @class wxRichTextRange This stores beginning and end positions for a range of data. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextRange { public: // Constructors /** Default constructor. */ wxRichTextRange() { m_start = 0; m_end = 0; } /** Constructor taking start and end positions. */ wxRichTextRange(long start, long end) { m_start = start; m_end = end; } /** Copy constructor. */ wxRichTextRange(const wxRichTextRange& range) { m_start = range.m_start; m_end = range.m_end; } ~wxRichTextRange() {} /** Assigns @a range to this range. */ void operator =(const wxRichTextRange& range) { m_start = range.m_start; m_end = range.m_end; } /** Equality operator. Returns @true if @a range is the same as this range. */ bool operator ==(const wxRichTextRange& range) const { return (m_start == range.m_start && m_end == range.m_end); } /** Inequality operator. */ bool operator !=(const wxRichTextRange& range) const { return (m_start != range.m_start || m_end != range.m_end); } /** Subtracts a range from this range. */ wxRichTextRange operator -(const wxRichTextRange& range) const { return wxRichTextRange(m_start - range.m_start, m_end - range.m_end); } /** Adds a range to this range. */ wxRichTextRange operator +(const wxRichTextRange& range) const { return wxRichTextRange(m_start + range.m_start, m_end + range.m_end); } /** Sets the range start and end positions. */ void SetRange(long start, long end) { m_start = start; m_end = end; } /** Sets the start position. */ void SetStart(long start) { m_start = start; } /** Returns the start position. */ long GetStart() const { return m_start; } /** Sets the end position. */ void SetEnd(long end) { m_end = end; } /** Gets the end position. */ long GetEnd() const { return m_end; } /** Returns true if this range is completely outside @a range. */ bool IsOutside(const wxRichTextRange& range) const { return range.m_start > m_end || range.m_end < m_start; } /** Returns true if this range is completely within @a range. */ bool IsWithin(const wxRichTextRange& range) const { return m_start >= range.m_start && m_end <= range.m_end; } /** Returns true if @a pos was within the range. Does not match if the range is empty. */ bool Contains(long pos) const { return pos >= m_start && pos <= m_end ; } /** Limit this range to be within @a range. */ bool LimitTo(const wxRichTextRange& range) ; /** Gets the length of the range. */ long GetLength() const { return m_end - m_start + 1; } /** Swaps the start and end. */ void Swap() { long tmp = m_start; m_start = m_end; m_end = tmp; } /** Converts the API-standard range, whose end is one past the last character in the range, to the internal form, which uses the first and last character positions of the range. In other words, one is subtracted from the end position. (n, n) is the range of a single character. */ wxRichTextRange ToInternal() const { return wxRichTextRange(m_start, m_end-1); } /** Converts the internal range, which uses the first and last character positions of the range, to the API-standard range, whose end is one past the last character in the range. In other words, one is added to the end position. (n, n+1) is the range of a single character. */ wxRichTextRange FromInternal() const { return wxRichTextRange(m_start, m_end+1); } protected: long m_start; long m_end; }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxRichTextRange, wxRichTextRangeArray, WXDLLIMPEXP_RICHTEXT); #define wxRICHTEXT_ALL wxRichTextRange(-2, -2) #define wxRICHTEXT_NONE wxRichTextRange(-1, -1) #define wxRICHTEXT_NO_SELECTION wxRichTextRange(-2, -2) /** @class wxRichTextSelection Stores selection information. The selection does not have to be contiguous, though currently non-contiguous selections are only supported for a range of table cells (a geometric block of cells can consist of a set of non-contiguous positions). The selection consists of an array of ranges, and the container that is the context for the selection. It follows that a single selection object can only represent ranges with the same parent container. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextSelection { public: /** Copy constructor. */ wxRichTextSelection(const wxRichTextSelection& sel) { Copy(sel); } /** Creates a selection from a range and a container. */ wxRichTextSelection(const wxRichTextRange& range, wxRichTextParagraphLayoutBox* container) { m_ranges.Add(range); m_container = container; } /** Default constructor. */ wxRichTextSelection() { Reset(); } /** Resets the selection. */ void Reset() { m_ranges.Clear(); m_container = NULL; } /** Sets the selection. */ void Set(const wxRichTextRange& range, wxRichTextParagraphLayoutBox* container) { m_ranges.Clear(); m_ranges.Add(range); m_container = container; } /** Adds a range to the selection. */ void Add(const wxRichTextRange& range) { m_ranges.Add(range); } /** Sets the selections from an array of ranges and a container object. */ void Set(const wxRichTextRangeArray& ranges, wxRichTextParagraphLayoutBox* container) { m_ranges = ranges; m_container = container; } /** Copies from @a sel. */ void Copy(const wxRichTextSelection& sel) { m_ranges = sel.m_ranges; m_container = sel.m_container; } /** Assignment operator. */ void operator=(const wxRichTextSelection& sel) { Copy(sel); } /** Equality operator. */ bool operator==(const wxRichTextSelection& sel) const; /** Index operator. */ wxRichTextRange operator[](size_t i) const { return GetRange(i); } /** Returns the selection ranges. */ wxRichTextRangeArray& GetRanges() { return m_ranges; } /** Returns the selection ranges. */ const wxRichTextRangeArray& GetRanges() const { return m_ranges; } /** Sets the selection ranges. */ void SetRanges(const wxRichTextRangeArray& ranges) { m_ranges = ranges; } /** Returns the number of ranges in the selection. */ size_t GetCount() const { return m_ranges.GetCount(); } /** Returns the range at the given index. */ wxRichTextRange GetRange(size_t i) const { return m_ranges[i]; } /** Returns the first range if there is one, otherwise wxRICHTEXT_NO_SELECTION. */ wxRichTextRange GetRange() const { return (m_ranges.GetCount() > 0) ? (m_ranges[0]) : wxRICHTEXT_NO_SELECTION; } /** Sets a single range. */ void SetRange(const wxRichTextRange& range) { m_ranges.Clear(); m_ranges.Add(range); } /** Returns the container for which the selection is valid. */ wxRichTextParagraphLayoutBox* GetContainer() const { return m_container; } /** Sets the container for which the selection is valid. */ void SetContainer(wxRichTextParagraphLayoutBox* container) { m_container = container; } /** Returns @true if the selection is valid. */ bool IsValid() const { return m_ranges.GetCount() > 0 && GetContainer(); } /** Returns the selection appropriate to the specified object, if any; returns an empty array if none at the level of the object's container. */ wxRichTextRangeArray GetSelectionForObject(wxRichTextObject* obj) const; /** Returns @true if the given position is within the selection. */ bool WithinSelection(long pos, wxRichTextObject* obj) const; /** Returns @true if the given position is within the selection. */ bool WithinSelection(long pos) const { return WithinSelection(pos, m_ranges); } /** Returns @true if the given position is within the selection range. */ static bool WithinSelection(long pos, const wxRichTextRangeArray& ranges); /** Returns @true if the given range is within the selection range. */ static bool WithinSelection(const wxRichTextRange& range, const wxRichTextRangeArray& ranges); wxRichTextRangeArray m_ranges; wxRichTextParagraphLayoutBox* m_container; }; /** @class wxRichTextDrawingContext A class for passing information to drawing and measuring functions. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextDrawingContext: public wxObject { wxDECLARE_CLASS(wxRichTextDrawingContext); public: /** Pass the buffer to the context so the context can retrieve information such as virtual attributes. */ wxRichTextDrawingContext(wxRichTextBuffer* buffer); void Init() { m_buffer = NULL; m_enableVirtualAttributes = true; m_enableImages = true; m_layingOut = false; m_enableDelayedImageLoading = false; } /** Does this object have virtual attributes? Virtual attributes can be provided for visual cues without affecting the actual styling. */ bool HasVirtualAttributes(wxRichTextObject* obj) const; /** Returns the virtual attributes for this object. Virtual attributes can be provided for visual cues without affecting the actual styling. */ wxRichTextAttr GetVirtualAttributes(wxRichTextObject* obj) const; /** Applies any virtual attributes relevant to this object. */ bool ApplyVirtualAttributes(wxRichTextAttr& attr, wxRichTextObject* obj) const; /** Gets the count for mixed virtual attributes for individual positions within the object. For example, individual characters within a text object may require special highlighting. */ int GetVirtualSubobjectAttributesCount(wxRichTextObject* obj) const; /** Gets the mixed virtual attributes for individual positions within the object. For example, individual characters within a text object may require special highlighting. The function is passed the count returned by GetVirtualSubobjectAttributesCount. */ int GetVirtualSubobjectAttributes(wxRichTextObject* obj, wxArrayInt& positions, wxRichTextAttrArray& attributes) const; /** Do we have virtual text for this object? Virtual text allows an application to replace characters in an object for editing and display purposes, for example for highlighting special characters. */ bool HasVirtualText(const wxRichTextPlainText* obj) const; /** Gets the virtual text for this object. */ bool GetVirtualText(const wxRichTextPlainText* obj, wxString& text) const; /** Enables virtual attribute processing. */ void EnableVirtualAttributes(bool b) { m_enableVirtualAttributes = b; } /** Returns @true if virtual attribute processing is enabled. */ bool GetVirtualAttributesEnabled() const { return m_enableVirtualAttributes; } /** Enable or disable images */ void EnableImages(bool b) { m_enableImages = b; } /** Returns @true if images are enabled. */ bool GetImagesEnabled() const { return m_enableImages; } /** Set laying out flag */ void SetLayingOut(bool b) { m_layingOut = b; } /** Returns @true if laying out. */ bool GetLayingOut() const { return m_layingOut; } /** Enable or disable delayed image loading */ void EnableDelayedImageLoading(bool b) { m_enableDelayedImageLoading = b; } /** Returns @true if delayed image loading is enabled. */ bool GetDelayedImageLoading() const { return m_enableDelayedImageLoading; } /** Returns the buffer pointer. */ wxRichTextBuffer* GetBuffer() const { return m_buffer; } wxRichTextBuffer* m_buffer; bool m_enableVirtualAttributes; bool m_enableImages; bool m_enableDelayedImageLoading; bool m_layingOut; }; /** @class wxRichTextObject This is the base for drawable rich text objects. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextObject: public wxObject { wxDECLARE_CLASS(wxRichTextObject); public: /** Constructor, taking an optional parent pointer. */ wxRichTextObject(wxRichTextObject* parent = NULL); virtual ~wxRichTextObject(); // Overridables /** Draw the item, within the given range. Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping) */ virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) = 0; /** Lay the item out at the specified position with the given size constraint. Layout must set the cached size. @rect is the available space for the object, and @a parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box). */ virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) = 0; /** Hit-testing: returns a flag indicating hit test details, plus information about position. @a contextObj is returned to specify what object position is relevant to, since otherwise there's an ambiguity. @ obj might not be a child of @a contextObj, since we may be referring to the container itself if we have no hit on a child - for example if we click outside an object. The function puts the position in @a textPosition if one is found. @a pt is in logical units (a zero y position is at the beginning of the buffer). Pass wxRICHTEXT_HITTEST_NO_NESTED_OBJECTS if you only want to consider objects directly under the object you are calling HitTest on. Otherwise, it will recurse and potentially find a nested object. @return One of the ::wxRichTextHitTestFlags values. */ virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0); /** Finds the absolute position and row height for the given character position. */ virtual bool FindPosition(wxDC& WXUNUSED(dc), wxRichTextDrawingContext& WXUNUSED(context), long WXUNUSED(index), wxPoint& WXUNUSED(pt), int* WXUNUSED(height), bool WXUNUSED(forceLineStart)) { return false; } /** Returns the best size, i.e. the ideal starting size for this object irrespective of available space. For a short text string, it will be the size that exactly encloses the text. For a longer string, it might use the parent width for example. */ virtual wxSize GetBestSize() const { return m_size; } /** Returns the object size for the given range. Returns @false if the range is invalid for this object. */ virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const = 0; /** Do a split from @a pos, returning an object containing the second part, and setting the first part in 'this'. */ virtual wxRichTextObject* DoSplit(long WXUNUSED(pos)) { return NULL; } /** Calculates the range of the object. By default, guess that the object is 1 unit long. */ virtual void CalculateRange(long start, long& end) { end = start ; m_range.SetRange(start, end); } /** Deletes the given range. */ virtual bool DeleteRange(const wxRichTextRange& WXUNUSED(range)) { return false; } /** Returns @true if the object is empty. */ virtual bool IsEmpty() const { return false; } /** Returns @true if this class of object is floatable. */ virtual bool IsFloatable() const { return false; } /** Returns @true if this object is currently floating. */ virtual bool IsFloating() const { return GetAttributes().GetTextBoxAttr().IsFloating(); } /** Returns the floating direction. */ virtual int GetFloatDirection() const { return GetAttributes().GetTextBoxAttr().GetFloatMode(); } /** Returns any text in this object for the given range. */ virtual wxString GetTextForRange(const wxRichTextRange& WXUNUSED(range)) const { return wxEmptyString; } /** Returns @true if this object can merge itself with the given one. */ virtual bool CanMerge(wxRichTextObject* WXUNUSED(object), wxRichTextDrawingContext& WXUNUSED(context)) const { return false; } /** Returns @true if this object merged itself with the given one. The calling code will then delete the given object. */ virtual bool Merge(wxRichTextObject* WXUNUSED(object), wxRichTextDrawingContext& WXUNUSED(context)) { return false; } /** Returns @true if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects. */ virtual bool CanSplit(wxRichTextDrawingContext& WXUNUSED(context)) const { return false; } /** Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes. Returns itself if it was not split. */ virtual wxRichTextObject* Split(wxRichTextDrawingContext& WXUNUSED(context)) { return this; } /** Dump object data to the given output stream for debugging. */ virtual void Dump(wxTextOutputStream& stream); /** Returns @true if we can edit the object's properties via a GUI. */ virtual bool CanEditProperties() const { return false; } /** Edits the object's properties via a GUI. */ virtual bool EditProperties(wxWindow* WXUNUSED(parent), wxRichTextBuffer* WXUNUSED(buffer)) { return false; } /** Returns the label to be used for the properties context menu item. */ virtual wxString GetPropertiesMenuLabel() const { return wxEmptyString; } /** Returns @true if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible. For example, containers supporting text, such as a text box object, can accept the focus, but a table can't (set the focus to individual cells instead). */ virtual bool AcceptsFocus() const { return false; } #if wxUSE_XML /** Imports this object from XML. */ virtual bool ImportFromXML(wxRichTextBuffer* buffer, wxXmlNode* node, wxRichTextXMLHandler* handler, bool* recurse); #endif #if wxRICHTEXT_HAVE_DIRECT_OUTPUT /** Exports this object directly to the given stream, bypassing the creation of a wxXmlNode hierarchy. This method is considerably faster than creating a tree first. However, both versions of ExportXML must be implemented so that if the tree method is made efficient in the future, we can deprecate the more verbose direct output method. Compiled only if wxRICHTEXT_HAVE_DIRECT_OUTPUT is defined (on by default). */ virtual bool ExportXML(wxOutputStream& stream, int indent, wxRichTextXMLHandler* handler); #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT /** Exports this object to the given parent node, usually creating at least one child node. This method is less efficient than the direct-to-stream method but is retained to allow for switching to this method if we make it more efficient. Compiled only if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT is defined (on by default). */ virtual bool ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler); #endif /** Returns @true if this object takes note of paragraph attributes (text and image objects don't). */ virtual bool UsesParagraphAttributes() const { return true; } /** Returns the XML node name of this object. This must be overridden for wxXmlNode-base XML export to work. */ virtual wxString GetXMLNodeName() const { return wxT("unknown"); } /** Invalidates the object at the given range. With no argument, invalidates the whole object. */ virtual void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL); /** Returns @true if this object can handle the selections of its children, fOr example a table. Required for composite selection handling to work. */ virtual bool HandlesChildSelections() const { return false; } /** Returns a selection object specifying the selections between start and end character positions. For example, a table would deduce what cells (of range length 1) are selected when dragging across the table. */ virtual wxRichTextSelection GetSelection(long WXUNUSED(start), long WXUNUSED(end)) const { return wxRichTextSelection(); } // Accessors /** Gets the cached object size as calculated by Layout. */ virtual wxSize GetCachedSize() const { return m_size; } /** Sets the cached object size as calculated by Layout. */ virtual void SetCachedSize(const wxSize& sz) { m_size = sz; } /** Gets the maximum object size as calculated by Layout. This allows us to fit an object to its contents or allocate extra space if required. */ virtual wxSize GetMaxSize() const { return m_maxSize; } /** Sets the maximum object size as calculated by Layout. This allows us to fit an object to its contents or allocate extra space if required. */ virtual void SetMaxSize(const wxSize& sz) { m_maxSize = sz; } /** Gets the minimum object size as calculated by Layout. This allows us to constrain an object to its absolute minimum size if necessary. */ virtual wxSize GetMinSize() const { return m_minSize; } /** Sets the minimum object size as calculated by Layout. This allows us to constrain an object to its absolute minimum size if necessary. */ virtual void SetMinSize(const wxSize& sz) { m_minSize = sz; } /** Gets the 'natural' size for an object. For an image, it would be the image size. */ virtual wxTextAttrSize GetNaturalSize() const { return wxTextAttrSize(); } /** Returns the object position in pixels. */ virtual wxPoint GetPosition() const { return m_pos; } /** Sets the object position in pixels. */ virtual void SetPosition(const wxPoint& pos) { m_pos = pos; } /** Returns the absolute object position, by traversing up the child/parent hierarchy. TODO: may not be needed, if all object positions are in fact relative to the top of the coordinate space. */ virtual wxPoint GetAbsolutePosition() const; /** Returns the rectangle enclosing the object. */ virtual wxRect GetRect() const { return wxRect(GetPosition(), GetCachedSize()); } /** Sets the object's range within its container. */ void SetRange(const wxRichTextRange& range) { m_range = range; } /** Returns the object's range. */ const wxRichTextRange& GetRange() const { return m_range; } /** Returns the object's range. */ wxRichTextRange& GetRange() { return m_range; } /** Set the object's own range, for a top-level object with its own position space. */ void SetOwnRange(const wxRichTextRange& range) { m_ownRange = range; } /** Returns the object's own range (valid if top-level). */ const wxRichTextRange& GetOwnRange() const { return m_ownRange; } /** Returns the object's own range (valid if top-level). */ wxRichTextRange& GetOwnRange() { return m_ownRange; } /** Returns the object's own range only if a top-level object. */ wxRichTextRange GetOwnRangeIfTopLevel() const { return IsTopLevel() ? m_ownRange : m_range; } /** Returns @true if this object is composite. */ virtual bool IsComposite() const { return false; } /** Returns @true if no user editing can be done inside the object. This returns @true for simple objects, @false for most composite objects, but @true for fields, which if composite, should not be user-edited. */ virtual bool IsAtomic() const { return true; } /** Returns a pointer to the parent object. */ virtual wxRichTextObject* GetParent() const { return m_parent; } /** Sets the pointer to the parent object. */ virtual void SetParent(wxRichTextObject* parent) { m_parent = parent; } /** Returns the top-level container of this object. May return itself if it's a container; use GetParentContainer to return a different container. */ virtual wxRichTextParagraphLayoutBox* GetContainer() const; /** Returns the top-level container of this object. Returns a different container than itself, unless there's no parent, in which case it will return NULL. */ virtual wxRichTextParagraphLayoutBox* GetParentContainer() const { return GetParent() ? GetParent()->GetContainer() : GetContainer(); } /** Set the margin around the object, in pixels. */ virtual void SetMargins(int margin); /** Set the margin around the object, in pixels. */ virtual void SetMargins(int leftMargin, int rightMargin, int topMargin, int bottomMargin); /** Returns the left margin of the object, in pixels. */ virtual int GetLeftMargin() const; /** Returns the right margin of the object, in pixels. */ virtual int GetRightMargin() const; /** Returns the top margin of the object, in pixels. */ virtual int GetTopMargin() const; /** Returns the bottom margin of the object, in pixels. */ virtual int GetBottomMargin() const; /** Calculates the available content space in the given rectangle, given the margins, border and padding specified in the object's attributes. */ virtual wxRect GetAvailableContentArea(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& outerRect) const; /** Lays out the object first with a given amount of space, and then if no width was specified in attr, lays out the object again using the minimum size. @a availableParentSpace is the maximum space for the object, whereas @a availableContainerSpace is the container with which relative positions and sizes should be computed. For example, a text box whose space has already been constrained in a previous layout pass to @a availableParentSpace, but should have a width of 50% of @a availableContainerSpace. (If these two rects were the same, a 2nd pass could see the object getting too small.) */ virtual bool LayoutToBestSize(wxDC& dc, wxRichTextDrawingContext& context, wxRichTextBuffer* buffer, const wxRichTextAttr& parentAttr, const wxRichTextAttr& attr, const wxRect& availableParentSpace, const wxRect& availableContainerSpace, int style); /** Adjusts the attributes for virtual attribute provision, collapsed borders, etc. */ virtual bool AdjustAttributes(wxRichTextAttr& attr, wxRichTextDrawingContext& context); /** Sets the object's attributes. */ void SetAttributes(const wxRichTextAttr& attr) { m_attributes = attr; } /** Returns the object's attributes. */ const wxRichTextAttr& GetAttributes() const { return m_attributes; } /** Returns the object's attributes. */ wxRichTextAttr& GetAttributes() { return m_attributes; } /** Returns the object's properties. */ wxRichTextProperties& GetProperties() { return m_properties; } /** Returns the object's properties. */ const wxRichTextProperties& GetProperties() const { return m_properties; } /** Sets the object's properties. */ void SetProperties(const wxRichTextProperties& props) { m_properties = props; } /** Sets the stored descent value. */ void SetDescent(int descent) { m_descent = descent; } /** Returns the stored descent value. */ int GetDescent() const { return m_descent; } /** Returns the containing buffer. */ wxRichTextBuffer* GetBuffer() const; /** Sets the identifying name for this object as a property using the "name" key. */ void SetName(const wxString& name) { m_properties.SetProperty(wxT("name"), name); } /** Returns the identifying name for this object from the properties, using the "name" key. */ wxString GetName() const { return m_properties.GetPropertyString(wxT("name")); } /** Returns @true if this object is top-level, i.e. contains its own paragraphs, such as a text box. */ virtual bool IsTopLevel() const { return false; } /** Returns @true if the object will be shown, @false otherwise. */ bool IsShown() const { return m_show; } // Operations /** Call to show or hide this object. This function does not cause the content to be laid out or redrawn. */ virtual void Show(bool show) { m_show = show; } /** Clones the object. */ virtual wxRichTextObject* Clone() const { return NULL; } /** Copies the object. */ void Copy(const wxRichTextObject& obj); /** Reference-counting allows us to use the same object in multiple lists (not yet used). */ void Reference() { m_refCount ++; } /** Reference-counting allows us to use the same object in multiple lists (not yet used). */ void Dereference(); /** Moves the object recursively, by adding the offset from old to new. */ virtual void Move(const wxPoint& pt); /** Converts units in tenths of a millimetre to device units. */ int ConvertTenthsMMToPixels(wxDC& dc, int units) const; /** Converts units in tenths of a millimetre to device units. */ static int ConvertTenthsMMToPixels(int ppi, int units, double scale = 1.0); /** Convert units in pixels to tenths of a millimetre. */ int ConvertPixelsToTenthsMM(wxDC& dc, int pixels) const; /** Convert units in pixels to tenths of a millimetre. */ static int ConvertPixelsToTenthsMM(int ppi, int pixels, double scale = 1.0); /** Draws the borders and background for the given rectangle and attributes. @a boxRect is taken to be the outer margin box, not the box around the content. */ static bool DrawBoxAttributes(wxDC& dc, wxRichTextBuffer* buffer, const wxRichTextAttr& attr, const wxRect& boxRect, int flags = 0, wxRichTextObject* obj = NULL); /** Draws a border. */ static bool DrawBorder(wxDC& dc, wxRichTextBuffer* buffer, const wxRichTextAttr& attr, const wxTextAttrBorders& borders, const wxRect& rect, int flags = 0); /** Returns the various rectangles of the box model in pixels. You can either specify @a contentRect (inner) or @a marginRect (outer), and the other must be the default rectangle (no width or height). Note that the outline doesn't affect the position of the rectangle, it's drawn in whatever space is available. */ static bool GetBoxRects(wxDC& dc, wxRichTextBuffer* buffer, const wxRichTextAttr& attr, wxRect& marginRect, wxRect& borderRect, wxRect& contentRect, wxRect& paddingRect, wxRect& outlineRect); /** Returns the total margin for the object in pixels, taking into account margin, padding and border size. */ static bool GetTotalMargin(wxDC& dc, wxRichTextBuffer* buffer, const wxRichTextAttr& attr, int& leftMargin, int& rightMargin, int& topMargin, int& bottomMargin); /** Returns the rectangle which the child has available to it given restrictions specified in the child attribute, e.g. 50% width of the parent, 400 pixels, x position 20% of the parent, etc. availableContainerSpace might be a parent that the cell has to compute its width relative to. E.g. a cell that's 50% of its parent. */ static wxRect AdjustAvailableSpace(wxDC& dc, wxRichTextBuffer* buffer, const wxRichTextAttr& parentAttr, const wxRichTextAttr& childAttr, const wxRect& availableParentSpace, const wxRect& availableContainerSpace); protected: wxSize m_size; wxSize m_maxSize; wxSize m_minSize; wxPoint m_pos; int m_descent; // Descent for this object (if any) int m_refCount; bool m_show; wxRichTextObject* m_parent; // The range of this object (start position to end position) wxRichTextRange m_range; // The internal range of this object, if it's a top-level object with its own range space wxRichTextRange m_ownRange; // Attributes wxRichTextAttr m_attributes; // Properties wxRichTextProperties m_properties; }; WX_DECLARE_LIST_WITH_DECL( wxRichTextObject, wxRichTextObjectList, class WXDLLIMPEXP_RICHTEXT ); /** @class wxRichTextCompositeObject Objects of this class can contain other objects. @library{wxrichtext} @category{richtext} @see wxRichTextObject, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextCompositeObject: public wxRichTextObject { wxDECLARE_CLASS(wxRichTextCompositeObject); public: // Constructors wxRichTextCompositeObject(wxRichTextObject* parent = NULL); virtual ~wxRichTextCompositeObject(); // Overridables virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0) wxOVERRIDE; virtual bool FindPosition(wxDC& dc, wxRichTextDrawingContext& context, long index, wxPoint& pt, int* height, bool forceLineStart) wxOVERRIDE; virtual void CalculateRange(long start, long& end) wxOVERRIDE; virtual bool DeleteRange(const wxRichTextRange& range) wxOVERRIDE; virtual wxString GetTextForRange(const wxRichTextRange& range) const wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; virtual void Dump(wxTextOutputStream& stream) wxOVERRIDE; virtual void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL) wxOVERRIDE; // Accessors /** Returns the children. */ wxRichTextObjectList& GetChildren() { return m_children; } /** Returns the children. */ const wxRichTextObjectList& GetChildren() const { return m_children; } /** Returns the number of children. */ size_t GetChildCount() const ; /** Returns the nth child. */ wxRichTextObject* GetChild(size_t n) const ; /** Returns @true if this object is composite. */ virtual bool IsComposite() const wxOVERRIDE { return true; } /** Returns @true if no user editing can be done inside the object. This returns @true for simple objects, @false for most composite objects, but @true for fields, which if composite, should not be user-edited. */ virtual bool IsAtomic() const wxOVERRIDE { return false; } /** Returns true if the buffer is empty. */ virtual bool IsEmpty() const wxOVERRIDE { return GetChildCount() == 0; } /** Returns the child object at the given character position. */ virtual wxRichTextObject* GetChildAtPosition(long pos) const; // Operations void Copy(const wxRichTextCompositeObject& obj); void operator= (const wxRichTextCompositeObject& obj) { Copy(obj); } /** Appends a child, returning the position. */ size_t AppendChild(wxRichTextObject* child) ; /** Inserts the child in front of the given object, or at the beginning. */ bool InsertChild(wxRichTextObject* child, wxRichTextObject* inFrontOf) ; /** Removes and optionally deletes the specified child. */ bool RemoveChild(wxRichTextObject* child, bool deleteChild = false) ; /** Deletes all the children. */ bool DeleteChildren() ; /** Recursively merges all pieces that can be merged. */ bool Defragment(wxRichTextDrawingContext& context, const wxRichTextRange& range = wxRICHTEXT_ALL); /** Moves the object recursively, by adding the offset from old to new. */ virtual void Move(const wxPoint& pt) wxOVERRIDE; protected: wxRichTextObjectList m_children; }; /** @class wxRichTextParagraphLayoutBox This class knows how to lay out paragraphs. @library{wxrichtext} @category{richtext} @see wxRichTextCompositeObject, wxRichTextObject, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextParagraphLayoutBox: public wxRichTextCompositeObject { wxDECLARE_DYNAMIC_CLASS(wxRichTextParagraphLayoutBox); public: // Constructors wxRichTextParagraphLayoutBox(wxRichTextObject* parent = NULL); wxRichTextParagraphLayoutBox(const wxRichTextParagraphLayoutBox& obj): wxRichTextCompositeObject() { Init(); Copy(obj); } ~wxRichTextParagraphLayoutBox(); // Overridables virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0) wxOVERRIDE; virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; virtual bool DeleteRange(const wxRichTextRange& range) wxOVERRIDE; virtual wxString GetTextForRange(const wxRichTextRange& range) const wxOVERRIDE; #if wxUSE_XML virtual bool ImportFromXML(wxRichTextBuffer* buffer, wxXmlNode* node, wxRichTextXMLHandler* handler, bool* recurse) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_DIRECT_OUTPUT virtual bool ExportXML(wxOutputStream& stream, int indent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT virtual bool ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("paragraphlayout"); } virtual bool AcceptsFocus() const wxOVERRIDE { return true; } // Accessors /** Associates a control with the buffer, for operations that for example require refreshing the window. */ void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_ctrl = ctrl; } /** Returns the associated control. */ wxRichTextCtrl* GetRichTextCtrl() const { return m_ctrl; } /** Sets a flag indicating whether the last paragraph is partial or complete. */ void SetPartialParagraph(bool partialPara) { m_partialParagraph = partialPara; } /** Returns a flag indicating whether the last paragraph is partial or complete. */ bool GetPartialParagraph() const { return m_partialParagraph; } /** Returns the style sheet associated with the overall buffer. */ virtual wxRichTextStyleSheet* GetStyleSheet() const; virtual bool IsTopLevel() const wxOVERRIDE { return true; } // Operations /** Submits a command to insert paragraphs. */ bool InsertParagraphsWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert the given text. */ bool InsertTextWithUndo(wxRichTextBuffer* buffer, long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert the given text. */ bool InsertNewlineWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert the given image. */ bool InsertImageWithUndo(wxRichTextBuffer* buffer, long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags, const wxRichTextAttr& textAttr); /** Submits a command to insert the given field. Field data can be included in properties. @see wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard */ wxRichTextField* InsertFieldWithUndo(wxRichTextBuffer* buffer, long pos, const wxString& fieldType, const wxRichTextProperties& properties, wxRichTextCtrl* ctrl, int flags, const wxRichTextAttr& textAttr); /** Returns the style that is appropriate for a new paragraph at this position. If the previous paragraph has a paragraph style name, looks up the next-paragraph style. */ wxRichTextAttr GetStyleForNewParagraph(wxRichTextBuffer* buffer, long pos, bool caretPosition = false, bool lookUpNewParaStyle=false) const; /** Inserts an object. */ wxRichTextObject* InsertObjectWithUndo(wxRichTextBuffer* buffer, long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to delete this range. */ bool DeleteRangeWithUndo(const wxRichTextRange& range, wxRichTextCtrl* ctrl, wxRichTextBuffer* buffer); /** Draws the floating objects in this buffer. */ void DrawFloats(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style); /** Moves an anchored object to another paragraph. */ void MoveAnchoredObjectToParagraph(wxRichTextParagraph* from, wxRichTextParagraph* to, wxRichTextObject* obj); /** Initializes the object. */ void Init(); /** Clears all the children. */ virtual void Clear(); /** Clears and initializes with one blank paragraph. */ virtual void Reset(); /** Convenience function to add a paragraph of text. */ virtual wxRichTextRange AddParagraph(const wxString& text, wxRichTextAttr* paraStyle = NULL); /** Convenience function to add an image. */ virtual wxRichTextRange AddImage(const wxImage& image, wxRichTextAttr* paraStyle = NULL); /** Adds multiple paragraphs, based on newlines. */ virtual wxRichTextRange AddParagraphs(const wxString& text, wxRichTextAttr* paraStyle = NULL); /** Returns the line at the given position. If @a caretPosition is true, the position is a caret position, which is normally a smaller number. */ virtual wxRichTextLine* GetLineAtPosition(long pos, bool caretPosition = false) const; /** Returns the line at the given y pixel position, or the last line. */ virtual wxRichTextLine* GetLineAtYPosition(int y) const; /** Returns the paragraph at the given character or caret position. */ virtual wxRichTextParagraph* GetParagraphAtPosition(long pos, bool caretPosition = false) const; /** Returns the line size at the given position. */ virtual wxSize GetLineSizeAtPosition(long pos, bool caretPosition = false) const; /** Given a position, returns the number of the visible line (potentially many to a paragraph), starting from zero at the start of the buffer. We also have to pass a bool (@a startOfLine) that indicates whether the caret is being shown at the end of the previous line or at the start of the next, since the caret can be shown at two visible positions for the same underlying position. */ virtual long GetVisibleLineNumber(long pos, bool caretPosition = false, bool startOfLine = false) const; /** Given a line number, returns the corresponding wxRichTextLine object. */ virtual wxRichTextLine* GetLineForVisibleLineNumber(long lineNumber) const; /** Returns the leaf object in a paragraph at this position. */ virtual wxRichTextObject* GetLeafObjectAtPosition(long position) const; /** Returns the paragraph by number. */ virtual wxRichTextParagraph* GetParagraphAtLine(long paragraphNumber) const; /** Returns the paragraph for a given line. */ virtual wxRichTextParagraph* GetParagraphForLine(wxRichTextLine* line) const; /** Returns the length of the paragraph. */ virtual int GetParagraphLength(long paragraphNumber) const; /** Returns the number of paragraphs. */ virtual int GetParagraphCount() const { return static_cast<int>(GetChildCount()); } /** Returns the number of visible lines. */ virtual int GetLineCount() const; /** Returns the text of the paragraph. */ virtual wxString GetParagraphText(long paragraphNumber) const; /** Converts zero-based line column and paragraph number to a position. */ virtual long XYToPosition(long x, long y) const; /** Converts a zero-based position to line column and paragraph number. */ virtual bool PositionToXY(long pos, long* x, long* y) const; /** Sets the attributes for the given range. Pass flags to determine how the attributes are set. The end point of range is specified as the last character position of the span of text. So, for example, to set the style for a character at position 5, use the range (5,5). This differs from the wxRichTextCtrl API, where you would specify (5,6). @a flags may contain a bit list of the following values: - wxRICHTEXT_SETSTYLE_NONE: no style flag. - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this operation should be undoable. - wxRICHTEXT_SETSTYLE_OPTIMIZE: specifies that the style should not be applied if the combined style at this point is already the style in question. - wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY: specifies that the style should only be applied to paragraphs, and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style. - wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY: specifies that the style should only be applied to characters, and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style. - wxRICHTEXT_SETSTYLE_RESET: resets (clears) the existing style before applying the new style. - wxRICHTEXT_SETSTYLE_REMOVE: removes the specified style. Only the style flags are used in this operation. */ virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); /** Sets the attributes for the given object only, for example the box attributes for a text box. */ virtual void SetStyle(wxRichTextObject *obj, const wxRichTextAttr& textAttr, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); /** Returns the combined text attributes for this position. This function gets the @e uncombined style - that is, the attributes associated with the paragraph or character content, and not necessarily the combined attributes you see on the screen. To get the combined attributes, use GetStyle(). If you specify (any) paragraph attribute in @e style's flags, this function will fetch the paragraph attributes. Otherwise, it will return the character attributes. */ virtual bool GetStyle(long position, wxRichTextAttr& style); /** Returns the content (uncombined) attributes for this position. */ virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style); /** Implementation helper for GetStyle. If combineStyles is true, combine base, paragraph and context attributes. */ virtual bool DoGetStyle(long position, wxRichTextAttr& style, bool combineStyles = true); /** This function gets a style representing the common, combined attributes in the given range. Attributes which have different values within the specified range will not be included the style flags. The function is used to get the attributes to display in the formatting dialog: the user can edit the attributes common to the selection, and optionally specify the values of further attributes to be applied uniformly. To apply the edited attributes, you can use SetStyle() specifying the wxRICHTEXT_SETSTYLE_OPTIMIZE flag, which will only apply attributes that are different from the @e combined attributes within the range. So, the user edits the effective, displayed attributes for the range, but his choice won't be applied unnecessarily to content. As an example, say the style for a paragraph specifies bold, but the paragraph text doesn't specify a weight. The combined style is bold, and this is what the user will see on-screen and in the formatting dialog. The user now specifies red text, in addition to bold. When applying with SetStyle(), the content font weight attributes won't be changed to bold because this is already specified by the paragraph. However the text colour attributes @e will be changed to show red. */ virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style); /** Combines @a style with @a currentStyle for the purpose of summarising the attributes of a range of content. */ bool CollectStyle(wxRichTextAttr& currentStyle, const wxRichTextAttr& style, wxRichTextAttr& clashingAttr, wxRichTextAttr& absentAttr); //@{ /** Sets the list attributes for the given range, passing flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from @a startFrom, otherwise existing attributes are used. - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. @see NumberList(), PromoteList(), ClearListStyle(). */ virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); virtual bool SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); //@} /** Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. @see SetListStyle(), PromoteList(), NumberList() */ virtual bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); //@{ /** Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from @a startFrom, otherwise existing attributes are used. - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. @a def can be NULL to indicate that the existing list style should be used. @see SetListStyle(), PromoteList(), ClearListStyle() */ virtual bool NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); virtual bool NumberList(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); //@} //@{ /** Promotes the list items within the given range. A positive @a promoteBy produces a smaller indent, and a negative number produces a larger indent. Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from @a startFrom, otherwise existing attributes are used. - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. @see SetListStyle(), SetListStyle(), ClearListStyle() */ virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); //@} /** Helper for NumberList and PromoteList, that does renumbering and promotion simultaneously @a def can be NULL/empty to indicate that the existing list style should be used. */ virtual bool DoNumberList(const wxRichTextRange& range, const wxRichTextRange& promotionRange, int promoteBy, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); /** Fills in the attributes for numbering a paragraph after previousParagraph. */ virtual bool FindNextParagraphNumber(wxRichTextParagraph* previousParagraph, wxRichTextAttr& attr) const; /** Sets the properties for the given range, passing flags to determine how the attributes are set. You can merge properties or replace them. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the properties for a character at position 5, use the range (5,6). @a flags may contain a bit list of the following values: - wxRICHTEXT_SETPROPERTIES_NONE: no flag. - wxRICHTEXT_SETPROPERTIES_WITH_UNDO: specifies that this operation should be undoable. - wxRICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY: specifies that the properties should only be applied to paragraphs, and not the content. - wxRICHTEXT_SETPROPERTIES_CHARACTERS_ONLY: specifies that the properties should only be applied to characters, and not the paragraph. - wxRICHTEXT_SETPROPERTIES_RESET: resets (clears) the existing properties before applying the new properties. - wxRICHTEXT_SETPROPERTIES_REMOVE: removes the specified properties. */ virtual bool SetProperties(const wxRichTextRange& range, const wxRichTextProperties& properties, int flags = wxRICHTEXT_SETPROPERTIES_WITH_UNDO); /** Sets with undo the properties for the given object. */ virtual bool SetObjectPropertiesWithUndo(wxRichTextObject& obj, const wxRichTextProperties& properties, wxRichTextObject* objToSet = NULL); /** Test if this whole range has character attributes of the specified kind. If any of the attributes are different within the range, the test fails. You can use this to implement, for example, bold button updating. style must have flags indicating which attributes are of interest. */ virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const; /** Test if this whole range has paragraph attributes of the specified kind. If any of the attributes are different within the range, the test fails. You can use this to implement, for example, centering button updating. style must have flags indicating which attributes are of interest. */ virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const; virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextParagraphLayoutBox(*this); } /** Prepares the content just before insertion (or after buffer reset). Currently is only called if undo mode is on. */ virtual void PrepareContent(wxRichTextParagraphLayoutBox& container); /** Insert fragment into this box at the given position. If partialParagraph is true, it is assumed that the last (or only) paragraph is just a piece of data with no paragraph marker. */ virtual bool InsertFragment(long position, wxRichTextParagraphLayoutBox& fragment); /** Make a copy of the fragment corresponding to the given range, putting it in @a fragment. */ virtual bool CopyFragment(const wxRichTextRange& range, wxRichTextParagraphLayoutBox& fragment); /** Apply the style sheet to the buffer, for example if the styles have changed. */ virtual bool ApplyStyleSheet(wxRichTextStyleSheet* styleSheet); void Copy(const wxRichTextParagraphLayoutBox& obj); void operator= (const wxRichTextParagraphLayoutBox& obj) { Copy(obj); } /** Calculate ranges. */ virtual void UpdateRanges(); /** Get all the text. */ virtual wxString GetText() const; /** Sets the default style, affecting the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). This is not cumulative - setting the default style will replace the previous default style. Setting it to a default attribute object makes new content take on the 'basic' style. */ virtual bool SetDefaultStyle(const wxRichTextAttr& style); /** Returns the current default style, affecting the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ virtual const wxRichTextAttr& GetDefaultStyle() const { return m_defaultAttributes; } /** Sets the basic (overall) style. This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ virtual void SetBasicStyle(const wxRichTextAttr& style) { m_attributes = style; } /** Returns the basic (overall) style. This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ virtual const wxRichTextAttr& GetBasicStyle() const { return m_attributes; } /** Invalidates the buffer. With no argument, invalidates whole buffer. */ virtual void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL) wxOVERRIDE; /** Do the (in)validation for this object only. */ virtual void DoInvalidate(const wxRichTextRange& invalidRange); /** Do the (in)validation both up and down the hierarchy. */ virtual void InvalidateHierarchy(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL); /** Gather information about floating objects. If untilObj is non-NULL, will stop getting information if the current object is this, since we will collect the rest later. */ virtual bool UpdateFloatingObjects(const wxRect& availableRect, wxRichTextObject* untilObj = NULL); /** Get invalid range, rounding to entire paragraphs if argument is true. */ wxRichTextRange GetInvalidRange(bool wholeParagraphs = false) const; /** Returns @true if this object needs layout. */ bool IsDirty() const { return m_invalidRange != wxRICHTEXT_NONE; } /** Returns the wxRichTextFloatCollector of this object. */ wxRichTextFloatCollector* GetFloatCollector() { return m_floatCollector; } /** Returns the number of floating objects at this level. */ int GetFloatingObjectCount() const; /** Returns a list of floating objects. */ bool GetFloatingObjects(wxRichTextObjectList& objects) const; protected: wxRichTextCtrl* m_ctrl; wxRichTextAttr m_defaultAttributes; // The invalidated range that will need full layout wxRichTextRange m_invalidRange; // Is the last paragraph partial or complete? bool m_partialParagraph; // The floating layout state wxRichTextFloatCollector* m_floatCollector; }; /** @class wxRichTextBox This class implements a floating or inline text box, containing paragraphs. @library{wxrichtext} @category{richtext} @see wxRichTextParagraphLayoutBox, wxRichTextObject, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextBox: public wxRichTextParagraphLayoutBox { wxDECLARE_DYNAMIC_CLASS(wxRichTextBox); public: // Constructors /** Default constructor; optionally pass the parent object. */ wxRichTextBox(wxRichTextObject* parent = NULL); /** Copy constructor. */ wxRichTextBox(const wxRichTextBox& obj): wxRichTextParagraphLayoutBox() { Copy(obj); } // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("textbox"); } virtual bool CanEditProperties() const wxOVERRIDE { return true; } virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer) wxOVERRIDE; virtual wxString GetPropertiesMenuLabel() const wxOVERRIDE { return wxGetTranslation("&Box"); } // Accessors // Operations virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextBox(*this); } void Copy(const wxRichTextBox& obj); protected: }; /** @class wxRichTextField This class implements the general concept of a field, an object that represents additional functionality such as a footnote, a bookmark, a page number, a table of contents, and so on. Extra information (such as a bookmark name) can be stored in the object properties. Drawing, layout, and property editing is delegated to classes derived from wxRichTextFieldType, such as instances of wxRichTextFieldTypeStandard; this makes the use of fields an efficient method of introducing extra functionality, since most of the information required to draw a field (such as a bitmap) is kept centrally in a single field type definition. The FieldType property, accessed by SetFieldType/GetFieldType, is used to retrieve the field type definition. So be careful not to overwrite this property. wxRichTextField is derived from wxRichTextParagraphLayoutBox, which means that it can contain its own read-only content, refreshed when the application calls the UpdateField function. Whether a field is treated as a composite or a single graphic is determined by the field type definition. If using wxRichTextFieldTypeStandard, passing the display type wxRICHTEXT_FIELD_STYLE_COMPOSITE to the field type definition causes the field to behave like a composite; the other display styles display a simple graphic. When implementing a composite field, you will still need to derive from wxRichTextFieldTypeStandard or wxRichTextFieldType, if only to implement UpdateField to refresh the field content appropriately. wxRichTextFieldTypeStandard is only one possible implementation, but covers common needs especially for simple, static fields using text or a bitmap. Register field types on application initialisation with the static function wxRichTextBuffer::AddFieldType. They will be deleted automatically on application exit. An application can write a field to a control with wxRichTextCtrl::WriteField, taking a field type, the properties for the field, and optional attributes. @library{wxrichtext} @category{richtext} @see wxRichTextFieldTypeStandard, wxRichTextFieldType, wxRichTextParagraphLayoutBox, wxRichTextProperties, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextField: public wxRichTextParagraphLayoutBox { wxDECLARE_DYNAMIC_CLASS(wxRichTextField); public: // Constructors /** Default constructor; optionally pass the parent object. */ wxRichTextField(const wxString& fieldType = wxEmptyString, wxRichTextObject* parent = NULL); /** Copy constructor. */ wxRichTextField(const wxRichTextField& obj): wxRichTextParagraphLayoutBox() { Copy(obj); } // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("field"); } virtual bool CanEditProperties() const wxOVERRIDE; virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer) wxOVERRIDE; virtual wxString GetPropertiesMenuLabel() const wxOVERRIDE; virtual bool AcceptsFocus() const wxOVERRIDE { return false; } virtual void CalculateRange(long start, long& end) wxOVERRIDE; /** If a field has children, we don't want the user to be able to edit it. */ virtual bool IsAtomic() const wxOVERRIDE { return true; } virtual bool IsEmpty() const wxOVERRIDE { return false; } virtual bool IsTopLevel() const wxOVERRIDE; // Accessors void SetFieldType(const wxString& fieldType) { GetProperties().SetProperty(wxT("FieldType"), fieldType); } wxString GetFieldType() const { return GetProperties().GetPropertyString(wxT("FieldType")); } // Operations /** Update the field; delegated to the associated field type. This would typically expand the field to its value, if this is a dynamically changing and/or composite field. */ virtual bool UpdateField(wxRichTextBuffer* buffer); virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextField(*this); } void Copy(const wxRichTextField& obj); protected: }; /** @class wxRichTextFieldType The base class for custom field types. Each type definition handles one field type. Override functions to provide drawing, layout, updating and property editing functionality for a field. Register field types on application initialisation with the static function wxRichTextBuffer::AddFieldType. They will be deleted automatically on application exit. @library{wxrichtext} @category{richtext} @see wxRichTextFieldTypeStandard, wxRichTextField, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextFieldType: public wxObject { wxDECLARE_CLASS(wxRichTextFieldType); public: /** Creates a field type definition. */ wxRichTextFieldType(const wxString& name = wxEmptyString) : m_name(name) { } /** Copy constructor. */ wxRichTextFieldType(const wxRichTextFieldType& fieldType) : wxObject(fieldType) { Copy(fieldType); } void Copy(const wxRichTextFieldType& fieldType) { m_name = fieldType.m_name; } /** Draw the item, within the given range. Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping) */ virtual bool Draw(wxRichTextField* obj, wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) = 0; /** Lay the item out at the specified position with the given size constraint. Layout must set the cached size. @rect is the available space for the object, and @a parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box). */ virtual bool Layout(wxRichTextField* obj, wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) = 0; /** Returns the object size for the given range. Returns @false if the range is invalid for this object. */ virtual bool GetRangeSize(wxRichTextField* obj, const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const = 0; /** Returns @true if we can edit the object's properties via a GUI. */ virtual bool CanEditProperties(wxRichTextField* WXUNUSED(obj)) const { return false; } /** Edits the object's properties via a GUI. */ virtual bool EditProperties(wxRichTextField* WXUNUSED(obj), wxWindow* WXUNUSED(parent), wxRichTextBuffer* WXUNUSED(buffer)) { return false; } /** Returns the label to be used for the properties context menu item. */ virtual wxString GetPropertiesMenuLabel(wxRichTextField* WXUNUSED(obj)) const { return wxEmptyString; } /** Update the field. This would typically expand the field to its value, if this is a dynamically changing and/or composite field. */ virtual bool UpdateField(wxRichTextBuffer* WXUNUSED(buffer), wxRichTextField* WXUNUSED(obj)) { return false; } /** Returns @true if this object is top-level, i.e. contains its own paragraphs, such as a text box. */ virtual bool IsTopLevel(wxRichTextField* WXUNUSED(obj)) const { return true; } /** Sets the field type name. There should be a unique name per field type object. */ void SetName(const wxString& name) { m_name = name; } /** Returns the field type name. There should be a unique name per field type object. */ wxString GetName() const { return m_name; } protected: wxString m_name; }; WX_DECLARE_STRING_HASH_MAP(wxRichTextFieldType*, wxRichTextFieldTypeHashMap); /** @class wxRichTextFieldTypeStandard A field type that can handle fields with text or bitmap labels, with a small range of styles for implementing rectangular fields and fields that can be used for start and end tags. The border, text and background colours can be customised; the default is white text on a black background. The following display styles can be used. @beginStyleTable @style{wxRICHTEXT_FIELD_STYLE_COMPOSITE} Creates a composite field; you will probably need to derive a new class to implement UpdateField. @style{wxRICHTEXT_FIELD_STYLE_RECTANGLE} Shows a rounded rectangle background. @style{wxRICHTEXT_FIELD_STYLE_NO_BORDER} Suppresses the background and border; mostly used with a bitmap label. @style{wxRICHTEXT_FIELD_STYLE_START_TAG} Shows a start tag background, with the pointy end facing right. @style{wxRICHTEXT_FIELD_STYLE_END_TAG} Shows an end tag background, with the pointy end facing left. @endStyleTable @library{wxrichtext} @category{richtext} @see wxRichTextFieldType, wxRichTextField, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextFieldTypeStandard: public wxRichTextFieldType { wxDECLARE_CLASS(wxRichTextFieldTypeStandard); public: // Display style types enum { wxRICHTEXT_FIELD_STYLE_COMPOSITE = 0x01, wxRICHTEXT_FIELD_STYLE_RECTANGLE = 0x02, wxRICHTEXT_FIELD_STYLE_NO_BORDER = 0x04, wxRICHTEXT_FIELD_STYLE_START_TAG = 0x08, wxRICHTEXT_FIELD_STYLE_END_TAG = 0x10 }; /** Constructor, creating a field type definition with a text label. @param parent The name of the type definition. This must be unique, and is the type name used when adding a field to a control. @param label The text label to be shown on the field. @param displayStyle The display style: one of wxRICHTEXT_FIELD_STYLE_RECTANGLE, wxRICHTEXT_FIELD_STYLE_NO_BORDER, wxRICHTEXT_FIELD_STYLE_START_TAG, wxRICHTEXT_FIELD_STYLE_END_TAG. */ wxRichTextFieldTypeStandard(const wxString& name, const wxString& label, int displayStyle = wxRICHTEXT_FIELD_STYLE_RECTANGLE); /** Constructor, creating a field type definition with a bitmap label. @param parent The name of the type definition. This must be unique, and is the type name used when adding a field to a control. @param label The bitmap label to be shown on the field. @param displayStyle The display style: one of wxRICHTEXT_FIELD_STYLE_RECTANGLE, wxRICHTEXT_FIELD_STYLE_NO_BORDER, wxRICHTEXT_FIELD_STYLE_START_TAG, wxRICHTEXT_FIELD_STYLE_END_TAG. */ wxRichTextFieldTypeStandard(const wxString& name, const wxBitmap& bitmap, int displayStyle = wxRICHTEXT_FIELD_STYLE_NO_BORDER); /** The default constructor. */ wxRichTextFieldTypeStandard() { Init(); } /** The copy constructor. */ wxRichTextFieldTypeStandard(const wxRichTextFieldTypeStandard& field) : wxRichTextFieldType(field) { Copy(field); } /** Initialises the object. */ void Init(); /** Copies the object. */ void Copy(const wxRichTextFieldTypeStandard& field); /** The assignment operator. */ void operator=(const wxRichTextFieldTypeStandard& field) { Copy(field); } /** Draw the item, within the given range. Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping) */ virtual bool Draw(wxRichTextField* obj, wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; /** Lay the item out at the specified position with the given size constraint. Layout must set the cached size. @rect is the available space for the object, and @a parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box). */ virtual bool Layout(wxRichTextField* obj, wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; /** Returns the object size for the given range. Returns @false if the range is invalid for this object. */ virtual bool GetRangeSize(wxRichTextField* obj, const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; /** Get the size of the field, given the label, font size, and so on. */ wxSize GetSize(wxRichTextField* obj, wxDC& dc, wxRichTextDrawingContext& context, int style) const; /** Returns @true if the display type is wxRICHTEXT_FIELD_STYLE_COMPOSITE, @false otherwise. */ virtual bool IsTopLevel(wxRichTextField* WXUNUSED(obj)) const wxOVERRIDE { return (GetDisplayStyle() & wxRICHTEXT_FIELD_STYLE_COMPOSITE) != 0; } /** Sets the text label for fields of this type. */ void SetLabel(const wxString& label) { m_label = label; } /** Returns the text label for fields of this type. */ const wxString& GetLabel() const { return m_label; } /** Sets the bitmap label for fields of this type. */ void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } /** Gets the bitmap label for fields of this type. */ const wxBitmap& GetBitmap() const { return m_bitmap; } /** Gets the display style for fields of this type. */ int GetDisplayStyle() const { return m_displayStyle; } /** Sets the display style for fields of this type. */ void SetDisplayStyle(int displayStyle) { m_displayStyle = displayStyle; } /** Gets the font used for drawing the text label. */ const wxFont& GetFont() const { return m_font; } /** Sets the font used for drawing the text label. */ void SetFont(const wxFont& font) { m_font = font; } /** Gets the colour used for drawing the text label. */ const wxColour& GetTextColour() const { return m_textColour; } /** Sets the colour used for drawing the text label. */ void SetTextColour(const wxColour& colour) { m_textColour = colour; } /** Gets the colour used for drawing the field border. */ const wxColour& GetBorderColour() const { return m_borderColour; } /** Sets the colour used for drawing the field border. */ void SetBorderColour(const wxColour& colour) { m_borderColour = colour; } /** Gets the colour used for drawing the field background. */ const wxColour& GetBackgroundColour() const { return m_backgroundColour; } /** Sets the colour used for drawing the field background. */ void SetBackgroundColour(const wxColour& colour) { m_backgroundColour = colour; } /** Sets the vertical padding (the distance between the border and the text). */ void SetVerticalPadding(int padding) { m_verticalPadding = padding; } /** Gets the vertical padding (the distance between the border and the text). */ int GetVerticalPadding() const { return m_verticalPadding; } /** Sets the horizontal padding (the distance between the border and the text). */ void SetHorizontalPadding(int padding) { m_horizontalPadding = padding; } /** Sets the horizontal padding (the distance between the border and the text). */ int GetHorizontalPadding() const { return m_horizontalPadding; } /** Sets the horizontal margin surrounding the field object. */ void SetHorizontalMargin(int margin) { m_horizontalMargin = margin; } /** Gets the horizontal margin surrounding the field object. */ int GetHorizontalMargin() const { return m_horizontalMargin; } /** Sets the vertical margin surrounding the field object. */ void SetVerticalMargin(int margin) { m_verticalMargin = margin; } /** Gets the vertical margin surrounding the field object. */ int GetVerticalMargin() const { return m_verticalMargin; } protected: wxString m_label; int m_displayStyle; wxFont m_font; wxColour m_textColour; wxColour m_borderColour; wxColour m_backgroundColour; int m_verticalPadding; int m_horizontalPadding; int m_horizontalMargin; int m_verticalMargin; wxBitmap m_bitmap; }; /** @class wxRichTextLine This object represents a line in a paragraph, and stores offsets from the start of the paragraph representing the start and end positions of the line. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextLine { public: // Constructors wxRichTextLine(wxRichTextParagraph* parent); wxRichTextLine(const wxRichTextLine& obj) { Init( NULL); Copy(obj); } virtual ~wxRichTextLine() {} // Overridables // Accessors /** Sets the range associated with this line. */ void SetRange(const wxRichTextRange& range) { m_range = range; } /** Sets the range associated with this line. */ void SetRange(long from, long to) { m_range = wxRichTextRange(from, to); } /** Returns the parent paragraph. */ wxRichTextParagraph* GetParent() { return m_parent; } /** Returns the range. */ const wxRichTextRange& GetRange() const { return m_range; } /** Returns the range. */ wxRichTextRange& GetRange() { return m_range; } /** Returns the absolute range. */ wxRichTextRange GetAbsoluteRange() const; /** Returns the line size as calculated by Layout. */ virtual wxSize GetSize() const { return m_size; } /** Sets the line size as calculated by Layout. */ virtual void SetSize(const wxSize& sz) { m_size = sz; } /** Returns the object position relative to the parent. */ virtual wxPoint GetPosition() const { return m_pos; } /** Sets the object position relative to the parent. */ virtual void SetPosition(const wxPoint& pos) { m_pos = pos; } /** Returns the absolute object position. */ virtual wxPoint GetAbsolutePosition() const; /** Returns the rectangle enclosing the line. */ virtual wxRect GetRect() const { return wxRect(GetAbsolutePosition(), GetSize()); } /** Sets the stored descent. */ void SetDescent(int descent) { m_descent = descent; } /** Returns the stored descent. */ int GetDescent() const { return m_descent; } #if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING wxArrayInt& GetObjectSizes() { return m_objectSizes; } const wxArrayInt& GetObjectSizes() const { return m_objectSizes; } #endif // Operations /** Initialises the object. */ void Init(wxRichTextParagraph* parent); /** Copies from @a obj. */ void Copy(const wxRichTextLine& obj); virtual wxRichTextLine* Clone() const { return new wxRichTextLine(*this); } protected: // The range of the line (start position to end position) // This is relative to the parent paragraph. wxRichTextRange m_range; // Size and position measured relative to top of paragraph wxPoint m_pos; wxSize m_size; // Maximum descent for this line (location of text baseline) int m_descent; // The parent object wxRichTextParagraph* m_parent; #if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING wxArrayInt m_objectSizes; #endif }; WX_DECLARE_LIST_WITH_DECL( wxRichTextLine, wxRichTextLineList , class WXDLLIMPEXP_RICHTEXT ); /** @class wxRichTextParagraph This object represents a single paragraph containing various objects such as text content, images, and further paragraph layout objects. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextParagraph: public wxRichTextCompositeObject { wxDECLARE_DYNAMIC_CLASS(wxRichTextParagraph); public: // Constructors /** Constructor taking a parent and style. */ wxRichTextParagraph(wxRichTextObject* parent = NULL, wxRichTextAttr* style = NULL); /** Constructor taking a text string, a parent and paragraph and character attributes. */ wxRichTextParagraph(const wxString& text, wxRichTextObject* parent = NULL, wxRichTextAttr* paraStyle = NULL, wxRichTextAttr* charStyle = NULL); virtual ~wxRichTextParagraph(); wxRichTextParagraph(const wxRichTextParagraph& obj): wxRichTextCompositeObject() { Copy(obj); } void Init(); // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; virtual bool FindPosition(wxDC& dc, wxRichTextDrawingContext& context, long index, wxPoint& pt, int* height, bool forceLineStart) wxOVERRIDE; virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0) wxOVERRIDE; virtual void CalculateRange(long start, long& end) wxOVERRIDE; virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("paragraph"); } // Accessors /** Returns the cached lines. */ wxRichTextLineList& GetLines() { return m_cachedLines; } // Operations /** Copies the object. */ void Copy(const wxRichTextParagraph& obj); virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextParagraph(*this); } /** Clears the cached lines. */ void ClearLines(); // Implementation /** Applies paragraph styles such as centering to the wrapped lines. */ virtual void ApplyParagraphStyle(wxRichTextLine* line, const wxRichTextAttr& attr, const wxRect& rect, wxDC& dc); /** Inserts text at the given position. */ virtual bool InsertText(long pos, const wxString& text); /** Splits an object at this position if necessary, and returns the previous object, or NULL if inserting at the beginning. */ virtual wxRichTextObject* SplitAt(long pos, wxRichTextObject** previousObject = NULL); /** Moves content to a list from this point. */ virtual void MoveToList(wxRichTextObject* obj, wxList& list); /** Adds content back from a list. */ virtual void MoveFromList(wxList& list); /** Returns the plain text searching from the start or end of the range. The resulting string may be shorter than the range given. */ bool GetContiguousPlainText(wxString& text, const wxRichTextRange& range, bool fromStart = true); /** Finds a suitable wrap position. @a wrapPosition is the last position in the line to the left of the split. */ bool FindWrapPosition(const wxRichTextRange& range, wxDC& dc, wxRichTextDrawingContext& context, int availableSpace, long& wrapPosition, wxArrayInt* partialExtents); /** Finds the object at the given position. */ wxRichTextObject* FindObjectAtPosition(long position); /** Returns the bullet text for this paragraph. */ wxString GetBulletText(); /** Allocates or reuses a line object. */ wxRichTextLine* AllocateLine(int pos); /** Clears remaining unused line objects, if any. */ bool ClearUnusedLines(int lineCount); /** Returns combined attributes of the base style, paragraph style and character style. We use this to dynamically retrieve the actual style. */ wxRichTextAttr GetCombinedAttributes(const wxRichTextAttr& contentStyle, bool includingBoxAttr = false) const; /** Returns the combined attributes of the base style and paragraph style. */ wxRichTextAttr GetCombinedAttributes(bool includingBoxAttr = false) const; /** Returns the first position from pos that has a line break character. */ long GetFirstLineBreakPosition(long pos); /** Creates a default tabstop array. */ static void InitDefaultTabs(); /** Clears the default tabstop array. */ static void ClearDefaultTabs(); /** Returns the default tabstop array. */ static const wxArrayInt& GetDefaultTabs() { return sm_defaultTabs; } /** Lays out the floating objects. */ void LayoutFloat(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style, wxRichTextFloatCollector* floatCollector); /** Whether the paragraph is impacted by floating objects from above. */ int GetImpactedByFloatingObjects() const { return m_impactedByFloatingObjects; } /** Sets whether the paragraph is impacted by floating objects from above. */ void SetImpactedByFloatingObjects(int i) { m_impactedByFloatingObjects = i; } protected: // The lines that make up the wrapped paragraph wxRichTextLineList m_cachedLines; // Whether the paragraph is impacted by floating objects from above int m_impactedByFloatingObjects; // Default tabstops static wxArrayInt sm_defaultTabs; friend class wxRichTextFloatCollector; }; /** @class wxRichTextPlainText This object represents a single piece of text. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextPlainText: public wxRichTextObject { wxDECLARE_DYNAMIC_CLASS(wxRichTextPlainText); public: // Constructors /** Constructor. */ wxRichTextPlainText(const wxString& text = wxEmptyString, wxRichTextObject* parent = NULL, wxRichTextAttr* style = NULL); /** Copy constructor. */ wxRichTextPlainText(const wxRichTextPlainText& obj): wxRichTextObject() { Copy(obj); } // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; virtual bool AdjustAttributes(wxRichTextAttr& attr, wxRichTextDrawingContext& context) wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; virtual wxString GetTextForRange(const wxRichTextRange& range) const wxOVERRIDE; virtual wxRichTextObject* DoSplit(long pos) wxOVERRIDE; virtual void CalculateRange(long start, long& end) wxOVERRIDE; virtual bool DeleteRange(const wxRichTextRange& range) wxOVERRIDE; virtual bool IsEmpty() const wxOVERRIDE { return m_text.empty(); } virtual bool CanMerge(wxRichTextObject* object, wxRichTextDrawingContext& context) const wxOVERRIDE; virtual bool Merge(wxRichTextObject* object, wxRichTextDrawingContext& context) wxOVERRIDE; virtual void Dump(wxTextOutputStream& stream) wxOVERRIDE; virtual bool CanSplit(wxRichTextDrawingContext& context) const wxOVERRIDE; virtual wxRichTextObject* Split(wxRichTextDrawingContext& context) wxOVERRIDE; /** Get the first position from pos that has a line break character. */ long GetFirstLineBreakPosition(long pos); /// Does this object take note of paragraph attributes? Text and image objects don't. virtual bool UsesParagraphAttributes() const wxOVERRIDE { return false; } #if wxUSE_XML virtual bool ImportFromXML(wxRichTextBuffer* buffer, wxXmlNode* node, wxRichTextXMLHandler* handler, bool* recurse) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_DIRECT_OUTPUT virtual bool ExportXML(wxOutputStream& stream, int indent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT virtual bool ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("text"); } // Accessors /** Returns the text. */ const wxString& GetText() const { return m_text; } /** Sets the text. */ void SetText(const wxString& text) { m_text = text; } // Operations // Copies the text object, void Copy(const wxRichTextPlainText& obj); // Clones the text object. virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextPlainText(*this); } private: bool DrawTabbedString(wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect, wxString& str, wxCoord& x, wxCoord& y, bool selected); protected: wxString m_text; }; /** @class wxRichTextImageBlock This class stores information about an image, in binary in-memory form. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextImageBlock: public wxObject { public: /** Constructor. */ wxRichTextImageBlock(); /** Copy constructor. */ wxRichTextImageBlock(const wxRichTextImageBlock& block); virtual ~wxRichTextImageBlock(); /** Initialises the block. */ void Init(); /** Clears the block. */ void Clear(); /** Load the original image into a memory block. If the image is not a JPEG, we must convert it into a JPEG to conserve space. If it's not a JPEG we can make use of @a image, already scaled, so we don't have to load the image a second time. */ virtual bool MakeImageBlock(const wxString& filename, wxBitmapType imageType, wxImage& image, bool convertToJPEG = true); /** Make an image block from the wxImage in the given format. */ virtual bool MakeImageBlock(wxImage& image, wxBitmapType imageType, int quality = 80); /** Uses a const wxImage for efficiency, but can't set quality (only relevant for JPEG) */ virtual bool MakeImageBlockDefaultQuality(const wxImage& image, wxBitmapType imageType); /** Makes the image block. */ virtual bool DoMakeImageBlock(const wxImage& image, wxBitmapType imageType); /** Writes the block to a file. */ bool Write(const wxString& filename); /** Writes the data in hex to a stream. */ bool WriteHex(wxOutputStream& stream); /** Reads the data in hex from a stream. */ bool ReadHex(wxInputStream& stream, int length, wxBitmapType imageType); /** Copy from @a block. */ void Copy(const wxRichTextImageBlock& block); // Load a wxImage from the block /** */ bool Load(wxImage& image); // Operators /** Assignment operation. */ void operator=(const wxRichTextImageBlock& block); // Accessors /** Returns the raw data. */ unsigned char* GetData() const { return m_data; } /** Returns the data size in bytes. */ size_t GetDataSize() const { return m_dataSize; } /** Returns the image type. */ wxBitmapType GetImageType() const { return m_imageType; } /** */ void SetData(unsigned char* image) { m_data = image; } /** Sets the data size. */ void SetDataSize(size_t size) { m_dataSize = size; } /** Sets the image type. */ void SetImageType(wxBitmapType imageType) { m_imageType = imageType; } /** Returns @true if the data is non-NULL. */ bool IsOk() const { return GetData() != NULL; } bool Ok() const { return IsOk(); } /** Gets the extension for the block's type. */ wxString GetExtension() const; /// Implementation /** Allocates and reads from a stream as a block of memory. */ static unsigned char* ReadBlock(wxInputStream& stream, size_t size); /** Allocates and reads from a file as a block of memory. */ static unsigned char* ReadBlock(const wxString& filename, size_t size); /** Writes a memory block to stream. */ static bool WriteBlock(wxOutputStream& stream, unsigned char* block, size_t size); /** Writes a memory block to a file. */ static bool WriteBlock(const wxString& filename, unsigned char* block, size_t size); protected: // Size in bytes of the image stored. // This is in the raw, original form such as a JPEG file. unsigned char* m_data; size_t m_dataSize; wxBitmapType m_imageType; }; /** @class wxRichTextImage This class implements a graphic object. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl, wxRichTextImageBlock */ class WXDLLIMPEXP_RICHTEXT wxRichTextImage: public wxRichTextObject { wxDECLARE_DYNAMIC_CLASS(wxRichTextImage); public: enum { ImageState_Unloaded, ImageState_Loaded, ImageState_Bad }; // Constructors /** Default constructor. */ wxRichTextImage(wxRichTextObject* parent = NULL): wxRichTextObject(parent) { Init(); } /** Creates a wxRichTextImage from a wxImage. */ wxRichTextImage(const wxImage& image, wxRichTextObject* parent = NULL, wxRichTextAttr* charStyle = NULL); /** Creates a wxRichTextImage from an image block. */ wxRichTextImage(const wxRichTextImageBlock& imageBlock, wxRichTextObject* parent = NULL, wxRichTextAttr* charStyle = NULL); /** Copy constructor. */ wxRichTextImage(const wxRichTextImage& obj): wxRichTextObject(obj) { Copy(obj); } /** Destructor. */ ~wxRichTextImage(); /** Initialisation. */ void Init(); // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; /** Returns the 'natural' size for this object - the image size. */ virtual wxTextAttrSize GetNaturalSize() const wxOVERRIDE; virtual bool IsEmpty() const wxOVERRIDE { return false; /* !m_imageBlock.IsOk(); */ } virtual bool CanEditProperties() const wxOVERRIDE { return true; } virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer) wxOVERRIDE; virtual wxString GetPropertiesMenuLabel() const wxOVERRIDE { return wxGetTranslation("&Picture"); } virtual bool UsesParagraphAttributes() const wxOVERRIDE { return false; } #if wxUSE_XML virtual bool ImportFromXML(wxRichTextBuffer* buffer, wxXmlNode* node, wxRichTextXMLHandler* handler, bool* recurse) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_DIRECT_OUTPUT virtual bool ExportXML(wxOutputStream& stream, int indent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT virtual bool ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif // Images can be floatable (optionally). virtual bool IsFloatable() const wxOVERRIDE { return true; } virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("image"); } // Accessors /** Returns the image cache (a scaled bitmap). */ const wxBitmap& GetImageCache() const { return m_imageCache; } /** Sets the image cache. */ void SetImageCache(const wxBitmap& bitmap) { m_imageCache = bitmap; m_originalImageSize = wxSize(bitmap.GetWidth(), bitmap.GetHeight()); m_imageState = ImageState_Loaded; } /** Resets the image cache. */ void ResetImageCache() { m_imageCache = wxNullBitmap; m_originalImageSize = wxSize(-1, -1); m_imageState = ImageState_Unloaded; } /** Returns the image block containing the raw data. */ wxRichTextImageBlock& GetImageBlock() { return m_imageBlock; } // Operations /** Copies the image object. */ void Copy(const wxRichTextImage& obj); /** Clones the image object. */ virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextImage(*this); } /** Creates a cached image at the required size. */ virtual bool LoadImageCache(wxDC& dc, wxRichTextDrawingContext& context, wxSize& retImageSize, bool resetCache = false, const wxSize& parentSize = wxDefaultSize); /** Do the loading and scaling */ virtual bool LoadAndScaleImageCache(wxImage& image, const wxSize& sz, wxRichTextDrawingContext& context, bool& changed); /** Gets the original image size. */ wxSize GetOriginalImageSize() const { return m_originalImageSize; } /** Sets the original image size. */ void SetOriginalImageSize(const wxSize& sz) { m_originalImageSize = sz; } /** Gets the image state. */ int GetImageState() const { return m_imageState; } /** Sets the image state. */ void SetImageState(int state) { m_imageState = state; } protected: wxRichTextImageBlock m_imageBlock; wxBitmap m_imageCache; wxSize m_originalImageSize; int m_imageState; }; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCommand; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAction; /** @class wxRichTextBuffer This is a kind of paragraph layout box, used to represent the whole buffer. @library{wxrichtext} @category{richtext} @see wxRichTextParagraphLayoutBox, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer: public wxRichTextParagraphLayoutBox { wxDECLARE_DYNAMIC_CLASS(wxRichTextBuffer); public: // Constructors /** Default constructor. */ wxRichTextBuffer() { Init(); } /** Copy constructor. */ wxRichTextBuffer(const wxRichTextBuffer& obj): wxRichTextParagraphLayoutBox() { Init(); Copy(obj); } virtual ~wxRichTextBuffer() ; // Accessors /** Returns the command processor. A text buffer always creates its own command processor when it is initialized. */ wxCommandProcessor* GetCommandProcessor() const { return m_commandProcessor; } /** Sets style sheet, if any. This will allow the application to use named character and paragraph styles found in the style sheet. Neither the buffer nor the control owns the style sheet so must be deleted by the application. */ void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { m_styleSheet = styleSheet; } /** Returns the style sheet. */ virtual wxRichTextStyleSheet* GetStyleSheet() const wxOVERRIDE { return m_styleSheet; } /** Sets the style sheet and sends a notification of the change. */ bool SetStyleSheetAndNotify(wxRichTextStyleSheet* sheet); /** Pushes the style sheet to the top of the style sheet stack. */ bool PushStyleSheet(wxRichTextStyleSheet* styleSheet); /** Pops the style sheet from the top of the style sheet stack. */ wxRichTextStyleSheet* PopStyleSheet(); /** Returns the table storing fonts, for quick access and font reuse. */ wxRichTextFontTable& GetFontTable() { return m_fontTable; } /** Returns the table storing fonts, for quick access and font reuse. */ const wxRichTextFontTable& GetFontTable() const { return m_fontTable; } /** Sets table storing fonts, for quick access and font reuse. */ void SetFontTable(const wxRichTextFontTable& table) { m_fontTable = table; } /** Sets the scale factor for displaying fonts, for example for more comfortable editing. */ void SetFontScale(double fontScale); /** Returns the scale factor for displaying fonts, for example for more comfortable editing. */ double GetFontScale() const { return m_fontScale; } /** Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing. This can be useful when editing in a small control where you still want legible text, but a minimum of wasted white space. */ void SetDimensionScale(double dimScale); /** Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing. */ double GetDimensionScale() const { return m_dimensionScale; } // Operations /** Initialisation. */ void Init(); /** Clears the buffer, adds an empty paragraph, and clears the command processor. */ virtual void ResetAndClearCommands(); #if wxUSE_FFILE && wxUSE_STREAMS //@{ /** Loads content from a file. Not all handlers will implement file loading. */ virtual bool LoadFile(const wxString& filename, wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); //@} //@{ /** Saves content to a file. Not all handlers will implement file saving. */ virtual bool SaveFile(const wxString& filename, wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); //@} #endif // wxUSE_FFILE #if wxUSE_STREAMS //@{ /** Loads content from a stream. Not all handlers will implement loading from a stream. */ virtual bool LoadFile(wxInputStream& stream, wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); //@} //@{ /** Saves content to a stream. Not all handlers will implement saving to a stream. */ virtual bool SaveFile(wxOutputStream& stream, wxRichTextFileType type = wxRICHTEXT_TYPE_ANY); //@} #endif // wxUSE_STREAMS /** Sets the handler flags, controlling loading and saving. */ void SetHandlerFlags(int flags) { m_handlerFlags = flags; } /** Gets the handler flags, controlling loading and saving. */ int GetHandlerFlags() const { return m_handlerFlags; } /** Convenience function to add a paragraph of text. */ virtual wxRichTextRange AddParagraph(const wxString& text, wxRichTextAttr* paraStyle = NULL) wxOVERRIDE { Modify(); return wxRichTextParagraphLayoutBox::AddParagraph(text, paraStyle); } /** Begin collapsing undo/redo commands. Note that this may not work properly if combining commands that delete or insert content, changing ranges for subsequent actions. @a cmdName should be the name of the combined command that will appear next to Undo and Redo in the edit menu. */ virtual bool BeginBatchUndo(const wxString& cmdName); /** End collapsing undo/redo commands. */ virtual bool EndBatchUndo(); /** Returns @true if we are collapsing commands. */ virtual bool BatchingUndo() const { return m_batchedCommandDepth > 0; } /** Submit the action immediately, or delay according to whether collapsing is on. */ virtual bool SubmitAction(wxRichTextAction* action); /** Returns the collapsed command. */ virtual wxRichTextCommand* GetBatchedCommand() const { return m_batchedCommand; } /** Begin suppressing undo/redo commands. The way undo is suppressed may be implemented differently by each command. If not dealt with by a command implementation, then it will be implemented automatically by not storing the command in the undo history when the action is submitted to the command processor. */ virtual bool BeginSuppressUndo(); /** End suppressing undo/redo commands. */ virtual bool EndSuppressUndo(); /** Are we suppressing undo?? */ virtual bool SuppressingUndo() const { return m_suppressUndo > 0; } /** Copy the range to the clipboard. */ virtual bool CopyToClipboard(const wxRichTextRange& range); /** Paste the clipboard content to the buffer. */ virtual bool PasteFromClipboard(long position); /** Returns @true if we can paste from the clipboard. */ virtual bool CanPasteFromClipboard() const; /** Begin using a style. */ virtual bool BeginStyle(const wxRichTextAttr& style); /** End the style. */ virtual bool EndStyle(); /** End all styles. */ virtual bool EndAllStyles(); /** Clears the style stack. */ virtual void ClearStyleStack(); /** Returns the size of the style stack, for example to check correct nesting. */ virtual size_t GetStyleStackSize() const { return m_attributeStack.GetCount(); } /** Begins using bold. */ bool BeginBold(); /** Ends using bold. */ bool EndBold() { return EndStyle(); } /** Begins using italic. */ bool BeginItalic(); /** Ends using italic. */ bool EndItalic() { return EndStyle(); } /** Begins using underline. */ bool BeginUnderline(); /** Ends using underline. */ bool EndUnderline() { return EndStyle(); } /** Begins using point size. */ bool BeginFontSize(int pointSize); /** Ends using point size. */ bool EndFontSize() { return EndStyle(); } /** Begins using this font. */ bool BeginFont(const wxFont& font); /** Ends using a font. */ bool EndFont() { return EndStyle(); } /** Begins using this colour. */ bool BeginTextColour(const wxColour& colour); /** Ends using a colour. */ bool EndTextColour() { return EndStyle(); } /** Begins using alignment. */ bool BeginAlignment(wxTextAttrAlignment alignment); /** Ends alignment. */ bool EndAlignment() { return EndStyle(); } /** Begins using @a leftIndent for the left indent, and optionally @a leftSubIndent for the sub-indent. Both are expressed in tenths of a millimetre. The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines. */ bool BeginLeftIndent(int leftIndent, int leftSubIndent = 0); /** Ends left indent. */ bool EndLeftIndent() { return EndStyle(); } /** Begins a right indent, specified in tenths of a millimetre. */ bool BeginRightIndent(int rightIndent); /** Ends right indent. */ bool EndRightIndent() { return EndStyle(); } /** Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre. */ bool BeginParagraphSpacing(int before, int after); /** Ends paragraph spacing. */ bool EndParagraphSpacing() { return EndStyle(); } /** Begins line spacing using the specified value. @e spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing. The ::wxTextAttrLineSpacing enumeration values are defined for convenience. */ bool BeginLineSpacing(int lineSpacing); /** Ends line spacing. */ bool EndLineSpacing() { return EndStyle(); } /** Begins numbered bullet. This call will be needed for each item in the list, and the application should take care of incrementing the numbering. @a bulletNumber is a number, usually starting with 1. @a leftIndent and @a leftSubIndent are values in tenths of a millimetre. @a bulletStyle is a bitlist of the following values: wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent. */ bool BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD); /** Ends numbered bullet. */ bool EndNumberedBullet() { return EndStyle(); } /** Begins applying a symbol bullet, using a character from the current font. See BeginNumberedBullet() for an explanation of how indentation is used to render the bulleted paragraph. */ bool BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL); /** Ends symbol bullet. */ bool EndSymbolBullet() { return EndStyle(); } /** Begins applying a standard bullet, using one of the standard bullet names (currently @c standard/circle or @c standard/square. See BeginNumberedBullet() for an explanation of how indentation is used to render the bulleted paragraph. */ bool BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD); /** Ends standard bullet. */ bool EndStandardBullet() { return EndStyle(); } /** Begins named character style. */ bool BeginCharacterStyle(const wxString& characterStyle); /** Ends named character style. */ bool EndCharacterStyle() { return EndStyle(); } /** Begins named paragraph style. */ bool BeginParagraphStyle(const wxString& paragraphStyle); /** Ends named character style. */ bool EndParagraphStyle() { return EndStyle(); } /** Begins named list style. Optionally, you can also pass a level and a number. */ bool BeginListStyle(const wxString& listStyle, int level = 1, int number = 1); /** Ends named character style. */ bool EndListStyle() { return EndStyle(); } /** Begins applying wxTEXT_ATTR_URL to the content. Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining. */ bool BeginURL(const wxString& url, const wxString& characterStyle = wxEmptyString); /** Ends URL. */ bool EndURL() { return EndStyle(); } // Event handling /** Adds an event handler. A buffer associated with a control has the control as the only event handler, but the application is free to add more if further notification is required. All handlers are notified of an event originating from the buffer, such as the replacement of a style sheet during loading. The buffer never deletes any of the event handlers, unless RemoveEventHandler() is called with @true as the second argument. */ bool AddEventHandler(wxEvtHandler* handler); /** Removes an event handler from the buffer's list of handlers, deleting the object if @a deleteHandler is @true. */ bool RemoveEventHandler(wxEvtHandler* handler, bool deleteHandler = false); /** Clear event handlers. */ void ClearEventHandlers(); /** Send event to event handlers. If sendToAll is true, will send to all event handlers, otherwise will stop at the first successful one. */ bool SendEvent(wxEvent& event, bool sendToAll = true); // Implementation virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0) wxOVERRIDE; /** Copies the buffer. */ void Copy(const wxRichTextBuffer& obj); /** Assignment operator. */ void operator= (const wxRichTextBuffer& obj) { Copy(obj); } /** Clones the buffer. */ virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextBuffer(*this); } /** Submits a command to insert paragraphs. */ bool InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert the given text. */ bool InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert a newline. */ bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int flags = 0); /** Submits a command to insert the given image. */ bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags = 0, const wxRichTextAttr& textAttr = wxRichTextAttr()); /** Submits a command to insert an object. */ wxRichTextObject* InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags); /** Submits a command to delete this range. */ bool DeleteRangeWithUndo(const wxRichTextRange& range, wxRichTextCtrl* ctrl); /** Mark modified. */ void Modify(bool modify = true) { m_modified = modify; } /** Returns @true if the buffer was modified. */ bool IsModified() const { return m_modified; } //@{ /** Dumps contents of buffer for debugging purposes. */ virtual void Dump(); virtual void Dump(wxTextOutputStream& stream) wxOVERRIDE { wxRichTextParagraphLayoutBox::Dump(stream); } //@} /** Returns the file handlers. */ static wxList& GetHandlers() { return sm_handlers; } /** Adds a file handler to the end. */ static void AddHandler(wxRichTextFileHandler *handler); /** Inserts a file handler at the front. */ static void InsertHandler(wxRichTextFileHandler *handler); /** Removes a file handler. */ static bool RemoveHandler(const wxString& name); /** Finds a file handler by name. */ static wxRichTextFileHandler *FindHandler(const wxString& name); /** Finds a file handler by extension and type. */ static wxRichTextFileHandler *FindHandler(const wxString& extension, wxRichTextFileType imageType); /** Finds a handler by filename or, if supplied, type. */ static wxRichTextFileHandler *FindHandlerFilenameOrType(const wxString& filename, wxRichTextFileType imageType); /** Finds a handler by type. */ static wxRichTextFileHandler *FindHandler(wxRichTextFileType imageType); /** Gets a wildcard incorporating all visible handlers. If @a types is present, it will be filled with the file type corresponding to each filter. This can be used to determine the type to pass to LoadFile given a selected filter. */ static wxString GetExtWildcard(bool combine = false, bool save = false, wxArrayInt* types = NULL); /** Clean up file handlers. */ static void CleanUpHandlers(); /** Initialise the standard file handlers. Currently, only the plain text loading/saving handler is initialised by default. */ static void InitStandardHandlers(); /** Returns the drawing handlers. */ static wxList& GetDrawingHandlers() { return sm_drawingHandlers; } /** Adds a drawing handler to the end. */ static void AddDrawingHandler(wxRichTextDrawingHandler *handler); /** Inserts a drawing handler at the front. */ static void InsertDrawingHandler(wxRichTextDrawingHandler *handler); /** Removes a drawing handler. */ static bool RemoveDrawingHandler(const wxString& name); /** Finds a drawing handler by name. */ static wxRichTextDrawingHandler *FindDrawingHandler(const wxString& name); /** Clean up drawing handlers. */ static void CleanUpDrawingHandlers(); /** Returns the field types. */ static wxRichTextFieldTypeHashMap& GetFieldTypes() { return sm_fieldTypes; } /** Adds a field type. @see RemoveFieldType(), FindFieldType(), wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard */ static void AddFieldType(wxRichTextFieldType *fieldType); /** Removes a field type by name. @see AddFieldType(), FindFieldType(), wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard */ static bool RemoveFieldType(const wxString& name); /** Finds a field type by name. @see RemoveFieldType(), AddFieldType(), wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard */ static wxRichTextFieldType *FindFieldType(const wxString& name); /** Cleans up field types. */ static void CleanUpFieldTypes(); /** Returns the renderer object. */ static wxRichTextRenderer* GetRenderer() { return sm_renderer; } /** Sets @a renderer as the object to be used to render certain aspects of the content, such as bullets. You can override default rendering by deriving a new class from wxRichTextRenderer or wxRichTextStdRenderer, overriding one or more virtual functions, and setting an instance of the class using this function. */ static void SetRenderer(wxRichTextRenderer* renderer); /** Returns the minimum margin between bullet and paragraph in 10ths of a mm. */ static int GetBulletRightMargin() { return sm_bulletRightMargin; } /** Sets the minimum margin between bullet and paragraph in 10ths of a mm. */ static void SetBulletRightMargin(int margin) { sm_bulletRightMargin = margin; } /** Returns the factor to multiply by character height to get a reasonable bullet size. */ static float GetBulletProportion() { return sm_bulletProportion; } /** Sets the factor to multiply by character height to get a reasonable bullet size. */ static void SetBulletProportion(float prop) { sm_bulletProportion = prop; } /** Returns the scale factor for calculating dimensions. */ double GetScale() const { return m_scale; } /** Sets the scale factor for calculating dimensions. */ void SetScale(double scale) { m_scale = scale; } /** Sets the floating layout mode. Pass @false to speed up editing by not performing floating layout. This setting affects all buffers. */ static void SetFloatingLayoutMode(bool mode) { sm_floatingLayoutMode = mode; } /** Returns the floating layout mode. The default is @true, where objects are laid out according to their floating status. */ static bool GetFloatingLayoutMode() { return sm_floatingLayoutMode; } protected: /// Command processor wxCommandProcessor* m_commandProcessor; /// Table storing fonts wxRichTextFontTable m_fontTable; /// Has been modified? bool m_modified; /// Collapsed command stack int m_batchedCommandDepth; /// Name for collapsed command wxString m_batchedCommandsName; /// Current collapsed command accumulating actions wxRichTextCommand* m_batchedCommand; /// Whether to suppress undo int m_suppressUndo; /// Style sheet, if any wxRichTextStyleSheet* m_styleSheet; /// List of event handlers that will be notified of events wxList m_eventHandlers; /// Stack of attributes for convenience functions wxList m_attributeStack; /// Flags to be passed to handlers int m_handlerFlags; /// File handlers static wxList sm_handlers; /// Drawing handlers static wxList sm_drawingHandlers; /// Field types static wxRichTextFieldTypeHashMap sm_fieldTypes; /// Renderer static wxRichTextRenderer* sm_renderer; /// Minimum margin between bullet and paragraph in 10ths of a mm static int sm_bulletRightMargin; /// Factor to multiply by character height to get a reasonable bullet size static float sm_bulletProportion; /// Floating layout mode, @true by default static bool sm_floatingLayoutMode; /// Scaling factor in use: needed to calculate correct dimensions when printing double m_scale; /// Font scale for adjusting the text size when editing double m_fontScale; /// Dimension scale for reducing redundant whitespace when editing double m_dimensionScale; }; /** @class wxRichTextCell wxRichTextCell is the cell in a table. */ class WXDLLIMPEXP_RICHTEXT wxRichTextCell: public wxRichTextBox { wxDECLARE_DYNAMIC_CLASS(wxRichTextCell); public: // Constructors /** Default constructor; optionally pass the parent object. */ wxRichTextCell(wxRichTextObject* parent = NULL); /** Copy constructor. */ wxRichTextCell(const wxRichTextCell& obj): wxRichTextBox() { Copy(obj); } // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0) wxOVERRIDE; virtual bool AdjustAttributes(wxRichTextAttr& attr, wxRichTextDrawingContext& context) wxOVERRIDE; virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("cell"); } virtual bool CanEditProperties() const wxOVERRIDE { return true; } virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer) wxOVERRIDE; virtual wxString GetPropertiesMenuLabel() const wxOVERRIDE { return wxGetTranslation("&Cell"); } /// Don't allow a cell to be deleted in Defragment virtual bool IsEmpty() const wxOVERRIDE { return false; } // Accessors /** Returns the column span. The default is 1. */ int GetColSpan() const; /** Sets the column span. */ void SetColSpan(int span); /** Returns the row span. The default is 1. */ int GetRowSpan() const; /** Sets the row span. */ void SetRowSpan(int span); // Operations virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextCell(*this); } void Copy(const wxRichTextCell& obj); protected: }; /** @class wxRichTextTable wxRichTextTable represents a table with arbitrary columns and rows. */ WX_DEFINE_ARRAY_PTR(wxRichTextObject*, wxRichTextObjectPtrArray); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxRichTextObjectPtrArray, wxRichTextObjectPtrArrayArray, WXDLLIMPEXP_RICHTEXT); class WXDLLIMPEXP_RICHTEXT wxRichTextTable: public wxRichTextBox { wxDECLARE_DYNAMIC_CLASS(wxRichTextTable); public: // Constructors /** Default constructor; optionally pass the parent object. */ wxRichTextTable(wxRichTextObject* parent = NULL); /** Copy constructor. */ wxRichTextTable(const wxRichTextTable& obj): wxRichTextBox() { Copy(obj); } // Overridables virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) wxOVERRIDE; virtual int HitTest(wxDC& dc, wxRichTextDrawingContext& context, const wxPoint& pt, long& textPosition, wxRichTextObject** obj, wxRichTextObject** contextObj, int flags = 0) wxOVERRIDE; virtual bool AdjustAttributes(wxRichTextAttr& attr, wxRichTextDrawingContext& context) wxOVERRIDE; virtual wxString GetXMLNodeName() const wxOVERRIDE { return wxT("table"); } virtual bool Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style) wxOVERRIDE; virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, wxRichTextDrawingContext& context, int flags, const wxPoint& position = wxPoint(0,0), const wxSize& parentSize = wxDefaultSize, wxArrayInt* partialExtents = NULL) const wxOVERRIDE; virtual bool DeleteRange(const wxRichTextRange& range) wxOVERRIDE; virtual wxString GetTextForRange(const wxRichTextRange& range) const wxOVERRIDE; #if wxUSE_XML virtual bool ImportFromXML(wxRichTextBuffer* buffer, wxXmlNode* node, wxRichTextXMLHandler* handler, bool* recurse) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_DIRECT_OUTPUT virtual bool ExportXML(wxOutputStream& stream, int indent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT virtual bool ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler) wxOVERRIDE; #endif virtual bool FindPosition(wxDC& dc, wxRichTextDrawingContext& context, long index, wxPoint& pt, int* height, bool forceLineStart) wxOVERRIDE; virtual void CalculateRange(long start, long& end) wxOVERRIDE; // Can this object handle the selections of its children? FOr example, a table. virtual bool HandlesChildSelections() const wxOVERRIDE { return true; } /// Returns a selection object specifying the selections between start and end character positions. /// For example, a table would deduce what cells (of range length 1) are selected when dragging across the table. virtual wxRichTextSelection GetSelection(long start, long end) const wxOVERRIDE; virtual bool CanEditProperties() const wxOVERRIDE { return true; } virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer) wxOVERRIDE; virtual wxString GetPropertiesMenuLabel() const wxOVERRIDE { return wxGetTranslation("&Table"); } // Returns true if objects of this class can accept the focus, i.e. a call to SetFocusObject // is possible. For example, containers supporting text, such as a text box object, can accept the focus, // but a table can't (set the focus to individual cells instead). virtual bool AcceptsFocus() const wxOVERRIDE { return false; } // Accessors /** Returns the cells array. */ const wxRichTextObjectPtrArrayArray& GetCells() const { return m_cells; } /** Returns the cells array. */ wxRichTextObjectPtrArrayArray& GetCells() { return m_cells; } /** Returns the row count. */ int GetRowCount() const { return m_rowCount; } /** Sets the row count. */ void SetRowCount(int count) { m_rowCount = count; } /** Returns the column count. */ int GetColumnCount() const { return m_colCount; } /** Sets the column count. */ void SetColumnCount(int count) { m_colCount = count; } /** Returns the cell at the given row/column position. */ virtual wxRichTextCell* GetCell(int row, int col) const; /** Returns the cell at the given character position (in the range of the table). */ virtual wxRichTextCell* GetCell(long pos) const; /** Returns the row/column for a given character position. */ virtual bool GetCellRowColumnPosition(long pos, int& row, int& col) const; /** Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none. */ virtual wxPosition GetFocusedCell() const; // Operations /** Clears the table. */ virtual void ClearTable(); /** Creates a table of the given dimensions. */ virtual bool CreateTable(int rows, int cols); /** Sets the attributes for the cells specified by the selection. */ virtual bool SetCellStyle(const wxRichTextSelection& selection, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); /** Deletes rows from the given row position. */ virtual bool DeleteRows(int startRow, int noRows = 1); /** Deletes columns from the given column position. */ virtual bool DeleteColumns(int startCol, int noCols = 1); /** Adds rows from the given row position. */ virtual bool AddRows(int startRow, int noRows = 1, const wxRichTextAttr& attr = wxRichTextAttr()); /** Adds columns from the given column position. */ virtual bool AddColumns(int startCol, int noCols = 1, const wxRichTextAttr& attr = wxRichTextAttr()); // Makes a clone of this object. virtual wxRichTextObject* Clone() const wxOVERRIDE { return new wxRichTextTable(*this); } // Copies this object. void Copy(const wxRichTextTable& obj); protected: int m_rowCount; int m_colCount; // An array of rows, each of which is a wxRichTextObjectPtrArray containing // the cell objects. The cell objects are also children of this object. // Problem: if boxes are immediate children of a box, this will cause problems // with wxRichTextParagraphLayoutBox functions (and functions elsewhere) that // expect to find just paragraphs. May have to adjust the way we handle the // hierarchy to accept non-paragraph objects in a paragraph layout box. // We'll be overriding much wxRichTextParagraphLayoutBox functionality so this // may not be such a problem. Perhaps the table should derive from a different // class? wxRichTextObjectPtrArrayArray m_cells; }; /** @class wxRichTextTableBlock Stores the coordinates for a block of cells. */ class WXDLLIMPEXP_RICHTEXT wxRichTextTableBlock { public: wxRichTextTableBlock() { Init(); } wxRichTextTableBlock(int colStart, int colEnd, int rowStart, int rowEnd) { Init(); m_colStart = colStart; m_colEnd = colEnd; m_rowStart = rowStart; m_rowEnd = rowEnd; } wxRichTextTableBlock(const wxRichTextTableBlock& block) { Copy(block); } void Init() { m_colStart = 0; m_colEnd = 0; m_rowStart = 0; m_rowEnd = 0; } void Copy(const wxRichTextTableBlock& block) { m_colStart = block.m_colStart; m_colEnd = block.m_colEnd; m_rowStart = block.m_rowStart; m_rowEnd = block.m_rowEnd; } void operator=(const wxRichTextTableBlock& block) { Copy(block); } bool operator==(const wxRichTextTableBlock& block) { return m_colStart == block.m_colStart && m_colEnd == block.m_colEnd && m_rowStart == block.m_rowStart && m_rowEnd == block.m_rowEnd; } /// Computes the block given a table (perhaps about to be edited) and a rich text control /// that may have a selection. If no selection, the whole table is used. If just the whole content /// of one cell is selected, this cell only is used. If the cell contents is not selected and /// requireCellSelection is @false, the focused cell will count as a selected cell. bool ComputeBlockForSelection(wxRichTextTable* table, wxRichTextCtrl* ctrl, bool requireCellSelection = true); /// Does this block represent the whole table? bool IsWholeTable(wxRichTextTable* table) const; /// Returns the cell focused in the table, if any static wxRichTextCell* GetFocusedCell(wxRichTextCtrl* ctrl); int& ColStart() { return m_colStart; } int ColStart() const { return m_colStart; } int& ColEnd() { return m_colEnd; } int ColEnd() const { return m_colEnd; } int& RowStart() { return m_rowStart; } int RowStart() const { return m_rowStart; } int& RowEnd() { return m_rowEnd; } int RowEnd() const { return m_rowEnd; } int m_colStart, m_colEnd, m_rowStart, m_rowEnd; }; /** The command identifiers for Do/Undo. */ enum wxRichTextCommandId { wxRICHTEXT_INSERT, wxRICHTEXT_DELETE, wxRICHTEXT_CHANGE_ATTRIBUTES, wxRICHTEXT_CHANGE_STYLE, wxRICHTEXT_CHANGE_PROPERTIES, wxRICHTEXT_CHANGE_OBJECT }; /** @class wxRichTextObjectAddress A class for specifying an object anywhere in an object hierarchy, without using a pointer, necessary since wxRTC commands may delete and recreate sub-objects so physical object addresses change. An array of positions (one per hierarchy level) is used. @library{wxrichtext} @category{richtext} @see wxRichTextCommand */ class WXDLLIMPEXP_RICHTEXT wxRichTextObjectAddress { public: /** Creates the address given a container and an object. */ wxRichTextObjectAddress(wxRichTextParagraphLayoutBox* topLevelContainer, wxRichTextObject* obj) { Create(topLevelContainer, obj); } /** */ wxRichTextObjectAddress() { Init(); } /** */ wxRichTextObjectAddress(const wxRichTextObjectAddress& address) { Copy(address); } void Init() {} /** Copies the address. */ void Copy(const wxRichTextObjectAddress& address) { m_address = address.m_address; } /** Assignment operator. */ void operator=(const wxRichTextObjectAddress& address) { Copy(address); } /** Returns the object specified by the address, given a top level container. */ wxRichTextObject* GetObject(wxRichTextParagraphLayoutBox* topLevelContainer) const; /** Creates the address given a container and an object. */ bool Create(wxRichTextParagraphLayoutBox* topLevelContainer, wxRichTextObject* obj); /** Returns the array of integers representing the object address. */ wxArrayInt& GetAddress() { return m_address; } /** Returns the array of integers representing the object address. */ const wxArrayInt& GetAddress() const { return m_address; } /** Sets the address from an array of integers. */ void SetAddress(const wxArrayInt& address) { m_address = address; } protected: wxArrayInt m_address; }; class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAction; /** @class wxRichTextCommand Implements a command on the undo/redo stack. A wxRichTextCommand object contains one or more wxRichTextAction objects, allowing aggregation of a number of operations into one command. @library{wxrichtext} @category{richtext} @see wxRichTextAction */ class WXDLLIMPEXP_RICHTEXT wxRichTextCommand: public wxCommand { public: /** Constructor for one action. */ wxRichTextCommand(const wxString& name, wxRichTextCommandId id, wxRichTextBuffer* buffer, wxRichTextParagraphLayoutBox* container, wxRichTextCtrl* ctrl, bool ignoreFirstTime = false); /** Constructor for multiple actions. */ wxRichTextCommand(const wxString& name); virtual ~wxRichTextCommand(); /** Performs the command. */ bool Do() wxOVERRIDE; /** Undoes the command. */ bool Undo() wxOVERRIDE; /** Adds an action to the action list. */ void AddAction(wxRichTextAction* action); /** Clears the action list. */ void ClearActions(); /** Returns the action list. */ wxList& GetActions() { return m_actions; } /** Indicate whether the control should be frozen when performing Do/Undo */ bool GetFreeze() const { return m_freeze; } void SetFreeze(bool freeze) { m_freeze = freeze; } protected: wxList m_actions; bool m_freeze; }; /** @class wxRichTextAction Implements a part of a command. @library{wxrichtext} @category{richtext} @see wxRichTextCommand */ class WXDLLIMPEXP_RICHTEXT wxRichTextAction: public wxObject { public: /** Constructor. @a buffer is the top-level buffer, while @a container is the object within which the action is taking place. In the simplest case, they are the same. */ wxRichTextAction(wxRichTextCommand* cmd, const wxString& name, wxRichTextCommandId id, wxRichTextBuffer* buffer, wxRichTextParagraphLayoutBox* container, wxRichTextCtrl* ctrl, bool ignoreFirstTime = false); virtual ~wxRichTextAction(); /** Performs the action. */ bool Do(); /** Undoes the action. */ bool Undo(); /** Updates the control appearance, optimizing if possible given information from the call to Layout. */ void UpdateAppearance(long caretPosition, bool sendUpdateEvent = false, const wxRect& oldFloatRect = wxRect(), wxArrayInt* optimizationLineCharPositions = NULL, wxArrayInt* optimizationLineYPositions = NULL, bool isDoCmd = true); /** Replaces the buffer paragraphs with the given fragment. */ void ApplyParagraphs(const wxRichTextParagraphLayoutBox& fragment); /** Returns the new fragments. */ wxRichTextParagraphLayoutBox& GetNewParagraphs() { return m_newParagraphs; } /** Returns the old fragments. */ wxRichTextParagraphLayoutBox& GetOldParagraphs() { return m_oldParagraphs; } /** Returns the attributes, for single-object commands. */ wxRichTextAttr& GetAttributes() { return m_attributes; } /** Returns the object to replace the one at the position defined by the container address and the action's range start position. */ wxRichTextObject* GetObject() const { return m_object; } /** Returns the associated rich text control. */ wxRichTextCtrl* GetRichTextCtrl() const { return m_ctrl; } /** Stores the object to replace the one at the position defined by the container address without making an address for it (cf SetObject() and MakeObject()). */ void StoreObject(wxRichTextObject* obj) { m_object = obj; } /** Sets the object to replace the one at the position defined by the container address and the action's range start position. */ void SetObject(wxRichTextObject* obj) { m_object = obj; m_objectAddress.Create(m_buffer, m_object); } /** Makes an address from the given object. */ void MakeObject(wxRichTextObject* obj) { m_objectAddress.Create(m_buffer, obj); } /** Sets the existing and new objects, for use with wxRICHTEXT_CHANGE_OBJECT. */ void SetOldAndNewObjects(wxRichTextObject* oldObj, wxRichTextObject* newObj) { SetObject(oldObj); StoreObject(newObj); } /** Calculate arrays for refresh optimization. */ void CalculateRefreshOptimizations(wxArrayInt& optimizationLineCharPositions, wxArrayInt& optimizationLineYPositions, wxRect& oldFloatRect); /** Sets the position used for e.g. insertion. */ void SetPosition(long pos) { m_position = pos; } /** Returns the position used for e.g. insertion. */ long GetPosition() const { return m_position; } /** Sets the range for e.g. deletion. */ void SetRange(const wxRichTextRange& range) { m_range = range; } /** Returns the range for e.g. deletion. */ const wxRichTextRange& GetRange() const { return m_range; } /** Returns the address (nested position) of the container within the buffer being manipulated. */ wxRichTextObjectAddress& GetContainerAddress() { return m_containerAddress; } /** Returns the address (nested position) of the container within the buffer being manipulated. */ const wxRichTextObjectAddress& GetContainerAddress() const { return m_containerAddress; } /** Sets the address (nested position) of the container within the buffer being manipulated. */ void SetContainerAddress(const wxRichTextObjectAddress& address) { m_containerAddress = address; } /** Sets the address (nested position) of the container within the buffer being manipulated. */ void SetContainerAddress(wxRichTextParagraphLayoutBox* container, wxRichTextObject* obj) { m_containerAddress.Create(container, obj); } /** Returns the container that this action refers to, using the container address and top-level buffer. */ wxRichTextParagraphLayoutBox* GetContainer() const; /** Returns the action name. */ const wxString& GetName() const { return m_name; } /** Instructs the first Do() command should be skipped as it's already been applied. */ void SetIgnoreFirstTime(bool b) { m_ignoreThis = b; } /** Returns true if the first Do() command should be skipped as it's already been applied. */ bool GetIgnoreFirstTime() const { return m_ignoreThis; } protected: // Action name wxString m_name; // Buffer wxRichTextBuffer* m_buffer; // The address (nested position) of the container being manipulated. // This is necessary because objects are deleted, and we can't // therefore store actual pointers. wxRichTextObjectAddress m_containerAddress; // Control wxRichTextCtrl* m_ctrl; // Stores the new paragraphs wxRichTextParagraphLayoutBox m_newParagraphs; // Stores the old paragraphs wxRichTextParagraphLayoutBox m_oldParagraphs; // Stores an object to replace the one at the position // defined by the container address and the action's range start position. wxRichTextObject* m_object; // Stores the attributes wxRichTextAttr m_attributes; // The address of the object being manipulated (used for changing an individual object or its attributes) wxRichTextObjectAddress m_objectAddress; // Stores the old attributes // wxRichTextAttr m_oldAttributes; // The affected range wxRichTextRange m_range; // The insertion point for this command long m_position; // Ignore 1st 'Do' operation because we already did it bool m_ignoreThis; // The command identifier wxRichTextCommandId m_cmdId; }; /*! * Handler flags */ // Include style sheet when loading and saving #define wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET 0x0001 // Save images to memory file system in HTML handler #define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY 0x0010 // Save images to files in HTML handler #define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES 0x0020 // Save images as inline base64 data in HTML handler #define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 0x0040 // Don't write header and footer (or BODY), so we can include the fragment // in a larger document #define wxRICHTEXT_HANDLER_NO_HEADER_FOOTER 0x0080 // Convert the more common face names to names that will work on the current platform // in a larger document #define wxRICHTEXT_HANDLER_CONVERT_FACENAMES 0x0100 /** @class wxRichTextFileHandler The base class for file handlers. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextFileHandler: public wxObject { wxDECLARE_CLASS(wxRichTextFileHandler); public: /** Creates a file handler object. */ wxRichTextFileHandler(const wxString& name = wxEmptyString, const wxString& ext = wxEmptyString, int type = 0) : m_name(name), m_extension(ext), m_type(type), m_flags(0), m_visible(true) { } #if wxUSE_STREAMS /** Loads the buffer from a stream. Not all handlers will implement file loading. */ bool LoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) { return DoLoadFile(buffer, stream); } /** Saves the buffer to a stream. Not all handlers will implement file saving. */ bool SaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) { return DoSaveFile(buffer, stream); } #endif #if wxUSE_FFILE && wxUSE_STREAMS /** Loads the buffer from a file. */ virtual bool LoadFile(wxRichTextBuffer *buffer, const wxString& filename); /** Saves the buffer to a file. */ virtual bool SaveFile(wxRichTextBuffer *buffer, const wxString& filename); #endif // wxUSE_STREAMS && wxUSE_STREAMS /** Returns @true if we handle this filename (if using files). By default, checks the extension. */ virtual bool CanHandle(const wxString& filename) const; /** Returns @true if we can save using this handler. */ virtual bool CanSave() const { return false; } /** Returns @true if we can load using this handler. */ virtual bool CanLoad() const { return false; } /** Returns @true if this handler should be visible to the user. */ virtual bool IsVisible() const { return m_visible; } /** Sets whether the handler should be visible to the user (via the application's load and save dialogs). */ virtual void SetVisible(bool visible) { m_visible = visible; } /** Sets the name of the handler. */ void SetName(const wxString& name) { m_name = name; } /** Returns the name of the handler. */ wxString GetName() const { return m_name; } /** Sets the default extension to recognise. */ void SetExtension(const wxString& ext) { m_extension = ext; } /** Returns the default extension to recognise. */ wxString GetExtension() const { return m_extension; } /** Sets the handler type. */ void SetType(int type) { m_type = type; } /** Returns the handler type. */ int GetType() const { return m_type; } /** Sets flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler. You call this function directly if you are using a file handler explicitly (without going through the text control or buffer LoadFile/SaveFile API). Or, you can call the control or buffer's SetHandlerFlags function to set the flags that will be used for subsequent load and save operations. */ void SetFlags(int flags) { m_flags = flags; } /** Returns flags controlling how loading and saving is done. */ int GetFlags() const { return m_flags; } /** Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen. */ void SetEncoding(const wxString& encoding) { m_encoding = encoding; } /** Returns the encoding to use when saving a file. If empty, a suitable encoding is chosen. */ const wxString& GetEncoding() const { return m_encoding; } protected: #if wxUSE_STREAMS /** Override to load content from @a stream into @a buffer. */ virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) = 0; /** Override to save content to @a stream from @a buffer. */ virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) = 0; #endif wxString m_name; wxString m_encoding; wxString m_extension; int m_type; int m_flags; bool m_visible; }; /** @class wxRichTextPlainTextHandler Implements saving a buffer to plain text. @library{wxrichtext} @category{richtext} @see wxRichTextFileHandler, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextPlainTextHandler: public wxRichTextFileHandler { wxDECLARE_CLASS(wxRichTextPlainTextHandler); public: wxRichTextPlainTextHandler(const wxString& name = wxT("Text"), const wxString& ext = wxT("txt"), wxRichTextFileType type = wxRICHTEXT_TYPE_TEXT) : wxRichTextFileHandler(name, ext, type) { } // Can we save using this handler? virtual bool CanSave() const wxOVERRIDE { return true; } // Can we load using this handler? virtual bool CanLoad() const wxOVERRIDE { return true; } protected: #if wxUSE_STREAMS virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) wxOVERRIDE; virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) wxOVERRIDE; #endif }; /** @class wxRichTextDrawingHandler The base class for custom drawing handlers. Currently, drawing handlers can provide virtual attributes. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextDrawingHandler: public wxObject { wxDECLARE_CLASS(wxRichTextDrawingHandler); public: /** Creates a drawing handler object. */ wxRichTextDrawingHandler(const wxString& name = wxEmptyString) : m_name(name) { } /** Returns @true if this object has virtual attributes that we can provide. */ virtual bool HasVirtualAttributes(wxRichTextObject* obj) const = 0; /** Provides virtual attributes that we can provide. */ virtual bool GetVirtualAttributes(wxRichTextAttr& attr, wxRichTextObject* obj) const = 0; /** Gets the count for mixed virtual attributes for individual positions within the object. For example, individual characters within a text object may require special highlighting. */ virtual int GetVirtualSubobjectAttributesCount(wxRichTextObject* obj) const = 0; /** Gets the mixed virtual attributes for individual positions within the object. For example, individual characters within a text object may require special highlighting. Returns the number of virtual attributes found. */ virtual int GetVirtualSubobjectAttributes(wxRichTextObject* obj, wxArrayInt& positions, wxRichTextAttrArray& attributes) const = 0; /** Do we have virtual text for this object? Virtual text allows an application to replace characters in an object for editing and display purposes, for example for highlighting special characters. */ virtual bool HasVirtualText(const wxRichTextPlainText* obj) const = 0; /** Gets the virtual text for this object. */ virtual bool GetVirtualText(const wxRichTextPlainText* obj, wxString& text) const = 0; /** Sets the name of the handler. */ void SetName(const wxString& name) { m_name = name; } /** Returns the name of the handler. */ wxString GetName() const { return m_name; } protected: wxString m_name; }; #if wxUSE_DATAOBJ /** @class wxRichTextBufferDataObject Implements a rich text data object for clipboard transfer. @library{wxrichtext} @category{richtext} @see wxDataObjectSimple, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextBufferDataObject: public wxDataObjectSimple { public: /** The constructor doesn't copy the pointer, so it shouldn't go away while this object is alive. */ wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = NULL); virtual ~wxRichTextBufferDataObject(); /** After a call to this function, the buffer is owned by the caller and it is responsible for deleting it. */ wxRichTextBuffer* GetRichTextBuffer(); /** Returns the id for the new data format. */ static const wxChar* GetRichTextBufferFormatId() { return ms_richTextBufferFormatId; } // base class pure virtuals virtual wxDataFormat GetPreferredFormat(Direction dir) const wxOVERRIDE; virtual size_t GetDataSize() const wxOVERRIDE; virtual bool GetDataHere(void *pBuf) const wxOVERRIDE; virtual bool SetData(size_t len, const void *buf) wxOVERRIDE; // prevent warnings virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat&, void *buf) const wxOVERRIDE { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) wxOVERRIDE { return SetData(len, buf); } protected: wxDataFormat m_formatRichTextBuffer; // our custom format wxRichTextBuffer* m_richTextBuffer; // our data static const wxChar* ms_richTextBufferFormatId; // our format id }; #endif /** @class wxRichTextRenderer This class isolates some common drawing functionality. @library{wxrichtext} @category{richtext} @see wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer: public wxObject { public: /** Constructor. */ wxRichTextRenderer() {} virtual ~wxRichTextRenderer() {} /** Draws a standard bullet, as specified by the value of GetBulletName. This function should be overridden. */ virtual bool DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect) = 0; /** Draws a bullet that can be described by text, such as numbered or symbol bullets. This function should be overridden. */ virtual bool DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect, const wxString& text) = 0; /** Draws a bitmap bullet, where the bullet bitmap is specified by the value of GetBulletName. This function should be overridden. */ virtual bool DrawBitmapBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect) = 0; /** Enumerate the standard bullet names currently supported. This function should be overridden. */ virtual bool EnumerateStandardBulletNames(wxArrayString& bulletNames) = 0; /** Measure the bullet. */ virtual bool MeasureBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, wxSize& sz) = 0; }; /** @class wxRichTextStdRenderer The standard renderer for drawing bullets. @library{wxrichtext} @category{richtext} @see wxRichTextRenderer, wxRichTextBuffer, wxRichTextCtrl */ class WXDLLIMPEXP_RICHTEXT wxRichTextStdRenderer: public wxRichTextRenderer { public: /** Constructor. */ wxRichTextStdRenderer() {} // Draw a standard bullet, as specified by the value of GetBulletName virtual bool DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect) wxOVERRIDE; // Draw a bullet that can be described by text, such as numbered or symbol bullets virtual bool DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect, const wxString& text) wxOVERRIDE; // Draw a bitmap bullet, where the bullet bitmap is specified by the value of GetBulletName virtual bool DrawBitmapBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, const wxRect& rect) wxOVERRIDE; // Enumerate the standard bullet names currently supported virtual bool EnumerateStandardBulletNames(wxArrayString& bulletNames) wxOVERRIDE; // Measure the bullet. virtual bool MeasureBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& attr, wxSize& sz) wxOVERRIDE; // Set a font which may depend on text effects. static void SetFontForBullet(wxRichTextBuffer& buffer, wxDC& dc, const wxRichTextAttr& attr); }; /*! * Utilities * */ inline bool wxRichTextHasStyle(int flags, int style) { return ((flags & style) == style); } /// Compare two attribute objects WXDLLIMPEXP_RICHTEXT bool wxTextAttrEq(const wxRichTextAttr& attr1, const wxRichTextAttr& attr2); WXDLLIMPEXP_RICHTEXT bool wxTextAttrEq(const wxRichTextAttr& attr1, const wxRichTextAttr& attr2); /// Apply one style to another WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL); // Remove attributes WXDLLIMPEXP_RICHTEXT bool wxRichTextRemoveStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style); /// Combine two bitlists WXDLLIMPEXP_RICHTEXT bool wxRichTextCombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB); /// Compare two bitlists WXDLLIMPEXP_RICHTEXT bool wxRichTextBitlistsEqPartial(int valueA, int valueB, int flags); /// Split into paragraph and character styles WXDLLIMPEXP_RICHTEXT bool wxRichTextSplitParaCharStyles(const wxRichTextAttr& style, wxRichTextAttr& parStyle, wxRichTextAttr& charStyle); /// Compare tabs WXDLLIMPEXP_RICHTEXT bool wxRichTextTabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2); /// Convert a decimal to Roman numerals WXDLLIMPEXP_RICHTEXT wxString wxRichTextDecimalToRoman(long n); // Collects the attributes that are common to a range of content, building up a note of // which attributes are absent in some objects and which clash in some objects. WXDLLIMPEXP_RICHTEXT void wxTextAttrCollectCommonAttributes(wxTextAttr& currentStyle, const wxTextAttr& attr, wxTextAttr& clashingAttr, wxTextAttr& absentAttr); WXDLLIMPEXP_RICHTEXT void wxRichTextModuleInit(); #endif // wxUSE_RICHTEXT #endif // _WX_RICHTEXTBUFFER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextindentspage.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextindentspage.h // Purpose: Declares the rich text formatting dialog indent page. // Author: Julian Smart // Modified by: // Created: 10/3/2006 2:28:21 PM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTINDENTSPAGE_H_ #define _RICHTEXTINDENTSPAGE_H_ /*! * Includes */ #include "wx/richtext/richtextdialogpage.h" ////@begin includes #include "wx/statline.h" ////@end includes /*! * Forward declarations */ ////@begin forward declarations class wxRichTextCtrl; ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_TITLE wxEmptyString #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_IDNAME ID_RICHTEXTINDENTSSPACINGPAGE #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION wxDefaultPosition ////@end control identifiers /*! * wxRichTextIndentsSpacingPage class declaration */ class WXDLLIMPEXP_RICHTEXT wxRichTextIndentsSpacingPage: public wxRichTextDialogPage { wxDECLARE_DYNAMIC_CLASS(wxRichTextIndentsSpacingPage); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxRichTextIndentsSpacingPage( ); wxRichTextIndentsSpacingPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE, long style = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE, long style = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE ); /// Initialise members void Init(); /// Creates the controls and sizers void CreateControls(); /// Transfer data from/to window virtual bool TransferDataFromWindow() wxOVERRIDE; virtual bool TransferDataToWindow() wxOVERRIDE; /// Updates the paragraph preview void UpdatePreview(); /// Gets the attributes associated with the main formatting dialog wxRichTextAttr* GetAttributes(); ////@begin wxRichTextIndentsSpacingPage event handler declarations /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT void OnAlignmentLeftSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT void OnAlignmentRightSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED void OnAlignmentJustifiedSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED void OnAlignmentCentredSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE void OnAlignmentIndeterminateSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT void OnIndentLeftUpdated( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST void OnIndentLeftFirstUpdated( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT void OnIndentRightUpdated( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL void OnRichtextOutlinelevelSelected( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE void OnSpacingBeforeUpdated( wxCommandEvent& event ); /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER void OnSpacingAfterUpdated( wxCommandEvent& event ); /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE void OnSpacingLineSelected( wxCommandEvent& event ); ////@end wxRichTextIndentsSpacingPage event handler declarations ////@begin wxRichTextIndentsSpacingPage member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxRichTextIndentsSpacingPage member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin wxRichTextIndentsSpacingPage member variables wxRadioButton* m_alignmentLeft; wxRadioButton* m_alignmentRight; wxRadioButton* m_alignmentJustified; wxRadioButton* m_alignmentCentred; wxRadioButton* m_alignmentIndeterminate; wxTextCtrl* m_indentLeft; wxTextCtrl* m_indentLeftFirst; wxTextCtrl* m_indentRight; wxComboBox* m_outlineLevelCtrl; wxTextCtrl* m_spacingBefore; wxTextCtrl* m_spacingAfter; wxComboBox* m_spacingLine; wxCheckBox* m_pageBreakCtrl; wxRichTextCtrl* m_previewCtrl; /// Control identifiers enum { ID_RICHTEXTINDENTSSPACINGPAGE = 10100, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT = 10102, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT = 10110, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED = 10111, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED = 10112, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE = 10101, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT = 10103, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST = 10104, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT = 10113, ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL = 10105, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE = 10114, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER = 10116, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE = 10115, ID_RICHTEXTINDENTSSPACINGPAGE_PAGEBREAK = 10106, ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL = 10109 }; ////@end wxRichTextIndentsSpacingPage member variables bool m_dontUpdate; }; #endif // _RICHTEXTINDENTSPAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextuicustomization.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextuicustomization.h // Purpose: UI customization base class for wxRTC // Author: Julian Smart // Modified by: // Created: 2010-11-14 // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTUICUSTOMIZATION_H_ #define _WX_RICHTEXTUICUSTOMIZATION_H_ #if wxUSE_RICHTEXT #include "wx/window.h" /** @class wxRichTextUICustomization The base class for functionality to plug in to various rich text control dialogs, currently allowing the application to respond to Help button clicks without the need to derive new dialog classes. The application will typically have calls like this in its initialisation: wxRichTextFormattingDialog::GetHelpInfo().SetHelpId(ID_HELP_FORMATTINGDIALOG); wxRichTextFormattingDialog::GetHelpInfo().SetUICustomization(& wxGetApp().GetRichTextUICustomization()); wxRichTextBordersPage::GetHelpInfo().SetHelpId(ID_HELP_BORDERSPAGE); Only the wxRichTextFormattingDialog class needs to have its customization object and help id set, though the application set them for individual pages if it wants. **/ class WXDLLIMPEXP_RICHTEXT wxRichTextUICustomization { public: wxRichTextUICustomization() {} virtual ~wxRichTextUICustomization() {} /// Show the help given the current active window, and a help topic id. virtual bool ShowHelp(wxWindow* win, long id) = 0; }; /** @class wxRichTextHelpInfo This class is used as a static member of dialogs, to store the help topic for the dialog and also the customization object that will allow help to be shown appropriately for the application. **/ class WXDLLIMPEXP_RICHTEXT wxRichTextHelpInfo { public: wxRichTextHelpInfo() { m_helpTopic = -1; m_uiCustomization = NULL; } virtual ~wxRichTextHelpInfo() {} virtual bool ShowHelp(wxWindow* win) { if ( !m_uiCustomization || m_helpTopic == -1 ) return false; return m_uiCustomization->ShowHelp(win, m_helpTopic); } /// Get the help topic identifier. long GetHelpId() const { return m_helpTopic; } /// Set the help topic identifier. void SetHelpId(long id) { m_helpTopic = id; } /// Get the UI customization object. wxRichTextUICustomization* GetUICustomization() const { return m_uiCustomization; } /// Set the UI customization object. void SetUICustomization(wxRichTextUICustomization* customization) { m_uiCustomization = customization; } /// Is there a valid help topic id? bool HasHelpId() const { return m_helpTopic != -1; } /// Is there a valid customization object? bool HasUICustomization() const { return m_uiCustomization != NULL; } protected: wxRichTextUICustomization* m_uiCustomization; long m_helpTopic; }; /// Add this to the base class of dialogs #define DECLARE_BASE_CLASS_HELP_PROVISION() \ virtual long GetHelpId() const = 0; \ virtual wxRichTextUICustomization* GetUICustomization() const = 0; \ virtual bool ShowHelp(wxWindow* win) = 0; /// A macro to make it easy to add help topic provision and UI customization /// to a class. Optionally, add virtual functions to a base class /// using DECLARE_BASE_CLASS_HELP_PROVISION. This means that the formatting dialog /// can obtain help topics from its individual pages without needing /// to know in advance what page classes are being used, allowing for extension /// of the formatting dialog. #define DECLARE_HELP_PROVISION() \ wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) \ virtual long GetHelpId() const { return sm_helpInfo.GetHelpId(); } \ virtual void SetHelpId(long id) { sm_helpInfo.SetHelpId(id); } \ virtual wxRichTextUICustomization* GetUICustomization() const { return sm_helpInfo.GetUICustomization(); } \ virtual void SetUICustomization(wxRichTextUICustomization* customization) { sm_helpInfo.SetUICustomization(customization); } \ virtual bool ShowHelp(wxWindow* win) { return sm_helpInfo.ShowHelp(win); } \ wxCLANG_WARNING_RESTORE(inconsistent-missing-override) \ public: \ static wxRichTextHelpInfo& GetHelpInfo() { return sm_helpInfo; }\ protected: \ static wxRichTextHelpInfo sm_helpInfo; \ public: /// Add this to the implementation file for each dialog that needs help provision. #define IMPLEMENT_HELP_PROVISION(theClass) \ wxRichTextHelpInfo theClass::sm_helpInfo; #endif // wxUSE_RICHTEXT #endif // _WX_RICHTEXTUICUSTOMIZATION_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextsymboldlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextsymboldlg.h // Purpose: Declares the symbol picker dialog. // Author: Julian Smart // Modified by: // Created: 10/5/2006 3:11:58 PM // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _RICHTEXTSYMBOLDLG_H_ #define _RICHTEXTSYMBOLDLG_H_ /*! * Includes */ #include "wx/richtext/richtextuicustomization.h" #include "wx/dialog.h" #include "wx/vscroll.h" /*! * Forward declarations */ class WXDLLIMPEXP_FWD_CORE wxStaticText; class WXDLLIMPEXP_FWD_CORE wxComboBox; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; ////@begin forward declarations class wxSymbolListCtrl; class wxStdDialogButtonSizer; ////@end forward declarations // __UNICODE__ is a symbol used by DialogBlocks-generated code. #ifndef __UNICODE__ #if wxUSE_UNICODE #define __UNICODE__ #endif #endif /*! * Symbols */ #define SYMBOL_WXSYMBOLPICKERDIALOG_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLOSE_BOX) #define SYMBOL_WXSYMBOLPICKERDIALOG_TITLE wxGetTranslation("Symbols") #define SYMBOL_WXSYMBOLPICKERDIALOG_IDNAME ID_SYMBOLPICKERDIALOG #define SYMBOL_WXSYMBOLPICKERDIALOG_SIZE wxSize(400, 300) #define SYMBOL_WXSYMBOLPICKERDIALOG_POSITION wxDefaultPosition /*! * wxSymbolPickerDialog class declaration */ class WXDLLIMPEXP_RICHTEXT wxSymbolPickerDialog: public wxDialog { wxDECLARE_DYNAMIC_CLASS(wxSymbolPickerDialog); wxDECLARE_EVENT_TABLE(); DECLARE_HELP_PROVISION() public: /// Constructors wxSymbolPickerDialog( ); wxSymbolPickerDialog( const wxString& symbol, const wxString& fontName, const wxString& normalTextFont, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXSYMBOLPICKERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXSYMBOLPICKERDIALOG_POSITION, const wxSize& size = SYMBOL_WXSYMBOLPICKERDIALOG_SIZE, long style = SYMBOL_WXSYMBOLPICKERDIALOG_STYLE ); /// Creation bool Create( const wxString& symbol, const wxString& fontName, const wxString& normalTextFont, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXSYMBOLPICKERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXSYMBOLPICKERDIALOG_POSITION, const wxSize& size = SYMBOL_WXSYMBOLPICKERDIALOG_SIZE, long style = SYMBOL_WXSYMBOLPICKERDIALOG_STYLE ); /// Initialises members variables void Init(); /// Creates the controls and sizers void CreateControls(); /// Update the display void UpdateSymbolDisplay(bool updateSymbolList = true, bool showAtSubset = true); /// Respond to symbol selection void OnSymbolSelected( wxCommandEvent& event ); /// Set Unicode mode void SetUnicodeMode(bool unicodeMode); /// Show at the current subset selection void ShowAtSubset(); /// Get the selected symbol character int GetSymbolChar() const; /// Is there a selection? bool HasSelection() const { return !m_symbol.IsEmpty(); } /// Specifying normal text? bool UseNormalFont() const { return m_fontName.IsEmpty(); } /// Should we show tooltips? static bool ShowToolTips() { return sm_showToolTips; } /// Determines whether tooltips will be shown static void SetShowToolTips(bool show) { sm_showToolTips = show; } /// Data transfer virtual bool TransferDataToWindow() wxOVERRIDE; ////@begin wxSymbolPickerDialog event handler declarations /// wxEVT_COMBOBOX event handler for ID_SYMBOLPICKERDIALOG_FONT void OnFontCtrlSelected( wxCommandEvent& event ); #if defined(__UNICODE__) /// wxEVT_COMBOBOX event handler for ID_SYMBOLPICKERDIALOG_SUBSET void OnSubsetSelected( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for ID_SYMBOLPICKERDIALOG_SUBSET void OnSymbolpickerdialogSubsetUpdate( wxUpdateUIEvent& event ); #endif #if defined(__UNICODE__) /// wxEVT_COMBOBOX event handler for ID_SYMBOLPICKERDIALOG_FROM void OnFromUnicodeSelected( wxCommandEvent& event ); #endif /// wxEVT_UPDATE_UI event handler for wxID_OK void OnOkUpdate( wxUpdateUIEvent& event ); /// wxEVT_BUTTON event handler for wxID_HELP void OnHelpClick( wxCommandEvent& event ); /// wxEVT_UPDATE_UI event handler for wxID_HELP void OnHelpUpdate( wxUpdateUIEvent& event ); ////@end wxSymbolPickerDialog event handler declarations ////@begin wxSymbolPickerDialog member function declarations wxString GetFontName() const { return m_fontName ; } void SetFontName(wxString value) { m_fontName = value ; } bool GetFromUnicode() const { return m_fromUnicode ; } void SetFromUnicode(bool value) { m_fromUnicode = value ; } wxString GetNormalTextFontName() const { return m_normalTextFontName ; } void SetNormalTextFontName(wxString value) { m_normalTextFontName = value ; } wxString GetSymbol() const { return m_symbol ; } void SetSymbol(wxString value) { m_symbol = value ; } /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end wxSymbolPickerDialog member function declarations ////@begin wxSymbolPickerDialog member variables wxComboBox* m_fontCtrl; #if defined(__UNICODE__) wxComboBox* m_subsetCtrl; #endif wxSymbolListCtrl* m_symbolsCtrl; wxStaticText* m_symbolStaticCtrl; wxTextCtrl* m_characterCodeCtrl; #if defined(__UNICODE__) wxComboBox* m_fromUnicodeCtrl; #endif wxStdDialogButtonSizer* m_stdButtonSizer; wxString m_fontName; bool m_fromUnicode; wxString m_normalTextFontName; wxString m_symbol; /// Control identifiers enum { ID_SYMBOLPICKERDIALOG = 10600, ID_SYMBOLPICKERDIALOG_FONT = 10602, ID_SYMBOLPICKERDIALOG_SUBSET = 10605, ID_SYMBOLPICKERDIALOG_LISTCTRL = 10608, ID_SYMBOLPICKERDIALOG_CHARACTERCODE = 10601, ID_SYMBOLPICKERDIALOG_FROM = 10603 }; ////@end wxSymbolPickerDialog member variables bool m_dontUpdate; static bool sm_showToolTips; }; /*! * The scrolling symbol list. */ class WXDLLIMPEXP_RICHTEXT wxSymbolListCtrl : public wxVScrolledWindow { public: // constructors and such // --------------------- // default constructor, you must call Create() later wxSymbolListCtrl() { Init(); } // normal constructor which calls Create() internally wxSymbolListCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { Init(); (void)Create(parent, id, pos, size, style, name); } // really creates the control and sets the initial number of items in it // (which may be changed later with SetItemCount()) // // returns true on success or false if the control couldn't be created bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr); // dtor does some internal cleanup virtual ~wxSymbolListCtrl(); // accessors // --------- // set the current font virtual bool SetFont(const wxFont& font) wxOVERRIDE; // set Unicode/ASCII mode void SetUnicodeMode(bool unicodeMode); // get the index of the currently selected item or wxNOT_FOUND if there is no selection int GetSelection() const; // is this item selected? bool IsSelected(int item) const; // is this item the current one? bool IsCurrentItem(int item) const { return item == m_current; } // get the margins around each cell wxPoint GetMargins() const { return m_ptMargins; } // get the background colour of selected cells const wxColour& GetSelectionBackground() const { return m_colBgSel; } // operations // ---------- // set the selection to the specified item, if it is wxNOT_FOUND the // selection is unset void SetSelection(int selection); // make this item visible void EnsureVisible(int item); // set the margins: horizontal margin is the distance between the window // border and the item contents while vertical margin is half of the // distance between items // // by default both margins are 0 void SetMargins(const wxPoint& pt); void SetMargins(wxCoord x, wxCoord y) { SetMargins(wxPoint(x, y)); } // set the cell size void SetCellSize(const wxSize& sz) { m_cellSize = sz; } const wxSize& GetCellSize() const { return m_cellSize; } // change the background colour of the selected cells void SetSelectionBackground(const wxColour& col); virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE { return GetClassDefaultAttributes(GetWindowVariant()); } static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); // Get min/max symbol values int GetMinSymbolValue() const { return m_minSymbolValue; } int GetMaxSymbolValue() const { return m_maxSymbolValue; } // Respond to size change void OnSize(wxSizeEvent& event); protected: // draws a line of symbols virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; // gets the line height virtual wxCoord OnGetRowHeight(size_t line) const wxOVERRIDE; // event handlers void OnPaint(wxPaintEvent& event); void OnKeyDown(wxKeyEvent& event); void OnLeftDown(wxMouseEvent& event); void OnLeftDClick(wxMouseEvent& event); // common part of all ctors void Init(); // send the wxEVT_LISTBOX event void SendSelectedEvent(); // change the current item (in single selection listbox it also implicitly // changes the selection); current may be wxNOT_FOUND in which case there // will be no current item any more // // return true if the current item changed, false otherwise bool DoSetCurrent(int current); // flags for DoHandleItemClick enum { ItemClick_Shift = 1, // item shift-clicked ItemClick_Ctrl = 2, // ctrl ItemClick_Kbd = 4 // item selected from keyboard }; // common part of keyboard and mouse handling processing code void DoHandleItemClick(int item, int flags); // calculate line number from symbol value int SymbolValueToLineNumber(int item); // initialise control from current min/max values void SetupCtrl(bool scrollToSelection = true); // hit testing int HitTest(const wxPoint& pt); private: // the current item or wxNOT_FOUND int m_current; // margins wxPoint m_ptMargins; // the selection bg colour wxColour m_colBgSel; // double buffer wxBitmap* m_doubleBuffer; // cell size wxSize m_cellSize; // minimum and maximum symbol value int m_minSymbolValue; // minimum and maximum symbol value int m_maxSymbolValue; // number of items per line int m_symbolsPerLine; // Unicode/ASCII mode bool m_unicodeMode; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxSymbolListCtrl); wxDECLARE_ABSTRACT_CLASS(wxSymbolListCtrl); }; #endif // _RICHTEXTSYMBOLDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/richtext/richtextctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richtext/richtextctrl.h // Purpose: A rich edit control // Author: Julian Smart // Modified by: // Created: 2005-09-30 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTEXTCTRL_H_ #define _WX_RICHTEXTCTRL_H_ #include "wx/richtext/richtextbuffer.h" #if wxUSE_RICHTEXT #include "wx/scrolwin.h" #include "wx/caret.h" #include "wx/timer.h" #include "wx/textctrl.h" #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" #endif #if !defined(__WXGTK__) && !defined(__WXMAC__) #define wxRICHTEXT_BUFFERED_PAINTING 1 #else #define wxRICHTEXT_BUFFERED_PAINTING 0 #endif class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleDefinition; /* * Styles and flags */ /** Styles */ #define wxRE_READONLY 0x0010 #define wxRE_MULTILINE 0x0020 #define wxRE_CENTRE_CARET 0x8000 #define wxRE_CENTER_CARET wxRE_CENTRE_CARET /** Flags */ #define wxRICHTEXT_SHIFT_DOWN 0x01 #define wxRICHTEXT_CTRL_DOWN 0x02 #define wxRICHTEXT_ALT_DOWN 0x04 /** Extra flags */ // Don't draw guide lines around boxes and tables #define wxRICHTEXT_EX_NO_GUIDELINES 0x00000100 /* Defaults */ #define wxRICHTEXT_DEFAULT_OVERALL_SIZE wxSize(-1, -1) #define wxRICHTEXT_DEFAULT_IMAGE_SIZE wxSize(80, 80) #define wxRICHTEXT_DEFAULT_SPACING 3 #define wxRICHTEXT_DEFAULT_MARGIN 3 #define wxRICHTEXT_DEFAULT_UNFOCUSSED_BACKGROUND wxColour(175, 175, 175) #define wxRICHTEXT_DEFAULT_FOCUSSED_BACKGROUND wxColour(140, 140, 140) #define wxRICHTEXT_DEFAULT_UNSELECTED_BACKGROUND wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) #define wxRICHTEXT_DEFAULT_TYPE_COLOUR wxColour(0, 0, 200) #define wxRICHTEXT_DEFAULT_FOCUS_RECT_COLOUR wxColour(100, 80, 80) #define wxRICHTEXT_DEFAULT_CARET_WIDTH 2 // Minimum buffer size before delayed layout kicks in #define wxRICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD 20000 // Milliseconds before layout occurs after resize #define wxRICHTEXT_DEFAULT_LAYOUT_INTERVAL 50 // Milliseconds before delayed image processing occurs #define wxRICHTEXT_DEFAULT_DELAYED_IMAGE_PROCESSING_INTERVAL 200 /* Identifiers */ #define wxID_RICHTEXT_PROPERTIES1 (wxID_HIGHEST + 1) #define wxID_RICHTEXT_PROPERTIES2 (wxID_HIGHEST + 2) #define wxID_RICHTEXT_PROPERTIES3 (wxID_HIGHEST + 3) /* Normal selection occurs initially and as user drags within one container. Common ancestor selection occurs when the user starts dragging across containers that have a common ancestor, for example the cells in a table. */ enum wxRichTextCtrlSelectionState { wxRichTextCtrlSelectionState_Normal, wxRichTextCtrlSelectionState_CommonAncestor }; /** @class wxRichTextContextMenuPropertiesInfo wxRichTextContextMenuPropertiesInfo keeps track of objects that appear in the context menu, whose properties are available to be edited. */ class WXDLLIMPEXP_RICHTEXT wxRichTextContextMenuPropertiesInfo { public: /** Constructor. */ wxRichTextContextMenuPropertiesInfo() { Init(); } // Operations /** Initialisation. */ void Init() {} /** Adds an item. */ bool AddItem(const wxString& label, wxRichTextObject* obj); /** Returns the number of menu items that were added. */ int AddMenuItems(wxMenu* menu, int startCmd = wxID_RICHTEXT_PROPERTIES1) const; /** Adds appropriate menu items for the current container and clicked on object (and container's parent, if appropriate). */ int AddItems(wxRichTextCtrl* ctrl, wxRichTextObject* container, wxRichTextObject* obj); /** Clears the items. */ void Clear() { m_objects.Clear(); m_labels.Clear(); } // Accessors /** Returns the nth label. */ wxString GetLabel(int n) const { return m_labels[n]; } /** Returns the nth object. */ wxRichTextObject* GetObject(int n) const { return m_objects[n]; } /** Returns the array of objects. */ wxRichTextObjectPtrArray& GetObjects() { return m_objects; } /** Returns the array of objects. */ const wxRichTextObjectPtrArray& GetObjects() const { return m_objects; } /** Returns the array of labels. */ wxArrayString& GetLabels() { return m_labels; } /** Returns the array of labels. */ const wxArrayString& GetLabels() const { return m_labels; } /** Returns the number of items. */ int GetCount() const { return m_objects.GetCount(); } wxRichTextObjectPtrArray m_objects; wxArrayString m_labels; }; /** @class wxRichTextCtrl wxRichTextCtrl provides a generic, ground-up implementation of a text control capable of showing multiple styles and images. wxRichTextCtrl sends notification events: see wxRichTextEvent. It also sends the standard wxTextCtrl events @c wxEVT_TEXT_ENTER and @c wxEVT_TEXT, and wxTextUrlEvent when URL content is clicked. For more information, see the @ref overview_richtextctrl. @beginStyleTable @style{wxRE_CENTRE_CARET} The control will try to keep the caret line centred vertically while editing. wxRE_CENTER_CARET is a synonym for this style. @style{wxRE_MULTILINE} The control will be multiline (mandatory). @style{wxRE_READONLY} The control will not be editable. @endStyleTable @library{wxrichtext} @category{richtext} @appearance{richtextctrl.png} */ class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl : public wxControl, public wxTextCtrlIface, public wxScrollHelper { wxDECLARE_DYNAMIC_CLASS(wxRichTextCtrl); wxDECLARE_EVENT_TABLE(); public: // Constructors /** Default constructor. */ wxRichTextCtrl( ); /** Constructor, creating and showing a rich text control. @param parent Parent window. Must not be @NULL. @param id Window identifier. The value @c wxID_ANY indicates a default value. @param value Default string. @param pos Window position. @param size Window size. @param style Window style. @param validator Window validator. @param name Window name. @see Create(), wxValidator */ wxRichTextCtrl( wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr); /** Destructor. */ virtual ~wxRichTextCtrl( ); // Operations /** Creates the underlying window. */ bool Create( wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr ); /** Initialises the members of the control. */ void Init(); // Accessors /** Gets the text for the given range. The end point of range is specified as the last character position of the span of text, plus one. */ virtual wxString GetRange(long from, long to) const wxOVERRIDE; /** Returns the length of the specified line in characters. */ virtual int GetLineLength(long lineNo) const wxOVERRIDE ; /** Returns the text for the given line. */ virtual wxString GetLineText(long lineNo) const wxOVERRIDE ; /** Returns the number of lines in the buffer. */ virtual int GetNumberOfLines() const wxOVERRIDE ; /** Returns @true if the buffer has been modified. */ virtual bool IsModified() const wxOVERRIDE ; /** Returns @true if the control is editable. */ virtual bool IsEditable() const wxOVERRIDE ; /** Returns @true if the control is single-line. Currently wxRichTextCtrl does not support single-line editing. */ bool IsSingleLine() const { return !HasFlag(wxRE_MULTILINE); } /** Returns @true if the control is multiline. */ bool IsMultiLine() const { return !IsSingleLine(); } //@{ /** Returns the range of the current selection. The end point of range is specified as the last character position of the span of text, plus one. If the return values @a from and @a to are the same, there is no selection. */ virtual void GetSelection(long* from, long* to) const wxOVERRIDE; const wxRichTextSelection& GetSelection() const { return m_selection; } wxRichTextSelection& GetSelection() { return m_selection; } //@} /** Returns the text within the current selection range, if any. */ virtual wxString GetStringSelection() const wxOVERRIDE; /** Gets the current filename associated with the control. */ wxString GetFilename() const { return m_filename; } /** Sets the current filename. */ void SetFilename(const wxString& filename) { m_filename = filename; } /** Sets the size of the buffer beyond which layout is delayed during resizing. This optimizes sizing for large buffers. The default is 20000. */ void SetDelayedLayoutThreshold(long threshold) { m_delayedLayoutThreshold = threshold; } /** Gets the size of the buffer beyond which layout is delayed during resizing. This optimizes sizing for large buffers. The default is 20000. */ long GetDelayedLayoutThreshold() const { return m_delayedLayoutThreshold; } /** Gets the flag indicating that full layout is required. */ bool GetFullLayoutRequired() const { return m_fullLayoutRequired; } /** Sets the flag indicating that full layout is required. */ void SetFullLayoutRequired(bool b) { m_fullLayoutRequired = b; } /** Returns the last time full layout was performed. */ wxLongLong GetFullLayoutTime() const { return m_fullLayoutTime; } /** Sets the last time full layout was performed. */ void SetFullLayoutTime(wxLongLong t) { m_fullLayoutTime = t; } /** Returns the position that should be shown when full (delayed) layout is performed. */ long GetFullLayoutSavedPosition() const { return m_fullLayoutSavedPosition; } /** Sets the position that should be shown when full (delayed) layout is performed. */ void SetFullLayoutSavedPosition(long p) { m_fullLayoutSavedPosition = p; } /** Forces any pending layout due to delayed, partial layout when the control was resized. */ void ForceDelayedLayout(); /** Sets the text (normal) cursor. */ void SetTextCursor(const wxCursor& cursor ) { m_textCursor = cursor; } /** Returns the text (normal) cursor. */ wxCursor GetTextCursor() const { return m_textCursor; } /** Sets the cursor to be used over URLs. */ void SetURLCursor(const wxCursor& cursor ) { m_urlCursor = cursor; } /** Returns the cursor to be used over URLs. */ wxCursor GetURLCursor() const { return m_urlCursor; } /** Returns @true if we are showing the caret position at the start of a line instead of at the end of the previous one. */ bool GetCaretAtLineStart() const { return m_caretAtLineStart; } /** Sets a flag to remember that we are showing the caret position at the start of a line instead of at the end of the previous one. */ void SetCaretAtLineStart(bool atStart) { m_caretAtLineStart = atStart; } /** Returns @true if we are dragging a selection. */ bool GetDragging() const { return m_dragging; } /** Sets a flag to remember if we are dragging a selection. */ void SetDragging(bool dragging) { m_dragging = dragging; } #if wxUSE_DRAG_AND_DROP /** Are we trying to start Drag'n'Drop? */ bool GetPreDrag() const { return m_preDrag; } /** Set if we're trying to start Drag'n'Drop */ void SetPreDrag(bool pd) { m_preDrag = pd; } /** Get the possible Drag'n'Drop start point */ const wxPoint GetDragStartPoint() const { return m_dragStartPoint; } /** Set the possible Drag'n'Drop start point */ void SetDragStartPoint(wxPoint sp) { m_dragStartPoint = sp; } #if wxUSE_DATETIME /** Get the possible Drag'n'Drop start time */ const wxDateTime GetDragStartTime() const { return m_dragStartTime; } /** Set the possible Drag'n'Drop start time */ void SetDragStartTime(wxDateTime st) { m_dragStartTime = st; } #endif // wxUSE_DATETIME #endif // wxUSE_DRAG_AND_DROP #if wxRICHTEXT_BUFFERED_PAINTING //@{ /** Returns the buffer bitmap if using buffered painting. */ const wxBitmap& GetBufferBitmap() const { return m_bufferBitmap; } wxBitmap& GetBufferBitmap() { return m_bufferBitmap; } //@} #endif /** Returns the current context menu. */ wxMenu* GetContextMenu() const { return m_contextMenu; } /** Sets the current context menu. */ void SetContextMenu(wxMenu* menu); /** Returns an anchor so we know how to extend the selection. It's a caret position since it's between two characters. */ long GetSelectionAnchor() const { return m_selectionAnchor; } /** Sets an anchor so we know how to extend the selection. It's a caret position since it's between two characters. */ void SetSelectionAnchor(long anchor) { m_selectionAnchor = anchor; } /** Returns the anchor object if selecting multiple containers. */ wxRichTextObject* GetSelectionAnchorObject() const { return m_selectionAnchorObject; } /** Sets the anchor object if selecting multiple containers. */ void SetSelectionAnchorObject(wxRichTextObject* anchor) { m_selectionAnchorObject = anchor; } //@{ /** Returns an object that stores information about context menu property item(s), in order to communicate between the context menu event handler and the code that responds to it. The wxRichTextContextMenuPropertiesInfo stores one item for each object that could respond to a property-editing event. If objects are nested, several might be editable. */ wxRichTextContextMenuPropertiesInfo& GetContextMenuPropertiesInfo() { return m_contextMenuPropertiesInfo; } const wxRichTextContextMenuPropertiesInfo& GetContextMenuPropertiesInfo() const { return m_contextMenuPropertiesInfo; } //@} /** Returns the wxRichTextObject object that currently has the editing focus. If there are no composite objects, this will be the top-level buffer. */ wxRichTextParagraphLayoutBox* GetFocusObject() const { return m_focusObject; } /** Sets m_focusObject without making any alterations. */ void StoreFocusObject(wxRichTextParagraphLayoutBox* obj) { m_focusObject = obj; } /** Sets the wxRichTextObject object that currently has the editing focus. */ bool SetFocusObject(wxRichTextParagraphLayoutBox* obj, bool setCaretPosition = true); // Operations /** Invalidates the whole buffer to trigger painting later. */ void Invalidate() { GetBuffer().Invalidate(wxRICHTEXT_ALL); } /** Clears the buffer content, leaving a single empty paragraph. Cannot be undone. */ virtual void Clear() wxOVERRIDE; /** Replaces the content in the specified range with the string specified by @a value. */ virtual void Replace(long from, long to, const wxString& value) wxOVERRIDE; /** Removes the content in the specified range. */ virtual void Remove(long from, long to) wxOVERRIDE; #ifdef DOXYGEN /** Loads content into the control's buffer using the given type. If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from the filename extension. This function looks for a suitable wxRichTextFileHandler object. */ bool LoadFile(const wxString& file, int type = wxRICHTEXT_TYPE_ANY); #endif #if wxUSE_FFILE && wxUSE_STREAMS /** Helper function for LoadFile(). Loads content into the control's buffer using the given type. If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from the filename extension. This function looks for a suitable wxRichTextFileHandler object. */ virtual bool DoLoadFile(const wxString& file, int fileType) wxOVERRIDE; #endif // wxUSE_FFILE && wxUSE_STREAMS #ifdef DOXYGEN /** Saves the buffer content using the given type. If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from the filename extension. This function looks for a suitable wxRichTextFileHandler object. */ bool SaveFile(const wxString& file = wxEmptyString, int type = wxRICHTEXT_TYPE_ANY); #endif #if wxUSE_FFILE && wxUSE_STREAMS /** Helper function for SaveFile(). Saves the buffer content using the given type. If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from the filename extension. This function looks for a suitable wxRichTextFileHandler object. */ virtual bool DoSaveFile(const wxString& file = wxEmptyString, int fileType = wxRICHTEXT_TYPE_ANY) wxOVERRIDE; #endif // wxUSE_FFILE && wxUSE_STREAMS /** Sets flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler. */ void SetHandlerFlags(int flags) { GetBuffer().SetHandlerFlags(flags); } /** Returns flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler. */ int GetHandlerFlags() const { return GetBuffer().GetHandlerFlags(); } /** Marks the buffer as modified. */ virtual void MarkDirty() wxOVERRIDE; /** Sets the buffer's modified status to @false, and clears the buffer's command history. */ virtual void DiscardEdits() wxOVERRIDE; /** Sets the maximum number of characters that may be entered in a single line text control. For compatibility only; currently does nothing. */ virtual void SetMaxLength(unsigned long WXUNUSED(len)) wxOVERRIDE { } /** Writes text at the current position. */ virtual void WriteText(const wxString& text) wxOVERRIDE; /** Sets the insertion point to the end of the buffer and writes the text. */ virtual void AppendText(const wxString& text) wxOVERRIDE; //@{ /** Gets the attributes at the given position. This function gets the combined style - that is, the style you see on the screen as a result of combining base style, paragraph style and character style attributes. To get the character or paragraph style alone, use GetUncombinedStyle(). @beginWxPerlOnly In wxPerl this method is implemented as GetStyle(@a position) returning a 2-element list (ok, attr). @endWxPerlOnly */ virtual bool GetStyle(long position, wxTextAttr& style) wxOVERRIDE; virtual bool GetStyle(long position, wxRichTextAttr& style); virtual bool GetStyle(long position, wxRichTextAttr& style, wxRichTextParagraphLayoutBox* container); //@} //@{ /** Sets the attributes for the given range. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the style for a character at position 5, use the range (5,6). */ virtual bool SetStyle(long start, long end, const wxTextAttr& style) wxOVERRIDE; virtual bool SetStyle(long start, long end, const wxRichTextAttr& style); virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttr& style); virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style); //@} /** Sets the attributes for a single object */ virtual void SetStyle(wxRichTextObject *obj, const wxRichTextAttr& textAttr, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); //@{ /** Gets the attributes common to the specified range. Attributes that differ in value within the range will not be included in @a style flags. @beginWxPerlOnly In wxPerl this method is implemented as GetStyleForRange(@a position) returning a 2-element list (ok, attr). @endWxPerlOnly */ virtual bool GetStyleForRange(const wxRichTextRange& range, wxTextAttr& style); virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style); virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style, wxRichTextParagraphLayoutBox* container); //@} /** Sets the attributes for the given range, passing flags to determine how the attributes are set. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the style for a character at position 5, use the range (5,6). @a flags may contain a bit list of the following values: - wxRICHTEXT_SETSTYLE_NONE: no style flag. - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this operation should be undoable. - wxRICHTEXT_SETSTYLE_OPTIMIZE: specifies that the style should not be applied if the combined style at this point is already the style in question. - wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY: specifies that the style should only be applied to paragraphs, and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style. - wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY: specifies that the style should only be applied to characters, and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style. - wxRICHTEXT_SETSTYLE_RESET: resets (clears) the existing style before applying the new style. - wxRICHTEXT_SETSTYLE_REMOVE: removes the specified style. Only the style flags are used in this operation. */ virtual bool SetStyleEx(const wxRichTextRange& range, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); //@{ /** Gets the attributes at the given position. This function gets the @e uncombined style - that is, the attributes associated with the paragraph or character content, and not necessarily the combined attributes you see on the screen. To get the combined attributes, use GetStyle(). If you specify (any) paragraph attribute in @e style's flags, this function will fetch the paragraph attributes. Otherwise, it will return the character attributes. @beginWxPerlOnly In wxPerl this method is implemented as GetUncombinedStyle(@a position) returning a 2-element list (ok, attr). @endWxPerlOnly */ virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style); virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style, wxRichTextParagraphLayoutBox* container); //@} //@{ /** Sets the current default style, which can be used to change how subsequently inserted text is displayed. */ virtual bool SetDefaultStyle(const wxTextAttr& style) wxOVERRIDE; virtual bool SetDefaultStyle(const wxRichTextAttr& style); //@} /** Returns the current default style, which can be used to change how subsequently inserted text is displayed. */ virtual const wxRichTextAttr& GetDefaultStyleEx() const; //virtual const wxTextAttr& GetDefaultStyle() const; //@{ /** Sets the list attributes for the given range, passing flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from @a startFrom, otherwise existing attributes are used. - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. @see NumberList(), PromoteList(), ClearListStyle(). */ virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); virtual bool SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); //@} /** Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. @see SetListStyle(), PromoteList(), NumberList(). */ virtual bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); //@{ /** Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from @a startFrom, otherwise existing attributes are used. - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. @see SetListStyle(), PromoteList(), ClearListStyle(). */ virtual bool NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); virtual bool NumberList(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); //@} //@{ /** Promotes or demotes the paragraphs in the given range. A positive @a promoteBy produces a smaller indent, and a negative number produces a larger indent. Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed. @a flags is a bit list of the following: - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable. - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from @a startFrom, otherwise existing attributes are used. - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used. @see SetListStyle(), @see SetListStyle(), ClearListStyle(). */ virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); //@} /** Sets the properties for the given range, passing flags to determine how the attributes are set. You can merge properties or replace them. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the properties for a character at position 5, use the range (5,6). @a flags may contain a bit list of the following values: - wxRICHTEXT_SETSPROPERTIES_NONE: no flag. - wxRICHTEXT_SETPROPERTIES_WITH_UNDO: specifies that this operation should be undoable. - wxRICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY: specifies that the properties should only be applied to paragraphs, and not the content. - wxRICHTEXT_SETPROPERTIES_CHARACTERS_ONLY: specifies that the properties should only be applied to characters, and not the paragraph. - wxRICHTEXT_SETPROPERTIES_RESET: resets (clears) the existing properties before applying the new properties. - wxRICHTEXT_SETPROPERTIES_REMOVE: removes the specified properties. */ virtual bool SetProperties(const wxRichTextRange& range, const wxRichTextProperties& properties, int flags = wxRICHTEXT_SETPROPERTIES_WITH_UNDO); /** Deletes the content within the given range. */ virtual bool Delete(const wxRichTextRange& range); /** Translates from column and line number to position. */ virtual long XYToPosition(long x, long y) const wxOVERRIDE; /** Converts a text position to zero-based column and line numbers. */ virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE; /** Scrolls the buffer so that the given position is in view. */ virtual void ShowPosition(long pos) wxOVERRIDE; //@{ /** Finds the character at the given position in pixels. @a pt is in device coords (not adjusted for the client area origin nor for scrolling). */ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const wxOVERRIDE; virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const wxOVERRIDE; /** Finds the container at the given point, which is in screen coordinates. */ wxRichTextParagraphLayoutBox* FindContainerAtPoint(const wxPoint& pt, long& position, int& hit, wxRichTextObject* hitObj, int flags = 0); //@} #if wxUSE_DRAG_AND_DROP /** Does the 'drop' of Drag'n'Drop. */ void OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def, wxDataObject* DataObj); #endif // Clipboard operations /** Copies the selected content (if any) to the clipboard. */ virtual void Copy() wxOVERRIDE; /** Copies the selected content (if any) to the clipboard and deletes the selection. This is undoable. */ virtual void Cut() wxOVERRIDE; /** Pastes content from the clipboard to the buffer. */ virtual void Paste() wxOVERRIDE; /** Deletes the content in the selection, if any. This is undoable. */ virtual void DeleteSelection(); /** Returns @true if selected content can be copied to the clipboard. */ virtual bool CanCopy() const wxOVERRIDE; /** Returns @true if selected content can be copied to the clipboard and deleted. */ virtual bool CanCut() const wxOVERRIDE; /** Returns @true if the clipboard content can be pasted to the buffer. */ virtual bool CanPaste() const wxOVERRIDE; /** Returns @true if selected content can be deleted. */ virtual bool CanDeleteSelection() const; /** Undoes the command at the top of the command history, if there is one. */ virtual void Undo() wxOVERRIDE; /** Redoes the current command. */ virtual void Redo() wxOVERRIDE; /** Returns @true if there is a command in the command history that can be undone. */ virtual bool CanUndo() const wxOVERRIDE; /** Returns @true if there is a command in the command history that can be redone. */ virtual bool CanRedo() const wxOVERRIDE; /** Sets the insertion point and causes the current editing style to be taken from the new position (unlike wxRichTextCtrl::SetCaretPosition). */ virtual void SetInsertionPoint(long pos) wxOVERRIDE; /** Sets the insertion point to the end of the text control. */ virtual void SetInsertionPointEnd() wxOVERRIDE; /** Returns the current insertion point. */ virtual long GetInsertionPoint() const wxOVERRIDE; /** Returns the last position in the buffer. */ virtual wxTextPos GetLastPosition() const wxOVERRIDE; //@{ /** Sets the selection to the given range. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the selection for a character at position 5, use the range (5,6). */ virtual void SetSelection(long from, long to) wxOVERRIDE; void SetSelection(const wxRichTextSelection& sel) { m_selection = sel; } //@} /** Makes the control editable, or not. */ virtual void SetEditable(bool editable) wxOVERRIDE; /** Returns @true if there is a selection and the object containing the selection was the same as the current focus object. */ virtual bool HasSelection() const; /** Returns @true if there was a selection, whether or not the current focus object is the same as the selection's container object. */ virtual bool HasUnfocusedSelection() const; //@{ /** Write a bitmap or image at the current insertion point. Supply an optional type to use for internal and file storage of the raw data. */ virtual bool WriteImage(const wxImage& image, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG, const wxRichTextAttr& textAttr = wxRichTextAttr()); virtual bool WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG, const wxRichTextAttr& textAttr = wxRichTextAttr()); //@} /** Loads an image from a file and writes it at the current insertion point. */ virtual bool WriteImage(const wxString& filename, wxBitmapType bitmapType, const wxRichTextAttr& textAttr = wxRichTextAttr()); /** Writes an image block at the current insertion point. */ virtual bool WriteImage(const wxRichTextImageBlock& imageBlock, const wxRichTextAttr& textAttr = wxRichTextAttr()); /** Write a text box at the current insertion point, returning the text box. You can then call SetFocusObject() to set the focus to the new object. */ virtual wxRichTextBox* WriteTextBox(const wxRichTextAttr& textAttr = wxRichTextAttr()); /** Writes a field at the current insertion point. @param fieldType The field type, matching an existing field type definition. @param properties Extra data for the field. @param textAttr Optional attributes. @see wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard */ virtual wxRichTextField* WriteField(const wxString& fieldType, const wxRichTextProperties& properties, const wxRichTextAttr& textAttr = wxRichTextAttr()); /** Write a table at the current insertion point, returning the table. You can then call SetFocusObject() to set the focus to the new object. */ virtual wxRichTextTable* WriteTable(int rows, int cols, const wxRichTextAttr& tableAttr = wxRichTextAttr(), const wxRichTextAttr& cellAttr = wxRichTextAttr()); /** Inserts a new paragraph at the current insertion point. @see LineBreak(). */ virtual bool Newline(); /** Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, and can be introduced by using this function, by appending the wxChar value @b wxRichTextLineBreakChar to text content, or by typing Shift-Return. */ virtual bool LineBreak(); /** Sets the basic (overall) style. This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ virtual void SetBasicStyle(const wxRichTextAttr& style) { GetBuffer().SetBasicStyle(style); } /** Gets the basic (overall) style. This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold). */ virtual const wxRichTextAttr& GetBasicStyle() const { return GetBuffer().GetBasicStyle(); } /** Begins applying a style. */ virtual bool BeginStyle(const wxRichTextAttr& style) { return GetBuffer().BeginStyle(style); } /** Ends the current style. */ virtual bool EndStyle() { return GetBuffer().EndStyle(); } /** Ends application of all styles in the current style stack. */ virtual bool EndAllStyles() { return GetBuffer().EndAllStyles(); } /** Begins using bold. */ bool BeginBold() { return GetBuffer().BeginBold(); } /** Ends using bold. */ bool EndBold() { return GetBuffer().EndBold(); } /** Begins using italic. */ bool BeginItalic() { return GetBuffer().BeginItalic(); } /** Ends using italic. */ bool EndItalic() { return GetBuffer().EndItalic(); } /** Begins using underlining. */ bool BeginUnderline() { return GetBuffer().BeginUnderline(); } /** End applying underlining. */ bool EndUnderline() { return GetBuffer().EndUnderline(); } /** Begins using the given point size. */ bool BeginFontSize(int pointSize) { return GetBuffer().BeginFontSize(pointSize); } /** Ends using a point size. */ bool EndFontSize() { return GetBuffer().EndFontSize(); } /** Begins using this font. */ bool BeginFont(const wxFont& font) { return GetBuffer().BeginFont(font); } /** Ends using a font. */ bool EndFont() { return GetBuffer().EndFont(); } /** Begins using this colour. */ bool BeginTextColour(const wxColour& colour) { return GetBuffer().BeginTextColour(colour); } /** Ends applying a text colour. */ bool EndTextColour() { return GetBuffer().EndTextColour(); } /** Begins using alignment. For alignment values, see wxTextAttr. */ bool BeginAlignment(wxTextAttrAlignment alignment) { return GetBuffer().BeginAlignment(alignment); } /** Ends alignment. */ bool EndAlignment() { return GetBuffer().EndAlignment(); } /** Begins applying a left indent and subindent in tenths of a millimetre. The subindent is an offset from the left edge of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented to the right of the subsequent lines. wxRichTextBuffer uses indentation to render a bulleted item. The content of the paragraph, including the first line, starts at the @a leftIndent plus the @a leftSubIndent. @param leftIndent The distance between the margin and the bullet. @param leftSubIndent The distance between the left edge of the bullet and the left edge of the actual paragraph. */ bool BeginLeftIndent(int leftIndent, int leftSubIndent = 0) { return GetBuffer().BeginLeftIndent(leftIndent, leftSubIndent); } /** Ends left indent. */ bool EndLeftIndent() { return GetBuffer().EndLeftIndent(); } /** Begins a right indent, specified in tenths of a millimetre. */ bool BeginRightIndent(int rightIndent) { return GetBuffer().BeginRightIndent(rightIndent); } /** Ends right indent. */ bool EndRightIndent() { return GetBuffer().EndRightIndent(); } /** Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre. */ bool BeginParagraphSpacing(int before, int after) { return GetBuffer().BeginParagraphSpacing(before, after); } /** Ends paragraph spacing. */ bool EndParagraphSpacing() { return GetBuffer().EndParagraphSpacing(); } /** Begins applying line spacing. @e spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing. The ::wxTextAttrLineSpacing constants are defined for convenience. */ bool BeginLineSpacing(int lineSpacing) { return GetBuffer().BeginLineSpacing(lineSpacing); } /** Ends line spacing. */ bool EndLineSpacing() { return GetBuffer().EndLineSpacing(); } /** Begins a numbered bullet. This call will be needed for each item in the list, and the application should take care of incrementing the numbering. @a bulletNumber is a number, usually starting with 1. @a leftIndent and @a leftSubIndent are values in tenths of a millimetre. @a bulletStyle is a bitlist of the ::wxTextAttrBulletStyle values. wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent. */ bool BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD) { return GetBuffer().BeginNumberedBullet(bulletNumber, leftIndent, leftSubIndent, bulletStyle); } /** Ends application of a numbered bullet. */ bool EndNumberedBullet() { return GetBuffer().EndNumberedBullet(); } /** Begins applying a symbol bullet, using a character from the current font. See BeginNumberedBullet() for an explanation of how indentation is used to render the bulleted paragraph. */ bool BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL) { return GetBuffer().BeginSymbolBullet(symbol, leftIndent, leftSubIndent, bulletStyle); } /** Ends applying a symbol bullet. */ bool EndSymbolBullet() { return GetBuffer().EndSymbolBullet(); } /** Begins applying a symbol bullet. */ bool BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD) { return GetBuffer().BeginStandardBullet(bulletName, leftIndent, leftSubIndent, bulletStyle); } /** Begins applying a standard bullet. */ bool EndStandardBullet() { return GetBuffer().EndStandardBullet(); } /** Begins using the named character style. */ bool BeginCharacterStyle(const wxString& characterStyle) { return GetBuffer().BeginCharacterStyle(characterStyle); } /** Ends application of a named character style. */ bool EndCharacterStyle() { return GetBuffer().EndCharacterStyle(); } /** Begins applying the named paragraph style. */ bool BeginParagraphStyle(const wxString& paragraphStyle) { return GetBuffer().BeginParagraphStyle(paragraphStyle); } /** Ends application of a named paragraph style. */ bool EndParagraphStyle() { return GetBuffer().EndParagraphStyle(); } /** Begins using a specified list style. Optionally, you can also pass a level and a number. */ bool BeginListStyle(const wxString& listStyle, int level = 1, int number = 1) { return GetBuffer().BeginListStyle(listStyle, level, number); } /** Ends using a specified list style. */ bool EndListStyle() { return GetBuffer().EndListStyle(); } /** Begins applying wxTEXT_ATTR_URL to the content. Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining. */ bool BeginURL(const wxString& url, const wxString& characterStyle = wxEmptyString) { return GetBuffer().BeginURL(url, characterStyle); } /** Ends applying a URL. */ bool EndURL() { return GetBuffer().EndURL(); } /** Sets the default style to the style under the cursor. */ bool SetDefaultStyleToCursorStyle(); /** Cancels any selection. */ virtual void SelectNone() wxOVERRIDE; /** Selects the word at the given character position. */ virtual bool SelectWord(long position); /** Returns the selection range in character positions. -1, -1 means no selection. The range is in API convention, i.e. a single character selection is denoted by (n, n+1) */ wxRichTextRange GetSelectionRange() const; /** Sets the selection to the given range. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the selection for a character at position 5, use the range (5,6). */ void SetSelectionRange(const wxRichTextRange& range); /** Returns the selection range in character positions. -2, -2 means no selection -1, -1 means select everything. The range is in internal format, i.e. a single character selection is denoted by (n, n) */ wxRichTextRange GetInternalSelectionRange() const { return m_selection.GetRange(); } /** Sets the selection range in character positions. -2, -2 means no selection -1, -1 means select everything. The range is in internal format, i.e. a single character selection is denoted by (n, n) */ void SetInternalSelectionRange(const wxRichTextRange& range) { m_selection.Set(range, GetFocusObject()); } /** Adds a new paragraph of text to the end of the buffer. */ virtual wxRichTextRange AddParagraph(const wxString& text); /** Adds an image to the control's buffer. */ virtual wxRichTextRange AddImage(const wxImage& image); /** Lays out the buffer, which must be done before certain operations, such as setting the caret position. This function should not normally be required by the application. */ virtual bool LayoutContent(bool onlyVisibleRect = false); /** Implements layout. An application may override this to perform operations before or after layout. */ virtual void DoLayoutBuffer(wxRichTextBuffer& buffer, wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int flags); /** Move the caret to the given character position. Please note that this does not update the current editing style from the new position; to do that, call wxRichTextCtrl::SetInsertionPoint instead. */ virtual bool MoveCaret(long pos, bool showAtLineStart = false, wxRichTextParagraphLayoutBox* container = NULL); /** Moves right. */ virtual bool MoveRight(int noPositions = 1, int flags = 0); /** Moves left. */ virtual bool MoveLeft(int noPositions = 1, int flags = 0); /** Moves to the start of the paragraph. */ virtual bool MoveUp(int noLines = 1, int flags = 0); /** Moves the caret down. */ virtual bool MoveDown(int noLines = 1, int flags = 0); /** Moves to the end of the line. */ virtual bool MoveToLineEnd(int flags = 0); /** Moves to the start of the line. */ virtual bool MoveToLineStart(int flags = 0); /** Moves to the end of the paragraph. */ virtual bool MoveToParagraphEnd(int flags = 0); /** Moves to the start of the paragraph. */ virtual bool MoveToParagraphStart(int flags = 0); /** Moves to the start of the buffer. */ virtual bool MoveHome(int flags = 0); /** Moves to the end of the buffer. */ virtual bool MoveEnd(int flags = 0); /** Moves one or more pages up. */ virtual bool PageUp(int noPages = 1, int flags = 0); /** Moves one or more pages down. */ virtual bool PageDown(int noPages = 1, int flags = 0); /** Moves a number of words to the left. */ virtual bool WordLeft(int noPages = 1, int flags = 0); /** Move a number of words to the right. */ virtual bool WordRight(int noPages = 1, int flags = 0); //@{ /** Returns the buffer associated with the control. */ wxRichTextBuffer& GetBuffer() { return m_buffer; } const wxRichTextBuffer& GetBuffer() const { return m_buffer; } //@} /** Starts batching undo history for commands. */ virtual bool BeginBatchUndo(const wxString& cmdName) { return m_buffer.BeginBatchUndo(cmdName); } /** Ends batching undo command history. */ virtual bool EndBatchUndo() { return m_buffer.EndBatchUndo(); } /** Returns @true if undo commands are being batched. */ virtual bool BatchingUndo() const { return m_buffer.BatchingUndo(); } /** Starts suppressing undo history for commands. */ virtual bool BeginSuppressUndo() { return m_buffer.BeginSuppressUndo(); } /** Ends suppressing undo command history. */ virtual bool EndSuppressUndo() { return m_buffer.EndSuppressUndo(); } /** Returns @true if undo history suppression is on. */ virtual bool SuppressingUndo() const { return m_buffer.SuppressingUndo(); } /** Test if this whole range has character attributes of the specified kind. If any of the attributes are different within the range, the test fails. You can use this to implement, for example, bold button updating. @a style must have flags indicating which attributes are of interest. */ virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const { return GetFocusObject()->HasCharacterAttributes(range.ToInternal(), style); } /** Test if this whole range has paragraph attributes of the specified kind. If any of the attributes are different within the range, the test fails. You can use this to implement, for example, centering button updating. @a style must have flags indicating which attributes are of interest. */ virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const { return GetFocusObject()->HasParagraphAttributes(range.ToInternal(), style); } /** Returns @true if all of the selection, or the content at the caret position, is bold. */ virtual bool IsSelectionBold(); /** Returns @true if all of the selection, or the content at the caret position, is italic. */ virtual bool IsSelectionItalics(); /** Returns @true if all of the selection, or the content at the caret position, is underlined. */ virtual bool IsSelectionUnderlined(); /** Returns @true if all of the selection, or the content at the current caret position, has the supplied wxTextAttrEffects flag(s). */ virtual bool DoesSelectionHaveTextEffectFlag(int flag); /** Returns @true if all of the selection, or the content at the caret position, is aligned according to the specified flag. */ virtual bool IsSelectionAligned(wxTextAttrAlignment alignment); /** Apples bold to the selection or default style (undoable). */ virtual bool ApplyBoldToSelection(); /** Applies italic to the selection or default style (undoable). */ virtual bool ApplyItalicToSelection(); /** Applies underline to the selection or default style (undoable). */ virtual bool ApplyUnderlineToSelection(); /** Applies one or more wxTextAttrEffects flags to the selection (undoable). If there is no selection, it is applied to the default style. */ virtual bool ApplyTextEffectToSelection(int flags); /** Applies the given alignment to the selection or the default style (undoable). For alignment values, see wxTextAttr. */ virtual bool ApplyAlignmentToSelection(wxTextAttrAlignment alignment); /** Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles in the buffer. This might be useful if the styles have changed. If @a sheet is @NULL, the sheet set with SetStyleSheet() is used. Currently this applies paragraph styles only. */ virtual bool ApplyStyle(wxRichTextStyleDefinition* def); /** Sets the style sheet associated with the control. A style sheet allows named character and paragraph styles to be applied. */ void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { GetBuffer().SetStyleSheet(styleSheet); } /** Returns the style sheet associated with the control, if any. A style sheet allows named character and paragraph styles to be applied. */ wxRichTextStyleSheet* GetStyleSheet() const { return GetBuffer().GetStyleSheet(); } /** Push the style sheet to top of stack. */ bool PushStyleSheet(wxRichTextStyleSheet* styleSheet) { return GetBuffer().PushStyleSheet(styleSheet); } /** Pops the style sheet from top of stack. */ wxRichTextStyleSheet* PopStyleSheet() { return GetBuffer().PopStyleSheet(); } /** Applies the style sheet to the buffer, for example if the styles have changed. */ bool ApplyStyleSheet(wxRichTextStyleSheet* styleSheet = NULL); /** Shows the given context menu, optionally adding appropriate property-editing commands for the current position in the object hierarchy. */ virtual bool ShowContextMenu(wxMenu* menu, const wxPoint& pt, bool addPropertyCommands = true); /** Prepares the context menu, optionally adding appropriate property-editing commands. Returns the number of property commands added. */ virtual int PrepareContextMenu(wxMenu* menu, const wxPoint& pt, bool addPropertyCommands = true); /** Returns @true if we can edit the object's properties via a GUI. */ virtual bool CanEditProperties(wxRichTextObject* obj) const { return obj->CanEditProperties(); } /** Edits the object's properties via a GUI. */ virtual bool EditProperties(wxRichTextObject* obj, wxWindow* parent) { return obj->EditProperties(parent, & GetBuffer()); } /** Gets the object's properties menu label. */ virtual wxString GetPropertiesMenuLabel(wxRichTextObject* obj) { return obj->GetPropertiesMenuLabel(); } /** Prepares the content just before insertion (or after buffer reset). Called by the same function in wxRichTextBuffer. Currently is only called if undo mode is on. */ virtual void PrepareContent(wxRichTextParagraphLayoutBox& WXUNUSED(container)) {} /** Can we delete this range? Sends an event to the control. */ virtual bool CanDeleteRange(wxRichTextParagraphLayoutBox& container, const wxRichTextRange& range) const; /** Can we insert content at this position? Sends an event to the control. */ virtual bool CanInsertContent(wxRichTextParagraphLayoutBox& container, long pos) const; /** Enable or disable the vertical scrollbar. */ virtual void EnableVerticalScrollbar(bool enable); /** Returns @true if the vertical scrollbar is enabled. */ virtual bool GetVerticalScrollbarEnabled() const { return m_verticalScrollbarEnabled; } /** Sets the scale factor for displaying fonts, for example for more comfortable editing. */ void SetFontScale(double fontScale, bool refresh = false); /** Returns the scale factor for displaying fonts, for example for more comfortable editing. */ double GetFontScale() const { return GetBuffer().GetFontScale(); } /** Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing. This can be useful when editing in a small control where you still want legible text, but a minimum of wasted white space. */ void SetDimensionScale(double dimScale, bool refresh = false); /** Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing. */ double GetDimensionScale() const { return GetBuffer().GetDimensionScale(); } /** Sets an overall scale factor for displaying and editing the content. */ void SetScale(double scale, bool refresh = false); /** Returns an overall scale factor for displaying and editing the content. */ double GetScale() const { return m_scale; } /** Returns an unscaled point. */ wxPoint GetUnscaledPoint(const wxPoint& pt) const; /** Returns a scaled point. */ wxPoint GetScaledPoint(const wxPoint& pt) const; /** Returns an unscaled size. */ wxSize GetUnscaledSize(const wxSize& sz) const; /** Returns a scaled size. */ wxSize GetScaledSize(const wxSize& sz) const; /** Returns an unscaled rectangle. */ wxRect GetUnscaledRect(const wxRect& rect) const; /** Returns a scaled rectangle. */ wxRect GetScaledRect(const wxRect& rect) const; /** Returns @true if this control can use virtual attributes and virtual text. The default is @false. */ bool GetVirtualAttributesEnabled() const { return m_useVirtualAttributes; } /** Pass @true to let the control use virtual attributes. The default is @false. */ void EnableVirtualAttributes(bool b) { m_useVirtualAttributes = b; } // Command handlers /** Sends the event to the control. */ void Command(wxCommandEvent& event) wxOVERRIDE; /** Loads the first dropped file. */ void OnDropFiles(wxDropFilesEvent& event); void OnCaptureLost(wxMouseCaptureLostEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); /** Standard handler for the wxID_CUT command. */ void OnCut(wxCommandEvent& event); /** Standard handler for the wxID_COPY command. */ void OnCopy(wxCommandEvent& event); /** Standard handler for the wxID_PASTE command. */ void OnPaste(wxCommandEvent& event); /** Standard handler for the wxID_UNDO command. */ void OnUndo(wxCommandEvent& event); /** Standard handler for the wxID_REDO command. */ void OnRedo(wxCommandEvent& event); /** Standard handler for the wxID_SELECTALL command. */ void OnSelectAll(wxCommandEvent& event); /** Standard handler for property commands. */ void OnProperties(wxCommandEvent& event); /** Standard handler for the wxID_CLEAR command. */ void OnClear(wxCommandEvent& event); /** Standard update handler for the wxID_CUT command. */ void OnUpdateCut(wxUpdateUIEvent& event); /** Standard update handler for the wxID_COPY command. */ void OnUpdateCopy(wxUpdateUIEvent& event); /** Standard update handler for the wxID_PASTE command. */ void OnUpdatePaste(wxUpdateUIEvent& event); /** Standard update handler for the wxID_UNDO command. */ void OnUpdateUndo(wxUpdateUIEvent& event); /** Standard update handler for the wxID_REDO command. */ void OnUpdateRedo(wxUpdateUIEvent& event); /** Standard update handler for the wxID_SELECTALL command. */ void OnUpdateSelectAll(wxUpdateUIEvent& event); /** Standard update handler for property commands. */ void OnUpdateProperties(wxUpdateUIEvent& event); /** Standard update handler for the wxID_CLEAR command. */ void OnUpdateClear(wxUpdateUIEvent& event); /** Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands. */ void OnContextMenu(wxContextMenuEvent& event); // Event handlers // Painting void OnPaint(wxPaintEvent& event); void OnEraseBackground(wxEraseEvent& event); // Left-click void OnLeftClick(wxMouseEvent& event); // Left-up void OnLeftUp(wxMouseEvent& event); // Motion void OnMoveMouse(wxMouseEvent& event); // Left-double-click void OnLeftDClick(wxMouseEvent& event); // Middle-click void OnMiddleClick(wxMouseEvent& event); // Right-click void OnRightClick(wxMouseEvent& event); // Key press void OnChar(wxKeyEvent& event); // Sizing void OnSize(wxSizeEvent& event); // Setting/losing focus void OnSetFocus(wxFocusEvent& event); void OnKillFocus(wxFocusEvent& event); // Idle-time processing void OnIdle(wxIdleEvent& event); // Scrolling void OnScroll(wxScrollWinEvent& event); /** Sets the font, and also the basic and default attributes (see wxRichTextCtrl::SetDefaultStyle). */ virtual bool SetFont(const wxFont& font) wxOVERRIDE; /** A helper function setting up scrollbars, for example after a resize. */ virtual void SetupScrollbars(bool atTop = false, bool fromOnPaint = false); /** Helper function implementing keyboard navigation. */ virtual bool KeyboardNavigate(int keyCode, int flags); /** Paints the background. */ virtual void PaintBackground(wxDC& dc); /** Other user defined painting after everything else (i.e. all text) is painted. @since 2.9.1 */ virtual void PaintAboveContent(wxDC& WXUNUSED(dc)) {} #if wxRICHTEXT_BUFFERED_PAINTING /** Recreates the buffer bitmap if necessary. */ virtual bool RecreateBuffer(const wxSize& size = wxDefaultSize); #endif // Write text virtual void DoWriteText(const wxString& value, int flags = 0); // Should we inherit colours? virtual bool ShouldInheritColours() const wxOVERRIDE { return false; } /** Internal function to position the visible caret according to the current caret position. */ virtual void PositionCaret(wxRichTextParagraphLayoutBox* container = NULL); /** Helper function for extending the selection, returning @true if the selection was changed. Selections are in caret positions. */ virtual bool ExtendSelection(long oldPosition, long newPosition, int flags); /** Extends a table selection in the given direction. */ virtual bool ExtendCellSelection(wxRichTextTable* table, int noRowSteps, int noColSteps); /** Starts selecting table cells. */ virtual bool StartCellSelection(wxRichTextTable* table, wxRichTextParagraphLayoutBox* newCell); /** Scrolls @a position into view. This function takes a caret position. */ virtual bool ScrollIntoView(long position, int keyCode); /** Refreshes the area affected by a selection change. */ bool RefreshForSelectionChange(const wxRichTextSelection& oldSelection, const wxRichTextSelection& newSelection); /** Overrides standard refresh in order to provoke delayed image loading. */ virtual void Refresh( bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE; /** Sets the caret position. The caret position is the character position just before the caret. A value of -1 means the caret is at the start of the buffer. Please note that this does not update the current editing style from the new position or cause the actual caret to be refreshed; to do that, call wxRichTextCtrl::SetInsertionPoint instead. */ void SetCaretPosition(long position, bool showAtLineStart = false) ; /** Returns the current caret position. */ long GetCaretPosition() const { return m_caretPosition; } /** The adjusted caret position is the character position adjusted to take into account whether we're at the start of a paragraph, in which case style information should be taken from the next position, not current one. */ long GetAdjustedCaretPosition(long caretPos) const; /** Move the caret one visual step forward: this may mean setting a flag and keeping the same position if we're going from the end of one line to the start of the next, which may be the exact same caret position. */ void MoveCaretForward(long oldPosition) ; /** Move the caret one visual step forward: this may mean setting a flag and keeping the same position if we're going from the end of one line to the start of the next, which may be the exact same caret position. */ void MoveCaretBack(long oldPosition) ; /** Returns the caret height and position for the given character position. If container is null, the current focus object will be used. @beginWxPerlOnly In wxPerl this method is implemented as GetCaretPositionForIndex(@a position) returning a 2-element list (ok, rect). @endWxPerlOnly */ bool GetCaretPositionForIndex(long position, wxRect& rect, wxRichTextParagraphLayoutBox* container = NULL); /** Internal helper function returning the line for the visible caret position. If the caret is shown at the very end of the line, it means the next character is actually on the following line. So this function gets the line we're expecting to find if this is the case. */ wxRichTextLine* GetVisibleLineForCaretPosition(long caretPosition) const; /** Gets the command processor associated with the control's buffer. */ wxCommandProcessor* GetCommandProcessor() const { return GetBuffer().GetCommandProcessor(); } /** Deletes content if there is a selection, e.g. when pressing a key. Returns the new caret position in @e newPos, or leaves it if there was no action. This is undoable. @beginWxPerlOnly In wxPerl this method takes no arguments and returns a 2-element list (ok, newPos). @endWxPerlOnly */ virtual bool DeleteSelectedContent(long* newPos= NULL); /** Transforms logical (unscrolled) position to physical window position. */ wxPoint GetPhysicalPoint(const wxPoint& ptLogical) const; /** Transforms physical window position to logical (unscrolled) position. */ wxPoint GetLogicalPoint(const wxPoint& ptPhysical) const; /** Helper function for finding the caret position for the next word. Direction is 1 (forward) or -1 (backwards). */ virtual long FindNextWordPosition(int direction = 1) const; /** Returns @true if the given position is visible on the screen. */ bool IsPositionVisible(long pos) const; /** Returns the first visible position in the current view. */ long GetFirstVisiblePosition() const; /** Returns the caret position since the default formatting was changed. As soon as this position changes, we no longer reflect the default style in the UI. A value of -2 means that we should only reflect the style of the content under the caret. */ long GetCaretPositionForDefaultStyle() const { return m_caretPositionForDefaultStyle; } /** Set the caret position for the default style that the user is selecting. */ void SetCaretPositionForDefaultStyle(long pos) { m_caretPositionForDefaultStyle = pos; } /** Returns @true if the user has recently set the default style without moving the caret, and therefore the UI needs to reflect the default style and not the style at the caret. Below is an example of code that uses this function to determine whether the UI should show that the current style is bold. @see SetAndShowDefaultStyle(). */ bool IsDefaultStyleShowing() const { return m_caretPositionForDefaultStyle != -2; } /** Sets @a attr as the default style and tells the control that the UI should reflect this attribute until the user moves the caret. @see IsDefaultStyleShowing(). */ void SetAndShowDefaultStyle(const wxRichTextAttr& attr) { SetDefaultStyle(attr); SetCaretPositionForDefaultStyle(GetCaretPosition()); } /** Returns the first visible point in the window. */ wxPoint GetFirstVisiblePoint() const; /** Enable or disable images */ void EnableImages(bool b) { m_enableImages = b; } /** Returns @true if images are enabled. */ bool GetImagesEnabled() const { return m_enableImages; } /** Enable or disable delayed image loading */ void EnableDelayedImageLoading(bool b) { m_enableDelayedImageLoading = b; } /** Returns @true if delayed image loading is enabled. */ bool GetDelayedImageLoading() const { return m_enableDelayedImageLoading; } /** Gets the flag indicating that delayed image processing is required. */ bool GetDelayedImageProcessingRequired() const { return m_delayedImageProcessingRequired; } /** Sets the flag indicating that delayed image processing is required. */ void SetDelayedImageProcessingRequired(bool b) { m_delayedImageProcessingRequired = b; } /** Returns the last time delayed image processing was performed. */ wxLongLong GetDelayedImageProcessingTime() const { return m_delayedImageProcessingTime; } /** Sets the last time delayed image processing was performed. */ void SetDelayedImageProcessingTime(wxLongLong t) { m_delayedImageProcessingTime = t; } #ifdef DOXYGEN /** Returns the content of the entire control as a string. */ virtual wxString GetValue() const; /** Replaces existing content with the given text. */ virtual void SetValue(const wxString& value); /** Call this function to prevent refresh and allow fast updates, and then Thaw() to refresh the control. */ void Freeze(); /** Call this function to end a Freeze and refresh the display. */ void Thaw(); /** Returns @true if Freeze has been called without a Thaw. */ bool IsFrozen() const; #endif /// Set the line increment height in pixels void SetLineHeight(int height) { m_lineHeight = height; } int GetLineHeight() const { return m_lineHeight; } // Implementation /** Processes the back key. */ virtual bool ProcessBackKey(wxKeyEvent& event, int flags); /** Given a character position at which there is a list style, find the range encompassing the same list style by looking backwards and forwards. */ virtual wxRichTextRange FindRangeForList(long pos, bool& isNumberedList); /** Sets up the caret for the given position and container, after a mouse click. */ bool SetCaretPositionAfterClick(wxRichTextParagraphLayoutBox* container, long position, int hitTestFlags, bool extendSelection = false); /** Find the caret position for the combination of hit-test flags and character position. Returns the caret position and also an indication of where to place the caret (caretLineStart) since this is ambiguous (same position used for end of line and start of next). */ long FindCaretPositionForCharacterPosition(long position, int hitTestFlags, wxRichTextParagraphLayoutBox* container, bool& caretLineStart); /** Processes mouse movement in order to change the cursor */ virtual bool ProcessMouseMovement(wxRichTextParagraphLayoutBox* container, wxRichTextObject* obj, long position, const wxPoint& pos); /** Font names take a long time to retrieve, so cache them (on demand). */ static const wxArrayString& GetAvailableFontNames(); /** Clears the cache of available font names. */ static void ClearAvailableFontNames(); WX_FORWARD_TO_SCROLL_HELPER() // implement wxTextEntry methods virtual wxString DoGetValue() const wxOVERRIDE; /** Do delayed image loading and garbage-collect other images */ bool ProcessDelayedImageLoading(bool refresh); bool ProcessDelayedImageLoading(const wxRect& screenRect, wxRichTextParagraphLayoutBox* box, int& loadCount); /** Request delayed image processing. */ void RequestDelayedImageProcessing(); /** Respond to timer events. */ void OnTimer(wxTimerEvent& event); protected: // implement the wxTextEntry pure virtual method virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; } // margins functions virtual bool DoSetMargins(const wxPoint& pt) wxOVERRIDE; virtual wxPoint DoGetMargins() const wxOVERRIDE; // FIXME: this does not work, it allows this code to compile but will fail // during run-time #ifndef __WXUNIVERSAL__ #ifdef __WXMSW__ virtual WXHWND GetEditHWND() const { return GetHWND(); } #endif #ifdef __WXMOTIF__ virtual WXWidget GetTextWidget() const { return NULL; } #endif #ifdef __WXGTK20__ virtual GtkEditable *GetEditable() const { return NULL; } virtual GtkEntry *GetEntry() const { return NULL; } #endif #endif // !__WXUNIVERSAL__ // Overrides protected: /** Currently this simply returns @c wxSize(10, 10). */ virtual wxSize DoGetBestSize() const wxOVERRIDE ; virtual void DoSetValue(const wxString& value, int flags = 0) wxOVERRIDE; virtual void DoThaw() wxOVERRIDE; // Data members protected: #if wxRICHTEXT_BUFFERED_PAINTING /// Buffer bitmap wxBitmap m_bufferBitmap; #endif /// Text buffer wxRichTextBuffer m_buffer; wxMenu* m_contextMenu; /// Caret position (1 less than the character position, so -1 is the /// first caret position). long m_caretPosition; /// Caret position when the default formatting has been changed. As /// soon as this position changes, we no longer reflect the default style /// in the UI. long m_caretPositionForDefaultStyle; /// Selection range in character positions. -2, -2 means no selection. wxRichTextSelection m_selection; wxRichTextCtrlSelectionState m_selectionState; /// Anchor so we know how to extend the selection /// It's a caret position since it's between two characters. long m_selectionAnchor; /// Anchor object if selecting multiple container objects, such as grid cells. wxRichTextObject* m_selectionAnchorObject; /// Are we editable? bool m_editable; /// Can we use virtual attributes and virtual text? bool m_useVirtualAttributes; /// Is the vertical scrollbar enabled? bool m_verticalScrollbarEnabled; /// Are we showing the caret position at the start of a line /// instead of at the end of the previous one? bool m_caretAtLineStart; /// Are we dragging (i.e. extending) a selection? bool m_dragging; #if wxUSE_DRAG_AND_DROP /// Are we trying to start Drag'n'Drop? bool m_preDrag; /// Initial position when starting Drag'n'Drop wxPoint m_dragStartPoint; #if wxUSE_DATETIME /// Initial time when starting Drag'n'Drop wxDateTime m_dragStartTime; #endif // wxUSE_DATETIME #endif // wxUSE_DRAG_AND_DROP /// Do we need full layout in idle? bool m_fullLayoutRequired; wxLongLong m_fullLayoutTime; long m_fullLayoutSavedPosition; /// Threshold for doing delayed layout long m_delayedLayoutThreshold; /// Cursors wxCursor m_textCursor; wxCursor m_urlCursor; static wxArrayString sm_availableFontNames; wxRichTextContextMenuPropertiesInfo m_contextMenuPropertiesInfo; /// The object that currently has the editing focus wxRichTextParagraphLayoutBox* m_focusObject; /// An overall scale factor double m_scale; /// Variables for scrollbar hysteresis detection wxSize m_lastWindowSize; int m_setupScrollbarsCount; int m_setupScrollbarsCountInOnSize; /// Whether images are enabled for this control bool m_enableImages; /// Line height in pixels int m_lineHeight; /// Whether delayed image loading is enabled for this control bool m_enableDelayedImageLoading; bool m_delayedImageProcessingRequired; wxLongLong m_delayedImageProcessingTime; wxTimer m_delayedImageProcessingTimer; }; #if wxUSE_DRAG_AND_DROP class WXDLLIMPEXP_RICHTEXT wxRichTextDropSource : public wxDropSource { public: wxRichTextDropSource(wxDataObject& data, wxRichTextCtrl* tc) : wxDropSource(data, tc), m_rtc(tc) {} protected: bool GiveFeedback(wxDragResult effect) wxOVERRIDE; wxRichTextCtrl* m_rtc; }; class WXDLLIMPEXP_RICHTEXT wxRichTextDropTarget : public wxDropTarget { public: wxRichTextDropTarget(wxRichTextCtrl* tc) : wxDropTarget(new wxRichTextBufferDataObject(new wxRichTextBuffer)), m_rtc(tc) {} virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE { if ( !GetData() ) return wxDragNone; m_rtc->OnDrop(x, y, def, m_dataObject); return def; } protected: wxRichTextCtrl* m_rtc; }; #endif // wxUSE_DRAG_AND_DROP /** @class wxRichTextEvent This is the event class for wxRichTextCtrl notifications. @beginEventTable{wxRichTextEvent} @event{EVT_RICHTEXT_LEFT_CLICK(id, func)} Process a @c wxEVT_RICHTEXT_LEFT_CLICK event, generated when the user releases the left mouse button over an object. @event{EVT_RICHTEXT_RIGHT_CLICK(id, func)} Process a @c wxEVT_RICHTEXT_RIGHT_CLICK event, generated when the user releases the right mouse button over an object. @event{EVT_RICHTEXT_MIDDLE_CLICK(id, func)} Process a @c wxEVT_RICHTEXT_MIDDLE_CLICK event, generated when the user releases the middle mouse button over an object. @event{EVT_RICHTEXT_LEFT_DCLICK(id, func)} Process a @c wxEVT_RICHTEXT_LEFT_DCLICK event, generated when the user double-clicks an object. @event{EVT_RICHTEXT_RETURN(id, func)} Process a @c wxEVT_RICHTEXT_RETURN event, generated when the user presses the return key. Valid event functions: GetFlags, GetPosition. @event{EVT_RICHTEXT_CHARACTER(id, func)} Process a @c wxEVT_RICHTEXT_CHARACTER event, generated when the user presses a character key. Valid event functions: GetFlags, GetPosition, GetCharacter. @event{EVT_RICHTEXT_CONSUMING_CHARACTER(id, func)} Process a @c wxEVT_RICHTEXT_CONSUMING_CHARACTER event, generated when the user presses a character key but before it is processed and inserted into the control. Call Veto to prevent normal processing. Valid event functions: GetFlags, GetPosition, GetCharacter, Veto. @event{EVT_RICHTEXT_DELETE(id, func)} Process a @c wxEVT_RICHTEXT_DELETE event, generated when the user presses the backspace or delete key. Valid event functions: GetFlags, GetPosition. @event{EVT_RICHTEXT_STYLE_CHANGED(id, func)} Process a @c wxEVT_RICHTEXT_STYLE_CHANGED event, generated when styling has been applied to the control. Valid event functions: GetPosition, GetRange. @event{EVT_RICHTEXT_STYLESHEET_CHANGED(id, func)} Process a @c wxEVT_RICHTEXT_STYLESHEET_CHANGING event, generated when the control's stylesheet has changed, for example the user added, edited or deleted a style. Valid event functions: GetRange, GetPosition. @event{EVT_RICHTEXT_STYLESHEET_REPLACING(id, func)} Process a @c wxEVT_RICHTEXT_STYLESHEET_REPLACING event, generated when the control's stylesheet is about to be replaced, for example when a file is loaded into the control. Valid event functions: Veto, GetOldStyleSheet, GetNewStyleSheet. @event{EVT_RICHTEXT_STYLESHEET_REPLACED(id, func)} Process a @c wxEVT_RICHTEXT_STYLESHEET_REPLACED event, generated when the control's stylesheet has been replaced, for example when a file is loaded into the control. Valid event functions: GetOldStyleSheet, GetNewStyleSheet. @event{EVT_RICHTEXT_PROPERTIES_CHANGED(id, func)} Process a @c wxEVT_RICHTEXT_PROPERTIES_CHANGED event, generated when properties have been applied to the control. Valid event functions: GetPosition, GetRange. @event{EVT_RICHTEXT_CONTENT_INSERTED(id, func)} Process a @c wxEVT_RICHTEXT_CONTENT_INSERTED event, generated when content has been inserted into the control. Valid event functions: GetPosition, GetRange. @event{EVT_RICHTEXT_CONTENT_DELETED(id, func)} Process a @c wxEVT_RICHTEXT_CONTENT_DELETED event, generated when content has been deleted from the control. Valid event functions: GetPosition, GetRange. @event{EVT_RICHTEXT_BUFFER_RESET(id, func)} Process a @c wxEVT_RICHTEXT_BUFFER_RESET event, generated when the buffer has been reset by deleting all content. You can use this to set a default style for the first new paragraph. @event{EVT_RICHTEXT_SELECTION_CHANGED(id, func)} Process a @c wxEVT_RICHTEXT_SELECTION_CHANGED event, generated when the selection range has changed. @event{EVT_RICHTEXT_FOCUS_OBJECT_CHANGED(id, func)} Process a @c wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED event, generated when the current focus object has changed. @endEventTable @library{wxrichtext} @category{events,richtext} */ class WXDLLIMPEXP_RICHTEXT wxRichTextEvent : public wxNotifyEvent { public: /** Constructor. @param commandType The type of the event. @param id Window identifier. The value @c wxID_ANY indicates a default value. */ wxRichTextEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) : wxNotifyEvent(commandType, winid), m_flags(0), m_position(-1), m_oldStyleSheet(NULL), m_newStyleSheet(NULL), m_char((wxChar) 0), m_container(NULL), m_oldContainer(NULL) { } /** Copy constructor. */ wxRichTextEvent(const wxRichTextEvent& event) : wxNotifyEvent(event), m_flags(event.m_flags), m_position(-1), m_oldStyleSheet(event.m_oldStyleSheet), m_newStyleSheet(event.m_newStyleSheet), m_char((wxChar) 0), m_container(event.m_container), m_oldContainer(event.m_oldContainer) { } /** Returns the buffer position at which the event occurred. */ long GetPosition() const { return m_position; } /** Sets the buffer position variable. */ void SetPosition(long pos) { m_position = pos; } /** Returns flags indicating modifier keys pressed. Possible values are @c wxRICHTEXT_CTRL_DOWN, @c wxRICHTEXT_SHIFT_DOWN, and @c wxRICHTEXT_ALT_DOWN. */ int GetFlags() const { return m_flags; } /** Sets flags indicating modifier keys pressed. Possible values are @c wxRICHTEXT_CTRL_DOWN, @c wxRICHTEXT_SHIFT_DOWN, and @c wxRICHTEXT_ALT_DOWN. */ void SetFlags(int flags) { m_flags = flags; } /** Returns the old style sheet. Can be used in a @c wxEVT_RICHTEXT_STYLESHEET_CHANGING or @c wxEVT_RICHTEXT_STYLESHEET_CHANGED event handler. */ wxRichTextStyleSheet* GetOldStyleSheet() const { return m_oldStyleSheet; } /** Sets the old style sheet variable. */ void SetOldStyleSheet(wxRichTextStyleSheet* sheet) { m_oldStyleSheet = sheet; } /** Returns the new style sheet. Can be used in a @c wxEVT_RICHTEXT_STYLESHEET_CHANGING or @c wxEVT_RICHTEXT_STYLESHEET_CHANGED event handler. */ wxRichTextStyleSheet* GetNewStyleSheet() const { return m_newStyleSheet; } /** Sets the new style sheet variable. */ void SetNewStyleSheet(wxRichTextStyleSheet* sheet) { m_newStyleSheet = sheet; } /** Gets the range for the current operation. */ const wxRichTextRange& GetRange() const { return m_range; } /** Sets the range variable. */ void SetRange(const wxRichTextRange& range) { m_range = range; } /** Returns the character pressed, within a @c wxEVT_RICHTEXT_CHARACTER event. */ wxChar GetCharacter() const { return m_char; } /** Sets the character variable. */ void SetCharacter(wxChar ch) { m_char = ch; } /** Returns the container for which the event is relevant. */ wxRichTextParagraphLayoutBox* GetContainer() const { return m_container; } /** Sets the container for which the event is relevant. */ void SetContainer(wxRichTextParagraphLayoutBox* container) { m_container = container; } /** Returns the old container, for a focus change event. */ wxRichTextParagraphLayoutBox* GetOldContainer() const { return m_oldContainer; } /** Sets the old container, for a focus change event. */ void SetOldContainer(wxRichTextParagraphLayoutBox* container) { m_oldContainer = container; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxRichTextEvent(*this); } protected: int m_flags; long m_position; wxRichTextStyleSheet* m_oldStyleSheet; wxRichTextStyleSheet* m_newStyleSheet; wxRichTextRange m_range; wxChar m_char; wxRichTextParagraphLayoutBox* m_container; wxRichTextParagraphLayoutBox* m_oldContainer; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxRichTextEvent); }; /*! * wxRichTextCtrl events */ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_LEFT_CLICK, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_RIGHT_CLICK, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_MIDDLE_CLICK, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_LEFT_DCLICK, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_RETURN, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_CHARACTER, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_CONSUMING_CHARACTER, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_DELETE, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_STYLESHEET_CHANGING, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_STYLESHEET_CHANGED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_STYLESHEET_REPLACING, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_STYLESHEET_REPLACED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_CONTENT_INSERTED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_CONTENT_DELETED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_STYLE_CHANGED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_PROPERTIES_CHANGED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_SELECTION_CHANGED, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_BUFFER_RESET, wxRichTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED, wxRichTextEvent ); typedef void (wxEvtHandler::*wxRichTextEventFunction)(wxRichTextEvent&); #define wxRichTextEventHandler(func) \ wxEVENT_HANDLER_CAST(wxRichTextEventFunction, func) #define EVT_RICHTEXT_LEFT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_LEFT_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_RIGHT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_RIGHT_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_MIDDLE_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_MIDDLE_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_LEFT_DCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_LEFT_DCLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_RETURN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_RETURN, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_CHARACTER(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_CHARACTER, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_CONSUMING_CHARACTER(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_CONSUMING_CHARACTER, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_DELETE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_DELETE, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_STYLESHEET_CHANGING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_STYLESHEET_CHANGING, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_STYLESHEET_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_STYLESHEET_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_STYLESHEET_REPLACING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_STYLESHEET_REPLACING, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_STYLESHEET_REPLACED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_STYLESHEET_REPLACED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_CONTENT_INSERTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_CONTENT_INSERTED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_CONTENT_DELETED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_CONTENT_DELETED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_STYLE_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_STYLE_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_PROPERTIES_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_PROPERTIES_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_SELECTION_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_SELECTION_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_BUFFER_RESET(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_BUFFER_RESET, id, -1, wxRichTextEventHandler( fn ), NULL ), #define EVT_RICHTEXT_FOCUS_OBJECT_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_RICHTEXT_LEFT_CLICK wxEVT_RICHTEXT_LEFT_CLICK #define wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK wxEVT_RICHTEXT_RIGHT_CLICK #define wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK wxEVT_RICHTEXT_MIDDLE_CLICK #define wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK wxEVT_RICHTEXT_LEFT_DCLICK #define wxEVT_COMMAND_RICHTEXT_RETURN wxEVT_RICHTEXT_RETURN #define wxEVT_COMMAND_RICHTEXT_CHARACTER wxEVT_RICHTEXT_CHARACTER #define wxEVT_COMMAND_RICHTEXT_DELETE wxEVT_RICHTEXT_DELETE #define wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING wxEVT_RICHTEXT_STYLESHEET_CHANGING #define wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED wxEVT_RICHTEXT_STYLESHEET_CHANGED #define wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING wxEVT_RICHTEXT_STYLESHEET_REPLACING #define wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED wxEVT_RICHTEXT_STYLESHEET_REPLACED #define wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED wxEVT_RICHTEXT_CONTENT_INSERTED #define wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED wxEVT_RICHTEXT_CONTENT_DELETED #define wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED wxEVT_RICHTEXT_STYLE_CHANGED #define wxEVT_COMMAND_RICHTEXT_PROPERTIES_CHANGED wxEVT_RICHTEXT_PROPERTIES_CHANGED #define wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED wxEVT_RICHTEXT_SELECTION_CHANGED #define wxEVT_COMMAND_RICHTEXT_BUFFER_RESET wxEVT_RICHTEXT_BUFFER_RESET #define wxEVT_COMMAND_RICHTEXT_FOCUS_OBJECT_CHANGED wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED #endif // wxUSE_RICHTEXT #endif // _WX_RICHTEXTCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/movable.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/meta/movable.h // Purpose: Test if a type is movable using memmove() etc. // Author: Vaclav Slavik // Created: 2008-01-21 // Copyright: (c) 2008 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_MOVABLE_H_ #define _WX_META_MOVABLE_H_ #include "wx/meta/pod.h" #include "wx/string.h" // for wxIsMovable<wxString> specialization // Helper to decide if an object of type T is "movable", i.e. if it can be // copied to another memory location using memmove() or realloc() C functions. // C++ only gurantees that POD types (including primitive types) are // movable. template<typename T> struct wxIsMovable { static const bool value = wxIsPod<T>::value; }; // Macro to add wxIsMovable<T> specialization for given type that marks it // as movable: #define WX_DECLARE_TYPE_MOVABLE(type) \ template<> struct wxIsMovable<type> \ { \ static const bool value = true; \ }; // Our implementation of wxString is written in such way that it's safe to move // it around (unless position cache is used which unfortunately breaks this). // OTOH, we don't know anything about std::string. // (NB: we don't put this into string.h and choose to include wx/string.h from // here instead so that rarely-used wxIsMovable<T> code isn't included by // everything) #if !wxUSE_STD_STRING && !wxUSE_STRING_POS_CACHE WX_DECLARE_TYPE_MOVABLE(wxString) #endif #endif // _WX_META_MOVABLE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/int2type.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/meta/int2type.h // Purpose: Generate a unique type from a constant integer // Author: Arne Steinarson // Created: 2008-01-10 // Copyright: (c) 2008 Arne Steinarson // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_INT2TYPE_H_ #define _WX_META_INT2TYPE_H_ template <int N> struct wxInt2Type { enum { value=N }; }; #endif // _WX_META_INT2TYPE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/pod.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/meta/pod.h // Purpose: Test if a type is POD // Author: Vaclav Slavik, Jaakko Salli // Created: 2010-06-14 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_POD_H_ #define _WX_META_POD_H_ #include "wx/defs.h" // // TODO: Use TR1 is_pod<> implementation where available. VC9 SP1 has it // in tr1 namespace, VC10 has it in std namespace. GCC 4.2 has it in // <tr1/type_traits>, while GCC 4.3 and later have it in <type_traits>. // // Helper to decide if an object of type T is POD (Plain Old Data) template<typename T> struct wxIsPod { static const bool value = false; }; // Macro to add wxIsPod<T> specialization for given type that marks it // as Plain Old Data: #define WX_DECLARE_TYPE_POD(type) \ template<> struct wxIsPod<type> \ { \ static const bool value = true; \ }; WX_DECLARE_TYPE_POD(bool) WX_DECLARE_TYPE_POD(unsigned char) WX_DECLARE_TYPE_POD(signed char) WX_DECLARE_TYPE_POD(unsigned int) WX_DECLARE_TYPE_POD(signed int) WX_DECLARE_TYPE_POD(unsigned short int) WX_DECLARE_TYPE_POD(signed short int) WX_DECLARE_TYPE_POD(signed long int) WX_DECLARE_TYPE_POD(unsigned long int) WX_DECLARE_TYPE_POD(float) WX_DECLARE_TYPE_POD(double) WX_DECLARE_TYPE_POD(long double) #if wxWCHAR_T_IS_REAL_TYPE WX_DECLARE_TYPE_POD(wchar_t) #endif #ifdef wxLongLong_t WX_DECLARE_TYPE_POD(wxLongLong_t) WX_DECLARE_TYPE_POD(wxULongLong_t) #endif // pointers are Plain Old Data: template<typename T> struct wxIsPod<T*> { static const bool value = true; }; template<typename T> struct wxIsPod<const T*> { static const bool value = true; }; #endif // _WX_META_POD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/implicitconversion.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/meta/implicitconversion.h // Purpose: Determine resulting type from implicit conversion // Author: Vaclav Slavik // Created: 2010-10-22 // Copyright: (c) 2010 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_IMPLICITCONVERSION_H_ #define _WX_META_IMPLICITCONVERSION_H_ #include "wx/defs.h" #include "wx/meta/if.h" // C++ hierarchy of data types is: // // Long double (highest) // Double // Float // Unsigned long int // Long int // Unsigned int // Int (lowest) // // Types lower in the hierarchy are converted into ones higher up if both are // involved e.g. in arithmetic expressions. namespace wxPrivate { template<typename T> struct TypeHierarchy { // consider unknown types (e.g. objects, pointers) to be of highest // level, always convert to them if they occur static const int level = 9999; }; #define WX_TYPE_HIERARCHY_LEVEL(level_num, type) \ template<> struct TypeHierarchy<type> \ { \ static const int level = level_num; \ } WX_TYPE_HIERARCHY_LEVEL( 1, char); WX_TYPE_HIERARCHY_LEVEL( 2, unsigned char); WX_TYPE_HIERARCHY_LEVEL( 3, short); WX_TYPE_HIERARCHY_LEVEL( 4, unsigned short); WX_TYPE_HIERARCHY_LEVEL( 5, int); WX_TYPE_HIERARCHY_LEVEL( 6, unsigned int); WX_TYPE_HIERARCHY_LEVEL( 7, long); WX_TYPE_HIERARCHY_LEVEL( 8, unsigned long); #ifdef wxLongLong_t WX_TYPE_HIERARCHY_LEVEL( 9, wxLongLong_t); WX_TYPE_HIERARCHY_LEVEL(10, wxULongLong_t); #endif WX_TYPE_HIERARCHY_LEVEL(11, float); WX_TYPE_HIERARCHY_LEVEL(12, double); WX_TYPE_HIERARCHY_LEVEL(13, long double); #if wxWCHAR_T_IS_REAL_TYPE #if SIZEOF_WCHAR_T == SIZEOF_SHORT template<> struct TypeHierarchy<wchar_t> : public TypeHierarchy<short> {}; #elif SIZEOF_WCHAR_T == SIZEOF_INT template<> struct TypeHierarchy<wchar_t> : public TypeHierarchy<int> {}; #elif SIZEOF_WCHAR_T == SIZEOF_LONG template<> struct TypeHierarchy<wchar_t> : public TypeHierarchy<long> {}; #else #error "weird wchar_t size, please update this code" #endif #endif #undef WX_TYPE_HIERARCHY_LEVEL } // namespace wxPrivate // Helper to determine resulting type of implicit conversion in // an expression with two arithmetic types. template<typename T1, typename T2> struct wxImplicitConversionType { typedef typename wxIf < // if T2 is "higher" type, convert to it (int)(wxPrivate::TypeHierarchy<T1>::level) < (int)(wxPrivate::TypeHierarchy<T2>::level), T2, // otherwise use T1 T1 >::value value; }; template<typename T1, typename T2, typename T3> struct wxImplicitConversionType3 : public wxImplicitConversionType< T1, typename wxImplicitConversionType<T2,T3>::value> { }; #endif // _WX_META_IMPLICITCONVERSION_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/convertible.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/meta/convertible.h // Purpose: Test if types are convertible // Author: Arne Steinarson // Created: 2008-01-10 // Copyright: (c) 2008 Arne Steinarson // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_CONVERTIBLE_H_ #define _WX_META_CONVERTIBLE_H_ // // Introduce an extra class to make this header compilable with g++3.2 // template <class D, class B> struct wxConvertibleTo_SizeHelper { static char Match(B* pb); static int Match(...); }; // Helper to decide if an object of type D is convertible to type B (the test // succeeds in particular when D derives from B) template <class D, class B> struct wxConvertibleTo { enum { value = sizeof(wxConvertibleTo_SizeHelper<D,B>::Match(static_cast<D*>(NULL))) == sizeof(char) }; }; // This is similar to wxConvertibleTo, except that when using a C++11 compiler, // the case of D deriving from B non-publicly will be detected and the correct // value (false) will be deduced instead of getting a compile-time error as // with wxConvertibleTo. For pre-C++11 compilers there is no difference between // this helper and wxConvertibleTo. template <class D, class B> struct wxIsPubliclyDerived { enum { #if __cplusplus >= 201103 || (defined(_MSC_VER) && _MSC_VER >= 1600) // If C++11 is available we use this, as on most compilers it's a // built-in and will be evaluated at compile-time. value = std::is_base_of<B, D>::value && std::is_convertible<D*, B*>::value #else // When not using C++11, we fall back to wxConvertibleTo, which fails // at compile-time if D doesn't publicly derive from B. value = wxConvertibleTo<D, B>::value #endif }; }; #endif // _WX_META_CONVERTIBLE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/removeref.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/meta/removeref.h // Purpose: Allows to remove a reference from a type. // Author: Vadim Zeitlin // Created: 2012-10-21 // Copyright: (c) 2012 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_REMOVEREF_H_ #define _WX_META_REMOVEREF_H_ // wxRemoveRef<> is similar to C++11 std::remove_reference<> but works with all // compilers (but, to compensate for this, doesn't work with rvalue references). template <typename T> struct wxRemoveRef { typedef T type; }; template <typename T> struct wxRemoveRef<T&> { typedef T type; }; // Define this for compatibility with the previous versions in which // wxRemoveRef() wasn't always defined as we supported MSVC6 for which it // couldn't be implemented. #define wxHAS_REMOVEREF #endif // _WX_META_REMOVEREF_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/meta/if.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/meta/if.h // Purpose: declares wxIf<> metaprogramming construct // Author: Vaclav Slavik // Created: 2008-01-22 // Copyright: (c) 2008 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_META_IF_H_ #define _WX_META_IF_H_ #include "wx/defs.h" namespace wxPrivate { template <bool Cond> struct wxIfImpl; // specialization for true: template <> struct wxIfImpl<true> { template<typename TTrue, typename TFalse> struct Result { typedef TTrue value; }; }; // specialization for false: template<> struct wxIfImpl<false> { template<typename TTrue, typename TFalse> struct Result { typedef TFalse value; }; }; } // namespace wxPrivate // wxIf<> template defines nested type "value" which is the same as // TTrue if the condition Cond (boolean compile-time constant) was met and // TFalse if it wasn't. // // See wxVector<T> in vector.h for usage example template<bool Cond, typename TTrue, typename TFalse> struct wxIf { typedef typename wxPrivate::wxIfImpl<Cond> ::template Result<TTrue, TFalse>::value value; }; #endif // _WX_META_IF_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/advprops.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/advprops.h // Purpose: wxPropertyGrid Advanced Properties (font, colour, etc.) // Author: Jaakko Salli // Modified by: // Created: 2004-09-25 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_ADVPROPS_H_ #define _WX_PROPGRID_ADVPROPS_H_ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/propgrid/props.h" // ----------------------------------------------------------------------- // // Additional Value Type Handlers // bool WXDLLIMPEXP_PROPGRID operator==(const wxArrayInt& array1, const wxArrayInt& array2); // // Additional Property Editors // #if wxUSE_SPINBTN WX_PG_DECLARE_EDITOR_WITH_DECL(SpinCtrl,WXDLLIMPEXP_PROPGRID) #endif #if wxUSE_DATEPICKCTRL WX_PG_DECLARE_EDITOR_WITH_DECL(DatePickerCtrl,WXDLLIMPEXP_PROPGRID) #endif // ----------------------------------------------------------------------- // Web colour is currently unsupported #define wxPG_COLOUR_WEB_BASE 0x10000 //#define wxPG_TO_WEB_COLOUR(A) ((wxUint32)(A+wxPG_COLOUR_WEB_BASE)) #define wxPG_COLOUR_CUSTOM 0xFFFFFF #define wxPG_COLOUR_UNSPECIFIED (wxPG_COLOUR_CUSTOM+1) // Because text, background and other colours tend to differ between // platforms, wxSystemColourProperty must be able to select between system // colour and, when necessary, to pick a custom one. wxSystemColourProperty // value makes this possible. class WXDLLIMPEXP_PROPGRID wxColourPropertyValue : public wxObject { public: // An integer value relating to the colour, and which exact // meaning depends on the property with which it is used. // For wxSystemColourProperty: // Any of wxSYS_COLOUR_XXX, or any web-colour ( use wxPG_TO_WEB_COLOUR // macro - (currently unsupported) ), or wxPG_COLOUR_CUSTOM. // // For custom colour properties without values array specified: // index or wxPG_COLOUR_CUSTOM // For custom colour properties with values array specified: // m_arrValues[index] or wxPG_COLOUR_CUSTOM wxUint32 m_type; // Resulting colour. Should be correct regardless of type. wxColour m_colour; wxColourPropertyValue() : wxObject() { m_type = 0; } virtual ~wxColourPropertyValue() { } wxColourPropertyValue( const wxColourPropertyValue& v ) : wxObject() { m_type = v.m_type; m_colour = v.m_colour; } void Init( wxUint32 type, const wxColour& colour ) { m_type = type; m_colour = colour; } wxColourPropertyValue( const wxColour& colour ) : wxObject() { m_type = wxPG_COLOUR_CUSTOM; m_colour = colour; } wxColourPropertyValue( wxUint32 type ) : wxObject() { m_type = type; } wxColourPropertyValue( wxUint32 type, const wxColour& colour ) : wxObject() { Init( type, colour ); } void operator=(const wxColourPropertyValue& cpv) { if (this != &cpv) Init( cpv.m_type, cpv.m_colour ); } private: wxDECLARE_DYNAMIC_CLASS(wxColourPropertyValue); }; bool WXDLLIMPEXP_PROPGRID operator==(const wxColourPropertyValue&, const wxColourPropertyValue&); DECLARE_VARIANT_OBJECT_EXPORTED(wxColourPropertyValue, WXDLLIMPEXP_PROPGRID) // ----------------------------------------------------------------------- // Declare part of custom colour property macro pairs. #if wxUSE_IMAGE #include "wx/image.h" #endif // ----------------------------------------------------------------------- // Property representing wxFont. class WXDLLIMPEXP_PROPGRID wxFontProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxFontProperty) public: wxFontProperty(const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxFont& value = wxFont()); virtual ~wxFontProperty(); virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) wxOVERRIDE; virtual wxVariant ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const wxOVERRIDE; virtual void RefreshChildren() wxOVERRIDE; protected: }; // ----------------------------------------------------------------------- // If set, then match from list is searched for a custom colour. #define wxPG_PROP_TRANSLATE_CUSTOM wxPG_PROP_CLASS_SPECIFIC_1 // Has dropdown list of wxWidgets system colours. Value used is // of wxColourPropertyValue type. class WXDLLIMPEXP_PROPGRID wxSystemColourProperty : public wxEnumProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxSystemColourProperty) public: wxSystemColourProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxColourPropertyValue& value = wxColourPropertyValue() ); virtual ~wxSystemColourProperty(); virtual void OnSetValue() wxOVERRIDE; virtual bool IntToValue(wxVariant& variant, int number, int argFlags = 0) const wxOVERRIDE; // Override in derived class to customize how colours are printed as // strings. virtual wxString ColourToString( const wxColour& col, int index, int argFlags = 0 ) const; // Returns index of entry that triggers colour picker dialog // (default is last). virtual int GetCustomColourIndex() const; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; virtual wxSize OnMeasureImage( int item ) const wxOVERRIDE; virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ) wxOVERRIDE; // Helper function to show the colour dialog bool QueryColourFromUser( wxVariant& variant ) const; // Default is to use wxSystemSettings::GetColour(index). Override to use // custom colour tables etc. virtual wxColour GetColour( int index ) const; wxColourPropertyValue GetVal( const wxVariant* pVariant = NULL ) const; protected: // Special constructors to be used by derived classes. wxSystemColourProperty( const wxString& label, const wxString& name, const char* const* labels, const long* values, wxPGChoices* choicesCache, const wxColourPropertyValue& value ); wxSystemColourProperty( const wxString& label, const wxString& name, const char* const* labels, const long* values, wxPGChoices* choicesCache, const wxColour& value ); void Init( int type, const wxColour& colour ); // Utility functions for internal use virtual wxVariant DoTranslateVal( wxColourPropertyValue& v ) const; wxVariant TranslateVal( wxColourPropertyValue& v ) const { return DoTranslateVal( v ); } wxVariant TranslateVal( int type, const wxColour& colour ) const { wxColourPropertyValue v(type, colour); return DoTranslateVal( v ); } // Translates colour to a int value, return wxNOT_FOUND if no match. int ColToInd( const wxColour& colour ) const; }; // ----------------------------------------------------------------------- class WXDLLIMPEXP_PROPGRID wxColourProperty : public wxSystemColourProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxColourProperty) public: wxColourProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxColour& value = *wxWHITE ); virtual ~wxColourProperty(); virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual wxColour GetColour( int index ) const wxOVERRIDE; protected: virtual wxVariant DoTranslateVal( wxColourPropertyValue& v ) const wxOVERRIDE; private: void Init( wxColour colour ); }; // ----------------------------------------------------------------------- // Property representing wxCursor. class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty { wxDECLARE_DYNAMIC_CLASS(wxCursorProperty); wxCursorProperty( const wxString& label= wxPG_LABEL, const wxString& name= wxPG_LABEL, int value = 0 ); virtual ~wxCursorProperty(); virtual wxSize OnMeasureImage( int item ) const wxOVERRIDE; virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ) wxOVERRIDE; }; // ----------------------------------------------------------------------- #if wxUSE_IMAGE WXDLLIMPEXP_PROPGRID const wxString& wxPGGetDefaultImageWildcard(); // Property representing image file(name). class WXDLLIMPEXP_PROPGRID wxImageFileProperty : public wxFileProperty { wxDECLARE_DYNAMIC_CLASS(wxImageFileProperty); public: wxImageFileProperty( const wxString& label= wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString); virtual ~wxImageFileProperty(); virtual void OnSetValue() wxOVERRIDE; virtual wxSize OnMeasureImage( int item ) const wxOVERRIDE; virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ) wxOVERRIDE; protected: wxBitmap* m_pBitmap; // final thumbnail area wxImage* m_pImage; // intermediate thumbnail area private: // Initialize m_pImage using the current file name. void LoadImageFromFile(); }; #endif #if wxUSE_CHOICEDLG // Property that manages a value resulting from wxMultiChoiceDialog. Value is // array of strings. You can get value as array of choice values/indices by // calling wxMultiChoiceProperty::GetValueAsArrayInt(). class WXDLLIMPEXP_PROPGRID wxMultiChoiceProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxMultiChoiceProperty) public: wxMultiChoiceProperty( const wxString& label, const wxString& name, const wxArrayString& strings, const wxArrayString& value ); wxMultiChoiceProperty( const wxString& label, const wxString& name, const wxPGChoices& choices, const wxArrayString& value = wxArrayString() ); wxMultiChoiceProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxArrayString& value = wxArrayString() ); virtual ~wxMultiChoiceProperty(); virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue(wxVariant& variant, const wxString& text, int argFlags = 0) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) wxOVERRIDE; wxArrayInt GetValueAsArrayInt() const { return m_choices.GetValuesForStrings(m_value.GetArrayString()); } protected: void GenerateValueAsString( wxVariant& value, wxString* target ) const; // Returns translation of values into string indices. wxArrayInt GetValueAsIndices() const; wxArrayString m_valueAsStrings; // Value as array of strings // Cache displayed text since generating it is relatively complicated. wxString m_display; }; #endif // wxUSE_CHOICEDLG // ----------------------------------------------------------------------- #if wxUSE_DATETIME // Property representing wxDateTime. class WXDLLIMPEXP_PROPGRID wxDateProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxDateProperty) public: wxDateProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxDateTime& value = wxDateTime() ); virtual ~wxDateProperty(); virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue(wxVariant& variant, const wxString& text, int argFlags = 0) const wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; void SetFormat( const wxString& format ) { m_format = format; } const wxString& GetFormat() const { return m_format; } void SetDateValue( const wxDateTime& dt ) { //m_valueDateTime = dt; m_value = dt; } wxDateTime GetDateValue() const { //return m_valueDateTime; return m_value; } long GetDatePickerStyle() const { return m_dpStyle; } protected: wxString m_format; long m_dpStyle; // DatePicker style static wxString ms_defaultDateFormat; static wxString DetermineDefaultDateFormat( bool showCentury ); }; #endif // wxUSE_DATETIME // ----------------------------------------------------------------------- #if wxUSE_SPINBTN // // Implement an editor control that allows using wxSpinCtrl (actually, a // combination of wxTextCtrl and wxSpinButton) to edit value of wxIntProperty // and wxFloatProperty (and similar). // // Note that new editor classes needs to be registered before use. This can be // accomplished using wxPGRegisterEditorClass macro, which is used for SpinCtrl // in wxPropertyGridInterface::RegisterAdditionalEditors (see below). // Registration can also be performed in a constructor of a property that is // likely to require the editor in question. // #include "wx/spinbutt.h" #include "wx/propgrid/editors.h" // NOTE: Regardless that this class inherits from a working editor, it has // all necessary methods to work independently. wxTextCtrl stuff is only // used for event handling here. class WXDLLIMPEXP_PROPGRID wxPGSpinCtrlEditor : public wxPGTextCtrlEditor { wxDECLARE_DYNAMIC_CLASS(wxPGSpinCtrlEditor); public: virtual ~wxPGSpinCtrlEditor(); wxString GetName() const wxOVERRIDE; virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd, wxEvent& event ) const wxOVERRIDE; private: mutable wxString m_tempString; }; #endif // wxUSE_SPINBTN // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_ADVPROPS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/propgridiface.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/propgridiface.h // Purpose: wxPropertyGridInterface class // Author: Jaakko Salli // Modified by: // Created: 2008-08-24 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_PROPGRID_PROPGRIDIFACE_H__ #define __WX_PROPGRID_PROPGRIDIFACE_H__ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/propgrid/property.h" #include "wx/propgrid/propgridpagestate.h" // ----------------------------------------------------------------------- // Most property grid functions have this type as their argument, as it can // convey a property by either a pointer or name. class WXDLLIMPEXP_PROPGRID wxPGPropArgCls { public: wxPGPropArgCls( const wxPGProperty* property ) { m_ptr.property = (wxPGProperty*) property; m_flags = IsProperty; } wxPGPropArgCls( const wxString& str ) { m_ptr.stringName = &str; m_flags = IsWxString; } wxPGPropArgCls( const wxPGPropArgCls& id ) { m_ptr = id.m_ptr; m_flags = id.m_flags; } // This is only needed for wxPython bindings. wxPGPropArgCls( wxString* str, bool WXUNUSED(deallocPtr) ) { m_ptr.stringName = str; m_flags = IsWxString | OwnsWxString; } ~wxPGPropArgCls() { if ( m_flags & OwnsWxString ) delete m_ptr.stringName; } wxPGProperty* GetPtr() const { wxCHECK( m_flags == IsProperty, NULL ); return m_ptr.property; } wxPGPropArgCls( const char* str ) { m_ptr.charName = str; m_flags = IsCharPtr; } wxPGPropArgCls( const wchar_t* str ) { m_ptr.wcharName = str; m_flags = IsWCharPtr; } // This constructor is required for NULL. wxPGPropArgCls( int ) { m_ptr.property = NULL; m_flags = IsProperty; } wxPGProperty* GetPtr( wxPropertyGridInterface* iface ) const; wxPGProperty* GetPtr( const wxPropertyGridInterface* iface ) const { return GetPtr((wxPropertyGridInterface*)iface); } wxPGProperty* GetPtr0() const { return m_ptr.property; } bool HasName() const { return (m_flags != IsProperty); } const wxString& GetName() const { return *m_ptr.stringName; } private: enum { IsProperty = 0x00, IsWxString = 0x01, IsCharPtr = 0x02, IsWCharPtr = 0x04, OwnsWxString = 0x10 }; union { wxPGProperty* property; const char* charName; const wchar_t* wcharName; const wxString* stringName; } m_ptr; unsigned char m_flags; }; typedef const wxPGPropArgCls& wxPGPropArg; // ----------------------------------------------------------------------- WXDLLIMPEXP_PROPGRID void wxPGTypeOperationFailed( const wxPGProperty* p, const wxString& typestr, const wxString& op ); WXDLLIMPEXP_PROPGRID void wxPGGetFailed( const wxPGProperty* p, const wxString& typestr ); // ----------------------------------------------------------------------- // Helper macro that does necessary preparations when calling // some wxPGProperty's member function. #define wxPG_PROP_ARG_CALL_PROLOG_0(PROPERTY) \ PROPERTY *p = (PROPERTY*)id.GetPtr(this); \ if ( !p ) return; #define wxPG_PROP_ARG_CALL_PROLOG_RETVAL_0(PROPERTY, RETVAL) \ PROPERTY *p = (PROPERTY*)id.GetPtr(this); \ if ( !p ) return RETVAL; #define wxPG_PROP_ARG_CALL_PROLOG() \ wxPG_PROP_ARG_CALL_PROLOG_0(wxPGProperty) #define wxPG_PROP_ARG_CALL_PROLOG_RETVAL(RVAL) \ wxPG_PROP_ARG_CALL_PROLOG_RETVAL_0(wxPGProperty, RVAL) #define wxPG_PROP_ID_CONST_CALL_PROLOG() \ wxPG_PROP_ARG_CALL_PROLOG_0(const wxPGProperty) #define wxPG_PROP_ID_CONST_CALL_PROLOG_RETVAL(RVAL) \ wxPG_PROP_ARG_CALL_PROLOG_RETVAL_0(const wxPGProperty, RVAL) // ----------------------------------------------------------------------- // Most of the shared property manipulation interface shared by wxPropertyGrid, // wxPropertyGridPage, and wxPropertyGridManager is defined in this class. // In separate wxPropertyGrid component this class was known as // wxPropertyContainerMethods. // wxPropertyGridInterface's property operation member functions all accept // a special wxPGPropArg id argument, using which you can refer to properties // either by their pointer (for performance) or by their name (for conveniency). class WXDLLIMPEXP_PROPGRID wxPropertyGridInterface { public: // Destructor. virtual ~wxPropertyGridInterface() { } // Appends property to the list. // wxPropertyGrid assumes ownership of the object. // Becomes child of most recently added category. // wxPropertyGrid takes the ownership of the property pointer. // If appending a category with name identical to a category already in // the wxPropertyGrid, then newly created category is deleted, and most // recently added category (under which properties are appended) is set // to the one with same name. This allows easier adding of items to same // categories in multiple passes. // Does not automatically redraw the control, so you may need to call // Refresh when calling this function after control has been shown for // the first time. // This functions deselects selected property, if any. Validation // failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. // selection is cleared even if editor had invalid value. wxPGProperty* Append( wxPGProperty* property ); // Same as Append(), but appends under given parent property. wxPGProperty* AppendIn( wxPGPropArg id, wxPGProperty* newproperty ); // In order to add new items into a property with fixed children (for // instance, wxFlagsProperty), you need to call this method. After // populating has been finished, you need to call EndAddChildren. void BeginAddChildren( wxPGPropArg id ); // Deletes all properties. virtual void Clear() = 0; // Clears current selection, if any. // validation - If set to false, deselecting the property will always work, // even if its editor had invalid value in it. // Returns true if successful or if there was no selection. May // fail if validation was enabled and active editor had invalid // value. // In wxPropertyGrid 1.4, this member function used to send // wxPG_EVT_SELECTED. In wxWidgets 2.9 and later, it no longer // does that. bool ClearSelection( bool validation = false ); // Resets modified status of all properties. void ClearModifiedStatus(); // Collapses given category or property with children. // Returns true if actually collapses. bool Collapse( wxPGPropArg id ); // Collapses all items that can be collapsed. // Return false if failed (may fail if editor value cannot be validated). bool CollapseAll() { return ExpandAll(false); } // Changes value of a property, as if from an editor. // Use this instead of SetPropertyValue() if you need the value to run // through validation process, and also send the property change event. // Returns true if value was successfully changed. bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue ); // Removes and deletes a property and any children. // id - Pointer or name of a property. // If you delete a property in a wxPropertyGrid event // handler, the actual deletion is postponed until the next // idle event. // This functions deselects selected property, if any. // Validation failure option wxPG_VFB_STAY_IN_PROPERTY is not // respected, ie. selection is cleared even if editor had // invalid value. void DeleteProperty( wxPGPropArg id ); // Removes a property. Does not delete the property object, but // instead returns it. // id - Pointer or name of a property. // Removed property cannot have any children. // Also, if you remove property in a wxPropertyGrid event // handler, the actual removal is postponed until the next // idle event. wxPGProperty* RemoveProperty( wxPGPropArg id ); // Disables a property. bool DisableProperty( wxPGPropArg id ) { return EnableProperty(id,false); } // Returns true if all property grid data changes have been committed. // Usually only returns false if value in active editor has been // invalidated by a wxValidator. bool EditorValidate(); // Enables or disables property, depending on whether enable is true or // false. Disabled property usually appears as having grey text. // id - Name or pointer to a property. // enable - If false, property is disabled instead. bool EnableProperty( wxPGPropArg id, bool enable = true ); // Called after population of property with fixed children has finished. void EndAddChildren( wxPGPropArg id ); // Expands given category or property with children. // Returns true if actually expands. bool Expand( wxPGPropArg id ); // Expands all items that can be expanded. bool ExpandAll( bool expand = true ); // Returns id of first child of given property. // Does not return sub-properties! wxPGProperty* GetFirstChild( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullProperty) if ( !p->GetChildCount() || p->HasFlag(wxPG_PROP_AGGREGATE) ) return wxNullProperty; return p->Item(0); } // Returns iterator class instance. // flags - See wxPG_ITERATOR_FLAGS. Value wxPG_ITERATE_DEFAULT causes // iteration over everything except private child properties. // firstProp - Property to start iteration from. If NULL, then first // child of root is used. wxPropertyGridIterator GetIterator( int flags = wxPG_ITERATE_DEFAULT, wxPGProperty* firstProp = NULL ) { return wxPropertyGridIterator( m_pState, flags, firstProp ); } wxPropertyGridConstIterator GetIterator( int flags = wxPG_ITERATE_DEFAULT, wxPGProperty* firstProp = NULL ) const { return wxPropertyGridConstIterator( m_pState, flags, firstProp ); } // Returns iterator class instance. // flags - See wxPG_ITERATOR_FLAGS. Value wxPG_ITERATE_DEFAULT causes // iteration over everything except private child properties. // startPos - Either wxTOP or wxBOTTOM. wxTOP will indicate that iterations start // from the first property from the top, and wxBOTTOM means that the // iteration will instead begin from bottommost valid item. wxPropertyGridIterator GetIterator( int flags, int startPos ) { return wxPropertyGridIterator( m_pState, flags, startPos ); } wxPropertyGridConstIterator GetIterator( int flags, int startPos ) const { return wxPropertyGridConstIterator( m_pState, flags, startPos ); } // Returns id of first item that matches given criteria. wxPGProperty* GetFirst( int flags = wxPG_ITERATE_ALL ) { wxPropertyGridIterator it( m_pState, flags, wxNullProperty, 1 ); return *it; } const wxPGProperty* GetFirst( int flags = wxPG_ITERATE_ALL ) const { return ((wxPropertyGridInterface*)this)->GetFirst(flags); } // Returns pointer to a property with given name (case-sensitive). // If there is no property with such name, NULL pointer is returned. // Properties which have non-category, non-root parent // cannot be accessed globally by their name. Instead, use // "<property>.<subproperty>" instead of "<subproperty>". wxPGProperty* GetProperty( const wxString& name ) const { return GetPropertyByName(name); } // Returns map-like storage of property's attributes. // Note that if extra style wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set, // then builtin-attributes are not included in the storage. const wxPGAttributeStorage& GetPropertyAttributes( wxPGPropArg id ) const { // If 'id' refers to invalid property, then we will return dummy // attributes (i.e. root property's attributes, which contents should // should always be empty and of no consequence). wxPG_PROP_ARG_CALL_PROLOG_RETVAL(m_pState->DoGetRoot()->GetAttributes()); return p->GetAttributes(); } // Adds to 'targetArr' pointers to properties that have given // flags 'flags' set. However, if 'inverse' is set to true, then // only properties without given flags are stored. // flags - Property flags to use. // iterFlags - Iterator flags to use. Default is everything expect private children. void GetPropertiesWithFlag( wxArrayPGProperty* targetArr, wxPGProperty::FlagType flags, bool inverse = false, int iterFlags = wxPG_ITERATE_PROPERTIES | wxPG_ITERATE_HIDDEN | wxPG_ITERATE_CATEGORIES) const; // Returns value of given attribute. If none found, returns wxNullVariant. wxVariant GetPropertyAttribute( wxPGPropArg id, const wxString& attrName ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullVariant) return p->GetAttribute(attrName); } // Returns pointer of property's nearest parent category. If no category // found, returns NULL. wxPropertyCategory* GetPropertyCategory( wxPGPropArg id ) const { wxPG_PROP_ID_CONST_CALL_PROLOG_RETVAL(NULL) return m_pState->GetPropertyCategory(p); } // Returns client data (void*) of a property. void* GetPropertyClientData( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(NULL) return p->GetClientData(); } // Returns first property which label matches given string. // NULL if none found. Note that this operation is extremely slow when // compared to GetPropertyByName(). wxPGProperty* GetPropertyByLabel( const wxString& label ) const; // Returns pointer to a property with given name (case-sensitive). // If there is no property with such name, @NULL pointer is returned. wxPGProperty* GetPropertyByName( const wxString& name ) const; // Returns child property 'subname' of property 'name'. Same as // calling GetPropertyByName("name.subname"), albeit slightly faster. wxPGProperty* GetPropertyByName( const wxString& name, const wxString& subname ) const; // Returns property's editor. const wxPGEditor* GetPropertyEditor( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(NULL) return p->GetEditorClass(); } // Returns help string associated with a property. wxString GetPropertyHelpString( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxEmptyString) return p->GetHelpString(); } // Returns property's custom value image (NULL of none). wxBitmap* GetPropertyImage( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(NULL) return p->GetValueImage(); } // Returns label of a property. const wxString& GetPropertyLabel( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(m_emptyString) return p->GetLabel(); } // Returns name of a property, by which it is globally accessible. wxString GetPropertyName( wxPGProperty* property ) { return property->GetName(); } // Returns parent item of a property. wxPGProperty* GetPropertyParent( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullProperty) return p->GetParent(); } #if wxUSE_VALIDATORS // Returns validator of a property as a reference, which you // can pass to any number of SetPropertyValidator. wxValidator* GetPropertyValidator( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(NULL) return p->GetValidator(); } #endif // Returns value as wxVariant. To get wxObject pointer from it, // you will have to use WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) macro. // If property value is unspecified, wxNullVariant is returned. wxVariant GetPropertyValue( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxVariant()) return p->GetValue(); } wxString GetPropertyValueAsString( wxPGPropArg id ) const; long GetPropertyValueAsLong( wxPGPropArg id ) const; unsigned long GetPropertyValueAsULong( wxPGPropArg id ) const { return (unsigned long) GetPropertyValueAsLong(id); } int GetPropertyValueAsInt( wxPGPropArg id ) const { return (int)GetPropertyValueAsLong(id); } bool GetPropertyValueAsBool( wxPGPropArg id ) const; double GetPropertyValueAsDouble( wxPGPropArg id ) const; #define wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(PGTypeName, DEFVAL) \ wxPG_PROP_ARG_CALL_PROLOG_RETVAL(DEFVAL) \ wxVariant value = p->GetValue(); \ if ( !value.IsType(PGTypeName) ) \ { \ wxPGGetFailed(p, PGTypeName); \ return DEFVAL; \ } #define wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL_WFALLBACK(PGTypeName, DEFVAL) \ wxPG_PROP_ARG_CALL_PROLOG_RETVAL(DEFVAL) \ wxVariant value = p->GetValue(); \ if ( !value.IsType(PGTypeName) ) \ return DEFVAL; \ wxArrayString GetPropertyValueAsArrayString( wxPGPropArg id ) const { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxPG_VARIANT_TYPE_ARRSTRING, wxArrayString()) return value.GetArrayString(); } #if defined(wxLongLong_t) && wxUSE_LONGLONG wxLongLong_t GetPropertyValueAsLongLong( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(0) return p->GetValue().GetLongLong().GetValue(); } wxULongLong_t GetPropertyValueAsULongLong( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(0) return p->GetValue().GetULongLong().GetValue(); } #endif wxArrayInt GetPropertyValueAsArrayInt( wxPGPropArg id ) const { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxArrayInt_VariantType, wxArrayInt()) wxArrayInt arr; arr << value; return arr; } #if wxUSE_DATETIME wxDateTime GetPropertyValueAsDateTime( wxPGPropArg id ) const { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxPG_VARIANT_TYPE_DATETIME, wxDateTime()) return value.GetDateTime(); } #endif // Returns a wxVariant list containing wxVariant versions of all // property values. Order is not guaranteed. // flags - Use wxPG_KEEP_STRUCTURE to retain category structure; each sub // category will be its own wxVariantList of wxVariant. // Use wxPG_INC_ATTRIBUTES to include property attributes as well. // Each attribute will be stored as list variant named // "@<propname>@attr." wxVariant GetPropertyValues( const wxString& listname = wxEmptyString, wxPGProperty* baseparent = NULL, long flags = 0 ) const { return m_pState->DoGetPropertyValues(listname, baseparent, flags); } // Returns currently selected property. NULL if none. // When wxPG_EX_MULTIPLE_SELECTION extra style is used, this // member function returns the focused property, that is the // one which can have active editor. wxPGProperty* GetSelection() const; // Returns list of currently selected properties. // wxArrayPGProperty should be compatible with std::vector API. const wxArrayPGProperty& GetSelectedProperties() const { return m_pState->m_selection; } wxPropertyGridPageState* GetState() const { return m_pState; } // Similar to GetIterator(), but instead returns wxPGVIterator instance, // which can be useful for forward-iterating through arbitrary property // containers. // flags - See wxPG_ITERATOR_FLAGS. virtual wxPGVIterator GetVIterator( int flags ) const; // Hides or reveals a property. // hide - If true, hides property, otherwise reveals it. // flags - By default changes are applied recursively. Set this paramter // wxPG_DONT_RECURSE to prevent this. bool HideProperty( wxPGPropArg id, bool hide = true, int flags = wxPG_RECURSE ); #if wxPG_INCLUDE_ADVPROPS // Initializes *all* property types. Causes references to most object // files in the library, so calling this may cause significant increase // in executable size when linking with static library. static void InitAllTypeHandlers(); #else static void InitAllTypeHandlers() { } #endif // Inserts property to the property container. // priorThis - New property is inserted just prior to this. Available only // in the first variant. There are two versions of this function // to allow this parameter to be either an id or name to // a property. // newproperty - Pointer to the inserted property. wxPropertyGrid will take // ownership of this object. // Returns id for the property, // wxPropertyGrid takes the ownership of the property pointer. // While Append may be faster way to add items, make note that when // both types of data storage (categoric and // non-categoric) are active, Insert becomes even more slow. This is // especially true if current mode is non-categoric. // Example of use: // // append category // wxPGProperty* my_cat_id = propertygrid->Append( // new wxPropertyCategory("My Category") ); // ... // // insert into category - using second variant // wxPGProperty* my_item_id_1 = propertygrid->Insert( // my_cat_id, 0, new wxStringProperty("My String 1") ); // // insert before to first item - using first variant // wxPGProperty* my_item_id_2 = propertygrid->Insert( // my_item_id, new wxStringProperty("My String 2") ); wxPGProperty* Insert( wxPGPropArg priorThis, wxPGProperty* newproperty ); // Inserts property to the property container. //See the other overload for more details. // parent - New property is inserted under this category. Available only // in the second variant. There are two versions of this function // to allow this parameter to be either an id or name to // a property. // index - Index under category. Available only in the second variant. // If index is < 0, property is appended in category. // newproperty - Pointer to the inserted property. wxPropertyGrid will take // ownership of this object. // Returns id for the property. wxPGProperty* Insert( wxPGPropArg parent, int index, wxPGProperty* newproperty ); // Returns true if property is a category. bool IsPropertyCategory( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return p->IsCategory(); } // Returns true if property is enabled. bool IsPropertyEnabled( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return !p->HasFlag(wxPG_PROP_DISABLED); } // Returns true if given property is expanded. // Naturally, always returns false for properties that cannot be expanded. bool IsPropertyExpanded( wxPGPropArg id ) const; // Returns true if property has been modified after value set or modify // flag clear by software. bool IsPropertyModified( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) #if WXWIN_COMPATIBILITY_3_0 return p->HasFlag(wxPG_PROP_MODIFIED)?true:false; #else return p->HasFlag(wxPG_PROP_MODIFIED); #endif } // Returns true if property is selected. bool IsPropertySelected( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return m_pState->DoIsPropertySelected(p); } // Returns true if property is shown (i.e. HideProperty with true not // called for it). bool IsPropertyShown( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return !p->HasFlag(wxPG_PROP_HIDDEN); } // Returns true if property value is set to unspecified. bool IsPropertyValueUnspecified( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return p->IsValueUnspecified(); } // Disables (limit = true) or enables (limit = false) wxTextCtrl editor // of a property, if it is not the sole mean to edit the value. void LimitPropertyEditing( wxPGPropArg id, bool limit = true ); // If state is shown in it's grid, refresh it now. virtual void RefreshGrid( wxPropertyGridPageState* state = NULL ); #if wxPG_INCLUDE_ADVPROPS // Initializes additional property editors (SpinCtrl etc.). Causes // references to most object files in the library, so calling this may // cause significant increase in executable size when linking with static // library. static void RegisterAdditionalEditors(); #else static void RegisterAdditionalEditors() { } #endif // Replaces property with id with newly created property. For example, // this code replaces existing property named "Flags" with one that // will have different set of items: // pg->ReplaceProperty("Flags", // wxFlagsProperty("Flags", wxPG_LABEL, newItems)) // For more info, see wxPropertyGrid::Insert. wxPGProperty* ReplaceProperty( wxPGPropArg id, wxPGProperty* property ); // Flags for wxPropertyGridInterface::SaveEditableState() // and wxPropertyGridInterface::RestoreEditableState(). enum EditableStateFlags { // Include selected property. SelectionState = 0x01, // Include expanded/collapsed property information. ExpandedState = 0x02, // Include scrolled position. ScrollPosState = 0x04, // Include selected page information. // Only applies to wxPropertyGridManager. PageState = 0x08, // Include splitter position. Stored for each page. SplitterPosState = 0x10, // Include description box size. // Only applies to wxPropertyGridManager. DescBoxState = 0x20, // Include all supported user editable state information. // This is usually the default value. AllStates = SelectionState | ExpandedState | ScrollPosState | PageState | SplitterPosState | DescBoxState }; // Restores user-editable state. // See also wxPropertyGridInterface::SaveEditableState(). // src - String generated by SaveEditableState. // restoreStates - Which parts to restore from source string. See @ref // propgridinterface_editablestate_flags "list of editable state // flags". // Returns false if there was problem reading the string. // If some parts of state (such as scrolled or splitter position) fail to // restore correctly, please make sure that you call this function after // wxPropertyGrid size has been set (this may sometimes be tricky when // sizers are used). bool RestoreEditableState( const wxString& src, int restoreStates = AllStates ); // Used to acquire user-editable state (selected property, expanded // properties, scrolled position, splitter positions). // includedStates - Which parts of state to include. See EditableStateFlags. wxString SaveEditableState( int includedStates = AllStates ) const; // Lets user set the strings listed in the choice dropdown of a // wxBoolProperty. Defaults are "True" and "False", so changing them to, // say, "Yes" and "No" may be useful in some less technical applications. static void SetBoolChoices( const wxString& trueChoice, const wxString& falseChoice ); // Set proportion of a auto-stretchable column. wxPG_SPLITTER_AUTO_CENTER // window style needs to be used to indicate that columns are auto- // resizable. // Returns false on failure. // You should call this for individual pages of wxPropertyGridManager // (if used). bool SetColumnProportion( unsigned int column, int proportion ); // Returns auto-resize proportion of the given column. int GetColumnProportion( unsigned int column ) const { return m_pState->DoGetColumnProportion(column); } // Sets an attribute for this property. // name - Text identifier of attribute. See @ref propgrid_property_attributes. // value - Value of attribute. // argFlags - Optional. Use wxPG_RECURSE to set the attribute to child // properties recursively. // Setting attribute's value to wxNullVariant will simply remove it // from property's set of attributes. void SetPropertyAttribute( wxPGPropArg id, const wxString& attrName, wxVariant value, long argFlags = 0 ) { DoSetPropertyAttribute(id,attrName,value,argFlags); } // Sets property attribute for all applicable properties. // Be sure to use this method only after all properties have been // added to the grid. void SetPropertyAttributeAll( const wxString& attrName, wxVariant value ); // Sets background colour of a property. // id - Property name or pointer. // colour - New background colour. // flags - Default is wxPG_RECURSE which causes colour to be set recursively. // Omit this flag to only set colour for the property in question // and not any of its children. void SetPropertyBackgroundColour( wxPGPropArg id, const wxColour& colour, int flags = wxPG_RECURSE ); // Resets text and background colours of given property. // id - Property name or pointer. // flags - Default is wxPG_DONT_RECURSE which causes colour to be reset // only for the property in question (for backward compatibility). #if WXWIN_COMPATIBILITY_3_0 void SetPropertyColoursToDefault(wxPGPropArg id); void SetPropertyColoursToDefault(wxPGPropArg id, int flags); #else void SetPropertyColoursToDefault(wxPGPropArg id, int flags = wxPG_DONT_RECURSE); #endif // WXWIN_COMPATIBILITY_3_0 // Sets text colour of a property. // id - Property name or pointer. // colour - New background colour. // flags - Default is wxPG_RECURSE which causes colour to be set recursively. // Omit this flag to only set colour for the property in question // and not any of its children. void SetPropertyTextColour( wxPGPropArg id, const wxColour& col, int flags = wxPG_RECURSE ); // Returns background colour of first cell of a property. wxColour GetPropertyBackgroundColour( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxColour()) return p->GetCell(0).GetBgCol(); } // Returns text colour of first cell of a property. wxColour GetPropertyTextColour( wxPGPropArg id ) const { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxColour()) return p->GetCell(0).GetFgCol(); } // Sets text, bitmap, and colours for given column's cell. // You can set label cell by setting column to 0. // You can use wxPG_LABEL as text to use default text for column. void SetPropertyCell( wxPGPropArg id, int column, const wxString& text = wxEmptyString, const wxBitmap& bitmap = wxNullBitmap, const wxColour& fgCol = wxNullColour, const wxColour& bgCol = wxNullColour ); // Sets client data (void*) of a property. // This untyped client data has to be deleted manually. void SetPropertyClientData( wxPGPropArg id, void* clientData ) { wxPG_PROP_ARG_CALL_PROLOG() p->SetClientData(clientData); } // Sets editor for a property. // editor - For builtin editors, use wxPGEditor_X, where X is builtin editor's // name (TextCtrl, Choice, etc. see wxPGEditor documentation for full // list). // For custom editors, use pointer you received from // wxPropertyGrid::RegisterEditorClass(). void SetPropertyEditor( wxPGPropArg id, const wxPGEditor* editor ) { wxPG_PROP_ARG_CALL_PROLOG() wxCHECK_RET( editor, wxS("unknown/NULL editor") ); p->SetEditor(editor); RefreshProperty(p); } // Sets editor control of a property. As editor argument, use // editor name string, such as "TextCtrl" or "Choice". void SetPropertyEditor( wxPGPropArg id, const wxString& editorName ) { SetPropertyEditor(id,GetEditorByName(editorName)); } // Sets label of a property. // Properties under same parent may have same labels. However, // property names must still remain unique. void SetPropertyLabel( wxPGPropArg id, const wxString& newproplabel ); // Sets name of a property. // id - Name or pointer of property which name to change. // newName - New name for property. void SetPropertyName( wxPGPropArg id, const wxString& newName ) { wxPG_PROP_ARG_CALL_PROLOG() m_pState->DoSetPropertyName( p, newName ); } // Sets property (and, recursively, its children) to have read-only value. // In other words, user cannot change the value in the editor, but they // can still copy it. // This is mainly for use with textctrl editor. Not all other editors fully // support it. // By default changes are applied recursively. Set parameter "flags" // to wxPG_DONT_RECURSE to prevent this. void SetPropertyReadOnly( wxPGPropArg id, bool set = true, int flags = wxPG_RECURSE ); // Sets property's value to unspecified. // If it has children (it may be category), then the same thing is done to // them. void SetPropertyValueUnspecified( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG() p->SetValueToUnspecified(); } // Sets property values from a list of wxVariants. void SetPropertyValues( const wxVariantList& list, wxPGPropArg defaultCategory = wxNullProperty ) { wxPGProperty *p; if ( defaultCategory.HasName() ) p = defaultCategory.GetPtr(this); else p = defaultCategory.GetPtr0(); m_pState->DoSetPropertyValues(list, p); } // Sets property values from a list of wxVariants. void SetPropertyValues( const wxVariant& list, wxPGPropArg defaultCategory = wxNullProperty ) { SetPropertyValues(list.GetList(),defaultCategory); } // Associates the help string with property. // By default, text is shown either in the manager's "description" // text box or in the status bar. If extra window style // wxPG_EX_HELP_AS_TOOLTIPS is used, then the text will appear as a // tooltip. void SetPropertyHelpString( wxPGPropArg id, const wxString& helpString ) { wxPG_PROP_ARG_CALL_PROLOG() p->SetHelpString(helpString); } // Set wxBitmap in front of the value. // Bitmap will be scaled to a size returned by // wxPropertyGrid::GetImageSize(); void SetPropertyImage( wxPGPropArg id, wxBitmap& bmp ) { wxPG_PROP_ARG_CALL_PROLOG() p->SetValueImage(bmp); RefreshProperty(p); } // Sets max length of property's text. bool SetPropertyMaxLength( wxPGPropArg id, int maxLen ); #if wxUSE_VALIDATORS // Sets validator of a property. void SetPropertyValidator( wxPGPropArg id, const wxValidator& validator ) { wxPG_PROP_ARG_CALL_PROLOG() p->SetValidator(validator); } #endif // Sets value (long integer) of a property. void SetPropertyValue( wxPGPropArg id, long value ) { wxVariant v(value); SetPropVal( id, v ); } // Sets value (integer) of a property. void SetPropertyValue( wxPGPropArg id, int value ) { wxVariant v((long)value); SetPropVal( id, v ); } // Sets value (floating point) of a property. void SetPropertyValue( wxPGPropArg id, double value ) { wxVariant v(value); SetPropVal( id, v ); } // Sets value (bool) of a property. void SetPropertyValue( wxPGPropArg id, bool value ) { wxVariant v(value); SetPropVal( id, v ); } // Sets value (wchar_t*) of a property. void SetPropertyValue( wxPGPropArg id, const wchar_t* value ) { SetPropertyValueString( id, wxString(value) ); } // Sets value (char*) of a property. void SetPropertyValue( wxPGPropArg id, const char* value ) { SetPropertyValueString( id, wxString(value) ); } // Sets value (string) of a property. void SetPropertyValue( wxPGPropArg id, const wxString& value ) { SetPropertyValueString( id, value ); } // Sets value (wxArrayString) of a property. void SetPropertyValue( wxPGPropArg id, const wxArrayString& value ) { wxVariant v(value); SetPropVal( id, v ); } #if wxUSE_DATETIME // Sets value (wxDateTime) of a property. void SetPropertyValue( wxPGPropArg id, const wxDateTime& value ) { wxVariant v(value); SetPropVal( id, v ); } #endif // Sets value (wxObject*) of a property. void SetPropertyValue( wxPGPropArg id, wxObject* value ) { wxVariant v(value); SetPropVal( id, v ); } // Sets value (wxObject&) of a property. void SetPropertyValue( wxPGPropArg id, wxObject& value ) { wxVariant v(&value); SetPropVal( id, v ); } #if wxUSE_LONGLONG #ifdef wxLongLong_t // Sets value (native 64-bit int) of a property. void SetPropertyValue(wxPGPropArg id, wxLongLong_t value) { wxVariant v = WXVARIANT(wxLongLong(value)); SetPropVal(id, v); } #endif // Sets value (wxLongLong) of a property. void SetPropertyValue( wxPGPropArg id, wxLongLong value ) { wxVariant v = WXVARIANT(value); SetPropVal( id, v ); } #ifdef wxULongLong_t // Sets value (native 64-bit unsigned int) of a property. void SetPropertyValue(wxPGPropArg id, wxULongLong_t value) { wxVariant v = WXVARIANT(wxULongLong(value)); SetPropVal(id, v); } #endif // Sets value (wxULongLong) of a property. void SetPropertyValue( wxPGPropArg id, wxULongLong value ) { wxVariant v = WXVARIANT(value); SetPropVal( id, v ); } #endif // Sets value (wxArrayInt&) of a property. void SetPropertyValue( wxPGPropArg id, const wxArrayInt& value ) { wxVariant v = WXVARIANT(value); SetPropVal( id, v ); } // Sets value (wxString) of a property. // This method uses wxPGProperty::SetValueFromString, which all properties // should implement. This means that there should not be a type error, // and instead the string is converted to property's actual value type. void SetPropertyValueString( wxPGPropArg id, const wxString& value ); // Sets value (wxVariant) of a property. // Use wxPropertyGrid::ChangePropertyValue() instead if you need to run // through validation process and send property change event. void SetPropertyValue( wxPGPropArg id, wxVariant value ) { SetPropVal( id, value ); } // Sets value (wxVariant&) of a property. Same as SetPropertyValue, // but accepts reference. void SetPropVal( wxPGPropArg id, wxVariant& value ); // Adjusts how wxPropertyGrid behaves when invalid value is entered // in a property. // vfbFlags - See wxPG_VALIDATION_FAILURE_BEHAVIOR_FLAGS for possible values. void SetValidationFailureBehavior( int vfbFlags ); // Sorts all properties recursively. // flags - This can contain any of the following options: // wxPG_SORT_TOP_LEVEL_ONLY: Only sort categories and their // immediate children. Sorting done by wxPG_AUTO_SORT option // uses this. // See SortChildren, wxPropertyGrid::SetSortFunction void Sort( int flags = 0 ); // Sorts children of a property. // id - Name or pointer to a property. // flags - This can contain any of the following options: // wxPG_RECURSE: Sorts recursively. // See Sort, wxPropertyGrid::SetSortFunction void SortChildren( wxPGPropArg id, int flags = 0 ) { wxPG_PROP_ARG_CALL_PROLOG() m_pState->DoSortChildren(p, flags); } // GetPropertyByName() with nice assertion error message. wxPGProperty* GetPropertyByNameA( const wxString& name ) const; // Returns editor pointer of editor with given name. static wxPGEditor* GetEditorByName( const wxString& editorName ); // NOTE: This function reselects the property and may cause // excess flicker, so to just call Refresh() on a rect // of single property, call DrawItem() instead. virtual void RefreshProperty( wxPGProperty* p ) = 0; protected: bool DoClearSelection( bool validation = false, int selFlags = 0 ); // In derived class, implement to set editable state component with // given name to given value. virtual bool SetEditableStateItem( const wxString& name, wxVariant value ) { wxUnusedVar(name); wxUnusedVar(value); return false; } // In derived class, implement to return editable state component with // given name. virtual wxVariant GetEditableStateItem( const wxString& name ) const { wxUnusedVar(name); return wxNullVariant; } // Returns page state data for given (sub) page (-1 means current page). virtual wxPropertyGridPageState* GetPageState( int pageIndex ) const { if ( pageIndex <= 0 ) return m_pState; return NULL; } virtual bool DoSelectPage( int WXUNUSED(index) ) { return true; } // Default call's m_pState's BaseGetPropertyByName virtual wxPGProperty* DoGetPropertyByName( const wxString& name ) const; // Deriving classes must set this (it must be only or current page). wxPropertyGridPageState* m_pState; // Intermediate version needed due to wxVariant copying inefficiency void DoSetPropertyAttribute( wxPGPropArg id, const wxString& name, wxVariant& value, long argFlags ); // Empty string object to return from member functions returning const // wxString&. wxString m_emptyString; private: // Cannot be GetGrid() due to ambiguity issues. wxPropertyGrid* GetPropertyGrid() { if ( !m_pState ) return NULL; return m_pState->GetGrid(); } // Cannot be GetGrid() due to ambiguity issues. const wxPropertyGrid* GetPropertyGrid() const { if ( !m_pState ) return NULL; return m_pState->GetGrid(); } friend class wxPropertyGrid; friend class wxPropertyGridManager; }; #endif // wxUSE_PROPGRID #endif // __WX_PROPGRID_PROPGRIDIFACE_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/manager.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/manager.h // Purpose: wxPropertyGridManager // Author: Jaakko Salli // Modified by: // Created: 2005-01-14 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_MANAGER_H_ #define _WX_PROPGRID_MANAGER_H_ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/propgrid/propgrid.h" #include "wx/dcclient.h" #include "wx/scrolwin.h" #include "wx/toolbar.h" #include "wx/stattext.h" #include "wx/button.h" #include "wx/textctrl.h" #include "wx/dialog.h" #include "wx/headerctrl.h" // ----------------------------------------------------------------------- #ifndef SWIG extern WXDLLIMPEXP_DATA_PROPGRID(const char) wxPropertyGridManagerNameStr[]; #endif // Holder of property grid page information. You can subclass this and // give instance in wxPropertyGridManager::AddPage. It inherits from // wxEvtHandler and can be used to process events specific to this // page (id of events will still be same as manager's). If you don't // want to use it to process all events of the page, you need to // return false in the derived wxPropertyGridPage::IsHandlingAllEvents. // // Please note that wxPropertyGridPage lacks many non-const property // manipulation functions found in wxPropertyGridManager. Please use // parent manager (m_manager member variable) when needed. // // Please note that most member functions are inherited and as such not // documented on this page. This means you will probably also want to read // wxPropertyGridInterface class reference. // // wxPropertyGridPage receives events emitted by its wxPropertyGridManager, but // only those events that are specific to that page. If // wxPropertyGridPage::IsHandlingAllEvents returns false, then unhandled // events are sent to the manager's parent, as usual. class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler, public wxPropertyGridInterface, public wxPropertyGridPageState { friend class wxPropertyGridManager; wxDECLARE_CLASS(wxPropertyGridPage); public: wxPropertyGridPage(); virtual ~wxPropertyGridPage(); // Deletes all properties on page. virtual void Clear() wxOVERRIDE; // Reduces column sizes to minimum possible that contents are still // visibly (naturally some margin space will be applied as well). // Returns minimum size for the page to still display everything. // This function only works properly if size of containing grid was // already fairly large. // Note that you can also get calculated column widths by calling // GetColumnWidth() immediately after this function returns. wxSize FitColumns(); // Returns page index in manager; inline int GetIndex() const; // Returns x-coordinate position of splitter on a page. int GetSplitterPosition( int col = 0 ) const { return GetStatePtr()->DoGetSplitterPosition(col); } // Returns "root property". It does not have name, etc. and it is not // visible. It is only useful for accessing its children. wxPGProperty* GetRoot() const { return GetStatePtr()->DoGetRoot(); } // Returns pointer to contained property grid state. wxPropertyGridPageState* GetStatePtr() { return this; } // Returns pointer to contained property grid state. const wxPropertyGridPageState* GetStatePtr() const { return this; } // Returns id of the tool bar item that represents this page on // wxPropertyGridManager's wxToolBar. int GetToolId() const { return m_toolId; } // Do any member initialization in this method. // Notes: // - Called every time the page is added into a manager. // - You can add properties to the page here. virtual void Init() {} // Return false here to indicate unhandled events should be // propagated to manager's parent, as normal. virtual bool IsHandlingAllEvents() const { return true; } // Called every time page is about to be shown. // Useful, for instance, creating properties just-in-time. virtual void OnShow(); // Refreshes given property on page. virtual void RefreshProperty( wxPGProperty* p ) wxOVERRIDE; // Sets splitter position on page. // Splitter position cannot exceed grid size, and therefore setting it // during form creation may fail as initial grid size is often smaller // than desired splitter position, especially when sizers are being used. void SetSplitterPosition( int splitterPos, int col = 0 ); #if WXWIN_COMPATIBILITY_3_0 // To avoid ambiguity between functions inherited // from both wxPropertyGridInterface and wxPropertyGridPageState using wxPropertyGridInterface::GetPropertyByLabel; #endif // WXWIN_COMPATIBILITY_3_0 protected: // Propagate to other pages. virtual void DoSetSplitterPosition( int pos, int splitterColumn = 0, int flags = wxPG_SPLITTER_REFRESH ) wxOVERRIDE; // Page label (may be referred as name in some parts of documentation). // Can be set in constructor, or passed in // wxPropertyGridManager::AddPage(), but *not* in both. wxString m_label; //virtual bool ProcessEvent( wxEvent& event ); wxPropertyGridManager* m_manager; // Toolbar tool id. Note that this is only valid when the tool bar // exists. int m_toolId; private: bool m_isDefault; // is this base page object? wxDECLARE_EVENT_TABLE(); }; // ----------------------------------------------------------------------- #if wxUSE_HEADERCTRL class wxPGHeaderCtrl; #endif // wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, // which can optionally have toolbar for mode and page selection, and help // text box. // Use window flags to select components to include. class WXDLLIMPEXP_PROPGRID wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface { wxDECLARE_CLASS(wxPropertyGridManager); friend class wxPropertyGridPage; public: #ifndef SWIG // Two step constructor. // Call Create when this constructor is called to build up the // wxPropertyGridManager. wxPropertyGridManager(); #endif // The default constructor. The styles to be used are styles valid for // the wxWindow. wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPGMAN_DEFAULT_STYLE, const wxString& name = wxPropertyGridManagerNameStr ); // Destructor. virtual ~wxPropertyGridManager(); // Creates new property page. Note that the first page is not created // automatically. // label - A label for the page. This may be shown as a toolbar tooltip etc. // bmp - Bitmap image for toolbar. If wxNullBitmap is used, then a built-in // default image is used. // pageObj - wxPropertyGridPage instance. Manager will take ownership of this object. // NULL indicates that a default page instance should be created. // Returns pointer to created page. // If toolbar is used, it is highly recommended that the pages are // added when the toolbar is not turned off using window style flag // switching. wxPropertyGridPage* AddPage( const wxString& label = wxEmptyString, const wxBitmap& bmp = wxNullBitmap, wxPropertyGridPage* pageObj = NULL ) { return InsertPage(-1, label, bmp, pageObj); } // Deletes all all properties and all pages. virtual void Clear() wxOVERRIDE; // Deletes all properties on given page. void ClearPage( int page ); // Forces updating the value of property from the editor control. // Returns true if DoPropertyChanged was actually called. bool CommitChangesFromEditor( wxUint32 flags = 0 ) { return m_pPropGrid->CommitChangesFromEditor(flags); } // Two step creation. // Whenever the control is created without any parameters, use Create to // actually create it. Don't access the control's public methods before // this is called. bool Create( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPGMAN_DEFAULT_STYLE, const wxString& name = wxPropertyGridManagerNameStr ); // Enables or disables (shows/hides) categories according to parameter // enable. // Calling this may not properly update toolbar buttons. bool EnableCategories( bool enable ) { long fl = m_windowStyle | wxPG_HIDE_CATEGORIES; if ( enable ) fl = m_windowStyle & ~(wxPG_HIDE_CATEGORIES); SetWindowStyleFlag(fl); return true; } // Selects page, scrolls and/or expands items to ensure that the // given item is visible. Returns true if something was actually done. bool EnsureVisible( wxPGPropArg id ); // Returns number of columns on given page. By the default, // returns number of columns on current page. int GetColumnCount( int page = -1 ) const; // Returns height of the description text box. int GetDescBoxHeight() const; // Returns pointer to the contained wxPropertyGrid. This does not change // after wxPropertyGridManager has been created, so you can safely obtain // pointer once and use it for the entire lifetime of the manager instance. wxPropertyGrid* GetGrid() { wxASSERT(m_pPropGrid); return m_pPropGrid; } const wxPropertyGrid* GetGrid() const { wxASSERT(m_pPropGrid); return (const wxPropertyGrid*)m_pPropGrid; } // Returns iterator class instance. // Calling this method in wxPropertyGridManager causes run-time assertion // failure. Please only iterate through individual pages or use // CreateVIterator(). wxPropertyGridIterator GetIterator( int flags = wxPG_ITERATE_DEFAULT, wxPGProperty* firstProp = NULL ) { wxFAIL_MSG( wxS("Please only iterate through individual pages ") wxS("or use CreateVIterator()") ); return wxPropertyGridInterface::GetIterator( flags, firstProp ); } wxPropertyGridConstIterator GetIterator(int flags = wxPG_ITERATE_DEFAULT, wxPGProperty* firstProp = NULL) const { wxFAIL_MSG( wxS("Please only iterate through individual pages ") wxS("or use CreateVIterator()") ); return wxPropertyGridInterface::GetIterator( flags, firstProp ); } // Returns iterator class instance. // Calling this method in wxPropertyGridManager causes run-time assertion // failure. Please only iterate through individual pages or use // CreateVIterator(). wxPropertyGridIterator GetIterator( int flags, int startPos ) { wxFAIL_MSG( wxS("Please only iterate through individual pages ") wxS("or use CreateVIterator()") ); return wxPropertyGridInterface::GetIterator( flags, startPos ); } wxPropertyGridConstIterator GetIterator( int flags, int startPos ) const { wxFAIL_MSG( wxS("Please only iterate through individual pages ") wxS("or use CreateVIterator()") ); return wxPropertyGridInterface::GetIterator( flags, startPos ); } // Similar to GetIterator, but instead returns wxPGVIterator instance, // which can be useful for forward-iterating through arbitrary property // containers. virtual wxPGVIterator GetVIterator( int flags ) const wxOVERRIDE; // Returns currently selected page. wxPropertyGridPage* GetCurrentPage() const { return GetPage(m_selPage); } // Returns page object for given page index. wxPropertyGridPage* GetPage( unsigned int ind ) const { return m_arrPages[ind]; } // Returns page object for given page name. wxPropertyGridPage* GetPage( const wxString& name ) const { return GetPage(GetPageByName(name)); } // Returns index for a page name. // If no match is found, wxNOT_FOUND is returned. int GetPageByName( const wxString& name ) const; // Returns index for a relevant propertygrid state. // If no match is found, wxNOT_FOUND is returned. int GetPageByState( const wxPropertyGridPageState* pstate ) const; protected: // Returns wxPropertyGridPageState of given page, current page's for -1. virtual wxPropertyGridPageState* GetPageState( int page ) const wxOVERRIDE; public: // Returns number of managed pages. size_t GetPageCount() const; // Returns name of given page. const wxString& GetPageName( int index ) const; // Returns "root property" of the given page. It does not have name, etc. // and it is not visible. It is only useful for accessing its children. wxPGProperty* GetPageRoot( int index ) const; // Returns index to currently selected page. int GetSelectedPage() const { return m_selPage; } // Alias for GetSelection(). wxPGProperty* GetSelectedProperty() const { return GetSelection(); } // Shortcut for GetGrid()->GetSelection(). wxPGProperty* GetSelection() const { return m_pPropGrid->GetSelection(); } #if wxUSE_TOOLBAR // Returns a pointer to the toolbar currently associated with the // wxPropertyGridManager (if any). wxToolBar* GetToolBar() const { return m_pToolbar; } #endif // wxUSE_TOOLBAR // Creates new property page. Note that the first page is not created // automatically. // index - Add to this position. -1 will add as the last item. // label - A label for the page. This may be shown as a toolbar tooltip etc. // bmp - Bitmap image for toolbar. If wxNullBitmap is used, then a built-in // default image is used. // pageObj - wxPropertyGridPage instance. Manager will take ownership of this object. // If NULL, default page object is constructed. // Returns pointer to created page. virtual wxPropertyGridPage* InsertPage( int index, const wxString& label, const wxBitmap& bmp = wxNullBitmap, wxPropertyGridPage* pageObj = NULL ); // Returns true if any property on any page has been modified by the user. bool IsAnyModified() const; // Returns true if any property on given page has been modified by the // user. bool IsPageModified( size_t index ) const; // Returns true if property is selected. Since selection is page // based, this function checks every page in the manager. virtual bool IsPropertySelected( wxPGPropArg id ) const; virtual void Refresh( bool eraseBackground = true, const wxRect* rect = (const wxRect*) NULL ) wxOVERRIDE; // Removes a page. // Returns false if it was not possible to remove page in question. virtual bool RemovePage( int page ); // Select and displays a given page. // index - Index of page being selected. Can be -1 to select nothing. void SelectPage( int index ); // Select and displays a given page (by label). void SelectPage( const wxString& label ) { int index = GetPageByName(label); wxCHECK_RET( index >= 0, wxS("No page with such name") ); SelectPage( index ); } // Select and displays a given page. void SelectPage( wxPropertyGridPage* ptr ) { SelectPage( GetPageByState(ptr) ); } // Select a property. bool SelectProperty( wxPGPropArg id, bool focus = false ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) unsigned int flags = wxPG_SEL_DONT_SEND_EVENT; if ( focus ) flags |= wxPG_SEL_FOCUS; return p->GetParentState()->DoSelectProperty(p, flags); } #if wxUSE_HEADERCTRL // Sets a column title. Default title for column 0 is "Property", // and "Value" for column 1. // If header is not shown yet, then calling this // member function will make it visible. void SetColumnTitle( int idx, const wxString& title ); #endif // wxUSE_HEADERCTRL // Sets number of columns on given page (default is current page). // If you use header, then you should always use this // member function to set the column count, instead of // ones present in wxPropertyGrid or wxPropertyGridPage. void SetColumnCount( int colCount, int page = -1 ); // Sets label and text in description box. void SetDescription( const wxString& label, const wxString& content ); // Sets y coordinate of the description box splitter. void SetDescBoxHeight( int ht, bool refresh = true ); // Moves splitter as left as possible, while still allowing all // labels to be shown in full. // subProps - If false, will still allow sub-properties (ie. properties which // parent is not root or category) to be cropped. // allPages - If true, takes labels on all pages into account. void SetSplitterLeft( bool subProps = false, bool allPages = true ); // Moves splitter as left as possible on an individual page, while still allowing all // labels to be shown in full. void SetPageSplitterLeft(int page, bool subProps = false); // Sets splitter position on individual page. // If you use header, then you should always use this // member function to set the splitter position, instead of // ones present in wxPropertyGrid or wxPropertyGridPage. void SetPageSplitterPosition( int page, int pos, int column = 0 ); // Sets splitter position for all pages. // Splitter position cannot exceed grid size, and therefore // setting it during form creation may fail as initial grid // size is often smaller than desired splitter position, // especially when sizers are being used. // If you use header, then you should always use this // member function to set the splitter position, instead of // ones present in wxPropertyGrid or wxPropertyGridPage. void SetSplitterPosition( int pos, int column = 0 ); #if wxUSE_HEADERCTRL // Show or hide the property grid header control. It is hidden // by the default. // Grid may look better if you use wxPG_NO_INTERNAL_BORDER // window style when showing a header. void ShowHeader(bool show = true); #endif protected: // // Subclassing helpers // // Creates property grid for the manager. Reimplement in derived class to // use subclassed wxPropertyGrid. However, if you do this then you // must also use the two-step construction (i.e. default constructor and // Create() instead of constructor with arguments) when creating the // manager. virtual wxPropertyGrid* CreatePropertyGrid() const; public: virtual void RefreshProperty( wxPGProperty* p ) wxOVERRIDE; // // Overridden functions - no documentation required. // void SetId( wxWindowID winid ) wxOVERRIDE; virtual void SetExtraStyle ( long exStyle ) wxOVERRIDE; virtual bool SetFont ( const wxFont& font ) wxOVERRIDE; virtual void SetWindowStyleFlag ( long style ) wxOVERRIDE; virtual bool Reparent( wxWindowBase *newParent ) wxOVERRIDE; protected: virtual wxSize DoGetBestSize() const wxOVERRIDE; virtual void DoFreeze() wxOVERRIDE; virtual void DoThaw() wxOVERRIDE; // // Event handlers // void OnMouseMove( wxMouseEvent &event ); void OnMouseClick( wxMouseEvent &event ); void OnMouseUp( wxMouseEvent &event ); void OnMouseEntry( wxMouseEvent &event ); void OnPaint( wxPaintEvent &event ); #if wxUSE_TOOLBAR void OnToolbarClick( wxCommandEvent &event ); #endif void OnResize( wxSizeEvent& event ); void OnPropertyGridSelect( wxPropertyGridEvent& event ); void OnPGColDrag( wxPropertyGridEvent& event ); wxPropertyGrid* m_pPropGrid; wxVector<wxPropertyGridPage*> m_arrPages; #if wxUSE_TOOLBAR wxToolBar* m_pToolbar; #endif #if wxUSE_HEADERCTRL wxPGHeaderCtrl* m_pHeaderCtrl; #endif wxStaticText* m_pTxtHelpCaption; wxStaticText* m_pTxtHelpContent; wxPropertyGridPage* m_emptyPage; wxArrayString m_columnLabels; long m_iFlags; // Selected page index. int m_selPage; int m_width; int m_height; int m_extraHeight; int m_splitterY; int m_splitterHeight; int m_dragOffset; wxCursor m_cursorSizeNS; int m_nextDescBoxSize; // Toolbar tool ids for categorized and alphabetic mode selectors. int m_categorizedModeToolId; int m_alphabeticModeToolId; unsigned char m_dragStatus; unsigned char m_onSplitter; bool m_showHeader; virtual wxPGProperty* DoGetPropertyByName( const wxString& name ) const wxOVERRIDE; // Select and displays a given page. virtual bool DoSelectPage( int index ) wxOVERRIDE; // Sets some members to defaults. void Init1(); // Initializes some members. void Init2( int style ); /*#ifdef __WXMSW__ virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; #endif*/ virtual bool ProcessEvent( wxEvent& event ) wxOVERRIDE; // Recalculates new positions for components, according to the // given size. void RecalculatePositions( int width, int height ); // (Re)creates/destroys controls, according to the window style bits. void RecreateControls(); void UpdateDescriptionBox( int new_splittery, int new_width, int new_height ); void RepaintDescBoxDecorations( wxDC& dc, int newSplitterY, int newWidth, int newHeight ); void SetDescribedProperty( wxPGProperty* p ); // Reimplement these to handle "descboxheight" state item virtual bool SetEditableStateItem( const wxString& name, wxVariant value ) wxOVERRIDE; virtual wxVariant GetEditableStateItem( const wxString& name ) const wxOVERRIDE; // Reconnect propgrid event handlers. void ReconnectEventHandlers(wxWindowID oldId, wxWindowID newId); private: wxDECLARE_EVENT_TABLE(); }; // ----------------------------------------------------------------------- inline int wxPropertyGridPage::GetIndex() const { if ( !m_manager ) return wxNOT_FOUND; return m_manager->GetPageByState(this); } // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_MANAGER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/property.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/property.h // Purpose: wxPGProperty and related support classes // Author: Jaakko Salli // Modified by: // Created: 2008-08-23 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_PROPERTY_H_ #define _WX_PROPGRID_PROPERTY_H_ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/propgrid/propgriddefs.h" // ----------------------------------------------------------------------- #define wxNullProperty ((wxPGProperty*)NULL) // Contains information relayed to property's OnCustomPaint. struct wxPGPaintData { // wxPropertyGrid const wxPropertyGrid* m_parent; // Normally -1, otherwise index to drop-down list item // that has to be drawn. int m_choiceItem; // Set to drawn width in OnCustomPaint (optional). int m_drawnWidth; // In a measure item call, set this to the height of item // at m_choiceItem index. int m_drawnHeight; }; // space between vertical sides of a custom image #define wxPG_CUSTOM_IMAGE_SPACINGY 1 // space between caption and selection rectangle, #define wxPG_CAPRECTXMARGIN 2 // horizontally and vertically #define wxPG_CAPRECTYMARGIN 1 // Base class for wxPropertyGrid cell renderers. class WXDLLIMPEXP_PROPGRID wxPGCellRenderer : public wxObjectRefData { public: wxPGCellRenderer() : wxObjectRefData() { } virtual ~wxPGCellRenderer() { } // Render flags enum { // We are painting selected item Selected = 0x00010000, // We are painting item in choice popup ChoicePopup = 0x00020000, // We are rendering wxOwnerDrawnComboBox control // (or other owner drawn control, but that is only // officially supported one ATM). Control = 0x00040000, // We are painting a disable property Disabled = 0x00080000, // We are painting selected, disabled, or similar // item that dictates fore- and background colours, // overriding any cell values. DontUseCellFgCol = 0x00100000, DontUseCellBgCol = 0x00200000, DontUseCellColours = DontUseCellFgCol | DontUseCellBgCol }; // Returns true if rendered something in the foreground // (text or bitmap). virtual bool Render( wxDC& dc, const wxRect& rect, const wxPropertyGrid* propertyGrid, wxPGProperty* property, int column, int item, int flags ) const = 0; // Returns size of the image in front of the editable area. // If property is NULL, then this call is for a custom value. // In that case the item is index to wxPropertyGrid's custom values. virtual wxSize GetImageSize( const wxPGProperty* property, int column, int item ) const; // Paints property category selection rectangle. #if WXWIN_COMPATIBILITY_3_0 virtual void DrawCaptionSelectionRect( wxDC& dc, int x, int y, int w, int h ) const; #else virtual void DrawCaptionSelectionRect(wxWindow *win, wxDC& dc, int x, int y, int w, int h) const; #endif // WXWIN_COMPATIBILITY_3_0 // Utility to draw vertically centered text. void DrawText( wxDC& dc, const wxRect& rect, int imageWidth, const wxString& text ) const; // Utility to draw editor's value, or vertically // aligned text if editor is NULL. void DrawEditorValue( wxDC& dc, const wxRect& rect, int xOffset, const wxString& text, wxPGProperty* property, const wxPGEditor* editor ) const; // Utility to render cell bitmap and set text // colour plus bg brush colour. // Returns image width, which, for instance, // can be passed to DrawText. int PreDrawCell( wxDC& dc, const wxRect& rect, const wxPGCell& cell, int flags ) const; // Utility to be called after drawing is done, to revert // whatever changes PreDrawCell() did. // Flags are the same as those passed to PreDrawCell(). void PostDrawCell( wxDC& dc, const wxPropertyGrid* propGrid, const wxPGCell& cell, int flags ) const; }; // Default cell renderer, that can handles the common // scenarios. class WXDLLIMPEXP_PROPGRID wxPGDefaultRenderer : public wxPGCellRenderer { public: virtual bool Render( wxDC& dc, const wxRect& rect, const wxPropertyGrid* propertyGrid, wxPGProperty* property, int column, int item, int flags ) const wxOVERRIDE; virtual wxSize GetImageSize( const wxPGProperty* property, int column, int item ) const wxOVERRIDE; protected: }; class WXDLLIMPEXP_PROPGRID wxPGCellData : public wxObjectRefData { friend class wxPGCell; public: wxPGCellData(); void SetText( const wxString& text ) { m_text = text; m_hasValidText = true; } void SetBitmap( const wxBitmap& bitmap ) { m_bitmap = bitmap; } void SetFgCol( const wxColour& col ) { m_fgCol = col; } void SetBgCol( const wxColour& col ) { m_bgCol = col; } void SetFont( const wxFont& font ) { m_font = font; } protected: virtual ~wxPGCellData() { } wxString m_text; wxBitmap m_bitmap; wxColour m_fgCol; wxColour m_bgCol; wxFont m_font; // True if m_text is valid and specified bool m_hasValidText; }; // Base class for wxPropertyGrid cell information. class WXDLLIMPEXP_PROPGRID wxPGCell : public wxObject { public: wxPGCell(); wxPGCell(const wxPGCell& other) : wxObject(other) { } wxPGCell( const wxString& text, const wxBitmap& bitmap = wxNullBitmap, const wxColour& fgCol = wxNullColour, const wxColour& bgCol = wxNullColour ); virtual ~wxPGCell() { } wxPGCellData* GetData() { return (wxPGCellData*) m_refData; } const wxPGCellData* GetData() const { return (const wxPGCellData*) m_refData; } bool HasText() const { return (m_refData && GetData()->m_hasValidText); } // Sets empty but valid data to this cell object. void SetEmptyData(); // Merges valid data from srcCell into this. void MergeFrom( const wxPGCell& srcCell ); void SetText( const wxString& text ); void SetBitmap( const wxBitmap& bitmap ); void SetFgCol( const wxColour& col ); // Sets font of the cell. // Because wxPropertyGrid does not support rows of // different height, it makes little sense to change // size of the font. Therefore it is recommended // to use return value of wxPropertyGrid::GetFont() // or wxPropertyGrid::GetCaptionFont() as a basis // for the font that, after modifications, is passed // to this member function. void SetFont( const wxFont& font ); void SetBgCol( const wxColour& col ); const wxString& GetText() const { return GetData()->m_text; } const wxBitmap& GetBitmap() const { return GetData()->m_bitmap; } const wxColour& GetFgCol() const { return GetData()->m_fgCol; } // Returns font of the cell. If no specific font is set for this // cell, then the font will be invalid. const wxFont& GetFont() const { return GetData()->m_font; } const wxColour& GetBgCol() const { return GetData()->m_bgCol; } wxPGCell& operator=( const wxPGCell& other ) { if ( this != &other ) { Ref(other); } return *this; } // Used mostly internally to figure out if this cell is supposed // to have default values when attached to a grid. bool IsInvalid() const { return ( m_refData == NULL ); } private: virtual wxObjectRefData *CreateRefData() const wxOVERRIDE { return new wxPGCellData(); } virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const wxOVERRIDE; }; // ----------------------------------------------------------------------- // wxPGAttributeStorage is somewhat optimized storage for // key=variant pairs (ie. a map). class WXDLLIMPEXP_PROPGRID wxPGAttributeStorage { public: wxPGAttributeStorage(); ~wxPGAttributeStorage(); void Set( const wxString& name, const wxVariant& value ); unsigned int GetCount() const { return (unsigned int) m_map.size(); } wxVariant FindValue( const wxString& name ) const { wxPGHashMapS2P::const_iterator it = m_map.find(name); if ( it != m_map.end() ) { wxVariantData* data = (wxVariantData*) it->second; data->IncRef(); return wxVariant(data, it->first); } return wxVariant(); } typedef wxPGHashMapS2P::const_iterator const_iterator; const_iterator StartIteration() const { return m_map.begin(); } bool GetNext( const_iterator& it, wxVariant& variant ) const { if ( it == m_map.end() ) return false; wxVariantData* data = (wxVariantData*) it->second; data->IncRef(); variant.SetData(data); variant.SetName(it->first); ++it; return true; } protected: wxPGHashMapS2P m_map; }; // ----------------------------------------------------------------------- enum wxPGPropertyFlags { // Indicates bold font. wxPG_PROP_MODIFIED = 0x0001, // Disables ('greyed' text and editor does not activate) property. wxPG_PROP_DISABLED = 0x0002, // Hider button will hide this property. wxPG_PROP_HIDDEN = 0x0004, // This property has custom paint image just in front of its value. // If property only draws custom images into a popup list, then this // flag should not be set. wxPG_PROP_CUSTOMIMAGE = 0x0008, // Do not create text based editor for this property (but button-triggered // dialog and choice are ok). wxPG_PROP_NOEDITOR = 0x0010, // Property is collapsed, ie. it's children are hidden. wxPG_PROP_COLLAPSED = 0x0020, // If property is selected, then indicates that validation failed for pending // value. // If property is not selected, that indicates that the actual property // value has failed validation (NB: this behaviour is not currently supported, // but may be used in future). wxPG_PROP_INVALID_VALUE = 0x0040, // 0x0080, // Switched via SetWasModified(). Temporary flag - only used when // setting/changing property value. wxPG_PROP_WAS_MODIFIED = 0x0200, // If set, then child properties (if any) are private, and should be // "invisible" to the application. wxPG_PROP_AGGREGATE = 0x0400, // If set, then child properties (if any) are copies and should not // be deleted in dtor. wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, // Classifies this item as a non-category. // Used for faster item type identification. wxPG_PROP_PROPERTY = 0x1000, // Classifies this item as a category. // Used for faster item type identification. wxPG_PROP_CATEGORY = 0x2000, // Classifies this item as a property that has children, //but is not aggregate (i.e. children are not private). wxPG_PROP_MISC_PARENT = 0x4000, // Property is read-only. Editor is still created for wxTextCtrl-based // property editors. For others, editor is not usually created because // they do implement wxTE_READONLY style or equivalent. wxPG_PROP_READONLY = 0x8000, // // NB: FLAGS ABOVE 0x8000 CANNOT BE USED WITH PROPERTY ITERATORS // // Property's value is composed from values of child properties. // This flag cannot be used with property iterators. wxPG_PROP_COMPOSED_VALUE = 0x00010000, // Common value of property is selectable in editor. // This flag cannot be used with property iterators. wxPG_PROP_USES_COMMON_VALUE = 0x00020000, // Property can be set to unspecified value via editor. // Currently, this applies to following properties: // - wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty: // Clear the text field // This flag cannot be used with property iterators. // See wxPGProperty::SetAutoUnspecified(). wxPG_PROP_AUTO_UNSPECIFIED = 0x00040000, // Indicates the bit useable by derived properties. wxPG_PROP_CLASS_SPECIFIC_1 = 0x00080000, // Indicates the bit useable by derived properties. wxPG_PROP_CLASS_SPECIFIC_2 = 0x00100000, // Indicates that the property is being deleted and should be ignored. wxPG_PROP_BEING_DELETED = 0x00200000, // Indicates the bit useable by derived properties. wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 }; // Topmost flag. #define wxPG_PROP_MAX wxPG_PROP_AUTO_UNSPECIFIED // Property with children must have one of these set, otherwise iterators // will not work correctly. // Code should automatically take care of this, however. #define wxPG_PROP_PARENTAL_FLAGS \ ((wxPGPropertyFlags)(wxPG_PROP_AGGREGATE | \ wxPG_PROP_CATEGORY | \ wxPG_PROP_MISC_PARENT)) // Combination of flags that can be stored by GetFlagsAsString #define wxPG_STRING_STORED_FLAGS \ (wxPG_PROP_DISABLED|wxPG_PROP_HIDDEN|wxPG_PROP_NOEDITOR|wxPG_PROP_COLLAPSED) // ----------------------------------------------------------------------- // wxPGProperty::SetAttribute() and // wxPropertyGridInterface::SetPropertyAttribute() accept one of these as // attribute name argument. // You can use strings instead of constants. However, some of these // constants are redefined to use cached strings which may reduce // your binary size by some amount. // Set default value for property. #define wxPG_ATTR_DEFAULT_VALUE wxS("DefaultValue") // Universal, int or double. Minimum value for numeric properties. #define wxPG_ATTR_MIN wxS("Min") // Universal, int or double. Maximum value for numeric properties. #define wxPG_ATTR_MAX wxS("Max") // Universal, string. When set, will be shown as text after the displayed // text value. Alternatively, if third column is enabled, text will be shown // there (for any type of property). #define wxPG_ATTR_UNITS wxS("Units") // When set, will be shown as 'greyed' text in property's value cell when // the actual displayed value is blank. #define wxPG_ATTR_HINT wxS("Hint") #if wxPG_COMPATIBILITY_1_4 // Ddeprecated. Use "Hint" (wxPG_ATTR_HINT) instead. #define wxPG_ATTR_INLINE_HELP wxS("InlineHelp") #endif // Universal, wxArrayString. Set to enable auto-completion in any // wxTextCtrl-based property editor. #define wxPG_ATTR_AUTOCOMPLETE wxS("AutoComplete") // wxBoolProperty and wxFlagsProperty specific. Value type is bool. // Default value is False. // When set to True, bool property will use check box instead of a // combo box as its editor control. If you set this attribute // for a wxFlagsProperty, it is automatically applied to child // bool properties. #define wxPG_BOOL_USE_CHECKBOX wxS("UseCheckbox") // wxBoolProperty and wxFlagsProperty specific. Value type is bool. // Default value is False. // Set to True for the bool property to cycle value on double click // (instead of showing the popup listbox). If you set this attribute // for a wxFlagsProperty, it is automatically applied to child // bool properties. #define wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING wxS("UseDClickCycling") // wxFloatProperty (and similar) specific, int, default -1. // Sets the (max) precision used when floating point value is rendered as // text. The default -1 means infinite precision. #define wxPG_FLOAT_PRECISION wxS("Precision") // The text will be echoed as asterisks (wxTE_PASSWORD will be passed // to textctrl etc.). #define wxPG_STRING_PASSWORD wxS("Password") // Define base used by a wxUIntProperty. Valid constants are // wxPG_BASE_OCT, wxPG_BASE_DEC, wxPG_BASE_HEX and wxPG_BASE_HEXL // (lowercase characters). #define wxPG_UINT_BASE wxS("Base") // Define prefix rendered to wxUIntProperty. Accepted constants // wxPG_PREFIX_NONE, wxPG_PREFIX_0x, and wxPG_PREFIX_DOLLAR_SIGN. // Note: // Only wxPG_PREFIX_NONE works with Decimal and Octal numbers. #define wxPG_UINT_PREFIX wxS("Prefix") // wxFileProperty/wxImageFileProperty specific, wxChar*, default is // detected/varies. // Sets the wildcard used in the triggered wxFileDialog. Format is the same. #define wxPG_FILE_WILDCARD wxS("Wildcard") // wxFileProperty/wxImageFileProperty specific, int, default 1. // When 0, only the file name is shown (i.e. drive and directory are hidden). #define wxPG_FILE_SHOW_FULL_PATH wxS("ShowFullPath") // Specific to wxFileProperty and derived properties, wxString, default empty. // If set, then the filename is shown relative to the given path string. #define wxPG_FILE_SHOW_RELATIVE_PATH wxS("ShowRelativePath") // Specific to wxFileProperty and derived properties, wxString, // default is empty. // Sets the initial path of where to look for files. #define wxPG_FILE_INITIAL_PATH wxS("InitialPath") // Specific to wxFileProperty and derivatives, wxString, default is empty. // Sets a specific title for the dir dialog. #define wxPG_FILE_DIALOG_TITLE wxS("DialogTitle") // Specific to wxFileProperty and derivatives, long, default is 0. // Sets a specific wxFileDialog style for the file dialog, e.g. ::wxFD_SAVE. #define wxPG_FILE_DIALOG_STYLE wxS("DialogStyle") // Specific to wxDirProperty, wxString, default is empty. // Sets a specific message for the dir dialog. #define wxPG_DIR_DIALOG_MESSAGE wxS("DialogMessage") // wxArrayStringProperty's string delimiter character. If this is // a quotation mark or hyphen, then strings will be quoted instead // (with given character). // Default delimiter is quotation mark. #define wxPG_ARRAY_DELIMITER wxS("Delimiter") // Sets displayed date format for wxDateProperty. #define wxPG_DATE_FORMAT wxS("DateFormat") // Sets wxDatePickerCtrl window style used with wxDateProperty. Default // is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE will enable // better unspecified value support in the editor #define wxPG_DATE_PICKER_STYLE wxS("PickerStyle") #if wxUSE_SPINBTN // SpinCtrl editor, int or double. How much number changes when button is // pressed (or up/down on keyboard). #define wxPG_ATTR_SPINCTRL_STEP wxS("Step") // SpinCtrl editor, bool. If true, value wraps at Min/Max. #define wxPG_ATTR_SPINCTRL_WRAP wxS("Wrap") // SpinCtrl editor, bool. If true, moving mouse when one of the spin // buttons is depressed rapidly changing "spin" value. #define wxPG_ATTR_SPINCTRL_MOTION wxS("MotionSpin") #endif // wxUSE_SPINBTN // wxMultiChoiceProperty, int. // If 0, no user strings allowed. If 1, user strings appear before list // strings. If 2, user strings appear after list string. #define wxPG_ATTR_MULTICHOICE_USERSTRINGMODE wxS("UserStringMode") // wxColourProperty and its kind, int, default 1. // Setting this attribute to 0 hides custom colour from property's list of // choices. #define wxPG_COLOUR_ALLOW_CUSTOM wxS("AllowCustom") // wxColourProperty and its kind: Set to True in order to support editing // alpha colour component. #define wxPG_COLOUR_HAS_ALPHA wxS("HasAlpha") // Redefine attribute macros to use cached strings #undef wxPG_ATTR_DEFAULT_VALUE #define wxPG_ATTR_DEFAULT_VALUE wxPGGlobalVars->m_strDefaultValue #undef wxPG_ATTR_MIN #define wxPG_ATTR_MIN wxPGGlobalVars->m_strMin #undef wxPG_ATTR_MAX #define wxPG_ATTR_MAX wxPGGlobalVars->m_strMax #undef wxPG_ATTR_UNITS #define wxPG_ATTR_UNITS wxPGGlobalVars->m_strUnits #undef wxPG_ATTR_HINT #define wxPG_ATTR_HINT wxPGGlobalVars->m_strHint #if wxPG_COMPATIBILITY_1_4 #undef wxPG_ATTR_INLINE_HELP #define wxPG_ATTR_INLINE_HELP wxPGGlobalVars->m_strInlineHelp #endif // ----------------------------------------------------------------------- // Data of a single wxPGChoices choice. class WXDLLIMPEXP_PROPGRID wxPGChoiceEntry : public wxPGCell { public: wxPGChoiceEntry(); wxPGChoiceEntry(const wxPGChoiceEntry& other) : wxPGCell(other) { m_value = other.m_value; } wxPGChoiceEntry( const wxString& label, int value = wxPG_INVALID_VALUE ) : wxPGCell(), m_value(value) { SetText(label); } virtual ~wxPGChoiceEntry() { } void SetValue( int value ) { m_value = value; } int GetValue() const { return m_value; } wxPGChoiceEntry& operator=( const wxPGChoiceEntry& other ) { if ( this != &other ) { Ref(other); } m_value = other.m_value; return *this; } protected: int m_value; }; typedef void* wxPGChoicesId; class WXDLLIMPEXP_PROPGRID wxPGChoicesData : public wxObjectRefData { friend class wxPGChoices; public: // Constructor sets m_refCount to 1. wxPGChoicesData(); void CopyDataFrom( wxPGChoicesData* data ); wxPGChoiceEntry& Insert( int index, const wxPGChoiceEntry& item ); // Delete all entries void Clear(); unsigned int GetCount() const { return (unsigned int) m_items.size(); } const wxPGChoiceEntry& Item( unsigned int i ) const { wxASSERT_MSG( i < GetCount(), wxS("invalid index") ); return m_items[i]; } wxPGChoiceEntry& Item( unsigned int i ) { wxASSERT_MSG( i < GetCount(), wxS("invalid index") ); return m_items[i]; } private: wxVector<wxPGChoiceEntry> m_items; protected: virtual ~wxPGChoicesData(); }; #define wxPGChoicesEmptyData ((wxPGChoicesData*)NULL) // Helper class for managing choices of wxPropertyGrid properties. // Each entry can have label, value, bitmap, text colour, and background // colour. // wxPGChoices uses reference counting, similar to other wxWidgets classes. // This means that assignment operator and copy constructor only copy the // reference and not the actual data. Use Copy() member function to create // a real copy. // If you do not specify value for entry, index is used. class WXDLLIMPEXP_PROPGRID wxPGChoices { public: typedef long ValArrItem; // Default constructor. wxPGChoices() { Init(); } // Copy constructor, uses reference counting. To create a real copy, // use Copy() member function instead. wxPGChoices( const wxPGChoices& a ) { if ( a.m_data != wxPGChoicesEmptyData ) { m_data = a.m_data; m_data->IncRef(); } else { Init(); } } // Constructor. // count - Number of labels. // labels - Labels themselves. // values - Values for choices. If NULL, indexes are used. wxPGChoices(size_t count, const wxString* labels, const long* values = NULL) { Init(); Add(count, labels, values); } // Constructor overload taking wxChar strings, provided mostly for // compatibility. // labels - Labels for choices, NULL-terminated. // values - Values for choices. If NULL, indexes are used. wxPGChoices( const wxChar* const* labels, const long* values = NULL ) { Init(); Add(labels,values); } // Constructor. // labels - Labels for choices. // values - Values for choices. If empty, indexes are used. wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ) { Init(); Add(labels,values); } // Simple interface constructor. wxPGChoices( wxPGChoicesData* data ) { wxASSERT(data); m_data = data; data->IncRef(); } // Destructor. ~wxPGChoices() { Free(); } // Adds to current. // If did not have own copies, creates them now. If was empty, identical // to set except that creates copies. void Add(size_t count, const wxString* labels, const long* values = NULL); // Overload taking wxChar strings, provided mostly for compatibility. // labels - Labels for added choices, NULL-terminated. // values - Values for added choices. If empty, relevant entry indexes are used. void Add( const wxChar* const* labels, const ValArrItem* values = NULL ); // Version that works with wxArrayString and wxArrayInt. void Add( const wxArrayString& arr, const wxArrayInt& arrint = wxArrayInt() ); // Adds a single choice. // label - Label for added choice. // value - Value for added choice. If unspecified, index is used. wxPGChoiceEntry& Add( const wxString& label, int value = wxPG_INVALID_VALUE ); // Adds a single item, with bitmap. wxPGChoiceEntry& Add( const wxString& label, const wxBitmap& bitmap, int value = wxPG_INVALID_VALUE ); // Adds a single item with full entry information. wxPGChoiceEntry& Add( const wxPGChoiceEntry& entry ) { return Insert(entry, -1); } // Adds a single item, sorted. wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE ); // Assigns choices data, using reference counting. To create a real copy, // use Copy() member function instead. void Assign( const wxPGChoices& a ) { AssignData(a.m_data); } // Assigns data from another set of choices. void AssignData( wxPGChoicesData* data ); // Delete all choices. void Clear(); // Returns a real copy of the choices. wxPGChoices Copy() const { wxPGChoices dst; dst.EnsureData(); dst.m_data->CopyDataFrom(m_data); return dst; } void EnsureData() { if ( m_data == wxPGChoicesEmptyData ) m_data = new wxPGChoicesData(); } // Gets a unsigned number identifying this list. wxPGChoicesId GetId() const { return (wxPGChoicesId) m_data; } // Returns label of item. const wxString& GetLabel( unsigned int ind ) const { return Item(ind).GetText(); } // Returns number of items. unsigned int GetCount () const { if ( !m_data ) return 0; return m_data->GetCount(); } // Returns value of item. int GetValue( unsigned int ind ) const { return Item(ind).GetValue(); } // Returns array of values matching the given strings. Unmatching strings // result in wxPG_INVALID_VALUE entry in array. wxArrayInt GetValuesForStrings( const wxArrayString& strings ) const; // Returns array of indices matching given strings. Unmatching strings // are added to 'unmatched', if not NULL. wxArrayInt GetIndicesForStrings( const wxArrayString& strings, wxArrayString* unmatched = NULL ) const; // Returns index of item with given label. int Index( const wxString& str ) const; // Returns index of item with given value. int Index( int val ) const; // Inserts a single item. wxPGChoiceEntry& Insert( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); // Inserts a single item with full entry information. wxPGChoiceEntry& Insert( const wxPGChoiceEntry& entry, int index ); // Returns false if this is a constant empty set of choices, // which should not be modified. bool IsOk() const { return ( m_data != wxPGChoicesEmptyData ); } const wxPGChoiceEntry& Item( unsigned int i ) const { wxASSERT( IsOk() ); return m_data->Item(i); } // Returns item at given index. wxPGChoiceEntry& Item( unsigned int i ) { wxASSERT( IsOk() ); return m_data->Item(i); } // Removes count items starting at position nIndex. void RemoveAt(size_t nIndex, size_t count = 1); // Sets contents from lists of strings and values. // Does not create copies for itself. // TODO: Deprecate. void Set(size_t count, const wxString* labels, const long* values = NULL) { Free(); Add(count, labels, values); } void Set( const wxChar* const* labels, const long* values = NULL ) { Free(); Add(labels,values); } // Sets contents from lists of strings and values. // Version that works with wxArrayString and wxArrayInt. void Set( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ) { Free(); Add(labels,values); } // Creates exclusive copy of current choices void AllocExclusive(); // Returns data, increases refcount. wxPGChoicesData* GetData() { wxASSERT( m_data->GetRefCount() != -1 ); m_data->IncRef(); return m_data; } // Returns plain data ptr - no refcounting stuff is done. wxPGChoicesData* GetDataPtr() const { return m_data; } // Changes ownership of data to you. wxPGChoicesData* ExtractData() { wxPGChoicesData* data = m_data; m_data = wxPGChoicesEmptyData; return data; } // Returns array of choice labels. wxArrayString GetLabels() const; void operator= (const wxPGChoices& a) { if (this != &a) AssignData(a.m_data); } wxPGChoiceEntry& operator[](unsigned int i) { return Item(i); } const wxPGChoiceEntry& operator[](unsigned int i) const { return Item(i); } protected: wxPGChoicesData* m_data; void Init(); void Free(); }; // ----------------------------------------------------------------------- // wxPGProperty is base class for all wxPropertyGrid properties. class WXDLLIMPEXP_PROPGRID wxPGProperty : public wxObject { friend class wxPropertyGrid; friend class wxPropertyGridInterface; friend class wxPropertyGridPageState; friend class wxPropertyGridPopulator; friend class wxStringProperty; // Proper "<composed>" support requires this wxDECLARE_ABSTRACT_CLASS(wxPGProperty); public: typedef wxUint32 FlagType; // Default constructor. wxPGProperty(); // Constructor. // All non-abstract property classes should have a constructor with // the same first two arguments as this one. wxPGProperty( const wxString& label, const wxString& name ); // Virtual destructor. // It is customary for derived properties to implement this. virtual ~wxPGProperty(); // This virtual function is called after m_value has been set. // Remarks: // - If m_value was set to Null variant (i.e. unspecified value), // OnSetValue() will not be called. // - m_value may be of any variant type. Typically properties internally // support only one variant type, and as such OnSetValue() provides a // good opportunity to convert // supported values into internal type. // - Default implementation does nothing. virtual void OnSetValue(); // Override this to return something else than m_value as the value. virtual wxVariant DoGetValue() const { return m_value; } // Implement this function in derived class to check the value. // Return true if it is ok. Returning false prevents property change // events from occurring. // Remark: Default implementation always returns true. virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const; // Converts text into wxVariant value appropriate for this property. // Prameters: // variant - On function entry this is the old value (should not be // wxNullVariant in normal cases). Translated value must be assigned // back to it. // text - Text to be translated into variant. // argFlags - If wxPG_FULL_VALUE is set, returns complete, storable value instead // of displayable one (they may be different). // If wxPG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of // composite property string value (as generated by ValueToString() // called with this same flag). // Returns true if resulting wxVariant value was different. // Default implementation converts semicolon delimited tokens into // child values. Only works for properties with children. // You might want to take into account that m_value is Null variant // if property value is unspecified (which is usually only case if // you explicitly enabled that sort behaviour). virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const; // Converts integer (possibly a choice selection) into wxVariant value // appropriate for this property. // Parameters: // variant - On function entry this is the old value (should not be wxNullVariant // in normal cases). Translated value must be assigned back to it. // number - Integer to be translated into variant. // argFlags - If wxPG_FULL_VALUE is set, returns complete, storable value // instead of displayable one. // Returns true if resulting wxVariant value was different. // Remarks // - If property is not supposed to use choice or spinctrl or other editor // with int-based value, it is not necessary to implement this method. // - Default implementation simply assign given int to m_value. // - If property uses choice control, and displays a dialog on some choice // items, then it is preferred to display that dialog in IntToValue // instead of OnEvent. // - You might want to take into account that m_value is Null variant // if property value is unspecified (which is usually only case if // you explicitly enabled that sort behaviour). virtual bool IntToValue( wxVariant& value, int number, int argFlags = 0 ) const; // Converts property value into a text representation. // Parameters: // value - Value to be converted. // argFlags - If 0 (default value), then displayed string is returned. // If wxPG_FULL_VALUE is set, returns complete, storable string value // instead of displayable. If wxPG_EDITABLE_VALUE is set, returns // string value that must be editable in textctrl. If // wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to // display as a part of string property's composite text // representation. // Default implementation calls GenerateComposedValue(). virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; // Converts string to a value, and if successful, calls SetValue() on it. // Default behaviour is to do nothing. // Returns true if value was changed. bool SetValueFromString( const wxString& text, int flags = wxPG_PROGRAMMATIC_VALUE ); // Converts integer to a value, and if successful, calls SetValue() on it. // Default behaviour is to do nothing. // Parameters: // value - Int to get the value from. // flags - If has wxPG_FULL_VALUE, then the value given is a actual value // and not an index. // Returns true if value was changed. bool SetValueFromInt( long value, int flags = 0 ); // Returns size of the custom painted image in front of property. // This method must be overridden to return non-default value if // OnCustomPaint is to be called. // item - Normally -1, but can be an index to the property's list of items. // Remarks: // - Default behaviour is to return wxSize(0,0), which means no image. // - Default image width or height is indicated with dimension -1. // - You can also return wxPG_DEFAULT_IMAGE_SIZE, i.e. wxDefaultSize. virtual wxSize OnMeasureImage( int item = -1 ) const; // Events received by editor widgets are processed here. // Note that editor class usually processes most events. Some, such as // button press events of TextCtrlAndButton class, can be handled here. // Also, if custom handling for regular events is desired, then that can // also be done (for example, wxSystemColourProperty custom handles // wxEVT_CHOICE to display colour picker dialog when // 'custom' selection is made). // If the event causes value to be changed, SetValueInEvent() // should be called to set the new value. // event - Associated wxEvent. // Should return true if any changes in value should be reported. // If property uses choice control, and displays a dialog on some choice // items, then it is preferred to display that dialog in IntToValue // instead of OnEvent. virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_primary, wxEvent& event ); // Called after value of a child property has been altered. Must return // new value of the whole property (after any alterations warranted by // child's new value). // Note that this function is usually called at the time that value of // this property, or given child property, is still pending for change, // and as such, result of GetValue() or m_value should not be relied // on. // Parameters: // thisValue - Value of this property. Changed value should be returned // (in previous versions of wxPropertyGrid it was only necessary to // write value back to this argument). // childIndex - Index of child changed (you can use Item(childIndex) // to get child property). // childValue - (Pending) value of the child property. // Returns modified value of the whole property. virtual wxVariant ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const; // Returns pointer to an instance of used editor. virtual const wxPGEditor* DoGetEditorClass() const; // Returns pointer to the wxValidator that should be used // with the editor of this property (NULL for no validator). // Setting validator explicitly via SetPropertyValidator // will override this. // You can get common filename validator by returning // wxFileProperty::GetClassValidator(). wxDirProperty, // for example, uses it. virtual wxValidator* DoGetValidator () const; // Override to paint an image in front of the property value text or // drop-down list item (but only if wxPGProperty::OnMeasureImage is // overridden as well). // If property's OnMeasureImage() returns size that has height != 0 but // less than row height ( < 0 has special meanings), wxPropertyGrid calls // this method to draw a custom image in a limited area in front of the // editor control or value text/graphics, and if control has drop-down // list, then the image is drawn there as well (even in the case // OnMeasureImage() returned higher height than row height). // NOTE: Following applies when OnMeasureImage() returns a "flexible" // height ( using wxPG_FLEXIBLE_SIZE(W,H) macro), which implies variable // height items: If rect.x is < 0, then this is a measure item call, which // means that dc is invalid and only thing that should be done is to set // paintdata.m_drawnHeight to the height of the image of item at index // paintdata.m_choiceItem. This call may be done even as often as once // every drop-down popup show. // Parameters: // dc - wxDC to paint on. // rect - Box reserved for custom graphics. Includes surrounding rectangle, // if any. If x is < 0, then this is a measure item call (see above). // paintdata - wxPGPaintData structure with much useful data. // Remarks: // - You can actually exceed rect width, but if you do so then // paintdata.m_drawnWidth must be set to the full width drawn in // pixels. // - Due to technical reasons, rect's height will be default even if // custom height was reported during measure call. // - Brush is guaranteed to be default background colour. It has been // already used to clear the background of area being painted. It // can be modified. // - Pen is guaranteed to be 1-wide 'black' (or whatever is the proper // colour) pen for drawing framing rectangle. It can be changed as // well. // See ValueToString() virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ); // Returns used wxPGCellRenderer instance for given property column // (label=0, value=1). // Default implementation returns editor's renderer for all columns. virtual wxPGCellRenderer* GetCellRenderer( int column ) const; // Returns which choice is currently selected. Only applies to properties // which have choices. // Needs to be reimplemented in derived class if property value does not // map directly to a choice. Integer as index, bool, and string usually do. virtual int GetChoiceSelection() const; // Refresh values of child properties. // Automatically called after value is set. virtual void RefreshChildren(); // Reimplement this member function to add special handling for // attributes of this property. // Return false to have the attribute automatically stored in // m_attributes. Default implementation simply does that and // nothing else. // To actually set property attribute values from the // application, use wxPGProperty::SetAttribute() instead. virtual bool DoSetAttribute( const wxString& name, wxVariant& value ); // Returns value of an attribute. // Override if custom handling of attributes is needed. // Default implementation simply return NULL variant. virtual wxVariant DoGetAttribute( const wxString& name ) const; // Returns instance of a new wxPGEditorDialogAdapter instance, which is // used when user presses the (optional) button next to the editor control; // Default implementation returns NULL (ie. no action is generated when // button is pressed). virtual wxPGEditorDialogAdapter* GetEditorDialog() const; // Called whenever validation has failed with given pending value. // If you implement this in your custom property class, please // remember to call the baser implementation as well, since they // may use it to revert property into pre-change state. virtual void OnValidationFailure( wxVariant& pendingValue ); // Append a new choice to property's list of choices. int AddChoice( const wxString& label, int value = wxPG_INVALID_VALUE ) { return InsertChoice(label, wxNOT_FOUND, value); } // Returns true if children of this property are component values (for // instance, points size, face name, and is_underlined are component // values of a font). bool AreChildrenComponents() const { return (m_flags & (wxPG_PROP_COMPOSED_VALUE|wxPG_PROP_AGGREGATE)) != 0; } // Deletes children of the property. void DeleteChildren(); // Removes entry from property's wxPGChoices and editor control (if it is // active). // If selected item is deleted, then the value is set to unspecified. void DeleteChoice( int index ); // Enables or disables the property. Disabled property usually appears // as having grey text. // See wxPropertyGridInterface::EnableProperty() void Enable( bool enable = true ); // Call to enable or disable usage of common value (integer value that can // be selected for properties instead of their normal values) for this // property. // Common values are disabled by the default for all properties. void EnableCommonValue( bool enable = true ) { if ( enable ) SetFlag( wxPG_PROP_USES_COMMON_VALUE ); else ClearFlag( wxPG_PROP_USES_COMMON_VALUE ); } // Composes text from values of child properties. wxString GenerateComposedValue() const { wxString s; DoGenerateComposedValue(s); return s; } // Returns property's label. const wxString& GetLabel() const { return m_label; } // Returns property's name with all (non-category, non-root) parents. wxString GetName() const; // Returns property's base name (i.e. parent's name is not added // in any case). const wxString& GetBaseName() const { return m_name; } // Returns read-only reference to property's list of choices. const wxPGChoices& GetChoices() const { return m_choices; } // Returns coordinate to the top y of the property. Note that the // position of scrollbars is not taken into account. int GetY() const; // Returns property's value. wxVariant GetValue() const { return DoGetValue(); } // Returns reference to the internal stored value. GetValue is preferred // way to get the actual value, since GetValueRef ignores DoGetValue, // which may override stored value. wxVariant& GetValueRef() { return m_value; } const wxVariant& GetValueRef() const { return m_value; } // Helper function (for wxPython bindings and such) for settings protected // m_value. wxVariant GetValuePlain() const { return m_value; } // Returns text representation of property's value. // argFlags - If 0 (default value), then displayed string is returned. // If wxPG_FULL_VALUE is set, returns complete, storable string value // instead of displayable. If wxPG_EDITABLE_VALUE is set, returns // string value that must be editable in textctrl. If // wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to // display as a part of string property's composite text // representation. // In older versions, this function used to be overridden to convert // property's value into a string representation. This function is // now handled by ValueToString(), and overriding this function now // will result in run-time assertion failure. virtual wxString GetValueAsString( int argFlags = 0 ) const; #if wxPG_COMPATIBILITY_1_4 // Synonymous to GetValueAsString(). wxDEPRECATED( wxString GetValueString( int argFlags = 0 ) const ); #endif // Returns wxPGCell of given column. // Const version of this member function returns 'default' // wxPGCell object if the property itself didn't hold // cell data. const wxPGCell& GetCell( unsigned int column ) const; // Returns wxPGCell of given column, creating one if necessary. wxPGCell& GetCell( unsigned int column ) { return GetOrCreateCell(column); } // Returns wxPGCell of given column, creating one if necessary. wxPGCell& GetOrCreateCell( unsigned int column ); // Return number of displayed common values for this property. int GetDisplayedCommonValueCount() const; // Returns property's displayed text. wxString GetDisplayedString() const { return GetValueAsString(0); } // Returns property's hint text (shown in empty value cell). inline wxString GetHintText() const; // Returns property grid where property lies. wxPropertyGrid* GetGrid() const; // Returns owner wxPropertyGrid, but only if one is currently // on a page displaying this property. wxPropertyGrid* GetGridIfDisplayed() const; // Returns highest level non-category, non-root parent. Useful when you // have nested properties with children. // Thus, if immediate parent is root or category, this will return the // property itself. wxPGProperty* GetMainParent() const; // Return parent of property. wxPGProperty* GetParent() const { return m_parent; } // Returns true if property has editable wxTextCtrl when selected. // Although disabled properties do not displayed editor, they still // Returns true here as being disabled is considered a temporary // condition (unlike being read-only or having limited editing enabled). bool IsTextEditable() const; // Returns true if property's value is considered unspecified. // This usually means that value is Null variant. bool IsValueUnspecified() const { return m_value.IsNull(); } #if WXWIN_COMPATIBILITY_3_0 // Returns non-zero if property has given flag set. FlagType HasFlag( wxPGPropertyFlags flag ) const { return ( m_flags & flag ); } #else // Returns true if property has given flag set. bool HasFlag(wxPGPropertyFlags flag) const { return (m_flags & flag) != 0; } #endif // Returns true if property has given flag set. bool HasFlag(FlagType flag) const { return (m_flags & flag) != 0; } // Returns true if property has all given flags set. bool HasFlagsExact(FlagType flags) const { return (m_flags & flags) == flags; } // Returns comma-delimited string of property attributes. const wxPGAttributeStorage& GetAttributes() const { return m_attributes; } // Returns m_attributes as list wxVariant. wxVariant GetAttributesAsList() const; #if WXWIN_COMPATIBILITY_3_0 // Returns property flags. wxDEPRECATED_MSG("Use HasFlag or HasFlagsExact functions instead.") FlagType GetFlags() const { return m_flags; } #endif // Returns wxPGEditor that will be used and created when // property becomes selected. Returns more accurate value // than DoGetEditorClass(). const wxPGEditor* GetEditorClass() const; // Returns value type used by this property. wxString GetValueType() const { return m_value.GetType(); } // Returns editor used for given column. NULL for no editor. const wxPGEditor* GetColumnEditor( int column ) const { if ( column == 1 ) return GetEditorClass(); return NULL; } // Returns common value selected for this property. -1 for none. int GetCommonValue() const { return m_commonValue; } // Returns true if property has even one visible child. bool HasVisibleChildren() const; // Use this member function to add independent (i.e. regular) children to // a property. // Returns inserted childProperty. // wxPropertyGrid is not automatically refreshed by this function. wxPGProperty* InsertChild( int index, wxPGProperty* childProperty ); // Inserts a new choice to property's list of choices. int InsertChoice( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); // Returns true if this property is actually a wxPropertyCategory. bool IsCategory() const { return (m_flags & wxPG_PROP_CATEGORY) != 0; } // Returns true if this property is actually a wxRootProperty. bool IsRoot() const { return (m_parent == NULL); } // Returns true if this is a sub-property. bool IsSubProperty() const { wxPGProperty* parent = (wxPGProperty*)m_parent; if ( parent && !parent->IsCategory() ) return true; return false; } // Returns last visible sub-property, recursively. const wxPGProperty* GetLastVisibleSubItem() const; // Returns property's default value. If property's value type is not // a built-in one, and "DefaultValue" attribute is not defined, then // this function usually returns Null variant. wxVariant GetDefaultValue() const; // Returns maximum allowed length of property's text value. int GetMaxLength() const { return (int) m_maxLen; } // Determines, recursively, if all children are not unspecified. // pendingList - Assumes members in this wxVariant list as pending // replacement values. bool AreAllChildrenSpecified( wxVariant* pendingList = NULL ) const; // Updates composed values of parent non-category properties, recursively. // Returns topmost property updated. // Must not call SetValue() (as can be called in it). wxPGProperty* UpdateParentValues(); // Returns true if containing grid uses wxPG_EX_AUTO_UNSPECIFIED_VALUES. bool UsesAutoUnspecified() const { return (m_flags & wxPG_PROP_AUTO_UNSPECIFIED) != 0; } // Returns bitmap that appears next to value text. Only returns non-@NULL // bitmap if one was set with SetValueImage(). wxBitmap* GetValueImage() const { return m_valueBitmap; } // Returns property attribute value, null variant if not found. wxVariant GetAttribute( const wxString& name ) const; // Returns named attribute, as string, if found. // Otherwise defVal is returned. wxString GetAttribute( const wxString& name, const wxString& defVal ) const; // Returns named attribute, as long, if found. // Otherwise defVal is returned. long GetAttributeAsLong( const wxString& name, long defVal ) const; // Returns named attribute, as double, if found. // Otherwise defVal is returned. double GetAttributeAsDouble( const wxString& name, double defVal ) const; unsigned int GetDepth() const { return (unsigned int)m_depth; } // Gets flags as a'|' delimited string. Note that flag names are not // prepended with 'wxPG_PROP_'. // flagmask - String will only be made to include flags combined by this parameter. wxString GetFlagsAsString( FlagType flagsMask ) const; // Returns position in parent's array. unsigned int GetIndexInParent() const { return (unsigned int)m_arrIndex; } // Hides or reveals the property. // hide - true for hide, false for reveal. // flags - By default changes are applied recursively. Set this // parameter to wxPG_DONT_RECURSE to prevent this. bool Hide( bool hide, int flags = wxPG_RECURSE ); // Returns true if property has visible children. bool IsExpanded() const { return (!(m_flags & wxPG_PROP_COLLAPSED) && GetChildCount()); } // Returns true if all parents expanded. bool IsVisible() const; // Returns true if property is enabled. bool IsEnabled() const { return !(m_flags & wxPG_PROP_DISABLED); } // If property's editor is created this forces its recreation. // Useful in SetAttribute etc. Returns true if actually did anything. bool RecreateEditor(); // If property's editor is active, then update it's value. void RefreshEditor(); // Sets an attribute for this property. // name - Text identifier of attribute. See @ref propgrid_property_attributes. // value - Value of attribute. // Setting attribute's value to Null variant will simply remove it // from property's set of attributes. void SetAttribute( const wxString& name, wxVariant value ); void SetAttributes( const wxPGAttributeStorage& attributes ); // Set if user can change the property's value to unspecified by // modifying the value of the editor control (usually by clearing // it). Currently, this can work with following properties: // wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty. // enable - Whether to enable or disable this behaviour (it is disabled // by default). void SetAutoUnspecified( bool enable = true ) { ChangeFlag(wxPG_PROP_AUTO_UNSPECIFIED, enable); } // Sets property's background colour. // colour - Background colour to use. // flags - Default is wxPG_RECURSE which causes colour to be set recursively. // Omit this flag to only set colour for the property in question // and not any of its children. void SetBackgroundColour( const wxColour& colour, int flags = wxPG_RECURSE ); // Sets property's text colour. // colour - Text colour to use. // flags - Default is wxPG_RECURSE which causes colour to be set recursively. // Omit this flag to only set colour for the property in question // and not any of its children. void SetTextColour( const wxColour& colour, int flags = wxPG_RECURSE ); // Sets property's default text and background colours. // flags - Default is wxPG_RECURSE which causes colours to be set recursively. // Omit this flag to only set colours for the property in question // and not any of its children. void SetDefaultColours(int flags = wxPG_RECURSE); // Set default value of a property. Synonymous to // SetAttribute("DefaultValue", value); void SetDefaultValue( wxVariant& value ); // Sets editor for a property. // editor - For builtin editors, use wxPGEditor_X, where X is builtin editor's // name (TextCtrl, Choice, etc. see wxPGEditor documentation for full // list). // For custom editors, use pointer you received from // wxPropertyGrid::RegisterEditorClass(). void SetEditor( const wxPGEditor* editor ) { m_customEditor = editor; } // Sets editor for a property, , by editor name. inline void SetEditor( const wxString& editorName ); // Sets cell information for given column. void SetCell( int column, const wxPGCell& cell ); // Sets common value selected for this property. -1 for none. void SetCommonValue( int commonValue ) { m_commonValue = commonValue; } // Sets flags from a '|' delimited string. Note that flag names are not // prepended with 'wxPG_PROP_'. void SetFlagsFromString( const wxString& str ); // Sets property's "is it modified?" flag. Affects children recursively. void SetModifiedStatus( bool modified ) { SetFlagRecursively(wxPG_PROP_MODIFIED, modified); } // Call in OnEvent(), OnButtonClick() etc. to change the property value // based on user input. // This method is const since it doesn't actually modify value, but posts // given variant as pending value, stored in wxPropertyGrid. void SetValueInEvent( wxVariant value ) const; // Call this to set value of the property. // Unlike methods in wxPropertyGrid, this does not automatically update // the display. // Use wxPropertyGrid::ChangePropertyValue() instead if you need to run // through validation process and send property change event. // If you need to change property value in event, based on user input, use // SetValueInEvent() instead. // pList - Pointer to list variant that contains child values. Used to // indicate which children should be marked as modified. // flags - Various flags (for instance, wxPG_SETVAL_REFRESH_EDITOR, which // is enabled by default). void SetValue( wxVariant value, wxVariant* pList = NULL, int flags = wxPG_SETVAL_REFRESH_EDITOR ); // Set wxBitmap in front of the value. This bitmap may be ignored // by custom cell renderers. void SetValueImage( wxBitmap& bmp ); // Sets selected choice and changes property value. // Tries to retain value type, although currently if it is not string, // then it is forced to integer. void SetChoiceSelection( int newValue ); void SetExpanded( bool expanded ) { if ( !expanded ) m_flags |= wxPG_PROP_COLLAPSED; else m_flags &= ~wxPG_PROP_COLLAPSED; } // Sets or clears given property flag. Mainly for internal use. // Setting a property flag never has any side-effect, and is // intended almost exclusively for internal use. So, for // example, if you want to disable a property, call // Enable(false) instead of setting wxPG_PROP_DISABLED flag. void ChangeFlag( wxPGPropertyFlags flag, bool set ) { if ( set ) m_flags |= flag; else m_flags &= ~flag; } // Sets or clears given property flag, recursively. This function is // primarily intended for internal use. void SetFlagRecursively( wxPGPropertyFlags flag, bool set ); // Sets property's help string, which is shown, for example, in // wxPropertyGridManager's description text box. void SetHelpString( const wxString& helpString ) { m_helpString = helpString; } // Sets property's label. // Properties under same parent may have same labels. However, // property names must still remain unique. void SetLabel( const wxString& label ); // Sets new (base) name for property. void SetName( const wxString& newName ); // Changes what sort of parent this property is for its children. // flag - Use one of the following values: wxPG_PROP_MISC_PARENT (for // generic parents), wxPG_PROP_CATEGORY (for categories), or // wxPG_PROP_AGGREGATE (for derived property classes with private // children). // You generally do not need to call this function. void SetParentalType( int flag ) { m_flags &= ~(wxPG_PROP_PROPERTY|wxPG_PROP_PARENTAL_FLAGS); m_flags |= flag; } // Sets property's value to unspecified (i.e. Null variant). void SetValueToUnspecified() { wxVariant val; // Create NULL variant SetValue(val, NULL, wxPG_SETVAL_REFRESH_EDITOR); } // Helper function (for wxPython bindings and such) for settings protected // m_value. void SetValuePlain( wxVariant value ) { m_value = value; } #if wxUSE_VALIDATORS // Sets wxValidator for a property. void SetValidator( const wxValidator& validator ) { m_validator = wxDynamicCast(validator.Clone(),wxValidator); } // Gets assignable version of property's validator. wxValidator* GetValidator() const { if ( m_validator ) return m_validator; return DoGetValidator(); } #endif // wxUSE_VALIDATORS // Returns client data (void*) of a property. void* GetClientData() const { return m_clientData; } // Sets client data (void*) of a property. // This untyped client data has to be deleted manually. void SetClientData( void* clientData ) { m_clientData = clientData; } // Sets client object of a property. void SetClientObject(wxClientData* clientObject) { delete m_clientObject; m_clientObject = clientObject; } // Gets managed client object of a property. wxClientData *GetClientObject() const { return m_clientObject; } // Sets new set of choices for the property. // This operation deselects the property and clears its // value. bool SetChoices( const wxPGChoices& choices ); // Set max length of text in text editor. inline bool SetMaxLength( int maxLen ); // Call with 'false' in OnSetValue to cancel value changes after all // (i.e. cancel 'true' returned by StringToValue() or IntToValue()). void SetWasModified( bool set = true ) { ChangeFlag(wxPG_PROP_WAS_MODIFIED, set); } // Returns property's help or description text. const wxString& GetHelpString() const { return m_helpString; } // Returns true if candidateParent is some parent of this property. // Use, for example, to detect if item is inside collapsed section. bool IsSomeParent( wxPGProperty* candidate_parent ) const; // Adapts list variant into proper value using consecutive // ChildChanged-calls. void AdaptListToValue( wxVariant& list, wxVariant* value ) const; #if wxPG_COMPATIBILITY_1_4 // Adds a private child property. // Use AddPrivateChild() instead. wxDEPRECATED( void AddChild( wxPGProperty* prop ) ); #endif // Adds a private child property. If you use this instead of // wxPropertyGridInterface::Insert() or // wxPropertyGridInterface::AppendIn(), then property's parental // type will automatically be set up to wxPG_PROP_AGGREGATE. In other // words, all properties of this property will become private. void AddPrivateChild( wxPGProperty* prop ); // Use this member function to add independent (i.e. regular) children to // a property. // wxPropertyGrid is not automatically refreshed by this function. wxPGProperty* AppendChild( wxPGProperty* prop ) { return InsertChild(-1, prop); } // Returns height of children, recursively, and // by taking expanded/collapsed status into account. // lh - Line height. Pass result of GetGrid()->GetRowHeight() here. // iMax - Only used (internally) when finding property y-positions. int GetChildrenHeight( int lh, int iMax = -1 ) const; // Returns number of child properties. unsigned int GetChildCount() const { return (unsigned int) m_children.size(); } // Returns sub-property at index i. wxPGProperty* Item( unsigned int i ) const { return m_children[i]; } // Returns last sub-property. wxPGProperty* Last() const { return m_children.back(); } // Returns index of given child property. wxNOT_FOUND if // given property is not child of this. int Index( const wxPGProperty* p ) const; // Puts correct indexes to children void FixIndicesOfChildren( unsigned int starthere = 0 ); // Converts image width into full image offset, with margins. int GetImageOffset( int imageWidth ) const; // Returns wxPropertyGridPageState in which this property resides. wxPropertyGridPageState* GetParentState() const { return m_parentState; } wxPGProperty* GetItemAtY( unsigned int y, unsigned int lh, unsigned int* nextItemY ) const; // Returns property at given virtual y coordinate. wxPGProperty* GetItemAtY( unsigned int y ) const; // Returns (direct) child property with given name (or NULL if not found). wxPGProperty* GetPropertyByName( const wxString& name ) const; // Returns various display-related information for given column #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("don't use GetDisplayInfo function with argument of 'const wxPGCell**' type. Use 'wxPGCell*' argument instead") void GetDisplayInfo( unsigned int column, int choiceIndex, int flags, wxString* pString, const wxPGCell** pCell ); #endif // WXWIN_COMPATIBILITY_3_0 // This function can return modified (customized) cell object. void GetDisplayInfo( unsigned int column, int choiceIndex, int flags, wxString* pString, wxPGCell* pCell ); static wxString* sm_wxPG_LABEL; // This member is public so scripting language bindings // wrapper code can access it freely. void* m_clientData; protected: // Sets property cell in fashion that reduces number of exclusive // copies of cell data. Used when setting, for instance, same // background colour for a number of properties. // firstCol - First column to affect. // lastCol- Last column to affect. // preparedCell - Pre-prepared cell that is used for those which cell data // before this matched unmodCellData. // srcData - If unmodCellData did not match, valid cell data from this // is merged into cell (usually generating new exclusive copy // of cell's data). // unmodCellData - If cell's cell data matches this, its cell is now set to // preparedCell. // ignoreWithFlags - Properties with any one of these flags are skipped. // recursively - If true, apply this operation recursively in child properties. void AdaptiveSetCell( unsigned int firstCol, unsigned int lastCol, const wxPGCell& preparedCell, const wxPGCell& srcData, wxPGCellData* unmodCellData, FlagType ignoreWithFlags, bool recursively ); // Clear cells associated with property. // recursively - If true, apply this operation recursively in child properties. void ClearCells(FlagType ignoreWithFlags, bool recursively); // Makes sure m_cells has size of column+1 (or more). void EnsureCells( unsigned int column ); // Returns (direct) child property with given name (or NULL if not found), // with hint index. // hintIndex - Start looking for the child at this index. // Does not support scope (i.e. Parent.Child notation). wxPGProperty* GetPropertyByNameWH( const wxString& name, unsigned int hintIndex ) const; // This is used by Insert etc. void DoAddChild( wxPGProperty* prop, int index = -1, bool correct_mode = true ); void DoGenerateComposedValue( wxString& text, int argFlags = wxPG_VALUE_IS_CURRENT, const wxVariantList* valueOverrides = NULL, wxPGHashMapS2S* childResults = NULL ) const; bool DoHide( bool hide, int flags ); void DoSetName(const wxString& str) { m_name = str; } // Deletes all sub-properties. void Empty(); bool HasCell( unsigned int column ) const { return m_cells.size() > column; } void InitAfterAdded( wxPropertyGridPageState* pageState, wxPropertyGrid* propgrid ); // Returns true if child property is selected. bool IsChildSelected( bool recursive = false ) const; // Removes child property with given pointer. Does not delete it. void RemoveChild( wxPGProperty* p ); // Removes child property at given index. Does not delete it. void RemoveChild(unsigned int index); // Sorts children using specified comparison function. void SortChildren(int (*fCmp)(wxPGProperty**, wxPGProperty**)); void DoEnable( bool enable ); void DoPreAddChild( int index, wxPGProperty* prop ); void SetParentState( wxPropertyGridPageState* pstate ) { m_parentState = pstate; } void SetFlag( wxPGPropertyFlags flag ) { // // NB: While using wxPGPropertyFlags here makes it difficult to // combine different flags, it usefully prevents user from // using incorrect flags (say, wxWindow styles). m_flags |= flag; } void ClearFlag( FlagType flag ) { m_flags &= ~(flag); } // Called when the property is being removed from the grid and/or // page state (but *not* when it is also deleted). void OnDetached(wxPropertyGridPageState* state, wxPropertyGrid* propgrid); // Call after fixed sub-properties added/removed after creation. // if oldSelInd >= 0 and < new max items, then selection is // moved to it. void SubPropsChanged( int oldSelInd = -1 ); int GetY2( int lh ) const; wxString m_label; wxString m_name; wxPGProperty* m_parent; wxPropertyGridPageState* m_parentState; wxClientData* m_clientObject; // Overrides editor returned by property class const wxPGEditor* m_customEditor; #if wxUSE_VALIDATORS // Editor is going to get this validator wxValidator* m_validator; #endif // Show this in front of the value // // TODO: Can bitmap be implemented with wxPGCell? wxBitmap* m_valueBitmap; wxVariant m_value; wxPGAttributeStorage m_attributes; wxVector<wxPGProperty*> m_children; // Extended cell information wxVector<wxPGCell> m_cells; // Choices shown in drop-down list of editor control. wxPGChoices m_choices; // Help shown in statusbar or help box. wxString m_helpString; // Index in parent's property array. unsigned int m_arrIndex; // If not -1, then overrides m_value int m_commonValue; FlagType m_flags; // Maximum length (mainly for string properties). Could be in some sort of // wxBaseStringProperty, but currently, for maximum flexibility and // compatibility, we'll stick it here. Anyway, we had 3 excess bytes to use // so short int will fit in just fine. short m_maxLen; // Root has 0, categories etc. at that level 1, etc. unsigned char m_depth; // m_depthBgCol indicates width of background colour between margin and item // (essentially this is category's depth, if none then equals m_depth). unsigned char m_depthBgCol; private: // Called in constructors. void Init(); void Init( const wxString& label, const wxString& name ); }; // ----------------------------------------------------------------------- // // Property class declaration helper macros // (wxPGRootPropertyClass and wxPropertyCategory require this). // #define WX_PG_DECLARE_DOGETEDITORCLASS \ virtual const wxPGEditor* DoGetEditorClass() const wxOVERRIDE; #ifndef WX_PG_DECLARE_PROPERTY_CLASS #define WX_PG_DECLARE_PROPERTY_CLASS(CLASSNAME) \ public: \ wxDECLARE_DYNAMIC_CLASS(CLASSNAME); \ WX_PG_DECLARE_DOGETEDITORCLASS \ private: #endif // Implements sans constructor function. Also, first arg is class name, not // property name. #define wxPG_IMPLEMENT_PROPERTY_CLASS_PLAIN(PROPNAME, EDITOR) \ const wxPGEditor* PROPNAME::DoGetEditorClass() const \ { \ return wxPGEditor_##EDITOR; \ } #if WXWIN_COMPATIBILITY_3_0 // This macro is deprecated. Use wxPG_IMPLEMENT_PROPERTY_CLASS_PLAIN instead. #define WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(PROPNAME,T,EDITOR) \ wxPG_IMPLEMENT_PROPERTY_CLASS_PLAIN(PROPNAME, EDITOR) #endif // WXWIN_COMPATIBILITY_3_0 // ----------------------------------------------------------------------- // Root parent property. class WXDLLIMPEXP_PROPGRID wxPGRootProperty : public wxPGProperty { public: WX_PG_DECLARE_PROPERTY_CLASS(wxPGRootProperty) public: // Constructor. wxPGRootProperty( const wxString& name = wxS("<Root>") ); virtual ~wxPGRootProperty(); virtual bool StringToValue( wxVariant&, const wxString&, int ) const wxOVERRIDE { return false; } protected: }; // ----------------------------------------------------------------------- // Category (caption) property. class WXDLLIMPEXP_PROPGRID wxPropertyCategory : public wxPGProperty { friend class wxPropertyGrid; friend class wxPropertyGridPageState; WX_PG_DECLARE_PROPERTY_CLASS(wxPropertyCategory) public: // Default constructor is only used in special cases. wxPropertyCategory(); wxPropertyCategory( const wxString& label, const wxString& name = wxPG_LABEL ); ~wxPropertyCategory(); int GetTextExtent( const wxWindow* wnd, const wxFont& font ) const; virtual wxString ValueToString( wxVariant& value, int argFlags ) const wxOVERRIDE; virtual wxString GetValueAsString( int argFlags = 0 ) const wxOVERRIDE; protected: void SetTextColIndex( unsigned int colInd ) { m_capFgColIndex = (wxByte) colInd; } unsigned int GetTextColIndex() const { return (unsigned int) m_capFgColIndex; } void CalculateTextExtent(const wxWindow* wnd, const wxFont& font); int m_textExtent; // pre-calculated length of text wxByte m_capFgColIndex; // caption text colour index private: void Init(); }; // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_PROPERTY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/propgriddefs.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/propgriddefs.h // Purpose: wxPropertyGrid miscellaneous definitions // Author: Jaakko Salli // Modified by: // Created: 2008-08-31 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_PROPGRIDDEFS_H_ #define _WX_PROPGRID_PROPGRIDDEFS_H_ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/dynarray.h" #include "wx/vector.h" #include "wx/hashmap.h" #include "wx/hashset.h" #include "wx/variant.h" #include "wx/any.h" #include "wx/longlong.h" #include "wx/clntdata.h" // ----------------------------------------------------------------------- // // Here are some platform dependent defines // NOTE: More in propertygrid.cpp // // NB: Only define wxPG_TEXTCTRLXADJUST for platforms that do not // (yet) support wxTextEntry::SetMargins() for the left margin. #if defined(__WXMSW__) // space between vertical line and value text #define wxPG_XBEFORETEXT 4 // space between vertical line and value editor control #define wxPG_XBEFOREWIDGET 1 // left margin can be set with wxTextEntry::SetMargins() #undef wxPG_TEXTCTRLXADJUST // comment to use bitmap buttons #define wxPG_ICON_WIDTH 9 // 1 if wxRendererNative should be employed #define wxPG_USE_RENDERER_NATIVE 1 // Enable tooltips #define wxPG_SUPPORT_TOOLTIPS 1 // width of optional bitmap/image in front of property #define wxPG_CUSTOM_IMAGE_WIDTH 20 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_NO_CHILD_EVT_MOTION 0 #define wxPG_NAT_BUTTON_BORDER_ANY 1 #define wxPG_NAT_BUTTON_BORDER_X 1 #define wxPG_NAT_BUTTON_BORDER_Y 1 // If 1 then controls are refreshed explicitly in a few places #define wxPG_REFRESH_CONTROLS 0 #elif defined(__WXGTK__) // space between vertical line and value text #define wxPG_XBEFORETEXT 5 // space between vertical line and value editor control #define wxPG_XBEFOREWIDGET 1 // x position adjustment for wxTextCtrl (and like) // left margin can be set with wxTextEntry::SetMargins() #undef wxPG_TEXTCTRLXADJUST // comment to use bitmap buttons #define wxPG_ICON_WIDTH 9 // 1 if wxRendererNative should be employed #define wxPG_USE_RENDERER_NATIVE 1 // Enable tooltips #define wxPG_SUPPORT_TOOLTIPS 1 // width of optional bitmap/image in front of property #define wxPG_CUSTOM_IMAGE_WIDTH 20 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_NO_CHILD_EVT_MOTION 1 #define wxPG_NAT_BUTTON_BORDER_ANY 1 #define wxPG_NAT_BUTTON_BORDER_X 1 #define wxPG_NAT_BUTTON_BORDER_Y 1 // If 1 then controls are refreshed after selected was drawn. #define wxPG_REFRESH_CONTROLS 1 #elif defined(__WXMAC__) // space between vertical line and value text #define wxPG_XBEFORETEXT 4 // space between vertical line and value editor widget #define wxPG_XBEFOREWIDGET 1 // x position adjustment for wxTextCtrl (and like) // left margin cannot be set with wxTextEntry::SetMargins() #define wxPG_TEXTCTRLXADJUST 1 // comment to use bitmap buttons #define wxPG_ICON_WIDTH 11 // 1 if wxRendererNative should be employed #define wxPG_USE_RENDERER_NATIVE 1 // Enable tooltips #define wxPG_SUPPORT_TOOLTIPS 1 // width of optional bitmap/image in front of property #define wxPG_CUSTOM_IMAGE_WIDTH 20 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_NO_CHILD_EVT_MOTION 0 #define wxPG_NAT_BUTTON_BORDER_ANY 0 #define wxPG_NAT_BUTTON_BORDER_X 0 #define wxPG_NAT_BUTTON_BORDER_Y 0 // If 1 then controls are refreshed after selected was drawn. #define wxPG_REFRESH_CONTROLS 0 #else // defaults // space between vertical line and value text #define wxPG_XBEFORETEXT 5 // space between vertical line and value editor widget #define wxPG_XBEFOREWIDGET 1 // x position adjustment for wxTextCtrl (and like) // left margin cannot be set with wxTextEntry::SetMargins() #define wxPG_TEXTCTRLXADJUST 3 // comment to use bitmap buttons #define wxPG_ICON_WIDTH 9 // 1 if wxRendererNative should be employed #define wxPG_USE_RENDERER_NATIVE 0 // Enable tooltips #define wxPG_SUPPORT_TOOLTIPS 0 // width of optional bitmap/image in front of property #define wxPG_CUSTOM_IMAGE_WIDTH 20 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_NO_CHILD_EVT_MOTION 1 #define wxPG_NAT_BUTTON_BORDER_ANY 0 #define wxPG_NAT_BUTTON_BORDER_X 0 #define wxPG_NAT_BUTTON_BORDER_Y 0 // If 1 then controls are refreshed after selected was drawn. #define wxPG_REFRESH_CONTROLS 0 #endif // platform #define wxPG_CONTROL_MARGIN 0 // space between splitter and control #define wxCC_CUSTOM_IMAGE_MARGIN1 4 // before image #define wxCC_CUSTOM_IMAGE_MARGIN2 5 // after image #define DEFAULT_IMAGE_OFFSET_INCREMENT \ (wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2) #define wxPG_DRAG_MARGIN 30 #if wxPG_NO_CHILD_EVT_MOTION #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right #else #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right #endif // Use this macro to generate standard custom image height from #define wxPG_STD_CUST_IMAGE_HEIGHT(LINEHEIGHT) ((LINEHEIGHT)-3) // Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead // (for tree buttons) //#undef wxPG_ICON_WIDTH #if WXWIN_COMPATIBILITY_2_8 #define wxPG_COMPATIBILITY_1_4 1 #else #define wxPG_COMPATIBILITY_1_4 0 #endif // Need to force disable tooltips? #if !wxUSE_TOOLTIPS #undef wxPG_SUPPORT_TOOLTIPS #define wxPG_SUPPORT_TOOLTIPS 0 #endif // Set 1 to include advanced properties (wxFontProperty, wxColourProperty, etc.) #ifndef wxPG_INCLUDE_ADVPROPS #define wxPG_INCLUDE_ADVPROPS 1 #endif // Set 1 to include checkbox editor class #define wxPG_INCLUDE_CHECKBOX 1 // ----------------------------------------------------------------------- class wxPGEditor; class wxPGProperty; class wxPropertyCategory; class wxPGChoices; class wxPropertyGridPageState; class wxPGCell; class wxPGCellRenderer; class wxPGChoiceEntry; class wxPGPropArgCls; class wxPropertyGridInterface; class wxPropertyGrid; class wxPropertyGridEvent; class wxPropertyGridManager; class wxPGOwnerDrawnComboBox; class wxPGEditorDialogAdapter; class wxPGValidationInfo; // ----------------------------------------------------------------------- // Some miscellaneous values, types and macros. // Used to tell wxPGProperty to use label as name as well #define wxPG_LABEL (*wxPGProperty::sm_wxPG_LABEL) // This is the value placed in wxPGProperty::sm_wxPG_LABEL #define wxPG_LABEL_STRING wxS("@!") #if WXWIN_COMPATIBILITY_3_0 #define wxPG_NULL_BITMAP wxNullBitmap #endif // WXWIN_COMPATIBILITY_3_0 #define wxPG_COLOUR_BLACK (*wxBLACK) // Convert Red, Green and Blue to a single 32-bit value. #define wxPG_COLOUR(R,G,B) ((wxUint32)((R)+((G)<<8)+((B)<<16))) // If property is supposed to have custom-painted image, then returning // this in OnMeasureImage() will usually be enough. #define wxPG_DEFAULT_IMAGE_SIZE wxDefaultSize // This callback function is used for sorting properties. // Call wxPropertyGrid::SetSortFunction() to set it. // Sort function should return a value greater than 0 if position of p1 is // after p2. So, for instance, when comparing property names, you can use // following implementation: // int MyPropertySortFunction(wxPropertyGrid* propGrid, // wxPGProperty* p1, // wxPGProperty* p2) // { // return p1->GetBaseName().compare( p2->GetBaseName() ); // } typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid, wxPGProperty* p1, wxPGProperty* p2); #if WXWIN_COMPATIBILITY_3_0 typedef wxString wxPGCachedString; #endif // ----------------------------------------------------------------------- // Used to indicate wxPGChoices::Add etc. that the value is actually not given // by the caller. #define wxPG_INVALID_VALUE INT_MAX // ----------------------------------------------------------------------- WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxPGProperty*, wxArrayPGProperty, wxBaseArrayPtrVoid, class WXDLLIMPEXP_PROPGRID); WX_DECLARE_STRING_HASH_MAP_WITH_DECL(void*, wxPGHashMapS2P, class WXDLLIMPEXP_PROPGRID); WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxString, wxPGHashMapS2S, class WXDLLIMPEXP_PROPGRID); WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(void*, wxPGHashMapP2P, class WXDLLIMPEXP_PROPGRID); WX_DECLARE_HASH_MAP_WITH_DECL(wxInt32, wxInt32, wxIntegerHash, wxIntegerEqual, wxPGHashMapI2I, class WXDLLIMPEXP_PROPGRID); WX_DECLARE_HASH_SET_WITH_DECL(int, wxIntegerHash, wxIntegerEqual, wxPGHashSetInt, class WXDLLIMPEXP_PROPGRID); WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxObject*, wxArrayPGObject, wxBaseArrayPtrVoid, class WXDLLIMPEXP_PROPGRID); // ----------------------------------------------------------------------- enum wxPG_PROPERTYVALUES_FLAGS { // Flag for wxPropertyGridInterface::SetProperty* functions, // wxPropertyGridInterface::HideProperty(), etc. // Apply changes only for the property in question. wxPG_DONT_RECURSE = 0x00000000, // Flag for wxPropertyGridInterface::GetPropertyValues(). // Use this flag to retain category structure; each sub-category // will be its own wxVariantList of wxVariant. wxPG_KEEP_STRUCTURE = 0x00000010, // Flag for wxPropertyGridInterface::SetProperty* functions, // wxPropertyGridInterface::HideProperty(), etc. // Apply changes recursively for the property and all its children. wxPG_RECURSE = 0x00000020, // Flag for wxPropertyGridInterface::GetPropertyValues(). // Use this flag to include property attributes as well. wxPG_INC_ATTRIBUTES = 0x00000040, // Used when first starting recursion. wxPG_RECURSE_STARTS = 0x00000080, // Force value change. wxPG_FORCE = 0x00000100, // Only sort categories and their immediate children. // Sorting done by wxPG_AUTO_SORT option uses this. wxPG_SORT_TOP_LEVEL_ONLY = 0x00000200 }; // ----------------------------------------------------------------------- // Misc. argument flags. enum wxPG_MISC_ARG_FLAGS { // Get/Store full value instead of displayed value. wxPG_FULL_VALUE = 0x00000001, // Perform special action in case of unsuccessful conversion. wxPG_REPORT_ERROR = 0x00000002, wxPG_PROPERTY_SPECIFIC = 0x00000004, // Get/Store editable value instead of displayed one (should only be // different in the case of common values) wxPG_EDITABLE_VALUE = 0x00000008, // Used when dealing with fragments of composite string value wxPG_COMPOSITE_FRAGMENT = 0x00000010, // Means property for which final string value is for cannot really be // edited. wxPG_UNEDITABLE_COMPOSITE_FRAGMENT = 0x00000020, // ValueToString() called from GetValueAsString() // (guarantees that input wxVariant value is current own value) wxPG_VALUE_IS_CURRENT = 0x00000040, // Value is being set programmatically (i.e. not by user) wxPG_PROGRAMMATIC_VALUE = 0x00000080 }; // ----------------------------------------------------------------------- // wxPGProperty::SetValue() flags enum wxPG_SETVALUE_FLAGS { wxPG_SETVAL_REFRESH_EDITOR = 0x0001, wxPG_SETVAL_AGGREGATED = 0x0002, wxPG_SETVAL_FROM_PARENT = 0x0004, wxPG_SETVAL_BY_USER = 0x0008 // Set if value changed by user }; // ----------------------------------------------------------------------- // // Valid constants for wxPG_UINT_BASE attribute // (long because of wxVariant constructor) #define wxPG_BASE_OCT (long)8 #define wxPG_BASE_DEC (long)10 #define wxPG_BASE_HEX (long)16 #define wxPG_BASE_HEXL (long)32 // // Valid constants for wxPG_UINT_PREFIX attribute #define wxPG_PREFIX_NONE (long)0 #define wxPG_PREFIX_0x (long)1 #define wxPG_PREFIX_DOLLAR_SIGN (long)2 // ----------------------------------------------------------------------- // Editor class. // Editor accessor (for backwards compatibility use only). #define wxPG_EDITOR(T) wxPGEditor_##T // Macro for declaring editor class, with optional impexpdecl part. #ifndef WX_PG_DECLARE_EDITOR_WITH_DECL #define WX_PG_DECLARE_EDITOR_WITH_DECL(EDITOR,DECL) \ extern DECL wxPGEditor* wxPGEditor_##EDITOR; \ extern DECL wxPGEditor* wxPGConstruct##EDITOR##EditorClass(); #endif // Declare editor class. #define WX_PG_DECLARE_EDITOR(EDITOR) \ extern wxPGEditor* wxPGEditor_##EDITOR; \ extern wxPGEditor* wxPGConstruct##EDITOR##EditorClass(); // Declare built-in editor classes. WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrl,WXDLLIMPEXP_PROPGRID) WX_PG_DECLARE_EDITOR_WITH_DECL(Choice,WXDLLIMPEXP_PROPGRID) WX_PG_DECLARE_EDITOR_WITH_DECL(ComboBox,WXDLLIMPEXP_PROPGRID) WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrlAndButton,WXDLLIMPEXP_PROPGRID) #if wxPG_INCLUDE_CHECKBOX WX_PG_DECLARE_EDITOR_WITH_DECL(CheckBox,WXDLLIMPEXP_PROPGRID) #endif WX_PG_DECLARE_EDITOR_WITH_DECL(ChoiceAndButton,WXDLLIMPEXP_PROPGRID) // ----------------------------------------------------------------------- #ifndef SWIG // // Macro WXVARIANT allows creation of wxVariant from any type supported by // wxWidgets internally, and of all types created using // WX_PG_DECLARE_VARIANT_DATA. template<class T> wxVariant WXVARIANT( const T& WXUNUSED(value) ) { wxFAIL_MSG(wxS("Code should always call specializations of this template")); return wxVariant(); } template<> inline wxVariant WXVARIANT( const int& value ) { return wxVariant((long)value); } template<> inline wxVariant WXVARIANT( const long& value ) { return wxVariant(value); } template<> inline wxVariant WXVARIANT( const bool& value ) { return wxVariant(value); } template<> inline wxVariant WXVARIANT( const double& value ) { return wxVariant(value); } template<> inline wxVariant WXVARIANT( const wxArrayString& value ) { return wxVariant(value); } template<> inline wxVariant WXVARIANT( const wxString& value ) { return wxVariant(value); } #if wxUSE_LONGLONG template<> inline wxVariant WXVARIANT( const wxLongLong& value ) { return wxVariant(value); } template<> inline wxVariant WXVARIANT( const wxULongLong& value ) { return wxVariant(value); } #endif #if wxUSE_DATETIME template<> inline wxVariant WXVARIANT( const wxDateTime& value ) { return wxVariant(value); } #endif // // These are modified versions of DECLARE/WX_PG_IMPLEMENT_VARIANT_DATA // macros found in variant.h. Differences are as follows: // * These support non-wxObject data // * These implement classname##RefFromVariant function which returns // reference to data within. // * const char* classname##_VariantType which equals classname. // * WXVARIANT // #define WX_PG_DECLARE_VARIANT_DATA(classname) \ WX_PG_DECLARE_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) #define WX_PG_DECLARE_VARIANT_DATA_EXPORTED(classname,expdecl) \ expdecl classname& operator << ( classname &object, const wxVariant &variant ); \ expdecl wxVariant& operator << ( wxVariant &variant, const classname &object ); \ expdecl const classname& classname##RefFromVariant( const wxVariant& variant ); \ expdecl classname& classname##RefFromVariant( wxVariant& variant ); \ template<> inline wxVariant WXVARIANT( const classname& value ) \ { \ wxVariant variant; \ variant << value; \ return variant; \ } \ extern expdecl const char* classname##_VariantType; #define WX_PG_IMPLEMENT_VARIANT_DATA(classname) \ WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) // Add getter (i.e. classname << variant) separately to allow // custom implementations. #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ_NO_GETTER(classname,expdecl) \ const char* classname##_VariantType = #classname; \ class classname##VariantData: public wxVariantData \ { \ public:\ classname##VariantData() {} \ classname##VariantData( const classname &value ) { m_value = value; } \ \ classname &GetValue() { return m_value; } \ \ const classname &GetValue() const { return m_value; } \ \ virtual bool Eq(wxVariantData& data) const wxOVERRIDE; \ \ virtual wxString GetType() const wxOVERRIDE; \ \ virtual wxVariantData* Clone() const wxOVERRIDE { return new classname##VariantData(m_value); } \ \ DECLARE_WXANY_CONVERSION() \ protected:\ classname m_value; \ };\ \ IMPLEMENT_TRIVIAL_WXANY_CONVERSION(classname, classname##VariantData) \ \ wxString classname##VariantData::GetType() const\ {\ return wxS(#classname);\ }\ \ expdecl wxVariant& operator << ( wxVariant &variant, const classname &value )\ {\ classname##VariantData *data = new classname##VariantData( value );\ variant.SetData( data );\ return variant;\ } \ expdecl classname& classname##RefFromVariant( wxVariant& variant ) \ { \ wxASSERT_MSG( variant.GetType() == wxS(#classname), \ wxString::Format(wxS("Variant type should have been '%s'") \ wxS("instead of '%s'"), \ wxS(#classname), \ variant.GetType())); \ classname##VariantData *data = \ (classname##VariantData*) variant.GetData(); \ return data->GetValue();\ } \ expdecl const classname& classname##RefFromVariant( const wxVariant& variant ) \ { \ wxASSERT_MSG( variant.GetType() == wxS(#classname), \ wxString::Format(wxS("Variant type should have been '%s'") \ wxS("instead of '%s'"), \ wxS(#classname), \ variant.GetType())); \ classname##VariantData *data = \ (classname##VariantData*) variant.GetData(); \ return data->GetValue();\ } #define WX_PG_IMPLEMENT_VARIANT_DATA_GETTER(classname, expdecl) \ expdecl classname& operator << ( classname &value, const wxVariant &variant )\ {\ wxASSERT( variant.GetType() == #classname );\ \ classname##VariantData *data = (classname##VariantData*) variant.GetData();\ value = data->GetValue();\ return value;\ } #define WX_PG_IMPLEMENT_VARIANT_DATA_EQ(classname, expdecl) \ bool classname##VariantData::Eq(wxVariantData& data) const \ {\ wxASSERT( GetType() == data.GetType() );\ \ classname##VariantData & otherData = (classname##VariantData &) data;\ \ return otherData.m_value == m_value;\ } // implements a wxVariantData-derived class using for the Eq() method the // operator== which must have been provided by "classname" #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname,expdecl) \ WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ_NO_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ WX_PG_IMPLEMENT_VARIANT_DATA_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ WX_PG_IMPLEMENT_VARIANT_DATA_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) #define WX_PG_IMPLEMENT_VARIANT_DATA(classname) \ WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) // with Eq() implementation that always returns false #define WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_DUMMY_EQ(classname,expdecl) \ WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_NO_EQ_NO_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ WX_PG_IMPLEMENT_VARIANT_DATA_GETTER(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ \ bool classname##VariantData::Eq(wxVariantData& WXUNUSED(data)) const \ {\ return false; \ } #define WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(classname) \ WX_PG_IMPLEMENT_VARIANT_DATA_EXPORTED_DUMMY_EQ(classname, wxEMPTY_PARAMETER_VALUE) WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxPoint, WXDLLIMPEXP_PROPGRID) WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxSize, WXDLLIMPEXP_PROPGRID) WX_PG_DECLARE_VARIANT_DATA_EXPORTED(wxArrayInt, WXDLLIMPEXP_PROPGRID) DECLARE_VARIANT_OBJECT_EXPORTED(wxFont, WXDLLIMPEXP_PROPGRID) template<> inline wxVariant WXVARIANT( const wxFont& value ) { wxVariant variant; variant << value; return variant; } template<> inline wxVariant WXVARIANT( const wxColour& value ) { wxVariant variant; variant << value; return variant; } // Define constants for common wxVariant type strings #define wxPG_VARIANT_TYPE_STRING wxPGGlobalVars->m_strstring #define wxPG_VARIANT_TYPE_LONG wxPGGlobalVars->m_strlong #define wxPG_VARIANT_TYPE_BOOL wxPGGlobalVars->m_strbool #define wxPG_VARIANT_TYPE_LIST wxPGGlobalVars->m_strlist #define wxPG_VARIANT_TYPE_DOUBLE wxS("double") #define wxPG_VARIANT_TYPE_ARRSTRING wxS("arrstring") #if wxUSE_DATETIME #define wxPG_VARIANT_TYPE_DATETIME wxS("datetime") #endif #if wxUSE_LONGLONG #define wxPG_VARIANT_TYPE_LONGLONG wxS("longlong") #define wxPG_VARIANT_TYPE_ULONGLONG wxS("ulonglong") #endif #endif // !SWIG // ----------------------------------------------------------------------- // // Tokenizer macros. // NOTE: I have made two versions - worse ones (performance and consistency // wise) use wxStringTokenizer and better ones (may have unfound bugs) // use custom code. // #include "wx/tokenzr.h" // TOKENIZER1 can be done with wxStringTokenizer #define WX_PG_TOKENIZER1_BEGIN(WXSTRING,DELIMITER) \ wxStringTokenizer tkz(WXSTRING,DELIMITER,wxTOKEN_RET_EMPTY); \ while ( tkz.HasMoreTokens() ) \ { \ wxString token = tkz.GetNextToken(); \ token.Trim(true); \ token.Trim(false); #define WX_PG_TOKENIZER1_END() \ } // // 2nd version: tokens are surrounded by DELIMITERs (for example, C-style // strings). TOKENIZER2 must use custom code (a class) for full compliance with // " surrounded strings with \" inside. // // class implementation is in propgrid.cpp // class WXDLLIMPEXP_PROPGRID wxPGStringTokenizer { public: wxPGStringTokenizer( const wxString& str, wxChar delimiter ); ~wxPGStringTokenizer(); bool HasMoreTokens(); // not const so we can do some stuff in it wxString GetNextToken(); protected: const wxString* m_str; wxString::const_iterator m_curPos; wxString m_readyToken; wxUniChar m_delimiter; }; #define WX_PG_TOKENIZER2_BEGIN(WXSTRING,DELIMITER) \ wxPGStringTokenizer tkz(WXSTRING,DELIMITER); \ while ( tkz.HasMoreTokens() ) \ { \ wxString token = tkz.GetNextToken(); #define WX_PG_TOKENIZER2_END() \ } // ----------------------------------------------------------------------- // wxVector utilities // Utility to check if specific item is in a vector. template<typename T> inline bool wxPGItemExistsInVector(const wxVector<T>& vector, const T& item) { #if wxUSE_STL return std::find(vector.begin(), vector.end(), item) != vector.end(); #else for (typename wxVector<T>::const_iterator it = vector.begin(); it != vector.end(); ++it) { if ( *it == item ) return true; } return false; #endif // wxUSE_STL/!wxUSE_STL } // Utility to determine the index of the item in the vector. template<typename T> inline int wxPGItemIndexInVector(const wxVector<T>& vector, const T& item) { #if wxUSE_STL typename wxVector<T>::const_iterator it = std::find(vector.begin(), vector.end(), item); if ( it != vector.end() ) return (int)(it - vector.begin()); return wxNOT_FOUND; #else for (typename wxVector<T>::const_iterator it = vector.begin(); it != vector.end(); ++it) { if ( *it == item ) return (int)(it - vector.begin()); } return wxNOT_FOUND; #endif // wxUSE_STL/!wxUSE_STL } // Utility to remove given item from the vector. template<typename T> inline void wxPGRemoveItemFromVector(wxVector<T>& vector, const T& item) { #if wxUSE_STL typename wxVector<T>::iterator it = std::find(vector.begin(), vector.end(), item); if ( it != vector.end() ) { vector.erase(it); } #else for (typename wxVector<T>::iterator it = vector.begin(); it != vector.end(); ++it) { if ( *it == item ) { vector.erase(it); return; } } #endif // wxUSE_STL/!wxUSE_STL } // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_PROPGRIDDEFS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/propgridpagestate.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/propgridpagestate.h // Purpose: wxPropertyGridPageState class // Author: Jaakko Salli // Modified by: // Created: 2008-08-24 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_PROPGRIDPAGESTATE_H_ #define _WX_PROPGRID_PROPGRIDPAGESTATE_H_ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/propgrid/property.h" // ----------------------------------------------------------------------- // A return value from wxPropertyGrid::HitTest(), // contains all you need to know about an arbitrary location on the grid. class WXDLLIMPEXP_PROPGRID wxPropertyGridHitTestResult { friend class wxPropertyGridPageState; public: wxPropertyGridHitTestResult() { m_property = NULL; m_column = -1; m_splitter = -1; m_splitterHitOffset = 0; } ~wxPropertyGridHitTestResult() { } // Returns column hit. -1 for margin. int GetColumn() const { return m_column; } // Returns property hit. NULL if empty space below // properties was hit instead. wxPGProperty* GetProperty() const { return m_property; } // Returns index of splitter hit, -1 for none. int GetSplitter() const { return m_splitter; } // If splitter hit, then this member function // returns offset to the exact splitter position. int GetSplitterHitOffset() const { return m_splitterHitOffset; } private: // Property. NULL if empty space below properties was hit. wxPGProperty* m_property; // Column. -1 for margin. int m_column; // Index of splitter hit, -1 for none. int m_splitter; // If splitter hit, offset to that. int m_splitterHitOffset; }; // ----------------------------------------------------------------------- #define wxPG_IT_CHILDREN(A) ((A)<<16) // NOTES: At lower 16-bits, there are flags to check if item will be included. // At higher 16-bits, there are same flags, but to instead check if children // will be included. enum wxPG_ITERATOR_FLAGS { // Iterate through 'normal' property items (does not include children of // aggregate or hidden items by default). wxPG_ITERATE_PROPERTIES = wxPG_PROP_PROPERTY | wxPG_PROP_MISC_PARENT | wxPG_PROP_AGGREGATE | wxPG_PROP_COLLAPSED | wxPG_IT_CHILDREN(wxPG_PROP_MISC_PARENT) | wxPG_IT_CHILDREN(wxPG_PROP_CATEGORY), // Iterate children of collapsed parents, and individual items that are hidden. wxPG_ITERATE_HIDDEN = wxPG_PROP_HIDDEN | wxPG_IT_CHILDREN(wxPG_PROP_COLLAPSED), // Iterate children of parent that is an aggregate property (ie has fixed // children). wxPG_ITERATE_FIXED_CHILDREN = wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE) | wxPG_ITERATE_PROPERTIES, // Iterate categories. // Note that even without this flag, children of categories are still iterated // through. wxPG_ITERATE_CATEGORIES = wxPG_PROP_CATEGORY | wxPG_IT_CHILDREN(wxPG_PROP_CATEGORY) | wxPG_PROP_COLLAPSED, wxPG_ITERATE_ALL_PARENTS = wxPG_PROP_MISC_PARENT | wxPG_PROP_AGGREGATE | wxPG_PROP_CATEGORY, wxPG_ITERATE_ALL_PARENTS_RECURSIVELY = wxPG_ITERATE_ALL_PARENTS | wxPG_IT_CHILDREN( wxPG_ITERATE_ALL_PARENTS), wxPG_ITERATOR_FLAGS_ALL = wxPG_PROP_PROPERTY | wxPG_PROP_MISC_PARENT | wxPG_PROP_AGGREGATE | wxPG_PROP_HIDDEN | wxPG_PROP_CATEGORY | wxPG_PROP_COLLAPSED, wxPG_ITERATOR_MASK_OP_ITEM = wxPG_ITERATOR_FLAGS_ALL, // (wxPG_PROP_MISC_PARENT|wxPG_PROP_AGGREGATE|wxPG_PROP_CATEGORY) wxPG_ITERATOR_MASK_OP_PARENT = wxPG_ITERATOR_FLAGS_ALL, // Combines all flags needed to iterate through visible properties // (ie. hidden properties and children of collapsed parents are skipped). wxPG_ITERATE_VISIBLE = wxPG_ITERATE_PROPERTIES | wxPG_PROP_CATEGORY | wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE), // Iterate all items. wxPG_ITERATE_ALL = wxPG_ITERATE_VISIBLE | wxPG_ITERATE_HIDDEN, // Iterate through individual properties (ie categories and children of // aggregate properties are skipped). wxPG_ITERATE_NORMAL = wxPG_ITERATE_PROPERTIES | wxPG_ITERATE_HIDDEN, // Default iterator flags. wxPG_ITERATE_DEFAULT = wxPG_ITERATE_NORMAL }; #define wxPG_ITERATOR_CREATE_MASKS(FLAGS, A, B) \ A = (FLAGS ^ wxPG_ITERATOR_MASK_OP_ITEM) & \ wxPG_ITERATOR_MASK_OP_ITEM & 0xFFFF; \ B = ((FLAGS>>16) ^ wxPG_ITERATOR_MASK_OP_PARENT) & \ wxPG_ITERATOR_MASK_OP_PARENT & 0xFFFF; // Macro to test if children of PWC should be iterated through #define wxPG_ITERATOR_PARENTEXMASK_TEST(PWC, PARENTMASK) \ ( \ !PWC->HasFlag(PARENTMASK) && \ PWC->GetChildCount() \ ) // Base for wxPropertyGridIterator classes. class WXDLLIMPEXP_PROPGRID wxPropertyGridIteratorBase { public: wxPropertyGridIteratorBase() { } void Assign( const wxPropertyGridIteratorBase& it ); bool AtEnd() const { return m_property == NULL; } // Get current property. wxPGProperty* GetProperty() const { return m_property; } void Init( wxPropertyGridPageState* state, int flags, wxPGProperty* property, int dir = 1 ); void Init( wxPropertyGridPageState* state, int flags, int startPos = wxTOP, int dir = 0 ); // Iterate to the next property. void Next( bool iterateChildren = true ); // Iterate to the previous property. void Prev(); // Set base parent, i.e. a property when, in which iteration returns, it // ends. // Default base parent is the root of the used wxPropertyGridPageState. void SetBaseParent( wxPGProperty* baseParent ) { m_baseParent = baseParent; } protected: wxPGProperty* m_property; private: wxPropertyGridPageState* m_state; wxPGProperty* m_baseParent; // Masks are used to quickly exclude items wxPGProperty::FlagType m_itemExMask; wxPGProperty::FlagType m_parentExMask; }; #define wxPG_IMPLEMENT_ITERATOR(CLASS, PROPERTY, STATE) \ CLASS( STATE* state, int flags = wxPG_ITERATE_DEFAULT, \ PROPERTY* property = NULL, int dir = 1 ) \ : wxPropertyGridIteratorBase() \ { Init( (wxPropertyGridPageState*)state, flags, \ (wxPGProperty*)property, dir ); } \ CLASS( STATE* state, int flags, int startPos, int dir = 0 ) \ : wxPropertyGridIteratorBase() \ { Init( (wxPropertyGridPageState*)state, flags, startPos, dir ); } \ CLASS() \ : wxPropertyGridIteratorBase() \ { \ m_property = NULL; \ } \ CLASS( const CLASS& it ) \ : wxPropertyGridIteratorBase( ) \ { \ Assign(it); \ } \ ~CLASS() \ { \ } \ const CLASS& operator=( const CLASS& it ) \ { \ if (this != &it) \ Assign(it); \ return *this; \ } \ CLASS& operator++() { Next(); return *this; } \ CLASS operator++(int) { CLASS it=*this;Next();return it; } \ CLASS& operator--() { Prev(); return *this; } \ CLASS operator--(int) { CLASS it=*this;Prev();return it; } \ PROPERTY* operator *() const { return (PROPERTY*)m_property; } \ static PROPERTY* OneStep( STATE* state, \ int flags = wxPG_ITERATE_DEFAULT, \ PROPERTY* property = NULL, \ int dir = 1 ) \ { \ CLASS it( state, flags, property, dir ); \ if ( property ) \ { \ if ( dir == 1 ) it.Next(); \ else it.Prev(); \ } \ return *it; \ } // Preferable way to iterate through contents of wxPropertyGrid, // wxPropertyGridManager, and wxPropertyGridPage. // See wxPropertyGridInterface::GetIterator() for more information about usage. class WXDLLIMPEXP_PROPGRID wxPropertyGridIterator : public wxPropertyGridIteratorBase { public: wxPG_IMPLEMENT_ITERATOR(wxPropertyGridIterator, wxPGProperty, wxPropertyGridPageState) protected: }; // Const version of wxPropertyGridIterator. class WXDLLIMPEXP_PROPGRID wxPropertyGridConstIterator : public wxPropertyGridIteratorBase { public: wxPG_IMPLEMENT_ITERATOR(wxPropertyGridConstIterator, const wxPGProperty, const wxPropertyGridPageState) // Additional copy constructor. wxPropertyGridConstIterator( const wxPropertyGridIterator& other ) { Assign(other); } // Additional assignment operator. const wxPropertyGridConstIterator& operator=( const wxPropertyGridIterator& it ) { Assign(it); return *this; } protected: }; // ----------------------------------------------------------------------- // Base class to derive new viterators. class WXDLLIMPEXP_PROPGRID wxPGVIteratorBase : public wxObjectRefData { friend class wxPGVIterator; public: wxPGVIteratorBase() { } virtual void Next() = 0; protected: virtual ~wxPGVIteratorBase() { } wxPropertyGridIterator m_it; }; // Abstract implementation of a simple iterator. Can only be used // to iterate in forward order, and only through the entire container. // Used to have functions dealing with all properties work with both // wxPropertyGrid and wxPropertyGridManager. class WXDLLIMPEXP_PROPGRID wxPGVIterator { public: wxPGVIterator() { m_pIt = NULL; } wxPGVIterator( wxPGVIteratorBase* obj ) { m_pIt = obj; } ~wxPGVIterator() { UnRef(); } void UnRef() { if (m_pIt) m_pIt->DecRef(); } wxPGVIterator( const wxPGVIterator& it ) { m_pIt = it.m_pIt; m_pIt->IncRef(); } const wxPGVIterator& operator=( const wxPGVIterator& it ) { if (this != &it) { UnRef(); m_pIt = it.m_pIt; m_pIt->IncRef(); } return *this; } void Next() { m_pIt->Next(); } bool AtEnd() const { return m_pIt->m_it.AtEnd(); } wxPGProperty* GetProperty() const { return m_pIt->m_it.GetProperty(); } protected: wxPGVIteratorBase* m_pIt; }; // ----------------------------------------------------------------------- // Contains low-level property page information (properties, column widths, // etc.) of a single wxPropertyGrid or single wxPropertyGridPage. Generally you // should not use this class directly, but instead member functions in // wxPropertyGridInterface, wxPropertyGrid, wxPropertyGridPage, and // wxPropertyGridManager. // - In separate wxPropertyGrid component this class was known as // wxPropertyGridState. // - Currently this class is not implemented in wxPython. class WXDLLIMPEXP_PROPGRID wxPropertyGridPageState { friend class wxPGProperty; friend class wxPropertyGrid; friend class wxPGCanvas; friend class wxPropertyGridInterface; friend class wxPropertyGridPage; friend class wxPropertyGridManager; public: // Default constructor. wxPropertyGridPageState(); // Destructor. virtual ~wxPropertyGridPageState(); // Makes sure all columns have minimum width. void CheckColumnWidths( int widthChange = 0 ); // Override this member function to add custom behaviour on property // deletion. virtual void DoDelete( wxPGProperty* item, bool doDelete = true ); wxSize DoFitColumns( bool allowGridResize = false ); wxPGProperty* DoGetItemAtY( int y ) const; // Override this member function to add custom behaviour on property // insertion. virtual wxPGProperty* DoInsert( wxPGProperty* parent, int index, wxPGProperty* property ); // This needs to be overridden in grid used the manager so that splitter // changes can be propagated to other pages. virtual void DoSetSplitterPosition( int pos, int splitterColumn = 0, int flags = 0 ); bool EnableCategories( bool enable ); // Make sure virtual height is up-to-date. void EnsureVirtualHeight() { if ( m_vhCalcPending ) { RecalculateVirtualHeight(); m_vhCalcPending = false; } } // Returns (precalculated) height of contained visible properties. unsigned int GetVirtualHeight() const { wxASSERT( !m_vhCalcPending ); return m_virtualHeight; } // Returns (precalculated) height of contained visible properties. unsigned int GetVirtualHeight() { EnsureVirtualHeight(); return m_virtualHeight; } // Returns actual height of contained visible properties. // Mostly used for internal diagnostic purposes. inline unsigned int GetActualVirtualHeight() const; unsigned int GetColumnCount() const { return (unsigned int) m_colWidths.size(); } int GetColumnMinWidth( int column ) const; int GetColumnWidth( unsigned int column ) const { return m_colWidths[column]; } wxPropertyGrid* GetGrid() const { return m_pPropGrid; } // Returns last item which could be iterated using given flags. wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ); const wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) const { return ((wxPropertyGridPageState*)this)->GetLastItem(flags); } // Returns currently selected property. wxPGProperty* GetSelection() const { return m_selection.empty()? NULL: m_selection[0]; } void DoSetSelection( wxPGProperty* prop ) { m_selection.clear(); if ( prop ) m_selection.push_back(prop); } bool DoClearSelection() { return DoSelectProperty(NULL); } void DoRemoveFromSelection( wxPGProperty* prop ); void DoSetColumnProportion( unsigned int column, int proportion ); int DoGetColumnProportion( unsigned int column ) const { return m_columnProportions[column]; } void ResetColumnSizes( int setSplitterFlags ); wxPropertyCategory* GetPropertyCategory( const wxPGProperty* p ) const; #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("don't refer directly to wxPropertyGridPageState::GetPropertyByLabel") wxPGProperty* GetPropertyByLabel( const wxString& name, wxPGProperty* parent = NULL ) const; #endif // WXWIN_COMPATIBILITY_3_0 wxVariant DoGetPropertyValues( const wxString& listname, wxPGProperty* baseparent, long flags ) const; wxPGProperty* DoGetRoot() const { return m_properties; } void DoSetPropertyName( wxPGProperty* p, const wxString& newName ); // Returns combined width of margin and all the columns int GetVirtualWidth() const { return m_width; } // Returns minimal width for given column so that all images and texts // will fit entirely. // Used by SetSplitterLeft() and DoFitColumns(). int GetColumnFitWidth(wxClientDC& dc, wxPGProperty* pwc, unsigned int col, bool subProps) const; int GetColumnFullWidth(wxClientDC &dc, wxPGProperty *p, unsigned int col); // Returns information about arbitrary position in the grid. // pt - Logical coordinates in the virtual grid space. Use // wxScrolled<T>::CalcUnscrolledPosition() if you need to // translate a scrolled position into a logical one. wxPropertyGridHitTestResult HitTest( const wxPoint& pt ) const; // Returns true if page is visibly displayed. inline bool IsDisplayed() const; bool IsInNonCatMode() const { return (bool)(m_properties == m_abcArray); } void DoLimitPropertyEditing( wxPGProperty* p, bool limit = true ) { p->SetFlagRecursively(wxPG_PROP_NOEDITOR, limit); } bool DoSelectProperty( wxPGProperty* p, unsigned int flags = 0 ); // widthChange is non-client. void OnClientWidthChange( int newWidth, int widthChange, bool fromOnResize = false ); // Recalculates m_virtualHeight. void RecalculateVirtualHeight() { m_virtualHeight = GetActualVirtualHeight(); } void SetColumnCount( int colCount ); void PropagateColSizeDec( int column, int decrease, int dir ); bool DoHideProperty( wxPGProperty* p, bool hide, int flags = wxPG_RECURSE ); bool DoSetPropertyValueString( wxPGProperty* p, const wxString& value ); bool DoSetPropertyValue( wxPGProperty* p, wxVariant& value ); bool DoSetPropertyValueWxObjectPtr( wxPGProperty* p, wxObject* value ); void DoSetPropertyValues( const wxVariantList& list, wxPGProperty* default_category ); void SetSplitterLeft( bool subProps = false ); // Set virtual width for this particular page. void SetVirtualWidth( int width ); void DoSortChildren( wxPGProperty* p, int flags = 0 ); void DoSort( int flags = 0 ); bool PrepareAfterItemsAdded(); // Called after virtual height needs to be recalculated. void VirtualHeightChanged() { m_vhCalcPending = true; } // Base append. wxPGProperty* DoAppend( wxPGProperty* property ); // Returns property by its name. wxPGProperty* BaseGetPropertyByName( const wxString& name ) const; // Called in, for example, wxPropertyGrid::Clear. void DoClear(); bool DoIsPropertySelected( wxPGProperty* prop ) const; bool DoCollapse( wxPGProperty* p ); bool DoExpand( wxPGProperty* p ); void CalculateFontAndBitmapStuff( int vspacing ); protected: // Utility to check if two properties are visibly next to each other bool ArePropertiesAdjacent( wxPGProperty* prop1, wxPGProperty* prop2, int iterFlags = wxPG_ITERATE_VISIBLE ) const; int DoGetSplitterPosition( int splitterIndex = 0 ) const; // Returns column at x coordinate (in GetGrid()->GetPanel()). // pSplitterHit - Give pointer to int that receives index to splitter that is at x. // pSplitterHitOffset - Distance from said splitter. int HitTestH( int x, int* pSplitterHit, int* pSplitterHitOffset ) const; bool PrepareToAddItem( wxPGProperty* property, wxPGProperty* scheduledParent ); // Returns property by its label. wxPGProperty* BaseGetPropertyByLabel( const wxString& label, wxPGProperty* parent = NULL ) const; // Unselect sub-properties. void DoRemoveChildrenFromSelection(wxPGProperty* p, bool recursive, int selFlags); // Mark sub-properties as being deleted. void DoMarkChildrenAsDeleted(wxPGProperty* p, bool recursive); // Rename the property // so it won't remain in the way of the user code. void DoInvalidatePropertyName(wxPGProperty* p); // Rename sub-properties // so it won't remain in the way of the user code. void DoInvalidateChildrenNames(wxPGProperty* p, bool recursive); // Check if property contains given sub-category. bool IsChildCategory(wxPGProperty* p, wxPropertyCategory* cat, bool recursive); // If visible, then this is pointer to wxPropertyGrid. // This shall *never* be NULL to indicate that this state is not visible. wxPropertyGrid* m_pPropGrid; // Pointer to currently used array. wxPGProperty* m_properties; // Array for categoric mode. wxPGRootProperty m_regularArray; // Array for root of non-categoric mode. wxPGRootProperty* m_abcArray; // Dictionary for name-based access. wxPGHashMapS2P m_dictName; // List of column widths (first column does not include margin). wxVector<int> m_colWidths; // List of indices of columns the user can edit by clicking it. wxVector<int> m_editableColumns; // Column proportions. wxVector<int> m_columnProportions; double m_fSplitterX; // Most recently added category. wxPropertyCategory* m_currentCategory; // Array of selected property. wxArrayPGProperty m_selection; // Virtual width. int m_width; // Indicates total virtual height of visible properties. unsigned int m_virtualHeight; #if WXWIN_COMPATIBILITY_3_0 // 1 if m_lastCaption is also the bottommost caption. unsigned char m_lastCaptionBottomnest; // 1 items appended/inserted, so stuff needs to be done before drawing; // If m_virtualHeight == 0, then calcylatey's must be done. // Otherwise just sort. unsigned char m_itemsAdded; // 1 if any value is modified. unsigned char m_anyModified; unsigned char m_vhCalcPending; #else // True if m_lastCaption is also the bottommost caption. bool m_lastCaptionBottomnest; // True: items appended/inserted, so stuff needs to be done before drawing; // If m_virtualHeight == 0, then calcylatey's must be done. // Otherwise just sort. bool m_itemsAdded; // True if any value is modified. bool m_anyModified; bool m_vhCalcPending; #endif // WXWIN_COMPATIBILITY_3_0 // True if splitter has been pre-set by the application. bool m_isSplitterPreSet; // Used to (temporarily) disable splitter centering. bool m_dontCenterSplitter; private: // Only inits arrays, doesn't migrate things or such. void InitNonCatMode(); }; // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_PROPGRIDPAGESTATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/editors.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/editors.h // Purpose: wxPropertyGrid editors // Author: Jaakko Salli // Modified by: // Created: 2007-04-14 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_EDITORS_H_ #define _WX_PROPGRID_EDITORS_H_ #include "wx/defs.h" #if wxUSE_PROPGRID class WXDLLIMPEXP_FWD_PROPGRID wxPGCell; class WXDLLIMPEXP_FWD_PROPGRID wxPGProperty; class WXDLLIMPEXP_FWD_PROPGRID wxPropertyGrid; // ----------------------------------------------------------------------- // wxPGWindowList contains list of editor windows returned by CreateControls. class wxPGWindowList { public: wxPGWindowList() { m_primary = m_secondary = NULL; } void SetSecondary( wxWindow* secondary ) { m_secondary = secondary; } wxWindow* m_primary; wxWindow* m_secondary; wxPGWindowList( wxWindow* a ) { m_primary = a; m_secondary = NULL; } wxPGWindowList( wxWindow* a, wxWindow* b ) { m_primary = a; m_secondary = b; } }; // ----------------------------------------------------------------------- // Base class for custom wxPropertyGrid editors. // - Names of builtin property editors are: TextCtrl, Choice, // ComboBox, CheckBox, TextCtrlAndButton, and ChoiceAndButton. Additional // editors include SpinCtrl and DatePickerCtrl, but using them requires // calling wxPropertyGrid::RegisterAdditionalEditors() prior use. // - Pointer to builtin editor is available as wxPGEditor_EditorName // (e.g. wxPGEditor_TextCtrl). // - To add new editor you need to register it first using static function // wxPropertyGrid::RegisterEditorClass(), with code like this: // wxPGEditor *editorPointer = wxPropertyGrid::RegisterEditorClass( // new MyEditorClass(), "MyEditor"); // After that, wxPropertyGrid will take ownership of the given object, but // you should still store editorPointer somewhere, so you can pass it to // wxPGProperty::SetEditor(), or return it from // wxPGEditor::DoGetEditorClass(). class WXDLLIMPEXP_PROPGRID wxPGEditor : public wxObject { wxDECLARE_ABSTRACT_CLASS(wxPGEditor); public: // Constructor. wxPGEditor() : wxObject() { m_clientData = NULL; } // Destructor. virtual ~wxPGEditor(); // Returns pointer to the name of the editor. For example, // wxPGEditor_TextCtrl has name "TextCtrl". If you don't need to access // your custom editor by string name, then you do not need to implement // this function. virtual wxString GetName() const; // Instantiates editor controls. // propgrid- wxPropertyGrid to which the property belongs // (use as parent for control). // property - Property for which this method is called. // pos - Position, inside wxPropertyGrid, to create control(s) to. // size - Initial size for control(s). // Unlike in previous version of wxPropertyGrid, it is no longer // necessary to call wxEvtHandler::Connect() for interesting editor // events. Instead, all events from control are now automatically // forwarded to wxPGEditor::OnEvent() and wxPGProperty::OnEvent(). virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const = 0; // Loads value from property to the control. virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const = 0; // Used to get the renderer to draw the value with when the control is // hidden. // Default implementation returns g_wxPGDefaultRenderer. //virtual wxPGCellRenderer* GetCellRenderer() const; // Draws value for given property. virtual void DrawValue( wxDC& dc, const wxRect& rect, wxPGProperty* property, const wxString& text ) const; // Handles events. Returns true if value in control was modified // (see wxPGProperty::OnEvent for more information). // wxPropertyGrid will automatically unfocus the editor when // wxEVT_TEXT_ENTER is received and when it results in // property value being modified. This happens regardless of // editor type (i.e. behaviour is same for any wxTextCtrl and // wxComboBox based editor). virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd_primary, wxEvent& event ) const = 0; // Returns value from control, via parameter 'variant'. // Usually ends up calling property's StringToValue or IntToValue. // Returns true if value was different. virtual bool GetValueFromControl( wxVariant& variant, wxPGProperty* property, wxWindow* ctrl ) const; // Sets new appearance for the control. Default implementation // sets foreground colour, background colour, font, plus text // for wxTextCtrl and wxComboCtrl. // appearance - New appearance to be applied. // oldAppearance - Previously applied appearance. Used to detect // which control attributes need to be changed (e.g. so we only // change background colour if really needed). // unspecified - true if the new appearance represents an unspecified // property value. virtual void SetControlAppearance( wxPropertyGrid* pg, wxPGProperty* property, wxWindow* ctrl, const wxPGCell& appearance, const wxPGCell& oldAppearance, bool unspecified ) const; // Sets value in control to unspecified. virtual void SetValueToUnspecified( wxPGProperty* property, wxWindow* ctrl ) const; // Sets control's value specifically from string. virtual void SetControlStringValue( wxPGProperty* property, wxWindow* ctrl, const wxString& txt ) const; // Sets control's value specifically from int (applies to choice etc.). virtual void SetControlIntValue( wxPGProperty* property, wxWindow* ctrl, int value ) const; // Inserts item to existing control. Index -1 means appending. // Default implementation does nothing. Returns index of item added. virtual int InsertItem( wxWindow* ctrl, const wxString& label, int index ) const; // Deletes item from existing control. // Default implementation does nothing. virtual void DeleteItem( wxWindow* ctrl, int index ) const; // Extra processing when control gains focus. For example, wxTextCtrl // based controls should select all text. virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; // Returns true if control itself can contain the custom image. Default is // to return false. virtual bool CanContainCustomImage() const; // // This member is public so scripting language bindings // wrapper code can access it freely. void* m_clientData; }; #define WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(EDITOR,CLASSNAME,BASECLASS) \ wxIMPLEMENT_DYNAMIC_CLASS(CLASSNAME, BASECLASS); \ wxString CLASSNAME::GetName() const \ { \ return wxS(#EDITOR); \ } \ wxPGEditor* wxPGEditor_##EDITOR = NULL; // // Following are the built-in editor classes. // class WXDLLIMPEXP_PROPGRID wxPGTextCtrlEditor : public wxPGEditor { wxDECLARE_DYNAMIC_CLASS(wxPGTextCtrlEditor); public: wxPGTextCtrlEditor() {} virtual ~wxPGTextCtrlEditor(); virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* primaryCtrl, wxEvent& event ) const wxOVERRIDE; virtual bool GetValueFromControl( wxVariant& variant, wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual wxString GetName() const wxOVERRIDE; //virtual wxPGCellRenderer* GetCellRenderer() const; virtual void SetControlStringValue( wxPGProperty* property, wxWindow* ctrl, const wxString& txt ) const wxOVERRIDE; virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const wxOVERRIDE; // Provided so that, for example, ComboBox editor can use the same code // (multiple inheritance would get way too messy). static bool OnTextCtrlEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ); static bool GetTextCtrlValueFromControl( wxVariant& variant, wxPGProperty* property, wxWindow* ctrl ); }; class WXDLLIMPEXP_PROPGRID wxPGChoiceEditor : public wxPGEditor { wxDECLARE_DYNAMIC_CLASS(wxPGChoiceEditor); public: wxPGChoiceEditor() {} virtual ~wxPGChoiceEditor(); virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* primaryCtrl, wxEvent& event ) const wxOVERRIDE; virtual bool GetValueFromControl( wxVariant& variant, wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual void SetValueToUnspecified( wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual wxString GetName() const wxOVERRIDE; virtual void SetControlIntValue( wxPGProperty* property, wxWindow* ctrl, int value ) const wxOVERRIDE; virtual void SetControlStringValue( wxPGProperty* property, wxWindow* ctrl, const wxString& txt ) const wxOVERRIDE; virtual int InsertItem( wxWindow* ctrl, const wxString& label, int index ) const wxOVERRIDE; virtual void DeleteItem( wxWindow* ctrl, int index ) const wxOVERRIDE; virtual bool CanContainCustomImage() const wxOVERRIDE; // CreateControls calls this with CB_READONLY in extraStyle wxWindow* CreateControlsBase( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, long extraStyle ) const; }; class WXDLLIMPEXP_PROPGRID wxPGComboBoxEditor : public wxPGChoiceEditor { wxDECLARE_DYNAMIC_CLASS(wxPGComboBoxEditor); public: wxPGComboBoxEditor() {} virtual ~wxPGComboBoxEditor(); virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; virtual wxString GetName() const wxOVERRIDE; virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ) const wxOVERRIDE; virtual bool GetValueFromControl( wxVariant& variant, wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const wxOVERRIDE; }; class WXDLLIMPEXP_PROPGRID wxPGChoiceAndButtonEditor : public wxPGChoiceEditor { public: wxPGChoiceAndButtonEditor() {} virtual ~wxPGChoiceAndButtonEditor(); virtual wxString GetName() const wxOVERRIDE; virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxPGChoiceAndButtonEditor); }; class WXDLLIMPEXP_PROPGRID wxPGTextCtrlAndButtonEditor : public wxPGTextCtrlEditor { public: wxPGTextCtrlAndButtonEditor() {} virtual ~wxPGTextCtrlAndButtonEditor(); virtual wxString GetName() const wxOVERRIDE; virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxPGTextCtrlAndButtonEditor); }; #if wxPG_INCLUDE_CHECKBOX // // Use custom check box code instead of native control // for cleaner (i.e. more integrated) look. // class WXDLLIMPEXP_PROPGRID wxPGCheckBoxEditor : public wxPGEditor { wxDECLARE_DYNAMIC_CLASS(wxPGCheckBoxEditor); public: wxPGCheckBoxEditor() {} virtual ~wxPGCheckBoxEditor(); virtual wxString GetName() const wxOVERRIDE; virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size) const wxOVERRIDE; virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* primaryCtrl, wxEvent& event ) const wxOVERRIDE; virtual bool GetValueFromControl( wxVariant& variant, wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual void SetValueToUnspecified( wxPGProperty* property, wxWindow* ctrl ) const wxOVERRIDE; virtual void DrawValue( wxDC& dc, const wxRect& rect, wxPGProperty* property, const wxString& text ) const wxOVERRIDE; //virtual wxPGCellRenderer* GetCellRenderer() const; virtual void SetControlIntValue( wxPGProperty* property, wxWindow* ctrl, int value ) const wxOVERRIDE; }; #endif // ----------------------------------------------------------------------- // Editor class registration macro (mostly for internal use) #define wxPGRegisterEditorClass(EDITOR) \ if ( wxPGEditor_##EDITOR == NULL ) \ { \ wxPGEditor_##EDITOR = wxPropertyGrid::RegisterEditorClass( \ new wxPG##EDITOR##Editor ); \ } // ----------------------------------------------------------------------- // Derive a class from this to adapt an existing editor dialog or function to // be used when editor button of a property is pushed. // You only need to derive class and implement DoShowDialog() to create and // show the dialog, and finally submit the value returned by the dialog // via SetValue(). class WXDLLIMPEXP_PROPGRID wxPGEditorDialogAdapter : public wxObject { wxDECLARE_ABSTRACT_CLASS(wxPGEditorDialogAdapter); public: wxPGEditorDialogAdapter() : wxObject() { m_clientData = NULL; } virtual ~wxPGEditorDialogAdapter() { } bool ShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property ); virtual bool DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property ) = 0; void SetValue( wxVariant value ) { m_value = value; } // This method is typically only used if deriving class from existing // adapter with value conversion purposes. wxVariant& GetValue() { return m_value; } // This member is public so scripting language bindings // wrapper code can access it freely. void* m_clientData; private: wxVariant m_value; }; // ----------------------------------------------------------------------- // This class can be used to have multiple buttons in a property editor. // You will need to create a new property editor class, override // CreateControls, and have it return wxPGMultiButton instance in // wxPGWindowList::SetSecondary(). class WXDLLIMPEXP_PROPGRID wxPGMultiButton : public wxWindow { public: wxPGMultiButton( wxPropertyGrid* pg, const wxSize& sz ); virtual ~wxPGMultiButton() {} wxWindow* GetButton( unsigned int i ) { return (wxWindow*) m_buttons[i]; } const wxWindow* GetButton( unsigned int i ) const { return (const wxWindow*) m_buttons[i]; } // Utility function to be used in event handlers. int GetButtonId( unsigned int i ) const { return GetButton(i)->GetId(); } // Returns number of buttons. unsigned int GetCount() const { return (unsigned int) m_buttons.size(); } void Add( const wxString& label, int id = -2 ); #if wxUSE_BMPBUTTON void Add( const wxBitmap& bitmap, int id = -2 ); #endif wxSize GetPrimarySize() const { return wxSize(m_fullEditorSize.x - m_buttonsWidth, m_fullEditorSize.y); } void Finalize( wxPropertyGrid* propGrid, const wxPoint& pos ); protected: void DoAddButton( wxWindow* button, const wxSize& sz ); int GenId( int id ) const; wxArrayPtrVoid m_buttons; wxSize m_fullEditorSize; int m_buttonsWidth; }; // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_EDITORS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/props.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/props.h // Purpose: wxPropertyGrid Property Classes // Author: Jaakko Salli // Modified by: // Created: 2007-03-28 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_PROPS_H_ #define _WX_PROPGRID_PROPS_H_ #include "wx/defs.h" #if wxUSE_PROPGRID // ----------------------------------------------------------------------- class wxPGArrayEditorDialog; #include "wx/propgrid/editors.h" #include "wx/filename.h" #include "wx/dialog.h" #include "wx/textctrl.h" #include "wx/button.h" #include "wx/listbox.h" #include "wx/valtext.h" // ----------------------------------------------------------------------- // // Property class implementation helper macros. // #define wxPG_IMPLEMENT_PROPERTY_CLASS(NAME, UPCLASS, EDITOR) \ wxIMPLEMENT_DYNAMIC_CLASS(NAME, UPCLASS); \ wxPG_IMPLEMENT_PROPERTY_CLASS_PLAIN(NAME, EDITOR) #if WXWIN_COMPATIBILITY_3_0 // This macro is deprecated. Use wxPG_IMPLEMENT_PROPERTY_CLASS instead. #define WX_PG_IMPLEMENT_PROPERTY_CLASS(NAME, UPCLASS, T, T_AS_ARG, EDITOR) \ wxIMPLEMENT_DYNAMIC_CLASS(NAME, UPCLASS); \ WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(NAME, T, EDITOR) #endif // WXWIN_COMPATIBILITY_3_0 // ----------------------------------------------------------------------- // // These macros help creating DoGetValidator #define WX_PG_DOGETVALIDATOR_ENTRY() \ static wxValidator* s_ptr = NULL; \ if ( s_ptr ) return s_ptr; // Common function exit #define WX_PG_DOGETVALIDATOR_EXIT(VALIDATOR) \ s_ptr = VALIDATOR; \ wxPGGlobalVars->m_arrValidators.push_back( VALIDATOR ); \ return VALIDATOR; // ----------------------------------------------------------------------- // Creates and manages a temporary wxTextCtrl for validation purposes. // Uses wxPropertyGrid's current editor, if available. class WXDLLIMPEXP_PROPGRID wxPGInDialogValidator { public: wxPGInDialogValidator() { m_textCtrl = NULL; } ~wxPGInDialogValidator() { if ( m_textCtrl ) m_textCtrl->Destroy(); } bool DoValidate( wxPropertyGrid* propGrid, wxValidator* validator, const wxString& value ); private: wxTextCtrl* m_textCtrl; }; // ----------------------------------------------------------------------- // Property classes // ----------------------------------------------------------------------- #define wxPG_PROP_PASSWORD wxPG_PROP_CLASS_SPECIFIC_2 // Basic property with string value. // If value "<composed>" is set, then actual value is formed (or composed) // from values of child properties. class WXDLLIMPEXP_PROPGRID wxStringProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxStringProperty) public: wxStringProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString ); virtual ~wxStringProperty(); virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; // This is updated so "<composed>" special value can be handled. virtual void OnSetValue() wxOVERRIDE; protected: }; // ----------------------------------------------------------------------- // Constants used with NumericValidation<>(). enum wxPGNumericValidationConstants { // Instead of modifying the value, show an error message. wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE = 0, // Modify value, but stick with the limitations. wxPG_PROPERTY_VALIDATION_SATURATE = 1, // Modify value, wrap around on overflow. wxPG_PROPERTY_VALIDATION_WRAP = 2 }; // ----------------------------------------------------------------------- #if wxUSE_VALIDATORS // A more comprehensive numeric validator class. class WXDLLIMPEXP_PROPGRID wxNumericPropertyValidator : public wxTextValidator { public: enum NumericType { Signed = 0, Unsigned, Float }; wxNumericPropertyValidator( NumericType numericType, int base = 10 ); virtual ~wxNumericPropertyValidator() { } virtual bool Validate(wxWindow* parent) wxOVERRIDE; }; #endif // wxUSE_VALIDATORS // Basic property with integer value. // Seamlessly supports 64-bit integer (wxLongLong) on overflow. class WXDLLIMPEXP_PROPGRID wxIntProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxIntProperty) public: wxIntProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, long value = 0 ); virtual ~wxIntProperty(); #if wxUSE_LONGLONG wxIntProperty( const wxString& label, const wxString& name, const wxLongLong& value ); #endif virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const wxOVERRIDE; virtual bool IntToValue( wxVariant& variant, int number, int argFlags = 0 ) const wxOVERRIDE; static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator() const wxOVERRIDE; // Validation helpers. #if wxUSE_LONGLONG static bool DoValidation( const wxPGProperty* property, wxLongLong& value, wxPGValidationInfo* pValidationInfo, int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE ); #if defined(wxLongLong_t) static bool DoValidation( const wxPGProperty* property, wxLongLong_t& value, wxPGValidationInfo* pValidationInfo, int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE ); #endif // wxLongLong_t #endif // wxUSE_LONGLONG static bool DoValidation(const wxPGProperty* property, long& value, wxPGValidationInfo* pValidationInfo, int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE); protected: }; // ----------------------------------------------------------------------- // Basic property with unsigned integer value. // Seamlessly supports 64-bit integer (wxULongLong) on overflow. class WXDLLIMPEXP_PROPGRID wxUIntProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxUIntProperty) public: wxUIntProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, unsigned long value = 0 ); virtual ~wxUIntProperty(); #if wxUSE_LONGLONG wxUIntProperty( const wxString& label, const wxString& name, const wxULongLong& value ); #endif virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const wxOVERRIDE; virtual wxValidator* DoGetValidator () const wxOVERRIDE; virtual bool IntToValue( wxVariant& variant, int number, int argFlags = 0 ) const wxOVERRIDE; protected: wxByte m_base; wxByte m_realBase; // translated to 8,16,etc. wxByte m_prefix; private: void Init(); // Validation helpers. #if wxUSE_LONGLONG static bool DoValidation(const wxPGProperty* property, wxULongLong& value, wxPGValidationInfo* pValidationInfo, int mode =wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE); #if defined(wxULongLong_t) static bool DoValidation(const wxPGProperty* property, wxULongLong_t& value, wxPGValidationInfo* pValidationInfo, int mode =wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE); #endif // wxULongLong_t #endif // wxUSE_LONGLONG static bool DoValidation(const wxPGProperty* property, long& value, wxPGValidationInfo* pValidationInfo, int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE); }; // ----------------------------------------------------------------------- // Basic property with double-precision floating point value. class WXDLLIMPEXP_PROPGRID wxFloatProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxFloatProperty) public: wxFloatProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, double value = 0.0 ); virtual ~wxFloatProperty(); virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; virtual wxVariant DoGetAttribute( const wxString& name ) const wxOVERRIDE; virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const wxOVERRIDE; // Validation helper. static bool DoValidation( const wxPGProperty* property, double& value, wxPGValidationInfo* pValidationInfo, int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE ); static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator () const wxOVERRIDE; protected: int m_precision; }; // ----------------------------------------------------------------------- // Basic property with boolean value. class WXDLLIMPEXP_PROPGRID wxBoolProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxBoolProperty) public: wxBoolProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, bool value = false ); virtual ~wxBoolProperty(); virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool IntToValue( wxVariant& variant, int number, int argFlags = 0 ) const wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; virtual wxVariant DoGetAttribute( const wxString& name ) const wxOVERRIDE; }; // ----------------------------------------------------------------------- // If set, then selection of choices is static and should not be // changed (i.e. returns NULL in GetPropertyChoices). #define wxPG_PROP_STATIC_CHOICES wxPG_PROP_CLASS_SPECIFIC_1 // Represents a single selection from a list of choices // You can derive custom properties with choices from this class. // Updating private index is important. You can do this either by calling // SetIndex() in IntToValue, and then letting wxBaseEnumProperty::OnSetValue // be called (by not implementing it, or by calling super class function in // it) -OR- you can just call SetIndex in OnSetValue. class WXDLLIMPEXP_PROPGRID wxEnumProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxEnumProperty) public: #ifndef SWIG wxEnumProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxChar* const* labels = NULL, const long* values = NULL, int value = 0 ); wxEnumProperty( const wxString& label, const wxString& name, wxPGChoices& choices, int value = 0 ); // Special constructor for caching choices (used by derived class) wxEnumProperty( const wxString& label, const wxString& name, const char* const* untranslatedLabels, const long* values, wxPGChoices* choicesCache, int value = 0 ); wxEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values = wxArrayInt(), int value = 0 ); #else wxEnumProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxArrayString& labels = wxArrayString(), const wxArrayInt& values = wxArrayInt(), int value = 0 ); #endif virtual ~wxEnumProperty(); size_t GetItemCount() const { return m_choices.GetCount(); } virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const wxOVERRIDE; // If wxPG_FULL_VALUE is not set in flags, then the value is interpreted // as index to choices list. Otherwise, it is actual value. virtual bool IntToValue( wxVariant& variant, int number, int argFlags = 0 ) const wxOVERRIDE; // // Additional virtuals // This must be overridden to have non-index based value virtual int GetIndexForValue( int value ) const; // GetChoiceSelection needs to overridden since m_index is // the true index, and various property classes derived from // this take advantage of it. virtual int GetChoiceSelection() const wxOVERRIDE { return m_index; } virtual void OnValidationFailure( wxVariant& pendingValue ) wxOVERRIDE; protected: int GetIndex() const; void SetIndex( int index ); #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("use ValueFromString_(wxVariant&, int*, const wxString&, int) function instead") bool ValueFromString_( wxVariant& value, const wxString& text, int argFlags ) const { return ValueFromString_(value, NULL, text, argFlags); } wxDEPRECATED_MSG("use ValueFromInt_(wxVariant&, int*, int, int) function instead") bool ValueFromInt_( wxVariant& value, int intVal, int argFlags ) const { return ValueFromInt_(value, NULL, intVal, argFlags); } wxDEPRECATED_MSG("don't use ResetNextIndex() function") static void ResetNextIndex() { } #endif // Converts text to value and returns corresponding index in the collection bool ValueFromString_(wxVariant& value, int* pIndex, const wxString& text, int argFlags) const; // Converts number to value and returns corresponding index in the collection bool ValueFromInt_(wxVariant& value, int* pIndex, int intVal, int argFlags) const; private: // This is private so that classes are guaranteed to use GetIndex // for up-to-date index value. int m_index; }; // ----------------------------------------------------------------------- // wxEnumProperty with wxString value and writable combo box editor. // Uses int value, similar to wxEnumProperty, unless text entered by user is // is not in choices (in which case string value is used). class WXDLLIMPEXP_PROPGRID wxEditEnumProperty : public wxEnumProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxEditEnumProperty) public: wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels, const long* values, const wxString& value ); wxEditEnumProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxArrayString& labels = wxArrayString(), const wxArrayInt& values = wxArrayInt(), const wxString& value = wxEmptyString ); wxEditEnumProperty( const wxString& label, const wxString& name, wxPGChoices& choices, const wxString& value = wxEmptyString ); // Special constructor for caching choices (used by derived class) wxEditEnumProperty( const wxString& label, const wxString& name, const char* const* untranslatedLabels, const long* values, wxPGChoices* choicesCache, const wxString& value ); virtual ~wxEditEnumProperty(); void OnSetValue() wxOVERRIDE; bool StringToValue(wxVariant& variant, const wxString& text, int argFlags = 0) const wxOVERRIDE; bool ValidateValue(wxVariant& value, wxPGValidationInfo& validationInfo) const wxOVERRIDE; protected: }; // ----------------------------------------------------------------------- // Represents a bit set that fits in a long integer. wxBoolProperty // sub-properties are created for editing individual bits. Textctrl is created // to manually edit the flags as a text; a continuous sequence of spaces, // commas and semicolons is considered as a flag id separator. // Note: When changing "choices" (ie. flag labels) of wxFlagsProperty, // you will need to use SetPropertyChoices - otherwise they will not get // updated properly. class WXDLLIMPEXP_PROPGRID wxFlagsProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxFlagsProperty) public: #ifndef SWIG wxFlagsProperty( const wxString& label, const wxString& name, const wxChar* const* labels, const long* values = NULL, long value = 0 ); wxFlagsProperty( const wxString& label, const wxString& name, wxPGChoices& choices, long value = 0 ); #endif wxFlagsProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxArrayString& labels = wxArrayString(), const wxArrayInt& values = wxArrayInt(), int value = 0 ); virtual ~wxFlagsProperty (); virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int flags ) const wxOVERRIDE; virtual wxVariant ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const wxOVERRIDE; virtual void RefreshChildren() wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; // GetChoiceSelection needs to overridden since m_choices is // used and value is integer, but it is not index. virtual int GetChoiceSelection() const wxOVERRIDE { return wxNOT_FOUND; } // helpers size_t GetItemCount() const { return m_choices.GetCount(); } const wxString& GetLabel( size_t ind ) const { return m_choices.GetLabel(static_cast<unsigned int>(ind)); } protected: // Used to detect if choices have been changed wxPGChoicesData* m_oldChoicesData; // Needed to properly mark changed sub-properties long m_oldValue; // Converts string id to a relevant bit. long IdToBit( const wxString& id ) const; // Creates children and sets value. void Init(); }; // ----------------------------------------------------------------------- class WXDLLIMPEXP_PROPGRID wxPGFileDialogAdapter : public wxPGEditorDialogAdapter { public: virtual bool DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property ) wxOVERRIDE; }; // ----------------------------------------------------------------------- // Indicates first bit useable by derived properties. #define wxPG_PROP_SHOW_FULL_FILENAME wxPG_PROP_CLASS_SPECIFIC_1 // Like wxLongStringProperty, but the button triggers file selector instead. class WXDLLIMPEXP_PROPGRID wxFileProperty : public wxPGProperty { friend class wxPGFileDialogAdapter; WX_PG_DECLARE_PROPERTY_CLASS(wxFileProperty) public: wxFileProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString ); virtual ~wxFileProperty (); virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual wxPGEditorDialogAdapter* GetEditorDialog() const wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator() const wxOVERRIDE; // Returns filename to file represented by current value. wxFileName GetFileName() const; protected: wxString m_wildcard; wxString m_basePath; // If set, then show path relative to it wxString m_initialPath; // If set, start the file dialog here wxString m_dlgTitle; // If set, used as title for file dialog int m_indFilter; // index to the selected filter }; // ----------------------------------------------------------------------- #define wxPG_PROP_NO_ESCAPE wxPG_PROP_CLASS_SPECIFIC_1 // Flag used in wxLongStringProperty to mark that edit button // should be enabled even in the read-only mode. #define wxPG_PROP_ACTIVE_BTN wxPG_PROP_CLASS_SPECIFIC_3 class WXDLLIMPEXP_PROPGRID wxPGLongStringDialogAdapter : public wxPGEditorDialogAdapter { public: virtual bool DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property ) wxOVERRIDE; }; // Like wxStringProperty, but has a button that triggers a small text // editor dialog. class WXDLLIMPEXP_PROPGRID wxLongStringProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxLongStringProperty) public: wxLongStringProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString ); virtual ~wxLongStringProperty(); virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) wxOVERRIDE; // Shows string editor dialog. Value to be edited should be read from // value, and if dialog is not cancelled, it should be stored back and true // should be returned if that was the case. virtual bool OnButtonClick( wxPropertyGrid* propgrid, wxString& value ); static bool DisplayEditorDialog( wxPGProperty* prop, wxPropertyGrid* propGrid, wxString& value ); protected: }; // ----------------------------------------------------------------------- // Like wxLongStringProperty, but the button triggers dir selector instead. class WXDLLIMPEXP_PROPGRID wxDirProperty : public wxLongStringProperty { wxDECLARE_DYNAMIC_CLASS(wxDirProperty); public: wxDirProperty( const wxString& name = wxPG_LABEL, const wxString& label = wxPG_LABEL, const wxString& value = wxEmptyString ); virtual ~wxDirProperty(); virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; virtual wxValidator* DoGetValidator() const wxOVERRIDE; virtual bool OnButtonClick ( wxPropertyGrid* propGrid, wxString& value ) wxOVERRIDE; protected: wxString m_dlgMessage; }; // ----------------------------------------------------------------------- // wxBoolProperty specific flags #define wxPG_PROP_USE_CHECKBOX wxPG_PROP_CLASS_SPECIFIC_1 // DCC = Double Click Cycles #define wxPG_PROP_USE_DCC wxPG_PROP_CLASS_SPECIFIC_2 // ----------------------------------------------------------------------- // Property that manages a list of strings. class WXDLLIMPEXP_PROPGRID wxArrayStringProperty : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS(wxArrayStringProperty) public: wxArrayStringProperty( const wxString& label = wxPG_LABEL, const wxString& name = wxPG_LABEL, const wxArrayString& value = wxArrayString() ); virtual ~wxArrayStringProperty(); virtual void OnSetValue() wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const wxOVERRIDE; virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; // Implement in derived class for custom array-to-string conversion. virtual void ConvertArrayToString(const wxArrayString& arr, wxString* pString, const wxUniChar& delimiter) const; // Shows string editor dialog. Value to be edited should be read from // value, and if dialog is not cancelled, it should be stored back and true // should be returned if that was the case. virtual bool OnCustomStringEdit( wxWindow* parent, wxString& value ); // Helper. virtual bool OnButtonClick( wxPropertyGrid* propgrid, wxWindow* primary, const wxChar* cbt ); // Creates wxPGArrayEditorDialog for string editing. Called in OnButtonClick. virtual wxPGArrayEditorDialog* CreateEditorDialog(); enum ConversionFlags { Escape = 0x01, QuoteStrings = 0x02 }; // Generates contents for string dst based on the contents of // wxArrayString src. static void ArrayStringToString( wxString& dst, const wxArrayString& src, wxUniChar delimiter, int flags ); protected: // Previously this was to be implemented in derived class for array-to- // string conversion. Now you should implement ConvertValueToString() // instead. virtual void GenerateValueAsString(); wxString m_display; // Cache for displayed text. wxUniChar m_delimiter; }; // ----------------------------------------------------------------------- #define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR_WITH_DECL(PROPNAME, \ DECL) \ DECL PROPNAME : public wxArrayStringProperty \ { \ WX_PG_DECLARE_PROPERTY_CLASS(PROPNAME) \ public: \ PROPNAME( const wxString& label = wxPG_LABEL, \ const wxString& name = wxPG_LABEL, \ const wxArrayString& value = wxArrayString() ); \ ~PROPNAME(); \ virtual bool OnEvent( wxPropertyGrid* propgrid, \ wxWindow* primary, wxEvent& event ) wxOVERRIDE; \ virtual bool OnCustomStringEdit( wxWindow* parent, wxString& value ) wxOVERRIDE; \ virtual wxValidator* DoGetValidator() const wxOVERRIDE; \ }; #define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAM) \ WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAM, class) #define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME, \ DELIMCHAR, \ CUSTBUTTXT) \ wxPG_IMPLEMENT_PROPERTY_CLASS(PROPNAME, wxArrayStringProperty, \ TextCtrlAndButton) \ PROPNAME::PROPNAME( const wxString& label, \ const wxString& name, \ const wxArrayString& value ) \ : wxArrayStringProperty(label,name,value) \ { \ PROPNAME::GenerateValueAsString(); \ m_delimiter = DELIMCHAR; \ } \ PROPNAME::~PROPNAME() { } \ bool PROPNAME::OnEvent( wxPropertyGrid* propgrid, \ wxWindow* primary, wxEvent& event ) \ { \ if ( event.GetEventType() == wxEVT_BUTTON ) \ return OnButtonClick(propgrid,primary,(const wxChar*) CUSTBUTTXT); \ return false; \ } #define WX_PG_DECLARE_ARRAYSTRING_PROPERTY(PROPNAME) \ WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME) #define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_DECL(PROPNAME, DECL) \ WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR_WITH_DECL(PROPNAME, DECL) #define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY(PROPNAME,DELIMCHAR,CUSTBUTTXT) \ WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME, \ DELIMCHAR, \ CUSTBUTTXT) \ wxValidator* PROPNAME::DoGetValidator () const \ { return NULL; } // ----------------------------------------------------------------------- // wxPGArrayEditorDialog // ----------------------------------------------------------------------- #if wxUSE_EDITABLELISTBOX class WXDLLIMPEXP_FWD_CORE wxEditableListBox; class WXDLLIMPEXP_FWD_CORE wxListEvent; #define wxAEDIALOG_STYLE \ (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE) class WXDLLIMPEXP_PROPGRID wxPGArrayEditorDialog : public wxDialog { public: wxPGArrayEditorDialog(); virtual ~wxPGArrayEditorDialog() { } void Init(); wxPGArrayEditorDialog( wxWindow *parent, const wxString& message, const wxString& caption, long style = wxAEDIALOG_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize ); bool Create( wxWindow *parent, const wxString& message, const wxString& caption, long style = wxAEDIALOG_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize ); void EnableCustomNewAction() { m_hasCustomNewAction = true; } // Set value modified by dialog. virtual void SetDialogValue( const wxVariant& WXUNUSED(value) ) { wxFAIL_MSG(wxS("re-implement this member function in derived class")); } // Return value modified by dialog. virtual wxVariant GetDialogValue() const { wxFAIL_MSG(wxS("re-implement this member function in derived class")); return wxVariant(); } // Override to return wxValidator to be used with the wxTextCtrl // in dialog. Note that the validator is used in the standard // wx way, i.e. it immediately prevents user from entering invalid // input. // Note: Dialog frees the validator. virtual wxValidator* GetTextCtrlValidator() const { return NULL; } // Returns true if array was actually modified bool IsModified() const { return m_modified; } // wxEditableListBox utilities int GetSelection() const; // implementation from now on void OnAddClick(wxCommandEvent& event); void OnDeleteClick(wxCommandEvent& event); void OnUpClick(wxCommandEvent& event); void OnDownClick(wxCommandEvent& event); void OnEndLabelEdit(wxListEvent& event); void OnBeginLabelEdit(wxListEvent& evt); void OnIdle(wxIdleEvent& event); protected: wxEditableListBox* m_elb; // These are used for focus repair wxWindow* m_elbSubPanel; wxWindow* m_lastFocused; // A new item, edited by user, is pending at this index. // It will be committed once list ctrl item editing is done. int m_itemPendingAtIndex; bool m_modified; bool m_hasCustomNewAction; // These must be overridden - must return true on success. virtual wxString ArrayGet( size_t index ) = 0; virtual size_t ArrayGetCount() = 0; virtual bool ArrayInsert( const wxString& str, int index ) = 0; virtual bool ArraySet( size_t index, const wxString& str ) = 0; virtual void ArrayRemoveAt( int index ) = 0; virtual void ArraySwap( size_t first, size_t second ) = 0; virtual bool OnCustomNewAction(wxString* WXUNUSED(resString)) { return false; } private: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPGArrayEditorDialog); wxDECLARE_EVENT_TABLE(); }; #endif // wxUSE_EDITABLELISTBOX // ----------------------------------------------------------------------- // wxPGArrayStringEditorDialog // ----------------------------------------------------------------------- class WXDLLIMPEXP_PROPGRID wxPGArrayStringEditorDialog : public wxPGArrayEditorDialog { public: wxPGArrayStringEditorDialog(); virtual ~wxPGArrayStringEditorDialog() { } void Init(); virtual void SetDialogValue( const wxVariant& value ) wxOVERRIDE { m_array = value.GetArrayString(); } virtual wxVariant GetDialogValue() const wxOVERRIDE { return m_array; } void SetCustomButton( const wxString& custBtText, wxArrayStringProperty* pcc ) { if ( !custBtText.empty() ) { EnableCustomNewAction(); m_pCallingClass = pcc; } } virtual bool OnCustomNewAction(wxString* resString) wxOVERRIDE; protected: wxArrayString m_array; wxArrayStringProperty* m_pCallingClass; virtual wxString ArrayGet( size_t index ) wxOVERRIDE; virtual size_t ArrayGetCount() wxOVERRIDE; virtual bool ArrayInsert( const wxString& str, int index ) wxOVERRIDE; virtual bool ArraySet( size_t index, const wxString& str ) wxOVERRIDE; virtual void ArrayRemoveAt( int index ) wxOVERRIDE; virtual void ArraySwap( size_t first, size_t second ) wxOVERRIDE; private: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPGArrayStringEditorDialog); wxDECLARE_EVENT_TABLE(); }; // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID #endif // _WX_PROPGRID_PROPS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/propgrid/propgrid.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propgrid/propgrid.h // Purpose: wxPropertyGrid // Author: Jaakko Salli // Modified by: // Created: 2004-09-25 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_PROPGRID_H_ #define _WX_PROPGRID_PROPGRID_H_ #include "wx/defs.h" #if wxUSE_PROPGRID #include "wx/thread.h" #include "wx/dcclient.h" #include "wx/control.h" #include "wx/scrolwin.h" #include "wx/tooltip.h" #include "wx/datetime.h" #include "wx/recguard.h" #include "wx/time.h" // needed for wxMilliClock_t #include "wx/propgrid/property.h" #include "wx/propgrid/propgridiface.h" #ifndef SWIG extern WXDLLIMPEXP_DATA_PROPGRID(const char) wxPropertyGridNameStr[]; #endif class wxPGComboBox; #if wxUSE_STATUSBAR class WXDLLIMPEXP_FWD_CORE wxStatusBar; #endif // ----------------------------------------------------------------------- // Global variables // ----------------------------------------------------------------------- // This is required for sharing common global variables. class WXDLLIMPEXP_PROPGRID wxPGGlobalVarsClass { public: wxPGGlobalVarsClass(); ~wxPGGlobalVarsClass(); #if wxUSE_THREADS // Critical section for handling the globals. Generally it is not needed // since GUI code is supposed to be in single thread. However, // we do want the user to be able to convey wxPropertyGridEvents to other // threads. wxCriticalSection m_critSect; #endif // Used by advprops, but here to make things easier. wxString m_pDefaultImageWildcard; // Map of editor class instances (keys are name string). wxPGHashMapS2P m_mapEditorClasses; #if wxUSE_VALIDATORS wxVector<wxValidator*> m_arrValidators; // These wxValidators need to be freed #endif wxPGHashMapS2P m_dictPropertyClassInfo; // PropertyName -> ClassInfo wxPGChoices* m_fontFamilyChoices; // Replace with your own to affect all properties using default renderer. wxPGCellRenderer* m_defaultRenderer; wxPGChoices m_boolChoices; // Some shared variants #if WXWIN_COMPATIBILITY_3_0 wxVariant m_vEmptyString; wxVariant m_vZero; wxVariant m_vMinusOne; wxVariant m_vTrue; wxVariant m_vFalse; #else const wxVariant m_vEmptyString; const wxVariant m_vZero; const wxVariant m_vMinusOne; const wxVariant m_vTrue; const wxVariant m_vFalse; #endif // WXWIN_COMPATIBILITY_3_0 // Cached constant strings #if WXWIN_COMPATIBILITY_3_0 wxPGCachedString m_strstring; wxPGCachedString m_strlong; wxPGCachedString m_strbool; wxPGCachedString m_strlist; wxPGCachedString m_strDefaultValue; wxPGCachedString m_strMin; wxPGCachedString m_strMax; wxPGCachedString m_strUnits; wxPGCachedString m_strHint; #else const wxString m_strstring; const wxString m_strlong; const wxString m_strbool; const wxString m_strlist; const wxString m_strDefaultValue; const wxString m_strMin; const wxString m_strMax; const wxString m_strUnits; const wxString m_strHint; #endif // WXWIN_COMPATIBILITY_3_0 #if wxPG_COMPATIBILITY_1_4 wxPGCachedString m_strInlineHelp; #endif // If true then some things are automatically translated bool m_autoGetTranslation; // > 0 if errors cannot or should not be shown in statusbar etc. int m_offline; int m_extraStyle; // global extra style int m_warnings; int HasExtraStyle( int style ) const { return (m_extraStyle & style); } }; extern WXDLLIMPEXP_DATA_PROPGRID(wxPGGlobalVarsClass*) wxPGGlobalVars; #define wxPGVariant_EmptyString (wxPGGlobalVars->m_vEmptyString) #define wxPGVariant_Zero (wxPGGlobalVars->m_vZero) #define wxPGVariant_MinusOne (wxPGGlobalVars->m_vMinusOne) #define wxPGVariant_True (wxPGGlobalVars->m_vTrue) #define wxPGVariant_False (wxPGGlobalVars->m_vFalse) #define wxPGVariant_Bool(A) (A?wxPGVariant_True:wxPGVariant_False) // When wxPG is loaded dynamically after the application is already running // then the built-in module system won't pick this one up. Add it manually. WXDLLIMPEXP_PROPGRID void wxPGInitResourceModule(); // ----------------------------------------------------------------------- // SetWindowStyleFlag method can be used to modify some of these at run-time. enum wxPG_WINDOW_STYLES { // This will cause Sort() automatically after an item is added. // When inserting a lot of items in this mode, it may make sense to // use Freeze() before operations and Thaw() afterwards to increase // performance. wxPG_AUTO_SORT = 0x00000010, // Categories are not initially shown (even if added). // IMPORTANT NOTE: If you do not plan to use categories, then this // style will waste resources. // This flag can also be changed using wxPropertyGrid::EnableCategories method. wxPG_HIDE_CATEGORIES = 0x00000020, // This style combines non-categoric mode and automatic sorting. wxPG_ALPHABETIC_MODE = (wxPG_HIDE_CATEGORIES|wxPG_AUTO_SORT), // Modified values are shown in bold font. Changing this requires Refresh() // to show changes. wxPG_BOLD_MODIFIED = 0x00000040, // When wxPropertyGrid is resized, splitter moves to the center. This // behaviour stops once the user manually moves the splitter. wxPG_SPLITTER_AUTO_CENTER = 0x00000080, // Display tooltips for cell text that cannot be shown completely. If // wxUSE_TOOLTIPS is 0, then this doesn't have any effect. wxPG_TOOLTIPS = 0x00000100, // Disables margin and hides all expand/collapse buttons that would appear // outside the margin (for sub-properties). Toggling this style automatically // expands all collapsed items. wxPG_HIDE_MARGIN = 0x00000200, // This style prevents user from moving the splitter. wxPG_STATIC_SPLITTER = 0x00000400, // Combination of other styles that make it impossible for user to modify // the layout. wxPG_STATIC_LAYOUT = (wxPG_HIDE_MARGIN|wxPG_STATIC_SPLITTER), // Disables wxTextCtrl based editors for properties which // can be edited in another way. // Equals calling wxPropertyGrid::LimitPropertyEditing for all added // properties. wxPG_LIMITED_EDITING = 0x00000800, // wxPropertyGridManager only: Show toolbar for mode and page selection. wxPG_TOOLBAR = 0x00001000, // wxPropertyGridManager only: Show adjustable text box showing description // or help text, if available, for currently selected property. wxPG_DESCRIPTION = 0x00002000, // wxPropertyGridManager only: don't show an internal border around the // property grid. Recommended if you use a header. wxPG_NO_INTERNAL_BORDER = 0x00004000, // A mask which can be used to filter (out) all styles. wxPG_WINDOW_STYLE_MASK = wxPG_AUTO_SORT|wxPG_HIDE_CATEGORIES|wxPG_BOLD_MODIFIED| wxPG_SPLITTER_AUTO_CENTER|wxPG_TOOLTIPS|wxPG_HIDE_MARGIN| wxPG_STATIC_SPLITTER|wxPG_LIMITED_EDITING|wxPG_TOOLBAR| wxPG_DESCRIPTION|wxPG_NO_INTERNAL_BORDER }; #if wxPG_COMPATIBILITY_1_4 // In wxPG 1.4 this was used to enable now-default theme border support // in wxPropertyGridManager. #define wxPG_THEME_BORDER 0x00000000 #endif // NOTE: wxPG_EX_xxx are extra window styles and must be set using // SetExtraStyle() member function. enum wxPG_EX_WINDOW_STYLES { // Speeds up switching to wxPG_HIDE_CATEGORIES mode. Initially, if // wxPG_HIDE_CATEGORIES is not defined, the non-categorized data storage is // not activated, and switching the mode first time becomes somewhat slower. // wxPG_EX_INIT_NOCAT activates the non-categorized data storage right away. // NOTE: If you do plan not switching to non-categoric mode, or if // you don't plan to use categories at all, then using this style will result // in waste of resources. wxPG_EX_INIT_NOCAT = 0x00001000, // Extended window style that sets wxPropertyGridManager toolbar to not // use flat style. wxPG_EX_NO_FLAT_TOOLBAR = 0x00002000, // Shows alphabetic/categoric mode buttons from toolbar. wxPG_EX_MODE_BUTTONS = 0x00008000, // Show property help strings as tool tips instead as text on the status bar. // You can set the help strings using SetPropertyHelpString member function. wxPG_EX_HELP_AS_TOOLTIPS = 0x00010000, // Prevent TAB from focusing to wxButtons. This behaviour was default // in version 1.2.0 and earlier. // NOTE! Tabbing to button doesn't work yet. Problem seems to be that on wxMSW // at least the button doesn't properly propagate key events (yes, I'm using // wxWANTS_CHARS). //wxPG_EX_NO_TAB_TO_BUTTON = 0x00020000, // Allows relying on native double-buffering. wxPG_EX_NATIVE_DOUBLE_BUFFERING = 0x00080000, // Set this style to let user have ability to set values of properties to // unspecified state. Same as setting wxPG_PROP_AUTO_UNSPECIFIED for // all properties. wxPG_EX_AUTO_UNSPECIFIED_VALUES = 0x00200000, // If this style is used, built-in attributes (such as wxPG_FLOAT_PRECISION // and wxPG_STRING_PASSWORD) are not stored into property's attribute storage // (thus they are not readable). // Note that this option is global, and applies to all wxPG property // containers. wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES = 0x00400000, // Hides page selection buttons from toolbar. wxPG_EX_HIDE_PAGE_BUTTONS = 0x01000000, // Allows multiple properties to be selected by user (by pressing SHIFT // when clicking on a property, or by dragging with left mouse button // down). // You can get array of selected properties with // wxPropertyGridInterface::GetSelectedProperties(). In multiple selection // mode wxPropertyGridInterface::GetSelection() returns // property which has editor active (usually the first one // selected). Other useful member functions are ClearSelection(), // AddToSelection() and RemoveFromSelection(). wxPG_EX_MULTIPLE_SELECTION = 0x02000000, // This enables top-level window tracking which allows wxPropertyGrid to // notify the application of last-minute property value changes by user. // This style is not enabled by default because it may cause crashes when // wxPropertyGrid is used in with wxAUI or similar system. // Note: If you are not in fact using any system that may change // wxPropertyGrid's top-level parent window on its own, then you // are recommended to enable this style. wxPG_EX_ENABLE_TLP_TRACKING = 0x04000000, // Don't show divider above toolbar, on Windows. wxPG_EX_NO_TOOLBAR_DIVIDER = 0x08000000, // Show a separator below the toolbar. wxPG_EX_TOOLBAR_SEPARATOR = 0x10000000, // Allows to take focus on the entire area (on canvas) // even if wxPropertyGrid is not a standalone control. wxPG_EX_ALWAYS_ALLOW_FOCUS = 0x00100000, // A mask which can be used to filter (out) all extra styles applicable to wxPropertyGrid. wxPG_EX_WINDOW_PG_STYLE_MASK = wxPG_EX_INIT_NOCAT|wxPG_EX_HELP_AS_TOOLTIPS|wxPG_EX_NATIVE_DOUBLE_BUFFERING| wxPG_EX_AUTO_UNSPECIFIED_VALUES|wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES| wxPG_EX_MULTIPLE_SELECTION|wxPG_EX_ENABLE_TLP_TRACKING|wxPG_EX_ALWAYS_ALLOW_FOCUS, // A mask which can be used to filter (out) all extra styles applicable to wxPropertyGridManager. wxPG_EX_WINDOW_PGMAN_STYLE_MASK = wxPG_EX_NO_FLAT_TOOLBAR|wxPG_EX_MODE_BUTTONS|wxPG_EX_HIDE_PAGE_BUTTONS| wxPG_EX_NO_TOOLBAR_DIVIDER|wxPG_EX_TOOLBAR_SEPARATOR, // A mask which can be used to filter (out) all extra styles. wxPG_EX_WINDOW_STYLE_MASK = wxPG_EX_WINDOW_PG_STYLE_MASK|wxPG_EX_WINDOW_PGMAN_STYLE_MASK }; #if wxPG_COMPATIBILITY_1_4 #define wxPG_EX_DISABLE_TLP_TRACKING 0x00000000 #endif // Combines various styles. #define wxPG_DEFAULT_STYLE (0) // Combines various styles. #define wxPGMAN_DEFAULT_STYLE (0) // ----------------------------------------------------------------------- // wxPropertyGrid stores information about common values in these // records. // NB: Common value feature is not complete, and thus not mentioned in // documentation. class WXDLLIMPEXP_PROPGRID wxPGCommonValue { public: wxPGCommonValue( const wxString& label, wxPGCellRenderer* renderer ) { m_label = label; m_renderer = renderer; renderer->IncRef(); } virtual ~wxPGCommonValue() { m_renderer->DecRef(); } virtual wxString GetEditableText() const { return m_label; } const wxString& GetLabel() const { return m_label; } wxPGCellRenderer* GetRenderer() const { return m_renderer; } protected: wxString m_label; wxPGCellRenderer* m_renderer; }; // ----------------------------------------------------------------------- // wxPropertyGrid Validation Failure behaviour Flags enum wxPG_VALIDATION_FAILURE_BEHAVIOR_FLAGS { // Prevents user from leaving property unless value is valid. If this // behaviour flag is not used, then value change is instead cancelled. wxPG_VFB_STAY_IN_PROPERTY = 0x01, // Calls wxBell() on validation failure. wxPG_VFB_BEEP = 0x02, // Cell with invalid value will be marked (with red colour). wxPG_VFB_MARK_CELL = 0x04, // Display a text message explaining the situation. // To customize the way the message is displayed, you need to // reimplement wxPropertyGrid::DoShowPropertyError() in a // derived class. Default behaviour is to display the text on // the top-level frame's status bar, if present, and otherwise // using wxMessageBox. wxPG_VFB_SHOW_MESSAGE = 0x08, // Similar to wxPG_VFB_SHOW_MESSAGE, except always displays the // message using wxMessageBox. wxPG_VFB_SHOW_MESSAGEBOX = 0x10, // Similar to wxPG_VFB_SHOW_MESSAGE, except always displays the // message on the status bar (when present - you can reimplement // wxPropertyGrid::GetStatusBar() in a derived class to specify // this yourself). wxPG_VFB_SHOW_MESSAGE_ON_STATUSBAR = 0x20, // Defaults. wxPG_VFB_DEFAULT = wxPG_VFB_MARK_CELL | wxPG_VFB_SHOW_MESSAGEBOX, // Only used internally. wxPG_VFB_UNDEFINED = 0x80 }; // Having this as define instead of wxByte typedef makes things easier for // wxPython bindings (ignoring and redefining it in SWIG interface file // seemed rather tricky) #define wxPGVFBFlags unsigned char // Used to convey validation information to and from functions that // actually perform validation. Mostly used in custom property // classes. class WXDLLIMPEXP_PROPGRID wxPGValidationInfo { friend class wxPropertyGrid; public: wxPGValidationInfo() { m_failureBehavior = 0; m_isFailing = false; } ~wxPGValidationInfo() { } // Returns failure behaviour which is a combination of // wxPG_VFB_XXX flags. wxPGVFBFlags GetFailureBehavior() const { return m_failureBehavior; } // Returns current failure message. const wxString& GetFailureMessage() const { return m_failureMessage; } // Returns reference to pending value. wxVariant& GetValue() { wxASSERT(m_pValue); return *m_pValue; } // Set validation failure behaviour // failureBehavior - Mixture of wxPG_VFB_XXX flags. void SetFailureBehavior(wxPGVFBFlags failureBehavior) { m_failureBehavior = failureBehavior; } // Set current failure message. void SetFailureMessage(const wxString& message) { m_failureMessage = message; } private: // Value to be validated. wxVariant* m_pValue; // Message displayed on validation failure. wxString m_failureMessage; // Validation failure behaviour. Use wxPG_VFB_XXX flags. wxPGVFBFlags m_failureBehavior; // True when validation is currently failing. bool m_isFailing; }; // ----------------------------------------------------------------------- // These are used with wxPropertyGrid::AddActionTrigger() and // wxPropertyGrid::ClearActionTriggers(). enum wxPG_KEYBOARD_ACTIONS { wxPG_ACTION_INVALID = 0, // Select the next property. wxPG_ACTION_NEXT_PROPERTY, // Select the previous property. wxPG_ACTION_PREV_PROPERTY, // Expand the selected property, if it has child items. wxPG_ACTION_EXPAND_PROPERTY, // Collapse the selected property, if it has child items. wxPG_ACTION_COLLAPSE_PROPERTY, // Cancel and undo any editing done in the currently active property // editor. wxPG_ACTION_CANCEL_EDIT, // Move focus to the editor control of the currently selected // property. wxPG_ACTION_EDIT, // Causes editor's button (if any) to be pressed. wxPG_ACTION_PRESS_BUTTON, wxPG_ACTION_MAX }; // ----------------------------------------------------------------------- // wxPropertyGrid::DoSelectProperty flags (selFlags) enum wxPG_SELECT_PROPERTY_FLAGS { // Focuses to created editor wxPG_SEL_FOCUS = 0x0001, // Forces deletion and recreation of editor wxPG_SEL_FORCE = 0x0002, // For example, doesn't cause EnsureVisible wxPG_SEL_NONVISIBLE = 0x0004, // Do not validate editor's value before selecting wxPG_SEL_NOVALIDATE = 0x0008, // Property being deselected is about to be deleted wxPG_SEL_DELETING = 0x0010, // Property's values was set to unspecified by the user wxPG_SEL_SETUNSPEC = 0x0020, // Property's event handler changed the value wxPG_SEL_DIALOGVAL = 0x0040, // Set to disable sending of wxEVT_PG_SELECTED event wxPG_SEL_DONT_SEND_EVENT = 0x0080, // Don't make any graphics updates wxPG_SEL_NO_REFRESH = 0x0100 }; // ----------------------------------------------------------------------- // DoSetSplitterPosition() flags enum wxPG_SET_SPLITTER_POSITION_SPLITTER_FLAGS { wxPG_SPLITTER_REFRESH = 0x0001, wxPG_SPLITTER_ALL_PAGES = 0x0002, wxPG_SPLITTER_FROM_EVENT = 0x0004, wxPG_SPLITTER_FROM_AUTO_CENTER = 0x0008 }; // ----------------------------------------------------------------------- // Internal flags enum wxPG_INTERNAL_FLAGS { wxPG_FL_INITIALIZED = 0x0001, // Set when creating editor controls if it was clicked on. wxPG_FL_ACTIVATION_BY_CLICK = 0x0002, wxPG_FL_DONT_CENTER_SPLITTER = 0x0004, wxPG_FL_FOCUSED = 0x0008, wxPG_FL_MOUSE_CAPTURED = 0x0010, wxPG_FL_MOUSE_INSIDE = 0x0020, wxPG_FL_VALUE_MODIFIED = 0x0040, // don't clear background of m_wndEditor wxPG_FL_PRIMARY_FILLS_ENTIRE = 0x0080, // currently active editor uses custom image wxPG_FL_CUR_USES_CUSTOM_IMAGE = 0x0100, // cell colours override selection colours for selected cell wxPG_FL_CELL_OVERRIDES_SEL = 0x0200, wxPG_FL_SCROLLED = 0x0400, // set when all added/inserted properties get hideable flag wxPG_FL_ADDING_HIDEABLES = 0x0800, // Disables showing help strings on statusbar. wxPG_FL_NOSTATUSBARHELP = 0x1000, // Marks that we created the state, so we have to destroy it too. wxPG_FL_CREATEDSTATE = 0x2000, // Set if scrollbar's existence was detected in last onresize. wxPG_FL_SCROLLBAR_DETECTED = 0x4000, // Set if wxPGMan requires redrawing of description text box. wxPG_FL_DESC_REFRESH_REQUIRED = 0x8000, // Set if contained in wxPropertyGridManager wxPG_FL_IN_MANAGER = 0x00020000, // Set after wxPropertyGrid is shown in its initial good size wxPG_FL_GOOD_SIZE_SET = 0x00040000, // Set when in SelectProperty. wxPG_FL_IN_SELECT_PROPERTY = 0x00100000, // Set when help string is shown in status bar wxPG_FL_STRING_IN_STATUSBAR = 0x00200000, // Auto sort is enabled (for categorized mode) wxPG_FL_CATMODE_AUTO_SORT = 0x01000000, // Set after page has been inserted to manager wxPG_MAN_FL_PAGE_INSERTED = 0x02000000, // Active editor control is abnormally large wxPG_FL_ABNORMAL_EDITOR = 0x04000000, // Recursion guard for HandleCustomEditorEvent wxPG_FL_IN_HANDLECUSTOMEDITOREVENT = 0x08000000, wxPG_FL_VALUE_CHANGE_IN_EVENT = 0x10000000, // Editor control width should not change on resize wxPG_FL_FIXED_WIDTH_EDITOR = 0x20000000, // Width of panel can be different from width of grid wxPG_FL_HAS_VIRTUAL_WIDTH = 0x40000000, // Prevents RecalculateVirtualSize re-entrancy wxPG_FL_RECALCULATING_VIRTUAL_SIZE = 0x80000000 }; #if !defined(__wxPG_SOURCE_FILE__) // Reduce compile time, but still include in user app #include "wx/propgrid/props.h" #endif // ----------------------------------------------------------------------- // wxPropertyGrid is a specialized grid for editing properties // such as strings, numbers, flagsets, fonts, and colours. wxPropertySheet // used to do the very same thing, but it hasn't been updated for a while // and it is currently deprecated. // Please note that most member functions are inherited and as such not // documented heree. This means you will probably also want to read // wxPropertyGridInterface class reference. // To process input from a propertygrid control, use these event handler // macros to direct input to member functions that take a wxPropertyGridEvent // argument. // EVT_PG_SELECTED (id, func) // Respond to wxEVT_PG_SELECTED event, generated when a property selection // has been changed, either by user action or by indirect program // function. For instance, collapsing a parent property programmatically // causes any selected child property to become unselected, and may // therefore cause this event to be generated. // EVT_PG_CHANGING(id, func) // Respond to wxEVT_PG_CHANGING event, generated when property value // is about to be changed by user. Use wxPropertyGridEvent::GetValue() // to take a peek at the pending value, and wxPropertyGridEvent::Veto() // to prevent change from taking place, if necessary. // EVT_PG_HIGHLIGHTED(id, func) // Respond to wxEVT_PG_HIGHLIGHTED event, which occurs when mouse // moves over a property. Event's property is NULL if hovered area does // not belong to any property. // EVT_PG_RIGHT_CLICK(id, func) // Respond to wxEVT_PG_RIGHT_CLICK event, which occurs when property is // clicked on with right mouse button. // EVT_PG_DOUBLE_CLICK(id, func) // Respond to wxEVT_PG_DOUBLE_CLICK event, which occurs when property is // double-clicked onwith left mouse button. // EVT_PG_ITEM_COLLAPSED(id, func) // Respond to wxEVT_PG_ITEM_COLLAPSED event, generated when user collapses // a property or category.. // EVT_PG_ITEM_EXPANDED(id, func) // Respond to wxEVT_PG_ITEM_EXPANDED event, generated when user expands // a property or category.. // EVT_PG_LABEL_EDIT_BEGIN(id, func) // Respond to wxEVT_PG_LABEL_EDIT_BEGIN event, generated when is about to // begin editing a property label. You can veto this event to prevent the // action. // EVT_PG_LABEL_EDIT_ENDING(id, func) // Respond to wxEVT_PG_LABEL_EDIT_ENDING event, generated when is about to // end editing of a property label. You can veto this event to prevent the // action. // EVT_PG_COL_BEGIN_DRAG(id, func) // Respond to wxEVT_PG_COL_BEGIN_DRAG event, generated when user // starts resizing a column - can be vetoed. // EVT_PG_COL_DRAGGING,(id, func) // Respond to wxEVT_PG_COL_DRAGGING, event, generated when a // column resize by user is in progress. This event is also generated // when user double-clicks the splitter in order to recenter // it. // EVT_PG_COL_END_DRAG(id, func) // Respond to wxEVT_PG_COL_END_DRAG event, generated after column // resize by user has finished. // Use Freeze() and Thaw() respectively to disable and enable drawing. This // will also delay sorting etc. miscellaneous calculations to the last // possible moment. class WXDLLIMPEXP_PROPGRID wxPropertyGrid : public wxControl, public wxScrollHelper, public wxPropertyGridInterface { friend class wxPropertyGridEvent; friend class wxPropertyGridPageState; friend class wxPropertyGridInterface; friend class wxPropertyGridManager; friend class wxPGHeaderCtrl; wxDECLARE_DYNAMIC_CLASS(wxPropertyGrid); public: #ifndef SWIG // Two step constructor. // Call Create when this constructor is called to build up the // wxPropertyGrid wxPropertyGrid(); #endif // The default constructor. The styles to be used are styles valid for // the wxWindow. wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPG_DEFAULT_STYLE, const wxString& name = wxPropertyGridNameStr ); // Destructor virtual ~wxPropertyGrid(); // Adds given key combination to trigger given action. // Here is a sample code to make Enter key press move focus to // the next property. // propGrid->AddActionTrigger(wxPG_ACTION_NEXT_PROPERTY, WXK_RETURN); // propGrid->DedicateKey(WXK_RETURN); // action - Which action to trigger. See @ref propgrid_keyboard_actions. // keycode - Which keycode triggers the action. // modifiers - Which key event modifiers, in addition to keycode, are needed to // trigger the action. void AddActionTrigger( int action, int keycode, int modifiers = 0 ); // Dedicates a specific keycode to wxPropertyGrid. This means that such // key presses will not be redirected to editor controls. // Using this function allows, for example, navigation between // properties using arrow keys even when the focus is in the editor // control. void DedicateKey( int keycode ) { #if WXWIN_COMPATIBILITY_3_0 // Deprecated: use a hash set instead. m_dedicatedKeys.push_back(keycode); #else m_dedicatedKeys.insert(keycode); #endif } // This static function enables or disables automatic use of // wxGetTranslation for following strings: wxEnumProperty list labels, // wxFlagsProperty child property labels. // Default is false. static void AutoGetTranslation( bool enable ); // Changes value of a property, as if from an editor. // Use this instead of SetPropertyValue() if you need the value to run // through validation process, and also send the property change event. // Returns true if value was successfully changed. bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue ); // Centers the splitter. // enableAutoResizing - If true, automatic column resizing is enabled // (only applicable if window style wxPG_SPLITTER_AUTO_CENTER is used). void CenterSplitter( bool enableAutoResizing = false ); // Deletes all properties. virtual void Clear() wxOVERRIDE; // Clears action triggers for given action. // action - Which action to trigger. void ClearActionTriggers( int action ); // Forces updating the value of property from the editor control. // Note that wxEVT_PG_CHANGING and wxEVT_PG_CHANGED are dispatched using // ProcessEvent, meaning your event handlers will be called immediately. // Returns true if anything was changed. virtual bool CommitChangesFromEditor( wxUint32 flags = 0 ); // Two step creation. // Whenever the control is created without any parameters, use Create to // actually create it. Don't access the control's public methods before // this is called @see @link wndflags Additional Window Styles@endlink bool Create( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPG_DEFAULT_STYLE, const wxString& name = wxPropertyGridNameStr ); // Call when editor widget's contents is modified. // For example, this is called when changes text in wxTextCtrl (used in // wxStringProperty and wxIntProperty). // This function should only be called by custom properties. void EditorsValueWasModified() { m_iFlags |= wxPG_FL_VALUE_MODIFIED; } // Reverse of EditorsValueWasModified(). // This function should only be called by custom properties. void EditorsValueWasNotModified() { m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED); } // Enables or disables (shows/hides) categories according to parameter // enable. bool EnableCategories( bool enable ); // Scrolls and/or expands items to ensure that the given item is visible. // Returns true if something was actually done. bool EnsureVisible( wxPGPropArg id ); // Reduces column sizes to minimum possible that contents are still // visibly (naturally some margin space will be applied as well). // Returns minimum size for the grid to still display everything. // Does not work well with wxPG_SPLITTER_AUTO_CENTER window style. // This function only works properly if grid size prior to call was already // fairly large. // Note that you can also get calculated column widths by calling // GetState->GetColumnWidth() immediately after this function returns. wxSize FitColumns() { wxSize sz = m_pState->DoFitColumns(); return sz; } // Returns wxWindow that the properties are painted on, and which should // be used as the parent for editor controls. wxWindow* GetPanel() { return this; } // Returns current category caption background colour. wxColour GetCaptionBackgroundColour() const { return m_colCapBack; } wxFont& GetCaptionFont() { return m_captionFont; } // Returns current category caption font. const wxFont& GetCaptionFont() const { return m_captionFont; } // Returns current category caption text colour. wxColour GetCaptionForegroundColour() const { return m_colCapFore; } // Returns current cell background colour. wxColour GetCellBackgroundColour() const { return m_colPropBack; } // Returns current cell text colour when disabled. wxColour GetCellDisabledTextColour() const { return m_colDisPropFore; } // Returns current cell text colour. wxColour GetCellTextColour() const { return m_colPropFore; } // Returns number of columns currently on grid. unsigned int GetColumnCount() const { return m_pState->GetColumnCount(); } // Returns colour of empty space below properties. wxColour GetEmptySpaceColour() const { return m_colEmptySpace; } // Returns height of highest characters of used font. int GetFontHeight() const { return m_fontHeight; } // Returns pointer to itself. Dummy function that enables same kind // of code to use wxPropertyGrid and wxPropertyGridManager. wxPropertyGrid* GetGrid() { return this; } // Returns rectangle of custom paint image. wxRect GetImageRect( wxPGProperty* p, int item ) const; // Returns size of the custom paint image in front of property. // If no argument is given (p is NULL), returns preferred size. wxSize GetImageSize( wxPGProperty* p = NULL, int item = -1 ) const; // Returns last item which could be iterated using given flags. wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) { return m_pState->GetLastItem(flags); } const wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) const { return m_pState->GetLastItem(flags); } // Returns colour of lines between cells. wxColour GetLineColour() const { return m_colLine; } // Returns background colour of margin. wxColour GetMarginColour() const { return m_colMargin; } // Returns margin width. int GetMarginWidth() const { return m_marginWidth; } // Returns most up-to-date value of selected property. This will return // value different from GetSelectedProperty()->GetValue() only when text // editor is activate and string edited by user represents valid, // uncommitted property value. wxVariant GetUncommittedPropertyValue(); // Returns "root property". It does not have name, etc. and it is not // visible. It is only useful for accessing its children. wxPGProperty* GetRoot() const { return m_pState->m_properties; } // Returns height of a single grid row (in pixels). int GetRowHeight() const { return m_lineHeight; } // Returns currently selected property. wxPGProperty* GetSelectedProperty() const { return GetSelection(); } // Returns current selection background colour. wxColour GetSelectionBackgroundColour() const { return m_colSelBack; } // Returns current selection text colour. wxColour GetSelectionForegroundColour() const { return m_colSelFore; } // Returns current splitter x position. int GetSplitterPosition( unsigned int splitterIndex = 0 ) const { return m_pState->DoGetSplitterPosition(splitterIndex); } // Returns wxTextCtrl active in currently selected property, if any. Takes // into account wxOwnerDrawnComboBox. wxTextCtrl* GetEditorTextCtrl() const; wxPGValidationInfo& GetValidationInfo() { return m_validationInfo; } // Returns current vertical spacing. int GetVerticalSpacing() const { return (int)m_vspacing; } // Returns true if a property editor control has focus. bool IsEditorFocused() const; // Returns true if editor's value was marked modified. bool IsEditorsValueModified() const { return ( m_iFlags & wxPG_FL_VALUE_MODIFIED ) ? true : false; } // Returns information about arbitrary position in the grid. // pt - Coordinates in the virtual grid space. You may need to use // wxScrolled<T>::CalcScrolledPosition() for translating // wxPropertyGrid client coordinates into something this member // function can use. wxPropertyGridHitTestResult HitTest( const wxPoint& pt ) const; // Returns true if any property has been modified by the user. bool IsAnyModified() const #if WXWIN_COMPATIBILITY_3_0 { return m_pState->m_anyModified != (unsigned char)false; } #else { return m_pState->m_anyModified; } #endif // It is recommended that you call this function any time your code causes // wxPropertyGrid's top-level parent to change. wxPropertyGrid's OnIdle() // handler should be able to detect most changes, but it is not perfect. // newTLP - New top-level parent that is about to be set. Old top-level parent // window should still exist as the current one. // This function is automatically called from wxPropertyGrid:: // Reparent() and wxPropertyGridManager::Reparent(). You only // need to use it if you reparent wxPropertyGrid indirectly. void OnTLPChanging( wxWindow* newTLP ); // Redraws given property. virtual void RefreshProperty( wxPGProperty* p ) wxOVERRIDE; // Registers a new editor class. // Returns pointer to the editor class instance that should be used. static wxPGEditor* RegisterEditorClass( wxPGEditor* editor, bool noDefCheck = false ) { return DoRegisterEditorClass(editor, wxEmptyString, noDefCheck); } static wxPGEditor* DoRegisterEditorClass( wxPGEditor* editorClass, const wxString& editorName, bool noDefCheck = false ); // Resets all colours to the original system values. void ResetColours(); // Resets column sizes and splitter positions, based on proportions. // enableAutoResizing - If true, automatic column resizing is enabled // (only applicable if window style wxPG_SPLITTER_AUTO_CENTER is used). void ResetColumnSizes( bool enableAutoResizing = false ); // Selects a property. // Editor widget is automatically created, but not focused unless focus is // true. // id - Property to select. // Returns true if selection finished successfully. Usually only fails if // current value in editor is not valid. // This function clears any previous selection. // In wxPropertyGrid 1.4, this member function used to generate // wxEVT_PG_SELECTED. In wxWidgets 2.9 and later, it no longer // does that. bool SelectProperty( wxPGPropArg id, bool focus = false ); // Set entire new selection from given list of properties. void SetSelection( const wxArrayPGProperty& newSelection ) { DoSetSelection( newSelection, wxPG_SEL_DONT_SEND_EVENT ); } // Adds given property into selection. If wxPG_EX_MULTIPLE_SELECTION // extra style is not used, then this has same effect as // calling SelectProperty(). // Multiple selection is not supported for categories. This // means that if you have properties selected, you cannot // add category to selection, and also if you have category // selected, you cannot add other properties to selection. // This member function will fail silently in these cases, // even returning true. bool AddToSelection( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return DoAddToSelection(p, wxPG_SEL_DONT_SEND_EVENT); } // Removes given property from selection. If property is not selected, // an assertion failure will occur. bool RemoveFromSelection( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) return DoRemoveFromSelection(p, wxPG_SEL_DONT_SEND_EVENT); } // Makes given column editable by user. // editable - Using false here will disable column from being editable. void MakeColumnEditable( unsigned int column, bool editable = true ); // Creates label editor wxTextCtrl for given column, for property // that is currently selected. When multiple selection is // enabled, this applies to whatever property GetSelection() // returns. // colIndex - Which column's label to edit. Note that you should not // use value 1, which is reserved for property value // column. void BeginLabelEdit( unsigned int column = 0 ) { DoBeginLabelEdit(column, wxPG_SEL_DONT_SEND_EVENT); } // Destroys label editor wxTextCtrl, if any. // commit - Use true (default) to store edited label text in // property cell data. void EndLabelEdit( bool commit = true ) { DoEndLabelEdit(commit, wxPG_SEL_DONT_SEND_EVENT); } // Returns currently active label editor, NULL if none. wxTextCtrl* GetLabelEditor() const { return m_labelEditor; } // Sets category caption background colour. void SetCaptionBackgroundColour(const wxColour& col); // Sets category caption text colour. void SetCaptionTextColour(const wxColour& col); // Sets default cell background colour - applies to property cells. // Note that appearance of editor widgets may not be affected. void SetCellBackgroundColour(const wxColour& col); // Sets cell text colour for disabled properties. void SetCellDisabledTextColour(const wxColour& col); // Sets default cell text colour - applies to property name and value text. // Note that appearance of editor widgets may not be affected. void SetCellTextColour(const wxColour& col); // Set number of columns (2 or more). void SetColumnCount( int colCount ) { m_pState->SetColumnCount(colCount); Refresh(); } // Sets the 'current' category - Append will add non-category properties // under it. void SetCurrentCategory( wxPGPropArg id ) { wxPG_PROP_ARG_CALL_PROLOG() wxPropertyCategory* pc = wxDynamicCast(p, wxPropertyCategory); wxASSERT(pc); m_pState->m_currentCategory = pc; } // Sets colour of empty space below properties. void SetEmptySpaceColour(const wxColour& col); // Sets colour of lines between cells. void SetLineColour(const wxColour& col); // Sets background colour of margin. void SetMarginColour(const wxColour& col); // Sets selection background colour - applies to selected property name // background. void SetSelectionBackgroundColour(const wxColour& col); // Sets selection foreground colour - applies to selected property name // text. void SetSelectionTextColour(const wxColour& col); // Sets x coordinate of the splitter. // Splitter position cannot exceed grid size, and therefore setting it // during form creation may fail as initial grid size is often smaller // than desired splitter position, especially when sizers are being used. void SetSplitterPosition( int newXPos, int col = 0 ) { DoSetSplitterPosition(newXPos, col, wxPG_SPLITTER_REFRESH); } // Sets the property sorting function. // sortFunction - The sorting function to be used. It should return a value greater // than 0 if position of p1 is after p2. So, for instance, when // comparing property names, you can use following implementation: // int MyPropertySortFunction(wxPropertyGrid* propGrid, // wxPGProperty* p1, // wxPGProperty* p2) // { // return p1->GetBaseName().compare( p2->GetBaseName() ); // } // Default property sort function sorts properties by their labels // (case-insensitively). void SetSortFunction( wxPGSortCallback sortFunction ) { m_sortFunction = sortFunction; } // Returns the property sort function (default is NULL). wxPGSortCallback GetSortFunction() const { return m_sortFunction; } // Sets appearance of value cells representing an unspecified property // value. Default appearance is blank. // If you set the unspecified value to have any // textual representation, then that will override // "InlineHelp" attribute. void SetUnspecifiedValueAppearance( const wxPGCell& cell ) { m_unspecifiedAppearance = m_propertyDefaultCell; m_unspecifiedAppearance.MergeFrom(cell); } // Returns current appearance of unspecified value cells. const wxPGCell& GetUnspecifiedValueAppearance() const { return m_unspecifiedAppearance; } // Returns (visual) text representation of the unspecified // property value. // argFlags - For internal use only. wxString GetUnspecifiedValueText( int argFlags = 0 ) const; // Set virtual width for this particular page. Width -1 indicates that the // virtual width should be disabled. void SetVirtualWidth( int width ); // Moves splitter as left as possible, while still allowing all // labels to be shown in full. // privateChildrenToo - If false, will still allow private children to be cropped. void SetSplitterLeft( bool privateChildrenToo = false ) { m_pState->SetSplitterLeft(privateChildrenToo); } // Sets vertical spacing. Can be 1, 2, or 3 - a value relative to font // height. Value of 2 should be default on most platforms. void SetVerticalSpacing( int vspacing ) { m_vspacing = (unsigned char)vspacing; CalculateFontAndBitmapStuff( vspacing ); if ( !m_pState->m_itemsAdded ) Refresh(); } // Shows an brief error message that is related to a property. void ShowPropertyError( wxPGPropArg id, const wxString& msg ) { wxPG_PROP_ARG_CALL_PROLOG() DoShowPropertyError(p, msg); } ///////////////////////////////////////////////////////////////// // // Following methods do not need to be (currently) documented // ///////////////////////////////////////////////////////////////// bool HasVirtualWidth() const { return (m_iFlags & wxPG_FL_HAS_VIRTUAL_WIDTH) ? true : false; } const wxPGCommonValue* GetCommonValue( unsigned int i ) const { return (wxPGCommonValue*) m_commonValues[i]; } // Returns number of common values. unsigned int GetCommonValueCount() const { return (unsigned int) m_commonValues.size(); } // Returns label of given common value. wxString GetCommonValueLabel( unsigned int i ) const { wxASSERT( GetCommonValue(i) ); return GetCommonValue(i)->GetLabel(); } // Returns index of common value that will truly change value to // unspecified. int GetUnspecifiedCommonValue() const { return m_cvUnspecified; } // Set index of common value that will truly change value to unspecified. // Using -1 will set none to have such effect. // Default is 0. void SetUnspecifiedCommonValue( int index ) { m_cvUnspecified = index; } // Shortcut for creating dialog-caller button. Used, for example, by // wxFontProperty. // This should only be called by properties. wxWindow* GenerateEditorButton( const wxPoint& pos, const wxSize& sz ); // Fixes position of wxTextCtrl-like control (wxSpinCtrl usually // fits as one). Call after control has been created (but before // shown). void FixPosForTextCtrl( wxWindow* ctrl, unsigned int forColumn = 1, const wxPoint& offset = wxPoint(0, 0) ); // Shortcut for creating text editor widget. // pos - Same as pos given for CreateEditor. // sz - Same as sz given for CreateEditor. // value - Initial text for wxTextCtrl. // secondary - If right-side control, such as button, also created, // then create it first and pass it as this parameter. // extraStyle - Extra style flags to pass for wxTextCtrl. // Note that this should generally be called only by new classes derived // from wxPGProperty. wxWindow* GenerateEditorTextCtrl( const wxPoint& pos, const wxSize& sz, const wxString& value, wxWindow* secondary, int extraStyle = 0, int maxLen = 0, unsigned int forColumn = 1 ); // Generates both textctrl and button. wxWindow* GenerateEditorTextCtrlAndButton( const wxPoint& pos, const wxSize& sz, wxWindow** psecondary, int limited_editing, wxPGProperty* property ); // Generates position for a widget editor dialog box. // p - Property for which dialog is positioned. // sz - Known or over-approximated size of the dialog. // Returns position for dialog. wxPoint GetGoodEditorDialogPosition( wxPGProperty* p, const wxSize& sz ); // Converts escape sequences in src_str to newlines, // tabs, etc. and copies result to dst_str. static wxString& ExpandEscapeSequences( wxString& dst_str, const wxString& src_str ); // Converts newlines, tabs, etc. in src_str to escape // sequences, and copies result to dst_str. static wxString& CreateEscapeSequences( wxString& dst_str, const wxString& src_str ); // Checks system screen design used for laying out various dialogs. static bool IsSmallScreen(); // Returns rectangle that fully contains properties between and including // p1 and p2. Rectangle is in virtual scrolled window coordinates. wxRect GetPropertyRect( const wxPGProperty* p1, const wxPGProperty* p2 ) const; // Returns pointer to current active primary editor control (NULL if none). wxWindow* GetEditorControl() const; wxWindow* GetPrimaryEditor() const { return GetEditorControl(); } // Returns pointer to current active secondary editor control (NULL if // none). wxWindow* GetEditorControlSecondary() const { return m_wndEditor2; } // Refreshes any active editor control. void RefreshEditor(); // Events from editor controls are forward to this function bool HandleCustomEditorEvent( wxEvent &event ); // Mostly useful for page switching. void SwitchState( wxPropertyGridPageState* pNewState ); long GetInternalFlags() const { return m_iFlags; } bool HasInternalFlag( long flag ) const { return (m_iFlags & flag) ? true : false; } void SetInternalFlag( long flag ) { m_iFlags |= flag; } void ClearInternalFlag( long flag ) { m_iFlags &= ~(flag); } void OnComboItemPaint( const wxPGComboBox* pCb, int item, wxDC* pDc, wxRect& rect, int flags ); #if WXWIN_COMPATIBILITY_3_0 // Standardized double-to-string conversion. static const wxString& DoubleToString( wxString& target, double value, int precision, bool removeZeroes, wxString* precTemplate = NULL ); #endif // WXWIN_COMPATIBILITY_3_0 // Call this from wxPGProperty::OnEvent() to cause property value to be // changed after the function returns (with true as return value). // ValueChangeInEvent() must be used if you wish the application to be // able to use wxEVT_PG_CHANGING to potentially veto the given value. void ValueChangeInEvent( wxVariant variant ) { m_changeInEventValue = variant; m_iFlags |= wxPG_FL_VALUE_CHANGE_IN_EVENT; } // You can use this member function, for instance, to detect in // wxPGProperty::OnEvent() if wxPGProperty::SetValueInEvent() was // already called in wxPGEditor::OnEvent(). It really only detects // if was value was changed using wxPGProperty::SetValueInEvent(), which // is usually used when a 'picker' dialog is displayed. If value was // written by "normal means" in wxPGProperty::StringToValue() or // IntToValue(), then this function will return false (on the other hand, // wxPGProperty::OnEvent() is not even called in those cases). bool WasValueChangedInEvent() const { return (m_iFlags & wxPG_FL_VALUE_CHANGE_IN_EVENT) ? true : false; } // Returns true if given event is from first of an array of buttons // (as can be in case when wxPGMultiButton is used). bool IsMainButtonEvent( const wxEvent& event ) { return (event.GetEventType() == wxEVT_BUTTON) && (m_wndSecId == event.GetId()); } // Pending value is expected to be passed in PerformValidation(). virtual bool DoPropertyChanged( wxPGProperty* p, unsigned int selFlags = 0 ); // Called when validation for given property fails. // invalidValue - Value which failed in validation. // Returns true if user is allowed to change to another property even // if current has invalid value. // To add your own validation failure behaviour, override // wxPropertyGrid::DoOnValidationFailure(). bool OnValidationFailure( wxPGProperty* property, wxVariant& invalidValue ); // Called to indicate property and editor has valid value now. void OnValidationFailureReset( wxPGProperty* property ) { if ( property && property->HasFlag(wxPG_PROP_INVALID_VALUE) ) { DoOnValidationFailureReset(property); property->ClearFlag(wxPG_PROP_INVALID_VALUE); } m_validationInfo.m_failureMessage.clear(); } // Override in derived class to display error messages in custom manner // (these message usually only result from validation failure). // If you implement this, then you also need to implement // DoHidePropertyError() - possibly to do nothing, if error // does not need hiding (e.g. it was logged or shown in a // message box). virtual void DoShowPropertyError( wxPGProperty* property, const wxString& msg ); // Override in derived class to hide an error displayed by // DoShowPropertyError(). virtual void DoHidePropertyError( wxPGProperty* property ); #if wxUSE_STATUSBAR // Return wxStatusBar that is used by this wxPropertyGrid. You can // reimplement this member function in derived class to override // the default behaviour of using the top-level wxFrame's status // bar, if any. virtual wxStatusBar* GetStatusBar(); #endif // Override to customize property validation failure behaviour. // invalidValue - Value which failed in validation. // Returns true if user is allowed to change to another property even // if current has invalid value. virtual bool DoOnValidationFailure( wxPGProperty* property, wxVariant& invalidValue ); // Override to customize resetting of property validation failure status. // Property is guaranteed to have flag wxPG_PROP_INVALID_VALUE set. virtual void DoOnValidationFailureReset( wxPGProperty* property ); int GetSpacingY() const { return m_spacingy; } // Must be called in wxPGEditor::CreateControls() if primary editor window // is wxTextCtrl, just before textctrl is created. // text - Initial text value of created wxTextCtrl. void SetupTextCtrlValue( const wxString& text ) { m_prevTcValue = text; } // Unfocuses or closes editor if one was open, but does not deselect // property. bool UnfocusEditor(); virtual void SetWindowStyleFlag( long style ) wxOVERRIDE; void DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 ); void DrawItem( wxPGProperty* p ) { DrawItems(p,p); } virtual void DrawItemAndChildren( wxPGProperty* p ); // Draws item, children, and consecutive parents as long as category is // not met. void DrawItemAndValueRelated( wxPGProperty* p ); protected: // wxPropertyGridPageState used by the grid is created here. // If grid is used in wxPropertyGridManager, there is no point overriding // this - instead, set custom wxPropertyGridPage classes. virtual wxPropertyGridPageState* CreateState() const; enum PerformValidationFlags { SendEvtChanging = 0x0001, IsStandaloneValidation = 0x0002 // Not called in response to event }; // Runs all validation functionality (includes sending wxEVT_PG_CHANGING). // Returns true if all tests passed. Implement in derived class to // add additional validation behaviour. virtual bool PerformValidation( wxPGProperty* p, wxVariant& pendingValue, int flags = SendEvtChanging ); public: // Control font changer helper. void SetCurControlBoldFont(); wxPGCell& GetPropertyDefaultCell() { return m_propertyDefaultCell; } wxPGCell& GetCategoryDefaultCell() { return m_categoryDefaultCell; } // Public methods for semi-public use bool DoSelectProperty( wxPGProperty* p, unsigned int flags = 0 ); // Overridden functions. virtual bool Destroy() wxOVERRIDE; // Returns property at given y coordinate (relative to grid's top left). wxPGProperty* GetItemAtY( int y ) const { return DoGetItemAtY(y); } virtual void Refresh( bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE; virtual bool SetFont( const wxFont& font ) wxOVERRIDE; virtual void SetExtraStyle( long exStyle ) wxOVERRIDE; virtual bool Reparent( wxWindowBase *newParent ) wxOVERRIDE; protected: virtual void DoThaw() wxOVERRIDE; virtual wxSize DoGetBestSize() const wxOVERRIDE; #ifndef wxPG_ICON_WIDTH wxBitmap *m_expandbmp, *m_collbmp; #endif wxCursor *m_cursorSizeWE; // wxWindow pointers to editor control(s). wxWindow *m_wndEditor; wxWindow *m_wndEditor2; // Actual positions of the editors within the cell. wxPoint m_wndEditorPosRel; wxPoint m_wndEditor2PosRel; wxBitmap *m_doubleBuffer; // Local time ms when control was created. wxMilliClock_t m_timeCreated; // wxPGProperty::OnEvent can change value by setting this. wxVariant m_changeInEventValue; // Id of m_wndEditor2, or its first child, if any. int m_wndSecId; // Extra Y spacing between the items. int m_spacingy; // Control client area width; updated on resize. int m_width; // Control client area height; updated on resize. int m_height; // Current non-client width (needed when auto-centering). int m_ncWidth; // Non-client width (auto-centering helper). //int m_fWidth; // Previously recorded scroll start position. int m_prevVY; // The gutter spacing in front and back of the image. // This determines the amount of spacing in front of each item int m_gutterWidth; // Includes separator line. int m_lineHeight; // Gutter*2 + image width. int m_marginWidth; // y spacing for expand/collapse button. int m_buttonSpacingY; // Extra margin for expanded sub-group items. int m_subgroup_extramargin; // The image width of the [+] icon. // This is also calculated in the gutter int m_iconWidth; #ifndef wxPG_ICON_WIDTH // The image height of the [+] icon. // This is calculated as minimal size and to align int m_iconHeight; #endif // Current cursor id. int m_curcursor; // Caption font. Same as normal font plus bold style. wxFont m_captionFont; int m_fontHeight; // Height of the font. // m_splitterx when drag began. int m_startingSplitterX; // Index to splitter currently being dragged (0=one after the first // column). int m_draggedSplitter; // Changed property, calculated in PerformValidation(). wxPGProperty* m_chgInfo_changedProperty; // Lowest property for which editing happened, but which does not have // aggregate parent wxPGProperty* m_chgInfo_baseChangedProperty; // Changed property value, calculated in PerformValidation(). wxVariant m_chgInfo_pendingValue; // Passed to SetValue. wxVariant m_chgInfo_valueList; // Validation information. wxPGValidationInfo m_validationInfo; // Actions and keys that trigger them. wxPGHashMapI2I m_actionTriggers; // Appearance of currently active editor. wxPGCell m_editorAppearance; // Appearance of a unspecified value cell. wxPGCell m_unspecifiedAppearance; // List of properties to be deleted/removed in idle event handler. wxVector<wxPGProperty*> m_deletedProperties; wxVector<wxPGProperty*> m_removedProperties; #if !WXWIN_COMPATIBILITY_3_0 // List of editors and their event handlers to be deleted in idle event handler. wxArrayPGObject m_deletedEditorObjects; #endif // List of key codes that will not be handed over to editor controls. #if WXWIN_COMPATIBILITY_3_0 // Deprecated: use a hash set instead. wxVector<int> m_dedicatedKeys; #else wxPGHashSetInt m_dedicatedKeys; #endif // // Temporary values // // Bits are used to indicate which colours are customized. unsigned short m_coloursCustomized; // x - m_splitterx. signed char m_dragOffset; // 0 = not dragging, 1 = drag just started, 2 = drag in progress unsigned char m_dragStatus; // 0 = margin, 1 = label, 2 = value. unsigned char m_mouseSide; // True when editor control is focused. #if WXWIN_COMPATIBILITY_3_0 unsigned char m_editorFocused; #else bool m_editorFocused; #endif // 1 if m_latsCaption is also the bottommost caption. //unsigned char m_lastCaptionBottomnest; unsigned char m_vspacing; #if WXWIN_COMPATIBILITY_3_0 // Unused variable. // Used to track when Alt/Ctrl+Key was consumed. unsigned char m_keyComboConsumed; #endif // 1 if in DoPropertyChanged() bool m_inDoPropertyChanged; // 1 if in CommitChangesFromEditor() bool m_inCommitChangesFromEditor; // 1 if in DoSelectProperty() bool m_inDoSelectProperty; bool m_inOnValidationFailure; wxPGVFBFlags m_permanentValidationFailureBehavior; // Set by app // DoEditorValidate() recursion guard wxRecursionGuardFlag m_validatingEditor; // Internal flags - see wxPG_FL_XXX constants. wxUint32 m_iFlags; #if WXWIN_COMPATIBILITY_3_0 // Unused variable. // When drawing next time, clear this many item slots at the end. int m_clearThisMany; #endif // Mouse is hovering over this column (index) unsigned int m_colHover; // pointer to property that has mouse hovering wxPGProperty* m_propHover; // Active label editor and its actual position within the cell wxTextCtrl* m_labelEditor; wxPoint m_labelEditorPosRel; // For which property the label editor is active wxPGProperty* m_labelEditorProperty; // EventObject for wxPropertyGridEvents wxWindow* m_eventObject; // What (global) window is currently focused (needed to resolve event // handling mess). wxWindow* m_curFocused; // Event currently being sent - NULL if none at the moment wxPropertyGridEvent* m_processedEvent; // Last known top-level parent wxWindow* m_tlp; // Last closed top-level parent wxWindow* m_tlpClosed; // Local time ms when tlp was closed. wxMilliClock_t m_tlpClosedTime; // Sort function wxPGSortCallback m_sortFunction; // y coordinate of property that mouse hovering int m_propHoverY; // Which column's editor is selected (usually 1)? unsigned int m_selColumn; // x relative to splitter (needed for resize). int m_ctrlXAdjust; // lines between cells wxColour m_colLine; // property labels and values are written in this colour wxColour m_colPropFore; // or with this colour when disabled wxColour m_colDisPropFore; // background for m_colPropFore wxColour m_colPropBack; // text color for captions wxColour m_colCapFore; // background color for captions wxColour m_colCapBack; // foreground for selected property wxColour m_colSelFore; // background for selected property (actually use background color when // control out-of-focus) wxColour m_colSelBack; // background colour for margin wxColour m_colMargin; // background colour for empty space below the grid wxColour m_colEmptySpace; // Default property colours wxPGCell m_propertyDefaultCell; // Default property category wxPGCell m_categoryDefaultCell; // Backup of selected property's cells wxVector<wxPGCell> m_propCellsBackup; // NB: These *cannot* be moved to globals. // labels when properties use common values wxVector<wxPGCommonValue*> m_commonValues; // array of live events wxVector<wxPropertyGridEvent*> m_liveEvents; // Which cv selection really sets value to unspecified? int m_cvUnspecified; // Used to skip excess text editor events wxString m_prevTcValue; protected: // Sets some members to defaults (called constructors). void Init1(); // Initializes some members (called by Create and complex constructor). void Init2(); void OnPaint(wxPaintEvent &event ); // main event receivers void OnMouseMove( wxMouseEvent &event ); void OnMouseClick( wxMouseEvent &event ); void OnMouseRightClick( wxMouseEvent &event ); void OnMouseDoubleClick( wxMouseEvent &event ); void OnMouseUp( wxMouseEvent &event ); void OnKey( wxKeyEvent &event ); void OnResize( wxSizeEvent &event ); // event handlers bool HandleMouseMove( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseClick( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseRightClick( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseDoubleClick( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseUp( int x, unsigned int y, wxMouseEvent &event ); void HandleKeyEvent( wxKeyEvent &event, bool fromChild ); void OnMouseEntry( wxMouseEvent &event ); void OnIdle( wxIdleEvent &event ); void OnFocusEvent( wxFocusEvent &event ); void OnChildFocusEvent( wxChildFocusEvent& event ); bool OnMouseCommon( wxMouseEvent &event, int* px, int *py ); bool OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ); // sub-control event handlers void OnMouseClickChild( wxMouseEvent &event ); void OnMouseRightClickChild( wxMouseEvent &event ); void OnMouseMoveChild( wxMouseEvent &event ); void OnMouseUpChild( wxMouseEvent &event ); void OnChildKeyDown( wxKeyEvent &event ); void OnCaptureChange( wxMouseCaptureChangedEvent &event ); void OnScrollEvent( wxScrollWinEvent &event ); void OnSysColourChanged( wxSysColourChangedEvent &event ); void OnTLPClose( wxCloseEvent& event ); protected: bool AddToSelectionFromInputEvent( wxPGProperty* prop, unsigned int colIndex, wxMouseEvent* event = NULL, int selFlags = 0 ); // Adjust the centering of the bitmap icons (collapse / expand) when the // caption font changes. // They need to be centered in the middle of the font, so a bit of deltaY // adjustment is needed. On entry, m_captionFont must be set to window // font. It will be modified properly. void CalculateFontAndBitmapStuff( int vspacing ); wxRect GetEditorWidgetRect( wxPGProperty* p, int column ) const; void CorrectEditorWidgetSizeX(); // Called in RecalculateVirtualSize() to reposition control // on virtual height changes. void CorrectEditorWidgetPosY(); #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("use two-argument function DoDrawItems(dc,rect)") int DoDrawItems( wxDC& dc, const wxRect* itemsRect, bool isBuffered ) const { return DoDrawItemsBase(dc, itemsRect, isBuffered); } int DoDrawItems( wxDC& dc, const wxRect* itemsRect ) const { return DoDrawItemsBase(dc, itemsRect, true); } int DoDrawItemsBase( wxDC& dc, const wxRect* itemsRect, bool isBuffered ) const; #else int DoDrawItems( wxDC& dc, const wxRect* itemsRect ) const; #endif // Draws an expand/collapse (ie. +/-) button. virtual void DrawExpanderButton( wxDC& dc, const wxRect& rect, wxPGProperty* property ) const; // Draws items from topItemY to bottomItemY void DrawItems( wxDC& dc, unsigned int topItemY, unsigned int bottomItemY, const wxRect* itemsRect = NULL ); // Translate wxKeyEvent to wxPG_ACTION_XXX int KeyEventToActions(wxKeyEvent &event, int* pSecond) const; int KeyEventToAction(wxKeyEvent &event) const { return KeyEventToActions(event, NULL); } void ImprovedClientToScreen( int* px, int* py ); // Called by focus event handlers. newFocused is the window that becomes // focused. void HandleFocusChange( wxWindow* newFocused ); // Reloads all non-customized colours from system settings. void RegainColours(); virtual bool DoEditorValidate(); // Similar to DoSelectProperty() but also works on columns // other than 1. Does not active editor if column is not // editable. bool DoSelectAndEdit( wxPGProperty* prop, unsigned int colIndex, unsigned int selFlags ); void DoSetSelection( const wxArrayPGProperty& newSelection, int selFlags = 0 ); void DoSetSplitterPosition( int newxpos, int splitterIndex = 0, int flags = wxPG_SPLITTER_REFRESH ); bool DoAddToSelection( wxPGProperty* prop, int selFlags = 0 ); bool DoRemoveFromSelection( wxPGProperty* prop, int selFlags = 0 ); void DoBeginLabelEdit( unsigned int colIndex, int selFlags = 0 ); void DoEndLabelEdit( bool commit, int selFlags = 0 ); void OnLabelEditorEnterPress( wxCommandEvent& event ); void OnLabelEditorKeyPress( wxKeyEvent& event ); wxPGProperty* DoGetItemAtY( int y ) const; void DestroyEditorWnd( wxWindow* wnd ); void FreeEditors(); virtual bool DoExpand( wxPGProperty* p, bool sendEvent = false ); virtual bool DoCollapse( wxPGProperty* p, bool sendEvent = false ); // Returns nearest paint visible property (such that will be painted unless // window is scrolled or resized). If given property is paint visible, then // it itself will be returned. wxPGProperty* GetNearestPaintVisible( wxPGProperty* p ) const; static void RegisterDefaultEditors(); // Sets up basic event handling for child control void SetupChildEventHandling( wxWindow* wnd ); void CustomSetCursor( int type, bool override = false ); // Repositions scrollbar and underlying panel according // to changed virtual size. void RecalculateVirtualSize( int forceXPos = -1 ); void SetEditorAppearance( const wxPGCell& cell, bool unspecified = false ); void ResetEditorAppearance() { wxPGCell cell; cell.SetEmptyData(); SetEditorAppearance(cell, false); } void PrepareAfterItemsAdded(); // Send event from the property grid. // Omit the wxPG_SEL_NOVALIDATE flag to allow vetoing the event bool SendEvent( int eventType, wxPGProperty* p, wxVariant* pValue = NULL, unsigned int selFlags = wxPG_SEL_NOVALIDATE, unsigned int column = 1 ); // This function only moves focus to the wxPropertyGrid if it already // was on one of its child controls. void SetFocusOnCanvas(); bool DoHideProperty( wxPGProperty* p, bool hide, int flags ); void DeletePendingObjects(); private: bool ButtonTriggerKeyTest( int action, wxKeyEvent& event ); wxDECLARE_EVENT_TABLE(); }; // ----------------------------------------------------------------------- // // Bunch of inlines that need to resolved after all classes have been defined. // inline bool wxPropertyGridPageState::IsDisplayed() const { return ( this == m_pPropGrid->GetState() ); } inline unsigned int wxPropertyGridPageState::GetActualVirtualHeight() const { return DoGetRoot()->GetChildrenHeight(GetGrid()->GetRowHeight()); } inline wxString wxPGProperty::GetHintText() const { wxVariant vHintText = GetAttribute(wxPG_ATTR_HINT); #if wxPG_COMPATIBILITY_1_4 // Try the old, deprecated "InlineHelp" if ( vHintText.IsNull() ) vHintText = GetAttribute(wxPG_ATTR_INLINE_HELP); #endif if ( !vHintText.IsNull() ) return vHintText.GetString(); return wxEmptyString; } inline int wxPGProperty::GetDisplayedCommonValueCount() const { if ( HasFlag(wxPG_PROP_USES_COMMON_VALUE) ) { wxPropertyGrid* pg = GetGrid(); if ( pg ) return (int) pg->GetCommonValueCount(); } return 0; } inline void wxPGProperty::SetDefaultValue( wxVariant& value ) { SetAttribute(wxPG_ATTR_DEFAULT_VALUE, value); } inline void wxPGProperty::SetEditor( const wxString& editorName ) { m_customEditor = wxPropertyGridInterface::GetEditorByName(editorName); } inline bool wxPGProperty::SetMaxLength( int maxLen ) { return GetGrid()->SetPropertyMaxLength(this,maxLen); } // ----------------------------------------------------------------------- #define wxPG_BASE_EVT_PRE_ID 1775 #ifndef SWIG wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_SELECTED, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_CHANGING, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_CHANGED, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_HIGHLIGHTED, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_RIGHT_CLICK, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_PAGE_CHANGED, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_ITEM_COLLAPSED, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_ITEM_EXPANDED, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_DOUBLE_CLICK, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_LABEL_EDIT_BEGIN, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_LABEL_EDIT_ENDING, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_BEGIN_DRAG, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_DRAGGING, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_END_DRAG, wxPropertyGridEvent ); #else enum { wxEVT_PG_SELECTED = wxPG_BASE_EVT_PRE_ID, wxEVT_PG_CHANGING, wxEVT_PG_CHANGED, wxEVT_PG_HIGHLIGHTED, wxEVT_PG_RIGHT_CLICK, wxEVT_PG_PAGE_CHANGED, wxEVT_PG_ITEM_COLLAPSED, wxEVT_PG_ITEM_EXPANDED, wxEVT_PG_DOUBLE_CLICK, wxEVT_PG_LABEL_EDIT_BEGIN, wxEVT_PG_LABEL_EDIT_ENDING, wxEVT_PG_COL_BEGIN_DRAG, wxEVT_PG_COL_DRAGGING, wxEVT_PG_COL_END_DRAG }; #endif #define wxPG_BASE_EVT_TYPE wxEVT_PG_SELECTED #define wxPG_MAX_EVT_TYPE (wxPG_BASE_EVT_TYPE+30) #ifndef SWIG typedef void (wxEvtHandler::*wxPropertyGridEventFunction)(wxPropertyGridEvent&); #define EVT_PG_SELECTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_SELECTED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_CHANGING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_HIGHLIGHTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_HIGHLIGHTED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_RIGHT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_RIGHT_CLICK, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_DOUBLE_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_DOUBLE_CLICK, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_PAGE_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_PAGE_CHANGED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_ITEM_COLLAPSED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_COLLAPSED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_ITEM_EXPANDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_EXPANDED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_LABEL_EDIT_BEGIN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_LABEL_EDIT_BEGIN, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_LABEL_EDIT_ENDING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_LABEL_EDIT_ENDING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_COL_BEGIN_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_COL_BEGIN_DRAG, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_COL_DRAGGING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_COL_DRAGGING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define EVT_PG_COL_END_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_COL_END_DRAG, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), NULL ), #define wxPropertyGridEventHandler(fn) \ wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ) #endif // A propertygrid event holds information about events associated with // wxPropertyGrid objects. class WXDLLIMPEXP_PROPGRID wxPropertyGridEvent : public wxCommandEvent { public: // Constructor. wxPropertyGridEvent(wxEventType commandType=0, int id=0); // Copy constructor. wxPropertyGridEvent(const wxPropertyGridEvent& event); // Destructor. ~wxPropertyGridEvent(); // Copyer. virtual wxEvent* Clone() const wxOVERRIDE; // Returns the column index associated with this event. // For the column dragging events, it is the column to the left // of the splitter being dragged unsigned int GetColumn() const { return m_column; } wxPGProperty* GetMainParent() const { wxASSERT(m_property); return m_property->GetMainParent(); } // Returns property associated with this event. wxPGProperty* GetProperty() const { return m_property; } wxPGValidationInfo& GetValidationInfo() { wxASSERT(m_validationInfo); return *m_validationInfo; } // Returns true if you can veto the action that the event is signaling. bool CanVeto() const { return m_canVeto; } // Call this from your event handler to veto action that the event is // signaling. // You can only veto a shutdown if wxPropertyGridEvent::CanVeto returns // true. // Currently only wxEVT_PG_CHANGING supports vetoing. void Veto( bool veto = true ) { m_wasVetoed = veto; } // Returns name of the associated property. // Property name is stored in event, so it remains // accessible even after the associated property or // the property grid has been deleted. wxString GetPropertyName() const { return m_propertyName; } // Returns value of the associated property. Works for all event // types, but for wxEVT_PG_CHANGING this member function returns // the value that is pending, so you can call Veto() if the // value is not satisfactory. // Property value is stored in event, so it remains // accessible even after the associated property or // the property grid has been deleted. wxVariant GetPropertyValue() const { if ( m_validationInfo ) return m_validationInfo->GetValue(); return m_value; } // Returns value of the associated property. // See GetPropertyValue() wxVariant GetValue() const { return GetPropertyValue(); } // Set override validation failure behaviour. // Only effective if Veto was also called, and only allowed if event type // is wxEVT_PG_CHANGING. void SetValidationFailureBehavior( wxPGVFBFlags flags ) { wxASSERT( GetEventType() == wxEVT_PG_CHANGING ); m_validationInfo->SetFailureBehavior( flags ); } // Sets custom failure message for this time only. Only applies if // wxPG_VFB_SHOW_MESSAGE is set in validation failure flags. void SetValidationFailureMessage( const wxString& message ) { wxASSERT( GetEventType() == wxEVT_PG_CHANGING ); m_validationInfo->SetFailureMessage( message ); } wxPGVFBFlags GetValidationFailureBehavior() const { wxASSERT( GetEventType() == wxEVT_PG_CHANGING ); return m_validationInfo->GetFailureBehavior(); } void SetColumn( unsigned int column ) { m_column = column; } void SetCanVeto( bool canVeto ) { m_canVeto = canVeto; } bool WasVetoed() const { return m_wasVetoed; } // Changes the property associated with this event. void SetProperty( wxPGProperty* p ) { m_property = p; if ( p ) m_propertyName = p->GetName(); } void SetPropertyValue( wxVariant value ) { m_value = value; } void SetPropertyGrid( wxPropertyGrid* pg ) { m_pg = pg; OnPropertyGridSet(); } void SetupValidationInfo() { wxASSERT(m_pg); wxASSERT( GetEventType() == wxEVT_PG_CHANGING ); m_validationInfo = &m_pg->GetValidationInfo(); m_value = m_validationInfo->GetValue(); } private: void Init(); void OnPropertyGridSet(); wxDECLARE_DYNAMIC_CLASS(wxPropertyGridEvent); wxPGProperty* m_property; wxPropertyGrid* m_pg; wxPGValidationInfo* m_validationInfo; wxString m_propertyName; wxVariant m_value; unsigned int m_column; bool m_canVeto; bool m_wasVetoed; }; // ----------------------------------------------------------------------- // Allows populating wxPropertyGrid from arbitrary text source. class WXDLLIMPEXP_PROPGRID wxPropertyGridPopulator { public: // Default constructor. wxPropertyGridPopulator(); // Destructor. virtual ~wxPropertyGridPopulator(); void SetState( wxPropertyGridPageState* state ); void SetGrid( wxPropertyGrid* pg ); // Appends a new property under bottommost parent. // propClass - Property class as string. wxPGProperty* Add( const wxString& propClass, const wxString& propLabel, const wxString& propName, const wxString* propValue, wxPGChoices* pChoices = NULL ); // Pushes property to the back of parent array (ie it becomes bottommost // parent), and starts scanning/adding children for it. // When finished, parent array is returned to the original state. void AddChildren( wxPGProperty* property ); // Adds attribute to the bottommost property. // type - Allowed values: "string", (same as string), "int", "bool". // Empty string mean autodetect. bool AddAttribute( const wxString& name, const wxString& type, const wxString& value ); // Called once in AddChildren. virtual void DoScanForChildren() = 0; // Returns id of parent property for which children can currently be // added. wxPGProperty* GetCurParent() const { return m_propHierarchy.back(); } wxPropertyGridPageState* GetState() { return m_state; } const wxPropertyGridPageState* GetState() const { return m_state; } // Like wxString::ToLong, except allows N% in addition of N. static bool ToLongPCT( const wxString& s, long* pval, long max ); // Parses strings of format "choice1"[=value1] ... "choiceN"[=valueN] into // wxPGChoices. Registers parsed result using idString (if not empty). // Also, if choices with given id already registered, then don't parse but // return those choices instead. wxPGChoices ParseChoices( const wxString& choicesString, const wxString& idString ); // Implement in derived class to do custom process when an error occurs. // Default implementation uses wxLogError. virtual void ProcessError( const wxString& msg ); protected: // Used property grid. wxPropertyGrid* m_pg; // Used property grid state. wxPropertyGridPageState* m_state; // Tree-hierarchy of added properties (that can have children). wxVector<wxPGProperty*> m_propHierarchy; // Hashmap for string-id to wxPGChoicesData mapping. wxPGHashMapS2P m_dictIdChoices; }; // ----------------------------------------------------------------------- // // Undefine macros that are not needed outside propertygrid sources // #ifndef __wxPG_SOURCE_FILE__ #undef wxPG_FL_DESC_REFRESH_REQUIRED #undef wxPG_FL_SCROLLBAR_DETECTED #undef wxPG_FL_CREATEDSTATE #undef wxPG_FL_NOSTATUSBARHELP #undef wxPG_FL_SCROLLED #undef wxPG_FL_FOCUS_INSIDE_CHILD #undef wxPG_FL_FOCUS_INSIDE #undef wxPG_FL_MOUSE_INSIDE_CHILD #undef wxPG_FL_CUR_USES_CUSTOM_IMAGE #undef wxPG_FL_PRIMARY_FILLS_ENTIRE #undef wxPG_FL_VALUE_MODIFIED #undef wxPG_FL_MOUSE_INSIDE #undef wxPG_FL_FOCUSED #undef wxPG_FL_MOUSE_CAPTURED #undef wxPG_FL_INITIALIZED #undef wxPG_FL_ACTIVATION_BY_CLICK #undef wxPG_SUPPORT_TOOLTIPS #undef wxPG_ICON_WIDTH #undef wxPG_USE_RENDERER_NATIVE // Following are needed by the manager headers // #undef const wxString& #endif // ----------------------------------------------------------------------- #endif #endif // _WX_PROPGRID_PROPGRID_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dcclient.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dcclient.h // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DCCLIENT_H_ #define _WX_QT_DCCLIENT_H_ #include "wx/qt/dc.h" class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxQtDCImpl { public: wxWindowDCImpl( wxDC *owner ); wxWindowDCImpl( wxDC *owner, wxWindow *win ); ~wxWindowDCImpl(); protected: wxWindow *m_window; }; class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl { public: wxClientDCImpl( wxDC *owner ); wxClientDCImpl( wxDC *owner, wxWindow *win ); ~wxClientDCImpl(); }; class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxWindowDCImpl { public: wxPaintDCImpl( wxDC *owner ); wxPaintDCImpl( wxDC *owner, wxWindow *win ); }; #endif // _WX_QT_DCCLIENT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/listctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/listctrl.h // Author: Mariano Reingart, Peter Most // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_LISTCTRL_H_ #define _WX_QT_LISTCTRL_H_ #include "wx/textctrl.h" class QTreeWidget; class QTreeWidgetItem; class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase { public: wxListCtrl(); wxListCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListCtrlNameStr); bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListCtrlNameStr); virtual ~wxListCtrl(); // Attributes //////////////////////////////////////////////////////////////////////////// // Set the control colours bool SetForegroundColour(const wxColour& col); bool SetBackgroundColour(const wxColour& col); // Gets information about this column bool GetColumn(int col, wxListItem& info) const; // Sets information about this column bool SetColumn(int col, const wxListItem& info); // Gets the column width int GetColumnWidth(int col) const; // Sets the column width bool SetColumnWidth(int col, int width); // Gets the column order from its index or index from its order int GetColumnOrder(int col) const; int GetColumnIndexFromOrder(int order) const; // Gets the column order for all columns wxArrayInt GetColumnsOrder() const; // Sets the column order for all columns bool SetColumnsOrder(const wxArrayInt& orders); // Gets the number of items that can fit vertically in the // visible area of the list control (list or report view) // or the total number of items in the list control (icon // or small icon view) int GetCountPerPage() const; // return the total area occupied by all the items (icon/small icon only) wxRect GetViewRect() const; // Gets the edit control for editing labels. wxTextCtrl* GetEditControl() const; // Gets information about the item bool GetItem(wxListItem& info) const; // Sets information about the item bool SetItem(wxListItem& info); // Sets a string field at a particular column long SetItem(long index, int col, const wxString& label, int imageId = -1); // Gets the item state int GetItemState(long item, long stateMask) const; // Sets the item state bool SetItemState(long item, long state, long stateMask); // Sets the item image bool SetItemImage(long item, int image, int selImage = -1); bool SetItemColumnImage(long item, long column, int image); // Gets the item text wxString GetItemText(long item, int col = 0) const; // Sets the item text void SetItemText(long item, const wxString& str); // Gets the item data wxUIntPtr GetItemData(long item) const; // Sets the item data bool SetItemPtrData(long item, wxUIntPtr data); bool SetItemData(long item, long data); // Gets the item rectangle bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const; // Gets the subitem rectangle in report mode bool GetSubItemRect(long item, long subItem, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const; // Gets the item position bool GetItemPosition(long item, wxPoint& pos) const; // Sets the item position bool SetItemPosition(long item, const wxPoint& pos); // Gets the number of items in the list control int GetItemCount() const; // Gets the number of columns in the list control int GetColumnCount() const; // get the horizontal and vertical components of the item spacing wxSize GetItemSpacing() const; // Foreground colour of an item. void SetItemTextColour( long item, const wxColour& col); wxColour GetItemTextColour( long item ) const; // Background colour of an item. void SetItemBackgroundColour( long item, const wxColour &col); wxColour GetItemBackgroundColour( long item ) const; // Font of an item. void SetItemFont( long item, const wxFont &f); wxFont GetItemFont( long item ) const; // Gets the number of selected items in the list control int GetSelectedItemCount() const; // Gets the text colour of the listview wxColour GetTextColour() const; // Sets the text colour of the listview void SetTextColour(const wxColour& col); // Gets the index of the topmost visible item when in // list or report view long GetTopItem() const; // Add or remove a single window style void SetSingleStyle(long style, bool add = true); // Set the whole window style void SetWindowStyleFlag(long style); // Searches for an item, starting from 'item'. // item can be -1 to find the first item that matches the // specified flags. // Returns the item or -1 if unsuccessful. long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const; // Gets one of the three image lists wxImageList *GetImageList(int which) const; // Sets the image list void SetImageList(wxImageList *imageList, int which); void AssignImageList(wxImageList *imageList, int which); // refresh items selectively (only useful for virtual list controls) void RefreshItem(long item); void RefreshItems(long itemFrom, long itemTo); // Operations //////////////////////////////////////////////////////////////////////////// // Arranges the items bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); // Deletes an item bool DeleteItem(long item); // Deletes all items bool DeleteAllItems(); // Deletes a column bool DeleteColumn(int col); // Deletes all columns bool DeleteAllColumns(); // Clears items, and columns if there are any. void ClearAll(); // Edit the label wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); // End label editing, optionally cancelling the edit bool EndEditLabel(bool cancel); // Ensures this item is visible bool EnsureVisible(long item); // Find an item whose label matches this string, starting from the item after 'start' // or the beginning if 'start' is -1. long FindItem(long start, const wxString& str, bool partial = false); // Find an item whose data matches this data, starting from the item after 'start' // or the beginning if 'start' is -1. long FindItem(long start, wxUIntPtr data); // Find an item nearest this position in the specified direction, starting from // the item after 'start' or the beginning if 'start' is -1. long FindItem(long start, const wxPoint& pt, int direction); // Determines which item (if any) is at the specified point, // giving details in 'flags' (see wxLIST_HITTEST_... flags above) // Request the subitem number as well at the given coordinate. long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const; // Inserts an item, returning the index of the new item if successful, // -1 otherwise. long InsertItem(const wxListItem& info); // Insert a string item long InsertItem(long index, const wxString& label); // Insert an image item long InsertItem(long index, int imageIndex); // Insert an image/string item long InsertItem(long index, const wxString& label, int imageIndex); // set the number of items in a virtual list control void SetItemCount(long count); // Scrolls the list control. If in icon, small icon or report view mode, // x specifies the number of pixels to scroll. If in list view mode, x // specifies the number of columns to scroll. // If in icon, small icon or list view mode, y specifies the number of pixels // to scroll. If in report view mode, y specifies the number of lines to scroll. bool ScrollList(int dx, int dy); // Sort items. // fn is a function which takes 3 long arguments: item1, item2, data. // item1 is the long data associated with a first item (NOT the index). // item2 is the long data associated with a second item (NOT the index). // data is the same value as passed to SortItems. // The return value is a negative number if the first item should precede the second // item, a positive number of the second item should precede the first, // or zero if the two items are equivalent. // data is arbitrary data to be passed to the sort function. bool SortItems(wxListCtrlCompare fn, wxIntPtr data); // these functions are only used for virtual list view controls, i.e. the // ones with wxLC_VIRTUAL style (not currently implemented in wxQT) // return the text for the given column of the given item virtual wxString OnGetItemText(long item, long column) const; // return the icon for the given item. In report view, OnGetItemImage will // only be called for the first column. See OnGetItemColumnImage for // details. virtual int OnGetItemImage(long item) const; // return the icon for the given item and column. virtual int OnGetItemColumnImage(long item, long column) const; // return the attribute for the given item and column (may return NULL if none) virtual wxItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const { return OnGetItemAttr(item); } virtual QWidget *GetHandle() const; protected: void Init(); // Implement base class pure virtual methods. long DoInsertColumn(long col, const wxListItem& info); QTreeWidgetItem *QtGetItem(int id) const; wxImageList * m_imageListNormal; // The image list for normal icons wxImageList * m_imageListSmall; // The image list for small icons wxImageList * m_imageListState; // The image list state icons (not implemented yet) bool m_ownsImageListNormal, m_ownsImageListSmall, m_ownsImageListState; private: QTreeWidget *m_qtTreeWidget; wxDECLARE_DYNAMIC_CLASS( wxListCtrl ); }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/font.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/font.h // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_FONT_H_ #define _WX_QT_FONT_H_ class QFont; class WXDLLIMPEXP_CORE wxFont : public wxFontBase { public: wxFont(); wxFont(const wxFontInfo& info); wxFont(const wxString& nativeFontInfoString); wxFont(const wxNativeFontInfo& info); wxFont(const QFont& font); wxFont(int size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); wxFont(const wxSize& pixelSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") wxFont(int size, int family, int style, int weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); bool Create(wxSize size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // accessors: get the font characteristics virtual float GetFractionalPointSize() const wxOVERRIDE; virtual wxFontStyle GetStyle() const; virtual int GetNumericWeight() const wxOVERRIDE; virtual bool GetUnderlined() const; virtual wxString GetFaceName() const; virtual wxFontEncoding GetEncoding() const; virtual const wxNativeFontInfo *GetNativeFontInfo() const; // change the font characteristics virtual void SetFractionalPointSize(float pointSize) wxOVERRIDE; virtual void SetFamily( wxFontFamily family ); virtual void SetStyle( wxFontStyle style ); virtual void SetNumericWeight(int weight) wxOVERRIDE; virtual bool SetFaceName(const wxString& facename); virtual void SetUnderlined( bool underlined ); virtual void SetEncoding(wxFontEncoding encoding); wxDECLARE_COMMON_FONT_METHODS(); virtual QFont GetHandle() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; virtual wxFontFamily DoGetFamily() const; wxDECLARE_DYNAMIC_CLASS(wxFont); }; #endif // _WX_QT_FONT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/nonownedwnd.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/nonownedwnd.h // Author: Sean D'Epagnier // Copyright: (c) 2016 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_NONOWNEDWND_H_ #define _WX_QT_NONOWNEDWND_H_ // ---------------------------------------------------------------------------- // wxNonOwnedWindow contains code common to wx{Popup,TopLevel}Window in wxQT. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase { public: wxNonOwnedWindow(); protected: virtual bool DoClearShape() wxOVERRIDE; virtual bool DoSetRegionShape(const wxRegion& region) wxOVERRIDE; #if wxUSE_GRAPHICS_CONTEXT virtual bool DoSetPathShape(const wxGraphicsPath& path) wxOVERRIDE; #endif // wxUSE_GRAPHICS_CONTEXT wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow); }; #endif // _WX_QT_NONOWNEDWND_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/app.h
///////////////////////////////////////////////////////////////////////////// // Name: app.h // Purpose: wxApp class // Author: Peter Most, Mariano Reingart // Copyright: (c) 2009 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_APP_H_ #define _WX_QT_APP_H_ class QApplication; class WXDLLIMPEXP_CORE wxApp : public wxAppBase { public: wxApp(); ~wxApp(); virtual bool Initialize(int& argc, wxChar **argv); private: QApplication *m_qtApplication; int m_qtArgc; char **m_qtArgv; wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxApp ); }; #endif // _WX_QT_APP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dcmemory.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dcmemory.h // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DCMEMORY_H_ #define _WX_QT_DCMEMORY_H_ #include "wx/qt/dcclient.h" class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxQtDCImpl { public: wxMemoryDCImpl( wxMemoryDC *owner ); wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ); wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ); ~wxMemoryDCImpl(); virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const; virtual void DoSelect(const wxBitmap& bitmap); virtual const wxBitmap& GetSelectedBitmap() const; virtual wxBitmap& GetSelectedBitmap(); private: wxBitmap m_selected; }; #endif // _WX_QT_DCMEMORY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/anybutton.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/anybutton.h // Purpose: wxQT wxAnyButton class declaration // Author: Mariano Reingart // Copyright: (c) 2014 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_ANYBUTTON_H_ #define _WX_QT_ANYBUTTON_H_ class QPushButton; //----------------------------------------------------------------------------- // wxAnyButton //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase { public: wxAnyButton() { } // implementation // -------------- virtual void SetLabel( const wxString &label ); virtual QWidget *GetHandle() const; protected: virtual wxBitmap DoGetBitmap(State state) const wxOVERRIDE; virtual void DoSetBitmap(const wxBitmap& bitmap, State which) wxOVERRIDE; QPushButton *m_qtPushButton; void QtCreate(wxWindow *parent); void QtSetBitmap( const wxBitmap &bitmap ); private: typedef wxAnyButtonBase base_type; wxBitmap m_bitmap; wxDECLARE_NO_COPY_CLASS(wxAnyButton); }; #endif // _WX_QT_ANYBUTTON_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/toplevel.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/qt/toplevel.h // Purpose: declares wxTopLevelWindowNative class // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2009 wxWidgets dev team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_TOPLEVEL_H_ #define _WX_QT_TOPLEVEL_H_ class WXDLLIMPEXP_CORE wxTopLevelWindowQt : public wxTopLevelWindowBase { public: wxTopLevelWindowQt(); wxTopLevelWindowQt(wxWindow *parent, wxWindowID winid, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); virtual void Maximize(bool maximize = true); virtual void Restore(); virtual void Iconize(bool iconize = true); virtual bool IsMaximized() const; virtual bool IsIconized() const; virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool IsFullScreen() const; virtual void SetTitle(const wxString& title); virtual wxString GetTitle() const; virtual void SetIcons(const wxIconBundle& icons); // Styles virtual void SetWindowStyleFlag( long style ); virtual long GetWindowStyleFlag() const; }; #endif // _WX_QT_TOPLEVEL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/tooltip.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/tooltip.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_TOOLTIP_H_ #define _WX_QT_TOOLTIP_H_ #include "wx/object.h" class wxWindow; class WXDLLIMPEXP_CORE wxToolTip : public wxObject { public: // controlling tooltip behaviour: globally change tooltip parameters // enable or disable the tooltips globally static void Enable(bool flag); // set the delay after which the tooltip appears static void SetDelay(long milliseconds); // set the delay after which the tooltip disappears or how long the // tooltip remains visible static void SetAutoPop(long milliseconds); // set the delay between subsequent tooltips to appear static void SetReshow(long milliseconds); wxToolTip(const wxString &tip); void SetTip(const wxString& tip); const wxString& GetTip() const; // the window we're associated with void SetWindow(wxWindow *win); wxWindow *GetWindow() const { return m_window; } private: wxString m_text; wxWindow* m_window; // main window we're associated with }; #endif // _WX_QT_TOOLTIP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/stattext.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/stattext.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_STATTEXT_H_ #define _WX_QT_STATTEXT_H_ class QLabel; class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase { public: wxStaticText(); wxStaticText(wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0, const wxString &name = wxStaticTextNameStr ); bool Create(wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0, const wxString &name = wxStaticTextNameStr ); virtual void SetLabel(const wxString& label) wxOVERRIDE; virtual wxString GetLabel() const wxOVERRIDE; virtual QWidget *GetHandle() const; private: QLabel *m_qtLabel; wxDECLARE_DYNAMIC_CLASS( wxStaticText ); }; #endif // _WX_QT_STATTEXT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/radiobut.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/radiobut.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_RADIOBUT_H_ #define _WX_QT_RADIOBUT_H_ class QRadioButton; class WXDLLIMPEXP_CORE wxRadioButton : public wxControl { public: wxRadioButton(); wxRadioButton( wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRadioButtonNameStr ); bool Create( wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRadioButtonNameStr ); virtual void SetValue(bool value); virtual bool GetValue() const; virtual QWidget *GetHandle() const; protected: private: QRadioButton *m_qtRadioButton; wxDECLARE_DYNAMIC_CLASS( wxRadioButton ); }; #endif // _WX_QT_RADIOBUT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/radiobox.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/radiobox.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_RADIOBOX_H_ #define _WX_QT_RADIOBOX_H_ class QGroupBox; class QButtonGroup; class QBoxLayout; class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, public wxRadioBoxBase { public: wxRadioBox(); wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, int majorDim = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, int majorDim = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, int majorDim = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, int majorDim = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); using wxWindowBase::Show; using wxWindowBase::Enable; using wxRadioBoxBase::GetDefaultBorder; virtual bool Enable(unsigned int n, bool enable = true); virtual bool Show(unsigned int n, bool show = true); virtual bool IsItemEnabled(unsigned int n) const; virtual bool IsItemShown(unsigned int n) const; virtual unsigned int GetCount() const; virtual wxString GetString(unsigned int n) const; virtual void SetString(unsigned int n, const wxString& s); virtual void SetSelection(int n); virtual int GetSelection() const; virtual QWidget *GetHandle() const; private: // The 'visual' group box: QGroupBox *m_qtGroupBox; // Handles the mutual exclusion of buttons: QButtonGroup *m_qtButtonGroup; // Autofit layout for buttons (either vert. or horiz.): QBoxLayout *m_qtBoxLayout; wxDECLARE_DYNAMIC_CLASS(wxRadioBox); }; #endif // _WX_QT_RADIOBOX_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/defs.h
/* * Name: wx/qt/defs.h * Author: Peter Most * Copyright: (c) Peter Most * Licence: wxWindows licence */ #ifndef _WX_QT_DEFS_H_ #define _WX_QT_DEFS_H_ #ifdef __cplusplus typedef class QWidget *WXWidget; #endif #endif /* _WX_QT_DEFS_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/checklst.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/checklst.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CHECKLST_H_ #define _WX_QT_CHECKLST_H_ class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase { public: wxCheckListBox(); wxCheckListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int nStrings = 0, const wxString *choices = (const wxString *)NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); wxCheckListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); virtual ~wxCheckListBox(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); virtual bool IsChecked(unsigned int item) const; virtual void Check(unsigned int item, bool check = true); private: virtual void Init(); //common construction wxDECLARE_DYNAMIC_CLASS(wxCheckListBox); }; #endif // _WX_QT_CHECKLST_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/listbox.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/listbox.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_LISTBOX_H_ #define _WX_QT_LISTBOX_H_ class QListWidget; class QModelIndex; class QScrollArea; class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase { public: wxListBox(); wxListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); wxListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); virtual ~wxListBox(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); virtual bool IsSelected(int n) const; virtual int GetSelections(wxArrayInt& aSelections) const; virtual unsigned int GetCount() const; virtual wxString GetString(unsigned int n) const; virtual void SetString(unsigned int n, const wxString& s); virtual int GetSelection() const; virtual QWidget *GetHandle() const; void QtSendEvent(wxEventType evtType, const QModelIndex &index, bool selected); protected: virtual void DoSetFirstItem(int n); virtual void DoSetSelection(int n, bool select); virtual int DoInsertItems(const wxArrayStringsAdapter & items, unsigned int pos, void **clientData, wxClientDataType type); virtual int DoInsertOneItem(const wxString& item, unsigned int pos); virtual void DoSetItemClientData(unsigned int n, void *clientData); virtual void *DoGetItemClientData(unsigned int n) const; virtual void DoClear(); virtual void DoDeleteOneItem(unsigned int pos); virtual QScrollArea *QtGetScrollBarsContainer() const; #if wxUSE_CHECKLISTBOX bool m_hasCheckBoxes; #endif // wxUSE_CHECKLISTBOX QListWidget *m_qtListWidget; private: virtual void Init(); //common construction void UnSelectAll(); wxDECLARE_DYNAMIC_CLASS(wxListBox); }; #endif // _WX_QT_LISTBOX_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/textentry.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/textentry.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_TEXTENTRY_H_ #define _WX_QT_TEXTENTRY_H_ class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase { public: wxTextEntry(); virtual void WriteText(const wxString& text); virtual void Remove(long from, long to); virtual void Copy(); virtual void Cut(); virtual void Paste(); virtual void Undo(); virtual void Redo(); virtual bool CanUndo() const; virtual bool CanRedo() const; virtual void SetInsertionPoint(long pos); virtual long GetInsertionPoint() const; virtual long GetLastPosition() const; virtual void SetSelection(long from, long to); virtual void GetSelection(long *from, long *to) const; virtual bool IsEditable() const; virtual void SetEditable(bool editable); protected: virtual wxString DoGetValue() const; virtual void DoSetValue(const wxString& value, int flags=0); virtual wxWindow *GetEditableWindow(); private: }; #endif // _WX_QT_TEXTENTRY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/fontdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/fontdlg.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_FONTDLG_H_ #define _WX_QT_FONTDLG_H_ class QFontDialog; class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase { public: wxFontDialog() { } wxFontDialog(wxWindow *parent) { Create(parent); } wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); } protected: bool DoCreate(wxWindow *parent); private: wxFontData m_data; wxDECLARE_DYNAMIC_CLASS(wxFontDialog); }; #endif // _WX_QT_FONTDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/filedlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/filedlg.h // Author: Sean D'Epagnier // Copyright: (c) 2014 Sean D'Epagnier // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_FILEDLG_H_ #define _WX_QT_FILEDLG_H_ class QFileDialog; class WXDLLIMPEXP_CORE wxFileDialog : public wxFileDialogBase { public: wxFileDialog() { } wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, const wxString& name = wxFileDialogNameStr); bool Create(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, const wxString& name = wxFileDialogNameStr); virtual wxString GetPath() const wxOVERRIDE; virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE; virtual wxString GetFilename() const wxOVERRIDE; virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE; virtual int GetFilterIndex() const wxOVERRIDE; virtual void SetMessage(const wxString& message) wxOVERRIDE; virtual void SetPath(const wxString& path) wxOVERRIDE; virtual void SetDirectory(const wxString& dir) wxOVERRIDE; virtual void SetFilename(const wxString& name) wxOVERRIDE; virtual void SetWildcard(const wxString& wildCard) wxOVERRIDE; virtual void SetFilterIndex(int filterIndex) wxOVERRIDE; virtual bool SupportsExtraControl() const wxOVERRIDE { return true; } virtual QFileDialog *GetQFileDialog() const; private: wxDECLARE_DYNAMIC_CLASS(wxFileDialog); }; #endif // _WX_QT_FILEDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/spinbutt.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/spinbutt.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_SPINBUTT_H_ #define _WX_QT_SPINBUTT_H_ #include "wx/spinbutt.h" class QSpinBox; class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase { public: wxSpinButton(); wxSpinButton(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_VERTICAL, const wxString& name = wxSPIN_BUTTON_NAME); bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_VERTICAL, const wxString& name = wxSPIN_BUTTON_NAME); virtual int GetValue() const; virtual void SetValue(int val); virtual QWidget *GetHandle() const; private: QSpinBox *m_qtSpinBox; wxDECLARE_DYNAMIC_CLASS( wxSpinButton ); }; #endif // _WX_QT_SPINBUTT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/statbmp.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/statbmp.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_STATBMP_H_ #define _WX_QT_STATBMP_H_ class QLabel; class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase { public: wxStaticBitmap(); wxStaticBitmap( wxWindow *parent, wxWindowID id, const wxBitmap& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxStaticBitmapNameStr ); bool Create( wxWindow *parent, wxWindowID id, const wxBitmap& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxStaticBitmapNameStr); virtual void SetIcon(const wxIcon& icon); virtual void SetBitmap(const wxBitmap& bitmap); virtual wxBitmap GetBitmap() const; virtual wxIcon GetIcon() const; virtual QWidget *GetHandle() const; protected: private: QLabel *m_qtLabel; wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap); }; #endif // _WX_QT_STATBMP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/slider.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/slider.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_SLIDER_H_ #define _WX_QT_SLIDER_H_ class QSlider; class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase { public: wxSlider(); wxSlider(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr); bool Create(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr); virtual int GetValue() const; virtual void SetValue(int value); virtual void SetRange(int minValue, int maxValue); virtual int GetMin() const; virtual int GetMax() const; virtual void DoSetTickFreq(int freq); virtual int GetTickFreq() const; virtual void SetLineSize(int lineSize); virtual void SetPageSize(int pageSize); virtual int GetLineSize() const; virtual int GetPageSize() const; virtual void SetThumbLength(int lenPixels); virtual int GetThumbLength() const; virtual QWidget *GetHandle() const; private: QSlider *m_qtSlider; wxDECLARE_DYNAMIC_CLASS( wxSlider ); }; #endif // _WX_QT_SLIDER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/menuitem.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/menuitem.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_MENUITEM_H_ #define _WX_QT_MENUITEM_H_ #include "wx/menuitem.h" #include "wx/bitmap.h" class QAction; class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase { public: wxMenuItem(wxMenu *parentMenu = NULL, int id = wxID_SEPARATOR, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL, wxMenu *subMenu = NULL); virtual void SetItemLabel(const wxString& str); virtual void SetCheckable(bool checkable); virtual void Enable(bool enable = true); virtual bool IsEnabled() const; virtual void Check(bool check = true); virtual bool IsChecked() const; virtual void SetBitmap(const wxBitmap& bitmap); virtual const wxBitmap& GetBitmap() const { return m_bitmap; }; virtual QAction *GetHandle() const; private: // Qt is using an action instead of a menu item. QAction *m_qtAction; wxBitmap m_bitmap; wxDECLARE_DYNAMIC_CLASS( wxMenuItem ); }; #endif // _WX_QT_MENUITEM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/calctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/calctrl.h // Purpose: wxCalendarCtrl control implementation for wxQt // Author: Kolya Kosenko // Created: 2010-05-12 // Copyright: (c) 2010 Kolya Kosenko // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CALCTRL_H_ #define _WX_QT_CALCTRL_H_ #include "wx/calctrl.h" class QCalendarWidget; class WXDLLIMPEXP_ADV wxCalendarCtrl : public wxCalendarCtrlBase { public: wxCalendarCtrl() { Init(); } wxCalendarCtrl(wxWindow *parent, wxWindowID id, const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAL_SHOW_HOLIDAYS, const wxString& name = wxCalendarNameStr) { Init(); Create(parent, id, date, pos, size, style, name); } virtual ~wxCalendarCtrl(); bool Create(wxWindow *parent, wxWindowID id, const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAL_SHOW_HOLIDAYS, const wxString& name = wxCalendarNameStr); virtual bool SetDate(const wxDateTime& date); virtual wxDateTime GetDate() const; virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, const wxDateTime& upperdate = wxDefaultDateTime); virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const; virtual bool EnableMonthChange(bool enable = true); virtual void Mark(size_t day, bool mark); // holidays colours virtual void SetHoliday(size_t day); virtual void SetHolidayColours(const wxColour& colFg, const wxColour& colBg); virtual const wxColour& GetHolidayColourFg() const { return m_colHolidayFg; } virtual const wxColour& GetHolidayColourBg() const { return m_colHolidayBg; } // header colours virtual void SetHeaderColours(const wxColour& colFg, const wxColour& colBg); virtual const wxColour& GetHeaderColourFg() const { return m_colHeaderFg; } virtual const wxColour& GetHeaderColourBg() const { return m_colHeaderBg; } // day attributes virtual wxCalendarDateAttr *GetAttr(size_t day) const; virtual void SetAttr(size_t day, wxCalendarDateAttr *attr); virtual void ResetAttr(size_t day) { SetAttr(day, NULL); } virtual void SetWindowStyleFlag(long style); using wxCalendarCtrlBase::GenerateAllChangeEvents; virtual QWidget *GetHandle() const; protected: virtual void RefreshHolidays(); private: void Init(); void UpdateStyle(); QCalendarWidget *m_qtCalendar; wxColour m_colHeaderFg, m_colHeaderBg, m_colHolidayFg, m_colHolidayBg; wxCalendarDateAttr *m_attrs[31]; wxDECLARE_DYNAMIC_CLASS(wxCalendarCtrl); }; #endif // _WX_QT_CALCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/toolbar.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/toolbar.h // Author: Sean D'Epagnier, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// class QToolBar; #ifndef _WX_QT_TOOLBAR_H_ #define _WX_QT_TOOLBAR_H_ class QActionGroup; class wxQtToolBar; class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase { public: wxToolBar() { Init(); } wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTB_DEFAULT_STYLE | wxNO_BORDER, const wxString& name = wxToolBarNameStr) { Init(); Create(parent, id, pos, size, style, name); } virtual ~wxToolBar(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTB_DEFAULT_STYLE | wxNO_BORDER, const wxString& name = wxToolBarNameStr); virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE; virtual QToolBar *GetQToolBar() const { return m_qtToolBar; } virtual void SetWindowStyleFlag( long style ) wxOVERRIDE; virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE; virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE; virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE; virtual bool Realize() wxOVERRIDE; virtual wxToolBarToolBase *CreateTool(int toolid, const wxString& label, const wxBitmap& bmpNormal, const wxBitmap& bmpDisabled = wxNullBitmap, wxItemKind kind = wxITEM_NORMAL, wxObject *clientData = NULL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString) wxOVERRIDE; virtual wxToolBarToolBase *CreateTool(wxControl *control, const wxString& label) wxOVERRIDE; QWidget *GetHandle() const wxOVERRIDE; protected: QActionGroup* GetActionGroup(size_t pos); virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE; virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE; virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE; virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE; virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE; private: void Init(); long GetButtonStyle(); QToolBar *m_qtToolBar; wxDECLARE_DYNAMIC_CLASS(wxToolBar); }; #endif // _WX_QT_TOOLBAR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/gauge.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/gauge.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_GAUGE_H_ #define _WX_QT_GAUGE_H_ class QProgressBar; class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase { public: wxGauge(); wxGauge(wxWindow *parent, wxWindowID id, int range, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxGaugeNameStr); bool Create(wxWindow *parent, wxWindowID id, int range, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxGaugeNameStr); virtual QWidget *GetHandle() const; // set/get the control range virtual void SetRange(int range); virtual int GetRange() const; virtual void SetValue(int pos); virtual int GetValue() const; private: QProgressBar *m_qtProgressBar; wxDECLARE_DYNAMIC_CLASS(wxGauge); }; #endif // _WX_QT_GAUGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/spinctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/spinctrl.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_SPINCTRL_H_ #define _WX_QT_SPINCTRL_H_ class QSpinBox; class QDoubleSpinBox; // Take advantage of the Qt compile time polymorphy and use a template to avoid // copy&paste code for the usage of QSpinBox/QDoubleSpinBox. template < typename T, typename Widget > class WXDLLIMPEXP_CORE wxSpinCtrlQt : public wxSpinCtrlBase { public: wxSpinCtrlQt(); wxSpinCtrlQt( wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, T min, T max, T initial, T inc, const wxString& name ); bool Create( wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, T min, T max, T initial, T inc, const wxString& name ); virtual void SetValue(const wxString&) {} virtual void SetSnapToTicks(bool snap_to_ticks); virtual bool GetSnapToTicks() const; virtual void SetSelection(long from, long to); virtual void SetValue(T val); void SetRange(T minVal, T maxVal); void SetIncrement(T inc); T GetValue() const; T GetMin() const; T GetMax() const; T GetIncrement() const; virtual QWidget *GetHandle() const; protected: Widget *m_qtSpinBox; }; class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlQt< int, QSpinBox > { public: wxSpinCtrl(); wxSpinCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, const wxString& name = wxT("wxSpinCtrl")); bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, const wxString& name = wxT("wxSpinCtrl")); virtual int GetBase() const wxOVERRIDE { return m_base; } virtual bool SetBase(int base) wxOVERRIDE; virtual void SetValue(const wxString & val); virtual void SetValue(int val) { wxSpinCtrlQt<int,QSpinBox>::SetValue(val); } private: // Common part of all ctors. void Init() { m_base = 10; } int m_base; wxDECLARE_DYNAMIC_CLASS(wxSpinCtrl); }; class WXDLLIMPEXP_CORE wxSpinCtrlDouble : public wxSpinCtrlQt< double, QDoubleSpinBox > { public: wxSpinCtrlDouble(); wxSpinCtrlDouble(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, double min = 0, double max = 100, double initial = 0, double inc = 1, const wxString& name = wxT("wxSpinCtrlDouble")); bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, double min = 0, double max = 100, double initial = 0, double inc = 1, const wxString& name = wxT("wxSpinCtrlDouble")); void SetDigits(unsigned digits); unsigned GetDigits() const; virtual int GetBase() const wxOVERRIDE { return 10; } virtual bool SetBase(int WXUNUSED(base)) wxOVERRIDE { return false; } virtual void SetValue(const wxString & val); virtual void SetValue(double val) { wxSpinCtrlQt<double,QDoubleSpinBox>::SetValue(val); } private: wxDECLARE_DYNAMIC_CLASS( wxSpinCtrlDouble ); }; #endif // _WX_QT_SPINCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/region.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/region.h // Purpose: header for wxRegion // Author: Peter Most, Javier Torres // Copyright: (c) Peter Most, Javier Torres // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_REGION_H_ #define _WX_QT_REGION_H_ class QRegion; class QRect; template<class T> class QVector; class WXDLLIMPEXP_CORE wxRegion : public wxRegionBase { public: wxRegion(); wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h); wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegion(const wxRect& rect); wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); wxRegion(const wxBitmap& bmp); wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0); virtual bool IsEmpty() const; virtual void Clear(); virtual const QRegion &GetHandle() const; virtual void QtSetRegion(QRegion region); // Hangs on to this region protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; virtual bool DoIsEqual(const wxRegion& region) const; virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const; virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const; virtual wxRegionContain DoContainsRect(const wxRect& rect) const; virtual bool DoOffset(wxCoord x, wxCoord y); virtual bool DoUnionWithRect(const wxRect& rect); virtual bool DoUnionWithRegion(const wxRegion& region); virtual bool DoIntersect(const wxRegion& region); virtual bool DoSubtract(const wxRegion& region); virtual bool DoXor(const wxRegion& region); }; class WXDLLIMPEXP_CORE wxRegionIterator: public wxObject { public: wxRegionIterator(); wxRegionIterator(const wxRegion& region); wxRegionIterator(const wxRegionIterator& ri); ~wxRegionIterator(); wxRegionIterator& operator=(const wxRegionIterator& ri); void Reset(); void Reset(const wxRegion& region); bool HaveRects() const; operator bool () const; wxRegionIterator& operator ++ (); wxRegionIterator operator ++ (int); wxCoord GetX() const; wxCoord GetY() const; wxCoord GetW() const; wxCoord GetWidth() const; wxCoord GetH() const; wxCoord GetHeight() const; wxRect GetRect() const; private: QVector < QRect > *m_qtRects; int m_pos; }; #endif // _WX_QT_REGION_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/evtloop.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/evtloop.h // Author: Peter Most, Javier Torres, Mariano Reingart, Sean D'Epagnier // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_EVTLOOP_H_ #define _WX_QT_EVTLOOP_H_ class QTimer; class WXDLLIMPEXP_CORE wxQtEventLoopBase : public wxEventLoopBase { public: wxQtEventLoopBase(); ~wxQtEventLoopBase(); virtual int DoRun(); virtual void ScheduleExit(int rc = 0); virtual bool Pending() const; virtual bool Dispatch(); virtual int DispatchTimeout(unsigned long timeout); virtual void WakeUp(); virtual void DoYieldFor(long eventsToProcess); #if wxUSE_EVENTLOOP_SOURCE virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags); #endif // wxUSE_EVENTLOOP_SOURCE protected: private: QTimer *m_qtIdleTimer; wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase); }; #if wxUSE_GUI class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxQtEventLoopBase { public: wxGUIEventLoop(); }; #endif // wxUSE_GUI #endif // _WX_QT_EVTLOOP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/palette.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/palette.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_PALETTE_H_ #define _WX_QT_PALETTE_H_ class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase { public: wxPalette(); wxPalette(int n, unsigned char *red, unsigned char *green, unsigned char *blue); bool Create(int n, unsigned char *red, unsigned char *green, unsigned char *blue); bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const; int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; }; #endif // _WX_QT_PALETTE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/menu.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/menu.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_MENU_H_ #define _WX_QT_MENU_H_ class QMenu; class QMenuBar; class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase { public: wxMenu(long style = 0); wxMenu(const wxString& title, long style = 0); virtual QMenu *GetHandle() const; protected: virtual wxMenuItem *DoAppend(wxMenuItem *item); virtual wxMenuItem *DoInsert(size_t pos, wxMenuItem *item); virtual wxMenuItem *DoRemove(wxMenuItem *item); private: QMenu *m_qtMenu; wxDECLARE_DYNAMIC_CLASS(wxMenu); }; class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase { public: wxMenuBar(); wxMenuBar(long style); wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); virtual bool Append(wxMenu *menu, const wxString& title); virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); virtual wxMenu *Remove(size_t pos); virtual void EnableTop(size_t pos, bool enable); virtual bool IsEnabledTop(size_t pos) const wxOVERRIDE; virtual void SetMenuLabel(size_t pos, const wxString& label); virtual wxString GetMenuLabel(size_t pos) const; QMenuBar *GetQMenuBar() const { return m_qtMenuBar; } virtual QWidget *GetHandle() const; virtual void Attach(wxFrame *frame); virtual void Detach(); private: QMenuBar *m_qtMenuBar; wxDECLARE_DYNAMIC_CLASS(wxMenuBar); }; #endif // _WX_QT_MENU_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/colour.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/colour.h // Purpose: wxColour class implementation for wxQt // Author: Kolya Kosenko // Created: 2010-05-12 // Copyright: (c) 2010 Kolya Kosenko // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_COLOUR_H_ #define _WX_QT_COLOUR_H_ class QColor; class WXDLLIMPEXP_CORE wxColour : public wxColourBase { public: DEFINE_STD_WXCOLOUR_CONSTRUCTORS wxColour(const QColor& color); virtual bool IsOk() const { return m_valid; } ChannelType Red() const { return m_red; } ChannelType Green() const { return m_green; } ChannelType Blue() const { return m_blue; } ChannelType Alpha() const { return m_alpha; } bool operator==(const wxColour& color) const; bool operator!=(const wxColour& color) const; int GetPixel() const; QColor GetQColor() const; protected: void Init(); virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a); private: ChannelType m_red, m_green, m_blue, m_alpha; bool m_valid; wxDECLARE_DYNAMIC_CLASS(wxColour); }; #endif // _WX_QT_COLOUR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/checkbox.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/checkbox.h // Author: Peter Most, Sean D'Epagnier, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CHECKBOX_H_ #define _WX_QT_CHECKBOX_H_ class QCheckBox; class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase { public: wxCheckBox(); wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr ); virtual void SetValue(bool value); virtual bool GetValue() const; virtual void SetLabel(const wxString& label) wxOVERRIDE; virtual wxString GetLabel() const wxOVERRIDE; virtual QWidget *GetHandle() const; protected: virtual void DoSet3StateValue(wxCheckBoxState state); virtual wxCheckBoxState DoGet3StateValue() const; private: QCheckBox *m_qtCheckBox; wxDECLARE_DYNAMIC_CLASS(wxCheckBox); }; #endif // _WX_QT_CHECKBOX_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/bmpbuttn.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/bmpbuttn.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_BMPBUTTN_H_ #define _WX_QT_BMPBUTTN_H_ class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase { public: wxBitmapButton(); wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr); protected: wxDECLARE_DYNAMIC_CLASS(wxBitmapButton); private: // We re-use wxButton }; #endif // _WX_QT_BMPBUTTN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/mdi.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/mdi.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_MDI_H_ #define _WX_QT_MDI_H_ class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase { public: wxMDIParentFrame(); wxMDIParentFrame(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, const wxString& name = wxFrameNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, const wxString& name = wxFrameNameStr); // override/implement base class [pure] virtual methods // ---------------------------------------------------- static bool IsTDI() { return false; } virtual void ActivateNext(); virtual void ActivatePrevious(); protected: private: wxDECLARE_DYNAMIC_CLASS(wxMDIParentFrame); }; class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxMDIChildFrameBase { public: wxMDIChildFrame(); wxMDIChildFrame(wxMDIParentFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); bool Create(wxMDIParentFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); virtual void Activate(); }; class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase { public: wxMDIClientWindow(); virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); }; #endif // _WX_QT_MDI_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dataview.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dataview.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DATAVIEW_H_ #define _WX_QT_DATAVIEW_H_ class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase { public: wxDataViewColumn( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *renderer, unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxDATAVIEW_COL_RESIZABLE ); // setters: virtual void SetTitle( const wxString &title ); virtual void SetBitmap( const wxBitmap &bitmap ); virtual void SetOwner( wxDataViewCtrl *owner ); virtual void SetAlignment( wxAlignment align ); virtual void SetSortable( bool sortable ); virtual void SetSortOrder( bool ascending ); virtual void SetAsSortKey(bool sort = true); virtual void SetResizeable( bool resizeable ); virtual void SetHidden( bool hidden ); virtual void SetMinWidth( int minWidth ); virtual void SetWidth( int width ); virtual void SetReorderable( bool reorderable ); virtual void SetFlags(int flags); // getters: virtual wxString GetTitle() const; virtual wxAlignment GetAlignment() const; virtual bool IsSortable() const; virtual bool IsSortOrderAscending() const; virtual bool IsSortKey() const; virtual bool IsResizeable() const; virtual bool IsHidden() const; virtual int GetWidth() const; virtual int GetMinWidth() const; virtual bool IsReorderable() const; virtual int GetFlags() const; }; class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase { public: wxDataViewCtrl(); wxDataViewCtrl( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator ); virtual ~wxDataViewCtrl(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator ); virtual bool AssociateModel( wxDataViewModel *model ); virtual bool PrependColumn( wxDataViewColumn *col ); virtual bool AppendColumn( wxDataViewColumn *col ); virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ); virtual unsigned int GetColumnCount() const; virtual wxDataViewColumn* GetColumn( unsigned int pos ) const; virtual bool DeleteColumn( wxDataViewColumn *column ); virtual bool ClearColumns(); virtual int GetColumnPosition( const wxDataViewColumn *column ) const; virtual wxDataViewColumn *GetSortingColumn() const; virtual wxDataViewItem GetSelection() const; virtual int GetSelections( wxDataViewItemArray & sel ) const; virtual void SetSelections( const wxDataViewItemArray & sel ); virtual void Select( const wxDataViewItem & item ); virtual void Unselect( const wxDataViewItem & item ); virtual bool IsSelected( const wxDataViewItem & item ) const; virtual void SelectAll(); virtual void UnselectAll(); virtual void EnsureVisible( const wxDataViewItem& item, const wxDataViewColumn *column = NULL ); virtual void HitTest( const wxPoint &point, wxDataViewItem &item, wxDataViewColumn *&column ) const; virtual wxRect GetItemRect( const wxDataViewItem &item, const wxDataViewColumn *column = NULL ) const; virtual void Expand( const wxDataViewItem & item ); virtual void Collapse( const wxDataViewItem & item ); virtual bool IsExpanded( const wxDataViewItem & item ) const; virtual bool EnableDragSource( const wxDataFormat &format ); virtual bool EnableDropTarget( const wxDataFormat &format ); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); wxWindow *GetMainWindow() { return (wxWindow*) this; } virtual void OnInternalIdle(); protected: virtual void DoSetExpanderColumn(); virtual void DoSetIndent(); private: virtual wxDataViewItem DoGetCurrentItem() const; virtual void DoSetCurrentItem(const wxDataViewItem& item); }; #endif // _WX_QT_DATAVIEW_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/accel.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/accel.h // Purpose: wxAcceleratorTable class // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2009 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_ACCEL_H_ #define _WX_QT_ACCEL_H_ /* wxQt accelerators implementation: * * Storing: * QShortcuts are stored in wxWindow (m_qtShortcuts) to allow to delete them * when the accelerator table is changed, and also because we need to specify * a not-null parent from them, which is unknown at the moment of creating the * accelerator table. So, the accelerator table only contains a list of * wxAcceleratorEntries, which are converted to a list of QShortcuts when * the table is fixed to a wxWindow. * * Passing keypresses to accelerators: * The accelerators are implemented using QShortcut's. As there is no easy way * to call them, we must pass all keypress events through the QApplication * notify() function (which is the one that checks if the keypress match any * shortcut. * * Executing commands when a QShortcut is triggered: * Each QShortcut has a property ("wxQt_Command") set with the number of the * wx command it is associated to. Then, its activated() signal is connected to * a small handler (wxQtShortcutHandler in window_qt.h) which calls the main * handler (wxWindow::QtHandleShortcut) passing the command extracted from the * QShortcut. This handler will finally create and send the appropriate wx * event to the window. */ class QShortcut; template < class T > class QList; class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject { public: wxAcceleratorTable(); wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Implementation QList < QShortcut* > *ConvertShortcutTable( QWidget *parent ) const; bool Ok() const { return IsOk(); } bool IsOk() const; protected: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; private: wxDECLARE_DYNAMIC_CLASS(wxAcceleratorTable); }; #endif // _WX_QT_ACCEL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dvrenderer.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dvrenderer.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DVRENDERER_H_ #define _WX_QT_DVRENDERER_H_ // ---------------------------------------------------------------------------- // wxDataViewRenderer // ---------------------------------------------------------------------------- class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewRendererBase { public: wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align = wxDVR_DEFAULT_ALIGNMENT ); virtual void SetMode( wxDataViewCellMode mode ); virtual wxDataViewCellMode GetMode() const; virtual void SetAlignment( int align ); virtual int GetAlignment() const; virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE); virtual wxEllipsizeMode GetEllipsizeMode() const; }; #endif // _WX_QT_DVRENDERER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/scrolbar.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/scrolbar.h // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_SCROLBAR_H_ #define _WX_QT_SCROLBAR_H_ #include "wx/scrolbar.h" class QScrollBar; class WXDLLIMPEXP_FWD_CORE wxQtScrollBar; class WXDLLIMPEXP_CORE wxScrollBar : public wxScrollBarBase { public: wxScrollBar(); wxScrollBar( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr ); bool Create( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr ); virtual int GetThumbPosition() const; virtual int GetThumbSize() const; virtual int GetPageSize() const; virtual int GetRange() const; virtual void SetThumbPosition(int viewStart); virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, bool refresh = true); QScrollBar *GetQScrollBar() const { return m_qtScrollBar; } QWidget *GetHandle() const; private: QScrollBar *m_qtScrollBar; wxDECLARE_DYNAMIC_CLASS(wxScrollBar); }; #endif // _WX_QT_SCROLBAR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dirdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dirdlg.h // Author: Sean D'Epagnier // Copyright: (c) 2014 Sean D'Epagnier // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DIRDLG_H_ #define _WX_QT_DIRDLG_H_ class QFileDialog; class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase { public: wxDirDialog() { } wxDirDialog(wxWindow *parent, const wxString& message = wxDirSelectorPromptStr, const wxString& defaultPath = wxEmptyString, long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& name = wxDirDialogNameStr); bool Create(wxWindow *parent, const wxString& message = wxDirSelectorPromptStr, const wxString& defaultPath = wxEmptyString, long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& name = wxDirDialogNameStr); public: // overrides from wxGenericDirDialog wxString GetPath() const wxOVERRIDE; void SetPath(const wxString& path) wxOVERRIDE; private: virtual QFileDialog *GetQFileDialog() const; wxDECLARE_DYNAMIC_CLASS(wxDirDialog); }; #endif // _WX_QT_DIRDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/choice.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/choice.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CHOICE_H_ #define _WX_QT_CHOICE_H_ class QComboBox; class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase { public: wxChoice(); wxChoice( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr ); wxChoice( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr ); bool Create( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr ); bool Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr ); virtual wxSize DoGetBestSize() const; virtual unsigned int GetCount() const; virtual wxString GetString(unsigned int n) const; virtual void SetString(unsigned int n, const wxString& s); virtual void SetSelection(int n); virtual int GetSelection() const; virtual QWidget *GetHandle() const; protected: virtual int DoInsertItems(const wxArrayStringsAdapter & items, unsigned int pos, void **clientData, wxClientDataType type); virtual int DoInsertOneItem(const wxString& item, unsigned int pos); virtual void DoSetItemClientData(unsigned int n, void *clientData); virtual void *DoGetItemClientData(unsigned int n) const; virtual void DoClear(); virtual void DoDeleteOneItem(unsigned int pos); QComboBox *m_qtComboBox; private: wxDECLARE_DYNAMIC_CLASS(wxChoice); }; #endif // _WX_QT_CHOICE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/bitmap.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/bitmap.h // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_BITMAP_H_ #define _WX_QT_BITMAP_H_ class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; class WXDLLIMPEXP_FWD_CORE wxImage; class WXDLLIMPEXP_FWD_CORE wxCursor; class QImage; class QPixmap; class QBitmap; class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase { public: wxBitmap(); wxBitmap(QPixmap pix); wxBitmap(const wxBitmap& bmp); wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); wxBitmap(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH); wxBitmap(const char* const* bits); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM); wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0); // Convert from wxIcon / wxCursor wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } explicit wxBitmap(const wxCursor& cursor); static void InitStandardHandlers(); virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH); virtual bool Create(int width, int height, const wxDC& WXUNUSED(dc)); virtual int GetHeight() const; virtual int GetWidth() const; virtual int GetDepth() const; #if wxUSE_IMAGE virtual wxImage ConvertToImage() const; #endif // wxUSE_IMAGE virtual wxMask *GetMask() const; virtual void SetMask(wxMask *mask); virtual wxBitmap GetSubBitmap(const wxRect& rect) const; virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = NULL) const; virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); #if wxUSE_PALETTE virtual wxPalette *GetPalette() const; virtual void SetPalette(const wxPalette& palette); #endif // wxUSE_PALETTE // copies the contents and mask of the given (colour) icon to the bitmap virtual bool CopyFromIcon(const wxIcon& icon); // implementation: #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED(virtual void SetHeight(int height)); wxDEPRECATED(virtual void SetWidth(int width)); wxDEPRECATED(virtual void SetDepth(int depth)); #endif void *GetRawData(wxPixelDataBase& data, int bpp); void UngetRawData(wxPixelDataBase& data); // these functions are internal and shouldn't be used, they risk to // disappear in the future bool HasAlpha() const; QPixmap *GetHandle() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxBitmap); }; class WXDLLIMPEXP_CORE wxMask : public wxMaskBase { public: wxMask(); // Copy constructor wxMask(const wxMask &mask); wxMask& operator=(const wxMask &mask); // Construct a mask from a bitmap and a colour indicating the transparent // area wxMask(const wxBitmap& bitmap, const wxColour& colour); // Construct a mask from a bitmap and a palette index indicating the // transparent area wxMask(const wxBitmap& bitmap, int paletteIndex); // Construct a mask from a mono bitmap (copies the bitmap). wxMask(const wxBitmap& bitmap); virtual ~wxMask(); // Implementation QBitmap *GetHandle() const; protected: // this function is called from Create() to free the existing mask data void FreeData(); // by the public wrappers bool InitFromColour(const wxBitmap& bitmap, const wxColour& colour); bool InitFromMonoBitmap(const wxBitmap& bitmap); wxBitmap GetBitmap() const; protected: wxDECLARE_DYNAMIC_CLASS(wxMask); private: QBitmap *m_qtBitmap; }; #endif // _WX_QT_BITMAP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/printqt.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/printqt.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_PRINTQT_H_ #define _WX_QT_PRINTQT_H_ #include "wx/prntbase.h" class WXDLLIMPEXP_CORE wxQtPrinter : public wxPrinterBase { public: wxQtPrinter( wxPrintDialogData *data = NULL ); virtual bool Setup(wxWindow *parent); virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true); virtual wxDC* PrintDialog(wxWindow *parent); private: }; class WXDLLIMPEXP_CORE wxQtPrintPreview : public wxPrintPreviewBase { public: wxQtPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintDialogData *data = NULL); wxQtPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data); virtual bool Print(bool interactive); virtual void DetermineScaling(); protected: }; #endif // _WX_QT_PRINTQT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/ctrlsub.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/ctrlsub.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CTRLSUB_H_ #define _WX_QT_CTRLSUB_H_ class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsBase { public: wxControlWithItems(); protected: private: wxDECLARE_ABSTRACT_CLASS(wxControlWithItems); }; #endif // _WX_QT_CTRLSUB_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/taskbar.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/taskbar.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_TASKBAR_H_ #define _WX_QT_TASKBAR_H_ class QSystemTrayIcon; class WXDLLIMPEXP_ADV wxTaskBarIcon : public wxTaskBarIconBase { public: wxTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE); virtual ~wxTaskBarIcon(); // Accessors bool IsOk() const { return false; } bool IsIconInstalled() const { return false; } // Operations virtual bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); virtual bool RemoveIcon(); virtual bool PopupMenu(wxMenu *menu); private: QSystemTrayIcon *m_qtSystemTrayIcon; wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon); }; #endif // _WX_QT_TASKBAR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/minifram.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/minifram.h // Purpose: wxMiniFrame class // Author: Mariano Reingart // Copyright: (c) 2014 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MINIFRAM_H_ #define _WX_MINIFRAM_H_ #include "wx/frame.h" class WXDLLIMPEXP_CORE wxMiniFrame : public wxFrame { public: wxMiniFrame() { } bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER, const wxString& name = wxFrameNameStr) { return wxFrame::Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR, name); } wxMiniFrame(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER, const wxString& name = wxFrameNameStr) { Create(parent, id, title, pos, size, style, name); } protected: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMiniFrame); }; #endif // _WX_MINIFRAM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/pen.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/pen.h // Author: Peter Most, Javier Torres // Copyright: (c) Peter Most, Javier Torres // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_PEN_H_ #define _WX_QT_PEN_H_ class QPen; class WXDLLIMPEXP_CORE wxPen : public wxPenBase { public: wxPen(); wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") wxPen(const wxColour& col, int width, int style); bool operator==(const wxPen& pen) const; bool operator!=(const wxPen& pen) const; virtual void SetColour(const wxColour& col); virtual void SetColour(unsigned char r, unsigned char g, unsigned char b); virtual void SetWidth(int width); virtual void SetStyle(wxPenStyle style); virtual void SetStipple(const wxBitmap& stipple); virtual void SetDashes(int nb_dashes, const wxDash *dash); virtual void SetJoin(wxPenJoin join); virtual void SetCap(wxPenCap cap); virtual wxColour GetColour() const; virtual wxBitmap *GetStipple() const; virtual wxPenStyle GetStyle() const; virtual wxPenJoin GetJoin() const; virtual wxPenCap GetCap() const; virtual int GetWidth() const; virtual int GetDashes(wxDash **ptr) const; wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxPenStyle)style); } QPen GetHandle() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; }; #endif // _WX_QT_PEN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dialog.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dialog.h // Author: Peter Most, Javier Torres, Mariano Reingart, Sean D'Epagnier // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DIALOG_H_ #define _WX_QT_DIALOG_H_ #include "wx/dialog.h" class QDialog; class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase { public: wxDialog(); wxDialog( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr ); virtual ~wxDialog(); bool Create( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr ); virtual int ShowModal(); virtual void EndModal(int retCode); virtual bool IsModal() const; QDialog *GetDialogHandle() const; private: wxDECLARE_DYNAMIC_CLASS( wxDialog ); }; #endif // _WX_QT_DIALOG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dataobj2.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dataobj2.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DATAOBJ2_H_ #define _WX_QT_DATAOBJ2_H_ class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase { public: wxBitmapDataObject(); wxBitmapDataObject(const wxBitmap& bitmap); protected: private: }; class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase { public: wxFileDataObject(); void AddFile( const wxString &filename ); }; #endif // _WX_QT_DATAOBJ2_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/cursor.h
///////////////////////////////////////////////////////////////////////////// // Name: cursor.h // Author: Sean D'Epagnier // Copyright: (c) Sean D'Epagnier 2014 // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CURSOR_H_ #define _WX_QT_CURSOR_H_ #include "wx/image.h" class QCursor; class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor() { } wxCursor(wxStockCursor id) { InitFromStock(id); } #if WXWIN_COMPATIBILITY_2_8 wxCursor(int id) { InitFromStock((wxStockCursor)id); } #endif #if wxUSE_IMAGE wxCursor( const wxImage & image ); wxCursor(const wxString& name, wxBitmapType type = wxCURSOR_DEFAULT_TYPE, int hotSpotX = 0, int hotSpotY = 0); #endif virtual wxPoint GetHotSpot() const; QCursor &GetHandle() const; protected: void InitFromStock( wxStockCursor cursorId ); #if wxUSE_IMAGE void InitFromImage( const wxImage & image ); #endif private: void Init(); virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxCursor); }; #endif // _WX_QT_CURSOR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dnd.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dnd.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DND_H_ #define _WX_QT_DND_H_ #define wxDROP_ICON(name) wxICON(name) class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase { public: wxDropTarget(wxDataObject *dataObject = NULL ); virtual bool OnDrop(wxCoord x, wxCoord y); virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); virtual bool GetData(); wxDataFormat GetMatchingPair(); protected: private: }; class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase { public: wxDropSource( wxWindow *win = NULL, const wxIcon &copy = wxNullIcon, const wxIcon &move = wxNullIcon, const wxIcon &none = wxNullIcon); wxDropSource( wxDataObject& data, wxWindow *win, const wxIcon &copy = wxNullIcon, const wxIcon &move = wxNullIcon, const wxIcon &none = wxNullIcon); virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); }; #endif // _WX_QT_DND_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/popupwin.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/popupwin.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_POPUPWIN_H_ #define _WX_QT_POPUPWIN_H_ class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase { public: wxPopupWindow(); wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE); protected: private: wxDECLARE_DYNAMIC_CLASS(wxPopupWindow); }; #endif // _WX_QT_POPUPWIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/dataform.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/toolbar.h // Author: Sean D'Epagnier // Copyright: (c) Sean D'Epagnier 2014 // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_DATAFORM_H_ #define _WX_QT_DATAFORM_H_ class QString; class WXDLLIMPEXP_CORE wxDataFormat { public: wxDataFormat(); wxDataFormat( wxDataFormatId formatId ); wxDataFormat(const wxString &id); wxDataFormat(const QString &id); wxDataFormat(const wxChar *id); void SetId( const wxChar *id ); bool operator==(wxDataFormatId format) const; bool operator!=(wxDataFormatId format) const; bool operator==(const wxDataFormat& format) const; bool operator!=(const wxDataFormat& format) const; // string ids are used for custom types - this SetId() must be used for // application-specific formats wxString GetId() const; void SetId( const wxString& id ); // implementation wxDataFormatId GetType() const; void SetType( wxDataFormatId type ); wxString m_MimeType; }; #endif // _WX_QT_DATAFORM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/brush.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/brush.h // Author: Peter Most, Javier Torres, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_BRUSH_H_ #define _WX_QT_BRUSH_H_ class QBrush; class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase { public: wxBrush(); wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID); wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") wxBrush(const wxColour& col, int style); wxBrush(const wxBitmap& stipple); virtual void SetColour(const wxColour& col); virtual void SetColour(unsigned char r, unsigned char g, unsigned char b); virtual void SetStyle(wxBrushStyle style); virtual void SetStipple(const wxBitmap& stipple); bool operator==(const wxBrush& brush) const; bool operator!=(const wxBrush& brush) const { return !(*this == brush); } virtual wxColour GetColour() const; virtual wxBrushStyle GetStyle() const; virtual wxBitmap *GetStipple() const; wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxBrushStyle)style); } QBrush GetHandle() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; }; #endif // _WX_QT_BRUSH_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/clipbrd.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/toolbar.h // Author: Sean D'Epagnier // Copyright: (c) Sean D'Epagnier 2014 // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_CLIPBRD_H_ #define _WX_QT_CLIPBRD_H_ #include "wx/weakref.h" class QtClipBoardSignalHandler; class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase { public: wxClipboard(); ~wxClipboard(); virtual bool Open(); virtual void Close(); virtual bool IsOpened() const; virtual bool AddData( wxDataObject *data ); virtual bool SetData( wxDataObject *data ); virtual bool GetData( wxDataObject& data ); virtual void Clear(); virtual bool IsSupported( const wxDataFormat& format ); virtual bool IsSupportedAsync(wxEvtHandler *sink); private: friend class QtClipBoardSignalHandler; int Mode(); QtClipBoardSignalHandler *m_SignalHandler; wxEvtHandlerRef m_sink; bool m_open; wxDECLARE_DYNAMIC_CLASS(wxClipboard); }; #endif // _WX_QT_CLIPBRD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/qt/tglbtn.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/tglbtn.h // Author: Peter Most, Mariano Reingart // Copyright: (c) 2010 wxWidgets dev team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_TGLBTN_H_ #define _WX_QT_TGLBTN_H_ #include "wx/tglbtn.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[]; class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButtonBase { public: wxBitmapToggleButton(); wxBitmapToggleButton(wxWindow *parent, wxWindowID id, const wxBitmap& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr); virtual void SetValue(bool state); virtual bool GetValue() const; virtual QWidget *GetHandle() const; private: wxDECLARE_DYNAMIC_CLASS(wxBitmapToggleButton); }; class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase { public: wxToggleButton(); wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr); virtual void SetValue(bool state); virtual bool GetValue() const; virtual QWidget *GetHandle() const; private: }; #endif // _WX_QT_TGLBTN_H_
h