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/Win64/include/wx/generic/choicdgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/choicdgg.h
// Purpose: Generic choice dialogs
// Author: Julian Smart
// Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions
// Created: 01/02/97
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_CHOICDGG_H_
#define _WX_GENERIC_CHOICDGG_H_
#include "wx/dynarray.h"
#include "wx/dialog.h"
class WXDLLIMPEXP_FWD_CORE wxListBoxBase;
// ----------------------------------------------------------------------------
// some (ugly...) constants
// ----------------------------------------------------------------------------
#define wxCHOICE_HEIGHT 150
#define wxCHOICE_WIDTH 200
#define wxCHOICEDLG_STYLE \
(wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE)
// ----------------------------------------------------------------------------
// wxAnyChoiceDialog: a base class for dialogs containing a listbox
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyChoiceDialog : public wxDialog
{
public:
wxAnyChoiceDialog() { }
wxAnyChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n, const wxString *choices,
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB)
{
(void)Create(parent, message, caption, n, choices,
styleDlg, pos, styleLbox);
}
wxAnyChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB)
{
(void)Create(parent, message, caption, choices,
styleDlg, pos, styleLbox);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n, const wxString *choices,
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB);
protected:
wxListBoxBase *m_listbox;
virtual wxListBoxBase *CreateList(int n,
const wxString *choices,
long styleLbox);
wxDECLARE_NO_COPY_CLASS(wxAnyChoiceDialog);
};
// ----------------------------------------------------------------------------
// wxSingleChoiceDialog: a dialog with single selection listbox
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSingleChoiceDialog : public wxAnyChoiceDialog
{
public:
wxSingleChoiceDialog()
{
m_selection = -1;
}
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, caption, n, choices, clientData, style, pos);
}
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, caption, choices, clientData, style, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
void SetSelection(int sel);
int GetSelection() const { return m_selection; }
wxString GetStringSelection() const { return m_stringSelection; }
void* GetSelectionData() const { return m_clientData; }
#if WXWIN_COMPATIBILITY_2_8
// Deprecated overloads taking "char**" client data.
wxDEPRECATED_CONSTRUCTOR
(
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
)
{
Create(parent, message, caption, n, choices,
(void**)clientData, style, pos);
}
wxDEPRECATED_CONSTRUCTOR
(
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
)
{
Create(parent, message, caption, choices,
(void**)clientData, style, pos);
}
wxDEPRECATED_INLINE
(
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition),
return Create(parent, message, caption, n, choices,
(void**)clientData, style, pos);
)
wxDEPRECATED_INLINE
(
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition),
return Create(parent, message, caption, choices,
(void**)clientData, style, pos);
)
// NB: no need to make it return wxChar, it's untyped
wxDEPRECATED_ACCESSOR
(
char* GetSelectionClientData() const,
(char*)GetSelectionData()
)
#endif // WXWIN_COMPATIBILITY_2_8
// implementation from now on
void OnOK(wxCommandEvent& event);
void OnListBoxDClick(wxCommandEvent& event);
protected:
int m_selection;
wxString m_stringSelection;
void DoChoice();
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog);
wxDECLARE_EVENT_TABLE();
};
// ----------------------------------------------------------------------------
// wxMultiChoiceDialog: a dialog with multi selection listbox
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMultiChoiceDialog : public wxAnyChoiceDialog
{
public:
wxMultiChoiceDialog() { }
wxMultiChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
{
(void)Create(parent, message, caption, n, choices, style, pos);
}
wxMultiChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
{
(void)Create(parent, message, caption, choices, style, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
void SetSelections(const wxArrayInt& selections);
wxArrayInt GetSelections() const { return m_selections; }
// implementation from now on
virtual bool TransferDataFromWindow() wxOVERRIDE;
protected:
#if wxUSE_CHECKLISTBOX
virtual wxListBoxBase *CreateList(int n,
const wxString *choices,
long styleLbox) wxOVERRIDE;
#endif // wxUSE_CHECKLISTBOX
wxArrayInt m_selections;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMultiChoiceDialog);
};
// ----------------------------------------------------------------------------
// wrapper functions which can be used to get selection(s) from the user
// ----------------------------------------------------------------------------
// get the user selection as a string
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
const wxString& caption,
const wxArrayString& choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT,
int initialSelection = 0);
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
const wxString& caption,
int n, const wxString *choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT,
int initialSelection = 0);
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
const wxString& caption,
const wxArrayString& choices,
int initialSelection,
wxWindow *parent = NULL);
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
const wxString& caption,
int n, const wxString *choices,
int initialSelection,
wxWindow *parent = NULL);
// Same as above but gets position in list of strings, instead of string,
// or -1 if no selection
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
const wxString& caption,
const wxArrayString& choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT,
int initialSelection = 0);
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
const wxString& caption,
int n, const wxString *choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT,
int initialSelection = 0);
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
const wxString& caption,
const wxArrayString& choices,
int initialSelection,
wxWindow *parent = NULL);
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
const wxString& caption,
int n, const wxString *choices,
int initialSelection,
wxWindow *parent = NULL);
// Return client data instead or NULL if canceled
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
const wxString& caption,
const wxArrayString& choices,
void **client_data,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT,
int initialSelection = 0);
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
const wxString& caption,
int n, const wxString *choices,
void **client_data,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT,
int initialSelection = 0);
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
const wxString& caption,
const wxArrayString& choices,
void **client_data,
int initialSelection,
wxWindow *parent = NULL);
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
const wxString& caption,
int n, const wxString *choices,
void **client_data,
int initialSelection,
wxWindow *parent = NULL);
// fill the array with the indices of the chosen items, it will be empty
// if no items were selected or Cancel was pressed - return the number of
// selections or -1 if cancelled
WXDLLIMPEXP_CORE int wxGetSelectedChoices(wxArrayInt& selections,
const wxString& message,
const wxString& caption,
int n, const wxString *choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT);
WXDLLIMPEXP_CORE int wxGetSelectedChoices(wxArrayInt& selections,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT);
#if WXWIN_COMPATIBILITY_2_8
// fill the array with the indices of the chosen items, it will be empty
// if no items were selected or Cancel was pressed - return the number of
// selections
wxDEPRECATED( WXDLLIMPEXP_CORE size_t wxGetMultipleChoices(wxArrayInt& selections,
const wxString& message,
const wxString& caption,
int n, const wxString *choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT) );
wxDEPRECATED( WXDLLIMPEXP_CORE size_t wxGetMultipleChoices(wxArrayInt& selections,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
wxWindow *parent = NULL,
int x = wxDefaultCoord,
int y = wxDefaultCoord,
bool centre = true,
int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT));
#endif // WXWIN_COMPATIBILITY_2_8
#endif // _WX_GENERIC_CHOICDGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/imaglist.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/imaglist.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Copyright: (c) 1998 Robert Roebling and Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGLISTG_H_
#define _WX_IMAGLISTG_H_
#include "wx/bitmap.h"
#include "wx/gdicmn.h"
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxDC;
class WXDLLIMPEXP_FWD_CORE wxIcon;
class WXDLLIMPEXP_FWD_CORE wxColour;
class WXDLLIMPEXP_CORE wxGenericImageList: public wxObject
{
public:
wxGenericImageList() { }
wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 );
virtual ~wxGenericImageList();
bool Create( int width, int height, bool mask = true, int initialCount = 1 );
virtual int GetImageCount() const;
virtual bool GetSize( int index, int &width, int &height ) const;
virtual wxSize GetSize() const { return m_size; }
int Add( const wxBitmap& bitmap );
int Add( const wxBitmap& bitmap, const wxBitmap& mask );
int Add( const wxBitmap& bitmap, const wxColour& maskColour );
wxBitmap GetBitmap(int index) const;
wxIcon GetIcon(int index) const;
bool Replace( int index,
const wxBitmap& bitmap,
const wxBitmap& mask = wxNullBitmap );
bool Remove( int index );
bool RemoveAll();
virtual bool Draw(int index, wxDC& dc, int x, int y,
int flags = wxIMAGELIST_DRAW_NORMAL,
bool solidBackground = false);
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_MSG("Don't use this overload: it's not portable and does nothing")
bool Create() { return true; }
wxDEPRECATED_MSG("Use GetBitmap() instead")
const wxBitmap *GetBitmapPtr(int index) const { return DoGetPtr(index); }
#endif // WXWIN_COMPATIBILITY_3_0
private:
const wxBitmap *DoGetPtr(int index) const;
wxVector<wxBitmap> m_images;
// Size of a single bitmap in the list.
wxSize m_size;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList);
};
#ifndef wxHAS_NATIVE_IMAGELIST
/*
* wxImageList has to be a real class or we have problems with
* the run-time information.
*/
class WXDLLIMPEXP_CORE wxImageList: public wxGenericImageList
{
wxDECLARE_DYNAMIC_CLASS(wxImageList);
public:
wxImageList() {}
wxImageList( int width, int height, bool mask = true, int initialCount = 1 )
: wxGenericImageList(width, height, mask, initialCount)
{
}
};
#endif // !wxHAS_NATIVE_IMAGELIST
#endif // _WX_IMAGLISTG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/aboutdlgg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/aboutdlgg.h
// Purpose: generic wxAboutBox() implementation
// Author: Vadim Zeitlin
// Created: 2006-10-07
// Copyright: (c) 2006 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_ABOUTDLGG_H_
#define _WX_GENERIC_ABOUTDLGG_H_
#include "wx/defs.h"
#if wxUSE_ABOUTDLG
#include "wx/dialog.h"
class WXDLLIMPEXP_FWD_CORE wxAboutDialogInfo;
class WXDLLIMPEXP_FWD_CORE wxSizer;
class WXDLLIMPEXP_FWD_CORE wxSizerFlags;
// Under GTK and OS X "About" dialogs are not supposed to be modal, unlike MSW
// and, presumably, all the other platforms.
#ifndef wxUSE_MODAL_ABOUT_DIALOG
#if defined(__WXGTK__) || defined(__WXMAC__)
#define wxUSE_MODAL_ABOUT_DIALOG 0
#else
#define wxUSE_MODAL_ABOUT_DIALOG 1
#endif
#endif // wxUSE_MODAL_ABOUT_DIALOG not defined
// ----------------------------------------------------------------------------
// wxGenericAboutDialog: generic "About" dialog implementation
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericAboutDialog : public wxDialog
{
public:
// constructors and Create() method
// --------------------------------
// default ctor, you must use Create() to really initialize the dialog
wxGenericAboutDialog() { Init(); }
// ctor which fully initializes the object
wxGenericAboutDialog(const wxAboutDialogInfo& info, wxWindow* parent = NULL)
{
Init();
(void)Create(info, parent);
}
// this method must be called if and only if the default ctor was used
bool Create(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
protected:
// this virtual method may be overridden to add some more controls to the
// dialog
//
// notice that for this to work you must call Create() from the derived
// class ctor and not use the base class ctor directly as otherwise the
// virtual function of the derived class wouldn't be called
virtual void DoAddCustomControls() { }
// add arbitrary control to the text sizer contents with the specified
// flags
void AddControl(wxWindow *win, const wxSizerFlags& flags);
// add arbitrary control to the text sizer contents and center it
void AddControl(wxWindow *win);
// add the text, if it's not empty, to the text sizer contents
void AddText(const wxString& text);
#if wxUSE_COLLPANE
// add a wxCollapsiblePane containing the given text
void AddCollapsiblePane(const wxString& title, const wxString& text);
#endif // wxUSE_COLLPANE
private:
// common part of all ctors
void Init() { m_sizerText = NULL; }
#if !wxUSE_MODAL_ABOUT_DIALOG
// An explicit handler for deleting the dialog when it's closed is needed
// when we show it non-modally.
void OnCloseWindow(wxCloseEvent& event);
void OnOK(wxCommandEvent& event);
#endif // !wxUSE_MODAL_ABOUT_DIALOG
wxSizer *m_sizerText;
};
// unlike wxAboutBox which can show either the native or generic about dialog,
// this function always shows the generic one
WXDLLIMPEXP_CORE void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
#endif // wxUSE_ABOUTDLG
#endif // _WX_GENERIC_ABOUTDLGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/filectrlg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/filectrlg.h
// Purpose: wxGenericFileCtrl Header
// Author: Diaa M. Sami
// Modified by:
// Created: Jul-07-2007
// Copyright: (c) Diaa M. Sami
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_FILECTRL_H_
#define _WX_GENERIC_FILECTRL_H_
#if wxUSE_FILECTRL
#include "wx/containr.h"
#include "wx/listctrl.h"
#include "wx/filectrl.h"
#include "wx/filename.h"
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxChoice;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorDefaultWildcardStr[];
//-----------------------------------------------------------------------------
// wxFileData - a class to hold the file info for the wxFileListCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileData
{
public:
enum fileType
{
is_file = 0x0000,
is_dir = 0x0001,
is_link = 0x0002,
is_exe = 0x0004,
is_drive = 0x0008
};
wxFileData() { Init(); }
// Full copy constructor
wxFileData( const wxFileData& fileData ) { Copy(fileData); }
// Create a filedata from this information
wxFileData( const wxString &filePath, const wxString &fileName,
fileType type, int image_id );
// make a full copy of the other wxFileData
void Copy( const wxFileData &other );
// (re)read the extra data about the file from the system
void ReadData();
// get the name of the file, dir, drive
wxString GetFileName() const { return m_fileName; }
// get the full path + name of the file, dir, path
wxString GetFilePath() const { return m_filePath; }
// Set the path + name and name of the item
void SetNewName( const wxString &filePath, const wxString &fileName );
// Get the size of the file in bytes
wxFileOffset GetSize() const { return m_size; }
// Get the type of file, either file extension or <DIR>, <LINK>, <DRIVE>
wxString GetFileType() const;
// get the last modification time
wxDateTime GetDateTime() const { return m_dateTime; }
// Get the time as a formatted string
wxString GetModificationTime() const;
// in UNIX get rwx for file, in MSW get attributes ARHS
wxString GetPermissions() const { return m_permissions; }
// Get the id of the image used in a wxImageList
int GetImageId() const { return m_image; }
bool IsFile() const { return !IsDir() && !IsLink() && !IsDrive(); }
bool IsDir() const { return (m_type & is_dir ) != 0; }
bool IsLink() const { return (m_type & is_link ) != 0; }
bool IsExe() const { return (m_type & is_exe ) != 0; }
bool IsDrive() const { return (m_type & is_drive) != 0; }
// Get/Set the type of file, file/dir/drive/link
int GetType() const { return m_type; }
// the wxFileListCtrl fields in report view
enum fileListFieldType
{
FileList_Name,
FileList_Size,
FileList_Type,
FileList_Time,
#if defined(__UNIX__) || defined(__WIN32__)
FileList_Perm,
#endif // defined(__UNIX__) || defined(__WIN32__)
FileList_Max
};
// Get the entry for report view of wxFileListCtrl
wxString GetEntry( fileListFieldType num ) const;
// Get a string representation of the file info
wxString GetHint() const;
// initialize a wxListItem attributes
void MakeItem( wxListItem &item );
// operators
wxFileData& operator = (const wxFileData& fd) { Copy(fd); return *this; }
protected:
wxString m_fileName;
wxString m_filePath;
wxFileOffset m_size;
wxDateTime m_dateTime;
wxString m_permissions;
int m_type;
int m_image;
private:
void Init();
};
//-----------------------------------------------------------------------------
// wxFileListCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileListCtrl : public wxListCtrl
{
public:
wxFileListCtrl();
wxFileListCtrl( wxWindow *win,
wxWindowID id,
const wxString &wild,
bool showHidden,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLC_LIST,
const wxValidator &validator = wxDefaultValidator,
const wxString &name = wxT("filelist") );
virtual ~wxFileListCtrl();
virtual void ChangeToListMode();
virtual void ChangeToReportMode();
virtual void ChangeToSmallIconMode();
virtual void ShowHidden( bool show = true );
bool GetShowHidden() const { return m_showHidden; }
virtual long Add( wxFileData *fd, wxListItem &item );
virtual void UpdateItem(const wxListItem &item);
virtual void UpdateFiles();
virtual void MakeDir();
virtual void GoToParentDir();
virtual void GoToHomeDir();
virtual void GoToDir( const wxString &dir );
virtual void SetWild( const wxString &wild );
wxString GetWild() const { return m_wild; }
wxString GetDir() const { return m_dirName; }
void OnListDeleteItem( wxListEvent &event );
void OnListDeleteAllItems( wxListEvent &event );
void OnListEndLabelEdit( wxListEvent &event );
void OnListColClick( wxListEvent &event );
void OnSize( wxSizeEvent &event );
virtual void SortItems(wxFileData::fileListFieldType field, bool forward);
bool GetSortDirection() const { return m_sort_forward; }
wxFileData::fileListFieldType GetSortField() const { return m_sort_field; }
protected:
void FreeItemData(wxListItem& item);
void FreeAllItemsData();
wxString m_dirName;
bool m_showHidden;
wxString m_wild;
bool m_sort_forward;
wxFileData::fileListFieldType m_sort_field;
private:
wxDECLARE_DYNAMIC_CLASS(wxFileListCtrl);
wxDECLARE_EVENT_TABLE();
};
class WXDLLIMPEXP_CORE wxGenericFileCtrl : public wxNavigationEnabled<wxControl>,
public wxFileCtrlBase
{
public:
wxGenericFileCtrl()
{
m_ignoreChanges = false;
}
wxGenericFileCtrl ( wxWindow *parent,
wxWindowID id,
const wxString& defaultDirectory = wxEmptyString,
const wxString& defaultFilename = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFC_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxFileCtrlNameStr )
{
m_ignoreChanges = false;
Create(parent, id, defaultDirectory, defaultFilename, wildCard,
style, pos, size, name );
}
virtual ~wxGenericFileCtrl() {}
bool Create( wxWindow *parent,
wxWindowID id,
const wxString& defaultDirectory = wxEmptyString,
const wxString& defaultFileName = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFC_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxFileCtrlNameStr );
virtual void SetWildcard( const wxString& wildCard ) wxOVERRIDE;
virtual void SetFilterIndex( int filterindex ) wxOVERRIDE;
virtual bool SetDirectory( const wxString& dir ) wxOVERRIDE;
// Selects a certain file.
// In case the filename specified isn't found/couldn't be shown with
// currently selected filter, false is returned and nothing happens
virtual bool SetFilename( const wxString& name ) wxOVERRIDE;
// Changes to a certain directory and selects a certain file.
// In case the filename specified isn't found/couldn't be shown with
// currently selected filter, false is returned and if directory exists
// it's chdir'ed to
virtual bool SetPath( const wxString& path ) wxOVERRIDE;
virtual wxString GetFilename() const wxOVERRIDE;
virtual wxString GetDirectory() const wxOVERRIDE;
virtual wxString GetWildcard() const wxOVERRIDE { return this->m_wildCard; }
virtual wxString GetPath() const wxOVERRIDE;
virtual void GetPaths( wxArrayString& paths ) const wxOVERRIDE;
virtual void GetFilenames( wxArrayString& files ) const wxOVERRIDE;
virtual int GetFilterIndex() const wxOVERRIDE { return m_filterIndex; }
virtual bool HasMultipleFileSelection() const wxOVERRIDE
{ return HasFlag(wxFC_MULTIPLE); }
virtual void ShowHidden(bool show) wxOVERRIDE { m_list->ShowHidden( show ); }
void GoToParentDir();
void GoToHomeDir();
// get the directory currently shown in the control: this can be different
// from GetDirectory() if the user entered a full path (with a path other
// than the one currently shown in the control) in the text control
// manually
wxString GetShownDirectory() const { return m_list->GetDir(); }
wxFileListCtrl *GetFileList() { return m_list; }
void ChangeToReportMode() { m_list->ChangeToReportMode(); }
void ChangeToListMode() { m_list->ChangeToListMode(); }
private:
void OnChoiceFilter( wxCommandEvent &event );
void OnCheck( wxCommandEvent &event );
void OnActivated( wxListEvent &event );
void OnTextEnter( wxCommandEvent &WXUNUSED( event ) );
void OnTextChange( wxCommandEvent &WXUNUSED( event ) );
void OnSelected( wxListEvent &event );
void HandleAction( const wxString &fn );
void DoSetFilterIndex( int filterindex );
void UpdateControls();
// the first of these methods can only be used for the controls with single
// selection (i.e. without wxFC_MULTIPLE style), the second one in any case
wxFileName DoGetFileName() const;
void DoGetFilenames( wxArrayString& filenames, bool fullPath ) const;
int m_style;
wxString m_filterExtension;
wxChoice *m_choice;
wxTextCtrl *m_text;
wxFileListCtrl *m_list;
wxCheckBox *m_check;
wxStaticText *m_static;
wxString m_dir;
wxString m_fileName;
wxString m_wildCard; // wild card in one string as we got it
int m_filterIndex;
bool m_inSelected;
bool m_ignoreChanges;
bool m_noSelChgEvent; // suppress selection changed events.
wxDECLARE_DYNAMIC_CLASS(wxGenericFileCtrl);
wxDECLARE_EVENT_TABLE();
};
#endif // wxUSE_FILECTRL
#endif // _WX_GENERIC_FILECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/textdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/textdlgg.h
// Purpose: wxTextEntryDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TEXTDLGG_H_
#define _WX_TEXTDLGG_H_
#include "wx/defs.h"
#if wxUSE_TEXTDLG
#include "wx/dialog.h"
#if wxUSE_VALIDATORS
#include "wx/valtext.h"
#include "wx/textctrl.h"
#endif
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
extern WXDLLIMPEXP_DATA_CORE(const char) wxGetTextFromUserPromptStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxGetPasswordFromUserPromptStr[];
#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE)
// ----------------------------------------------------------------------------
// wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTextEntryDialog : public wxDialog
{
public:
wxTextEntryDialog()
{
m_textctrl = NULL;
}
wxTextEntryDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString,
long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, caption, value, style, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString,
long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition);
void SetValue(const wxString& val);
wxString GetValue() const { return m_value; }
void SetMaxLength(unsigned long len);
void ForceUpper();
#if wxUSE_VALIDATORS
void SetTextValidator( const wxTextValidator& validator );
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( void SetTextValidator( long style ) );
#endif
void SetTextValidator( wxTextValidatorStyle style = wxFILTER_NONE );
wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); }
#endif // wxUSE_VALIDATORS
virtual bool TransferDataToWindow() wxOVERRIDE;
virtual bool TransferDataFromWindow() wxOVERRIDE;
// implementation only
void OnOK(wxCommandEvent& event);
protected:
wxTextCtrl *m_textctrl;
wxString m_value;
long m_dialogStyle;
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxTextEntryDialog);
wxDECLARE_NO_COPY_CLASS(wxTextEntryDialog);
};
// ----------------------------------------------------------------------------
// wxPasswordEntryDialog: dialog with password control, [ok] and [cancel]
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPasswordEntryDialog : public wxTextEntryDialog
{
public:
wxPasswordEntryDialog() { }
wxPasswordEntryDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxGetPasswordFromUserPromptStr,
const wxString& value = wxEmptyString,
long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, caption, value, style, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption = wxGetPasswordFromUserPromptStr,
const wxString& value = wxEmptyString,
long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition);
private:
wxDECLARE_DYNAMIC_CLASS(wxPasswordEntryDialog);
wxDECLARE_NO_COPY_CLASS(wxPasswordEntryDialog);
};
// ----------------------------------------------------------------------------
// function to get a string from user
// ----------------------------------------------------------------------------
WXDLLIMPEXP_CORE wxString
wxGetTextFromUser(const wxString& message,
const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& default_value = wxEmptyString,
wxWindow *parent = NULL,
wxCoord x = wxDefaultCoord,
wxCoord y = wxDefaultCoord,
bool centre = true);
WXDLLIMPEXP_CORE wxString
wxGetPasswordFromUser(const wxString& message,
const wxString& caption = wxGetPasswordFromUserPromptStr,
const wxString& default_value = wxEmptyString,
wxWindow *parent = NULL,
wxCoord x = wxDefaultCoord,
wxCoord y = wxDefaultCoord,
bool centre = true);
#endif
// wxUSE_TEXTDLG
#endif // _WX_TEXTDLGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/hyperlink.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/hyperlink.h
// Purpose: Hyperlink control
// Author: David Norris <[email protected]>, Otto Wyss
// Modified by: Ryan Norton, Francesco Montorsi
// Created: 04/02/2005
// Copyright: (c) 2005 David Norris
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERICHYPERLINKCTRL_H_
#define _WX_GENERICHYPERLINKCTRL_H_
// ----------------------------------------------------------------------------
// wxGenericHyperlinkCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxGenericHyperlinkCtrl : public wxHyperlinkCtrlBase
{
public:
// Default constructor (for two-step construction).
wxGenericHyperlinkCtrl() { Init(); }
// Constructor.
wxGenericHyperlinkCtrl(wxWindow *parent,
wxWindowID id,
const wxString& label, const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxHyperlinkCtrlNameStr)
{
Init();
(void) Create(parent, id, label, url, pos, size, style, name);
}
// Creation function (for two-step construction).
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label, const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxHyperlinkCtrlNameStr);
// get/set
wxColour GetHoverColour() const wxOVERRIDE { return m_hoverColour; }
void SetHoverColour(const wxColour &colour) wxOVERRIDE { m_hoverColour = colour; }
wxColour GetNormalColour() const wxOVERRIDE { return m_normalColour; }
void SetNormalColour(const wxColour &colour) wxOVERRIDE;
wxColour GetVisitedColour() const wxOVERRIDE { return m_visitedColour; }
void SetVisitedColour(const wxColour &colour) wxOVERRIDE;
wxString GetURL() const wxOVERRIDE { return m_url; }
void SetURL (const wxString &url) wxOVERRIDE { m_url=url; }
void SetVisited(bool visited = true) wxOVERRIDE { m_visited=visited; }
bool GetVisited() const wxOVERRIDE { return m_visited; }
// NOTE: also wxWindow::Set/GetLabel, wxWindow::Set/GetBackgroundColour,
// wxWindow::Get/SetFont, wxWindow::Get/SetCursor are important !
protected:
// Helper used by this class itself and native MSW implementation that
// connects OnRightUp() and OnPopUpCopy() handlers.
void ConnectMenuHandlers();
// event handlers
// Renders the hyperlink.
void OnPaint(wxPaintEvent& event);
// Handle set/kill focus events (invalidate for painting focus rect)
void OnFocus(wxFocusEvent& event);
// Fire a HyperlinkEvent on space
void OnChar(wxKeyEvent& event);
// Returns the wxRect of the label of this hyperlink.
// This is different from the clientsize's rectangle when
// clientsize != bestsize and this rectangle is influenced
// by the alignment of the label (wxHL_ALIGN_*).
wxRect GetLabelRect() const;
// If the click originates inside the bounding box of the label,
// a flag is set so that an event will be fired when the left
// button is released.
void OnLeftDown(wxMouseEvent& event);
// If the click both originated and finished inside the bounding box
// of the label, a HyperlinkEvent is fired.
void OnLeftUp(wxMouseEvent& event);
void OnRightUp(wxMouseEvent& event);
// Changes the cursor to a hand, if the mouse is inside the label's
// bounding box.
void OnMotion(wxMouseEvent& event);
// Changes the cursor back to the default, if necessary.
void OnLeaveWindow(wxMouseEvent& event);
// handles "Copy URL" menuitem
void OnPopUpCopy(wxCommandEvent& event);
// overridden base class virtuals
// Returns the best size for the window, which is the size needed
// to display the text label.
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
// creates a context menu with "Copy URL" menuitem
virtual void DoContextMenu(const wxPoint &);
private:
// Common part of all ctors.
void Init();
// URL associated with the link. This is transmitted inside
// the HyperlinkEvent fired when the user clicks on the label.
wxString m_url;
// Foreground colours for various link types.
// NOTE: wxWindow::m_backgroundColour is used for background,
// wxWindow::m_foregroundColour is used to render non-visited links
wxColour m_hoverColour;
wxColour m_normalColour;
wxColour m_visitedColour;
// True if the mouse cursor is inside the label's bounding box.
bool m_rollover;
// True if the link has been clicked before.
bool m_visited;
// True if a click is in progress (left button down) and the click
// originated inside the label's bounding box.
bool m_clicking;
};
#endif // _WX_GENERICHYPERLINKCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/propdlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/propdlg.h
// Purpose: wxPropertySheetDialog
// Author: Julian Smart
// Modified by:
// Created: 2005-03-12
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PROPDLG_H_
#define _WX_PROPDLG_H_
#include "wx/defs.h"
#if wxUSE_BOOKCTRL
#include "wx/dialog.h"
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
//-----------------------------------------------------------------------------
// wxPropertySheetDialog
// A platform-independent properties dialog with a notebook and standard
// buttons.
//
// To use this class, call Create from your derived class.
// Then create pages and add to the book control. Finally call CreateButtons and
// LayoutDialog.
//
// For example:
//
// MyPropertySheetDialog::Create(...)
// {
// wxPropertySheetDialog::Create(...);
//
// // Add page
// wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
// GetBookCtrl()->AddPage(panel, wxT("General"));
//
// CreateButtons();
// LayoutDialog();
// }
//
// Override CreateBookCtrl and AddBookCtrl to create and add a different
// kind of book control.
//-----------------------------------------------------------------------------
enum wxPropertySheetDialogFlags
{
// Use the platform default
wxPROPSHEET_DEFAULT = 0x0001,
// Use a notebook
wxPROPSHEET_NOTEBOOK = 0x0002,
// Use a toolbook
wxPROPSHEET_TOOLBOOK = 0x0004,
// Use a choicebook
wxPROPSHEET_CHOICEBOOK = 0x0008,
// Use a listbook
wxPROPSHEET_LISTBOOK = 0x0010,
// Use a wxButtonToolBar toolbook
wxPROPSHEET_BUTTONTOOLBOOK = 0x0020,
// Use a treebook
wxPROPSHEET_TREEBOOK = 0x0040,
// Shrink dialog to fit current page
wxPROPSHEET_SHRINKTOFIT = 0x0100
};
class WXDLLIMPEXP_ADV wxPropertySheetDialog : public wxDialog
{
public:
wxPropertySheetDialog() : wxDialog() { Init(); }
wxPropertySheetDialog(wxWindow* parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
Init();
Create(parent, id, title, pos, sz, style, name);
}
bool Create(wxWindow* parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr);
//// Accessors
// Set and get the notebook
void SetBookCtrl(wxBookCtrlBase* book) { m_bookCtrl = book; }
wxBookCtrlBase* GetBookCtrl() const { return m_bookCtrl; }
// Override function in base
virtual wxWindow* GetContentWindow() const wxOVERRIDE;
// Set and get the inner sizer
void SetInnerSizer(wxSizer* sizer) { m_innerSizer = sizer; }
wxSizer* GetInnerSizer() const { return m_innerSizer ; }
// Set and get the book style
void SetSheetStyle(long sheetStyle) { m_sheetStyle = sheetStyle; }
long GetSheetStyle() const { return m_sheetStyle ; }
// Set and get the border around the whole dialog
void SetSheetOuterBorder(int border) { m_sheetOuterBorder = border; }
int GetSheetOuterBorder() const { return m_sheetOuterBorder ; }
// Set and get the border around the book control only
void SetSheetInnerBorder(int border) { m_sheetInnerBorder = border; }
int GetSheetInnerBorder() const { return m_sheetInnerBorder ; }
/// Operations
// Creates the buttons
virtual void CreateButtons(int flags = wxOK|wxCANCEL);
// Lay out the dialog, to be called after pages have been created
virtual void LayoutDialog(int centreFlags = wxBOTH);
/// Implementation
// Creates the book control. If you want to use a different kind of
// control, override.
virtual wxBookCtrlBase* CreateBookCtrl();
// Adds the book control to the inner sizer.
virtual void AddBookCtrl(wxSizer* sizer);
// Resize dialog if necessary
void OnIdle(wxIdleEvent& event);
private:
void Init();
protected:
wxBookCtrlBase* m_bookCtrl;
wxSizer* m_innerSizer; // sizer for extra space
long m_sheetStyle;
int m_sheetOuterBorder;
int m_sheetInnerBorder;
int m_selectedPage;
wxDECLARE_DYNAMIC_CLASS(wxPropertySheetDialog);
wxDECLARE_EVENT_TABLE();
};
#endif // wxUSE_BOOKCTRL
#endif // _WX_PROPDLG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/notifmsg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/notifmsg.h
// Purpose: generic implementation of wxGenericNotificationMessage
// Author: Vadim Zeitlin
// Created: 2007-11-24
// Copyright: (c) 2007 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_NOTIFMSG_H_
#define _WX_GENERIC_NOTIFMSG_H_
// ----------------------------------------------------------------------------
// wxGenericNotificationMessage
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxGenericNotificationMessage : public wxNotificationMessageBase
{
public:
wxGenericNotificationMessage()
{
Init();
}
wxGenericNotificationMessage(const wxString& title,
const wxString& message = wxString(),
wxWindow *parent = NULL,
int flags = wxICON_INFORMATION)
{
Init();
Create(title, message, parent, flags);
}
// generic implementation-specific methods
// get/set the default timeout (used if Timeout_Auto is specified)
static int GetDefaultTimeout();
static void SetDefaultTimeout(int timeout);
private:
void Init();
wxDECLARE_NO_COPY_CLASS(wxGenericNotificationMessage);
};
#endif // _WX_GENERIC_NOTIFMSG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/calctrlg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/calctrlg.h
// Purpose: generic implementation of date-picker control
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.12.99
// Copyright: (c) 1999 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_CALCTRLG_H
#define _WX_GENERIC_CALCTRLG_H
#include "wx/control.h" // the base class
#include "wx/dcclient.h" // for wxPaintDC
class WXDLLIMPEXP_FWD_CORE wxComboBox;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
// ----------------------------------------------------------------------------
// wxGenericCalendarCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxGenericCalendarCtrl : public wxCalendarCtrlBase
{
public:
// construction
wxGenericCalendarCtrl() { Init(); }
wxGenericCalendarCtrl(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);
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 ~wxGenericCalendarCtrl();
virtual bool Destroy() wxOVERRIDE;
// set/get the current date
// ------------------------
virtual bool SetDate(const wxDateTime& date) wxOVERRIDE;
virtual wxDateTime GetDate() const wxOVERRIDE { return m_date; }
// set/get the range in which selection can occur
// ---------------------------------------------
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime) wxOVERRIDE;
virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const wxOVERRIDE;
// these functions are for generic version only, don't use them but use the
// Set/GetDateRange() above instead
bool SetLowerDateLimit(const wxDateTime& date = wxDefaultDateTime);
const wxDateTime& GetLowerDateLimit() const { return m_lowdate; }
bool SetUpperDateLimit(const wxDateTime& date = wxDefaultDateTime);
const wxDateTime& GetUpperDateLimit() const { return m_highdate; }
// calendar mode
// -------------
// some calendar styles can't be changed after the control creation by
// just using SetWindowStyle() and Refresh() and the functions below
// should be used instead for them
// corresponds to wxCAL_NO_MONTH_CHANGE bit
virtual bool EnableMonthChange(bool enable = true) wxOVERRIDE;
// corresponds to wxCAL_NO_YEAR_CHANGE bit, deprecated, generic only
void EnableYearChange(bool enable = true);
// customization
// -------------
virtual void Mark(size_t day, bool mark) wxOVERRIDE;
// all other functions in this section are for generic version only
// header colours are used for painting the weekdays at the top
virtual void SetHeaderColours(const wxColour& colFg, const wxColour& colBg) wxOVERRIDE
{
m_colHeaderFg = colFg;
m_colHeaderBg = colBg;
}
virtual const wxColour& GetHeaderColourFg() const wxOVERRIDE { return m_colHeaderFg; }
virtual const wxColour& GetHeaderColourBg() const wxOVERRIDE { return m_colHeaderBg; }
// highlight colour is used for the currently selected date
virtual void SetHighlightColours(const wxColour& colFg, const wxColour& colBg) wxOVERRIDE
{
m_colHighlightFg = colFg;
m_colHighlightBg = colBg;
}
virtual const wxColour& GetHighlightColourFg() const wxOVERRIDE { return m_colHighlightFg; }
virtual const wxColour& GetHighlightColourBg() const wxOVERRIDE { return m_colHighlightBg; }
// holiday colour is used for the holidays (if style & wxCAL_SHOW_HOLIDAYS)
virtual void SetHolidayColours(const wxColour& colFg, const wxColour& colBg) wxOVERRIDE
{
m_colHolidayFg = colFg;
m_colHolidayBg = colBg;
}
virtual const wxColour& GetHolidayColourFg() const wxOVERRIDE { return m_colHolidayFg; }
virtual const wxColour& GetHolidayColourBg() const wxOVERRIDE { return m_colHolidayBg; }
virtual wxCalendarDateAttr *GetAttr(size_t day) const wxOVERRIDE
{
wxCHECK_MSG( day > 0 && day < 32, NULL, wxT("invalid day") );
return m_attrs[day - 1];
}
virtual void SetAttr(size_t day, wxCalendarDateAttr *attr) wxOVERRIDE
{
wxCHECK_RET( day > 0 && day < 32, wxT("invalid day") );
delete m_attrs[day - 1];
m_attrs[day - 1] = attr;
}
virtual void ResetAttr(size_t day) wxOVERRIDE { SetAttr(day, NULL); }
virtual void SetHoliday(size_t day) wxOVERRIDE;
virtual wxCalendarHitTestResult HitTest(const wxPoint& pos,
wxDateTime *date = NULL,
wxDateTime::WeekDay *wd = NULL) wxOVERRIDE;
// implementation only from now on
// -------------------------------
// forward these functions to all subcontrols
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
virtual void SetWindowStyleFlag(long style) wxOVERRIDE;
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE
{ return GetClassDefaultAttributes(GetWindowVariant()); }
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
void OnSysColourChanged(wxSysColourChangedEvent& event);
protected:
// override some base class virtuals
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
private:
// common part of all ctors
void Init();
// startup colours and reinitialization after colour changes in system
void InitColours();
// event handlers
void OnPaint(wxPaintEvent& event);
void OnClick(wxMouseEvent& event);
void OnDClick(wxMouseEvent& event);
void OnWheel(wxMouseEvent& event);
void OnChar(wxKeyEvent& event);
void OnMonthChange(wxCommandEvent& event);
void HandleYearChange(wxCommandEvent& event);
void OnYearChange(wxSpinEvent& event);
void OnYearTextChange(wxCommandEvent& event);
// (re)calc m_widthCol and m_heightRow
void RecalcGeometry();
// set the date and send the notification
void SetDateAndNotify(const wxDateTime& date);
// get the week (row, in range 1..6) for the given date
size_t GetWeek(const wxDateTime& date) const;
// get the date from which we start drawing days
wxDateTime GetStartDate() const;
// get the first/last days of the week corresponding to the current style
wxDateTime::WeekDay GetWeekStart() const
{
return WeekStartsOnMonday() ? wxDateTime::Mon
: wxDateTime::Sun;
}
wxDateTime::WeekDay GetWeekEnd() const
{
return WeekStartsOnMonday() ? wxDateTime::Sun
: wxDateTime::Sat;
}
// is this date shown?
bool IsDateShown(const wxDateTime& date) const;
// is this date in the currently allowed range?
bool IsDateInRange(const wxDateTime& date) const;
// adjust the date to the currently allowed range, return true if it was
// changed
bool AdjustDateToRange(wxDateTime *date) const;
// redraw the given date
void RefreshDate(const wxDateTime& date);
// change the date inside the same month/year
void ChangeDay(const wxDateTime& date);
// deprecated
bool AllowYearChange() const
{
return !(GetWindowStyle() & wxCAL_NO_YEAR_CHANGE);
}
// show the correct controls
void ShowCurrentControls();
// create the month combo and year spin controls
void CreateMonthComboBox();
void CreateYearSpinCtrl();
public:
// get the currently shown control for month/year
wxControl *GetMonthControl() const;
wxControl *GetYearControl() const;
private:
virtual void ResetHolidayAttrs() wxOVERRIDE;
virtual void RefreshHolidays() wxOVERRIDE { Refresh(); }
// OnPaint helper-methods
// Highlight the [fromdate : todate] range using pen and brush
void HighlightRange(wxPaintDC* dc, const wxDateTime& fromdate, const wxDateTime& todate, const wxPen* pen, const wxBrush* brush);
// Get the "coordinates" for the date relative to the month currently displayed.
// using (day, week): upper left coord is (1, 1), lower right coord is (7, 6)
// if the date isn't visible (-1, -1) is put in (day, week) and false is returned
bool GetDateCoord(const wxDateTime& date, int *day, int *week) const;
// Set the flag for SetDate(): otherwise it would overwrite the year
// typed in by the user
void SetUserChangedYear() { m_userChangedYear = true; }
// the subcontrols
wxStaticText *m_staticMonth;
wxComboBox *m_comboMonth;
wxStaticText *m_staticYear;
wxSpinCtrl *m_spinYear;
// the current selection
wxDateTime m_date;
// the date-range
wxDateTime m_lowdate;
wxDateTime m_highdate;
// default attributes
wxColour m_colHighlightFg,
m_colHighlightBg,
m_colHolidayFg,
m_colHolidayBg,
m_colHeaderFg,
m_colHeaderBg,
m_colBackground,
m_colSurrounding;
// the attributes for each of the month days
wxCalendarDateAttr *m_attrs[31];
// the width and height of one column/row in the calendar
wxCoord m_widthCol,
m_heightRow,
m_rowOffset,
m_calendarWeekWidth;
wxRect m_leftArrowRect,
m_rightArrowRect;
// the week day names
wxString m_weekdays[7];
// true if SetDate() is being called as the result of changing the year in
// the year control
bool m_userChangedYear;
wxDECLARE_DYNAMIC_CLASS(wxGenericCalendarCtrl);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxGenericCalendarCtrl);
};
#endif // _WX_GENERIC_CALCTRLG_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/wizard.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/wizard.h
// Purpose: declaration of generic wxWizard class
// Author: Vadim Zeitlin
// Modified by: Robert Vazan (sizers)
// Created: 28.09.99
// Copyright: (c) 1999 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_WIZARD_H_
#define _WX_GENERIC_WIZARD_H_
// ----------------------------------------------------------------------------
// wxWizard
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxStaticBitmap;
class WXDLLIMPEXP_FWD_CORE wxWizardEvent;
class WXDLLIMPEXP_FWD_CORE wxBoxSizer;
class WXDLLIMPEXP_FWD_CORE wxWizardSizer;
class WXDLLIMPEXP_CORE wxWizard : public wxWizardBase
{
public:
// ctor
wxWizard() { Init(); }
wxWizard(wxWindow *parent,
int id = wxID_ANY,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxPoint& pos = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE)
{
Init();
Create(parent, id, title, bitmap, pos, style);
}
bool Create(wxWindow *parent,
int id = wxID_ANY,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxPoint& pos = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE);
void Init();
virtual ~wxWizard();
// implement base class pure virtuals
virtual bool RunWizard(wxWizardPage *firstPage) wxOVERRIDE;
virtual wxWizardPage *GetCurrentPage() const wxOVERRIDE;
virtual void SetPageSize(const wxSize& size) wxOVERRIDE;
virtual wxSize GetPageSize() const wxOVERRIDE;
virtual void FitToPage(const wxWizardPage *firstPage) wxOVERRIDE;
virtual wxSizer *GetPageAreaSizer() const wxOVERRIDE;
virtual void SetBorder(int border) wxOVERRIDE;
/// set/get bitmap
const wxBitmap& GetBitmap() const { return m_bitmap; }
void SetBitmap(const wxBitmap& bitmap);
// implementation only from now on
// -------------------------------
// is the wizard running?
bool IsRunning() const { return m_page != NULL; }
// show the prev/next page, but call TransferDataFromWindow on the current
// page first and return false without changing the page if
// TransferDataFromWindow() returns false - otherwise, returns true
virtual bool ShowPage(wxWizardPage *page, bool goingForward = true);
// do fill the dialog with controls
// this is app-overridable to, for example, set help and tooltip text
virtual void DoCreateControls();
// Do the adaptation
virtual bool DoLayoutAdaptation() wxOVERRIDE;
// Set/get bitmap background colour
void SetBitmapBackgroundColour(const wxColour& colour) { m_bitmapBackgroundColour = colour; }
const wxColour& GetBitmapBackgroundColour() const { return m_bitmapBackgroundColour; }
// Set/get bitmap placement (centred, tiled etc.)
void SetBitmapPlacement(int placement) { m_bitmapPlacement = placement; }
int GetBitmapPlacement() const { return m_bitmapPlacement; }
// Set/get minimum bitmap width
void SetMinimumBitmapWidth(int w) { m_bitmapMinimumWidth = w; }
int GetMinimumBitmapWidth() const { return m_bitmapMinimumWidth; }
// Tile bitmap
static bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
protected:
// for compatibility only, doesn't do anything any more
void FinishLayout() { }
// Do fit, and adjust to screen size if necessary
virtual void DoWizardLayout();
// Resize bitmap if necessary
virtual bool ResizeBitmap(wxBitmap& bmp);
// was the dialog really created?
bool WasCreated() const { return m_btnPrev != NULL; }
// event handlers
void OnCancel(wxCommandEvent& event);
void OnBackOrNext(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
void OnWizEvent(wxWizardEvent& event);
void AddBitmapRow(wxBoxSizer *mainColumn);
void AddStaticLine(wxBoxSizer *mainColumn);
void AddBackNextPair(wxBoxSizer *buttonRow);
void AddButtonRow(wxBoxSizer *mainColumn);
// the page size requested by user
wxSize m_sizePage;
// the dialog position from the ctor
wxPoint m_posWizard;
// wizard state
wxWizardPage *m_page; // the current page or NULL
wxWizardPage *m_firstpage; // the page RunWizard started on or NULL
wxBitmap m_bitmap; // the default bitmap to show
// wizard controls
wxButton *m_btnPrev, // the "<Back" button
*m_btnNext; // the "Next>" or "Finish" button
wxStaticBitmap *m_statbmp; // the control for the bitmap
// cached labels so their translations stay consistent
wxString m_nextLabel,
m_finishLabel;
// Border around page area sizer requested using SetBorder()
int m_border;
// Whether RunWizard() was called
bool m_started;
// Whether was modal (modeless has to be destroyed on finish or cancel)
bool m_wasModal;
// True if pages are laid out using the sizer
bool m_usingSizer;
// Page area sizer will be inserted here with padding
wxBoxSizer *m_sizerBmpAndPage;
// Actual position and size of pages
wxWizardSizer *m_sizerPage;
// Bitmap background colour if resizing bitmap
wxColour m_bitmapBackgroundColour;
// Bitmap placement flags
int m_bitmapPlacement;
// Minimum bitmap width
int m_bitmapMinimumWidth;
friend class wxWizardSizer;
wxDECLARE_DYNAMIC_CLASS(wxWizard);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxWizard);
};
#endif // _WX_GENERIC_WIZARD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/gridsel.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/gridsel.h
// Purpose: wxGridSelection
// Author: Stefan Neis
// Modified by:
// Created: 20/02/2000
// Copyright: (c) Stefan Neis
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_GRIDSEL_H_
#define _WX_GENERIC_GRIDSEL_H_
#include "wx/defs.h"
#if wxUSE_GRID
#include "wx/grid.h"
class WXDLLIMPEXP_CORE wxGridSelection
{
public:
wxGridSelection(wxGrid *grid,
wxGrid::wxGridSelectionModes sel = wxGrid::wxGridSelectCells);
bool IsSelection();
bool IsInSelection(int row, int col);
bool IsInSelection(const wxGridCellCoords& coords)
{
return IsInSelection(coords.GetRow(), coords.GetCol());
}
void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; }
void SelectRow(int row, const wxKeyboardState& kbd = wxKeyboardState());
void SelectCol(int col, const wxKeyboardState& kbd = wxKeyboardState());
void SelectBlock(int topRow, int leftCol,
int bottomRow, int rightCol,
const wxKeyboardState& kbd = wxKeyboardState(),
bool sendEvent = true );
void SelectBlock(const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
const wxKeyboardState& kbd = wxKeyboardState(),
bool sendEvent = true )
{
SelectBlock(topLeft.GetRow(), topLeft.GetCol(),
bottomRight.GetRow(), bottomRight.GetCol(),
kbd, sendEvent);
}
void SelectCell(int row, int col,
const wxKeyboardState& kbd = wxKeyboardState(),
bool sendEvent = true);
void SelectCell(const wxGridCellCoords& coords,
const wxKeyboardState& kbd = wxKeyboardState(),
bool sendEvent = true)
{
SelectCell(coords.GetRow(), coords.GetCol(), kbd, sendEvent);
}
void ToggleCellSelection(int row, int col,
const wxKeyboardState& kbd = wxKeyboardState());
void ToggleCellSelection(const wxGridCellCoords& coords,
const wxKeyboardState& kbd = wxKeyboardState())
{
ToggleCellSelection(coords.GetRow(), coords.GetCol(), kbd);
}
void ClearSelection();
void UpdateRows( size_t pos, int numRows );
void UpdateCols( size_t pos, int numCols );
private:
int BlockContain( int topRow1, int leftCol1,
int bottomRow1, int rightCol1,
int topRow2, int leftCol2,
int bottomRow2, int rightCol2 );
// returns 1, if Block1 contains Block2,
// -1, if Block2 contains Block1,
// 0, otherwise
int BlockContainsCell( int topRow, int leftCol,
int bottomRow, int rightCol,
int row, int col )
// returns 1, if Block contains Cell,
// 0, otherwise
{
return ( topRow <= row && row <= bottomRow &&
leftCol <= col && col <= rightCol );
}
void SelectBlockNoEvent(int topRow, int leftCol,
int bottomRow, int rightCol)
{
SelectBlock(topRow, leftCol, bottomRow, rightCol,
wxKeyboardState(), false);
}
wxGridCellCoordsArray m_cellSelection;
wxGridCellCoordsArray m_blockSelectionTopLeft;
wxGridCellCoordsArray m_blockSelectionBottomRight;
wxArrayInt m_rowSelection;
wxArrayInt m_colSelection;
wxGrid *m_grid;
wxGrid::wxGridSelectionModes m_selectionMode;
friend class WXDLLIMPEXP_FWD_CORE wxGrid;
wxDECLARE_NO_COPY_CLASS(wxGridSelection);
};
#endif // wxUSE_GRID
#endif // _WX_GENERIC_GRIDSEL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/logg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/logg.h
// Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs)
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LOGG_H_
#define _WX_LOGG_H_
#if wxUSE_GUI
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
class WXDLLIMPEXP_FWD_CORE wxLogFrame;
class WXDLLIMPEXP_FWD_CORE wxWindow;
// ----------------------------------------------------------------------------
// the following log targets are only compiled in if the we're compiling the
// GUI part (andnot just the base one) of the library, they're implemented in
// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest)
// ----------------------------------------------------------------------------
#if wxUSE_TEXTCTRL
// log everything to a text window (GUI only of course)
class WXDLLIMPEXP_CORE wxLogTextCtrl : public wxLog
{
public:
wxLogTextCtrl(wxTextCtrl *pTextCtrl);
protected:
// implement sink function
virtual void DoLogText(const wxString& msg) wxOVERRIDE;
private:
// the control we use
wxTextCtrl *m_pTextCtrl;
wxDECLARE_NO_COPY_CLASS(wxLogTextCtrl);
};
#endif // wxUSE_TEXTCTRL
// ----------------------------------------------------------------------------
// GUI log target, the default one for wxWidgets programs
// ----------------------------------------------------------------------------
#if wxUSE_LOGGUI
class WXDLLIMPEXP_CORE wxLogGui : public wxLog
{
public:
// ctor
wxLogGui();
// show all messages that were logged since the last Flush()
virtual void Flush() wxOVERRIDE;
protected:
virtual void DoLogRecord(wxLogLevel level,
const wxString& msg,
const wxLogRecordInfo& info) wxOVERRIDE;
// return the title to be used for the log dialog, depending on m_bErrors
// and m_bWarnings values
wxString GetTitle() const;
// return the icon (one of wxICON_XXX constants) to be used for the dialog
// depending on m_bErrors/m_bWarnings
int GetSeverityIcon() const;
// empty everything
void Clear();
wxArrayString m_aMessages; // the log message texts
wxArrayInt m_aSeverity; // one of wxLOG_XXX values
wxArrayLong m_aTimes; // the time of each message
bool m_bErrors, // do we have any errors?
m_bWarnings, // any warnings?
m_bHasMessages; // any messages at all?
private:
// this method is called to show a single log message, it uses
// wxMessageBox() by default
virtual void DoShowSingleLogMessage(const wxString& message,
const wxString& title,
int style);
// this method is called to show multiple log messages, it uses wxLogDialog
virtual void DoShowMultipleLogMessages(const wxArrayString& messages,
const wxArrayInt& severities,
const wxArrayLong& times,
const wxString& title,
int style);
};
#endif // wxUSE_LOGGUI
// ----------------------------------------------------------------------------
// (background) log window: this class forwards all log messages to the log
// target which was active when it was instantiated, but also collects them
// to the log window. This window has its own menu which allows the user to
// close it, clear the log contents or save it to the file.
// ----------------------------------------------------------------------------
#if wxUSE_LOGWINDOW
class WXDLLIMPEXP_CORE wxLogWindow : public wxLogPassThrough
{
public:
wxLogWindow(wxWindow *pParent, // the parent frame (can be NULL)
const wxString& szTitle, // the title of the frame
bool bShow = true, // show window immediately?
bool bPassToOld = true); // pass messages to the old target?
virtual ~wxLogWindow();
// window operations
// show/hide the log window
void Show(bool bShow = true);
// retrieve the pointer to the frame
wxFrame *GetFrame() const;
// overridables
// called if the user closes the window interactively, will not be
// called if it is destroyed for another reason (such as when program
// exits) - return true from here to allow the frame to close, false
// to prevent this from happening
virtual bool OnFrameClose(wxFrame *frame);
// called right before the log frame is going to be deleted: will
// always be called unlike OnFrameClose()
virtual void OnFrameDelete(wxFrame *frame);
protected:
virtual void DoLogTextAtLevel(wxLogLevel level, const wxString& msg) wxOVERRIDE;
private:
wxLogFrame *m_pLogFrame; // the log frame
wxDECLARE_NO_COPY_CLASS(wxLogWindow);
};
#endif // wxUSE_LOGWINDOW
#endif // wxUSE_GUI
#endif // _WX_LOGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/treectlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/treectlg.h
// Purpose: wxTreeCtrl class
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// Copyright: (c) 1997,1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _GENERIC_TREECTRL_H_
#define _GENERIC_TREECTRL_H_
#if wxUSE_TREECTRL
#include "wx/scrolwin.h"
#include "wx/pen.h"
// -----------------------------------------------------------------------------
// forward declaration
// -----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxGenericTreeItem;
class WXDLLIMPEXP_FWD_CORE wxTreeItemData;
class WXDLLIMPEXP_FWD_CORE wxTreeRenameTimer;
class WXDLLIMPEXP_FWD_CORE wxTreeFindTimer;
class WXDLLIMPEXP_FWD_CORE wxTreeTextCtrl;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
// -----------------------------------------------------------------------------
// wxGenericTreeCtrl - the tree control
// -----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericTreeCtrl : public wxTreeCtrlBase,
public wxScrollHelper
{
public:
// creation
// --------
wxGenericTreeCtrl() : wxTreeCtrlBase(), wxScrollHelper(this) { Init(); }
wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr)
: wxTreeCtrlBase(),
wxScrollHelper(this)
{
Init();
Create(parent, id, pos, size, style, validator, name);
}
virtual ~wxGenericTreeCtrl();
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr);
// implement base class pure virtuals
// ----------------------------------
virtual unsigned int GetCount() const wxOVERRIDE;
virtual unsigned int GetIndent() const wxOVERRIDE { return m_indent; }
virtual void SetIndent(unsigned int indent) wxOVERRIDE;
virtual void SetImageList(wxImageList *imageList) wxOVERRIDE;
virtual void SetStateImageList(wxImageList *imageList) wxOVERRIDE;
virtual wxString GetItemText(const wxTreeItemId& item) const wxOVERRIDE;
virtual int GetItemImage(const wxTreeItemId& item,
wxTreeItemIcon which = wxTreeItemIcon_Normal) const wxOVERRIDE;
virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxColour GetItemTextColour(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxFont GetItemFont(const wxTreeItemId& item) const wxOVERRIDE;
virtual void SetItemText(const wxTreeItemId& item, const wxString& text) wxOVERRIDE;
virtual void SetItemImage(const wxTreeItemId& item,
int image,
wxTreeItemIcon which = wxTreeItemIcon_Normal) wxOVERRIDE;
virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data) wxOVERRIDE;
virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true) wxOVERRIDE;
virtual void SetItemBold(const wxTreeItemId& item, bool bold = true) wxOVERRIDE;
virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true) wxOVERRIDE;
virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col) wxOVERRIDE;
virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col) wxOVERRIDE;
virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font) wxOVERRIDE;
virtual bool IsVisible(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool ItemHasChildren(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool IsExpanded(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool IsSelected(const wxTreeItemId& item) const wxOVERRIDE;
virtual bool IsBold(const wxTreeItemId& item) const wxOVERRIDE;
virtual size_t GetChildrenCount(const wxTreeItemId& item,
bool recursively = true) const wxOVERRIDE;
// navigation
// ----------
virtual wxTreeItemId GetRootItem() const wxOVERRIDE { return m_anchor; }
virtual wxTreeItemId GetSelection() const wxOVERRIDE
{
wxASSERT_MSG( !HasFlag(wxTR_MULTIPLE),
wxT("must use GetSelections() with this control") );
return m_current;
}
virtual size_t GetSelections(wxArrayTreeItemIds&) const wxOVERRIDE;
virtual wxTreeItemId GetFocusedItem() const wxOVERRIDE { return m_current; }
virtual void ClearFocusedItem() wxOVERRIDE;
virtual void SetFocusedItem(const wxTreeItemId& item) wxOVERRIDE;
virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item,
wxTreeItemIdValue& cookie) const wxOVERRIDE;
virtual wxTreeItemId GetNextChild(const wxTreeItemId& item,
wxTreeItemIdValue& cookie) const wxOVERRIDE;
virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetFirstVisibleItem() const wxOVERRIDE;
virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const wxOVERRIDE;
virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const wxOVERRIDE;
// operations
// ----------
virtual wxTreeItemId AddRoot(const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL) wxOVERRIDE;
virtual void Delete(const wxTreeItemId& item) wxOVERRIDE;
virtual void DeleteChildren(const wxTreeItemId& item) wxOVERRIDE;
virtual void DeleteAllItems() wxOVERRIDE;
virtual void Expand(const wxTreeItemId& item) wxOVERRIDE;
virtual void Collapse(const wxTreeItemId& item) wxOVERRIDE;
virtual void CollapseAndReset(const wxTreeItemId& item) wxOVERRIDE;
virtual void Toggle(const wxTreeItemId& item) wxOVERRIDE;
virtual void Unselect() wxOVERRIDE;
virtual void UnselectAll() wxOVERRIDE;
virtual void SelectItem(const wxTreeItemId& item, bool select = true) wxOVERRIDE;
virtual void SelectChildren(const wxTreeItemId& parent) wxOVERRIDE;
virtual void EnsureVisible(const wxTreeItemId& item) wxOVERRIDE;
virtual void ScrollTo(const wxTreeItemId& item) wxOVERRIDE;
virtual wxTextCtrl *EditLabel(const wxTreeItemId& item,
wxClassInfo* textCtrlClass = wxCLASSINFO(wxTextCtrl)) wxOVERRIDE;
virtual wxTextCtrl *GetEditControl() const wxOVERRIDE;
virtual void EndEditLabel(const wxTreeItemId& item,
bool discardChanges = false) wxOVERRIDE;
virtual void EnableBellOnNoMatch(bool on = true) wxOVERRIDE;
virtual void SortChildren(const wxTreeItemId& item) wxOVERRIDE;
// items geometry
// --------------
virtual bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
bool textOnly = false) const wxOVERRIDE;
// this version specific methods
// -----------------------------
wxImageList *GetButtonsImageList() const { return m_imageListButtons; }
void SetButtonsImageList(wxImageList *imageList);
void AssignButtonsImageList(wxImageList *imageList);
void SetDropEffectAboveItem( bool above = false ) { m_dropEffectAboveItem = above; }
bool GetDropEffectAboveItem() const { return m_dropEffectAboveItem; }
wxTreeItemId GetNext(const wxTreeItemId& item) const;
// implementation only from now on
// overridden base class virtuals
virtual bool SetBackgroundColour(const wxColour& colour) wxOVERRIDE;
virtual bool SetForegroundColour(const wxColour& colour) wxOVERRIDE;
virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL) wxOVERRIDE;
virtual bool SetFont( const wxFont &font ) wxOVERRIDE;
virtual void SetWindowStyleFlag(long styles) wxOVERRIDE;
// callbacks
void OnPaint( wxPaintEvent &event );
void OnSetFocus( wxFocusEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnKeyDown( wxKeyEvent &event );
void OnChar( wxKeyEvent &event );
void OnMouse( wxMouseEvent &event );
void OnGetToolTip( wxTreeEvent &event );
void OnSize( wxSizeEvent &event );
void OnInternalIdle( ) wxOVERRIDE;
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// implementation helpers
void AdjustMyScrollbars();
WX_FORWARD_TO_SCROLL_HELPER()
protected:
friend class wxGenericTreeItem;
friend class wxTreeRenameTimer;
friend class wxTreeFindTimer;
friend class wxTreeTextCtrl;
wxFont m_normalFont;
wxFont m_boldFont;
wxGenericTreeItem *m_anchor;
wxGenericTreeItem *m_current,
*m_key_current,
// A hint to select a parent item after deleting a child
*m_select_me;
unsigned short m_indent;
int m_lineHeight;
wxPen m_dottedPen;
wxBrush *m_hilightBrush,
*m_hilightUnfocusedBrush;
bool m_hasFocus;
bool m_dirty;
bool m_ownsImageListButtons;
bool m_isDragging; // true between BEGIN/END drag events
bool m_lastOnSame; // last click on the same item as prev
wxImageList *m_imageListButtons;
int m_dragCount;
wxPoint m_dragStart;
wxGenericTreeItem *m_dropTarget;
wxCursor m_oldCursor; // cursor is changed while dragging
wxGenericTreeItem *m_oldSelection;
wxGenericTreeItem *m_underMouse; // for visual effects
enum { NoEffect, BorderEffect, AboveEffect, BelowEffect } m_dndEffect;
wxGenericTreeItem *m_dndEffectItem;
wxTreeTextCtrl *m_textCtrl;
wxTimer *m_renameTimer;
// incremental search data
wxString m_findPrefix;
wxTimer *m_findTimer;
// This flag is set to 0 if the bell is disabled, 1 if it is enabled and -1
// if it is globally enabled but has been temporarily disabled because we
// had already beeped for this particular search.
int m_findBell;
bool m_dropEffectAboveItem;
// the common part of all ctors
void Init();
// overridden wxWindow methods
virtual void DoThaw() wxOVERRIDE;
// misc helpers
void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted);
void DrawBorder(const wxTreeItemId& item);
void DrawLine(const wxTreeItemId& item, bool below);
void DrawDropEffect(wxGenericTreeItem *item);
void DoSelectItem(const wxTreeItemId& id,
bool unselect_others = true,
bool extended_select = false);
virtual int DoGetItemState(const wxTreeItemId& item) const wxOVERRIDE;
virtual void DoSetItemState(const wxTreeItemId& item, int state) wxOVERRIDE;
virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
size_t previous,
const wxString& text,
int image,
int selectedImage,
wxTreeItemData *data) wxOVERRIDE;
virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent,
const wxTreeItemId& idPrevious,
const wxString& text,
int image = -1, int selImage = -1,
wxTreeItemData *data = NULL) wxOVERRIDE;
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const wxOVERRIDE;
// called by wxTextTreeCtrl when it marks itself for deletion
void ResetTextControl();
// find the first item starting with the given prefix after the given item
wxTreeItemId FindItem(const wxTreeItemId& id, const wxString& prefix) const;
bool HasButtons() const { return HasFlag(wxTR_HAS_BUTTONS); }
void CalculateLineHeight();
int GetLineHeight(wxGenericTreeItem *item) const;
void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y );
void PaintItem( wxGenericTreeItem *item, wxDC& dc);
void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
void CalculatePositions();
void RefreshSubtree( wxGenericTreeItem *item );
void RefreshLine( wxGenericTreeItem *item );
// redraw all selected items
void RefreshSelected();
// RefreshSelected() recursive helper
void RefreshSelectedUnder(wxGenericTreeItem *item);
void OnRenameTimer();
bool OnRenameAccept(wxGenericTreeItem *item, const wxString& value);
void OnRenameCancelled(wxGenericTreeItem *item);
void FillArray(wxGenericTreeItem*, wxArrayTreeItemIds&) const;
void SelectItemRange( wxGenericTreeItem *item1, wxGenericTreeItem *item2 );
bool TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
void UnselectAllChildren( wxGenericTreeItem *item );
void ChildrenClosing(wxGenericTreeItem* item);
void DoDirtyProcessing();
virtual wxSize DoGetBestSize() const wxOVERRIDE;
private:
// Reset the state of the last find (i.e. keyboard incremental search)
// operation.
void ResetFindState();
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl);
wxDECLARE_NO_COPY_CLASS(wxGenericTreeCtrl);
};
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
/*
* wxTreeCtrl has to be a real class or we have problems with
* the run-time information.
*/
class WXDLLIMPEXP_CORE wxTreeCtrl: public wxGenericTreeCtrl
{
wxDECLARE_DYNAMIC_CLASS(wxTreeCtrl);
public:
wxTreeCtrl() {}
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr)
: wxGenericTreeCtrl(parent, id, pos, size, style, validator, name)
{
}
};
#endif // !__WXMSW__ || __WXUNIVERSAL__
#endif // wxUSE_TREECTRL
#endif // _GENERIC_TREECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/region.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/region.h
// Purpose: generic wxRegion class
// Author: David Elliott
// Modified by:
// Created: 2004/04/12
// Copyright: (c) 2004 David Elliott
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_REGION_H__
#define _WX_GENERIC_REGION_H__
class WXDLLIMPEXP_CORE wxRegionGeneric : public wxRegionBase
{
public:
wxRegionGeneric(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRegionGeneric(const wxRect& rect);
wxRegionGeneric(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
wxRegionGeneric(const wxBitmap& bmp);
wxRegionGeneric(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0);
wxRegionGeneric();
virtual ~wxRegionGeneric();
// wxRegionBase pure virtuals
virtual void Clear();
virtual bool IsEmpty() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
// wxRegionBase pure virtuals
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);
friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric;
};
class WXDLLIMPEXP_CORE wxRegionIteratorGeneric : public wxObject
{
public:
wxRegionIteratorGeneric();
wxRegionIteratorGeneric(const wxRegionGeneric& region);
wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator);
virtual ~wxRegionIteratorGeneric();
wxRegionIteratorGeneric& operator=(const wxRegionIteratorGeneric& iterator);
void Reset() { m_current = 0; }
void Reset(const wxRegionGeneric& region);
operator bool () const { return HaveRects(); }
bool HaveRects() const;
wxRegionIteratorGeneric& operator++();
wxRegionIteratorGeneric operator++(int);
long GetX() const;
long GetY() const;
long GetW() const;
long GetWidth() const { return GetW(); }
long GetH() const;
long GetHeight() const { return GetH(); }
wxRect GetRect() const;
private:
long m_current;
wxRegionGeneric m_region;
};
#endif // _WX_GENERIC_REGION_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/fontpickerg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/fontpickerg.h
// Purpose: wxGenericFontButton header
// Author: Francesco Montorsi
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FONTPICKER_H_
#define _WX_FONTPICKER_H_
#include "wx/button.h"
#include "wx/fontdata.h"
//-----------------------------------------------------------------------------
// wxGenericFontButton: a button which brings up a wxFontDialog
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericFontButton : public wxButton,
public wxFontPickerWidgetBase
{
public:
wxGenericFontButton() {}
wxGenericFontButton(wxWindow *parent,
wxWindowID id,
const wxFont &initial = wxNullFont,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFontPickerWidgetNameStr)
{
Create(parent, id, initial, pos, size, style, validator, name);
}
virtual wxColour GetSelectedColour() const wxOVERRIDE
{ return m_data.GetColour(); }
virtual void SetSelectedColour(const wxColour &colour) wxOVERRIDE
{ m_data.SetColour(colour); UpdateFont(); }
virtual ~wxGenericFontButton() {}
public: // API extensions specific for wxGenericFontButton
// user can override this to init font data in a different way
virtual void InitFontData();
// returns the font data shown in wxFontDialog
wxFontData *GetFontData() { return &m_data; }
public:
bool Create(wxWindow *parent,
wxWindowID id,
const wxFont &initial = *wxNORMAL_FONT,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFontPickerWidgetNameStr);
void OnButtonClick(wxCommandEvent &);
protected:
void UpdateFont() wxOVERRIDE;
wxFontData m_data;
private:
wxDECLARE_DYNAMIC_CLASS(wxGenericFontButton);
};
#endif // _WX_FONTPICKER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/mask.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/mask.h
// Purpose: generic implementation of wxMask
// Author: Vadim Zeitlin
// Created: 2006-09-28
// Copyright: (c) 2006 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_MASKG_H_
#define _WX_GENERIC_MASKG_H_
// ----------------------------------------------------------------------------
// generic wxMask implementation
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMask : public wxMaskBase
{
public:
wxMask() { }
wxMask(const wxBitmap& bitmap, const wxColour& colour)
{
InitFromColour(bitmap, colour);
}
#if wxUSE_PALETTE
wxMask(const wxBitmap& bitmap, int paletteIndex)
{
Create(bitmap, paletteIndex);
}
#endif // wxUSE_PALETTE
wxMask(const wxBitmap& bitmap)
{
InitFromMonoBitmap(bitmap);
}
// implementation-only from now on
wxBitmap GetBitmap() const { return m_bitmap; }
private:
// implement wxMaskBase pure virtuals
virtual void FreeData();
virtual bool InitFromColour(const wxBitmap& bitmap, const wxColour& colour);
virtual bool InitFromMonoBitmap(const wxBitmap& bitmap);
wxBitmap m_bitmap;
wxDECLARE_DYNAMIC_CLASS(wxMask);
};
#endif // _WX_GENERIC_MASKG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/datectrl.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/datectrl.h
// Purpose: generic wxDatePickerCtrl implementation
// Author: Andreas Pflug
// Modified by:
// Created: 2005-01-19
// Copyright: (c) 2005 Andreas Pflug <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_DATECTRL_H_
#define _WX_GENERIC_DATECTRL_H_
#include "wx/compositewin.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
class WXDLLIMPEXP_FWD_CORE wxCalendarCtrl;
class WXDLLIMPEXP_FWD_CORE wxCalendarComboPopup;
class WXDLLIMPEXP_CORE wxDatePickerCtrlGeneric
: public wxCompositeWindow< wxNavigationEnabled<wxDatePickerCtrlBase> >
{
public:
// creating the control
wxDatePickerCtrlGeneric() { Init(); }
virtual ~wxDatePickerCtrlGeneric();
wxDatePickerCtrlGeneric(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr)
{
Init();
(void)Create(parent, id, date, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr);
// wxDatePickerCtrl methods
void SetValue(const wxDateTime& date) wxOVERRIDE;
wxDateTime GetValue() const wxOVERRIDE;
bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const wxOVERRIDE;
void SetRange(const wxDateTime &dt1, const wxDateTime &dt2) wxOVERRIDE;
bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime);
// extra methods available only in this (generic) implementation
wxCalendarCtrl *GetCalendar() const;
// implementation only from now on
// -------------------------------
// overridden base class methods
virtual bool Destroy() wxOVERRIDE;
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
private:
void Init();
// return the list of the windows composing this one
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE;
void OnText(wxCommandEvent &event);
void OnSize(wxSizeEvent& event);
#ifdef __WXOSX_COCOA__
virtual void OSXGenerateEvent(const wxDateTime& WXUNUSED(dt)) wxOVERRIDE { }
#endif
wxComboCtrl* m_combo;
wxCalendarComboPopup* m_popup;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric);
};
#endif // _WX_GENERIC_DATECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/colour.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/colour.h
// Purpose: wxColour class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_COLOUR_H_
#define _WX_GENERIC_COLOUR_H_
#include "wx/object.h"
// Colour
class WXDLLIMPEXP_CORE wxColour: public wxColourBase
{
public:
// constructors
// ------------
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
// copy ctors and assignment operators
wxColour(const wxColour& col)
{
*this = col;
}
wxColour& operator=(const wxColour& col);
// accessors
virtual bool IsOk() const { return m_isInit; }
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
unsigned char Alpha() const { return m_alpha; }
// comparison
bool operator==(const wxColour& colour) const
{
return (m_red == colour.m_red &&
m_green == colour.m_green &&
m_blue == colour.m_blue &&
m_alpha == colour.m_alpha &&
m_isInit == colour.m_isInit);
}
bool operator!=(const wxColour& colour) const { return !(*this == colour); }
protected:
// Helper function
void Init();
virtual void
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
private:
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
unsigned char m_alpha;
private:
wxDECLARE_DYNAMIC_CLASS(wxColour);
};
#endif // _WX_GENERIC_COLOUR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/gridctrl.h | ///////////////////////////////////////////////////////////////////////////
// Name: wx/generic/gridctrl.h
// Purpose: wxGrid controls
// Author: Paul Gammans, Roger Gammans
// Modified by:
// Created: 11/04/2001
// Copyright: (c) The Computer Surgery ([email protected])
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_GRIDCTRL_H_
#define _WX_GENERIC_GRIDCTRL_H_
#include "wx/grid.h"
#if wxUSE_GRID
#define wxGRID_VALUE_CHOICEINT wxT("choiceint")
#define wxGRID_VALUE_DATETIME wxT("datetime")
// the default renderer for the cells containing string data
class WXDLLIMPEXP_ADV wxGridCellStringRenderer : public wxGridCellRenderer
{
public:
// draw the string
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
// return the string extent
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
{ return new wxGridCellStringRenderer; }
protected:
// set the text colours before drawing
void SetTextColoursAndFont(const wxGrid& grid,
const wxGridCellAttr& attr,
wxDC& dc,
bool isSelected);
// calc the string extent for given string/font
wxSize DoGetBestSize(const wxGridCellAttr& attr,
wxDC& dc,
const wxString& text);
};
// the default renderer for the cells containing numeric (long) data
class WXDLLIMPEXP_ADV wxGridCellNumberRenderer : public wxGridCellStringRenderer
{
public:
// draw the string right aligned
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
{ return new wxGridCellNumberRenderer; }
protected:
wxString GetString(const wxGrid& grid, int row, int col);
};
class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer
{
public:
wxGridCellFloatRenderer(int width = -1,
int precision = -1,
int format = wxGRID_FLOAT_FORMAT_DEFAULT);
// get/change formatting parameters
int GetWidth() const { return m_width; }
void SetWidth(int width) { m_width = width; m_format.clear(); }
int GetPrecision() const { return m_precision; }
void SetPrecision(int precision) { m_precision = precision; m_format.clear(); }
int GetFormat() const { return m_style; }
void SetFormat(int format) { m_style = format; m_format.clear(); }
// draw the string right aligned with given width/precision
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
// parameters string format is "width[,precision[,format]]"
// with format being one of f|e|g|E|F|G
virtual void SetParameters(const wxString& params) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
protected:
wxString GetString(const wxGrid& grid, int row, int col);
private:
// formatting parameters
int m_width,
m_precision;
int m_style;
wxString m_format;
};
// renderer for boolean fields
class WXDLLIMPEXP_ADV wxGridCellBoolRenderer : public wxGridCellRenderer
{
public:
// draw a check mark or nothing
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
// return the checkmark size
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
{ return new wxGridCellBoolRenderer; }
private:
static wxSize ms_sizeCheckMark;
};
#if wxUSE_DATETIME
#include "wx/datetime.h"
// the default renderer for the cells containing times and dates
class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
{
public:
wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat,
const wxString& informat = wxDefaultDateTimeFormat);
// draw the string right aligned
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
// output strptime()-like format string
virtual void SetParameters(const wxString& params) wxOVERRIDE;
protected:
wxString GetString(const wxGrid& grid, int row, int col);
wxString m_iformat;
wxString m_oformat;
wxDateTime m_dateDef;
wxDateTime::TimeZone m_tz;
};
#endif // wxUSE_DATETIME
// renders a number using the corresponding text string
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellStringRenderer
{
public:
wxGridCellEnumRenderer( const wxString& choices = wxEmptyString );
// draw the string right aligned
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
// parameters string format is "item1[,item2[...,itemN]]" where itemN will
// be used if the cell value is N-1
virtual void SetParameters(const wxString& params) wxOVERRIDE;
protected:
wxString GetString(const wxGrid& grid, int row, int col);
wxArrayString m_choices;
};
class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringRenderer : public wxGridCellStringRenderer
{
public:
wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { }
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) wxOVERRIDE;
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual int GetBestHeight(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col,
int width) wxOVERRIDE;
virtual int GetBestWidth(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col,
int height) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
{ return new wxGridCellAutoWrapStringRenderer; }
private:
wxArrayString GetTextLines( wxGrid& grid,
wxDC& dc,
const wxGridCellAttr& attr,
const wxRect& rect,
int row, int col);
// Helper methods of GetTextLines()
// Break a single logical line of text into several physical lines, all of
// which are added to the lines array. The lines are broken at maxWidth and
// the dc is used for measuring text extent only.
void BreakLine(wxDC& dc,
const wxString& logicalLine,
wxCoord maxWidth,
wxArrayString& lines);
// Break a word, which is supposed to be wider than maxWidth, into several
// lines, which are added to lines array and the last, incomplete, of which
// is returned in line output parameter.
//
// Returns the width of the last line.
wxCoord BreakWord(wxDC& dc,
const wxString& word,
wxCoord maxWidth,
wxArrayString& lines,
wxString& line);
};
#endif // wxUSE_GRID
#endif // _WX_GENERIC_GRIDCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/custombgwin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/custombgwin.h
// Purpose: Generic implementation of wxCustomBackgroundWindow.
// Author: Vadim Zeitlin
// Created: 2011-10-10
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_CUSTOMBGWIN_H_
#define _WX_GENERIC_CUSTOMBGWIN_H_
#include "wx/bitmap.h"
#include "wx/dc.h"
#include "wx/event.h"
#include "wx/window.h"
// A helper to avoid template bloat: this class contains all type-independent
// code of wxCustomBackgroundWindow<> below.
class wxCustomBackgroundWindowGenericBase : public wxCustomBackgroundWindowBase
{
public:
wxCustomBackgroundWindowGenericBase() { }
protected:
void DoEraseBackground(wxEraseEvent& event, wxWindow* win)
{
wxDC& dc = *event.GetDC();
const wxSize clientSize = win->GetClientSize();
const wxSize bitmapSize = m_bitmapBg.GetSize();
for ( int x = 0; x < clientSize.x; x += bitmapSize.x )
{
for ( int y = 0; y < clientSize.y; y += bitmapSize.y )
{
dc.DrawBitmap(m_bitmapBg, x, y);
}
}
}
// The bitmap used for painting the background if valid.
wxBitmap m_bitmapBg;
wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowGenericBase);
};
// ----------------------------------------------------------------------------
// wxCustomBackgroundWindow
// ----------------------------------------------------------------------------
template <class W>
class wxCustomBackgroundWindow : public W,
public wxCustomBackgroundWindowGenericBase
{
public:
typedef W BaseWindowClass;
wxCustomBackgroundWindow() { }
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) wxOVERRIDE
{
m_bitmapBg = bmp;
if ( m_bitmapBg.IsOk() )
{
BaseWindowClass::Bind
(
wxEVT_ERASE_BACKGROUND,
&wxCustomBackgroundWindow::OnEraseBackground, this
);
}
else
{
BaseWindowClass::Unbind
(
wxEVT_ERASE_BACKGROUND,
&wxCustomBackgroundWindow::OnEraseBackground, this
);
}
}
private:
// Event handler for erasing the background which is only used when we have
// a valid background bitmap.
void OnEraseBackground(wxEraseEvent& event)
{
DoEraseBackground(event, this);
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCustomBackgroundWindow, W);
};
#endif // _WX_GENERIC_CUSTOMBGWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/colrdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/colrdlgg.h
// Purpose: wxGenericColourDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLORDLGG_H_
#define _WX_COLORDLGG_H_
#include "wx/gdicmn.h"
#include "wx/dialog.h"
#if wxUSE_SLIDER
class WXDLLIMPEXP_FWD_CORE wxSlider;
#endif // wxUSE_SLIDER
// Preview with opacity is possible only if wxGCDC and wxStaticBitmap are
// available and currently it only works in wxOSX and wxMSW as it uses wxBitmap
// UseAlpha() and HasAlpha() methods which only these ports provide.
#if ((wxUSE_GRAPHICS_CONTEXT && wxUSE_STATBMP) && \
(defined(__WXMSW__) || defined(__WXOSX__)))
#define wxCLRDLGG_USE_PREVIEW_WITH_ALPHA 1
#else
#define wxCLRDLGG_USE_PREVIEW_WITH_ALPHA 0
#endif
#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
class wxStaticBitmap;
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
{
public:
wxGenericColourDialog();
wxGenericColourDialog(wxWindow *parent,
wxColourData *data = NULL);
virtual ~wxGenericColourDialog();
bool Create(wxWindow *parent, wxColourData *data = NULL);
wxColourData &GetColourData() { return m_colourData; }
virtual int ShowModal() wxOVERRIDE;
// Internal functions
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
void OnCustomColourMouseClick(wxMouseEvent& event);
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
virtual void CalculateMeasurements();
virtual void CreateWidgets();
virtual void InitializeColours();
virtual void PaintBasicColours(wxDC& dc);
#if !wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
virtual void PaintCustomColours(wxDC& dc, int clrIndex = -1);
#endif // !wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
virtual void PaintCustomColour(wxDC& dc);
virtual void PaintHighlight(wxDC& dc, bool draw);
virtual void OnBasicColourClick(int which);
virtual void OnCustomColourClick(int which);
void OnAddCustom(wxCommandEvent& event);
#if wxUSE_SLIDER
void OnRedSlider(wxCommandEvent& event);
void OnGreenSlider(wxCommandEvent& event);
void OnBlueSlider(wxCommandEvent& event);
void OnAlphaSlider(wxCommandEvent& event);
#endif // wxUSE_SLIDER
void OnCloseWindow(wxCloseEvent& event);
#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
void DoPreviewBitmap(wxBitmap& bmp, const wxColour& colour);
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
protected:
wxColourData m_colourData;
// Area reserved for grids of colours
wxRect m_standardColoursRect;
wxRect m_customColoursRect;
wxRect m_singleCustomColourRect;
// Size of each colour rectangle
wxSize m_smallRectangleSize;
// Grid spacing (between rectangles)
int m_gridSpacing;
// Section spacing (between left and right halves of dialog box)
int m_sectionSpacing;
// 48 'standard' colours
wxColour m_standardColours[48];
// 16 'custom' colours
wxColour m_customColours[16];
// Which colour is selected? An index into one of the two areas.
int m_colourSelection;
int m_whichKind; // 1 for standard colours, 2 for custom colours,
#if wxUSE_SLIDER
wxSlider *m_redSlider;
wxSlider *m_greenSlider;
wxSlider *m_blueSlider;
wxSlider *m_alphaSlider;
#endif // wxUSE_SLIDER
#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
// Bitmap to preview selected colour (with alpha channel)
wxStaticBitmap *m_customColourBmp;
// Bitmaps to preview custom colours (with alpha channel)
wxStaticBitmap *m_customColoursBmp[16];
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
int m_buttonY;
int m_okButtonX;
int m_customButtonX;
// static bool colourDialogCancelled;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericColourDialog);
};
#endif // _WX_COLORDLGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/grid.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/grid.h
// Purpose: wxGrid and related classes
// 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_H_
#define _WX_GENERIC_GRID_H_
#include "wx/defs.h"
#if wxUSE_GRID
#include "wx/hashmap.h"
#include "wx/scrolwin.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
extern WXDLLIMPEXP_DATA_CORE(const char) wxGridNameStr[];
// Default parameters for wxGrid
//
#define WXGRID_DEFAULT_NUMBER_ROWS 10
#define WXGRID_DEFAULT_NUMBER_COLS 10
#if defined(__WXMSW__) || defined(__WXGTK20__)
#define WXGRID_DEFAULT_ROW_HEIGHT 25
#else
#define WXGRID_DEFAULT_ROW_HEIGHT 30
#endif // __WXMSW__
#define WXGRID_DEFAULT_COL_WIDTH 80
#define WXGRID_DEFAULT_COL_LABEL_HEIGHT 32
#define WXGRID_DEFAULT_ROW_LABEL_WIDTH 82
#define WXGRID_LABEL_EDGE_ZONE 2
#define WXGRID_MIN_ROW_HEIGHT 15
#define WXGRID_MIN_COL_WIDTH 15
#define WXGRID_DEFAULT_SCROLLBAR_WIDTH 16
// type names for grid table values
#define wxGRID_VALUE_STRING wxT("string")
#define wxGRID_VALUE_BOOL wxT("bool")
#define wxGRID_VALUE_NUMBER wxT("long")
#define wxGRID_VALUE_FLOAT wxT("double")
#define wxGRID_VALUE_CHOICE wxT("choice")
#define wxGRID_VALUE_TEXT wxGRID_VALUE_STRING
#define wxGRID_VALUE_LONG wxGRID_VALUE_NUMBER
// magic constant which tells (to some functions) to automatically calculate
// the appropriate size
#define wxGRID_AUTOSIZE (-1)
// many wxGrid methods work either with columns or rows, this enum is used for
// the parameter indicating which one should it be
enum wxGridDirection
{
wxGRID_COLUMN,
wxGRID_ROW
};
// Flags used with wxGrid::Render() to select parts of the grid to draw.
enum wxGridRenderStyle
{
wxGRID_DRAW_ROWS_HEADER = 0x001,
wxGRID_DRAW_COLS_HEADER = 0x002,
wxGRID_DRAW_CELL_LINES = 0x004,
wxGRID_DRAW_BOX_RECT = 0x008,
wxGRID_DRAW_SELECTION = 0x010,
wxGRID_DRAW_DEFAULT = wxGRID_DRAW_ROWS_HEADER |
wxGRID_DRAW_COLS_HEADER |
wxGRID_DRAW_CELL_LINES |
wxGRID_DRAW_BOX_RECT
};
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxGrid;
class WXDLLIMPEXP_FWD_CORE wxGridCellAttr;
class WXDLLIMPEXP_FWD_CORE wxGridCellAttrProviderData;
class WXDLLIMPEXP_FWD_CORE wxGridColLabelWindow;
class WXDLLIMPEXP_FWD_CORE wxGridCornerLabelWindow;
class WXDLLIMPEXP_FWD_CORE wxGridRowLabelWindow;
class WXDLLIMPEXP_FWD_CORE wxGridWindow;
class WXDLLIMPEXP_FWD_CORE wxGridTypeRegistry;
class WXDLLIMPEXP_FWD_CORE wxGridSelection;
class WXDLLIMPEXP_FWD_CORE wxHeaderCtrl;
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxComboBox;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
#if wxUSE_SPINCTRL
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
#endif
class wxGridFixedIndicesSet;
class wxGridOperations;
class wxGridRowOperations;
class wxGridColumnOperations;
class wxGridDirectionOperations;
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
#define wxSafeIncRef(p) if ( p ) (p)->IncRef()
#define wxSafeDecRef(p) if ( p ) (p)->DecRef()
// ----------------------------------------------------------------------------
// wxGridCellWorker: common base class for wxGridCellRenderer and
// wxGridCellEditor
//
// NB: this is more an implementation convenience than a design issue, so this
// class is not documented and is not public at all
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridCellWorker : public wxClientDataContainer, public wxRefCounter
{
public:
wxGridCellWorker() { }
// interpret renderer parameters: arbitrary string whose interpretation is
// left to the derived classes
virtual void SetParameters(const wxString& params);
protected:
// virtual dtor for any base class - private because only DecRef() can
// delete us
virtual ~wxGridCellWorker();
private:
// suppress the stupid gcc warning about the class having private dtor and
// no friends
friend class wxGridCellWorkerDummyFriend;
};
// ----------------------------------------------------------------------------
// wxGridCellRenderer: this class is responsible for actually drawing the cell
// in the grid. You may pass it to the wxGridCellAttr (below) to change the
// format of one given cell or to wxGrid::SetDefaultRenderer() to change the
// view of all cells. This is an ABC, you will normally use one of the
// predefined derived classes or derive your own class from it.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridCellRenderer : public wxGridCellWorker
{
public:
// draw the given cell on the provided DC inside the given rectangle
// using the style specified by the attribute and the default or selected
// state corresponding to the isSelected value.
//
// this pure virtual function has a default implementation which will
// prepare the DC using the given attribute: it will draw the rectangle
// with the bg colour from attr and set the text colour and font
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rect,
int row, int col,
bool isSelected) = 0;
// get the preferred size of the cell for its contents
virtual wxSize GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col) = 0;
// Get the preferred height for a given width. Override this method if the
// renderer computes height as function of its width, as is the case of the
// standard wxGridCellAutoWrapStringRenderer, for example.
// and vice versa
virtual int GetBestHeight(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col,
int WXUNUSED(width))
{
return GetBestSize(grid, attr, dc, row, col).GetHeight();
}
// Get the preferred width for a given height, this is the symmetric
// version of GetBestHeight().
virtual int GetBestWidth(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col,
int WXUNUSED(height))
{
return GetBestSize(grid, attr, dc, row, col).GetWidth();
}
// create a new object which is the copy of this one
virtual wxGridCellRenderer *Clone() const = 0;
};
// ----------------------------------------------------------------------------
// wxGridCellEditor: This class is responsible for providing and manipulating
// the in-place edit controls for the grid. Instances of wxGridCellEditor
// (actually, instances of derived classes since it is an ABC) can be
// associated with the cell attributes for individual cells, rows, columns, or
// even for the entire grid.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridCellEditor : public wxGridCellWorker
{
public:
wxGridCellEditor();
bool IsCreated() const { return m_control != NULL; }
wxControl* GetControl() const { return m_control; }
void SetControl(wxControl* control) { m_control = control; }
wxGridCellAttr* GetCellAttr() const { return m_attr; }
void SetCellAttr(wxGridCellAttr* attr) { m_attr = attr; }
// Creates the actual edit control
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) = 0;
// Size and position the edit control
virtual void SetSize(const wxRect& rect);
// Show or hide the edit control, use the specified attributes to set
// colours/fonts for it
virtual void Show(bool show, wxGridCellAttr *attr = NULL);
// Draws the part of the cell not occupied by the control: the base class
// version just fills it with background colour from the attribute
virtual void PaintBackground(wxDC& dc,
const wxRect& rectCell,
const wxGridCellAttr& attr);
// The methods called by wxGrid when a cell is edited: first BeginEdit() is
// called, then EndEdit() is and if it returns true and if the change is
// not vetoed by a user-defined event handler, finally ApplyEdit() is called
// Fetch the value from the table and prepare the edit control
// to begin editing. Set the focus to the edit control.
virtual void BeginEdit(int row, int col, wxGrid* grid) = 0;
// Returns false if nothing changed, otherwise returns true and return the
// new value in its string form in the newval output parameter.
//
// This should also store the new value in its real type internally so that
// it could be used by ApplyEdit() but it must not modify the grid as the
// change could still be vetoed.
virtual bool EndEdit(int row, int col, const wxGrid *grid,
const wxString& oldval, wxString *newval) = 0;
// Complete the editing of the current cell by storing the value saved by
// the previous call to EndEdit() in the grid
virtual void ApplyEdit(int row, int col, wxGrid* grid) = 0;
// Reset the value in the control back to its starting value
virtual void Reset() = 0;
// return true to allow the given key to start editing: the base class
// version only checks that the event has no modifiers. The derived
// classes are supposed to do "if ( base::IsAcceptedKey() && ... )" in
// their IsAcceptedKey() implementation, although, of course, it is not a
// mandatory requirment.
//
// NB: if the key is F2 (special), editing will always start and this
// method will not be called at all (but StartingKey() will)
virtual bool IsAcceptedKey(wxKeyEvent& event);
// If the editor is enabled by pressing keys on the grid, this will be
// called to let the editor do something about that first key if desired
virtual void StartingKey(wxKeyEvent& event);
// if the editor is enabled by clicking on the cell, this method will be
// called
virtual void StartingClick();
// Some types of controls on some platforms may need some help
// with the Return key.
virtual void HandleReturn(wxKeyEvent& event);
// Final cleanup
virtual void Destroy();
// create a new object which is the copy of this one
virtual wxGridCellEditor *Clone() const = 0;
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const = 0;
protected:
// the dtor is private because only DecRef() can delete us
virtual ~wxGridCellEditor();
// the control we show on screen
wxControl* m_control;
// a temporary pointer to the attribute being edited
wxGridCellAttr* m_attr;
// if we change the colours/font of the control from the default ones, we
// must restore the default later and we save them here between calls to
// Show(true) and Show(false)
wxColour m_colFgOld,
m_colBgOld;
wxFont m_fontOld;
// suppress the stupid gcc warning about the class having private dtor and
// no friends
friend class wxGridCellEditorDummyFriend;
wxDECLARE_NO_COPY_CLASS(wxGridCellEditor);
};
// ----------------------------------------------------------------------------
// wxGridHeaderRenderer and company: like wxGridCellRenderer but for headers
// ----------------------------------------------------------------------------
// Base class for header cells renderers.
class WXDLLIMPEXP_CORE wxGridHeaderLabelsRenderer
{
public:
virtual ~wxGridHeaderLabelsRenderer() {}
// Draw the border around cell window.
virtual void DrawBorder(const wxGrid& grid,
wxDC& dc,
wxRect& rect) const = 0;
// Draw header cell label
virtual void DrawLabel(const wxGrid& grid,
wxDC& dc,
const wxString& value,
const wxRect& rect,
int horizAlign,
int vertAlign,
int textOrientation) const;
};
// Currently the row/column/corner renders don't need any methods other than
// those already in wxGridHeaderLabelsRenderer but still define separate classes
// for them for future extensions and also for better type safety (i.e. to
// avoid inadvertently using a column header renderer for the row headers)
class WXDLLIMPEXP_CORE wxGridRowHeaderRenderer
: public wxGridHeaderLabelsRenderer
{
};
class WXDLLIMPEXP_CORE wxGridColumnHeaderRenderer
: public wxGridHeaderLabelsRenderer
{
};
class WXDLLIMPEXP_CORE wxGridCornerHeaderRenderer
: public wxGridHeaderLabelsRenderer
{
};
// Also define the default renderers which are used by wxGridCellAttrProvider
// by default
class WXDLLIMPEXP_CORE wxGridRowHeaderRendererDefault
: public wxGridRowHeaderRenderer
{
public:
virtual void DrawBorder(const wxGrid& grid,
wxDC& dc,
wxRect& rect) const wxOVERRIDE;
};
// Column header cells renderers
class WXDLLIMPEXP_CORE wxGridColumnHeaderRendererDefault
: public wxGridColumnHeaderRenderer
{
public:
virtual void DrawBorder(const wxGrid& grid,
wxDC& dc,
wxRect& rect) const wxOVERRIDE;
};
// Header corner renderer
class WXDLLIMPEXP_CORE wxGridCornerHeaderRendererDefault
: public wxGridCornerHeaderRenderer
{
public:
virtual void DrawBorder(const wxGrid& grid,
wxDC& dc,
wxRect& rect) const wxOVERRIDE;
};
// ----------------------------------------------------------------------------
// wxGridCellAttr: this class can be used to alter the cells appearance in
// the grid by changing their colour/font/... from default. An object of this
// class may be returned by wxGridTable::GetAttr().
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridCellAttr : public wxClientDataContainer, public wxRefCounter
{
public:
enum wxAttrKind
{
Any,
Default,
Cell,
Row,
Col,
Merged
};
// ctors
wxGridCellAttr(wxGridCellAttr *attrDefault = NULL)
{
Init(attrDefault);
SetAlignment(wxALIGN_INVALID, wxALIGN_INVALID);
}
// VZ: considering the number of members wxGridCellAttr has now, this ctor
// seems to be pretty useless... may be we should just remove it?
wxGridCellAttr(const wxColour& colText,
const wxColour& colBack,
const wxFont& font,
int hAlign,
int vAlign)
: m_colText(colText), m_colBack(colBack), m_font(font)
{
Init();
SetAlignment(hAlign, vAlign);
}
// creates a new copy of this object
wxGridCellAttr *Clone() const;
void MergeWith(wxGridCellAttr *mergefrom);
// setters
void SetTextColour(const wxColour& colText) { m_colText = colText; }
void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
void SetFont(const wxFont& font) { m_font = font; }
void SetAlignment(int hAlign, int vAlign)
{
m_hAlign = hAlign;
m_vAlign = vAlign;
}
void SetSize(int num_rows, int num_cols);
void SetOverflow(bool allow = true)
{ m_overflow = allow ? Overflow : SingleCell; }
void SetReadOnly(bool isReadOnly = true)
{ m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; }
// takes ownership of the pointer
void SetRenderer(wxGridCellRenderer *renderer)
{ wxSafeDecRef(m_renderer); m_renderer = renderer; }
void SetEditor(wxGridCellEditor* editor)
{ wxSafeDecRef(m_editor); m_editor = editor; }
void SetKind(wxAttrKind kind) { m_attrkind = kind; }
// accessors
bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasFont() const { return m_font.IsOk(); }
bool HasAlignment() const
{
return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID;
}
bool HasRenderer() const { return m_renderer != NULL; }
bool HasEditor() const { return m_editor != NULL; }
bool HasReadWriteMode() const { return m_isReadOnly != Unset; }
bool HasOverflowMode() const { return m_overflow != UnsetOverflow; }
bool HasSize() const { return m_sizeRows != 1 || m_sizeCols != 1; }
const wxColour& GetTextColour() const;
const wxColour& GetBackgroundColour() const;
const wxFont& GetFont() const;
void GetAlignment(int *hAlign, int *vAlign) const;
// unlike GetAlignment() which always overwrites its output arguments with
// the alignment values to use, falling back on default alignment if this
// attribute doesn't have any, this function will preserve the values of
// parameters on entry if the corresponding alignment is not set in this
// attribute meaning that they can be initialized to default alignment (and
// also that they must be initialized, unlike with GetAlignment())
void GetNonDefaultAlignment(int *hAlign, int *vAlign) const;
void GetSize(int *num_rows, int *num_cols) const;
bool GetOverflow() const
{ return m_overflow != SingleCell; }
wxGridCellRenderer *GetRenderer(const wxGrid* grid, int row, int col) const;
wxGridCellEditor *GetEditor(const wxGrid* grid, int row, int col) const;
bool IsReadOnly() const { return m_isReadOnly == wxGridCellAttr::ReadOnly; }
wxAttrKind GetKind() { return m_attrkind; }
void SetDefAttr(wxGridCellAttr* defAttr) { m_defGridAttr = defAttr; }
protected:
// the dtor is private because only DecRef() can delete us
virtual ~wxGridCellAttr()
{
wxSafeDecRef(m_renderer);
wxSafeDecRef(m_editor);
}
private:
enum wxAttrReadMode
{
Unset = -1,
ReadWrite,
ReadOnly
};
enum wxAttrOverflowMode
{
UnsetOverflow = -1,
Overflow,
SingleCell
};
// the common part of all ctors
void Init(wxGridCellAttr *attrDefault = NULL);
wxColour m_colText,
m_colBack;
wxFont m_font;
int m_hAlign,
m_vAlign;
int m_sizeRows,
m_sizeCols;
wxAttrOverflowMode m_overflow;
wxGridCellRenderer* m_renderer;
wxGridCellEditor* m_editor;
wxGridCellAttr* m_defGridAttr;
wxAttrReadMode m_isReadOnly;
wxAttrKind m_attrkind;
// use Clone() instead
wxDECLARE_NO_COPY_CLASS(wxGridCellAttr);
// suppress the stupid gcc warning about the class having private dtor and
// no friends
friend class wxGridCellAttrDummyFriend;
};
// ----------------------------------------------------------------------------
// wxGridCellAttrProvider: class used by wxGridTableBase to retrieve/store the
// cell attributes.
// ----------------------------------------------------------------------------
// implementation note: we separate it from wxGridTableBase because we wish to
// avoid deriving a new table class if possible, and sometimes it will be
// enough to just derive another wxGridCellAttrProvider instead
//
// the default implementation is reasonably efficient for the generic case,
// but you might still wish to implement your own for some specific situations
// if you have performance problems with the stock one
class WXDLLIMPEXP_CORE wxGridCellAttrProvider : public wxClientDataContainer
{
public:
wxGridCellAttrProvider();
virtual ~wxGridCellAttrProvider();
// DecRef() must be called on the returned pointer
virtual wxGridCellAttr *GetAttr(int row, int col,
wxGridCellAttr::wxAttrKind kind ) const;
// all these functions take ownership of the pointer, don't call DecRef()
// on it
virtual void SetAttr(wxGridCellAttr *attr, int row, int col);
virtual void SetRowAttr(wxGridCellAttr *attr, int row);
virtual void SetColAttr(wxGridCellAttr *attr, int col);
// these functions must be called whenever some rows/cols are deleted
// because the internal data must be updated then
void UpdateAttrRows( size_t pos, int numRows );
void UpdateAttrCols( size_t pos, int numCols );
// get renderers for the given row/column header label and the corner
// window: unlike cell renderers, these objects are not reference counted
// and are never NULL so they are returned by reference
virtual const wxGridColumnHeaderRenderer& GetColumnHeaderRenderer(int col);
virtual const wxGridRowHeaderRenderer& GetRowHeaderRenderer(int row);
virtual const wxGridCornerHeaderRenderer& GetCornerRenderer();
private:
void InitData();
wxGridCellAttrProviderData *m_data;
wxDECLARE_NO_COPY_CLASS(wxGridCellAttrProvider);
};
// ----------------------------------------------------------------------------
// wxGridCellCoords: location of a cell in the grid
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridCellCoords
{
public:
wxGridCellCoords() { m_row = m_col = -1; }
wxGridCellCoords( int r, int c ) { m_row = r; m_col = c; }
// default copy ctor is ok
int GetRow() const { return m_row; }
void SetRow( int n ) { m_row = n; }
int GetCol() const { return m_col; }
void SetCol( int n ) { m_col = n; }
void Set( int row, int col ) { m_row = row; m_col = col; }
wxGridCellCoords& operator=( const wxGridCellCoords& other )
{
if ( &other != this )
{
m_row=other.m_row;
m_col=other.m_col;
}
return *this;
}
bool operator==( const wxGridCellCoords& other ) const
{
return (m_row == other.m_row && m_col == other.m_col);
}
bool operator!=( const wxGridCellCoords& other ) const
{
return (m_row != other.m_row || m_col != other.m_col);
}
bool operator!() const
{
return (m_row == -1 && m_col == -1 );
}
private:
int m_row;
int m_col;
};
// For comparisons...
//
extern WXDLLIMPEXP_CORE wxGridCellCoords wxGridNoCellCoords;
extern WXDLLIMPEXP_CORE wxRect wxGridNoCellRect;
// An array of cell coords...
//
WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellCoords, wxGridCellCoordsArray,
class WXDLLIMPEXP_CORE);
// ----------------------------------------------------------------------------
// Grid table classes
// ----------------------------------------------------------------------------
// the abstract base class
class WXDLLIMPEXP_CORE wxGridTableBase : public wxObject,
public wxClientDataContainer
{
public:
wxGridTableBase();
virtual ~wxGridTableBase();
// You must override these functions in a derived table class
//
// return the number of rows and columns in this table
virtual int GetNumberRows() = 0;
virtual int GetNumberCols() = 0;
// the methods above are unfortunately non-const even though they should
// have been const -- but changing it now is not possible any longer as it
// would break the existing code overriding them, so instead we provide
// these const synonyms which can be used from const-correct code
int GetRowsCount() const
{ return const_cast<wxGridTableBase *>(this)->GetNumberRows(); }
int GetColsCount() const
{ return const_cast<wxGridTableBase *>(this)->GetNumberCols(); }
virtual bool IsEmptyCell( int row, int col )
{
return GetValue(row, col).empty();
}
bool IsEmpty(const wxGridCellCoords& coord)
{
return IsEmptyCell(coord.GetRow(), coord.GetCol());
}
virtual wxString GetValue( int row, int col ) = 0;
virtual void SetValue( int row, int col, const wxString& value ) = 0;
// Data type determination and value access
virtual wxString GetTypeName( int row, int col );
virtual bool CanGetValueAs( int row, int col, const wxString& typeName );
virtual bool CanSetValueAs( int row, int col, const wxString& typeName );
virtual long GetValueAsLong( int row, int col );
virtual double GetValueAsDouble( int row, int col );
virtual bool GetValueAsBool( int row, int col );
virtual void SetValueAsLong( int row, int col, long value );
virtual void SetValueAsDouble( int row, int col, double value );
virtual void SetValueAsBool( int row, int col, bool value );
// For user defined types
virtual void* GetValueAsCustom( int row, int col, const wxString& typeName );
virtual void SetValueAsCustom( int row, int col, const wxString& typeName, void* value );
// Overriding these is optional
//
virtual void SetView( wxGrid *grid ) { m_view = grid; }
virtual wxGrid * GetView() const { return m_view; }
virtual void Clear() {}
virtual bool InsertRows( size_t pos = 0, size_t numRows = 1 );
virtual bool AppendRows( size_t numRows = 1 );
virtual bool DeleteRows( size_t pos = 0, size_t numRows = 1 );
virtual bool InsertCols( size_t pos = 0, size_t numCols = 1 );
virtual bool AppendCols( size_t numCols = 1 );
virtual bool DeleteCols( size_t pos = 0, size_t numCols = 1 );
virtual wxString GetRowLabelValue( int row );
virtual wxString GetColLabelValue( int col );
virtual wxString GetCornerLabelValue() const;
virtual void SetRowLabelValue( int WXUNUSED(row), const wxString& ) {}
virtual void SetColLabelValue( int WXUNUSED(col), const wxString& ) {}
virtual void SetCornerLabelValue( const wxString& ) {}
// Attribute handling
//
// give us the attr provider to use - we take ownership of the pointer
void SetAttrProvider(wxGridCellAttrProvider *attrProvider);
// get the currently used attr provider (may be NULL)
wxGridCellAttrProvider *GetAttrProvider() const { return m_attrProvider; }
// Does this table allow attributes? Default implementation creates
// a wxGridCellAttrProvider if necessary.
virtual bool CanHaveAttributes();
// by default forwarded to wxGridCellAttrProvider if any. May be
// overridden to handle attributes directly in the table.
virtual wxGridCellAttr *GetAttr( int row, int col,
wxGridCellAttr::wxAttrKind kind );
// these functions take ownership of the pointer
virtual void SetAttr(wxGridCellAttr* attr, int row, int col);
virtual void SetRowAttr(wxGridCellAttr *attr, int row);
virtual void SetColAttr(wxGridCellAttr *attr, int col);
private:
wxGrid * m_view;
wxGridCellAttrProvider *m_attrProvider;
wxDECLARE_ABSTRACT_CLASS(wxGridTableBase);
wxDECLARE_NO_COPY_CLASS(wxGridTableBase);
};
// ----------------------------------------------------------------------------
// wxGridTableMessage
// ----------------------------------------------------------------------------
// IDs for messages sent from grid table to view
//
enum wxGridTableRequest
{
// The first two requests never did anything, simply don't use them.
#if WXWIN_COMPATIBILITY_3_0
wxGRIDTABLE_REQUEST_VIEW_GET_VALUES = 2000,
wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES,
#endif // WXWIN_COMPATIBILITY_3_0
wxGRIDTABLE_NOTIFY_ROWS_INSERTED = 2002,
wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
wxGRIDTABLE_NOTIFY_ROWS_DELETED,
wxGRIDTABLE_NOTIFY_COLS_INSERTED,
wxGRIDTABLE_NOTIFY_COLS_APPENDED,
wxGRIDTABLE_NOTIFY_COLS_DELETED
};
class WXDLLIMPEXP_CORE wxGridTableMessage
{
public:
wxGridTableMessage();
wxGridTableMessage( wxGridTableBase *table, int id,
int comInt1 = -1,
int comInt2 = -1 );
void SetTableObject( wxGridTableBase *table ) { m_table = table; }
wxGridTableBase * GetTableObject() const { return m_table; }
void SetId( int id ) { m_id = id; }
int GetId() { return m_id; }
void SetCommandInt( int comInt1 ) { m_comInt1 = comInt1; }
int GetCommandInt() { return m_comInt1; }
void SetCommandInt2( int comInt2 ) { m_comInt2 = comInt2; }
int GetCommandInt2() { return m_comInt2; }
private:
wxGridTableBase *m_table;
int m_id;
int m_comInt1;
int m_comInt2;
wxDECLARE_NO_COPY_CLASS(wxGridTableMessage);
};
// ------ wxGridStringArray
// A 2-dimensional array of strings for data values
//
WX_DECLARE_OBJARRAY_WITH_DECL(wxArrayString, wxGridStringArray,
class WXDLLIMPEXP_CORE);
// ------ wxGridStringTable
//
// Simplest type of data table for a grid for small tables of strings
// that are stored in memory
//
class WXDLLIMPEXP_CORE wxGridStringTable : public wxGridTableBase
{
public:
wxGridStringTable();
wxGridStringTable( int numRows, int numCols );
// these are pure virtual in wxGridTableBase
//
virtual int GetNumberRows() wxOVERRIDE { return static_cast<int>(m_data.size()); }
virtual int GetNumberCols() wxOVERRIDE { return m_numCols; }
virtual wxString GetValue( int row, int col ) wxOVERRIDE;
virtual void SetValue( int row, int col, const wxString& s ) wxOVERRIDE;
// overridden functions from wxGridTableBase
//
void Clear() wxOVERRIDE;
bool InsertRows( size_t pos = 0, size_t numRows = 1 ) wxOVERRIDE;
bool AppendRows( size_t numRows = 1 ) wxOVERRIDE;
bool DeleteRows( size_t pos = 0, size_t numRows = 1 ) wxOVERRIDE;
bool InsertCols( size_t pos = 0, size_t numCols = 1 ) wxOVERRIDE;
bool AppendCols( size_t numCols = 1 ) wxOVERRIDE;
bool DeleteCols( size_t pos = 0, size_t numCols = 1 ) wxOVERRIDE;
void SetRowLabelValue( int row, const wxString& ) wxOVERRIDE;
void SetColLabelValue( int col, const wxString& ) wxOVERRIDE;
void SetCornerLabelValue( const wxString& ) wxOVERRIDE;
wxString GetRowLabelValue( int row ) wxOVERRIDE;
wxString GetColLabelValue( int col ) wxOVERRIDE;
wxString GetCornerLabelValue() const wxOVERRIDE;
private:
wxGridStringArray m_data;
// notice that while we don't need to store the number of our rows as it's
// always equal to the size of m_data array, we do need to store the number
// of our columns as we can't retrieve it from m_data when the number of
// rows is 0 (see #10818)
int m_numCols;
// These only get used if you set your own labels, otherwise the
// GetRow/ColLabelValue functions return wxGridTableBase defaults
//
wxArrayString m_rowLabels;
wxArrayString m_colLabels;
wxString m_cornerLabel;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGridStringTable);
};
// ============================================================================
// Grid view classes
// ============================================================================
// ----------------------------------------------------------------------------
// wxGridSizesInfo stores information about sizes of the rows or columns.
//
// It assumes that most of the columns or rows have default size and so stores
// the default size separately and uses a hash to map column or row numbers to
// their non default size for those which don't have the default size.
// ----------------------------------------------------------------------------
// hash map to store positions as the keys and sizes as the values
WX_DECLARE_HASH_MAP_WITH_DECL( unsigned, int, wxIntegerHash, wxIntegerEqual,
wxUnsignedToIntHashMap, class WXDLLIMPEXP_CORE );
struct WXDLLIMPEXP_CORE wxGridSizesInfo
{
// default ctor, initialize m_sizeDefault and m_customSizes later
wxGridSizesInfo() { }
// ctor used by wxGrid::Get{Col,Row}Sizes()
wxGridSizesInfo(int defSize, const wxArrayInt& allSizes);
// default copy ctor, assignment operator and dtor are ok
// Get the size of the element with the given index
int GetSize(unsigned pos) const;
// default size
int m_sizeDefault;
// position -> size map containing all elements with non-default size
wxUnsignedToIntHashMap m_customSizes;
};
// ----------------------------------------------------------------------------
// wxGrid
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGrid : public wxScrolledWindow
{
public:
// possible selection modes
enum wxGridSelectionModes
{
wxGridSelectCells = 0, // allow selecting anything
wxGridSelectRows = 1, // allow selecting only entire rows
wxGridSelectColumns = 2, // allow selecting only entire columns
wxGridSelectRowsOrColumns = wxGridSelectRows | wxGridSelectColumns
};
// Different behaviour of the TAB key when the end (or the beginning, for
// Shift-TAB) of the current row is reached:
enum TabBehaviour
{
Tab_Stop, // Do nothing, this is default.
Tab_Wrap, // Move to the next (or previous) row.
Tab_Leave // Move to the next (or previous) control.
};
// creation and destruction
// ------------------------
// ctor and Create() create the grid window, as with the other controls
wxGrid() { Init(); }
wxGrid(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxWANTS_CHARS,
const wxString& name = wxGridNameStr)
{
Init();
Create(parent, id, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxWANTS_CHARS,
const wxString& name = wxGridNameStr);
virtual ~wxGrid();
// however to initialize grid data either CreateGrid() or SetTable() must
// be also called
// this is basically equivalent to
//
// SetTable(new wxGridStringTable(numRows, numCols), true, selmode)
//
bool CreateGrid( int numRows, int numCols,
wxGridSelectionModes selmode = wxGridSelectCells );
bool SetTable( wxGridTableBase *table,
bool takeOwnership = false,
wxGridSelectionModes selmode = wxGridSelectCells );
bool ProcessTableMessage(wxGridTableMessage&);
wxGridTableBase *GetTable() const { return m_table; }
void SetSelectionMode(wxGridSelectionModes selmode);
wxGridSelectionModes GetSelectionMode() const;
// ------ grid dimensions
//
int GetNumberRows() const { return m_numRows; }
int GetNumberCols() const { return m_numCols; }
// ------ display update functions
//
wxArrayInt CalcRowLabelsExposed( const wxRegion& reg ) const;
wxArrayInt CalcColLabelsExposed( const wxRegion& reg ) const;
wxGridCellCoordsArray CalcCellsExposed( const wxRegion& reg ) const;
void ClearGrid();
bool InsertRows(int pos = 0, int numRows = 1, bool updateLabels = true)
{
return DoModifyLines(&wxGridTableBase::InsertRows,
pos, numRows, updateLabels);
}
bool InsertCols(int pos = 0, int numCols = 1, bool updateLabels = true)
{
return DoModifyLines(&wxGridTableBase::InsertCols,
pos, numCols, updateLabels);
}
bool AppendRows(int numRows = 1, bool updateLabels = true)
{
return DoAppendLines(&wxGridTableBase::AppendRows, numRows, updateLabels);
}
bool AppendCols(int numCols = 1, bool updateLabels = true)
{
return DoAppendLines(&wxGridTableBase::AppendCols, numCols, updateLabels);
}
bool DeleteRows(int pos = 0, int numRows = 1, bool updateLabels = true)
{
return DoModifyLines(&wxGridTableBase::DeleteRows,
pos, numRows, updateLabels);
}
bool DeleteCols(int pos = 0, int numCols = 1, bool updateLabels = true)
{
return DoModifyLines(&wxGridTableBase::DeleteCols,
pos, numCols, updateLabels);
}
void DrawGridCellArea( wxDC& dc , const wxGridCellCoordsArray& cells );
void DrawGridSpace( wxDC& dc );
void DrawCellBorder( wxDC& dc, const wxGridCellCoords& );
void DrawAllGridLines( wxDC& dc, const wxRegion & reg );
void DrawCell( wxDC& dc, const wxGridCellCoords& );
void DrawHighlight(wxDC& dc, const wxGridCellCoordsArray& cells);
// this function is called when the current cell highlight must be redrawn
// and may be overridden by the user
virtual void DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr );
virtual void DrawRowLabels( wxDC& dc, const wxArrayInt& rows );
virtual void DrawRowLabel( wxDC& dc, int row );
virtual void DrawColLabels( wxDC& dc, const wxArrayInt& cols );
virtual void DrawColLabel( wxDC& dc, int col );
virtual void DrawCornerLabel(wxDC& dc);
// ------ Cell text drawing functions
//
void DrawTextRectangle( wxDC& dc, const wxString&, const wxRect&,
int horizontalAlignment = wxALIGN_LEFT,
int verticalAlignment = wxALIGN_TOP,
int textOrientation = wxHORIZONTAL ) const;
void DrawTextRectangle( wxDC& dc, const wxArrayString& lines, const wxRect&,
int horizontalAlignment = wxALIGN_LEFT,
int verticalAlignment = wxALIGN_TOP,
int textOrientation = wxHORIZONTAL ) const;
// ------ grid render function for printing
//
void Render( wxDC& dc,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxGridCellCoords& topLeft = wxGridCellCoords(-1, -1),
const wxGridCellCoords& bottomRight = wxGridCellCoords(-1, -1),
int style = wxGRID_DRAW_DEFAULT );
// Split a string containing newline characters into an array of
// strings and return the number of lines
//
void StringToLines( const wxString& value, wxArrayString& lines ) const;
void GetTextBoxSize( const wxDC& dc,
const wxArrayString& lines,
long *width, long *height ) const;
// ------
// Code that does a lot of grid modification can be enclosed
// between BeginBatch() and EndBatch() calls to avoid screen
// flicker
//
void BeginBatch() { m_batchCount++; }
void EndBatch();
int GetBatchCount() { return m_batchCount; }
virtual void Refresh(bool eraseb = true, const wxRect* rect = NULL) wxOVERRIDE;
// Use this, rather than wxWindow::Refresh(), to force an
// immediate repainting of the grid. Has no effect if you are
// already inside a BeginBatch / EndBatch block.
//
// This function is necessary because wxGrid has a minimal OnPaint()
// handler to reduce screen flicker.
//
void ForceRefresh();
// ------ edit control functions
//
bool IsEditable() const { return m_editable; }
void EnableEditing( bool edit );
void EnableCellEditControl( bool enable = true );
void DisableCellEditControl() { EnableCellEditControl(false); }
bool CanEnableCellControl() const;
bool IsCellEditControlEnabled() const;
bool IsCellEditControlShown() const;
bool IsCurrentCellReadOnly() const;
void ShowCellEditControl();
void HideCellEditControl();
void SaveEditControlValue();
// ------ grid location functions
// Note that all of these functions work with the logical coordinates of
// grid cells and labels so you will need to convert from device
// coordinates for mouse events etc.
//
wxGridCellCoords XYToCell(int x, int y) const;
void XYToCell(int x, int y, wxGridCellCoords& coords) const
{ coords = XYToCell(x, y); }
wxGridCellCoords XYToCell(const wxPoint& pos) const
{ return XYToCell(pos.x, pos.y); }
// these functions return the index of the row/columns corresponding to the
// given logical position in pixels
//
// if clipToMinMax is false (default, wxNOT_FOUND is returned if the
// position is outside any row/column, otherwise the first/last element is
// returned in this case
int YToRow( int y, bool clipToMinMax = false ) const;
int XToCol( int x, bool clipToMinMax = false ) const;
int YToEdgeOfRow( int y ) const;
int XToEdgeOfCol( int x ) const;
wxRect CellToRect( int row, int col ) const;
wxRect CellToRect( const wxGridCellCoords& coords ) const
{ return CellToRect( coords.GetRow(), coords.GetCol() ); }
int GetGridCursorRow() const { return m_currentCellCoords.GetRow(); }
int GetGridCursorCol() const { return m_currentCellCoords.GetCol(); }
// check to see if a cell is either wholly visible (the default arg) or
// at least partially visible in the grid window
//
bool IsVisible( int row, int col, bool wholeCellVisible = true ) const;
bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = true ) const
{ return IsVisible( coords.GetRow(), coords.GetCol(), wholeCellVisible ); }
void MakeCellVisible( int row, int col );
void MakeCellVisible( const wxGridCellCoords& coords )
{ MakeCellVisible( coords.GetRow(), coords.GetCol() ); }
// ------ grid cursor movement functions
//
void SetGridCursor(int row, int col) { SetCurrentCell(row, col); }
void SetGridCursor(const wxGridCellCoords& c) { SetCurrentCell(c); }
void GoToCell(int row, int col)
{
if ( SetCurrentCell(row, col) )
MakeCellVisible(row, col);
}
void GoToCell(const wxGridCellCoords& coords)
{
if ( SetCurrentCell(coords) )
MakeCellVisible(coords);
}
bool MoveCursorUp( bool expandSelection );
bool MoveCursorDown( bool expandSelection );
bool MoveCursorLeft( bool expandSelection );
bool MoveCursorRight( bool expandSelection );
bool MovePageDown();
bool MovePageUp();
bool MoveCursorUpBlock( bool expandSelection );
bool MoveCursorDownBlock( bool expandSelection );
bool MoveCursorLeftBlock( bool expandSelection );
bool MoveCursorRightBlock( bool expandSelection );
void SetTabBehaviour(TabBehaviour behaviour) { m_tabBehaviour = behaviour; }
// ------ label and gridline formatting
//
int GetDefaultRowLabelSize() const { return WXGRID_DEFAULT_ROW_LABEL_WIDTH; }
int GetRowLabelSize() const { return m_rowLabelWidth; }
int GetDefaultColLabelSize() const { return WXGRID_DEFAULT_COL_LABEL_HEIGHT; }
int GetColLabelSize() const { return m_colLabelHeight; }
wxColour GetLabelBackgroundColour() const { return m_labelBackgroundColour; }
wxColour GetLabelTextColour() const { return m_labelTextColour; }
wxFont GetLabelFont() const { return m_labelFont; }
void GetRowLabelAlignment( int *horiz, int *vert ) const;
void GetColLabelAlignment( int *horiz, int *vert ) const;
void GetCornerLabelAlignment( int *horiz, int *vert ) const;
int GetColLabelTextOrientation() const;
int GetCornerLabelTextOrientation() const;
wxString GetRowLabelValue( int row ) const;
wxString GetColLabelValue( int col ) const;
wxString GetCornerLabelValue() const;
wxColour GetCellHighlightColour() const { return m_cellHighlightColour; }
int GetCellHighlightPenWidth() const { return m_cellHighlightPenWidth; }
int GetCellHighlightROPenWidth() const { return m_cellHighlightROPenWidth; }
// this one will use wxHeaderCtrl for the column labels
void UseNativeColHeader(bool native = true);
// this one will still draw them manually but using the native renderer
// instead of using the same appearance as for the row labels
void SetUseNativeColLabels( bool native = true );
void SetRowLabelSize( int width );
void SetColLabelSize( int height );
void HideRowLabels() { SetRowLabelSize( 0 ); }
void HideColLabels() { SetColLabelSize( 0 ); }
void SetLabelBackgroundColour( const wxColour& );
void SetLabelTextColour( const wxColour& );
void SetLabelFont( const wxFont& );
void SetRowLabelAlignment( int horiz, int vert );
void SetColLabelAlignment( int horiz, int vert );
void SetCornerLabelAlignment( int horiz, int vert );
void SetColLabelTextOrientation( int textOrientation );
void SetCornerLabelTextOrientation( int textOrientation );
void SetRowLabelValue( int row, const wxString& );
void SetColLabelValue( int col, const wxString& );
void SetCornerLabelValue( const wxString& );
void SetCellHighlightColour( const wxColour& );
void SetCellHighlightPenWidth(int width);
void SetCellHighlightROPenWidth(int width);
// interactive grid mouse operations control
// -----------------------------------------
// functions globally enabling row/column interactive resizing (enabled by
// default)
void EnableDragRowSize( bool enable = true );
void DisableDragRowSize() { EnableDragRowSize( false ); }
void EnableDragColSize( bool enable = true );
void DisableDragColSize() { EnableDragColSize( false ); }
// if interactive resizing is enabled, some rows/columns can still have
// fixed size
void DisableRowResize(int row) { DoDisableLineResize(row, m_setFixedRows); }
void DisableColResize(int col) { DoDisableLineResize(col, m_setFixedCols); }
// these functions return whether the given row/column can be
// effectively resized: for this interactive resizing must be enabled
// and this index must not have been passed to DisableRow/ColResize()
bool CanDragRowSize(int row) const
{ return m_canDragRowSize && DoCanResizeLine(row, m_setFixedRows); }
bool CanDragColSize(int col) const
{ return m_canDragColSize && DoCanResizeLine(col, m_setFixedCols); }
// interactive column reordering (disabled by default)
void EnableDragColMove( bool enable = true );
void DisableDragColMove() { EnableDragColMove( false ); }
bool CanDragColMove() const { return m_canDragColMove; }
// interactive resizing of grid cells (enabled by default)
void EnableDragGridSize(bool enable = true);
void DisableDragGridSize() { EnableDragGridSize(false); }
bool CanDragGridSize() const { return m_canDragGridSize; }
// interactive dragging of cells (disabled by default)
void EnableDragCell( bool enable = true );
void DisableDragCell() { EnableDragCell( false ); }
bool CanDragCell() const { return m_canDragCell; }
// grid lines
// ----------
// enable or disable drawing of the lines
void EnableGridLines(bool enable = true);
bool GridLinesEnabled() const { return m_gridLinesEnabled; }
// by default grid lines stop at last column/row, but this may be changed
void ClipHorzGridLines(bool clip)
{ DoClipGridLines(m_gridLinesClipHorz, clip); }
void ClipVertGridLines(bool clip)
{ DoClipGridLines(m_gridLinesClipVert, clip); }
bool AreHorzGridLinesClipped() const { return m_gridLinesClipHorz; }
bool AreVertGridLinesClipped() const { return m_gridLinesClipVert; }
// this can be used to change the global grid lines colour
void SetGridLineColour(const wxColour& col);
wxColour GetGridLineColour() const { return m_gridLineColour; }
// these methods may be overridden to customize individual grid lines
// appearance
virtual wxPen GetDefaultGridLinePen();
virtual wxPen GetRowGridLinePen(int row);
virtual wxPen GetColGridLinePen(int col);
// attributes
// ----------
// this sets the specified attribute for this cell or in this row/col
void SetAttr(int row, int col, wxGridCellAttr *attr);
void SetRowAttr(int row, wxGridCellAttr *attr);
void SetColAttr(int col, wxGridCellAttr *attr);
// the grid can cache attributes for the recently used cells (currently it
// only caches one attribute for the most recently used one) and might
// notice that its value in the attribute provider has changed -- if this
// happens, call this function to force it
void RefreshAttr(int row, int col);
// returns the attribute we may modify in place: a new one if this cell
// doesn't have any yet or the existing one if it does
//
// DecRef() must be called on the returned pointer, as usual
wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
// shortcuts for setting the column parameters
// set the format for the data in the column: default is string
void SetColFormatBool(int col);
void SetColFormatNumber(int col);
void SetColFormatFloat(int col, int width = -1, int precision = -1);
void SetColFormatCustom(int col, const wxString& typeName);
// ------ row and col formatting
//
int GetDefaultRowSize() const;
int GetRowSize( int row ) const;
bool IsRowShown(int row) const { return GetRowSize(row) != 0; }
int GetDefaultColSize() const;
int GetColSize( int col ) const;
bool IsColShown(int col) const { return GetColSize(col) != 0; }
wxColour GetDefaultCellBackgroundColour() const;
wxColour GetCellBackgroundColour( int row, int col ) const;
wxColour GetDefaultCellTextColour() const;
wxColour GetCellTextColour( int row, int col ) const;
wxFont GetDefaultCellFont() const;
wxFont GetCellFont( int row, int col ) const;
void GetDefaultCellAlignment( int *horiz, int *vert ) const;
void GetCellAlignment( int row, int col, int *horiz, int *vert ) const;
bool GetDefaultCellOverflow() const;
bool GetCellOverflow( int row, int col ) const;
// this function returns 1 in num_rows and num_cols for normal cells,
// positive numbers for a cell spanning multiple columns/rows (as set with
// SetCellSize()) and _negative_ numbers corresponding to the offset of the
// top left cell of the span from this one for the other cells covered by
// this cell
//
// the return value is CellSpan_None, CellSpan_Main or CellSpan_Inside for
// each of these cases respectively
enum CellSpan
{
CellSpan_Inside = -1,
CellSpan_None = 0,
CellSpan_Main
};
CellSpan GetCellSize( int row, int col, int *num_rows, int *num_cols ) const;
wxSize GetCellSize(const wxGridCellCoords& coords)
{
wxSize s;
GetCellSize(coords.GetRow(), coords.GetCol(), &s.x, &s.y);
return s;
}
// ------ row and col sizes
void SetDefaultRowSize( int height, bool resizeExistingRows = false );
void SetRowSize( int row, int height );
void HideRow(int row) { DoSetRowSize(row, 0); }
void ShowRow(int row) { DoSetRowSize(row, -1); }
void SetDefaultColSize( int width, bool resizeExistingCols = false );
void SetColSize( int col, int width );
void HideCol(int col) { DoSetColSize(col, 0); }
void ShowCol(int col) { DoSetColSize(col, -1); }
// the row and column sizes can be also set all at once using
// wxGridSizesInfo which holds all of them at once
wxGridSizesInfo GetColSizes() const
{ return wxGridSizesInfo(GetDefaultColSize(), m_colWidths); }
wxGridSizesInfo GetRowSizes() const
{ return wxGridSizesInfo(GetDefaultRowSize(), m_rowHeights); }
void SetColSizes(const wxGridSizesInfo& sizeInfo);
void SetRowSizes(const wxGridSizesInfo& sizeInfo);
// ------- columns (only, for now) reordering
// columns index <-> positions mapping: by default, the position of the
// column is the same as its index, but the columns can also be reordered
// (either by calling SetColPos() explicitly or by the user dragging the
// columns around) in which case their indices don't correspond to their
// positions on display any longer
//
// internally we always work with indices except for the functions which
// have "Pos" in their names (and which work with columns, not pixels) and
// only the display and hit testing code really cares about display
// positions at all
// set the positions of all columns at once (this method uses the same
// conventions as wxHeaderCtrl::SetColumnsOrder() for the order array)
void SetColumnsOrder(const wxArrayInt& order);
// return the column index corresponding to the given (valid) position
int GetColAt(int pos) const
{
return m_colAt.empty() ? pos : m_colAt[pos];
}
// reorder the columns so that the column with the given index is now shown
// as the position pos
void SetColPos(int idx, int pos);
// return the position at which the column with the given index is
// displayed: notice that this is a slow operation as we don't maintain the
// reverse mapping currently
int GetColPos(int idx) const
{
if ( m_colAt.IsEmpty() )
return idx;
int pos = m_colAt.Index(idx);
wxASSERT_MSG( pos != wxNOT_FOUND, "invalid column index" );
return pos;
}
// reset the columns positions to the default order
void ResetColPos();
// automatically size the column or row to fit to its contents, if
// setAsMin is true, this optimal width will also be set as minimal width
// for this column
void AutoSizeColumn( int col, bool setAsMin = true )
{ AutoSizeColOrRow(col, setAsMin, wxGRID_COLUMN); }
void AutoSizeRow( int row, bool setAsMin = true )
{ AutoSizeColOrRow(row, setAsMin, wxGRID_ROW); }
// auto size all columns (very ineffective for big grids!)
void AutoSizeColumns( bool setAsMin = true )
{ (void)SetOrCalcColumnSizes(false, setAsMin); }
void AutoSizeRows( bool setAsMin = true )
{ (void)SetOrCalcRowSizes(false, setAsMin); }
// auto size the grid, that is make the columns/rows of the "right" size
// and also set the grid size to just fit its contents
void AutoSize();
// Note for both AutoSizeRowLabelSize and AutoSizeColLabelSize:
// If col equals to wxGRID_AUTOSIZE value then function autosizes labels column
// instead of data column. Note that this operation may be slow for large
// tables.
// autosize row height depending on label text
void AutoSizeRowLabelSize( int row );
// autosize column width depending on label text
void AutoSizeColLabelSize( int col );
// column won't be resized to be lesser width - this must be called during
// the grid creation because it won't resize the column if it's already
// narrower than the minimal width
void SetColMinimalWidth( int col, int width );
void SetRowMinimalHeight( int row, int width );
/* These members can be used to query and modify the minimal
* acceptable size of grid rows and columns. Call this function in
* your code which creates the grid if you want to display cells
* with a size smaller than the default acceptable minimum size.
* Like the members SetColMinimalWidth and SetRowMinimalWidth,
* the existing rows or columns will not be checked/resized.
*/
void SetColMinimalAcceptableWidth( int width );
void SetRowMinimalAcceptableHeight( int width );
int GetColMinimalAcceptableWidth() const;
int GetRowMinimalAcceptableHeight() const;
void SetDefaultCellBackgroundColour( const wxColour& );
void SetCellBackgroundColour( int row, int col, const wxColour& );
void SetDefaultCellTextColour( const wxColour& );
void SetCellTextColour( int row, int col, const wxColour& );
void SetDefaultCellFont( const wxFont& );
void SetCellFont( int row, int col, const wxFont& );
void SetDefaultCellAlignment( int horiz, int vert );
void SetCellAlignment( int row, int col, int horiz, int vert );
void SetDefaultCellOverflow( bool allow );
void SetCellOverflow( int row, int col, bool allow );
void SetCellSize( int row, int col, int num_rows, int num_cols );
// takes ownership of the pointer
void SetDefaultRenderer(wxGridCellRenderer *renderer);
void SetCellRenderer(int row, int col, wxGridCellRenderer *renderer);
wxGridCellRenderer *GetDefaultRenderer() const;
wxGridCellRenderer* GetCellRenderer(int row, int col) const;
// takes ownership of the pointer
void SetDefaultEditor(wxGridCellEditor *editor);
void SetCellEditor(int row, int col, wxGridCellEditor *editor);
wxGridCellEditor *GetDefaultEditor() const;
wxGridCellEditor* GetCellEditor(int row, int col) const;
// ------ cell value accessors
//
wxString GetCellValue( int row, int col ) const
{
if ( m_table )
{
return m_table->GetValue( row, col );
}
else
{
return wxEmptyString;
}
}
wxString GetCellValue( const wxGridCellCoords& coords ) const
{ return GetCellValue( coords.GetRow(), coords.GetCol() ); }
void SetCellValue( int row, int col, const wxString& s );
void SetCellValue( const wxGridCellCoords& coords, const wxString& s )
{ SetCellValue( coords.GetRow(), coords.GetCol(), s ); }
// returns true if the cell can't be edited
bool IsReadOnly(int row, int col) const;
// make the cell editable/readonly
void SetReadOnly(int row, int col, bool isReadOnly = true);
// ------ select blocks of cells
//
void SelectRow( int row, bool addToSelected = false );
void SelectCol( int col, bool addToSelected = false );
void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
bool addToSelected = false );
void SelectBlock( const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
bool addToSelected = false )
{ SelectBlock( topLeft.GetRow(), topLeft.GetCol(),
bottomRight.GetRow(), bottomRight.GetCol(),
addToSelected ); }
void SelectAll();
bool IsSelection() const;
// ------ deselect blocks or cells
//
void DeselectRow( int row );
void DeselectCol( int col );
void DeselectCell( int row, int col );
void ClearSelection();
bool IsInSelection( int row, int col ) const;
bool IsInSelection( const wxGridCellCoords& coords ) const
{ return IsInSelection( coords.GetRow(), coords.GetCol() ); }
wxGridCellCoordsArray GetSelectedCells() const;
wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
wxArrayInt GetSelectedRows() const;
wxArrayInt GetSelectedCols() const;
// This function returns the rectangle that encloses the block of cells
// limited by TopLeft and BottomRight cell in device coords and clipped
// to the client size of the grid window.
//
wxRect BlockToDeviceRect( const wxGridCellCoords & topLeft,
const wxGridCellCoords & bottomRight ) const;
// Access or update the selection fore/back colours
wxColour GetSelectionBackground() const
{ return m_selectionBackground; }
wxColour GetSelectionForeground() const
{ return m_selectionForeground; }
void SetSelectionBackground(const wxColour& c) { m_selectionBackground = c; }
void SetSelectionForeground(const wxColour& c) { m_selectionForeground = c; }
// Methods for a registry for mapping data types to Renderers/Editors
void RegisterDataType(const wxString& typeName,
wxGridCellRenderer* renderer,
wxGridCellEditor* editor);
// DJC MAPTEK
virtual wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const;
wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c) const
{ return GetDefaultEditorForCell(c.GetRow(), c.GetCol()); }
virtual wxGridCellRenderer* GetDefaultRendererForCell(int row, int col) const;
virtual wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName) const;
virtual wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const;
// grid may occupy more space than needed for its rows/columns, this
// function allows to set how big this extra space is
void SetMargins(int extraWidth, int extraHeight)
{
m_extraWidth = extraWidth;
m_extraHeight = extraHeight;
CalcDimensions();
}
// Accessors for component windows
wxWindow* GetGridWindow() const { return (wxWindow*)m_gridWin; }
wxWindow* GetGridRowLabelWindow() const { return (wxWindow*)m_rowLabelWin; }
wxWindow* GetGridColLabelWindow() const { return m_colWindow; }
wxWindow* GetGridCornerLabelWindow() const { return (wxWindow*)m_cornerLabelWin; }
// This one can only be called if we are using the native header window
wxHeaderCtrl *GetGridColHeader() const
{
wxASSERT_MSG( m_useNativeHeader, "no column header window" );
// static_cast<> doesn't work without the full class declaration in
// view and we prefer to avoid adding more compile-time dependencies
// even at the cost of using reinterpret_cast<>
return reinterpret_cast<wxHeaderCtrl *>(m_colWindow);
}
// Allow adjustment of scroll increment. The default is (15, 15).
void SetScrollLineX(int x) { m_xScrollPixelsPerLine = x; }
void SetScrollLineY(int y) { m_yScrollPixelsPerLine = y; }
int GetScrollLineX() const { return m_xScrollPixelsPerLine; }
int GetScrollLineY() const { return m_yScrollPixelsPerLine; }
// ------- drag and drop
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget(wxDropTarget *dropTarget) wxOVERRIDE;
#endif // wxUSE_DRAG_AND_DROP
// ------- sorting support
// wxGrid doesn't support sorting on its own but it can indicate the sort
// order in the column header (currently only if native header control is
// used though)
// return the column currently displaying the sort indicator or wxNOT_FOUND
// if none
int GetSortingColumn() const { return m_sortCol; }
// return true if this column is currently used for sorting
bool IsSortingBy(int col) const { return GetSortingColumn() == col; }
// return the current sorting order (on GetSortingColumn()): true for
// ascending sort and false for descending; it doesn't make sense to call
// it if GetSortingColumn() returns wxNOT_FOUND
bool IsSortOrderAscending() const { return m_sortIsAscending; }
// set the sorting column (or unsets any existing one if wxNOT_FOUND) and
// the order in which to sort
void SetSortingColumn(int col, bool ascending = true);
// unset any existing sorting column
void UnsetSortingColumn() { SetSortingColumn(wxNOT_FOUND); }
#if WXWIN_COMPATIBILITY_2_8
// ------ For compatibility with previous wxGrid only...
//
// ************************************************
// ** Don't use these in new code because they **
// ** are liable to disappear in a future **
// ** revision **
// ************************************************
//
wxGrid( wxWindow *parent,
int x, int y, int w = wxDefaultCoord, int h = wxDefaultCoord,
long style = wxWANTS_CHARS,
const wxString& name = wxPanelNameStr )
{
Init();
Create(parent, wxID_ANY, wxPoint(x, y), wxSize(w, h), style, name);
}
void SetCellValue( const wxString& val, int row, int col )
{ SetCellValue( row, col, val ); }
void UpdateDimensions()
{ CalcDimensions(); }
int GetRows() const { return GetNumberRows(); }
int GetCols() const { return GetNumberCols(); }
int GetCursorRow() const { return GetGridCursorRow(); }
int GetCursorColumn() const { return GetGridCursorCol(); }
int GetScrollPosX() const { return 0; }
int GetScrollPosY() const { return 0; }
void SetScrollX( int WXUNUSED(x) ) { }
void SetScrollY( int WXUNUSED(y) ) { }
void SetColumnWidth( int col, int width )
{ SetColSize( col, width ); }
int GetColumnWidth( int col ) const
{ return GetColSize( col ); }
void SetRowHeight( int row, int height )
{ SetRowSize( row, height ); }
// GetRowHeight() is below
int GetViewHeight() const // returned num whole rows visible
{ return 0; }
int GetViewWidth() const // returned num whole cols visible
{ return 0; }
void SetLabelSize( int orientation, int sz )
{
if ( orientation == wxHORIZONTAL )
SetColLabelSize( sz );
else
SetRowLabelSize( sz );
}
int GetLabelSize( int orientation ) const
{
if ( orientation == wxHORIZONTAL )
return GetColLabelSize();
else
return GetRowLabelSize();
}
void SetLabelAlignment( int orientation, int align )
{
if ( orientation == wxHORIZONTAL )
SetColLabelAlignment( align, wxALIGN_INVALID );
else
SetRowLabelAlignment( align, wxALIGN_INVALID );
}
int GetLabelAlignment( int orientation, int WXUNUSED(align) ) const
{
int h, v;
if ( orientation == wxHORIZONTAL )
{
GetColLabelAlignment( &h, &v );
return h;
}
else
{
GetRowLabelAlignment( &h, &v );
return h;
}
}
void SetLabelValue( int orientation, const wxString& val, int pos )
{
if ( orientation == wxHORIZONTAL )
SetColLabelValue( pos, val );
else
SetRowLabelValue( pos, val );
}
wxString GetLabelValue( int orientation, int pos) const
{
if ( orientation == wxHORIZONTAL )
return GetColLabelValue( pos );
else
return GetRowLabelValue( pos );
}
wxFont GetCellTextFont() const
{ return m_defaultCellAttr->GetFont(); }
wxFont GetCellTextFont(int WXUNUSED(row), int WXUNUSED(col)) const
{ return m_defaultCellAttr->GetFont(); }
void SetCellTextFont(const wxFont& fnt)
{ SetDefaultCellFont( fnt ); }
void SetCellTextFont(const wxFont& fnt, int row, int col)
{ SetCellFont( row, col, fnt ); }
void SetCellTextColour(const wxColour& val, int row, int col)
{ SetCellTextColour( row, col, val ); }
void SetCellTextColour(const wxColour& col)
{ SetDefaultCellTextColour( col ); }
void SetCellBackgroundColour(const wxColour& col)
{ SetDefaultCellBackgroundColour( col ); }
void SetCellBackgroundColour(const wxColour& colour, int row, int col)
{ SetCellBackgroundColour( row, col, colour ); }
bool GetEditable() const { return IsEditable(); }
void SetEditable( bool edit = true ) { EnableEditing( edit ); }
bool GetEditInPlace() const { return IsCellEditControlEnabled(); }
void SetEditInPlace(bool WXUNUSED(edit) = true) { }
void SetCellAlignment( int align, int row, int col)
{ SetCellAlignment(row, col, align, wxALIGN_CENTER); }
void SetCellAlignment( int WXUNUSED(align) ) {}
void SetCellBitmap(wxBitmap *WXUNUSED(bitmap), int WXUNUSED(row), int WXUNUSED(col))
{ }
void SetDividerPen(const wxPen& WXUNUSED(pen)) { }
wxPen& GetDividerPen() const;
void OnActivate(bool WXUNUSED(active)) {}
// ******** End of compatibility functions **********
// ------ control IDs
enum { wxGRID_CELLCTRL = 2000,
wxGRID_TOPCTRL };
// ------ control types
enum { wxGRID_TEXTCTRL = 2100,
wxGRID_CHECKBOX,
wxGRID_CHOICE,
wxGRID_COMBOBOX };
wxDEPRECATED_INLINE(bool CanDragRowSize() const, return m_canDragRowSize; )
wxDEPRECATED_INLINE(bool CanDragColSize() const, return m_canDragColSize; )
#endif // WXWIN_COMPATIBILITY_2_8
// override some base class functions
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE
{ return (wxWindow*)m_gridWin; }
virtual void Fit() wxOVERRIDE;
// implementation only
void CancelMouseCapture();
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
bool m_created;
wxGridWindow *m_gridWin;
wxGridCornerLabelWindow *m_cornerLabelWin;
wxGridRowLabelWindow *m_rowLabelWin;
// the real type of the column window depends on m_useNativeHeader value:
// if it is true, its dynamic type is wxHeaderCtrl, otherwise it is
// wxGridColLabelWindow, use accessors below when the real type matters
wxWindow *m_colWindow;
wxGridColLabelWindow *GetColLabelWindow() const
{
wxASSERT_MSG( !m_useNativeHeader, "no column label window" );
return reinterpret_cast<wxGridColLabelWindow *>(m_colWindow);
}
wxGridTableBase *m_table;
bool m_ownTable;
int m_numRows;
int m_numCols;
wxGridCellCoords m_currentCellCoords;
// the corners of the block being currently selected or wxGridNoCellCoords
wxGridCellCoords m_selectedBlockTopLeft;
wxGridCellCoords m_selectedBlockBottomRight;
// when selecting blocks of cells (either from the keyboard using Shift
// with cursor keys, or by dragging the mouse), the selection is anchored
// at m_currentCellCoords which defines one of the corners of the rectangle
// being selected -- and this variable defines the other corner, i.e. it's
// either m_selectedBlockTopLeft or m_selectedBlockBottomRight depending on
// which of them is not m_currentCellCoords
//
// if no block selection is in process, it is set to wxGridNoCellCoords
wxGridCellCoords m_selectedBlockCorner;
wxGridSelection *m_selection;
wxColour m_selectionBackground;
wxColour m_selectionForeground;
// NB: *never* access m_row/col arrays directly because they are created
// on demand, *always* use accessor functions instead!
// init the m_rowHeights/Bottoms arrays with default values
void InitRowHeights();
int m_defaultRowHeight;
int m_minAcceptableRowHeight;
wxArrayInt m_rowHeights;
wxArrayInt m_rowBottoms;
// init the m_colWidths/Rights arrays
void InitColWidths();
int m_defaultColWidth;
int m_minAcceptableColWidth;
wxArrayInt m_colWidths;
wxArrayInt m_colRights;
int m_sortCol;
bool m_sortIsAscending;
bool m_useNativeHeader,
m_nativeColumnLabels;
// get the col/row coords
int GetColWidth(int col) const;
int GetColLeft(int col) const;
int GetColRight(int col) const;
// this function must be public for compatibility...
public:
int GetRowHeight(int row) const;
protected:
int GetRowTop(int row) const;
int GetRowBottom(int row) const;
int m_rowLabelWidth;
int m_colLabelHeight;
// the size of the margin left to the right and bottom of the cell area
int m_extraWidth,
m_extraHeight;
wxColour m_labelBackgroundColour;
wxColour m_labelTextColour;
wxFont m_labelFont;
int m_rowLabelHorizAlign;
int m_rowLabelVertAlign;
int m_colLabelHorizAlign;
int m_colLabelVertAlign;
int m_colLabelTextOrientation;
int m_cornerLabelHorizAlign;
int m_cornerLabelVertAlign;
int m_cornerLabelTextOrientation;
bool m_defaultRowLabelValues;
bool m_defaultColLabelValues;
wxColour m_gridLineColour;
bool m_gridLinesEnabled;
bool m_gridLinesClipHorz,
m_gridLinesClipVert;
wxColour m_cellHighlightColour;
int m_cellHighlightPenWidth;
int m_cellHighlightROPenWidth;
// common part of AutoSizeColumn/Row() and GetBestSize()
int SetOrCalcColumnSizes(bool calcOnly, bool setAsMin = true);
int SetOrCalcRowSizes(bool calcOnly, bool setAsMin = true);
// common part of AutoSizeColumn/Row()
void AutoSizeColOrRow(int n, bool setAsMin, wxGridDirection direction);
// Calculate the minimum acceptable size for labels area
wxCoord CalcColOrRowLabelAreaMinSize(wxGridDirection direction);
// if a column has a minimal width, it will be the value for it in this
// hash table
wxLongToLongHashMap m_colMinWidths,
m_rowMinHeights;
// get the minimal width of the given column/row
int GetColMinimalWidth(int col) const;
int GetRowMinimalHeight(int col) const;
// do we have some place to store attributes in?
bool CanHaveAttributes() const;
// cell attribute cache (currently we only cache 1, may be will do
// more/better later)
struct CachedAttr
{
int row, col;
wxGridCellAttr *attr;
} m_attrCache;
// invalidates the attribute cache
void ClearAttrCache();
// adds an attribute to cache
void CacheAttr(int row, int col, wxGridCellAttr *attr) const;
// looks for an attr in cache, returns true if found
bool LookupAttr(int row, int col, wxGridCellAttr **attr) const;
// looks for the attr in cache, if not found asks the table and caches the
// result
wxGridCellAttr *GetCellAttr(int row, int col) const;
wxGridCellAttr *GetCellAttr(const wxGridCellCoords& coords ) const
{ return GetCellAttr( coords.GetRow(), coords.GetCol() ); }
// the default cell attr object for cells that don't have their own
wxGridCellAttr* m_defaultCellAttr;
bool m_inOnKeyDown;
int m_batchCount;
wxGridTypeRegistry* m_typeRegistry;
enum CursorMode
{
WXGRID_CURSOR_SELECT_CELL,
WXGRID_CURSOR_RESIZE_ROW,
WXGRID_CURSOR_RESIZE_COL,
WXGRID_CURSOR_SELECT_ROW,
WXGRID_CURSOR_SELECT_COL,
WXGRID_CURSOR_MOVE_COL
};
// this method not only sets m_cursorMode but also sets the correct cursor
// for the given mode and, if captureMouse is not false releases the mouse
// if it was captured and captures it if it must be captured
//
// for this to work, you should always use it and not set m_cursorMode
// directly!
void ChangeCursorMode(CursorMode mode,
wxWindow *win = NULL,
bool captureMouse = true);
wxWindow *m_winCapture; // the window which captured the mouse
// this variable is used not for finding the correct current cursor but
// mainly for finding out what is going to happen if the mouse starts being
// dragged right now
//
// by default it is WXGRID_CURSOR_SELECT_CELL meaning that nothing else is
// going on, and it is set to one of RESIZE/SELECT/MOVE values while the
// corresponding operation will be started if the user starts dragging the
// mouse from the current position
CursorMode m_cursorMode;
//Column positions
wxArrayInt m_colAt;
bool m_canDragRowSize;
bool m_canDragColSize;
bool m_canDragColMove;
bool m_canDragGridSize;
bool m_canDragCell;
// the last position (horizontal or vertical depending on whether the user
// is resizing a column or a row) where a row or column separator line was
// dragged by the user or -1 of there is no drag operation in progress
int m_dragLastPos;
int m_dragRowOrCol;
// true if a drag operation is in progress; when this is true,
// m_startDragPos is valid, i.e. not wxDefaultPosition
bool m_isDragging;
// the position (in physical coordinates) where the user started dragging
// the mouse or wxDefaultPosition if mouse isn't being dragged
//
// notice that this can be != wxDefaultPosition while m_isDragging is still
// false because we wait until the mouse is moved some distance away before
// setting m_isDragging to true
wxPoint m_startDragPos;
bool m_waitForSlowClick;
wxGridCellCoords m_selectionStart;
wxCursor m_rowResizeCursor;
wxCursor m_colResizeCursor;
bool m_editable; // applies to whole grid
bool m_cellEditCtrlEnabled; // is in-place edit currently shown?
TabBehaviour m_tabBehaviour; // determines how the TAB key behaves
void Init(); // common part of all ctors
void Create();
void CreateColumnWindow();
void CalcDimensions();
void CalcWindowSizes();
bool Redimension( wxGridTableMessage& );
// generate the appropriate grid event and return -1 if it was vetoed, 1 if
// it was processed (but not vetoed) and 0 if it wasn't processed
int SendEvent(wxEventType evtType,
int row, int col,
const wxMouseEvent& e);
int SendEvent(wxEventType evtType,
const wxGridCellCoords& coords,
const wxMouseEvent& e)
{ return SendEvent(evtType, coords.GetRow(), coords.GetCol(), e); }
int SendEvent(wxEventType evtType,
int row, int col,
const wxString& s = wxString());
int SendEvent(wxEventType evtType,
const wxGridCellCoords& coords,
const wxString& s = wxString())
{ return SendEvent(evtType, coords.GetRow(), coords.GetCol(), s); }
int SendEvent(wxEventType evtType, const wxString& s = wxString())
{ return SendEvent(evtType, m_currentCellCoords, s); }
// send wxEVT_GRID_{ROW,COL}_SIZE or wxEVT_GRID_COL_AUTO_SIZE, return true
// if the event was processed, false otherwise
bool SendGridSizeEvent(wxEventType type,
int row, int col,
const wxMouseEvent& mouseEv);
void OnPaint( wxPaintEvent& );
void OnSize( wxSizeEvent& );
void OnKeyDown( wxKeyEvent& );
void OnKeyUp( wxKeyEvent& );
void OnChar( wxKeyEvent& );
void OnEraseBackground( wxEraseEvent& );
void OnHideEditor( wxCommandEvent& );
bool SetCurrentCell( const wxGridCellCoords& coords );
bool SetCurrentCell( int row, int col )
{ return SetCurrentCell( wxGridCellCoords(row, col) ); }
// this function is called to extend the block being currently selected
// from mouse and keyboard event handlers
void UpdateBlockBeingSelected(int topRow, int leftCol,
int bottomRow, int rightCol);
void UpdateBlockBeingSelected(const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight)
{ UpdateBlockBeingSelected(topLeft.GetRow(), topLeft.GetCol(),
bottomRight.GetRow(), bottomRight.GetCol()); }
friend class WXDLLIMPEXP_FWD_CORE wxGridSelection;
friend class wxGridRowOperations;
friend class wxGridColumnOperations;
// they call our private Process{{Corner,Col,Row}Label,GridCell}MouseEvent()
friend class wxGridCornerLabelWindow;
friend class wxGridColLabelWindow;
friend class wxGridRowLabelWindow;
friend class wxGridWindow;
friend class wxGridHeaderRenderer;
friend class wxGridHeaderCtrl;
private:
// implement wxScrolledWindow method to return m_gridWin size
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size) wxOVERRIDE;
// redraw the grid lines, should be called after changing their attributes
void RedrawGridLines();
// draw all grid lines in the given cell region (unlike the public
// DrawAllGridLines() which just draws all of them)
void DrawRangeGridLines(wxDC& dc, const wxRegion& reg,
const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight);
// draw all lines from top to bottom row and left to right column in the
// rectangle determined by (top, left)-(bottom, right) -- but notice that
// the caller must have set up the clipping correctly, this rectangle is
// only used here for optimization
void DoDrawGridLines(wxDC& dc,
int top, int left,
int bottom, int right,
int topRow, int leftCol,
int bottomRight, int rightCol);
// common part of Clip{Horz,Vert}GridLines
void DoClipGridLines(bool& var, bool clip);
// update the sorting indicator shown in the specified column (whose index
// must be valid)
//
// this will use GetSortingColumn() and IsSortOrderAscending() to determine
// the sorting indicator to effectively show
void UpdateColumnSortingIndicator(int col);
// update the grid after changing the columns order (common part of
// SetColPos() and ResetColPos())
void RefreshAfterColPosChange();
// reset the variables used during dragging operations after it ended,
// either because we called EndDraggingIfNecessary() ourselves or because
// we lost mouse capture
void DoAfterDraggingEnd();
// release the mouse capture if it's currently captured
void EndDraggingIfNecessary();
// return the position (not index) of the column at the given logical pixel
// position
//
// this always returns a valid position, even if the coordinate is out of
// bounds (in which case first/last column is returned)
int XToPos(int x) const;
// event handlers and their helpers
// --------------------------------
// process mouse drag event in WXGRID_CURSOR_SELECT_CELL mode
bool DoGridCellDrag(wxMouseEvent& event,
const wxGridCellCoords& coords,
bool isFirstDrag);
// process row/column resizing drag event
void DoGridLineDrag(wxMouseEvent& event, const wxGridOperations& oper);
// process mouse drag event in the grid window, return false if starting
// dragging was vetoed by the user-defined wxEVT_GRID_CELL_BEGIN_DRAG
// handler
bool DoGridDragEvent(wxMouseEvent& event,
const wxGridCellCoords& coords,
bool isFirstDrag);
// process different clicks on grid cells
void DoGridCellLeftDown(wxMouseEvent& event,
const wxGridCellCoords& coords,
const wxPoint& pos);
void DoGridCellLeftDClick(wxMouseEvent& event,
const wxGridCellCoords& coords,
const wxPoint& pos);
void DoGridCellLeftUp(wxMouseEvent& event, const wxGridCellCoords& coords);
// process movement (but not dragging) event in the grid cell area
void DoGridMouseMoveEvent(wxMouseEvent& event,
const wxGridCellCoords& coords,
const wxPoint& pos);
// process mouse events in the grid window
void ProcessGridCellMouseEvent(wxMouseEvent& event);
// process mouse events in the row/column labels/corner windows
void ProcessRowLabelMouseEvent(wxMouseEvent& event);
void ProcessColLabelMouseEvent(wxMouseEvent& event);
void ProcessCornerLabelMouseEvent(wxMouseEvent& event);
void DoColHeaderClick(int col);
void DoStartResizeCol(int col);
void DoUpdateResizeCol(int x);
void DoUpdateResizeColWidth(int w);
void DoStartMoveCol(int col);
void DoEndDragResizeRow(const wxMouseEvent& event);
void DoEndDragResizeCol(const wxMouseEvent& event);
void DoEndMoveCol(int pos);
// process a TAB keypress
void DoGridProcessTab(wxKeyboardState& kbdState);
// common implementations of methods defined for both rows and columns
void DeselectLine(int line, const wxGridOperations& oper);
bool DoEndDragResizeLine(const wxGridOperations& oper);
int PosToLinePos(int pos, bool clipToMinMax,
const wxGridOperations& oper) const;
int PosToLine(int pos, bool clipToMinMax,
const wxGridOperations& oper) const;
int PosToEdgeOfLine(int pos, const wxGridOperations& oper) const;
bool DoMoveCursor(bool expandSelection,
const wxGridDirectionOperations& diroper);
bool DoMoveCursorByPage(const wxGridDirectionOperations& diroper);
bool DoMoveCursorByBlock(bool expandSelection,
const wxGridDirectionOperations& diroper);
void AdvanceToNextNonEmpty(wxGridCellCoords& coords,
const wxGridDirectionOperations& diroper);
// common part of {Insert,Delete}{Rows,Cols}
bool DoModifyLines(bool (wxGridTableBase::*funcModify)(size_t, size_t),
int pos, int num, bool updateLabels);
// Append{Rows,Cols} is a bit different because of one less parameter
bool DoAppendLines(bool (wxGridTableBase::*funcAppend)(size_t),
int num, bool updateLabels);
// common part of Set{Col,Row}Sizes
void DoSetSizes(const wxGridSizesInfo& sizeInfo,
const wxGridOperations& oper);
// common part of Disable{Row,Col}Resize and CanDrag{Row,Col}Size
void DoDisableLineResize(int line, wxGridFixedIndicesSet *& setFixed);
bool DoCanResizeLine(int line, const wxGridFixedIndicesSet *setFixed) const;
// Helper of Render(): get grid size, origin offset and fill cell arrays
void GetRenderSizes( const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
wxPoint& pointOffSet, wxSize& sizeGrid,
wxGridCellCoordsArray& renderCells,
wxArrayInt& arrayCols, wxArrayInt& arrayRows );
// Helper of Render(): set the scale to draw the cells at the right size.
void SetRenderScale( wxDC& dc, const wxPoint& pos, const wxSize& size,
const wxSize& sizeGrid );
// Helper of Render(): get render start position from passed parameter
wxPoint GetRenderPosition( wxDC& dc, const wxPoint& position );
// Helper of Render(): draws a box around the rendered area
void DoRenderBox( wxDC& dc, const int& style,
const wxPoint& pointOffSet,
const wxSize& sizeCellArea,
const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight );
// Implementation of public Set{Row,Col}Size() and {Hide,Show}{Row,Col}().
// They interpret their height or width parameter slightly different from
// the public methods where -1 in it means "auto fit to the label" for the
// compatibility reasons. Here it means "show a previously hidden row or
// column" while 0 means "hide it" just as in the public methods. And any
// positive values are handled naturally, i.e. they just specify the size.
void DoSetRowSize( int row, int height );
void DoSetColSize( int col, int width );
// these sets contain the indices of fixed, i.e. non-resizable
// interactively, grid rows or columns and are NULL if there are no fixed
// elements (which is the default)
wxGridFixedIndicesSet *m_setFixedRows,
*m_setFixedCols;
wxDECLARE_DYNAMIC_CLASS(wxGrid);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxGrid);
};
// ----------------------------------------------------------------------------
// wxGridUpdateLocker prevents updates to a grid during its lifetime
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridUpdateLocker
{
public:
// if the pointer is NULL, Create() can be called later
wxGridUpdateLocker(wxGrid *grid = NULL)
{
Init(grid);
}
// can be called if ctor was used with a NULL pointer, must not be called
// more than once
void Create(wxGrid *grid)
{
wxASSERT_MSG( !m_grid, wxT("shouldn't be called more than once") );
Init(grid);
}
~wxGridUpdateLocker()
{
if ( m_grid )
m_grid->EndBatch();
}
private:
void Init(wxGrid *grid)
{
m_grid = grid;
if ( m_grid )
m_grid->BeginBatch();
}
wxGrid *m_grid;
wxDECLARE_NO_COPY_CLASS(wxGridUpdateLocker);
};
// ----------------------------------------------------------------------------
// Grid event class and event types
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridEvent : public wxNotifyEvent,
public wxKeyboardState
{
public:
wxGridEvent()
: wxNotifyEvent()
{
Init(-1, -1, -1, -1, false);
}
wxGridEvent(int id,
wxEventType type,
wxObject* obj,
int row = -1, int col = -1,
int x = -1, int y = -1,
bool sel = true,
const wxKeyboardState& kbd = wxKeyboardState())
: wxNotifyEvent(type, id),
wxKeyboardState(kbd)
{
Init(row, col, x, y, sel);
SetEventObject(obj);
}
// explicitly specifying inline allows gcc < 3.4 to
// handle the deprecation attribute even in the constructor.
wxDEPRECATED_CONSTRUCTOR(
wxGridEvent(int id,
wxEventType type,
wxObject* obj,
int row, int col,
int x, int y,
bool sel,
bool control,
bool shift = false, bool alt = false, bool meta = false));
virtual int GetRow() { return m_row; }
virtual int GetCol() { return m_col; }
wxPoint GetPosition() { return wxPoint( m_x, m_y ); }
bool Selecting() { return m_selecting; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxGridEvent(*this); }
protected:
int m_row;
int m_col;
int m_x;
int m_y;
bool m_selecting;
private:
void Init(int row, int col, int x, int y, bool sel)
{
m_row = row;
m_col = col;
m_x = x;
m_y = y;
m_selecting = sel;
}
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridEvent);
};
class WXDLLIMPEXP_CORE wxGridSizeEvent : public wxNotifyEvent,
public wxKeyboardState
{
public:
wxGridSizeEvent()
: wxNotifyEvent()
{
Init(-1, -1, -1);
}
wxGridSizeEvent(int id,
wxEventType type,
wxObject* obj,
int rowOrCol = -1,
int x = -1, int y = -1,
const wxKeyboardState& kbd = wxKeyboardState())
: wxNotifyEvent(type, id),
wxKeyboardState(kbd)
{
Init(rowOrCol, x, y);
SetEventObject(obj);
}
wxDEPRECATED_CONSTRUCTOR(
wxGridSizeEvent(int id,
wxEventType type,
wxObject* obj,
int rowOrCol,
int x, int y,
bool control,
bool shift = false,
bool alt = false,
bool meta = false) );
int GetRowOrCol() { return m_rowOrCol; }
wxPoint GetPosition() { return wxPoint( m_x, m_y ); }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxGridSizeEvent(*this); }
protected:
int m_rowOrCol;
int m_x;
int m_y;
private:
void Init(int rowOrCol, int x, int y)
{
m_rowOrCol = rowOrCol;
m_x = x;
m_y = y;
}
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridSizeEvent);
};
class WXDLLIMPEXP_CORE wxGridRangeSelectEvent : public wxNotifyEvent,
public wxKeyboardState
{
public:
wxGridRangeSelectEvent()
: wxNotifyEvent()
{
Init(wxGridNoCellCoords, wxGridNoCellCoords, false);
}
wxGridRangeSelectEvent(int id,
wxEventType type,
wxObject* obj,
const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
bool sel = true,
const wxKeyboardState& kbd = wxKeyboardState())
: wxNotifyEvent(type, id),
wxKeyboardState(kbd)
{
Init(topLeft, bottomRight, sel);
SetEventObject(obj);
}
wxDEPRECATED_CONSTRUCTOR(
wxGridRangeSelectEvent(int id,
wxEventType type,
wxObject* obj,
const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
bool sel,
bool control,
bool shift = false,
bool alt = false,
bool meta = false) );
wxGridCellCoords GetTopLeftCoords() { return m_topLeft; }
wxGridCellCoords GetBottomRightCoords() { return m_bottomRight; }
int GetTopRow() { return m_topLeft.GetRow(); }
int GetBottomRow() { return m_bottomRight.GetRow(); }
int GetLeftCol() { return m_topLeft.GetCol(); }
int GetRightCol() { return m_bottomRight.GetCol(); }
bool Selecting() { return m_selecting; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxGridRangeSelectEvent(*this); }
protected:
void Init(const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
bool selecting)
{
m_topLeft = topLeft;
m_bottomRight = bottomRight;
m_selecting = selecting;
}
wxGridCellCoords m_topLeft;
wxGridCellCoords m_bottomRight;
bool m_selecting;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridRangeSelectEvent);
};
class WXDLLIMPEXP_CORE wxGridEditorCreatedEvent : public wxCommandEvent
{
public:
wxGridEditorCreatedEvent()
: wxCommandEvent()
{
m_row = 0;
m_col = 0;
m_ctrl = NULL;
}
wxGridEditorCreatedEvent(int id, wxEventType type, wxObject* obj,
int row, int col, wxControl* ctrl);
int GetRow() { return m_row; }
int GetCol() { return m_col; }
wxControl* GetControl() { return m_ctrl; }
void SetRow(int row) { m_row = row; }
void SetCol(int col) { m_col = col; }
void SetControl(wxControl* ctrl) { m_ctrl = ctrl; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxGridEditorCreatedEvent(*this); }
private:
int m_row;
int m_col;
wxControl* m_ctrl;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridEditorCreatedEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_RIGHT_DCLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_LABEL_RIGHT_DCLICK, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_ROW_SIZE, wxGridSizeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_COL_SIZE, wxGridSizeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_COL_AUTO_SIZE, wxGridSizeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_CHANGING, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_CHANGED, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_SELECT_CELL, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_EDITOR_SHOWN, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_EDITOR_HIDDEN, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_EDITOR_CREATED, wxGridEditorCreatedEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_CELL_BEGIN_DRAG, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_COL_MOVE, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_COL_SORT, wxGridEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_GRID_TABBING, wxGridEvent );
typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&);
typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&);
typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&);
#define wxGridEventHandler(func) \
wxEVENT_HANDLER_CAST(wxGridEventFunction, func)
#define wxGridSizeEventHandler(func) \
wxEVENT_HANDLER_CAST(wxGridSizeEventFunction, func)
#define wxGridRangeSelectEventHandler(func) \
wxEVENT_HANDLER_CAST(wxGridRangeSelectEventFunction, func)
#define wxGridEditorCreatedEventHandler(func) \
wxEVENT_HANDLER_CAST(wxGridEditorCreatedEventFunction, func)
#define wx__DECLARE_GRIDEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEventHandler(fn))
#define wx__DECLARE_GRIDSIZEEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridSizeEventHandler(fn))
#define wx__DECLARE_GRIDRANGESELEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridRangeSelectEventHandler(fn))
#define wx__DECLARE_GRIDEDITOREVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEditorCreatedEventHandler(fn))
#define EVT_GRID_CMD_CELL_LEFT_CLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_LEFT_CLICK, id, fn)
#define EVT_GRID_CMD_CELL_RIGHT_CLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_RIGHT_CLICK, id, fn)
#define EVT_GRID_CMD_CELL_LEFT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_LEFT_DCLICK, id, fn)
#define EVT_GRID_CMD_CELL_RIGHT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_RIGHT_DCLICK, id, fn)
#define EVT_GRID_CMD_LABEL_LEFT_CLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_LEFT_CLICK, id, fn)
#define EVT_GRID_CMD_LABEL_RIGHT_CLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_RIGHT_CLICK, id, fn)
#define EVT_GRID_CMD_LABEL_LEFT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_LEFT_DCLICK, id, fn)
#define EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_RIGHT_DCLICK, id, fn)
#define EVT_GRID_CMD_ROW_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(ROW_SIZE, id, fn)
#define EVT_GRID_CMD_COL_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(COL_SIZE, id, fn)
#define EVT_GRID_CMD_COL_AUTO_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(COL_AUTO_SIZE, id, fn)
#define EVT_GRID_CMD_COL_MOVE(id, fn) wx__DECLARE_GRIDEVT(COL_MOVE, id, fn)
#define EVT_GRID_CMD_COL_SORT(id, fn) wx__DECLARE_GRIDEVT(COL_SORT, id, fn)
#define EVT_GRID_CMD_RANGE_SELECT(id, fn) wx__DECLARE_GRIDRANGESELEVT(RANGE_SELECT, id, fn)
#define EVT_GRID_CMD_CELL_CHANGING(id, fn) wx__DECLARE_GRIDEVT(CELL_CHANGING, id, fn)
#define EVT_GRID_CMD_CELL_CHANGED(id, fn) wx__DECLARE_GRIDEVT(CELL_CHANGED, id, fn)
#define EVT_GRID_CMD_SELECT_CELL(id, fn) wx__DECLARE_GRIDEVT(SELECT_CELL, id, fn)
#define EVT_GRID_CMD_EDITOR_SHOWN(id, fn) wx__DECLARE_GRIDEVT(EDITOR_SHOWN, id, fn)
#define EVT_GRID_CMD_EDITOR_HIDDEN(id, fn) wx__DECLARE_GRIDEVT(EDITOR_HIDDEN, id, fn)
#define EVT_GRID_CMD_EDITOR_CREATED(id, fn) wx__DECLARE_GRIDEDITOREVT(EDITOR_CREATED, id, fn)
#define EVT_GRID_CMD_CELL_BEGIN_DRAG(id, fn) wx__DECLARE_GRIDEVT(CELL_BEGIN_DRAG, id, fn)
#define EVT_GRID_CMD_TABBING(id, fn) wx__DECLARE_GRIDEVT(TABBING, id, fn)
// same as above but for any id (exists mainly for backwards compatibility but
// then it's also true that you rarely have multiple grid in the same window)
#define EVT_GRID_CELL_LEFT_CLICK(fn) EVT_GRID_CMD_CELL_LEFT_CLICK(wxID_ANY, fn)
#define EVT_GRID_CELL_RIGHT_CLICK(fn) EVT_GRID_CMD_CELL_RIGHT_CLICK(wxID_ANY, fn)
#define EVT_GRID_CELL_LEFT_DCLICK(fn) EVT_GRID_CMD_CELL_LEFT_DCLICK(wxID_ANY, fn)
#define EVT_GRID_CELL_RIGHT_DCLICK(fn) EVT_GRID_CMD_CELL_RIGHT_DCLICK(wxID_ANY, fn)
#define EVT_GRID_LABEL_LEFT_CLICK(fn) EVT_GRID_CMD_LABEL_LEFT_CLICK(wxID_ANY, fn)
#define EVT_GRID_LABEL_RIGHT_CLICK(fn) EVT_GRID_CMD_LABEL_RIGHT_CLICK(wxID_ANY, fn)
#define EVT_GRID_LABEL_LEFT_DCLICK(fn) EVT_GRID_CMD_LABEL_LEFT_DCLICK(wxID_ANY, fn)
#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) EVT_GRID_CMD_LABEL_RIGHT_DCLICK(wxID_ANY, fn)
#define EVT_GRID_ROW_SIZE(fn) EVT_GRID_CMD_ROW_SIZE(wxID_ANY, fn)
#define EVT_GRID_COL_SIZE(fn) EVT_GRID_CMD_COL_SIZE(wxID_ANY, fn)
#define EVT_GRID_COL_AUTO_SIZE(fn) EVT_GRID_CMD_COL_AUTO_SIZE(wxID_ANY, fn)
#define EVT_GRID_COL_MOVE(fn) EVT_GRID_CMD_COL_MOVE(wxID_ANY, fn)
#define EVT_GRID_COL_SORT(fn) EVT_GRID_CMD_COL_SORT(wxID_ANY, fn)
#define EVT_GRID_RANGE_SELECT(fn) EVT_GRID_CMD_RANGE_SELECT(wxID_ANY, fn)
#define EVT_GRID_CELL_CHANGING(fn) EVT_GRID_CMD_CELL_CHANGING(wxID_ANY, fn)
#define EVT_GRID_CELL_CHANGED(fn) EVT_GRID_CMD_CELL_CHANGED(wxID_ANY, fn)
#define EVT_GRID_SELECT_CELL(fn) EVT_GRID_CMD_SELECT_CELL(wxID_ANY, fn)
#define EVT_GRID_EDITOR_SHOWN(fn) EVT_GRID_CMD_EDITOR_SHOWN(wxID_ANY, fn)
#define EVT_GRID_EDITOR_HIDDEN(fn) EVT_GRID_CMD_EDITOR_HIDDEN(wxID_ANY, fn)
#define EVT_GRID_EDITOR_CREATED(fn) EVT_GRID_CMD_EDITOR_CREATED(wxID_ANY, fn)
#define EVT_GRID_CELL_BEGIN_DRAG(fn) EVT_GRID_CMD_CELL_BEGIN_DRAG(wxID_ANY, fn)
#define EVT_GRID_TABBING(fn) EVT_GRID_CMD_TABBING(wxID_ANY, fn)
// we used to have a single wxEVT_GRID_CELL_CHANGE event but it was split into
// wxEVT_GRID_CELL_CHANGING and CHANGED ones in wx 2.9.0, however the CHANGED
// is basically the same as the old CHANGE event so we keep the name for
// compatibility
#if WXWIN_COMPATIBILITY_2_8
#define wxEVT_GRID_CELL_CHANGE wxEVT_GRID_CELL_CHANGED
#define EVT_GRID_CMD_CELL_CHANGE EVT_GRID_CMD_CELL_CHANGED
#define EVT_GRID_CELL_CHANGE EVT_GRID_CELL_CHANGED
#endif // WXWIN_COMPATIBILITY_2_8
#if 0 // TODO: implement these ? others ?
extern const int wxEVT_GRID_CREATE_CELL;
extern const int wxEVT_GRID_CHANGE_LABELS;
extern const int wxEVT_GRID_CHANGE_SEL_LABEL;
#define EVT_GRID_CREATE_CELL(fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CREATE_CELL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CHANGE_LABELS(fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_LABELS, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CHANGE_SEL_LABEL(fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_SEL_LABEL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#endif
#endif // wxUSE_GRID
#endif // _WX_GENERIC_GRID_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/infobar.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/infobar.h
// Purpose: generic wxInfoBar class declaration
// Author: Vadim Zeitlin
// Created: 2009-07-28
// Copyright: (c) 2009 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_INFOBAR_H_
#define _WX_GENERIC_INFOBAR_H_
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
class WXDLLIMPEXP_FWD_CORE wxStaticBitmap;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
// ----------------------------------------------------------------------------
// wxInfoBar
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxInfoBarGeneric : public wxInfoBarBase
{
public:
// the usual ctors and Create() but remember that info bar is created
// hidden
wxInfoBarGeneric() { Init(); }
wxInfoBarGeneric(wxWindow *parent, wxWindowID winid = wxID_ANY)
{
Init();
Create(parent, winid);
}
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY);
// implement base class methods
// ----------------------------
virtual void ShowMessage(const wxString& msg,
int flags = wxICON_INFORMATION) wxOVERRIDE;
virtual void Dismiss() wxOVERRIDE;
virtual void AddButton(wxWindowID btnid, const wxString& label = wxString()) wxOVERRIDE;
virtual void RemoveButton(wxWindowID btnid) wxOVERRIDE;
virtual size_t GetButtonCount() const wxOVERRIDE;
virtual wxWindowID GetButtonId(size_t idx) const wxOVERRIDE;
virtual bool HasButtonId(wxWindowID btnid) const wxOVERRIDE;
// methods specific to this version
// --------------------------------
// set the effect(s) to use when showing/hiding the bar, may be
// wxSHOW_EFFECT_NONE to disable any effects entirely
//
// by default, slide to bottom/top is used when it's positioned on the top
// of the window for showing/hiding it and top/bottom when it's positioned
// at the bottom
void SetShowHideEffects(wxShowEffect showEffect, wxShowEffect hideEffect)
{
m_showEffect = showEffect;
m_hideEffect = hideEffect;
}
// get effect used when showing/hiding the window
wxShowEffect GetShowEffect() const;
wxShowEffect GetHideEffect() const;
// set the duration of animation used when showing/hiding the bar, in ms
void SetEffectDuration(int duration) { m_effectDuration = duration; }
// get the currently used effect animation duration
int GetEffectDuration() const { return m_effectDuration; }
// overridden base class methods
// -----------------------------
// setting the font of this window sets it for the text control inside it
// (default font is a larger and bold version of the normal one)
virtual bool SetFont(const wxFont& font) wxOVERRIDE;
// same thing with the colour: this affects the text colour
virtual bool SetForegroundColour(const wxColor& colour) wxOVERRIDE;
protected:
// info bar shouldn't have any border by default, the colour difference
// between it and the main window separates it well enough
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
// update the parent to take our new or changed size into account (notably
// should be called when we're shown or hidden)
void UpdateParent();
private:
// common part of all ctors
void Init();
// handler for the close button
void OnButton(wxCommandEvent& event);
// show/hide the bar
void DoShow();
void DoHide();
// determine the placement of the bar from its position in the containing
// sizer
enum BarPlacement
{
BarPlacement_Top,
BarPlacement_Bottom,
BarPlacement_Unknown
};
BarPlacement GetBarPlacement() const;
// different controls making up the bar
wxStaticBitmap *m_icon;
wxStaticText *m_text;
wxBitmapButton *m_button;
// the effects to use when showing/hiding and duration for them: by default
// the effect is determined by the info bar automatically depending on its
// position and the default duration is used
wxShowEffect m_showEffect,
m_hideEffect;
int m_effectDuration;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxInfoBarGeneric);
};
#endif // _WX_GENERIC_INFOBAR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/tabg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/tabg.h
// Purpose: Generic tabbed dialogs; used by wxMotif's wxNotebook
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __TABGH_G__
#define __TABGH_G__
#define WXTAB_VERSION 1.1
#include "wx/hashmap.h"
#include "wx/string.h"
#include "wx/dialog.h"
#include "wx/panel.h"
#include "wx/list.h"
class WXDLLIMPEXP_FWD_CORE wxTabView;
/*
* A wxTabControl is the internal and visual representation
* of the tab.
*/
class WXDLLIMPEXP_CORE wxTabControl: public wxObject
{
wxDECLARE_DYNAMIC_CLASS(wxTabControl);
public:
wxTabControl(wxTabView *v = NULL);
virtual ~wxTabControl(void);
virtual void OnDraw(wxDC& dc, bool lastInRow);
void SetLabel(const wxString& str) { m_controlLabel = str; }
wxString GetLabel(void) const { return m_controlLabel; }
void SetFont(const wxFont& f) { m_labelFont = f; }
wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; }
void SetSelected(bool sel) { m_isSelected = sel; }
bool IsSelected(void) const { return m_isSelected; }
void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; }
void SetSize(int x, int y) { m_width = x; m_height = y; }
void SetRowPosition(int r) { m_rowPosition = r; }
int GetRowPosition() const { return m_rowPosition; }
void SetColPosition(int c) { m_colPosition = c; }
int GetColPosition() const { return m_colPosition; }
int GetX(void) const { return m_offsetX; }
int GetY(void) const { return m_offsetY; }
int GetWidth(void) const { return m_width; }
int GetHeight(void) const { return m_height; }
int GetId(void) const { return m_id; }
void SetId(int i) { m_id = i; }
virtual bool HitTest(int x, int y) const ;
protected:
wxTabView* m_view;
wxString m_controlLabel;
bool m_isSelected;
wxFont m_labelFont;
int m_offsetX; // Offsets from top-left of tab view area (the area below the tabs)
int m_offsetY;
int m_width;
int m_height;
int m_id;
int m_rowPosition; // Position in row from 0
int m_colPosition; // Position in col from 0
};
/*
* Each wxTabLayer is a list of tabs. E.g. there
* are 3 layers in the MS Word Options dialog.
*/
class WXDLLIMPEXP_CORE wxTabLayer: public wxList
{
};
/*
* The wxTabView controls and draws the tabbed object
*/
WX_DECLARE_LIST(wxTabLayer, wxTabLayerList);
#define wxTAB_STYLE_DRAW_BOX 1 // Draws 3D boxes round tab layers
#define wxTAB_STYLE_COLOUR_INTERIOR 2 // Colours interior of tabs, otherwise draws outline
class WXDLLIMPEXP_CORE wxTabView: public wxObject
{
wxDECLARE_DYNAMIC_CLASS(wxTabView);
public:
wxTabView(long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
virtual ~wxTabView();
inline int GetNumberOfLayers() const { return m_layers.GetCount(); }
inline wxTabLayerList& GetLayers() { return m_layers; }
inline void SetWindow(wxWindow* wnd) { m_window = wnd; }
inline wxWindow* GetWindow(void) const { return m_window; }
// Automatically positions tabs
wxTabControl *AddTab(int id, const wxString& label, wxTabControl *existingTab = NULL);
// Remove the tab without deleting the window
bool RemoveTab(int id);
void ClearTabs(bool deleteTabs = true);
bool SetTabText(int id, const wxString& label);
wxString GetTabText(int id) const;
// Layout tabs (optional, e.g. if resizing window)
void LayoutTabs();
// Draw all tabs
virtual void Draw(wxDC& dc);
// Process mouse event, return false if we didn't process it
virtual bool OnEvent(wxMouseEvent& event);
// Called when a tab is activated
virtual void OnTabActivate(int activateId, int deactivateId);
// Allows vetoing
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return true; }
// Allows use of application-supplied wxTabControl classes.
virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); }
void SetHighlightColour(const wxColour& col);
void SetShadowColour(const wxColour& col);
void SetBackgroundColour(const wxColour& col);
inline void SetTextColour(const wxColour& col) { m_textColour = col; }
inline wxColour GetHighlightColour(void) const { return m_highlightColour; }
inline wxColour GetShadowColour(void) const { return m_shadowColour; }
inline wxColour GetBackgroundColour(void) const { return m_backgroundColour; }
inline wxColour GetTextColour(void) const { return m_textColour; }
inline const wxPen *GetHighlightPen(void) const { return m_highlightPen; }
inline const wxPen *GetShadowPen(void) const { return m_shadowPen; }
inline const wxPen *GetBackgroundPen(void) const { return m_backgroundPen; }
inline const wxBrush *GetBackgroundBrush(void) const { return m_backgroundBrush; }
inline void SetViewRect(const wxRect& rect) { m_tabViewRect = rect; }
inline wxRect GetViewRect(void) const { return m_tabViewRect; }
// Calculate tab width to fit to view, and optionally adjust the view
// to fit the tabs exactly.
int CalculateTabWidth(int noTabs, bool adjustView = false);
inline void SetTabStyle(long style) { m_tabStyle = style; }
inline long GetTabStyle(void) const { return m_tabStyle; }
inline void SetTabSize(int w, int h) { m_tabWidth = w; m_tabHeight = h; }
inline int GetTabWidth(void) const { return m_tabWidth; }
inline int GetTabHeight(void) const { return m_tabHeight; }
inline void SetTabSelectionHeight(int h) { m_tabSelectionHeight = h; }
inline int GetTabSelectionHeight(void) const { return m_tabSelectionHeight; }
// Returns the total height of the tabs component -- this may be several
// times the height of a tab, if there are several tab layers (rows).
int GetTotalTabHeight();
inline int GetTopMargin(void) const { return m_topMargin; }
inline void SetTopMargin(int margin) { m_topMargin = margin; }
void SetTabSelection(int sel, bool activateTool = true);
inline int GetTabSelection() const { return m_tabSelection; }
// Find tab control for id
wxTabControl *FindTabControlForId(int id) const ;
// Find tab control for layer, position (starting from zero)
wxTabControl *FindTabControlForPosition(int layer, int position) const ;
inline int GetHorizontalTabOffset() const { return m_tabHorizontalOffset; }
inline int GetHorizontalTabSpacing() const { return m_tabHorizontalSpacing; }
inline void SetHorizontalTabOffset(int sp) { m_tabHorizontalOffset = sp; }
inline void SetHorizontalTabSpacing(int sp) { m_tabHorizontalSpacing = sp; }
inline void SetVerticalTabTextSpacing(int s) { m_tabVerticalTextSpacing = s; }
inline int GetVerticalTabTextSpacing() const { return m_tabVerticalTextSpacing; }
inline wxFont *GetTabFont() const { return (wxFont*) & m_tabFont; }
inline void SetTabFont(const wxFont& f) { m_tabFont = f; }
inline wxFont *GetSelectedTabFont() const { return (wxFont*) & m_tabSelectedFont; }
inline void SetSelectedTabFont(const wxFont& f) { m_tabSelectedFont = f; }
// Find the node and the column at which this control is positioned.
wxList::compatibility_iterator FindTabNodeAndColumn(wxTabControl *control, int *col) const ;
// Do the necessary to change to this tab
virtual bool ChangeTab(wxTabControl *control);
// Move the selected tab to the bottom layer, if necessary,
// without calling app activation code
bool MoveSelectionTab(wxTabControl *control);
inline int GetNumberOfTabs() const { return m_noTabs; }
protected:
// List of layers, from front to back.
wxTabLayerList m_layers;
// Selected tab
int m_tabSelection;
// Usual tab height
int m_tabHeight;
// The height of the selected tab
int m_tabSelectionHeight;
// Usual tab width
int m_tabWidth;
// Space between tabs
int m_tabHorizontalSpacing;
// Space between top of normal tab and text
int m_tabVerticalTextSpacing;
// Horizontal offset of each tab row above the first
int m_tabHorizontalOffset;
// The distance between the bottom of the first tab row
// and the top of the client area (i.e. the margin)
int m_topMargin;
// The position and size of the view above which the tabs are placed.
// I.e., the internal client area of the sheet.
wxRect m_tabViewRect;
// Bitlist of styles
long m_tabStyle;
// Colours
wxColour m_highlightColour;
wxColour m_shadowColour;
wxColour m_backgroundColour;
wxColour m_textColour;
// Pen and brush cache
const wxPen* m_highlightPen;
const wxPen* m_shadowPen;
const wxPen* m_backgroundPen;
const wxBrush* m_backgroundBrush;
wxFont m_tabFont;
wxFont m_tabSelectedFont;
int m_noTabs;
wxWindow* m_window;
};
/*
* A dialog box class that is tab-friendly
*/
class WXDLLIMPEXP_CORE wxTabbedDialog : public wxDialog
{
wxDECLARE_DYNAMIC_CLASS(wxTabbedDialog);
public:
wxTabbedDialog(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long windowStyle = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr);
virtual ~wxTabbedDialog();
wxTabView *GetTabView() const { return m_tabView; }
void SetTabView(wxTabView *v) { m_tabView = v; }
void OnCloseWindow(wxCloseEvent& event);
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
protected:
wxTabView* m_tabView;
private:
wxDECLARE_EVENT_TABLE();
};
/*
* A panel class that is tab-friendly
*/
class WXDLLIMPEXP_CORE wxTabbedPanel : public wxPanel
{
wxDECLARE_DYNAMIC_CLASS(wxTabbedPanel);
public:
wxTabbedPanel(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long windowStyle = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxTabbedPanel();
wxTabView *GetTabView() const { return m_tabView; }
void SetTabView(wxTabView *v) { m_tabView = v; }
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
protected:
wxTabView* m_tabView;
private:
wxDECLARE_EVENT_TABLE();
};
WX_DECLARE_HASH_MAP(int, wxWindow*, wxIntegerHash, wxIntegerEqual,
wxIntToWindowHashMap);
class WXDLLIMPEXP_CORE wxPanelTabView : public wxTabView
{
wxDECLARE_DYNAMIC_CLASS(wxPanelTabView);
public:
wxPanelTabView(wxPanel *pan, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
virtual ~wxPanelTabView(void);
// Called when a tab is activated
virtual void OnTabActivate(int activateId, int deactivateId);
// Specific to this class
void AddTabWindow(int id, wxWindow *window);
wxWindow *GetTabWindow(int id) const ;
void ClearWindows(bool deleteWindows = true);
wxWindow *GetCurrentWindow() const { return m_currentWindow; }
void ShowWindowForTab(int id);
// wxList& GetWindows() const { return (wxList&) m_tabWindows; }
protected:
// List of panels, one for each tab. Indexed
// by tab ID.
wxIntToWindowHashMap m_tabWindows;
wxWindow* m_currentWindow;
wxPanel* m_panel;
};
#endif
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dataview.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dataview.h
// Purpose: wxDataViewCtrl generic implementation header
// Author: Robert Roebling
// Modified By: Bo Yang
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GENERICDATAVIEWCTRLH__
#define __GENERICDATAVIEWCTRLH__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/scrolwin.h"
#include "wx/icon.h"
#include "wx/vector.h"
#if wxUSE_ACCESSIBILITY
#include "wx/access.h"
#endif // wxUSE_ACCESSIBILITY
class WXDLLIMPEXP_FWD_CORE wxDataViewMainWindow;
class WXDLLIMPEXP_FWD_CORE wxDataViewHeaderWindow;
#if wxUSE_ACCESSIBILITY
class WXDLLIMPEXP_FWD_CORE wxDataViewCtrlAccessible;
#endif // wxUSE_ACCESSIBILITY
// ---------------------------------------------------------
// wxDataViewColumn
// ---------------------------------------------------------
class WXDLLIMPEXP_CORE 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)
: wxDataViewColumnBase(renderer, model_column),
m_title(title)
{
Init(width, align, flags);
}
wxDataViewColumn(const wxBitmap& bitmap,
wxDataViewRenderer *renderer,
unsigned int model_column,
int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE)
: wxDataViewColumnBase(bitmap, renderer, model_column)
{
Init(width, align, flags);
}
// implement wxHeaderColumnBase methods
virtual void SetTitle(const wxString& title) wxOVERRIDE
{
m_title = title;
UpdateWidth();
}
virtual wxString GetTitle() const wxOVERRIDE
{
return m_title;
}
virtual void SetWidth(int width) wxOVERRIDE
{
// As a small optimization, use this method to avoid calling
// UpdateWidth() if the width didn't really change, even if we don't
// care about its return value.
(void)WXUpdateWidth(width);
}
virtual int GetWidth() const wxOVERRIDE;
virtual void SetMinWidth(int minWidth) wxOVERRIDE
{
m_minWidth = minWidth;
UpdateWidth();
}
virtual int GetMinWidth() const wxOVERRIDE
{
return m_minWidth;
}
virtual void SetAlignment(wxAlignment align) wxOVERRIDE
{
m_align = align;
UpdateDisplay();
}
virtual wxAlignment GetAlignment() const wxOVERRIDE
{
return m_align;
}
virtual void SetFlags(int flags) wxOVERRIDE
{
m_flags = flags;
UpdateDisplay();
}
virtual int GetFlags() const wxOVERRIDE
{
return m_flags;
}
virtual bool IsSortKey() const wxOVERRIDE
{
return m_sort;
}
virtual void UnsetAsSortKey() wxOVERRIDE;
virtual void SetSortOrder(bool ascending) wxOVERRIDE;
virtual bool IsSortOrderAscending() const wxOVERRIDE
{
return m_sortAscending;
}
virtual void SetBitmap( const wxBitmap& bitmap ) wxOVERRIDE
{
wxDataViewColumnBase::SetBitmap(bitmap);
UpdateWidth();
}
// This method is specific to the generic implementation and is used only
// by wxWidgets itself.
bool WXUpdateWidth(int width)
{
if ( width == m_width )
return false;
m_width = width;
UpdateWidth();
return true;
}
private:
// common part of all ctors
void Init(int width, wxAlignment align, int flags);
// These methods forward to wxDataViewCtrl::OnColumnChange() and
// OnColumnWidthChange() respectively, i.e. the latter is stronger than the
// former.
void UpdateDisplay();
void UpdateWidth();
wxString m_title;
int m_width,
m_minWidth;
wxAlignment m_align;
int m_flags;
bool m_sort,
m_sortAscending;
friend class wxDataViewHeaderWindowBase;
friend class wxDataViewHeaderWindow;
friend class wxDataViewHeaderWindowMSW;
};
// ---------------------------------------------------------
// wxDataViewCtrl
// ---------------------------------------------------------
WX_DECLARE_LIST_WITH_DECL(wxDataViewColumn, wxDataViewColumnList,
class WXDLLIMPEXP_CORE);
class WXDLLIMPEXP_CORE wxDataViewCtrl : public wxDataViewCtrlBase,
public wxScrollHelper
{
friend class wxDataViewMainWindow;
friend class wxDataViewHeaderWindowBase;
friend class wxDataViewHeaderWindow;
friend class wxDataViewHeaderWindowMSW;
friend class wxDataViewColumn;
#if wxUSE_ACCESSIBILITY
friend class wxDataViewCtrlAccessible;
#endif // wxUSE_ACCESSIBILITY
public:
wxDataViewCtrl() : wxScrollHelper(this)
{
Init();
}
wxDataViewCtrl( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr )
: wxScrollHelper(this)
{
Create(parent, id, pos, size, style, validator, name);
}
virtual ~wxDataViewCtrl();
void Init();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr);
virtual bool AssociateModel( wxDataViewModel *model ) wxOVERRIDE;
virtual bool AppendColumn( wxDataViewColumn *col ) wxOVERRIDE;
virtual bool PrependColumn( wxDataViewColumn *col ) wxOVERRIDE;
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ) wxOVERRIDE;
virtual void DoSetExpanderColumn() wxOVERRIDE;
virtual void DoSetIndent() wxOVERRIDE;
virtual unsigned int GetColumnCount() const wxOVERRIDE;
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const wxOVERRIDE;
virtual bool DeleteColumn( wxDataViewColumn *column ) wxOVERRIDE;
virtual bool ClearColumns() wxOVERRIDE;
virtual int GetColumnPosition( const wxDataViewColumn *column ) const wxOVERRIDE;
virtual wxDataViewColumn *GetSortingColumn() const wxOVERRIDE;
virtual wxVector<wxDataViewColumn *> GetSortingColumns() const wxOVERRIDE;
virtual wxDataViewItem GetTopItem() const wxOVERRIDE;
virtual int GetCountPerPage() const wxOVERRIDE;
virtual int GetSelectedItemsCount() const wxOVERRIDE;
virtual int GetSelections( wxDataViewItemArray & sel ) const wxOVERRIDE;
virtual void SetSelections( const wxDataViewItemArray & sel ) wxOVERRIDE;
virtual void Select( const wxDataViewItem & item ) wxOVERRIDE;
virtual void Unselect( const wxDataViewItem & item ) wxOVERRIDE;
virtual bool IsSelected( const wxDataViewItem & item ) const wxOVERRIDE;
virtual void SelectAll() wxOVERRIDE;
virtual void UnselectAll() wxOVERRIDE;
virtual void EnsureVisible( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL ) wxOVERRIDE;
virtual void HitTest( const wxPoint & point, wxDataViewItem & item,
wxDataViewColumn* &column ) const wxOVERRIDE;
virtual wxRect GetItemRect( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL ) const wxOVERRIDE;
virtual bool SetRowHeight( int rowHeight ) wxOVERRIDE;
virtual void Collapse( const wxDataViewItem & item ) wxOVERRIDE;
virtual bool IsExpanded( const wxDataViewItem & item ) const wxOVERRIDE;
virtual void SetFocus() wxOVERRIDE;
virtual bool SetFont(const wxFont & font) wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual bool Show(bool show = true) wxOVERRIDE;
virtual void SetName(const wxString &name) wxOVERRIDE;
virtual bool Reparent(wxWindowBase *newParent) wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual bool AllowMultiColumnSort(bool allow) wxOVERRIDE;
virtual bool IsMultiColumnSortAllowed() const wxOVERRIDE { return m_allowMultiColumnSort; }
virtual void ToggleSortByColumn(int column) wxOVERRIDE;
#if wxUSE_DRAG_AND_DROP
virtual bool EnableDragSource( const wxDataFormat &format ) wxOVERRIDE;
virtual bool EnableDropTarget( const wxDataFormat &format ) wxOVERRIDE;
#endif // wxUSE_DRAG_AND_DROP
virtual wxBorder GetDefaultBorder() const wxOVERRIDE;
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) wxOVERRIDE;
virtual bool SetHeaderAttr(const wxItemAttr& attr) wxOVERRIDE;
virtual bool SetAlternateRowColour(const wxColour& colour) wxOVERRIDE;
// This method is specific to generic wxDataViewCtrl implementation and
// should not be used in portable code.
wxColour GetAlternateRowColour() const { return m_alternateRowColour; }
// The returned pointer is null if the control has wxDV_NO_HEADER style.
//
// This method is only available in the generic versions.
wxHeaderCtrl* GenericGetHeader() const;
protected:
void EnsureVisibleRowCol( int row, int column );
// Notice that row here may be invalid (i.e. >= GetRowCount()), this is not
// an error and this function simply returns an invalid item in this case.
wxDataViewItem GetItemByRow( unsigned int row ) const;
int GetRowByItem( const wxDataViewItem & item ) const;
// Mark the column as being used or not for sorting.
void UseColumnForSorting(int idx);
void DontUseColumnForSorting(int idx);
// Return true if the given column is sorted
bool IsColumnSorted(int idx) const;
// Reset all columns currently used for sorting.
void ResetAllSortColumns();
virtual void DoEnableSystemTheme(bool enable, wxWindow* window) wxOVERRIDE;
public: // utility functions not part of the API
// returns the "best" width for the idx-th column
unsigned int GetBestColumnWidth(int idx) const;
// called by header window after reorder
void ColumnMoved( wxDataViewColumn* col, unsigned int new_pos );
// update the display after a change to an individual column
void OnColumnChange(unsigned int idx);
// update after the column width changes, also calls OnColumnChange()
void OnColumnWidthChange(unsigned int idx);
// update after a change to the number of columns
void OnColumnsCountChanged();
wxWindow *GetMainWindow() { return (wxWindow*) m_clientArea; }
// return the index of the given column in m_cols
int GetColumnIndex(const wxDataViewColumn *column) const;
// Return the index of the column having the given model index.
int GetModelColumnIndex(unsigned int model_column) const;
// return the column displayed at the given position in the control
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
virtual wxDataViewColumn *GetCurrentColumn() const wxOVERRIDE;
virtual void OnInternalIdle() wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual wxAccessible* CreateAccessible() wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
private:
virtual wxDataViewItem DoGetCurrentItem() const wxOVERRIDE;
virtual void DoSetCurrentItem(const wxDataViewItem& item) wxOVERRIDE;
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
void InvalidateColBestWidths();
void InvalidateColBestWidth(int idx);
void UpdateColWidths();
wxDataViewColumnList m_cols;
// cached column best widths information, values are for
// respective columns from m_cols and the arrays have same size
struct CachedColWidthInfo
{
CachedColWidthInfo() : width(0), dirty(true) {}
int width; // cached width or 0 if not computed
bool dirty; // column was invalidated, header needs updating
};
wxVector<CachedColWidthInfo> m_colsBestWidths;
// This indicates that at least one entry in m_colsBestWidths has 'dirty'
// flag set. It's cheaper to check one flag in OnInternalIdle() than to
// iterate over m_colsBestWidths to check if anything needs to be done.
bool m_colsDirty;
wxDataViewModelNotifier *m_notifier;
wxDataViewMainWindow *m_clientArea;
wxDataViewHeaderWindow *m_headerArea;
// user defined color to draw row lines, may be invalid
wxColour m_alternateRowColour;
// columns indices used for sorting, empty if nothing is sorted
wxVector<int> m_sortingColumnIdxs;
// if true, allow sorting by more than one column
bool m_allowMultiColumnSort;
private:
void OnSize( wxSizeEvent &event );
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size) wxOVERRIDE;
// we need to return a special WM_GETDLGCODE value to process just the
// arrows but let the other navigation characters through
#ifdef __WXMSW__
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE;
#endif // __WXMSW__
WX_FORWARD_TO_SCROLL_HELPER()
private:
wxDECLARE_DYNAMIC_CLASS(wxDataViewCtrl);
wxDECLARE_NO_COPY_CLASS(wxDataViewCtrl);
wxDECLARE_EVENT_TABLE();
};
#if wxUSE_ACCESSIBILITY
//-----------------------------------------------------------------------------
// wxDataViewCtrlAccessible
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewCtrlAccessible: public wxWindowAccessible
{
public:
wxDataViewCtrlAccessible(wxDataViewCtrl* win);
virtual ~wxDataViewCtrlAccessible() {}
virtual wxAccStatus HitTest(const wxPoint& pt, int* childId,
wxAccessible** childObject) wxOVERRIDE;
virtual wxAccStatus GetLocation(wxRect& rect, int elementId) wxOVERRIDE;
virtual wxAccStatus Navigate(wxNavDir navDir, int fromId,
int* toId, wxAccessible** toObject) wxOVERRIDE;
virtual wxAccStatus GetName(int childId, wxString* name) wxOVERRIDE;
virtual wxAccStatus GetChildCount(int* childCount) wxOVERRIDE;
virtual wxAccStatus GetChild(int childId, wxAccessible** child) wxOVERRIDE;
// wxWindowAccessible::GetParent() implementation is enough.
// virtual wxAccStatus GetParent(wxAccessible** parent) wxOVERRIDE;
virtual wxAccStatus DoDefaultAction(int childId) wxOVERRIDE;
virtual wxAccStatus GetDefaultAction(int childId, wxString* actionName) wxOVERRIDE;
virtual wxAccStatus GetDescription(int childId, wxString* description) wxOVERRIDE;
virtual wxAccStatus GetHelpText(int childId, wxString* helpText) wxOVERRIDE;
virtual wxAccStatus GetKeyboardShortcut(int childId, wxString* shortcut) wxOVERRIDE;
virtual wxAccStatus GetRole(int childId, wxAccRole* role) wxOVERRIDE;
virtual wxAccStatus GetState(int childId, long* state) wxOVERRIDE;
virtual wxAccStatus GetValue(int childId, wxString* strValue) wxOVERRIDE;
virtual wxAccStatus Select(int childId, wxAccSelectionFlags selectFlags) wxOVERRIDE;
virtual wxAccStatus GetFocus(int* childId, wxAccessible** child) wxOVERRIDE;
virtual wxAccStatus GetSelections(wxVariant* selections) wxOVERRIDE;
};
#endif // wxUSE_ACCESSIBILITY
#endif // __GENERICDATAVIEWCTRLH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/accel.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/accel.h
// Purpose: wxAcceleratorTable class
// Author: Robert Roebling
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_ACCEL_H_
#define _WX_GENERIC_ACCEL_H_
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
// ----------------------------------------------------------------------------
// wxAcceleratorTable
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
{
public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
virtual ~wxAcceleratorTable();
bool Ok() const { return IsOk(); }
bool IsOk() const;
void Add(const wxAcceleratorEntry& entry);
void Remove(const wxAcceleratorEntry& entry);
// implementation
// --------------
wxMenuItem *GetMenuItem(const wxKeyEvent& event) const;
int GetCommand(const wxKeyEvent& event) const;
const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const;
protected:
// ref counting code
virtual wxObjectRefData *CreateRefData() const wxOVERRIDE;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxAcceleratorTable);
};
#endif // _WX_GENERIC_ACCEL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dvrenderer.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dvrenderer.h
// Purpose: wxDataViewRenderer for generic wxDataViewCtrl implementation
// Author: Robert Roebling, Vadim Zeitlin
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
// Copyright: (c) 2006 Robert Roebling
// (c) 2009 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_DVRENDERER_H_
#define _WX_GENERIC_DVRENDERER_H_
// ----------------------------------------------------------------------------
// wxDataViewRenderer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewCustomRendererBase
{
public:
wxDataViewRenderer( const wxString &varianttype,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual ~wxDataViewRenderer();
virtual wxDC *GetDC() wxOVERRIDE;
virtual void SetAlignment( int align ) wxOVERRIDE;
virtual int GetAlignment() const wxOVERRIDE;
virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE) wxOVERRIDE
{ m_ellipsizeMode = mode; }
virtual wxEllipsizeMode GetEllipsizeMode() const wxOVERRIDE
{ return m_ellipsizeMode; }
virtual void SetMode( wxDataViewCellMode mode ) wxOVERRIDE
{ m_mode = mode; }
virtual wxDataViewCellMode GetMode() const wxOVERRIDE
{ return m_mode; }
// implementation
// This callback is used by generic implementation of wxDVC itself. It's
// different from the corresponding ActivateCell() method which should only
// be overridable for the custom renderers while the generic implementation
// uses this one for all of them, including the standard ones.
virtual bool WXActivateCell(const wxRect& WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model),
const wxDataViewItem & WXUNUSED(item),
unsigned int WXUNUSED(col),
const wxMouseEvent* WXUNUSED(mouseEvent))
{ return false; }
void SetState(int state) { m_state = state; }
protected:
virtual bool IsHighlighted() const wxOVERRIDE
{ return m_state & wxDATAVIEW_CELL_SELECTED; }
private:
int m_align;
wxDataViewCellMode m_mode;
wxEllipsizeMode m_ellipsizeMode;
wxDC *m_dc;
int m_state;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer);
};
#endif // _WX_GENERIC_DVRENDERER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/paletteg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/paletteg.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Copyright: (c) 1998 Robert Roebling and Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_PALETTEG_H__
#define __WX_PALETTEG_H__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxPalette;
//-----------------------------------------------------------------------------
// wxPalette
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
{
public:
wxPalette();
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
virtual ~wxPalette();
bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
int GetPixel( unsigned char red, unsigned char green, unsigned char blue ) const;
bool GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const;
virtual int GetColoursCount() const wxOVERRIDE;
protected:
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxPalette);
};
#endif // __WX_PALETTEG_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/collpaneg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/collpaneg.h
// Purpose: wxGenericCollapsiblePane
// Author: Francesco Montorsi
// Modified by:
// Created: 8/10/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLLAPSABLE_PANE_H_GENERIC_
#define _WX_COLLAPSABLE_PANE_H_GENERIC_
// forward declared
class WXDLLIMPEXP_FWD_CORE wxCollapsibleHeaderCtrl;
#include "wx/containr.h"
// ----------------------------------------------------------------------------
// wxGenericCollapsiblePane
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane :
public wxNavigationEnabled<wxCollapsiblePaneBase>
{
public:
wxGenericCollapsiblePane() { Init(); }
wxGenericCollapsiblePane(wxWindow *parent,
wxWindowID winid,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCP_DEFAULT_STYLE,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr)
{
Init();
Create(parent, winid, label, pos, size, style, val, name);
}
virtual ~wxGenericCollapsiblePane();
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCP_DEFAULT_STYLE,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr);
// public wxCollapsiblePane API
virtual void Collapse(bool collapse = true) wxOVERRIDE;
virtual void SetLabel(const wxString &label) wxOVERRIDE;
virtual bool IsCollapsed() const wxOVERRIDE
{ return m_pPane==NULL || !m_pPane->IsShown(); }
virtual wxWindow *GetPane() const wxOVERRIDE
{ return m_pPane; }
virtual wxString GetLabel() const wxOVERRIDE;
virtual bool Layout() wxOVERRIDE;
// for the generic collapsible pane only:
wxControl* GetControlWidget() const
{ return (wxControl*)m_pButton; }
// implementation only, don't use
void OnStateChange(const wxSize& sizeNew);
protected:
// overridden methods
virtual wxSize DoGetBestSize() const wxOVERRIDE;
int GetBorder() const;
// child controls
wxCollapsibleHeaderCtrl *m_pButton;
wxWindow *m_pPane;
wxSizer *m_sz;
private:
void Init();
// event handlers
void OnButton(wxCommandEvent &ev);
void OnSize(wxSizeEvent &ev);
wxDECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane);
wxDECLARE_EVENT_TABLE();
};
#endif // _WX_COLLAPSABLE_PANE_H_GENERIC_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/filedlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/filedlgg.h
// Purpose: wxGenericFileDialog
// Author: Robert Roebling
// Modified by:
// Created: 8/17/99
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEDLGG_H_
#define _WX_FILEDLGG_H_
#include "wx/listctrl.h"
#include "wx/datetime.h"
#include "wx/filefn.h"
#include "wx/artprov.h"
#include "wx/filedlg.h"
#include "wx/generic/filectrlg.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
class WXDLLIMPEXP_FWD_CORE wxGenericFileCtrl;
class WXDLLIMPEXP_FWD_CORE wxGenericFileDialog;
class WXDLLIMPEXP_FWD_CORE wxFileCtrlEvent;
//-------------------------------------------------------------------------
// wxGenericFileDialog
//-------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericFileDialog: public wxFileDialogBase
{
public:
wxGenericFileDialog() : wxFileDialogBase() { Init(); }
wxGenericFileDialog(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 bypassGenericImpl = false );
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,
bool bypassGenericImpl = false );
virtual ~wxGenericFileDialog();
virtual void SetDirectory(const wxString& dir) wxOVERRIDE
{ m_filectrl->SetDirectory(dir); }
virtual void SetFilename(const wxString& name) wxOVERRIDE
{ m_filectrl->SetFilename(name); }
virtual void SetMessage(const wxString& message) wxOVERRIDE { SetTitle(message); }
virtual void SetPath(const wxString& path) wxOVERRIDE
{ m_filectrl->SetPath(path); }
virtual void SetFilterIndex(int filterIndex) wxOVERRIDE
{ m_filectrl->SetFilterIndex(filterIndex); }
virtual void SetWildcard(const wxString& wildCard) wxOVERRIDE
{ m_filectrl->SetWildcard(wildCard); }
virtual wxString GetPath() const wxOVERRIDE
{ return m_filectrl->GetPath(); }
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE
{ m_filectrl->GetPaths(paths); }
virtual wxString GetDirectory() const wxOVERRIDE
{ return m_filectrl->GetDirectory(); }
virtual wxString GetFilename() const wxOVERRIDE
{ return m_filectrl->GetFilename(); }
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE
{ m_filectrl->GetFilenames(files); }
virtual wxString GetWildcard() const wxOVERRIDE
{ return m_filectrl->GetWildcard(); }
virtual int GetFilterIndex() const wxOVERRIDE
{ return m_filectrl->GetFilterIndex(); }
virtual bool SupportsExtraControl() const wxOVERRIDE { return true; }
// implementation only from now on
// -------------------------------
virtual int ShowModal() wxOVERRIDE;
virtual bool Show( bool show = true ) wxOVERRIDE;
void OnList( wxCommandEvent &event );
void OnReport( wxCommandEvent &event );
void OnUp( wxCommandEvent &event );
void OnHome( wxCommandEvent &event );
void OnOk( wxCommandEvent &event );
void OnNew( wxCommandEvent &event );
void OnFileActivated( wxFileCtrlEvent &event);
private:
// if true, don't use this implementation at all
bool m_bypassGenericImpl;
protected:
// update the state of m_upDirButton and m_newDirButton depending on the
// currently selected directory
void OnUpdateButtonsUI(wxUpdateUIEvent& event);
wxString m_filterExtension;
wxGenericFileCtrl *m_filectrl;
wxBitmapButton *m_upDirButton;
wxBitmapButton *m_newDirButton;
private:
void Init();
wxBitmapButton* AddBitmapButton( wxWindowID winId, const wxArtID& artId,
const wxString& tip, wxSizer *sizer );
wxDECLARE_DYNAMIC_CLASS(wxGenericFileDialog);
wxDECLARE_EVENT_TABLE();
// these variables are preserved between wxGenericFileDialog calls
static long ms_lastViewStyle; // list or report?
static bool ms_lastShowHidden; // did we show hidden files?
};
#ifdef wxHAS_GENERIC_FILEDIALOG
class WXDLLIMPEXP_CORE wxFileDialog: public wxGenericFileDialog
{
public:
wxFileDialog() {}
wxFileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize)
:wxGenericFileDialog(parent, message,
defaultDir, defaultFile, wildCard,
style,
pos, size)
{
}
private:
wxDECLARE_DYNAMIC_CLASS(wxFileDialog);
};
#endif // wxHAS_GENERIC_FILEDIALOG
#endif // _WX_FILEDLGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/laywin.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/laywin.h
// Purpose: Implements a simple layout algorithm, plus
// wxSashLayoutWindow which is an example of a window with
// layout-awareness (via event handlers). This is suited to
// IDE-style window layout.
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LAYWIN_H_G_
#define _WX_LAYWIN_H_G_
#if wxUSE_SASH
#include "wx/sashwin.h"
#endif // wxUSE_SASH
#include "wx/event.h"
class WXDLLIMPEXP_FWD_CORE wxQueryLayoutInfoEvent;
class WXDLLIMPEXP_FWD_CORE wxCalculateLayoutEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_QUERY_LAYOUT_INFO, wxQueryLayoutInfoEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALCULATE_LAYOUT, wxCalculateLayoutEvent );
enum wxLayoutOrientation
{
wxLAYOUT_HORIZONTAL,
wxLAYOUT_VERTICAL
};
enum wxLayoutAlignment
{
wxLAYOUT_NONE,
wxLAYOUT_TOP,
wxLAYOUT_LEFT,
wxLAYOUT_RIGHT,
wxLAYOUT_BOTTOM
};
// Not sure this is necessary
// Tell window which dimension we're sizing on
#define wxLAYOUT_LENGTH_Y 0x0008
#define wxLAYOUT_LENGTH_X 0x0000
// Use most recently used length
#define wxLAYOUT_MRU_LENGTH 0x0010
// Only a query, so don't actually move it.
#define wxLAYOUT_QUERY 0x0100
/*
* This event is used to get information about window alignment,
* orientation and size.
*/
class WXDLLIMPEXP_CORE wxQueryLayoutInfoEvent: public wxEvent
{
public:
wxQueryLayoutInfoEvent(wxWindowID id = 0)
{
SetEventType(wxEVT_QUERY_LAYOUT_INFO);
m_requestedLength = 0;
m_flags = 0;
m_id = id;
m_alignment = wxLAYOUT_TOP;
m_orientation = wxLAYOUT_HORIZONTAL;
}
// Read by the app
void SetRequestedLength(int length) { m_requestedLength = length; }
int GetRequestedLength() const { return m_requestedLength; }
void SetFlags(int flags) { m_flags = flags; }
int GetFlags() const { return m_flags; }
// Set by the app
void SetSize(const wxSize& size) { m_size = size; }
wxSize GetSize() const { return m_size; }
void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; }
wxLayoutOrientation GetOrientation() const { return m_orientation; }
void SetAlignment(wxLayoutAlignment align) { m_alignment = align; }
wxLayoutAlignment GetAlignment() const { return m_alignment; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxQueryLayoutInfoEvent(*this); }
protected:
int m_flags;
int m_requestedLength;
wxSize m_size;
wxLayoutOrientation m_orientation;
wxLayoutAlignment m_alignment;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxQueryLayoutInfoEvent);
};
typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&);
#define wxQueryLayoutInfoEventHandler( func ) \
wxEVENT_HANDLER_CAST( wxQueryLayoutInfoEventFunction, func )
#define EVT_QUERY_LAYOUT_INFO(func) \
wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, wxQueryLayoutInfoEventHandler( func ), NULL ),
/*
* This event is used to take a bite out of the available client area.
*/
class WXDLLIMPEXP_CORE wxCalculateLayoutEvent: public wxEvent
{
public:
wxCalculateLayoutEvent(wxWindowID id = 0)
{
SetEventType(wxEVT_CALCULATE_LAYOUT);
m_flags = 0;
m_id = id;
}
// Read by the app
void SetFlags(int flags) { m_flags = flags; }
int GetFlags() const { return m_flags; }
// Set by the app
void SetRect(const wxRect& rect) { m_rect = rect; }
wxRect GetRect() const { return m_rect; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxCalculateLayoutEvent(*this); }
protected:
int m_flags;
wxRect m_rect;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCalculateLayoutEvent);
};
typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&);
#define wxCalculateLayoutEventHandler( func ) wxEVENT_HANDLER_CAST(wxCalculateLayoutEventFunction, func)
#define EVT_CALCULATE_LAYOUT(func) \
wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, wxCalculateLayoutEventHandler( func ), NULL ),
#if wxUSE_SASH
// This is window that can remember alignment/orientation, does its own layout,
// and can provide sashes too. Useful for implementing docked windows with sashes in
// an IDE-style interface.
class WXDLLIMPEXP_CORE wxSashLayoutWindow: public wxSashWindow
{
public:
wxSashLayoutWindow()
{
Init();
}
wxSashLayoutWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"))
{
Create(parent, id, pos, size, style, name);
}
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"));
// Accessors
inline wxLayoutAlignment GetAlignment() const { return m_alignment; }
inline wxLayoutOrientation GetOrientation() const { return m_orientation; }
inline void SetAlignment(wxLayoutAlignment align) { m_alignment = align; }
inline void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; }
// Give the window default dimensions
inline void SetDefaultSize(const wxSize& size) { m_defaultSize = size; }
// Event handlers
// Called by layout algorithm to allow window to take a bit out of the
// client rectangle, and size itself if not in wxLAYOUT_QUERY mode.
void OnCalculateLayout(wxCalculateLayoutEvent& event);
// Called by layout algorithm to retrieve information about the window.
void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event);
private:
void Init();
wxLayoutAlignment m_alignment;
wxLayoutOrientation m_orientation;
wxSize m_defaultSize;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxSashLayoutWindow);
wxDECLARE_EVENT_TABLE();
};
#endif // wxUSE_SASH
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
class WXDLLIMPEXP_FWD_CORE wxFrame;
// This class implements the layout algorithm
class WXDLLIMPEXP_CORE wxLayoutAlgorithm: public wxObject
{
public:
wxLayoutAlgorithm() {}
#if wxUSE_MDI_ARCHITECTURE
// The MDI client window is sized to whatever's left over.
bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
#endif // wxUSE_MDI_ARCHITECTURE
// mainWindow is sized to whatever's left over. This function for backward
// compatibility; use LayoutWindow.
bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
// mainWindow is sized to whatever's left over.
bool LayoutWindow(wxWindow* frame, wxWindow* mainWindow = NULL);
};
#endif
// _WX_LAYWIN_H_G_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/panelg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/panelg.h
// Purpose: wxPanel: a container for child controls
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_PANELG_H_
#define _WX_GENERIC_PANELG_H_
#include "wx/bitmap.h"
class WXDLLIMPEXP_CORE wxPanel : public wxPanelBase
{
public:
wxPanel() { }
// Constructor
wxPanel(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr)
{
Create(parent, winid, pos, size, style, name);
}
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_CONSTRUCTOR(
wxPanel(wxWindow *parent,
int x, int y, int width, int height,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr)
{
Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
}
)
#endif // WXWIN_COMPATIBILITY_2_8
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel);
};
#endif // _WX_GENERIC_PANELG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dragimgg.h | //////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dragimgg.h
// Purpose: wxDragImage class: a kind of a cursor, that can cope
// with more sophisticated images
// Author: Julian Smart
// Modified by:
// Created: 29/2/2000
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DRAGIMGG_H_
#define _WX_DRAGIMGG_H_
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/cursor.h"
#include "wx/treectrl.h"
#include "wx/listctrl.h"
#include "wx/log.h"
#include "wx/overlay.h"
/*
To use this class, create a wxDragImage when you start dragging, for example:
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
{
#ifdef __WXMSW__
::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets
#endif
CaptureMouse();
m_dragImage = new wxDragImage(* this, itemId);
m_dragImage->BeginDrag(wxPoint(0, 0), this);
m_dragImage->Move(pt, this);
m_dragImage->Show(this);
...
}
In your OnMouseMove function, hide the image, do any display updating required,
then move and show the image again:
void MyTreeCtrl::OnMouseMove(wxMouseEvent& event)
{
if (m_dragMode == MY_TREE_DRAG_NONE)
{
event.Skip();
return;
}
// Prevent screen corruption by hiding the image
if (m_dragImage)
m_dragImage->Hide(this);
// Do some updating of the window, such as highlighting the drop target
...
#ifdef __WXMSW__
if (updateWindow)
::UpdateWindow((HWND) GetHWND());
#endif
// Move and show the image again
m_dragImage->Move(event.GetPosition(), this);
m_dragImage->Show(this);
}
Eventually we end the drag and delete the drag image.
void MyTreeCtrl::OnLeftUp(wxMouseEvent& event)
{
...
// End the drag and delete the drag image
if (m_dragImage)
{
m_dragImage->EndDrag(this);
delete m_dragImage;
m_dragImage = NULL;
}
ReleaseMouse();
}
*/
/*
* wxGenericDragImage
*/
class WXDLLIMPEXP_CORE wxGenericDragImage: public wxObject
{
public:
// Ctors & dtor
////////////////////////////////////////////////////////////////////////////
wxGenericDragImage(const wxCursor& cursor = wxNullCursor)
{
Init();
Create(cursor);
}
wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor)
{
Init();
Create(image, cursor);
}
wxGenericDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor)
{
Init();
Create(image, cursor);
}
wxGenericDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor)
{
Init();
Create(str, cursor);
}
#if wxUSE_TREECTRL
wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
{
Init();
Create(treeCtrl, id);
}
#endif
#if wxUSE_LISTCTRL
wxGenericDragImage(const wxListCtrl& listCtrl, long id)
{
Init();
Create(listCtrl, id);
}
#endif
virtual ~wxGenericDragImage();
// Attributes
////////////////////////////////////////////////////////////////////////////
#ifdef wxHAS_NATIVE_OVERLAY
// backing store is not used when native overlays are
void SetBackingBitmap(wxBitmap* WXUNUSED(bitmap)) { }
#else
// For efficiency, tell wxGenericDragImage to use a bitmap that's already
// created (e.g. from last drag)
void SetBackingBitmap(wxBitmap* bitmap) { m_pBackingBitmap = bitmap; }
#endif // wxHAS_NATIVE_OVERLAY/!wxHAS_NATIVE_OVERLAY
// Operations
////////////////////////////////////////////////////////////////////////////
// Create a drag image with a virtual image (need to override DoDrawImage, GetImageRect)
bool Create(const wxCursor& cursor = wxNullCursor);
// Create a drag image from a bitmap and optional cursor
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
// Create a drag image from an icon and optional cursor
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
// Create a drag image from a string and optional cursor
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor);
#if wxUSE_TREECTRL
// Create a drag image for the given tree control item
bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
#endif
#if wxUSE_LISTCTRL
// Create a drag image for the given list control item
bool Create(const wxListCtrl& listCtrl, long id);
#endif
// Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image.
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = false, wxRect* rect = NULL);
// Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image. This is full screen only. fullScreenRect gives the
// position of the window on the screen, to restrict the drag to.
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect);
// End drag
bool EndDrag();
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
// is non-NULL, or in screen coordinates if NULL.
bool Move(const wxPoint& pt);
// Show the image
bool Show();
// Hide the image
bool Hide();
// Implementation
////////////////////////////////////////////////////////////////////////////
void Init();
// Override this if you are using a virtual image (drawing your own image)
virtual wxRect GetImageRect(const wxPoint& pos) const;
// Override this if you are using a virtual image (drawing your own image)
virtual bool DoDrawImage(wxDC& dc, const wxPoint& pos) const;
// Override this if you wish to draw the window contents to the backing bitmap
// yourself. This can be desirable if you wish to avoid flicker by not having to
// redraw the window itself before dragging in order to be graphic-minus-dragged-objects.
// Instead, paint the drag image's backing bitmap to be correct, and leave the window
// to be updated only when dragging the objects away (thus giving a smoother appearance).
virtual bool UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC,
const wxRect& sourceRect, const wxRect& destRect) const;
// Erase and redraw simultaneously if possible
virtual bool RedrawImage(const wxPoint& oldPos, const wxPoint& newPos, bool eraseOld, bool drawNew);
protected:
wxBitmap m_bitmap;
wxIcon m_icon;
wxCursor m_cursor;
wxCursor m_oldCursor;
// wxPoint m_hotspot;
wxPoint m_offset; // The hostpot value passed to BeginDrag
wxPoint m_position;
bool m_isDirty;
bool m_isShown;
wxWindow* m_window;
wxDC* m_windowDC;
#ifdef wxHAS_NATIVE_OVERLAY
wxOverlay m_overlay;
wxDCOverlay* m_dcOverlay;
#else
// Stores the window contents while we're dragging the image around
wxBitmap m_backingBitmap;
wxBitmap* m_pBackingBitmap; // Pointer to existing backing bitmap
// (pass to wxGenericDragImage as an efficiency measure)
// A temporary bitmap for repairing/redrawing
wxBitmap m_repairBitmap;
#endif // !wxHAS_NATIVE_OVERLAY
wxRect m_boundingRect;
bool m_fullScreen;
private:
wxDECLARE_DYNAMIC_CLASS(wxGenericDragImage);
wxDECLARE_NO_COPY_CLASS(wxGenericDragImage);
};
#endif
// _WX_DRAGIMGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/stattextg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/stattextg.h
// Purpose: wxGenericStaticText header
// Author: Marcin Wojdyr
// Created: 2008-06-26
// Copyright: Marcin Wojdyr
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_STATTEXTG_H_
#define _WX_GENERIC_STATTEXTG_H_
// prevent it from including the platform-specific wxStaticText declaration as
// this is not going to compile if it derives from wxGenericStaticText defined
// below (currently this is only the case in wxUniv but it could also happen
// with other ports)
#define wxNO_PORT_STATTEXT_INCLUDE
#include "wx/stattext.h"
#undef wxNO_PORT_STATTEXT_INCLUDE
class WXDLLIMPEXP_CORE wxGenericStaticText : public wxStaticTextBase
{
public:
wxGenericStaticText() { Init(); }
wxGenericStaticText(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticTextNameStr)
{
Init();
Create(parent, id, label, pos, size, style, name);
}
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 ~wxGenericStaticText();
// overridden base class virtual methods
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual bool SetFont(const wxFont &font) wxOVERRIDE;
protected:
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
virtual wxString DoGetLabel() const wxOVERRIDE { return m_label; }
virtual void DoSetLabel(const wxString& label) wxOVERRIDE;
void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE;
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup) wxOVERRIDE;
#endif // wxUSE_MARKUP
private:
void Init()
{
#if wxUSE_MARKUP
m_markupText = NULL;
#endif // wxUSE_MARKUP
}
void OnPaint(wxPaintEvent& event);
void DoDrawLabel(wxDC& dc, const wxRect& rect);
// These fields are only used if m_markupText == NULL.
wxString m_label;
int m_mnemonic;
#if wxUSE_MARKUP
class wxMarkupText *m_markupText;
#endif // wxUSE_MARKUP
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText);
};
#endif // _WX_GENERIC_STATTEXTG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/ctrlsub.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/ctrlsub.h
// Purpose: common functionality of wxItemContainer-derived controls
// Author: Vadim Zeitlin
// Created: 2007-07-25
// Copyright: (c) 2007 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_CTRLSUB_H_
#define _WX_GENERIC_CTRLSUB_H_
#include "wx/dynarray.h"
// ----------------------------------------------------------------------------
// wxControlWithItemsGeneric: generic implementation of item client data
// ----------------------------------------------------------------------------
class wxControlWithItemsGeneric : public wxControlWithItemsBase
{
public:
wxControlWithItemsGeneric() { }
virtual void DoInitItemClientData()
{
m_itemsClientData.resize(GetCount(), NULL);
}
virtual void DoSetItemClientData(unsigned int n, void *clientData)
{
m_itemsClientData[n] = clientData;
}
virtual void *DoGetItemClientData(unsigned int n) const
{
return m_itemsClientData[n];
}
virtual void DoClear() { m_itemsClientData.clear(); }
virtual void DoDeleteOneItem(unsigned int pos)
{
if ( HasClientData() )
m_itemsClientData.RemoveAt(pos);
}
protected:
// preallocate memory for numItems new items: this should be called from
// the derived classes DoInsertItems() to speed up appending big numbers of
// items with client data; it is safe to call even if we don't use client
// data at all and does nothing in this case
void AllocClientData(unsigned int numItems)
{
if ( HasClientData() )
m_itemsClientData.reserve(m_itemsClientData.size() + numItems);
}
// this must be called by derived classes when a new item is added to the
// control to add storage for the corresponding client data pointer (before
// inserting many items, call AllocClientData())
void InsertNewItemClientData(unsigned int pos,
void **clientData,
unsigned int n,
wxClientDataType type)
{
if ( InitClientDataIfNeeded(type) )
m_itemsClientData.Insert(clientData[n], pos);
}
// the same as InsertNewItemClientData() but for numItems consecutive items
// (this can only be used if the control doesn't support sorting as
// otherwise the items positions wouldn't be consecutive any more)
void InsertNewItemsClientData(unsigned int pos,
unsigned int numItems,
void **clientData,
wxClientDataType type)
{
if ( InitClientDataIfNeeded(type) )
{
// it's more efficient to insert everything at once and then update
// for big number of items to avoid moving the array contents
// around (which would result in O(N^2) algorithm)
m_itemsClientData.Insert(NULL, pos, numItems);
for ( unsigned int n = 0; n < numItems; ++n, ++pos )
m_itemsClientData[pos] = clientData[n];
}
}
// vector containing the client data pointers: it is either empty (if
// client data is not used) or has the same number of elements as the
// control
wxArrayPtrVoid m_itemsClientData;
private:
// initialize client data if needed, return false if we don't have any
// client data and true otherwise
bool InitClientDataIfNeeded(wxClientDataType type)
{
if ( !HasClientData() )
{
if ( type == wxClientData_None )
{
// we didn't have the client data before and are not asked to
// store it now neither
return false;
}
// this is the first time client data is used with this control
DoInitItemClientData();
SetClientDataType(type);
}
//else: we already have client data
return true;
}
wxDECLARE_NO_COPY_CLASS(wxControlWithItemsGeneric);
};
#endif // _WX_GENERIC_CTRLSUB_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/statbmpg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/statbmpg.h
// Purpose: wxGenericStaticBitmap header
// Author: Marcin Wojdyr, Stefan Csomor
// Created: 2008-06-16
// Copyright: wxWidgets developers
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_STATBMP_H_
#define _WX_GENERIC_STATBMP_H_
#include "wx/statbmp.h"
class WXDLLIMPEXP_CORE wxGenericStaticBitmap : public wxStaticBitmapBase
{
public:
wxGenericStaticBitmap() {}
wxGenericStaticBitmap(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr)
{
Create(parent, id, bitmap, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr);
virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE
{
m_bitmap = bitmap;
SetInitialSize(GetBitmapSize());
Refresh();
}
virtual wxBitmap GetBitmap() const wxOVERRIDE { return m_bitmap; }
virtual void SetIcon(const wxIcon& icon) wxOVERRIDE
{
m_bitmap.CopyFromIcon(icon);
SetInitialSize(GetBitmapSize());
Refresh();
}
#if defined(__WXGTK20__) || defined(__WXMAC__)
// icons and bitmaps are really the same thing in wxGTK and wxMac
wxIcon GetIcon() const wxOVERRIDE { return (const wxIcon &)m_bitmap; }
#endif
virtual void SetScaleMode(ScaleMode scaleMode) wxOVERRIDE
{
m_scaleMode = scaleMode;
Refresh();
}
virtual ScaleMode GetScaleMode() const wxOVERRIDE { return m_scaleMode; }
private:
wxSize GetBitmapSize()
{
return m_bitmap.IsOk() ? m_bitmap.GetScaledSize()
: wxSize(16, 16); // this is completely arbitrary
}
void OnPaint(wxPaintEvent& event);
wxBitmap m_bitmap;
ScaleMode m_scaleMode;
wxDECLARE_DYNAMIC_CLASS(wxGenericStaticBitmap);
};
#endif //_WX_GENERIC_STATBMP_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/icon.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/icon.h
// Purpose: wxIcon implementation for ports where it's same as wxBitmap
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_ICON_H_
#define _WX_GENERIC_ICON_H_
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{
public:
wxIcon();
wxIcon(const char* const* bits);
#ifdef wxNEEDS_CHARPP
wxIcon(char **bits);
#endif
// For compatibility with wxMSW where desired size is sometimes required to
// distinguish between multiple icons in a resource.
wxIcon( const wxString& filename,
wxBitmapType type = wxICON_DEFAULT_TYPE,
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
wxBitmap(filename, type)
{
}
wxIcon(const wxIconLocation& loc)
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
{
}
bool LoadFile(const wxString& name, wxBitmapType flags,
int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{ return wxBitmap::LoadFile(name, flags); }
// unhide the base class version
virtual bool LoadFile(const wxString& name,
wxBitmapType flags = wxICON_DEFAULT_TYPE) wxOVERRIDE
{ return wxBitmap::LoadFile(name, flags); }
// create from bitmap (which should have a mask unless it's monochrome):
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
private:
wxDECLARE_DYNAMIC_CLASS(wxIcon);
};
#endif // _WX_GENERIC_ICON_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/printps.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/printps.h
// Purpose: wxPostScriptPrinter, wxPostScriptPrintPreview
// wxGenericPageSetupDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __PRINTPSH__
#define __PRINTPSH__
#include "wx/prntbase.h"
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
// ----------------------------------------------------------------------------
// Represents the printer: manages printing a wxPrintout object
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPostScriptPrinter : public wxPrinterBase
{
public:
wxPostScriptPrinter(wxPrintDialogData *data = NULL);
virtual ~wxPostScriptPrinter();
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) wxOVERRIDE;
virtual wxDC* PrintDialog(wxWindow *parent) wxOVERRIDE;
virtual bool Setup(wxWindow *parent) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxPostScriptPrinter);
};
// ----------------------------------------------------------------------------
// wxPrintPreview: programmer creates an object of this class to preview a
// wxPrintout.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPostScriptPrintPreview : public wxPrintPreviewBase
{
public:
wxPostScriptPrintPreview(wxPrintout *printout,
wxPrintout *printoutForPrinting = NULL,
wxPrintDialogData *data = NULL);
wxPostScriptPrintPreview(wxPrintout *printout,
wxPrintout *printoutForPrinting,
wxPrintData *data);
virtual ~wxPostScriptPrintPreview();
virtual bool Print(bool interactive) wxOVERRIDE;
virtual void DetermineScaling() wxOVERRIDE;
private:
void Init(wxPrintout *printout, wxPrintout *printoutForPrinting);
private:
wxDECLARE_CLASS(wxPostScriptPrintPreview);
};
#endif
#endif
// __PRINTPSH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/caret.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/caret.h
// Purpose: generic wxCaret class
// Author: Vadim Zeitlin (original code by Robert Roebling)
// Modified by:
// Created: 25.05.99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CARET_H_
#define _WX_CARET_H_
#include "wx/timer.h"
#include "wx/dc.h"
#include "wx/overlay.h"
#ifdef wxHAS_NATIVE_OVERLAY
#define wxHAS_CARET_USING_OVERLAYS
#endif
class WXDLLIMPEXP_FWD_CORE wxCaret;
class WXDLLIMPEXP_CORE wxCaretTimer : public wxTimer
{
public:
wxCaretTimer(wxCaret *caret);
virtual void Notify() wxOVERRIDE;
private:
wxCaret *m_caret;
};
class WXDLLIMPEXP_CORE wxCaret : public wxCaretBase
{
public:
// ctors
// -----
// default - use Create()
wxCaret() : m_timer(this) { InitGeneric(); }
// creates a block caret associated with the given window
wxCaret(wxWindowBase *window, int width, int height)
: wxCaretBase(window, width, height), m_timer(this) { InitGeneric(); }
wxCaret(wxWindowBase *window, const wxSize& size)
: wxCaretBase(window, size), m_timer(this) { InitGeneric(); }
virtual ~wxCaret();
// implementation
// --------------
// called by wxWindow (not using the event tables)
virtual void OnSetFocus() wxOVERRIDE;
virtual void OnKillFocus() wxOVERRIDE;
// called by wxCaretTimer
void OnTimer();
protected:
virtual void DoShow() wxOVERRIDE;
virtual void DoHide() wxOVERRIDE;
virtual void DoMove() wxOVERRIDE;
virtual void DoSize() wxOVERRIDE;
// blink the caret once
void Blink();
// refresh the caret
void Refresh();
// draw the caret on the given DC
void DoDraw(wxDC *dc, wxWindow* win);
private:
// GTK specific initialization
void InitGeneric();
#ifdef wxHAS_CARET_USING_OVERLAYS
// the overlay for displaying the caret
wxOverlay m_overlay;
#else
// the bitmap holding the part of window hidden by the caret when it was
// at (m_xOld, m_yOld)
wxBitmap m_bmpUnderCaret;
int m_xOld,
m_yOld;
#endif
wxCaretTimer m_timer;
bool m_blinkedOut, // true => caret hidden right now
m_hasFocus; // true => our window has focus
};
#endif // _WX_CARET_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/numdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/numdlgg.h
// Purpose: wxNumberEntryDialog class
// Author: John Labenski
// Modified by:
// Created: 07.02.04 (extracted from textdlgg.cpp)
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __NUMDLGH_G__
#define __NUMDLGH_G__
#include "wx/defs.h"
#if wxUSE_NUMBERDLG
#include "wx/dialog.h"
#if wxUSE_SPINCTRL
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
#else
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
#endif // wxUSE_SPINCTRL
// ----------------------------------------------------------------------------
// wxNumberEntryDialog: a dialog with spin control, [ok] and [cancel] buttons
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNumberEntryDialog : public wxDialog
{
public:
wxNumberEntryDialog()
{
m_value = m_min = m_max = 0;
}
wxNumberEntryDialog(wxWindow *parent,
const wxString& message,
const wxString& prompt,
const wxString& caption,
long value, long min, long max,
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, prompt, caption, value, min, max, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& prompt,
const wxString& caption,
long value, long min, long max,
const wxPoint& pos = wxDefaultPosition);
long GetValue() const { return m_value; }
// implementation only
void OnOK(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
protected:
#if wxUSE_SPINCTRL
wxSpinCtrl *m_spinctrl;
#else
wxTextCtrl *m_spinctrl;
#endif // wxUSE_SPINCTRL
long m_value, m_min, m_max;
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxNumberEntryDialog);
wxDECLARE_NO_COPY_CLASS(wxNumberEntryDialog);
};
// ----------------------------------------------------------------------------
// function to get a number from user
// ----------------------------------------------------------------------------
WXDLLIMPEXP_CORE long
wxGetNumberFromUser(const wxString& message,
const wxString& prompt,
const wxString& caption,
long value = 0,
long min = 0,
long max = 100,
wxWindow *parent = NULL,
const wxPoint& pos = wxDefaultPosition);
#endif // wxUSE_NUMBERDLG
#endif // __NUMDLGH_G__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/prntdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/prntdlgg.h
// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
// wxGenericPageSetupDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __PRINTDLGH_G_
#define __PRINTDLGH_G_
#include "wx/defs.h"
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/dialog.h"
#include "wx/cmndata.h"
#include "wx/prntbase.h"
#include "wx/printdlg.h"
#include "wx/listctrl.h"
#include "wx/dc.h"
#if wxUSE_POSTSCRIPT
#include "wx/dcps.h"
#endif
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxComboBox;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxRadioBox;
class WXDLLIMPEXP_FWD_CORE wxPageSetupDialogData;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// This is not clear why all these enums start with 10 or 30 but do not change it
// without good reason to avoid some subtle backwards compatibility breakage
enum
{
wxPRINTID_STATIC = 10,
wxPRINTID_RANGE,
wxPRINTID_FROM,
wxPRINTID_TO,
wxPRINTID_COPIES,
wxPRINTID_PRINTTOFILE,
wxPRINTID_SETUP
};
enum
{
wxPRINTID_LEFTMARGIN = 30,
wxPRINTID_RIGHTMARGIN,
wxPRINTID_TOPMARGIN,
wxPRINTID_BOTTOMMARGIN
};
enum
{
wxPRINTID_PRINTCOLOUR = 10,
wxPRINTID_ORIENTATION,
wxPRINTID_COMMAND,
wxPRINTID_OPTIONS,
wxPRINTID_PAPERSIZE,
wxPRINTID_PRINTER
};
#if wxUSE_POSTSCRIPT
//----------------------------------------------------------------------------
// wxPostScriptNativeData
//----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPostScriptPrintNativeData: public wxPrintNativeDataBase
{
public:
wxPostScriptPrintNativeData();
virtual ~wxPostScriptPrintNativeData();
virtual bool TransferTo( wxPrintData &data ) wxOVERRIDE;
virtual bool TransferFrom( const wxPrintData &data ) wxOVERRIDE;
virtual bool Ok() const wxOVERRIDE { return IsOk(); }
virtual bool IsOk() const wxOVERRIDE { return true; }
const wxString& GetPrinterCommand() const { return m_printerCommand; }
const wxString& GetPrinterOptions() const { return m_printerOptions; }
const wxString& GetPreviewCommand() const { return m_previewCommand; }
const wxString& GetFontMetricPath() const { return m_afmPath; }
double GetPrinterScaleX() const { return m_printerScaleX; }
double GetPrinterScaleY() const { return m_printerScaleY; }
long GetPrinterTranslateX() const { return m_printerTranslateX; }
long GetPrinterTranslateY() const { return m_printerTranslateY; }
void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
void SetPrinterScaleX(double x) { m_printerScaleX = x; }
void SetPrinterScaleY(double y) { m_printerScaleY = y; }
void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
#if wxUSE_STREAMS
wxOutputStream *GetOutputStream() { return m_outputStream; }
void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; }
#endif
private:
wxString m_printerCommand;
wxString m_previewCommand;
wxString m_printerOptions;
wxString m_afmPath;
double m_printerScaleX;
double m_printerScaleY;
long m_printerTranslateX;
long m_printerTranslateY;
#if wxUSE_STREAMS
wxOutputStream *m_outputStream;
#endif
private:
wxDECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData);
};
// ----------------------------------------------------------------------------
// Simulated Print and Print Setup dialogs for non-Windows platforms (and
// Windows using PostScript print/preview)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericPrintDialog : public wxPrintDialogBase
{
public:
wxGenericPrintDialog(wxWindow *parent,
wxPrintDialogData* data = NULL);
wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
virtual ~wxGenericPrintDialog();
void OnSetup(wxCommandEvent& event);
void OnRange(wxCommandEvent& event);
void OnOK(wxCommandEvent& event);
virtual bool TransferDataFromWindow() wxOVERRIDE;
virtual bool TransferDataToWindow() wxOVERRIDE;
virtual int ShowModal() wxOVERRIDE;
wxPrintData& GetPrintData() wxOVERRIDE
{ return m_printDialogData.GetPrintData(); }
wxPrintDialogData& GetPrintDialogData() wxOVERRIDE { return m_printDialogData; }
wxDC *GetPrintDC() wxOVERRIDE;
public:
// wxStaticText* m_printerMessage;
wxButton* m_setupButton;
// wxButton* m_helpButton;
wxRadioBox* m_rangeRadioBox;
wxTextCtrl* m_fromText;
wxTextCtrl* m_toText;
wxTextCtrl* m_noCopiesText;
wxCheckBox* m_printToFileCheckBox;
// wxCheckBox* m_collateCopiesCheckBox;
wxPrintDialogData m_printDialogData;
protected:
void Init(wxWindow *parent);
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericPrintDialog);
};
class WXDLLIMPEXP_CORE wxGenericPrintSetupDialog : public wxDialog
{
public:
// There are no configuration options for the dialog, so we
// just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
virtual ~wxGenericPrintSetupDialog();
void Init(wxPrintData* data);
void OnPrinter(wxListEvent& event);
virtual bool TransferDataFromWindow() wxOVERRIDE;
virtual bool TransferDataToWindow() wxOVERRIDE;
virtual wxComboBox *CreatePaperTypeChoice();
public:
wxListCtrl* m_printerListCtrl;
wxRadioBox* m_orientationRadioBox;
wxTextCtrl* m_printerCommandText;
wxTextCtrl* m_printerOptionsText;
wxCheckBox* m_colourCheckBox;
wxComboBox* m_paperTypeChoice;
wxPrintData m_printData;
wxPrintData& GetPrintData() { return m_printData; }
// After pressing OK, write data here.
wxPrintData* m_targetData;
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_CLASS(wxGenericPrintSetupDialog);
};
#endif
// wxUSE_POSTSCRIPT
class WXDLLIMPEXP_CORE wxGenericPageSetupDialog : public wxPageSetupDialogBase
{
public:
wxGenericPageSetupDialog(wxWindow *parent = NULL,
wxPageSetupDialogData* data = NULL);
virtual ~wxGenericPageSetupDialog();
virtual bool TransferDataFromWindow() wxOVERRIDE;
virtual bool TransferDataToWindow() wxOVERRIDE;
virtual wxPageSetupDialogData& GetPageSetupDialogData() wxOVERRIDE;
void OnPrinter(wxCommandEvent& event);
wxComboBox *CreatePaperTypeChoice(int* x, int* y);
public:
wxButton* m_printerButton;
wxRadioBox* m_orientationRadioBox;
wxTextCtrl* m_marginLeftText;
wxTextCtrl* m_marginTopText;
wxTextCtrl* m_marginRightText;
wxTextCtrl* m_marginBottomText;
wxComboBox* m_paperTypeChoice;
wxPageSetupDialogData m_pageData;
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog);
};
#endif
#endif
// __PRINTDLGH_G_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/timectrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/timectrl.h
// Purpose: Generic implementation of wxTimePickerCtrl.
// Author: Paul Breen, Vadim Zeitlin
// Created: 2011-09-22
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_TIMECTRL_H_
#define _WX_GENERIC_TIMECTRL_H_
#include "wx/containr.h"
#include "wx/compositewin.h"
class WXDLLIMPEXP_ADV wxTimePickerCtrlGeneric
: public wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> >
{
public:
typedef wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> > Base;
// Creating the control.
wxTimePickerCtrlGeneric() { Init(); }
virtual ~wxTimePickerCtrlGeneric();
wxTimePickerCtrlGeneric(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr)
{
Init();
(void)Create(parent, id, date, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr);
// Implement pure virtual wxTimePickerCtrlBase methods.
virtual void SetValue(const wxDateTime& date) wxOVERRIDE;
virtual wxDateTime GetValue() const wxOVERRIDE;
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
private:
void Init();
// Return the list of the windows composing this one.
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE;
// Implementation data.
class wxTimePickerGenericImpl* m_impl;
wxDECLARE_NO_COPY_CLASS(wxTimePickerCtrlGeneric);
};
#endif // _WX_GENERIC_TIMECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/buttonbar.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/buttonbar.h
// Purpose: wxButtonToolBar declaration
// Author: Julian Smart, after Robert Roebling, Vadim Zeitlin, SciTech
// Modified by:
// Created: 2006-04-13
// Copyright: (c) Julian Smart, Robert Roebling, Vadim Zeitlin,
// SciTech Software, Inc.
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUTTONBAR_H_
#define _WX_BUTTONBAR_H_
#include "wx/bmpbuttn.h"
#include "wx/toolbar.h"
class WXDLLIMPEXP_FWD_CORE wxButtonToolBarTool;
// ----------------------------------------------------------------------------
// wxButtonToolBar
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxButtonToolBar : public wxToolBarBase
{
public:
// construction/destruction
wxButtonToolBar() { Init(); }
wxButtonToolBar(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxToolBarNameStr)
{
Init();
Create(parent, id, pos, size, style, name);
}
bool Create( wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxToolBarNameStr );
virtual ~wxButtonToolBar();
virtual bool Realize() wxOVERRIDE;
virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE;
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
protected:
// common part of all ctors
void Init();
// implement base class pure virtuals
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;
virtual wxToolBarToolBase *CreateTool(int id,
const wxString& label,
const wxBitmap& bmpNormal,
const wxBitmap& bmpDisabled,
wxItemKind kind,
wxObject *clientData,
const wxString& shortHelp,
const wxString& longHelp) wxOVERRIDE;
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label) wxOVERRIDE;
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
// calculate layout
void DoLayout();
// get the bounding rect for the given tool
wxRect GetToolRect(wxToolBarToolBase *tool) const;
// get the rect limits depending on the orientation: top/bottom for a
// vertical toolbar, left/right for a horizontal one
void GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const;
// receives button commands
void OnCommand(wxCommandEvent& event);
// paints a border
void OnPaint(wxPaintEvent& event);
// detects mouse clicks outside buttons
void OnLeftUp(wxMouseEvent& event);
private:
// have we calculated the positions of our tools?
bool m_needsLayout;
// the width of a separator
wxCoord m_widthSeparator;
// the total size of all toolbar elements
wxCoord m_maxWidth,
m_maxHeight;
// the height of a label
int m_labelHeight;
// the space above the label
int m_labelMargin;
private:
wxDECLARE_DYNAMIC_CLASS(wxButtonToolBar);
wxDECLARE_EVENT_TABLE();
};
#endif
// _WX_BUTTONBAR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/scrolwin.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/scrolwin.h
// Purpose: generic wxScrollHelper
// Author: Vadim Zeitlin
// Created: 2008-12-24 (replacing old file with the same name)
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_SCROLLWIN_H_
#define _WX_GENERIC_SCROLLWIN_H_
#include "wx/recguard.h"
// ----------------------------------------------------------------------------
// generic wxScrollHelper implementation
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
{
public:
wxScrollHelper(wxWindow *winToScroll);
// implement base class pure virtuals
virtual void AdjustScrollbars() wxOVERRIDE;
virtual bool IsScrollbarShown(int orient) const wxOVERRIDE;
protected:
virtual void DoScroll(int x, int y) wxOVERRIDE;
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
wxScrollbarVisibility vert) wxOVERRIDE;
private:
// helper of AdjustScrollbars(): does the work for the single scrollbar
//
// notice that the parameters passed by non-const references are modified
// by this function
void DoAdjustScrollbar(int orient,
int clientSize,
int virtSize,
int pixelsPerUnit,
int& scrollUnits,
int& scrollPosition,
int& scrollLinesPerPage,
wxScrollbarVisibility visibility);
wxScrollbarVisibility m_xVisibility,
m_yVisibility;
wxRecursionGuardFlag m_adjustScrollFlagReentrancy;
wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
};
#endif // _WX_GENERIC_SCROLLWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/splitter.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/splitter.h
// Purpose: wxSplitterWindow class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_SPLITTER_H_
#define _WX_GENERIC_SPLITTER_H_
#include "wx/window.h" // base class declaration
#include "wx/containr.h" // wxControlContainer
class WXDLLIMPEXP_FWD_CORE wxSplitterEvent;
// ---------------------------------------------------------------------------
// splitter constants
// ---------------------------------------------------------------------------
enum wxSplitMode
{
wxSPLIT_HORIZONTAL = 1,
wxSPLIT_VERTICAL
};
enum
{
wxSPLIT_DRAG_NONE,
wxSPLIT_DRAG_DRAGGING,
wxSPLIT_DRAG_LEFT_DOWN
};
// ---------------------------------------------------------------------------
// wxSplitterWindow maintains one or two panes, with
// an optional vertical or horizontal split which
// can be used with the mouse or programmatically.
// ---------------------------------------------------------------------------
// TODO:
// 1) Perhaps make the borders sensitive to dragging in order to create a split.
// The MFC splitter window manages scrollbars as well so is able to
// put sash buttons on the scrollbars, but we probably don't want to go down
// this path.
// 2) for wxWidgets 2.0, we must find a way to set the WS_CLIPCHILDREN style
// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be
// standard).
class WXDLLIMPEXP_CORE wxSplitterWindow: public wxNavigationEnabled<wxWindow>
{
public:
////////////////////////////////////////////////////////////////////////////
// Public API
// Default constructor
wxSplitterWindow()
{
Init();
}
// Normal constructor
wxSplitterWindow(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_3D,
const wxString& name = wxT("splitter"))
{
Init();
Create(parent, id, pos, size, style, name);
}
virtual ~wxSplitterWindow();
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_3D,
const wxString& name = wxT("splitter"));
// Gets the only or left/top pane
wxWindow *GetWindow1() const { return m_windowOne; }
// Gets the right/bottom pane
wxWindow *GetWindow2() const { return m_windowTwo; }
// Sets the split mode
void SetSplitMode(int mode)
{
wxASSERT_MSG( mode == wxSPLIT_VERTICAL || mode == wxSPLIT_HORIZONTAL,
wxT("invalid split mode") );
m_splitMode = (wxSplitMode)mode;
}
// Gets the split mode
wxSplitMode GetSplitMode() const { return m_splitMode; }
// Initialize with one window
void Initialize(wxWindow *window);
// Associates the given window with window 2, drawing the appropriate sash
// and changing the split mode.
// Does nothing and returns false if the window is already split.
// A sashPosition of 0 means choose a default sash position,
// negative sashPosition specifies the size of right/lower pane as its
// absolute value rather than the size of left/upper pane.
virtual bool SplitVertically(wxWindow *window1,
wxWindow *window2,
int sashPosition = 0)
{ return DoSplit(wxSPLIT_VERTICAL, window1, window2, sashPosition); }
virtual bool SplitHorizontally(wxWindow *window1,
wxWindow *window2,
int sashPosition = 0)
{ return DoSplit(wxSPLIT_HORIZONTAL, window1, window2, sashPosition); }
// Removes the specified (or second) window from the view
// Doesn't actually delete the window.
bool Unsplit(wxWindow *toRemove = NULL);
// Replaces one of the windows with another one (neither old nor new
// parameter should be NULL)
bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
// Make sure the child window sizes are updated. This is useful
// for reducing flicker by updating the sizes before a
// window is shown, if you know the overall size is correct.
void UpdateSize();
// Is the window split?
bool IsSplit() const { return (m_windowTwo != NULL); }
// Sets the border size
void SetBorderSize(int WXUNUSED(width)) { }
// Hide or show the sash and test whether it's currently hidden.
void SetSashInvisible(bool invisible = true);
bool IsSashInvisible() const { return HasFlag(wxSP_NOSASH); }
// Gets the current sash size which may be 0 if it's hidden and the default
// sash size.
int GetSashSize() const;
int GetDefaultSashSize() const;
// Gets the border size
int GetBorderSize() const;
// Set the sash position
void SetSashPosition(int position, bool redraw = true);
// Gets the sash position
int GetSashPosition() const { return m_sashPosition; }
// Set the sash gravity
void SetSashGravity(double gravity);
// Gets the sash gravity
double GetSashGravity() const { return m_sashGravity; }
// If this is zero, we can remove panes by dragging the sash.
void SetMinimumPaneSize(int min);
int GetMinimumPaneSize() const { return m_minimumPaneSize; }
// NB: the OnXXX() functions below are for backwards compatibility only,
// don't use them in new code but handle the events instead!
// called when the sash position is about to change, may return a new value
// for the sash or -1 to prevent the change from happening at all
virtual int OnSashPositionChanging(int newSashPosition);
// Called when the sash position is about to be changed, return
// false from here to prevent the change from taking place.
// Repositions sash to minimum position if pane would be too small.
// newSashPosition here is always positive or zero.
virtual bool OnSashPositionChange(int newSashPosition);
// If the sash is moved to an extreme position, a subwindow
// is removed from the splitter window, and the app is
// notified. The app should delete or hide the window.
virtual void OnUnsplit(wxWindow *removed);
// Called when the sash is double-clicked.
// The default behaviour is to remove the sash if the
// minimum pane size is zero.
virtual void OnDoubleClickSash(int x, int y);
////////////////////////////////////////////////////////////////////////////
// Implementation
// Paints the border and sash
void OnPaint(wxPaintEvent& event);
// Handles mouse events
void OnMouseEvent(wxMouseEvent& ev);
// Aborts dragging mode
void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
// Adjusts the panes
void OnSize(wxSizeEvent& event);
// In live mode, resize child windows in idle time
void OnInternalIdle() wxOVERRIDE;
// Draws the sash
virtual void DrawSash(wxDC& dc);
// Draws the sash tracker (for whilst moving the sash)
virtual void DrawSashTracker(int x, int y);
// Tests for x, y over sash
virtual bool SashHitTest(int x, int y);
// Resizes subwindows
virtual void SizeWindows();
#ifdef __WXMAC__
virtual bool MacClipGrandChildren() const wxOVERRIDE { return true ; }
#endif
// Sets the sash size: this doesn't do anything and shouldn't be used at
// all any more.
wxDEPRECATED_INLINE( void SetSashSize(int WXUNUSED(width)), return; )
protected:
// event handlers
#if defined(__WXMSW__) || defined(__WXMAC__)
void OnSetCursor(wxSetCursorEvent& event);
#endif // wxMSW
// send the given event, return false if the event was processed and vetoed
// by the user code
bool DoSendEvent(wxSplitterEvent& event);
// common part of all ctors
void Init();
// common part of SplitVertically() and SplitHorizontally()
bool DoSplit(wxSplitMode mode,
wxWindow *window1, wxWindow *window2,
int sashPosition);
// adjusts sash position with respect to min. pane and window sizes
int AdjustSashPosition(int sashPos) const;
// get either width or height depending on the split mode
int GetWindowSize() const;
// convert the user specified sash position which may be > 0 (as is), < 0
// (specifying the size of the right pane) or 0 (use default) to the real
// position to be passed to DoSetSashPosition()
int ConvertSashPosition(int sashPos) const;
// set the real sash position, sashPos here must be positive
//
// returns true if the sash position has been changed, false otherwise
bool DoSetSashPosition(int sashPos);
// set the sash position and send an event about it having been changed
void SetSashPositionAndNotify(int sashPos);
// callbacks executed when we detect that the mouse has entered or left
// the sash
virtual void OnEnterSash();
virtual void OnLeaveSash();
// set the cursor appropriate for the current split mode
void SetResizeCursor();
// redraw the splitter if its "hotness" changed if necessary
void RedrawIfHotSensitive(bool isHot);
// return the best size of the splitter equal to best sizes of its
// subwindows
virtual wxSize DoGetBestSize() const wxOVERRIDE;
wxSplitMode m_splitMode;
wxWindow* m_windowOne;
wxWindow* m_windowTwo;
int m_dragMode;
int m_oldX; // current tracker position if not live mode
int m_oldY; // current tracker position if not live mode
int m_sashPosition; // Number of pixels from left or top
double m_sashGravity;
wxSize m_lastSize;
int m_requestedSashPosition;
int m_sashPositionCurrent; // while dragging
wxPoint m_ptStart; // mouse position when dragging started
int m_sashStart; // sash position when dragging started
int m_minimumPaneSize;
wxCursor m_sashCursorWE;
wxCursor m_sashCursorNS;
wxPen *m_sashTrackerPen;
// when in live mode, set this to true to resize children in idle
bool m_needUpdating:1;
bool m_permitUnsplitAlways:1;
bool m_isHot:1;
private:
wxDECLARE_DYNAMIC_CLASS(wxSplitterWindow);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxSplitterWindow);
};
// ----------------------------------------------------------------------------
// event class and macros
// ----------------------------------------------------------------------------
// we reuse the same class for all splitter event types because this is the
// usual wxWin convention, but the three event types have different kind of
// data associated with them, so the accessors can be only used if the real
// event type matches with the one for which the accessors make sense
class WXDLLIMPEXP_CORE wxSplitterEvent : public wxNotifyEvent
{
public:
wxSplitterEvent(wxEventType type = wxEVT_NULL,
wxSplitterWindow *splitter = NULL)
: wxNotifyEvent(type)
{
SetEventObject(splitter);
if (splitter) m_id = splitter->GetId();
}
wxSplitterEvent(const wxSplitterEvent& event)
: wxNotifyEvent(event), m_data(event.m_data) { }
// SASH_POS_CHANGED methods
// setting the sash position to -1 prevents the change from taking place at
// all
void SetSashPosition(int pos)
{
wxASSERT( GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGED
|| GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGING);
m_data.pos = pos;
}
int GetSashPosition() const
{
wxASSERT( GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGED
|| GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGING);
return m_data.pos;
}
// UNSPLIT event methods
wxWindow *GetWindowBeingRemoved() const
{
wxASSERT( GetEventType() == wxEVT_SPLITTER_UNSPLIT );
return m_data.win;
}
// DCLICK event methods
int GetX() const
{
wxASSERT( GetEventType() == wxEVT_SPLITTER_DOUBLECLICKED );
return m_data.pt.x;
}
int GetY() const
{
wxASSERT( GetEventType() == wxEVT_SPLITTER_DOUBLECLICKED );
return m_data.pt.y;
}
virtual wxEvent *Clone() const wxOVERRIDE { return new wxSplitterEvent(*this); }
private:
friend class WXDLLIMPEXP_FWD_CORE wxSplitterWindow;
// data for the different types of event
union
{
int pos; // position for SASH_POS_CHANGED event
wxWindow *win; // window being removed for UNSPLIT event
struct
{
int x, y;
} pt; // position of double click for DCLICK event
} m_data;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSplitterEvent);
};
typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
#define wxSplitterEventHandler(func) \
wxEVENT_HANDLER_CAST(wxSplitterEventFunction, func)
#define wx__DECLARE_SPLITTEREVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))
#define EVT_SPLITTER_SASH_POS_CHANGED(id, fn) \
wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGED, id, fn)
#define EVT_SPLITTER_SASH_POS_CHANGING(id, fn) \
wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGING, id, fn)
#define EVT_SPLITTER_DCLICK(id, fn) \
wx__DECLARE_SPLITTEREVT(DOUBLECLICKED, id, fn)
#define EVT_SPLITTER_UNSPLIT(id, fn) \
wx__DECLARE_SPLITTEREVT(UNSPLIT, id, fn)
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED wxEVT_SPLITTER_SASH_POS_CHANGED
#define wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING wxEVT_SPLITTER_SASH_POS_CHANGING
#define wxEVT_COMMAND_SPLITTER_DOUBLECLICKED wxEVT_SPLITTER_DOUBLECLICKED
#define wxEVT_COMMAND_SPLITTER_UNSPLIT wxEVT_SPLITTER_UNSPLIT
#endif // _WX_GENERIC_SPLITTER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/richmsgdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/richmsgdlgg.h
// Purpose: wxGenericRichMessageDialog
// Author: Rickard Westerlund
// Created: 2010-07-04
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_RICHMSGDLGG_H_
#define _WX_GENERIC_RICHMSGDLGG_H_
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxCollapsiblePane;
class WXDLLIMPEXP_FWD_CORE wxCollapsiblePaneEvent;
class WXDLLIMPEXP_CORE wxGenericRichMessageDialog
: public wxRichMessageDialogBase
{
public:
wxGenericRichMessageDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK | wxCENTRE)
: wxRichMessageDialogBase( parent, message, caption, style ),
m_checkBox(NULL),
m_detailsPane(NULL)
{ }
virtual bool IsCheckBoxChecked() const wxOVERRIDE;
protected:
wxCheckBox *m_checkBox;
wxCollapsiblePane *m_detailsPane;
// overrides methods in the base class
virtual void AddMessageDialogCheckBox(wxSizer *sizer) wxOVERRIDE;
virtual void AddMessageDialogDetails(wxSizer *sizer) wxOVERRIDE;
private:
void OnPaneChanged(wxCollapsiblePaneEvent& event);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxGenericRichMessageDialog);
};
#endif // _WX_GENERIC_RICHMSGDLGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dcpsg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dcpsg.h
// Purpose: wxPostScriptDC class
// Author: Julian Smart and others
// Modified by:
// Copyright: (c) Julian Smart and Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCPSG_H_
#define _WX_DCPSG_H_
#include "wx/defs.h"
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
#include "wx/dc.h"
#include "wx/dcprint.h"
#include "wx/dialog.h"
#include "wx/module.h"
#include "wx/cmndata.h"
#include "wx/strvararg.h"
//-----------------------------------------------------------------------------
// wxPostScriptDC
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPostScriptDC : public wxDC
{
public:
wxPostScriptDC();
// Recommended constructor
wxPostScriptDC(const wxPrintData& printData);
private:
wxDECLARE_DYNAMIC_CLASS(wxPostScriptDC);
};
class WXDLLIMPEXP_CORE wxPostScriptDCImpl : public wxDCImpl
{
public:
wxPostScriptDCImpl( wxPrinterDC *owner );
wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data );
wxPostScriptDCImpl( wxPostScriptDC *owner );
wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data );
void Init();
virtual ~wxPostScriptDCImpl();
virtual bool Ok() const { return IsOk(); }
virtual bool IsOk() const wxOVERRIDE;
bool CanDrawBitmap() const wxOVERRIDE { return true; }
void Clear() wxOVERRIDE;
void SetFont( const wxFont& font ) wxOVERRIDE;
void SetPen( const wxPen& pen ) wxOVERRIDE;
void SetBrush( const wxBrush& brush ) wxOVERRIDE;
void SetLogicalFunction( wxRasterOperationMode function ) wxOVERRIDE;
void SetBackground( const wxBrush& brush ) wxOVERRIDE;
void DestroyClippingRegion() wxOVERRIDE;
bool StartDoc(const wxString& message) wxOVERRIDE;
void EndDoc() wxOVERRIDE;
void StartPage() wxOVERRIDE;
void EndPage() wxOVERRIDE;
wxCoord GetCharHeight() const wxOVERRIDE;
wxCoord GetCharWidth() const wxOVERRIDE;
bool CanGetTextExtent() const wxOVERRIDE { return true; }
// Resolution in pixels per logical inch
wxSize GetPPI() const wxOVERRIDE;
virtual void ComputeScaleAndOrigin() wxOVERRIDE;
void SetBackgroundMode(int WXUNUSED(mode)) wxOVERRIDE { }
#if wxUSE_PALETTE
void SetPalette(const wxPalette& WXUNUSED(palette)) wxOVERRIDE { }
#endif
void SetPrintData(const wxPrintData& data);
wxPrintData& GetPrintData() { return m_printData; }
virtual int GetDepth() const wxOVERRIDE { return 24; }
void PsPrint( const wxString& psdata );
// Overrridden for wxPrinterDC Impl
virtual int GetResolution() const wxOVERRIDE;
virtual wxRect GetPaperRect() const wxOVERRIDE;
virtual void* GetHandle() const wxOVERRIDE { return NULL; }
protected:
bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE;
bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const wxOVERRIDE;
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE;
void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE ;
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc) wxOVERRIDE;
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea) wxOVERRIDE;
void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE;
void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0) wxOVERRIDE;
void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20) wxOVERRIDE;
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
#if wxUSE_SPLINES
void DoDrawSpline(const wxPointList *points) wxOVERRIDE;
#endif
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE;
void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE;
void DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false) wxOVERRIDE;
void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE;
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) wxOVERRIDE;
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip)) wxOVERRIDE
{
wxFAIL_MSG( "not implemented" );
}
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const wxOVERRIDE;
void DoGetSize(int* width, int* height) const wxOVERRIDE;
void DoGetSizeMM(int *width, int *height) const wxOVERRIDE;
// Common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxWX2MBbuf& textbuf, wxCoord testDescent, double lineHeight);
// Actually set PostScript font
void SetPSFont();
// Set PostScript color
void SetPSColour(const wxColour& col);
FILE* m_pstream; // PostScript output stream
unsigned char m_currentRed;
unsigned char m_currentGreen;
unsigned char m_currentBlue;
int m_pageNumber;
bool m_clipping;
double m_underlinePosition;
double m_underlineThickness;
wxPrintData m_printData;
double m_pageHeight;
wxArrayString m_definedPSFonts;
bool m_isFontChanged;
private:
wxDECLARE_DYNAMIC_CLASS(wxPostScriptDCImpl);
};
#endif
// wxUSE_POSTSCRIPT && wxUSE_PRINTING_ARCHITECTURE
#endif
// _WX_DCPSG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/busyinfo.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/busyinfo.h
// Purpose: Information window (when app is busy)
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUSYINFO_H_
#define _WX_BUSYINFO_H_
#include "wx/defs.h"
#if wxUSE_BUSYINFO
#include "wx/object.h"
class WXDLLIMPEXP_FWD_CORE wxFrame;
class WXDLLIMPEXP_FWD_CORE wxWindow;
//--------------------------------------------------------------------------------
// wxBusyInfo
// Displays progress information
// Can be used in exactly same way as wxBusyCursor
//--------------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBusyInfo : public wxObject
{
public:
wxBusyInfo(const wxBusyInfoFlags& flags)
{
Init(flags);
}
wxBusyInfo(const wxString& message, wxWindow *parent = NULL)
{
Init(wxBusyInfoFlags().Parent(parent).Label(message));
}
virtual ~wxBusyInfo();
private:
void Init(const wxBusyInfoFlags& flags);
wxFrame *m_InfoFrame;
wxDECLARE_NO_COPY_CLASS(wxBusyInfo);
};
#endif // wxUSE_BUSYINFO
#endif // _WX_BUSYINFO_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/notebook.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/notebook.h
// Purpose: wxNotebook class (a.k.a. property sheet, tabbed dialog)
// Author: Julian Smart
// Modified by:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_NOTEBOOK_H_
#define _WX_NOTEBOOK_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/event.h"
#include "wx/control.h"
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
// fwd declarations
class WXDLLIMPEXP_FWD_CORE wxImageList;
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxTabView;
// ----------------------------------------------------------------------------
// wxNotebook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
{
public:
// ctors
// -----
// default for dynamic class
wxNotebook();
// the same arguments as for wxControl (@@@ any special styles?)
wxNotebook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
// Create() function
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
// dtor
virtual ~wxNotebook();
// accessors
// ---------
// Find the position of the wxNotebookPage, wxNOT_FOUND if not found.
int FindPagePosition(wxNotebookPage* page) const;
// set the currently selected page, return the index of the previously
// selected one (or wxNOT_FOUND on error)
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
int SetSelection(size_t nPage);
// cycle thru the tabs
// void AdvanceSelection(bool bForward = true);
// changes selected page without sending events
int ChangeSelection(size_t nPage);
// set/get the title of a page
bool SetPageText(size_t nPage, const wxString& strText);
wxString GetPageText(size_t nPage) const;
// get the number of rows for a control with wxNB_MULTILINE style (not all
// versions support it - they will always return 1 then)
virtual int GetRowCount() const ;
// sets/returns item's image index in the current image list
int GetPageImage(size_t nPage) const;
bool SetPageImage(size_t nPage, int nImage);
// control the appearance of the notebook pages
// set the size (the same for all pages)
void SetPageSize(const wxSize& size);
// set the padding between tabs (in pixels)
void SetPadding(const wxSize& padding);
// Sets the size of the tabs (assumes all tabs are the same size)
void SetTabSize(const wxSize& sz);
// operations
// ----------
// remove one page from the notebook, and delete the page.
bool DeletePage(size_t nPage);
bool DeletePage(wxNotebookPage* page);
// remove one page from the notebook, without deleting the page.
bool RemovePage(size_t nPage);
bool RemovePage(wxNotebookPage* page);
virtual wxWindow* DoRemovePage(size_t nPage);
// remove all pages
bool DeleteAllPages();
// the same as AddPage(), but adds it at the specified position
bool InsertPage(size_t nPage,
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
int imageId = NO_IMAGE);
// callbacks
// ---------
void OnSize(wxSizeEvent& event);
void OnInternalIdle();
void OnSelChange(wxBookCtrlEvent& event);
void OnSetFocus(wxFocusEvent& event);
void OnNavigationKey(wxNavigationKeyEvent& event);
// base class virtuals
// -------------------
virtual void Command(wxCommandEvent& event);
virtual void SetConstraintSizes(bool recurse = true);
virtual bool DoPhase(int nPhase);
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
// Implementation
// wxNotebook on Motif uses a generic wxTabView to implement itself.
wxTabView *GetTabView() const { return m_tabView; }
void SetTabView(wxTabView *v) { m_tabView = v; }
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
virtual wxRect GetAvailableClientSize();
// Implementation: calculate the layout of the view rect
// and resize the children if required
bool RefreshLayout(bool force = true);
protected:
// common part of all ctors
void Init();
// helper functions
void ChangePage(int nOldSel, int nSel); // change pages
wxTabView* m_tabView;
wxDECLARE_DYNAMIC_CLASS(wxNotebook);
wxDECLARE_EVENT_TABLE();
};
#endif // _WX_NOTEBOOK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dirdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dirdlgg.h
// Purpose: wxGenericDirCtrl class
// Builds on wxDirCtrl class written by Robert Roebling for the
// wxFile application, modified by Harm van der Heijden.
// Further modified for Windows.
// Author: Robert Roebling, Harm van der Heijden, Julian Smart et al
// Modified by:
// Created: 21/3/2000
// Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIRDLGG_H_
#define _WX_DIRDLGG_H_
class WXDLLIMPEXP_FWD_CORE wxGenericDirCtrl;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
class WXDLLIMPEXP_FWD_CORE wxTreeEvent;
// we may be included directly as well as from wx/dirdlg.h (FIXME)
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
#ifndef wxDD_DEFAULT_STYLE
#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
#endif
#include "wx/dialog.h"
//-----------------------------------------------------------------------------
// wxGenericDirDialog
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericDirDialog : public wxDirDialogBase
{
public:
wxGenericDirDialog() : wxDirDialogBase() { }
wxGenericDirDialog(wxWindow* parent,
const wxString& title = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,//Size(450, 550),
const wxString& name = wxDirDialogNameStr);
bool Create(wxWindow* parent,
const wxString& title = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,//Size(450, 550),
const wxString& name = wxDirDialogNameStr);
//// Accessors
void SetPath(const wxString& path) wxOVERRIDE;
wxString GetPath() const wxOVERRIDE;
//// Overrides
virtual int ShowModal() wxOVERRIDE;
virtual void EndModal(int retCode) wxOVERRIDE;
// this one is specific to wxGenericDirDialog
wxTextCtrl* GetInputCtrl() const { return m_input; }
protected:
//// Event handlers
void OnCloseWindow(wxCloseEvent& event);
void OnOK(wxCommandEvent& event);
void OnTreeSelected(wxTreeEvent &event);
void OnTreeKeyDown(wxTreeEvent &event);
void OnNew(wxCommandEvent& event);
void OnGoHome(wxCommandEvent& event);
void OnShowHidden(wxCommandEvent& event);
wxGenericDirCtrl* m_dirCtrl;
wxTextCtrl* m_input;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericDirDialog);
};
#endif // _WX_DIRDLGG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/statline.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/statline.h
// Purpose: a generic wxStaticLine class
// Author: Vadim Zeitlin
// Created: 28.06.99
// Copyright: (c) 1998 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_STATLINE_H_
#define _WX_GENERIC_STATLINE_H_
class wxStaticBox;
// ----------------------------------------------------------------------------
// wxStaticLine
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
{
wxDECLARE_DYNAMIC_CLASS(wxStaticLine);
public:
// constructors and pseudo-constructors
wxStaticLine() { m_statbox = NULL; }
wxStaticLine( wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr )
{
Create(parent, id, pos, size, style, name);
}
virtual ~wxStaticLine();
bool Create( wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr );
// it's necessary to override this wxWindow function because we
// will want to return the main widget for m_statbox
//
WXWidget GetMainWidget() const;
// override wxWindow methods to make things work
virtual void DoSetSize(int x, int y, int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void DoMoveWindow(int x, int y, int width, int height);
protected:
// we implement the static line using a static box
wxStaticBox *m_statbox;
};
#endif // _WX_GENERIC_STATLINE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dvrenderers.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dvrenderers.h
// Purpose: All generic wxDataViewCtrl renderer classes
// Author: Robert Roebling, Vadim Zeitlin
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
// Copyright: (c) 2006 Robert Roebling
// (c) 2009 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_DVRENDERERS_H_
#define _WX_GENERIC_DVRENDERERS_H_
// ---------------------------------------------------------
// wxDataViewCustomRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("string"); }
wxDataViewCustomRenderer( const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
// see the explanation of the following WXOnXXX() methods in wx/generic/dvrenderer.h
virtual bool WXActivateCell(const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col,
const wxMouseEvent *mouseEvent) wxOVERRIDE
{
return ActivateCell(cell, model, item, col, mouseEvent);
}
#if wxUSE_ACCESSIBILITY
virtual wxString GetAccessibleDescription() const wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer);
};
// ---------------------------------------------------------
// wxDataViewTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("string"); }
wxDataViewTextRenderer( const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual ~wxDataViewTextRenderer();
#if wxUSE_MARKUP
void EnableMarkup(bool enable = true);
#endif // wxUSE_MARKUP
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE;
virtual bool GetValue( wxVariant &value ) const wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual wxString GetAccessibleDescription() const wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Render(wxRect cell, wxDC *dc, int state) wxOVERRIDE;
virtual wxSize GetSize() const wxOVERRIDE;
// in-place editing
virtual bool HasEditorCtrl() const wxOVERRIDE;
virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value ) wxOVERRIDE;
virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ) wxOVERRIDE;
protected:
wxString m_text;
private:
#if wxUSE_MARKUP
class wxItemMarkupText *m_markupText;
#endif // wxUSE_MARKUP
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer);
};
// ---------------------------------------------------------
// wxDataViewBitmapRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("wxBitmap"); }
wxDataViewBitmapRenderer( const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE;
virtual bool GetValue( wxVariant &value ) const wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual wxString GetAccessibleDescription() const wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Render( wxRect cell, wxDC *dc, int state ) wxOVERRIDE;
virtual wxSize GetSize() const wxOVERRIDE;
private:
wxIcon m_icon;
wxBitmap m_bitmap;
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer);
};
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("bool"); }
wxDataViewToggleRenderer( const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
void ShowAsRadio() { m_radio = true; }
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE;
virtual bool GetValue( wxVariant &value ) const wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual wxString GetAccessibleDescription() const wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Render( wxRect cell, wxDC *dc, int state ) wxOVERRIDE;
virtual wxSize GetSize() const wxOVERRIDE;
// Implementation only, don't use nor override
virtual bool WXActivateCell(const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col,
const wxMouseEvent *mouseEvent) wxOVERRIDE;
private:
bool m_toggle;
bool m_radio;
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer);
};
// ---------------------------------------------------------
// wxDataViewProgressRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("long"); }
wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE;
virtual bool GetValue( wxVariant& value ) const wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual wxString GetAccessibleDescription() const wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Render(wxRect cell, wxDC *dc, int state) wxOVERRIDE;
virtual wxSize GetSize() const wxOVERRIDE;
private:
wxString m_label;
int m_value;
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer);
};
// ---------------------------------------------------------
// wxDataViewIconTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("wxDataViewIconText"); }
wxDataViewIconTextRenderer( const wxString &varianttype = GetDefaultType(),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE;
virtual bool GetValue( wxVariant &value ) const wxOVERRIDE;
#if wxUSE_ACCESSIBILITY
virtual wxString GetAccessibleDescription() const wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Render(wxRect cell, wxDC *dc, int state) wxOVERRIDE;
virtual wxSize GetSize() const wxOVERRIDE;
virtual bool HasEditorCtrl() const wxOVERRIDE { return true; }
virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value ) wxOVERRIDE;
virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ) wxOVERRIDE;
private:
wxDataViewIconText m_value;
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer);
};
#endif // _WX_GENERIC_DVRENDERERS_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/splash.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/splash.h
// Purpose: Splash screen class
// Author: Julian Smart
// Modified by:
// Created: 28/6/2000
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SPLASH_H_
#define _WX_SPLASH_H_
#include "wx/bitmap.h"
#include "wx/eventfilter.h"
#include "wx/frame.h"
#include "wx/timer.h"
/*
* A window for displaying a splash screen
*/
#define wxSPLASH_CENTRE_ON_PARENT 0x01
#define wxSPLASH_CENTRE_ON_SCREEN 0x02
#define wxSPLASH_NO_CENTRE 0x00
#define wxSPLASH_TIMEOUT 0x04
#define wxSPLASH_NO_TIMEOUT 0x00
class WXDLLIMPEXP_FWD_CORE wxSplashScreenWindow;
/*
* wxSplashScreen
*/
class WXDLLIMPEXP_CORE wxSplashScreen: public wxFrame,
public wxEventFilter
{
public:
// for RTTI macros only
wxSplashScreen() { Init(); }
wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
virtual ~wxSplashScreen();
void OnCloseWindow(wxCloseEvent& event);
void OnNotify(wxTimerEvent& event);
long GetSplashStyle() const { return m_splashStyle; }
wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
int GetTimeout() const { return m_milliseconds; }
// Override wxEventFilter method to hide splash screen on any user input.
virtual int FilterEvent(wxEvent& event) wxOVERRIDE;
protected:
// Common part of all ctors.
void Init();
wxSplashScreenWindow* m_window;
long m_splashStyle;
int m_milliseconds;
wxTimer m_timer;
wxDECLARE_DYNAMIC_CLASS(wxSplashScreen);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxSplashScreen);
};
/*
* wxSplashScreenWindow
*/
class WXDLLIMPEXP_CORE wxSplashScreenWindow: public wxWindow
{
public:
wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER);
void OnPaint(wxPaintEvent& event);
void OnEraseBackground(wxEraseEvent& event);
void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
wxBitmap& GetBitmap() { return m_bitmap; }
protected:
wxBitmap m_bitmap;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow);
};
#endif
// _WX_SPLASH_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/grideditors.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/grideditors.h
// Purpose: wxGridCellEditorEvtHandler and wxGrid editors
// 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_EDITORS_H_
#define _WX_GENERIC_GRID_EDITORS_H_
#include "wx/defs.h"
#if wxUSE_GRID
#include "wx/scopedptr.h"
class wxGridCellEditorEvtHandler : public wxEvtHandler
{
public:
wxGridCellEditorEvtHandler(wxGrid* grid, wxGridCellEditor* editor)
: m_grid(grid),
m_editor(editor),
m_inSetFocus(false)
{
}
void OnKillFocus(wxFocusEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnChar(wxKeyEvent& event);
void SetInSetFocus(bool inSetFocus) { m_inSetFocus = inSetFocus; }
private:
wxGrid *m_grid;
wxGridCellEditor *m_editor;
// Work around the fact that a focus kill event can be sent to
// a combobox within a set focus event.
bool m_inSetFocus;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler);
wxDECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler);
};
#if wxUSE_TEXTCTRL
// the editor for string/text data
class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor
{
public:
explicit wxGridCellTextEditor(size_t maxChars = 0);
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
virtual void PaintBackground(wxDC& dc,
const wxRect& rectCell,
const wxGridCellAttr& attr) wxOVERRIDE;
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual bool EndEdit(int row, int col, const wxGrid* grid,
const wxString& oldval, wxString *newval) wxOVERRIDE;
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual void Reset() wxOVERRIDE;
virtual void StartingKey(wxKeyEvent& event) wxOVERRIDE;
virtual void HandleReturn(wxKeyEvent& event) wxOVERRIDE;
// parameters string format is "max_width"
virtual void SetParameters(const wxString& params) wxOVERRIDE;
#if wxUSE_VALIDATORS
virtual void SetValidator(const wxValidator& validator);
#endif
virtual wxGridCellEditor *Clone() const wxOVERRIDE;
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const wxOVERRIDE;
protected:
wxTextCtrl *Text() const { return (wxTextCtrl *)m_control; }
// parts of our virtual functions reused by the derived classes
void DoCreate(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler,
long style = 0);
void DoBeginEdit(const wxString& startValue);
void DoReset(const wxString& startValue);
private:
size_t m_maxChars; // max number of chars allowed
#if wxUSE_VALIDATORS
wxScopedPtr<wxValidator> m_validator;
#endif
wxString m_value;
wxDECLARE_NO_COPY_CLASS(wxGridCellTextEditor);
};
// the editor for numeric (long) data
class WXDLLIMPEXP_ADV wxGridCellNumberEditor : public wxGridCellTextEditor
{
public:
// allows to specify the range - if min == max == -1, no range checking is
// done
wxGridCellNumberEditor(int min = -1, int max = -1);
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual bool EndEdit(int row, int col, const wxGrid* grid,
const wxString& oldval, wxString *newval) wxOVERRIDE;
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual void Reset() wxOVERRIDE;
virtual void StartingKey(wxKeyEvent& event) wxOVERRIDE;
// parameters string format is "min,max"
virtual void SetParameters(const wxString& params) wxOVERRIDE;
virtual wxGridCellEditor *Clone() const wxOVERRIDE
{ return new wxGridCellNumberEditor(m_min, m_max); }
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const wxOVERRIDE;
protected:
#if wxUSE_SPINCTRL
wxSpinCtrl *Spin() const { return (wxSpinCtrl *)m_control; }
#endif
// if HasRange(), we use wxSpinCtrl - otherwise wxTextCtrl
bool HasRange() const
{
#if wxUSE_SPINCTRL
return m_min != m_max;
#else
return false;
#endif
}
// string representation of our value
wxString GetString() const
{ return wxString::Format(wxT("%ld"), m_value); }
private:
int m_min,
m_max;
long m_value;
wxDECLARE_NO_COPY_CLASS(wxGridCellNumberEditor);
};
enum wxGridCellFloatFormat
{
// Decimal floating point (%f)
wxGRID_FLOAT_FORMAT_FIXED = 0x0010,
// Scientific notation (mantise/exponent) using e character (%e)
wxGRID_FLOAT_FORMAT_SCIENTIFIC = 0x0020,
// Use the shorter of %e or %f (%g)
wxGRID_FLOAT_FORMAT_COMPACT = 0x0040,
// To use in combination with one of the above formats (%F/%E/%G)
wxGRID_FLOAT_FORMAT_UPPER = 0x0080,
// Format used by default.
wxGRID_FLOAT_FORMAT_DEFAULT = wxGRID_FLOAT_FORMAT_FIXED,
// A mask to extract format from the combination of flags.
wxGRID_FLOAT_FORMAT_MASK = wxGRID_FLOAT_FORMAT_FIXED |
wxGRID_FLOAT_FORMAT_SCIENTIFIC |
wxGRID_FLOAT_FORMAT_COMPACT |
wxGRID_FLOAT_FORMAT_UPPER
};
// the editor for floating point numbers (double) data
class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor
{
public:
wxGridCellFloatEditor(int width = -1,
int precision = -1,
int format = wxGRID_FLOAT_FORMAT_DEFAULT);
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual bool EndEdit(int row, int col, const wxGrid* grid,
const wxString& oldval, wxString *newval) wxOVERRIDE;
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual void Reset() wxOVERRIDE;
virtual void StartingKey(wxKeyEvent& event) wxOVERRIDE;
virtual wxGridCellEditor *Clone() const wxOVERRIDE
{ return new wxGridCellFloatEditor(m_width, m_precision); }
// parameters string format is "width[,precision[,format]]"
// format to choose beween f|e|g|E|G (f is used by default)
virtual void SetParameters(const wxString& params) wxOVERRIDE;
protected:
// string representation of our value
wxString GetString();
private:
int m_width,
m_precision;
double m_value;
int m_style;
wxString m_format;
wxDECLARE_NO_COPY_CLASS(wxGridCellFloatEditor);
};
#endif // wxUSE_TEXTCTRL
#if wxUSE_CHECKBOX
// the editor for boolean data
class WXDLLIMPEXP_ADV wxGridCellBoolEditor : public wxGridCellEditor
{
public:
wxGridCellBoolEditor() { }
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
virtual void Show(bool show, wxGridCellAttr *attr = NULL) wxOVERRIDE;
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual bool EndEdit(int row, int col, const wxGrid* grid,
const wxString& oldval, wxString *newval) wxOVERRIDE;
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual void Reset() wxOVERRIDE;
virtual void StartingClick() wxOVERRIDE;
virtual void StartingKey(wxKeyEvent& event) wxOVERRIDE;
virtual wxGridCellEditor *Clone() const wxOVERRIDE
{ return new wxGridCellBoolEditor; }
// added GetValue so we can get the value which is in the control, see
// also UseStringValues()
virtual wxString GetValue() const wxOVERRIDE;
// set the string values returned by GetValue() for the true and false
// states, respectively
static void UseStringValues(const wxString& valueTrue = wxT("1"),
const wxString& valueFalse = wxEmptyString);
// return true if the given string is equal to the string representation of
// true value which we currently use
static bool IsTrueValue(const wxString& value);
protected:
wxCheckBox *CBox() const { return (wxCheckBox *)m_control; }
private:
bool m_value;
static wxString ms_stringValues[2];
wxDECLARE_NO_COPY_CLASS(wxGridCellBoolEditor);
};
#endif // wxUSE_CHECKBOX
#if wxUSE_COMBOBOX
// the editor for string data allowing to choose from the list of strings
class WXDLLIMPEXP_ADV wxGridCellChoiceEditor : public wxGridCellEditor
{
public:
// if !allowOthers, user can't type a string not in choices array
wxGridCellChoiceEditor(size_t count = 0,
const wxString choices[] = NULL,
bool allowOthers = false);
wxGridCellChoiceEditor(const wxArrayString& choices,
bool allowOthers = false);
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
virtual void PaintBackground(wxDC& dc,
const wxRect& rectCell,
const wxGridCellAttr& attr) wxOVERRIDE;
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual bool EndEdit(int row, int col, const wxGrid* grid,
const wxString& oldval, wxString *newval) wxOVERRIDE;
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual void Reset() wxOVERRIDE;
// parameters string format is "item1[,item2[...,itemN]]"
virtual void SetParameters(const wxString& params) wxOVERRIDE;
virtual wxGridCellEditor *Clone() const wxOVERRIDE;
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const wxOVERRIDE;
protected:
wxComboBox *Combo() const { return (wxComboBox *)m_control; }
wxString m_value;
wxArrayString m_choices;
bool m_allowOthers;
wxDECLARE_NO_COPY_CLASS(wxGridCellChoiceEditor);
};
#endif // wxUSE_COMBOBOX
#if wxUSE_COMBOBOX
class WXDLLIMPEXP_ADV wxGridCellEnumEditor : public wxGridCellChoiceEditor
{
public:
wxGridCellEnumEditor( const wxString& choices = wxEmptyString );
virtual ~wxGridCellEnumEditor() {}
virtual wxGridCellEditor* Clone() const wxOVERRIDE;
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual bool EndEdit(int row, int col, const wxGrid* grid,
const wxString& oldval, wxString *newval) wxOVERRIDE;
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
private:
long m_index;
wxDECLARE_NO_COPY_CLASS(wxGridCellEnumEditor);
};
#endif // wxUSE_COMBOBOX
class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor
{
public:
wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;
virtual wxGridCellEditor *Clone() const wxOVERRIDE
{ return new wxGridCellAutoWrapStringEditor; }
wxDECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor);
};
#endif // wxUSE_GRID
#endif // _WX_GENERIC_GRID_EDITORS_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/sashwin.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/sashwin.h
// Purpose: wxSashWindow implementation. A sash window has an optional
// sash on each edge, allowing it to be dragged. An event
// is generated when the sash is released.
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SASHWIN_H_G_
#define _WX_SASHWIN_H_G_
#if wxUSE_SASH
#include "wx/defs.h"
#include "wx/window.h"
#include "wx/string.h"
#define wxSASH_DRAG_NONE 0
#define wxSASH_DRAG_DRAGGING 1
#define wxSASH_DRAG_LEFT_DOWN 2
enum wxSashEdgePosition {
wxSASH_TOP = 0,
wxSASH_RIGHT,
wxSASH_BOTTOM,
wxSASH_LEFT,
wxSASH_NONE = 100
};
/*
* wxSashEdge represents one of the four edges of a window.
*/
class WXDLLIMPEXP_CORE wxSashEdge
{
public:
wxSashEdge()
{ m_show = false;
m_margin = 0; }
bool m_show; // Is the sash showing?
int m_margin; // The margin size
};
/*
* wxSashWindow flags
*/
#define wxSW_NOBORDER 0x0000
//#define wxSW_3D 0x0010
#define wxSW_BORDER 0x0020
#define wxSW_3DSASH 0x0040
#define wxSW_3DBORDER 0x0080
#define wxSW_3D (wxSW_3DSASH | wxSW_3DBORDER)
/*
* wxSashWindow allows any of its edges to have a sash which can be dragged
* to resize the window. The actual content window will be created as a child
* of wxSashWindow.
*/
class WXDLLIMPEXP_CORE wxSashWindow: public wxWindow
{
public:
// Default constructor
wxSashWindow()
{
Init();
}
// Normal constructor
wxSashWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"))
{
Init();
Create(parent, id, pos, size, style, name);
}
virtual ~wxSashWindow();
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"));
// Set whether there's a sash in this position
void SetSashVisible(wxSashEdgePosition edge, bool sash);
// Get whether there's a sash in this position
bool GetSashVisible(wxSashEdgePosition edge) const { return m_sashes[edge].m_show; }
// Get border size
int GetEdgeMargin(wxSashEdgePosition edge) const { return m_sashes[edge].m_margin; }
// Sets the default sash border size
void SetDefaultBorderSize(int width) { m_borderSize = width; }
// Gets the default sash border size
int GetDefaultBorderSize() const { return m_borderSize; }
// Sets the addition border size between child and sash window
void SetExtraBorderSize(int width) { m_extraBorderSize = width; }
// Gets the addition border size between child and sash window
int GetExtraBorderSize() const { return m_extraBorderSize; }
virtual void SetMinimumSizeX(int min) { m_minimumPaneSizeX = min; }
virtual void SetMinimumSizeY(int min) { m_minimumPaneSizeY = min; }
virtual int GetMinimumSizeX() const { return m_minimumPaneSizeX; }
virtual int GetMinimumSizeY() const { return m_minimumPaneSizeY; }
virtual void SetMaximumSizeX(int max) { m_maximumPaneSizeX = max; }
virtual void SetMaximumSizeY(int max) { m_maximumPaneSizeY = max; }
virtual int GetMaximumSizeX() const { return m_maximumPaneSizeX; }
virtual int GetMaximumSizeY() const { return m_maximumPaneSizeY; }
////////////////////////////////////////////////////////////////////////////
// Implementation
// Paints the border and sash
void OnPaint(wxPaintEvent& event);
// Handles mouse events
void OnMouseEvent(wxMouseEvent& ev);
// Adjusts the panes
void OnSize(wxSizeEvent& event);
#if defined(__WXMSW__) || defined(__WXMAC__)
// Handle cursor correctly
void OnSetCursor(wxSetCursorEvent& event);
#endif // wxMSW
// Draws borders
void DrawBorders(wxDC& dc);
// Draws the sashes
void DrawSash(wxSashEdgePosition edge, wxDC& dc);
// Draws the sashes
void DrawSashes(wxDC& dc);
// Draws the sash tracker (for whilst moving the sash)
void DrawSashTracker(wxSashEdgePosition edge, int x, int y);
// Tests for x, y over sash
wxSashEdgePosition SashHitTest(int x, int y, int tolerance = 2);
// Resizes subwindows
void SizeWindows();
// Initialize colours
void InitColours();
private:
void Init();
wxSashEdge m_sashes[4];
int m_dragMode;
wxSashEdgePosition m_draggingEdge;
int m_oldX;
int m_oldY;
int m_borderSize;
int m_extraBorderSize;
int m_firstX;
int m_firstY;
int m_minimumPaneSizeX;
int m_minimumPaneSizeY;
int m_maximumPaneSizeX;
int m_maximumPaneSizeY;
wxCursor* m_sashCursorWE;
wxCursor* m_sashCursorNS;
wxColour m_lightShadowColour;
wxColour m_mediumShadowColour;
wxColour m_darkShadowColour;
wxColour m_hilightColour;
wxColour m_faceColour;
bool m_mouseCaptured;
wxCursor* m_currentCursor;
private:
wxDECLARE_DYNAMIC_CLASS(wxSashWindow);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxSashWindow);
};
class WXDLLIMPEXP_FWD_CORE wxSashEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SASH_DRAGGED, wxSashEvent );
enum wxSashDragStatus
{
wxSASH_STATUS_OK,
wxSASH_STATUS_OUT_OF_RANGE
};
class WXDLLIMPEXP_CORE wxSashEvent: public wxCommandEvent
{
public:
wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE)
{
m_eventType = (wxEventType) wxEVT_SASH_DRAGGED;
m_id = id;
m_edge = edge;
}
wxSashEvent(const wxSashEvent& event)
: wxCommandEvent(event),
m_edge(event.m_edge),
m_dragRect(event.m_dragRect),
m_dragStatus(event.m_dragStatus) { }
void SetEdge(wxSashEdgePosition edge) { m_edge = edge; }
wxSashEdgePosition GetEdge() const { return m_edge; }
//// The rectangle formed by the drag operation
void SetDragRect(const wxRect& rect) { m_dragRect = rect; }
wxRect GetDragRect() const { return m_dragRect; }
//// Whether the drag caused the rectangle to be reversed (e.g.
//// dragging the top below the bottom)
void SetDragStatus(wxSashDragStatus status) { m_dragStatus = status; }
wxSashDragStatus GetDragStatus() const { return m_dragStatus; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxSashEvent(*this); }
private:
wxSashEdgePosition m_edge;
wxRect m_dragRect;
wxSashDragStatus m_dragStatus;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSashEvent);
};
typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&);
#define wxSashEventHandler(func) \
wxEVENT_HANDLER_CAST(wxSashEventFunction, func)
#define EVT_SASH_DRAGGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_SASH_DRAGGED, id, wxSashEventHandler(fn))
#define EVT_SASH_DRAGGED_RANGE(id1, id2, fn) \
wx__DECLARE_EVT2(wxEVT_SASH_DRAGGED, id1, id2, wxSashEventHandler(fn))
#endif // wxUSE_SASH
#endif
// _WX_SASHWIN_H_G_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/fontdlgg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/fontdlgg.h
// Purpose: wxGenericFontDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_FONTDLGG_H
#define _WX_GENERIC_FONTDLGG_H
#include "wx/gdicmn.h"
#include "wx/font.h"
#define USE_SPINCTRL_FOR_POINT_SIZE 0
/*
* FONT DIALOG
*/
class WXDLLIMPEXP_FWD_CORE wxChoice;
class WXDLLIMPEXP_FWD_CORE wxText;
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxFontPreviewer;
enum
{
wxID_FONT_UNDERLINE = 3000,
wxID_FONT_STYLE,
wxID_FONT_WEIGHT,
wxID_FONT_FAMILY,
wxID_FONT_COLOUR,
wxID_FONT_SIZE
};
class WXDLLIMPEXP_CORE wxGenericFontDialog : public wxFontDialogBase
{
public:
wxGenericFontDialog() { Init(); }
wxGenericFontDialog(wxWindow *parent)
: wxFontDialogBase(parent) { Init(); }
wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
: wxFontDialogBase(parent, data) { Init(); }
virtual ~wxGenericFontDialog();
virtual int ShowModal() wxOVERRIDE;
// Internal functions
void OnCloseWindow(wxCloseEvent& event);
virtual void CreateWidgets();
virtual void InitializeFont();
void OnChangeFont(wxCommandEvent& event);
#if USE_SPINCTRL_FOR_POINT_SIZE
void OnChangeSize(wxSpinEvent& event);
#endif
protected:
virtual bool DoCreate(wxWindow *parent) wxOVERRIDE;
private:
// common part of all ctors
void Init();
void DoChangeFont();
wxFont m_dialogFont;
wxChoice *m_familyChoice;
wxChoice *m_styleChoice;
wxChoice *m_weightChoice;
wxChoice *m_colourChoice;
wxCheckBox *m_underLineCheckBox;
#if USE_SPINCTRL_FOR_POINT_SIZE
wxSpinCtrl *m_pointSizeSpin;
#else
wxChoice *m_pointSizeChoice;
#endif
wxFontPreviewer *m_previewer;
bool m_useEvents;
// static bool fontDialogCancelled;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericFontDialog);
};
#endif // _WX_GENERIC_FONTDLGG_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/mdig.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/mdig.h
// Purpose: Generic MDI (Multiple Document Interface) classes
// Author: Hans Van Leemputten
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
// Created: 29/07/2002
// Copyright: (c) 2002 Hans Van Leemputten
// (c) 2008 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_MDIG_H_
#define _WX_GENERIC_MDIG_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/panel.h"
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent;
class WXDLLIMPEXP_FWD_CORE wxIcon;
class WXDLLIMPEXP_FWD_CORE wxIconBundle;
class WXDLLIMPEXP_FWD_CORE wxNotebook;
#if wxUSE_GENERIC_MDI_AS_NATIVE
#define wxGenericMDIParentFrame wxMDIParentFrame
#define wxGenericMDIChildFrame wxMDIChildFrame
#define wxGenericMDIClientWindow wxMDIClientWindow
#else // !wxUSE_GENERIC_MDI_AS_NATIVE
class WXDLLIMPEXP_FWD_CORE wxGenericMDIParentFrame;
class WXDLLIMPEXP_FWD_CORE wxGenericMDIChildFrame;
class WXDLLIMPEXP_FWD_CORE wxGenericMDIClientWindow;
#endif // wxUSE_GENERIC_MDI_AS_NATIVE/!wxUSE_GENERIC_MDI_AS_NATIVE
// ----------------------------------------------------------------------------
// wxGenericMDIParentFrame
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericMDIParentFrame : public wxMDIParentFrameBase
{
public:
wxGenericMDIParentFrame() { Init(); }
wxGenericMDIParentFrame(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr)
{
Init();
Create(parent, winid, title, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
virtual ~wxGenericMDIParentFrame();
// implement base class pure virtuals
static bool IsTDI() { return true; }
virtual void ActivateNext() { AdvanceActive(true); }
virtual void ActivatePrevious() { AdvanceActive(false); }
#if wxUSE_MENUS
virtual void SetWindowMenu(wxMenu* pMenu);
virtual void SetMenuBar(wxMenuBar *pMenuBar);
#endif // wxUSE_MENUS
virtual wxGenericMDIClientWindow *OnCreateGenericClient();
// implementation only from now on
void WXSetChildMenuBar(wxGenericMDIChildFrame *child);
void WXUpdateChildTitle(wxGenericMDIChildFrame *child);
void WXActivateChild(wxGenericMDIChildFrame *child);
void WXRemoveChild(wxGenericMDIChildFrame *child);
bool WXIsActiveChild(wxGenericMDIChildFrame *child) const;
bool WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const;
// return the book control used by the client window to manage the pages
wxBookCtrlBase *GetBookCtrl() const;
protected:
#if wxUSE_MENUS
wxMenuBar *m_pMyMenuBar;
#endif // wxUSE_MENUS
// advance the activation forward or backwards
void AdvanceActive(bool forward);
private:
void Init();
#if wxUSE_MENUS
void RemoveWindowMenu(wxMenuBar *pMenuBar);
void AddWindowMenu(wxMenuBar *pMenuBar);
void OnWindowMenu(wxCommandEvent& event);
#endif // wxUSE_MENUS
virtual bool ProcessEvent(wxEvent& event);
void OnClose(wxCloseEvent& event);
// return the client window, may be NULL if we hadn't been created yet
wxGenericMDIClientWindow *GetGenericClientWindow() const;
// close all children, return false if any of them vetoed it
bool CloseAll();
// this pointer is non-NULL if we're currently inside our ProcessEvent()
// and we forwarded the event to this child (as we do with menu events)
wxMDIChildFrameBase *m_childHandler;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIParentFrame);
};
// ----------------------------------------------------------------------------
// wxGenericMDIChildFrame
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericMDIChildFrame : public wxTDIChildFrame
{
public:
wxGenericMDIChildFrame() { Init(); }
wxGenericMDIChildFrame(wxGenericMDIParentFrame *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
{
Init();
Create(parent, winid, title, pos, size, style, name);
}
bool Create(wxGenericMDIParentFrame *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxGenericMDIChildFrame();
// implement MDI operations
virtual void Activate();
#if wxUSE_MENUS
virtual void SetMenuBar( wxMenuBar *menu_bar );
virtual wxMenuBar *GetMenuBar() const;
#endif // wxUSE_MENUS
virtual wxString GetTitle() const { return m_title; }
virtual void SetTitle(const wxString& title);
virtual bool TryAfter(wxEvent& event);
// implementation only from now on
wxGenericMDIParentFrame* GetGenericMDIParent() const
{
#if wxUSE_GENERIC_MDI_AS_NATIVE
return GetMDIParent();
#else // generic != native
return m_mdiParentGeneric;
#endif
}
protected:
wxString m_title;
#if wxUSE_MENUS
wxMenuBar *m_pMenuBar;
#endif // wxUSE_MENUS
#if !wxUSE_GENERIC_MDI_AS_NATIVE
wxGenericMDIParentFrame *m_mdiParentGeneric;
#endif
protected:
void Init();
private:
void OnMenuHighlight(wxMenuEvent& event);
void OnClose(wxCloseEvent& event);
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame);
wxDECLARE_EVENT_TABLE();
friend class wxGenericMDIClientWindow;
};
// ----------------------------------------------------------------------------
// wxGenericMDIClientWindow
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericMDIClientWindow : public wxMDIClientWindowBase
{
public:
wxGenericMDIClientWindow() { }
// unfortunately we need to provide our own version of CreateClient()
// because of the difference in the type of the first parameter and
// implement the base class pure virtual method in terms of it
// (CreateGenericClient() is virtual itself to allow customizing the client
// window creation by overriding it in the derived classes)
virtual bool CreateGenericClient(wxWindow *parent);
virtual bool CreateClient(wxMDIParentFrame *parent,
long WXUNUSED(style) = wxVSCROLL | wxHSCROLL)
{
return CreateGenericClient(parent);
}
// implementation only
wxBookCtrlBase *GetBookCtrl() const;
wxGenericMDIChildFrame *GetChild(size_t pos) const;
int FindChild(wxGenericMDIChildFrame *child) const;
private:
void PageChanged(int OldSelection, int newSelection);
void OnPageChanged(wxBookCtrlEvent& event);
void OnSize(wxSizeEvent& event);
// the notebook containing all MDI children as its pages
wxNotebook *m_notebook;
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIClientWindow);
};
// ----------------------------------------------------------------------------
// inline functions implementation
// ----------------------------------------------------------------------------
inline bool
wxGenericMDIParentFrame::
WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const
{
return child == m_childHandler;
}
#endif // _WX_GENERIC_MDIG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/progdlgg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/progdlgg.h
// Purpose: wxGenericProgressDialog class
// Author: Karsten Ballueder
// Modified by: Francesco Montorsi
// Created: 09.05.1999
// Copyright: (c) Karsten Ballueder
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef __PROGDLGH_G__
#define __PROGDLGH_G__
#include "wx/dialog.h"
#include "wx/weakref.h"
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxEventLoop;
class WXDLLIMPEXP_FWD_CORE wxGauge;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
/*
Progress dialog which shows a moving progress bar.
Taken from the Mahogany project.
*/
class WXDLLIMPEXP_CORE wxGenericProgressDialog : public wxDialog
{
public:
wxGenericProgressDialog();
wxGenericProgressDialog(const wxString& title, const wxString& message,
int maximum = 100,
wxWindow *parent = NULL,
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
virtual ~wxGenericProgressDialog();
bool Create(const wxString& title,
const wxString& message,
int maximum = 100,
wxWindow *parent = NULL,
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL);
virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL);
virtual void Resume();
virtual int GetValue() const;
virtual int GetRange() const;
virtual wxString GetMessage() const;
virtual void SetRange(int maximum);
// Return whether "Cancel" or "Skip" button was pressed, always return
// false if the corresponding button is not shown.
virtual bool WasCancelled() const;
virtual bool WasSkipped() const;
// Must provide overload to avoid hiding it (and warnings about it)
virtual void Update() wxOVERRIDE { wxDialog::Update(); }
virtual bool Show( bool show = true ) wxOVERRIDE;
// This enum is an implementation detail and should not be used
// by user code.
enum State
{
Uncancelable = -1, // dialog can't be canceled
Canceled, // can be cancelled and, in fact, was
Continue, // can be cancelled but wasn't
Finished, // finished, waiting to be removed from screen
Dismissed // was closed by user after finishing
};
protected:
// Update just the m_maximum field, this is used by public SetRange() but,
// unlike it, doesn't update the controls state. This makes it useful for
// both this class and its derived classes that don't use m_gauge to
// display progress.
void SetMaximum(int maximum);
// Return the labels to use for showing the elapsed/estimated/remaining
// times respectively.
static wxString GetElapsedLabel() { return wxGetTranslation("Elapsed time:"); }
static wxString GetEstimatedLabel() { return wxGetTranslation("Estimated time:"); }
static wxString GetRemainingLabel() { return wxGetTranslation("Remaining time:"); }
// Similar to wxWindow::HasFlag() but tests for a presence of a wxPD_XXX
// flag in our (separate) flags instead of using m_windowStyle.
bool HasPDFlag(int flag) const { return (m_pdStyle & flag) != 0; }
// Return the progress dialog style. Prefer to use HasPDFlag() if possible.
int GetPDStyle() const { return m_pdStyle; }
void SetPDStyle(int pdStyle) { m_pdStyle = pdStyle; }
// Updates estimated times from a given progress bar value and stores the
// results in provided arguments.
void UpdateTimeEstimates(int value,
unsigned long &elapsedTime,
unsigned long &estimatedTime,
unsigned long &remainingTime);
// Converts seconds to HH:mm:ss format.
static wxString GetFormattedTime(unsigned long timeInSec);
// Create a new event loop if there is no currently running one.
void EnsureActiveEventLoopExists();
// callback for optional abort button
void OnCancel(wxCommandEvent&);
// callback for optional skip button
void OnSkip(wxCommandEvent&);
// callback to disable "hard" window closing
void OnClose(wxCloseEvent&);
// called to disable the other windows while this dialog is shown
void DisableOtherWindows();
// must be called to reenable the other windows temporarily disabled while
// the dialog was shown
void ReenableOtherWindows();
// Store the parent window as wxWindow::m_parent and also set the top level
// parent reference we store in this class itself.
void SetTopParent(wxWindow* parent);
// return the top level parent window of this dialog (may be NULL)
wxWindow *GetTopParent() const { return m_parentTop; }
// continue processing or not (return value for Update())
State m_state;
// the maximum value
int m_maximum;
#if defined(__WXMSW__)
// the factor we use to always keep the value in 16 bit range as the native
// control only supports ranges from 0 to 65,535
size_t m_factor;
#endif // __WXMSW__
// time when the dialog was created
unsigned long m_timeStart;
// time when the dialog was closed or cancelled
unsigned long m_timeStop;
// time between the moment the dialog was closed/cancelled and resume
unsigned long m_break;
private:
// update the label to show the given time (in seconds)
static void SetTimeLabel(unsigned long val, wxStaticText *label);
// common part of all ctors
void Init();
// create the label with given text and another one to show the time nearby
// as the next windows in the sizer, returns the created control
wxStaticText *CreateLabel(const wxString& text, wxSizer *sizer);
// updates the label message
void UpdateMessage(const wxString &newmsg);
// common part of Update() and Pulse(), returns true if not cancelled
bool DoBeforeUpdate(bool *skip);
// common part of Update() and Pulse()
void DoAfterUpdate();
// shortcuts for enabling buttons
void EnableClose();
void EnableSkip(bool enable = true);
void EnableAbort(bool enable = true);
void DisableSkip() { EnableSkip(false); }
void DisableAbort() { EnableAbort(false); }
// the widget displaying current status (may be NULL)
wxGauge *m_gauge;
// the message displayed
wxStaticText *m_msg;
// displayed elapsed, estimated, remaining time
wxStaticText *m_elapsed,
*m_estimated,
*m_remaining;
// Reference to the parent top level window, automatically becomes NULL if
// it it is destroyed and could be always NULL if it's not given at all.
wxWindowRef m_parentTop;
// Progress dialog styles: this is not the same as m_windowStyle because
// wxPD_XXX constants clash with the existing TLW styles so to be sure we
// don't have any conflicts we just use a separate variable for storing
// them.
int m_pdStyle;
// skip some portion
bool m_skip;
// the abort and skip buttons (or NULL if none)
wxButton *m_btnAbort;
wxButton *m_btnSkip;
// saves the time when elapsed time was updated so there is only one
// update per second
unsigned long m_last_timeupdate;
// tells how often a change of the estimated time has to be confirmed
// before it is actually displayed - this reduces the frequency of updates
// of estimated and remaining time
int m_delay;
// counts the confirmations
int m_ctdelay;
unsigned long m_display_estimated;
// for wxPD_APP_MODAL case
wxWindowDisabler *m_winDisabler;
// Temporary event loop created by the dialog itself if there is no
// currently active loop when it is created.
wxEventLoop *m_tempEventLoop;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxGenericProgressDialog);
};
#endif // __PROGDLGH_G__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/clrpickerg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/clrpickerg.h
// Purpose: wxGenericColourButton header
// Author: Francesco Montorsi (based on Vadim Zeitlin's code)
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Vadim Zeitlin, Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLRPICKER_H_
#define _WX_CLRPICKER_H_
#include "wx/button.h"
#include "wx/bmpbuttn.h"
#include "wx/colourdata.h"
//-----------------------------------------------------------------------------
// wxGenericColourButton: a button which brings up a wxColourDialog
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericColourButton : public wxBitmapButton,
public wxColourPickerWidgetBase
{
public:
wxGenericColourButton() {}
wxGenericColourButton(wxWindow *parent,
wxWindowID id,
const wxColour& col = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr)
{
Create(parent, id, col, pos, size, style, validator, name);
}
virtual ~wxGenericColourButton() {}
public: // API extensions specific for wxGenericColourButton
// user can override this to init colour data in a different way
virtual void InitColourData();
// returns the colour data shown in wxColourDialog
wxColourData *GetColourData() { return &ms_data; }
public:
bool Create(wxWindow *parent,
wxWindowID id,
const wxColour& col = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr);
void OnButtonClick(wxCommandEvent &);
protected:
wxBitmap m_bitmap;
wxSize DoGetBestSize() const wxOVERRIDE;
void UpdateColour() wxOVERRIDE;
// the colour data shown in wxColourPickerCtrlGeneric
// controls. This member is static so that all colour pickers
// in the program share the same set of custom colours.
static wxColourData ms_data;
private:
wxDECLARE_DYNAMIC_CLASS(wxGenericColourButton);
};
#endif // _WX_CLRPICKER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/bmpcbox.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/bmpcbox.h
// Purpose: wxBitmapComboBox
// Author: Jaakko Salli
// Modified by:
// Created: Aug-30-2006
// Copyright: (c) Jaakko Salli
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_BMPCBOX_H_
#define _WX_GENERIC_BMPCBOX_H_
#define wxGENERIC_BITMAPCOMBOBOX 1
#include "wx/odcombo.h"
// ----------------------------------------------------------------------------
// wxBitmapComboBox: a wxComboBox that allows images to be shown
// in front of string items.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxBitmapComboBox : public wxOwnerDrawnComboBox,
public wxBitmapComboBoxBase
{
public:
// ctors and such
wxBitmapComboBox() : wxOwnerDrawnComboBox(), wxBitmapComboBoxBase()
{
Init();
}
wxBitmapComboBox(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
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 = wxBitmapComboBoxNameStr)
: wxOwnerDrawnComboBox(),
wxBitmapComboBoxBase()
{
Init();
(void)Create(parent, id, value, pos, size, n,
choices, style, validator, name);
}
wxBitmapComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
int n,
const wxString choices[],
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
virtual ~wxBitmapComboBox();
// Adds item with image to the end of the combo box.
int Append(const wxString& item, const wxBitmap& bitmap = wxNullBitmap);
int Append(const wxString& item, const wxBitmap& bitmap, void *clientData);
int Append(const wxString& item, const wxBitmap& bitmap, wxClientData *clientData);
// Inserts item with image into the list before pos. Not valid for wxCB_SORT
// styles, use Append instead.
int Insert(const wxString& item, const wxBitmap& bitmap, unsigned int pos);
int Insert(const wxString& item, const wxBitmap& bitmap,
unsigned int pos, void *clientData);
int Insert(const wxString& item, const wxBitmap& bitmap,
unsigned int pos, wxClientData *clientData);
// Sets the image for the given item.
virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) wxOVERRIDE;
virtual bool SetFont(const wxFont& font) wxOVERRIDE;
protected:
virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const wxOVERRIDE;
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const wxOVERRIDE;
virtual wxCoord OnMeasureItem(size_t item) const wxOVERRIDE;
virtual wxCoord OnMeasureItemWidth(size_t item) const wxOVERRIDE;
// Event handlers
void OnSize(wxSizeEvent& event);
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual wxItemContainer* GetItemContainer() wxOVERRIDE { return this; }
virtual wxWindow* GetControl() wxOVERRIDE { return this; }
// wxItemContainer implementation
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData, wxClientDataType type) wxOVERRIDE;
virtual void DoClear() wxOVERRIDE;
virtual void DoDeleteOneItem(unsigned int n) wxOVERRIDE;
private:
bool m_inResize;
void Init();
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxBitmapComboBox);
};
#endif // _WX_GENERIC_BMPCBOX_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/spinctlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/spinctlg.h
// Purpose: generic wxSpinCtrl class
// Author: Vadim Zeitlin
// Modified by:
// Created: 28.10.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_SPINCTRL_H_
#define _WX_GENERIC_SPINCTRL_H_
// ----------------------------------------------------------------------------
// wxSpinCtrl is a combination of wxSpinButton and wxTextCtrl, so if
// wxSpinButton is available, this is what we do - but if it isn't, we still
// define wxSpinCtrl class which then has the same appearance as wxTextCtrl but
// the different interface. This allows to write programs using wxSpinCtrl
// without tons of #ifdefs.
// ----------------------------------------------------------------------------
#if wxUSE_SPINBTN
#include "wx/compositewin.h"
class WXDLLIMPEXP_FWD_CORE wxSpinButton;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
class wxSpinCtrlTextGeneric; // wxTextCtrl used for the wxSpinCtrlGenericBase
// The !wxUSE_SPINBTN version's GetValue() function conflicts with the
// wxTextCtrl's GetValue() and so you have to input a dummy int value.
#define wxSPINCTRL_GETVALUE_FIX
// ----------------------------------------------------------------------------
// wxSpinCtrlGeneric is a combination of wxTextCtrl and wxSpinButton
//
// This class manages a double valued generic spinctrl through the DoGet/SetXXX
// functions that are made public as Get/SetXXX functions for int or double
// for the wxSpinCtrl and wxSpinCtrlDouble classes respectively to avoid
// function ambiguity.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase
: public wxNavigationEnabled<wxCompositeWindow<wxSpinCtrlBase> >
{
public:
wxSpinCtrlGenericBase() { Init(); }
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("wxSpinCtrl"));
virtual ~wxSpinCtrlGenericBase();
// accessors
// T GetValue() const
// T GetMin() const
// T GetMax() const
// T GetIncrement() const
virtual bool GetSnapToTicks() const wxOVERRIDE { return m_snap_to_ticks; }
// unsigned GetDigits() const - wxSpinCtrlDouble only
// operations
virtual void SetValue(const wxString& text) wxOVERRIDE;
// void SetValue(T val)
// void SetRange(T minVal, T maxVal)
// void SetIncrement(T inc)
virtual void SetSnapToTicks(bool snap_to_ticks) wxOVERRIDE;
// void SetDigits(unsigned digits) - wxSpinCtrlDouble only
// Select text in the textctrl
void SetSelection(long from, long to) wxOVERRIDE;
// implementation from now on
// forward these functions to all subcontrols
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
virtual bool SetBackgroundColour(const wxColour& colour) wxOVERRIDE;
// get the subcontrols
wxTextCtrl *GetText() const { return m_textCtrl; }
wxSpinButton *GetSpinButton() const { return m_spinButton; }
// forwarded events from children windows
void OnSpinButton(wxSpinEvent& event);
void OnTextLostFocus(wxFocusEvent& event);
void OnTextChar(wxKeyEvent& event);
// this window itself is used only as a container for its sub windows so it
// shouldn't accept the focus at all and any attempts to explicitly set
// focus to it should give focus to its text constol part
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
virtual void SetFocus() wxOVERRIDE;
friend class wxSpinCtrlTextGeneric;
protected:
// override the base class virtuals involved into geometry calculations
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
#ifdef __WXMSW__
// and, for MSW, enabling this window itself
virtual void DoEnable(bool enable) wxOVERRIDE;
#endif // __WXMSW__
enum SendEvent
{
SendEvent_None,
SendEvent_Text
};
// generic double valued functions
double DoGetValue() const { return m_value; }
bool DoSetValue(double val, SendEvent sendEvent);
void DoSetRange(double min_val, double max_val);
void DoSetIncrement(double inc);
// update our value to reflect the text control contents (if it has been
// modified by user, do nothing otherwise)
//
// can also change the text control if its value is invalid
//
// return true if our value has changed
bool SyncSpinToText(SendEvent sendEvent);
// Send the correct event type
virtual void DoSendEvent() = 0;
// Convert the text to/from the corresponding value.
virtual bool DoTextToValue(const wxString& text, double *val) = 0;
virtual wxString DoValueToText(double val) = 0;
// check if the value is in range
bool InRange(double n) const { return (n >= m_min) && (n <= m_max); }
// ensure that the value is in range wrapping it round if necessary
double AdjustToFitInRange(double value) const;
double m_value;
double m_min;
double m_max;
double m_increment;
bool m_snap_to_ticks;
int m_spin_value;
// the subcontrols
wxTextCtrl *m_textCtrl;
wxSpinButton *m_spinButton;
private:
// common part of all ctors
void Init();
// Implement pure virtual function inherited from wxCompositeWindow.
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE;
wxDECLARE_EVENT_TABLE();
};
#else // !wxUSE_SPINBTN
#define wxSPINCTRL_GETVALUE_FIX int = 1
// ----------------------------------------------------------------------------
// wxSpinCtrl is just a text control
// ----------------------------------------------------------------------------
#include "wx/textctrl.h"
class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase : public wxTextCtrl
{
public:
wxSpinCtrlGenericBase() : m_value(0), m_min(0), m_max(100),
m_increment(1), m_snap_to_ticks(false),
m_format(wxT("%g")) { }
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("wxSpinCtrl"))
{
m_min = min;
m_max = max;
m_value = initial;
m_increment = inc;
bool ok = wxTextCtrl::Create(parent, id, value, pos, size, style,
wxDefaultValidator, name);
DoSetValue(initial, SendEvent_None);
return ok;
}
// accessors
// T GetValue() const
// T GetMin() const
// T GetMax() const
// T GetIncrement() const
virtual bool GetSnapToTicks() const { return m_snap_to_ticks; }
// unsigned GetDigits() const - wxSpinCtrlDouble only
// operations
virtual void SetValue(const wxString& text) { wxTextCtrl::SetValue(text); }
// void SetValue(T val)
// void SetRange(T minVal, T maxVal)
// void SetIncrement(T inc)
virtual void SetSnapToTicks(bool snap_to_ticks)
{ m_snap_to_ticks = snap_to_ticks; }
// void SetDigits(unsigned digits) - wxSpinCtrlDouble only
// Select text in the textctrl
//void SetSelection(long from, long to);
protected:
// generic double valued
double DoGetValue() const
{
double n;
if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%lf"), &n) != 1) )
n = INT_MIN;
return n;
}
bool DoSetValue(double val, SendEvent sendEvent)
{
wxString str(wxString::Format(m_format, val));
switch ( sendEvent )
{
case SendEvent_None:
wxTextCtrl::ChangeValue(str);
break;
case SendEvent_Text:
wxTextCtrl::SetValue(str);
break;
}
return true;
}
void DoSetRange(double min_val, double max_val)
{
m_min = min_val;
m_max = max_val;
}
void DoSetIncrement(double inc) { m_increment = inc; } // Note: unused
double m_value;
double m_min;
double m_max;
double m_increment;
bool m_snap_to_ticks;
wxString m_format;
};
#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN
#if !defined(wxHAS_NATIVE_SPINCTRL)
//-----------------------------------------------------------------------------
// wxSpinCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlGenericBase
{
public:
wxSpinCtrl() { Init(); }
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"))
{
Init();
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
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"))
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial, 1, name);
}
// accessors
int GetValue(wxSPINCTRL_GETVALUE_FIX) const { return int(DoGetValue()); }
int GetMin() const { return int(m_min); }
int GetMax() const { return int(m_max); }
int GetIncrement() const { return int(m_increment); }
// operations
void SetValue(const wxString& value)
{ wxSpinCtrlGenericBase::SetValue(value); }
void SetValue( int value ) { DoSetValue(value, SendEvent_None); }
void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); }
void SetIncrement(int inc) { DoSetIncrement(inc); }
virtual int GetBase() const { return m_base; }
virtual bool SetBase(int base);
protected:
virtual void DoSendEvent();
virtual bool DoTextToValue(const wxString& text, double *val);
virtual wxString DoValueToText(double val);
private:
// Common part of all ctors.
void Init()
{
m_base = 10;
}
int m_base;
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrl);
};
#endif // wxHAS_NATIVE_SPINCTRL
//-----------------------------------------------------------------------------
// wxSpinCtrlDouble
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinCtrlDouble : public wxSpinCtrlGenericBase
{
public:
wxSpinCtrlDouble() { Init(); }
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"))
{
Init();
Create(parent, id, value, pos, size, style,
min, max, initial, inc, name);
}
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"))
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial,
inc, name);
}
// accessors
double GetValue(wxSPINCTRL_GETVALUE_FIX) const { return DoGetValue(); }
double GetMin() const { return m_min; }
double GetMax() const { return m_max; }
double GetIncrement() const { return m_increment; }
unsigned GetDigits() const { return m_digits; }
// operations
void SetValue(const wxString& value) wxOVERRIDE
{ wxSpinCtrlGenericBase::SetValue(value); }
void SetValue(double value) { DoSetValue(value, SendEvent_None); }
void SetRange(double minVal, double maxVal) { DoSetRange(minVal, maxVal); }
void SetIncrement(double inc) { DoSetIncrement(inc); }
void SetDigits(unsigned digits);
// We don't implement bases support for floating point numbers, this is not
// very useful in practice.
virtual int GetBase() const wxOVERRIDE { return 10; }
virtual bool SetBase(int WXUNUSED(base)) wxOVERRIDE { return false; }
protected:
virtual void DoSendEvent() wxOVERRIDE;
virtual bool DoTextToValue(const wxString& text, double *val) wxOVERRIDE;
virtual wxString DoValueToText(double val) wxOVERRIDE;
unsigned m_digits;
private:
// Common part of all ctors.
void Init()
{
m_digits = 0;
m_format = wxS("%g");
}
wxString m_format;
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrlDouble);
};
#endif // _WX_GENERIC_SPINCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/dirctrlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dirctrlg.h
// Purpose: wxGenericDirCtrl class
// Builds on wxDirCtrl class written by Robert Roebling for the
// wxFile application, modified by Harm van der Heijden.
// Further modified for Windows.
// Author: Robert Roebling, Harm van der Heijden, Julian Smart et al
// Modified by:
// Created: 21/3/2000
// Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIRCTRL_H_
#define _WX_DIRCTRL_H_
#if wxUSE_DIRDLG || wxUSE_FILEDLG
#include "wx/treectrl.h"
#include "wx/dialog.h"
#include "wx/dirdlg.h"
#include "wx/choice.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogDefaultFolderStr[];
//-----------------------------------------------------------------------------
// Extra styles for wxGenericDirCtrl
//-----------------------------------------------------------------------------
enum
{
// Only allow directory viewing/selection, no files
wxDIRCTRL_DIR_ONLY = 0x0010,
// When setting the default path, select the first file in the directory
wxDIRCTRL_SELECT_FIRST = 0x0020,
// Show the filter list
wxDIRCTRL_SHOW_FILTERS = 0x0040,
// Use 3D borders on internal controls
wxDIRCTRL_3D_INTERNAL = 0x0080,
// Editable labels
wxDIRCTRL_EDIT_LABELS = 0x0100,
// Allow multiple selection
wxDIRCTRL_MULTIPLE = 0x0200,
wxDIRCTRL_DEFAULT_STYLE = wxDIRCTRL_3D_INTERNAL
};
//-----------------------------------------------------------------------------
// wxDirItemData
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDirItemData : public wxTreeItemData
{
public:
wxDirItemData(const wxString& path, const wxString& name, bool isDir);
virtual ~wxDirItemData(){}
void SetNewDirName(const wxString& path);
bool HasSubDirs() const;
bool HasFiles(const wxString& spec = wxEmptyString) const;
wxString m_path, m_name;
bool m_isHidden;
bool m_isExpanded;
bool m_isDir;
};
//-----------------------------------------------------------------------------
// wxDirCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxDirFilterListCtrl;
class WXDLLIMPEXP_CORE wxGenericDirCtrl: public wxControl
{
public:
wxGenericDirCtrl();
wxGenericDirCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRCTRL_DEFAULT_STYLE,
const wxString& filter = wxEmptyString,
int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr )
{
Init();
Create(parent, id, dir, pos, size, style, filter, defaultFilter, name);
}
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRCTRL_DEFAULT_STYLE,
const wxString& filter = wxEmptyString,
int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr );
virtual void Init();
virtual ~wxGenericDirCtrl();
void OnExpandItem(wxTreeEvent &event );
void OnCollapseItem(wxTreeEvent &event );
void OnBeginEditItem(wxTreeEvent &event );
void OnEndEditItem(wxTreeEvent &event );
void OnTreeSelChange(wxTreeEvent &event);
void OnItemActivated(wxTreeEvent &event);
void OnSize(wxSizeEvent &event );
// Try to expand as much of the given path as possible.
virtual bool ExpandPath(const wxString& path);
// collapse the path
virtual bool CollapsePath(const wxString& path);
// Accessors
virtual inline wxString GetDefaultPath() const { return m_defaultPath; }
virtual void SetDefaultPath(const wxString& path) { m_defaultPath = path; }
// Get dir or filename
virtual wxString GetPath() const;
virtual void GetPaths(wxArrayString& paths) const;
// Get selected filename path only (else empty string).
// I.e. don't count a directory as a selection
virtual wxString GetFilePath() const;
virtual void GetFilePaths(wxArrayString& paths) const;
virtual void SetPath(const wxString& path);
virtual void SelectPath(const wxString& path, bool select = true);
virtual void SelectPaths(const wxArrayString& paths);
virtual void ShowHidden( bool show );
virtual bool GetShowHidden() { return m_showHidden; }
virtual wxString GetFilter() const { return m_filter; }
virtual void SetFilter(const wxString& filter);
virtual int GetFilterIndex() const { return m_currentFilter; }
virtual void SetFilterIndex(int n);
virtual wxTreeItemId GetRootId() { return m_rootId; }
virtual wxTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; }
virtual wxDirFilterListCtrl* GetFilterListCtrl() const { return m_filterListCtrl; }
virtual void UnselectAll();
// Helper
virtual void SetupSections();
// Find the child that matches the first part of 'path'.
// E.g. if a child path is "/usr" and 'path' is "/usr/include"
// then the child for /usr is returned.
// If the path string has been used (we're at the leaf), done is set to true
virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done);
wxString GetPath(wxTreeItemId itemId) const;
// Resize the components of the control
virtual void DoResize();
// Collapse & expand the tree, thus re-creating it from scratch:
virtual void ReCreateTree();
// Collapse the entire tree
virtual void CollapseTree();
// overridden base class methods
virtual void SetFocus() wxOVERRIDE;
protected:
virtual void ExpandRoot();
virtual void ExpandDir(wxTreeItemId parentId);
virtual void CollapseDir(wxTreeItemId parentId);
virtual const wxTreeItemId AddSection(const wxString& path, const wxString& name, int imageId = 0);
virtual wxTreeItemId AppendItem (const wxTreeItemId & parent,
const wxString & text,
int image = -1, int selectedImage = -1,
wxTreeItemData * data = NULL);
//void FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayString& filenames);
virtual wxTreeCtrl* CreateTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long treeStyle);
// Extract description and actual filter from overall filter string
bool ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description);
private:
void PopulateNode(wxTreeItemId node);
wxDirItemData* GetItemData(wxTreeItemId itemId);
bool m_showHidden;
wxTreeItemId m_rootId;
wxString m_defaultPath; // Starting path
long m_styleEx; // Extended style
wxString m_filter; // Wildcards in same format as per wxFileDialog
int m_currentFilter; // The current filter index
wxString m_currentFilterStr; // Current filter string
wxTreeCtrl* m_treeCtrl;
wxDirFilterListCtrl* m_filterListCtrl;
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxGenericDirCtrl);
wxDECLARE_NO_COPY_CLASS(wxGenericDirCtrl);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRCTRL_SELECTIONCHANGED, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRCTRL_FILEACTIVATED, wxTreeEvent );
#define wx__DECLARE_DIRCTRL_EVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_DIRCTRL_ ## evt, id, wxTreeEventHandler(fn))
#define EVT_DIRCTRL_SELECTIONCHANGED(id, fn) wx__DECLARE_DIRCTRL_EVT(SELECTIONCHANGED, id, fn)
#define EVT_DIRCTRL_FILEACTIVATED(id, fn) wx__DECLARE_DIRCTRL_EVT(FILEACTIVATED, id, fn)
//-----------------------------------------------------------------------------
// wxDirFilterListCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDirFilterListCtrl: public wxChoice
{
public:
wxDirFilterListCtrl() { Init(); }
wxDirFilterListCtrl(wxGenericDirCtrl* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0)
{
Init();
Create(parent, id, pos, size, style);
}
bool Create(wxGenericDirCtrl* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
void Init();
virtual ~wxDirFilterListCtrl() {}
//// Operations
void FillFilterList(const wxString& filter, int defaultFilter);
//// Events
void OnSelFilter(wxCommandEvent& event);
protected:
wxGenericDirCtrl* m_dirCtrl;
wxDECLARE_EVENT_TABLE();
wxDECLARE_CLASS(wxDirFilterListCtrl);
wxDECLARE_NO_COPY_CLASS(wxDirFilterListCtrl);
};
#if !defined(__WXMSW__) && !defined(__WXMAC__)
#define wxDirCtrl wxGenericDirCtrl
#endif
// Symbols for accessing individual controls
#define wxID_TREECTRL 7000
#define wxID_FILTERLISTCTRL 7001
#endif // wxUSE_DIRDLG
//-------------------------------------------------------------------------
// wxFileIconsTable - use wxTheFileIconsTable which is created as necessary
//-------------------------------------------------------------------------
#if wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL
class WXDLLIMPEXP_FWD_CORE wxImageList;
class WXDLLIMPEXP_CORE wxFileIconsTable
{
public:
wxFileIconsTable();
~wxFileIconsTable();
enum iconId_Type
{
folder,
folder_open,
computer,
drive,
cdrom,
floppy,
removeable,
file,
executable
};
int GetIconID(const wxString& extension, const wxString& mime = wxEmptyString);
wxImageList *GetSmallImageList();
const wxSize& GetSize() const { return m_size; }
void SetSize(const wxSize& sz) { m_size = sz; }
bool IsOk() const { return m_smallImageList != NULL; }
protected:
void Create(const wxSize& sz); // create on first use
wxImageList *m_smallImageList;
wxHashTable *m_HashTable;
wxSize m_size;
};
// The global fileicons table
extern WXDLLIMPEXP_DATA_CORE(wxFileIconsTable *) wxTheFileIconsTable;
#endif // wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_DIRCTRL_SELECTIONCHANGED wxEVT_DIRCTRL_SELECTIONCHANGED
#define wxEVT_COMMAND_DIRCTRL_FILEACTIVATED wxEVT_DIRCTRL_FILEACTIVATED
#endif
// _WX_DIRCTRLG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/fdrepdlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/fdrepdlg.h
// Purpose: wxGenericFindReplaceDialog class
// Author: Markus Greither
// Modified by:
// Created: 25/05/2001
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_FDREPDLG_H_
#define _WX_GENERIC_FDREPDLG_H_
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxRadioBox;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
// ----------------------------------------------------------------------------
// wxGenericFindReplaceDialog: dialog for searching / replacing text
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericFindReplaceDialog : public wxFindReplaceDialogBase
{
public:
wxGenericFindReplaceDialog() { Init(); }
wxGenericFindReplaceDialog(wxWindow *parent,
wxFindReplaceData *data,
const wxString& title,
int style = 0)
{
Init();
(void)Create(parent, data, title, style);
}
bool Create(wxWindow *parent,
wxFindReplaceData *data,
const wxString& title,
int style = 0);
protected:
void Init();
void SendEvent(const wxEventType& evtType);
void OnFind(wxCommandEvent& event);
void OnReplace(wxCommandEvent& event);
void OnReplaceAll(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
void OnUpdateFindUI(wxUpdateUIEvent& event);
void OnCloseWindow(wxCloseEvent& event);
wxCheckBox *m_chkCase,
*m_chkWord;
wxRadioBox *m_radioDir;
wxTextCtrl *m_textFind,
*m_textRepl;
private:
wxDECLARE_DYNAMIC_CLASS(wxGenericFindReplaceDialog);
wxDECLARE_EVENT_TABLE();
};
#endif // _WX_GENERIC_FDREPDLG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/headerctrlg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/headerctrlg.h
// Purpose: Generic wxHeaderCtrl implementation
// Author: Vadim Zeitlin
// Created: 2008-12-01
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_HEADERCTRLG_H_
#define _WX_GENERIC_HEADERCTRLG_H_
#include "wx/event.h"
#include "wx/vector.h"
#include "wx/overlay.h"
// ----------------------------------------------------------------------------
// wxHeaderCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
{
public:
wxHeaderCtrl()
{
Init();
}
wxHeaderCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr)
{
Init();
Create(parent, id, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr);
virtual ~wxHeaderCtrl();
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
private:
// implement base class pure virtuals
virtual void DoSetCount(unsigned int count) wxOVERRIDE;
virtual unsigned int DoGetCount() const wxOVERRIDE;
virtual void DoUpdate(unsigned int idx) wxOVERRIDE;
virtual void DoScrollHorz(int dx) wxOVERRIDE;
virtual void DoSetColumnsOrder(const wxArrayInt& order) wxOVERRIDE;
virtual wxArrayInt DoGetColumnsOrder() const wxOVERRIDE;
// common part of all ctors
void Init();
// event handlers
void OnPaint(wxPaintEvent& event);
void OnMouse(wxMouseEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnCaptureLost(wxMouseCaptureLostEvent& event);
// move the column with given idx at given position (this doesn't generate
// any events but does refresh the display)
void DoMoveCol(unsigned int idx, unsigned int pos);
// return the horizontal start position of the given column in physical
// coordinates
int GetColStart(unsigned int idx) const;
// and the end position
int GetColEnd(unsigned int idx) const;
// refresh the given column [only]; idx must be valid
void RefreshCol(unsigned int idx);
// refresh the given column if idx is valid
void RefreshColIfNotNone(unsigned int idx);
// refresh all the controls starting from (and including) the given one
void RefreshColsAfter(unsigned int idx);
// return the column at the given position or -1 if it is beyond the
// rightmost column and put true into onSeparator output parameter if the
// position is near the divider at the right end of this column (notice
// that this means that we return column 0 even if the position is over
// column 1 but close enough to the divider separating it from column 0)
unsigned int FindColumnAtPoint(int x, bool *onSeparator = NULL) const;
// return the result of FindColumnAtPoint() if it is a valid column,
// otherwise the index of the last (rightmost) displayed column
unsigned int FindColumnClosestToPoint(int xPhysical) const;
// return true if a drag resizing operation is currently in progress
bool IsResizing() const;
// return true if a drag reordering operation is currently in progress
bool IsReordering() const;
// return true if any drag operation is currently in progress
bool IsDragging() const { return IsResizing() || IsReordering(); }
// end any drag operation currently in progress (resizing or reordering)
void EndDragging();
// cancel the drag operation currently in progress and generate an event
// about it
void CancelDragging();
// start (if m_colBeingResized is -1) or continue resizing the column
//
// this generates wxEVT_HEADER_BEGIN_RESIZE/RESIZING events and can
// cancel the operation if the user handler decides so
void StartOrContinueResizing(unsigned int col, int xPhysical);
// end the resizing operation currently in progress and generate an event
// about it with its cancelled flag set if xPhysical is -1
void EndResizing(int xPhysical);
// same functions as above but for column moving/reordering instead of
// resizing
void StartReordering(unsigned int col, int xPhysical);
// returns true if we did drag the column somewhere else or false if we
// didn't really move it -- in this case we consider that no reordering
// took place and that a normal column click event should be generated
bool EndReordering(int xPhysical);
// constrain the given position to be larger than the start position of the
// given column plus its minimal width and return the effective width
int ConstrainByMinWidth(unsigned int col, int& xPhysical);
// update the information displayed while a column is being moved around
void UpdateReorderingMarker(int xPhysical);
// clear any overlaid markers
void ClearMarkers();
// number of columns in the control currently
unsigned int m_numColumns;
// index of the column under mouse or -1 if none
unsigned int m_hover;
// the column being resized or -1 if there is no resizing operation in
// progress
unsigned int m_colBeingResized;
// the column being moved or -1 if there is no reordering operation in
// progress
unsigned int m_colBeingReordered;
// the distance from the start of m_colBeingReordered and the mouse
// position when the user started to drag it
int m_dragOffset;
// the horizontal scroll offset
int m_scrollOffset;
// the overlay display used during the dragging operations
wxOverlay m_overlay;
// the indices of the column appearing at the given position on the display
// (its size is always m_numColumns)
wxArrayInt m_colIndices;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrl);
};
#endif // _WX_GENERIC_HEADERCTRLG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/filepickerg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/filepickerg.h
// Purpose: wxGenericFileDirButton, wxGenericFileButton, wxGenericDirButton
// Author: Francesco Montorsi
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEDIRPICKER_H_
#define _WX_FILEDIRPICKER_H_
#include "wx/button.h"
#include "wx/filedlg.h"
#include "wx/dirdlg.h"
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRPICKER_CHANGED, wxFileDirPickerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILEPICKER_CHANGED, wxFileDirPickerEvent );
//-----------------------------------------------------------------------------
// wxGenericFileDirButton: a button which brings up a wx{File|Dir}Dialog
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericFileDirButton : public wxButton,
public wxFileDirPickerWidgetBase
{
public:
wxGenericFileDirButton() { Init(); }
wxGenericFileDirButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr)
{
Init();
Create(parent, id, label, path, message, wildcard,
pos, size, style, validator, name);
}
virtual wxControl *AsControl() wxOVERRIDE { return this; }
public: // overridable
virtual wxDialog *CreateDialog() = 0;
virtual wxWindow *GetDialogParent()
{ return GetParent(); }
virtual wxEventType GetEventType() const = 0;
virtual void SetInitialDirectory(const wxString& dir) wxOVERRIDE;
public:
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr);
// event handler for the click
void OnButtonClick(wxCommandEvent &);
protected:
wxString m_message, m_wildcard;
// we just store the style passed to the ctor here instead of passing it to
// wxButton as some of our bits can conflict with wxButton styles and it
// just doesn't make sense to use picker styles for wxButton anyhow
long m_pickerStyle;
// Initial directory set by SetInitialDirectory() call or empty.
wxString m_initialDir;
private:
// common part of all ctors
void Init() { m_pickerStyle = -1; }
};
//-----------------------------------------------------------------------------
// wxGenericFileButton: a button which brings up a wxFileDialog
//-----------------------------------------------------------------------------
#define wxFILEBTN_DEFAULT_STYLE (wxFLP_OPEN)
class WXDLLIMPEXP_CORE wxGenericFileButton : public wxGenericFileDirButton
{
public:
wxGenericFileButton() {}
wxGenericFileButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxFilePickerWidgetLabel,
const wxString& path = wxEmptyString,
const wxString &message = wxFileSelectorPromptStr,
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFILEBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerWidgetNameStr)
{
Create(parent, id, label, path, message, wildcard,
pos, size, style, validator, name);
}
public: // overridable
virtual long GetDialogStyle() const
{
// the derived class must initialize it if it doesn't use the
// non-default wxGenericFileDirButton ctor
wxASSERT_MSG( m_pickerStyle != -1,
"forgot to initialize m_pickerStyle?" );
long filedlgstyle = 0;
if ( m_pickerStyle & wxFLP_OPEN )
filedlgstyle |= wxFD_OPEN;
if ( m_pickerStyle & wxFLP_SAVE )
filedlgstyle |= wxFD_SAVE;
if ( m_pickerStyle & wxFLP_OVERWRITE_PROMPT )
filedlgstyle |= wxFD_OVERWRITE_PROMPT;
if ( m_pickerStyle & wxFLP_FILE_MUST_EXIST )
filedlgstyle |= wxFD_FILE_MUST_EXIST;
if ( m_pickerStyle & wxFLP_CHANGE_DIR )
filedlgstyle |= wxFD_CHANGE_DIR;
return filedlgstyle;
}
virtual wxDialog *CreateDialog() wxOVERRIDE;
wxEventType GetEventType() const wxOVERRIDE
{ return wxEVT_FILEPICKER_CHANGED; }
protected:
void UpdateDialogPath(wxDialog *p) wxOVERRIDE
{ wxStaticCast(p, wxFileDialog)->SetPath(m_path); }
void UpdatePathFromDialog(wxDialog *p) wxOVERRIDE
{ m_path = wxStaticCast(p, wxFileDialog)->GetPath(); }
private:
wxDECLARE_DYNAMIC_CLASS(wxGenericFileButton);
};
//-----------------------------------------------------------------------------
// wxGenericDirButton: a button which brings up a wxDirDialog
//-----------------------------------------------------------------------------
#define wxDIRBTN_DEFAULT_STYLE 0
class WXDLLIMPEXP_CORE wxGenericDirButton : public wxGenericFileDirButton
{
public:
wxGenericDirButton() {}
wxGenericDirButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxDirPickerWidgetLabel,
const wxString& path = wxEmptyString,
const wxString &message = wxDirSelectorPromptStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDirPickerWidgetNameStr)
{
Create(parent, id, label, path, message, wxEmptyString,
pos, size, style, validator, name);
}
public: // overridable
virtual long GetDialogStyle() const
{
long dirdlgstyle = wxDD_DEFAULT_STYLE;
if ( m_pickerStyle & wxDIRP_DIR_MUST_EXIST )
dirdlgstyle |= wxDD_DIR_MUST_EXIST;
if ( m_pickerStyle & wxDIRP_CHANGE_DIR )
dirdlgstyle |= wxDD_CHANGE_DIR;
return dirdlgstyle;
}
virtual wxDialog *CreateDialog() wxOVERRIDE;
wxEventType GetEventType() const wxOVERRIDE
{ return wxEVT_DIRPICKER_CHANGED; }
protected:
void UpdateDialogPath(wxDialog *p) wxOVERRIDE
{ wxStaticCast(p, wxDirDialog)->SetPath(m_path); }
void UpdatePathFromDialog(wxDialog *p) wxOVERRIDE
{ m_path = wxStaticCast(p, wxDirDialog)->GetPath(); }
private:
wxDECLARE_DYNAMIC_CLASS(wxGenericDirButton);
};
// old wxEVT_COMMAND_* constants
//#define wxEVT_COMMAND_DIRPICKER_CHANGED wxEVT_DIRPICKER_CHANGED
//#define wxEVT_COMMAND_FILEPICKER_CHANGED wxEVT_FILEPICKER_CHANGED
#endif // _WX_FILEDIRPICKER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/fswatcher.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/fswatcher.h
// Purpose: wxPollingFileSystemWatcher
// Author: Bartosz Bekier
// Created: 2009-05-26
// Copyright: (c) 2009 Bartosz Bekier <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FSWATCHER_GENERIC_H_
#define _WX_FSWATCHER_GENERIC_H_
#include "wx/defs.h"
#if wxUSE_FSWATCHER
class WXDLLIMPEXP_BASE wxPollingFileSystemWatcher : public wxFileSystemWatcherBase
{
public:
};
#endif // wxUSE_FSWATCHER
#endif /* _WX_FSWATCHER_GENERIC_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/private/listctrl.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/private/listctrl.h
// Purpose: private definitions of wxListCtrl helpers
// Author: Robert Roebling
// Vadim Zeitlin (virtual list control support)
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_LISTCTRL_PRIVATE_H_
#define _WX_GENERIC_LISTCTRL_PRIVATE_H_
#include "wx/defs.h"
#if wxUSE_LISTCTRL
#include "wx/listctrl.h"
#include "wx/selstore.h"
#include "wx/timer.h"
#include "wx/settings.h"
// ============================================================================
// private classes
// ============================================================================
//-----------------------------------------------------------------------------
// wxColWidthInfo (internal)
//-----------------------------------------------------------------------------
struct wxColWidthInfo
{
int nMaxWidth;
bool bNeedsUpdate; // only set to true when an item whose
// width == nMaxWidth is removed
wxColWidthInfo(int w = 0, bool needsUpdate = false)
{
nMaxWidth = w;
bNeedsUpdate = needsUpdate;
}
};
WX_DEFINE_ARRAY_PTR(wxColWidthInfo *, ColWidthArray);
//-----------------------------------------------------------------------------
// wxListItemData (internal)
//-----------------------------------------------------------------------------
class wxListItemData
{
public:
wxListItemData(wxListMainWindow *owner);
~wxListItemData();
void SetItem( const wxListItem &info );
void SetImage( int image ) { m_image = image; }
void SetData( wxUIntPtr data ) { m_data = data; }
void SetPosition( int x, int y );
void SetSize( int width, int height );
bool HasText() const { return !m_text.empty(); }
const wxString& GetText() const { return m_text; }
void SetText(const wxString& text) { m_text = text; }
// we can't use empty string for measuring the string width/height, so
// always return something
wxString GetTextForMeasuring() const
{
wxString s = GetText();
if ( s.empty() )
s = wxT('H');
return s;
}
bool IsHit( int x, int y ) const;
int GetX() const;
int GetY() const;
int GetWidth() const;
int GetHeight() const;
int GetImage() const { return m_image; }
bool HasImage() const { return GetImage() != -1; }
void GetItem( wxListItem &info ) const;
void SetAttr(wxItemAttr *attr) { m_attr = attr; }
wxItemAttr *GetAttr() const { return m_attr; }
public:
// the item image or -1
int m_image;
// user data associated with the item
wxUIntPtr m_data;
// the item coordinates are not used in report mode; instead this pointer is
// NULL and the owner window is used to retrieve the item position and size
wxRect *m_rect;
// the list ctrl we are in
wxListMainWindow *m_owner;
// custom attributes or NULL
wxItemAttr *m_attr;
protected:
// common part of all ctors
void Init();
wxString m_text;
};
//-----------------------------------------------------------------------------
// wxListHeaderData (internal)
//-----------------------------------------------------------------------------
class wxListHeaderData : public wxObject
{
public:
wxListHeaderData();
wxListHeaderData( const wxListItem &info );
void SetItem( const wxListItem &item );
void SetPosition( int x, int y );
void SetWidth( int w );
void SetState( int state );
void SetFormat( int format );
void SetHeight( int h );
bool HasImage() const;
bool HasText() const { return !m_text.empty(); }
const wxString& GetText() const { return m_text; }
void SetText(const wxString& text) { m_text = text; }
void GetItem( wxListItem &item );
bool IsHit( int x, int y ) const;
int GetImage() const;
int GetWidth() const;
int GetFormat() const;
int GetState() const;
protected:
long m_mask;
int m_image;
wxString m_text;
int m_format;
int m_width;
int m_xpos,
m_ypos;
int m_height;
int m_state;
private:
void Init();
};
//-----------------------------------------------------------------------------
// wxListLineData (internal)
//-----------------------------------------------------------------------------
WX_DECLARE_LIST(wxListItemData, wxListItemDataList);
class wxListLineData
{
public:
// the list of subitems: only may have more than one item in report mode
wxListItemDataList m_items;
// this is not used in report view
struct GeometryInfo
{
// total item rect
wxRect m_rectAll;
// label only
wxRect m_rectLabel;
// icon only
wxRect m_rectIcon;
// the part to be highlighted
wxRect m_rectHighlight;
// extend all our rects to be centered inside the one of given width
void ExtendWidth(wxCoord w)
{
wxASSERT_MSG( m_rectAll.width <= w,
wxT("width can only be increased") );
m_rectAll.width = w;
m_rectLabel.x = m_rectAll.x + (w - m_rectLabel.width) / 2;
m_rectIcon.x = m_rectAll.x + (w - m_rectIcon.width) / 2;
m_rectHighlight.x = m_rectAll.x + (w - m_rectHighlight.width) / 2;
}
}
*m_gi;
// is this item selected? [NB: not used in virtual mode]
bool m_highlighted;
bool m_checked;
// back pointer to the list ctrl
wxListMainWindow *m_owner;
public:
wxListLineData(wxListMainWindow *owner);
~wxListLineData()
{
WX_CLEAR_LIST(wxListItemDataList, m_items);
delete m_gi;
}
// called by the owner when it toggles report view
void SetReportView(bool inReportView)
{
// we only need m_gi when we're not in report view so update as needed
if ( inReportView )
{
delete m_gi;
m_gi = NULL;
}
else
{
m_gi = new GeometryInfo;
}
}
// are we in report mode?
inline bool InReportView() const;
// are we in virtual report mode?
inline bool IsVirtual() const;
// these 2 methods shouldn't be called for report view controls, in that
// case we determine our position/size ourselves
// calculate the size of the line
void CalculateSize( wxDC *dc, int spacing );
// remember the position this line appears at
void SetPosition( int x, int y, int spacing );
// wxListCtrl API
void SetImage( int image ) { SetImage(0, image); }
int GetImage() const { return GetImage(0); }
void SetImage( int index, int image );
int GetImage( int index ) const;
void Check(bool check) { m_checked = check; }
bool IsChecked() { return m_checked; }
bool HasImage() const { return GetImage() != -1; }
bool HasText() const { return !GetText(0).empty(); }
void SetItem( int index, const wxListItem &info );
void GetItem( int index, wxListItem &info ) const;
wxString GetText(int index) const;
void SetText( int index, const wxString& s );
wxItemAttr *GetAttr() const;
void SetAttr(wxItemAttr *attr);
// return true if the highlighting really changed
bool Highlight( bool on );
void ReverseHighlight();
bool IsHighlighted() const
{
wxASSERT_MSG( !IsVirtual(), wxT("unexpected call to IsHighlighted") );
return m_highlighted;
}
// draw the line on the given DC in icon/list mode
void Draw( wxDC *dc, bool current );
// the same in report mode: it needs more parameters as we don't store
// everything in the item in report mode
void DrawInReportMode( wxDC *dc,
const wxRect& rect,
const wxRect& rectHL,
bool highlighted,
bool current );
private:
// set the line to contain num items (only can be > 1 in report mode)
void InitItems( int num );
// get the mode (i.e. style) of the list control
inline int GetMode() const;
// Apply this item attributes to the given DC: set the text font and colour
// and also erase the background appropriately.
void ApplyAttributes(wxDC *dc,
const wxRect& rectHL,
bool highlighted,
bool current);
// draw the text on the DC with the correct justification; also add an
// ellipsis if the text is too large to fit in the current width
void DrawTextFormatted(wxDC *dc,
const wxString &text,
int col,
int x,
int yMid, // this is middle, not top, of the text
int width);
};
class wxListLineDataArray : public wxVector<wxListLineData*>
{
public:
void Clear()
{
for ( size_t n = 0; n < size(); ++n )
delete (*this)[n];
clear();
}
~wxListLineDataArray() { Clear(); }
};
//-----------------------------------------------------------------------------
// wxListHeaderWindow (internal)
//-----------------------------------------------------------------------------
class wxListHeaderWindow : public wxWindow
{
protected:
wxListMainWindow *m_owner;
const wxCursor *m_currentCursor;
wxCursor *m_resizeCursor;
bool m_isDragging;
// column being resized or -1
int m_column;
// divider line position in logical (unscrolled) coords
int m_currentX;
// minimal position beyond which the divider line
// can't be dragged in logical coords
int m_minX;
public:
wxListHeaderWindow();
// We provide only Create(), not the ctor, because we need to create the
// C++ object before creating the window, see the explanations in
// CreateOrDestroyHeaderWindowAsNeeded()
bool Create( wxWindow *win,
wxWindowID id,
wxListMainWindow *owner,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxT("wxlistctrlcolumntitles") );
virtual ~wxListHeaderWindow();
// We never need focus as we don't have any keyboard interface.
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
void DrawCurrent();
void AdjustDC( wxDC& dc );
void OnPaint( wxPaintEvent &event );
void OnMouse( wxMouseEvent &event );
// needs refresh
bool m_dirty;
// Update main window's column later
bool m_sendSetColumnWidth;
int m_colToSend;
int m_widthToSend;
virtual wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE { return GetParent(); }
virtual void OnInternalIdle() wxOVERRIDE;
private:
// common part of all ctors
void Init();
// generate and process the list event of the given type, return true if
// it wasn't vetoed, i.e. if we should proceed
bool SendListEvent(wxEventType type, const wxPoint& pos);
wxDECLARE_EVENT_TABLE();
};
//-----------------------------------------------------------------------------
// wxListRenameTimer (internal)
//-----------------------------------------------------------------------------
class wxListRenameTimer: public wxTimer
{
private:
wxListMainWindow *m_owner;
public:
wxListRenameTimer( wxListMainWindow *owner );
void Notify() wxOVERRIDE;
};
//-----------------------------------------------------------------------------
// wxListFindTimer (internal)
//-----------------------------------------------------------------------------
class wxListFindTimer: public wxTimer
{
public:
// reset the current prefix after half a second of inactivity
enum { DELAY = 500 };
wxListFindTimer( wxListMainWindow *owner )
: m_owner(owner)
{
}
virtual void Notify() wxOVERRIDE;
private:
wxListMainWindow *m_owner;
};
//-----------------------------------------------------------------------------
// wxListTextCtrlWrapper: wraps a wxTextCtrl to make it work for inline editing
//-----------------------------------------------------------------------------
class wxListTextCtrlWrapper : public wxEvtHandler
{
public:
// NB: text must be a valid object but not Create()d yet
wxListTextCtrlWrapper(wxListMainWindow *owner,
wxTextCtrl *text,
size_t itemEdit);
wxTextCtrl *GetText() const { return m_text; }
// Check if the given key event should stop editing and return true if it
// does or false otherwise.
bool CheckForEndEditKey(const wxKeyEvent& event);
// Different reasons for calling EndEdit():
//
// It was called because:
enum EndReason
{
End_Accept, // user has accepted the changes.
End_Discard, // user has cancelled editing.
End_Destroy // the entire control is being destroyed.
};
void EndEdit(EndReason reason);
protected:
void OnChar( wxKeyEvent &event );
void OnKeyUp( wxKeyEvent &event );
void OnKillFocus( wxFocusEvent &event );
bool AcceptChanges();
void Finish( bool setfocus );
private:
wxListMainWindow *m_owner;
wxTextCtrl *m_text;
wxString m_startValue;
size_t m_itemEdited;
bool m_aboutToFinish;
wxDECLARE_EVENT_TABLE();
};
//-----------------------------------------------------------------------------
// wxListMainWindow (internal)
//-----------------------------------------------------------------------------
WX_DECLARE_LIST(wxListHeaderData, wxListHeaderDataList);
class wxListMainWindow : public wxWindow
{
public:
wxListMainWindow();
wxListMainWindow( wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size );
virtual ~wxListMainWindow();
// called by the main control when its mode changes
void SetReportView(bool inReportView);
// helper to simplify testing for wxLC_XXX flags
bool HasFlag(int flag) const { return m_parent->HasFlag(flag); }
// return true if this is a virtual list control
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
// return true if the control is in report mode
bool InReportView() const { return HasFlag(wxLC_REPORT); }
// return true if we are in single selection mode, false if multi sel
bool IsSingleSel() const { return HasFlag(wxLC_SINGLE_SEL); }
// do we have a header window?
bool HasHeader() const
{ return InReportView() && !HasFlag(wxLC_NO_HEADER); }
void HighlightAll( bool on );
// all these functions only do something if the line is currently visible
// change the line "selected" state, return true if it really changed
bool HighlightLine( size_t line, bool highlight = true);
// as HighlightLine() but do it for the range of lines: this is incredibly
// more efficient for virtual list controls!
//
// NB: unlike HighlightLine() this one does refresh the lines on screen
void HighlightLines( size_t lineFrom, size_t lineTo, bool on = true );
// toggle the line state and refresh it
void ReverseHighlight( size_t line )
{ HighlightLine(line, !IsHighlighted(line)); RefreshLine(line); }
// return true if the line is highlighted
bool IsHighlighted(size_t line) const;
// refresh one or several lines at once
void RefreshLine( size_t line );
void RefreshLines( size_t lineFrom, size_t lineTo );
// refresh all selected items
void RefreshSelected();
// refresh all lines below the given one: the difference with
// RefreshLines() is that the index here might not be a valid one (happens
// when the last line is deleted)
void RefreshAfter( size_t lineFrom );
// the methods which are forwarded to wxListLineData itself in list/icon
// modes but are here because the lines don't store their positions in the
// report mode
// get the bound rect for the entire line
wxRect GetLineRect(size_t line) const;
// get the bound rect of the label
wxRect GetLineLabelRect(size_t line) const;
// get the bound rect of the items icon (only may be called if we do have
// an icon!)
wxRect GetLineIconRect(size_t line) const;
// get the rect to be highlighted when the item has focus
wxRect GetLineHighlightRect(size_t line) const;
// get the size of the total line rect
wxSize GetLineSize(size_t line) const
{ return GetLineRect(line).GetSize(); }
// return the hit code for the corresponding position (in this line)
long HitTestLine(size_t line, int x, int y) const;
// bring the selected item into view, scrolling to it if necessary
void MoveToItem(size_t item);
bool ScrollList( int WXUNUSED(dx), int dy );
// bring the current item into view
void MoveToFocus() { MoveToItem(m_current); }
// start editing the label of the given item
wxTextCtrl *EditLabel(long item,
wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
bool EndEditLabel(bool cancel);
wxTextCtrl *GetEditControl() const
{
return m_textctrlWrapper ? m_textctrlWrapper->GetText() : NULL;
}
void ResetTextControl(wxTextCtrl *text)
{
delete text;
m_textctrlWrapper = NULL;
}
void OnRenameTimer();
bool OnRenameAccept(size_t itemEdit, const wxString& value);
void OnRenameCancelled(size_t itemEdit);
void OnFindTimer();
// set whether or not to ring the find bell
// (does nothing on MSW - bell is always rung)
void EnableBellOnNoMatch( bool on );
void OnMouse( wxMouseEvent &event );
// called to switch the selection from the current item to newCurrent,
void OnArrowChar( size_t newCurrent, const wxKeyEvent& event );
void OnCharHook( wxKeyEvent &event );
void OnChar( wxKeyEvent &event );
void OnKeyDown( wxKeyEvent &event );
void OnKeyUp( wxKeyEvent &event );
void OnSetFocus( wxFocusEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnScroll( wxScrollWinEvent& event );
void OnPaint( wxPaintEvent &event );
void OnChildFocus(wxChildFocusEvent& event);
void DrawImage( int index, wxDC *dc, int x, int y );
void GetImageSize( int index, int &width, int &height ) const;
void SetImageList( wxImageList *imageList, int which );
void SetItemSpacing( int spacing, bool isSmall = false );
int GetItemSpacing( bool isSmall = false );
void SetColumn( int col, const wxListItem &item );
void SetColumnWidth( int col, int width );
void GetColumn( int col, wxListItem &item ) const;
int GetColumnWidth( int col ) const;
int GetColumnCount() const { return m_columns.GetCount(); }
// returns the sum of the heights of all columns
int GetHeaderWidth() const;
int GetCountPerPage() const;
void SetItem( wxListItem &item );
void GetItem( wxListItem &item ) const;
void SetItemState( long item, long state, long stateMask );
void SetItemStateAll( long state, long stateMask );
int GetItemState( long item, long stateMask ) const;
bool GetItemRect( long item, wxRect &rect ) const
{
return GetSubItemRect(item, wxLIST_GETSUBITEMRECT_WHOLEITEM, rect);
}
bool GetSubItemRect( long item, long subItem, wxRect& rect ) const;
wxRect GetViewRect() const;
bool GetItemPosition( long item, wxPoint& pos ) const;
int GetSelectedItemCount() const;
bool HasCheckBoxes() const;
bool EnableCheckBoxes(bool enable = true);
bool IsItemChecked(long item) const;
void CheckItem(long item, bool check);
wxString GetItemText(long item, int col = 0) const
{
wxListItem info;
info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item;
info.m_col = col;
GetItem( info );
return info.m_text;
}
void SetItemText(long item, const wxString& value)
{
wxListItem info;
info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item;
info.m_text = value;
SetItem( info );
}
wxImageList* GetSmallImageList() const
{ return m_small_image_list; }
// set the scrollbars and update the positions of the items
void RecalculatePositions(bool noRefresh = false);
// refresh the window and the header
void RefreshAll();
long GetNextItem( long item, int geometry, int state ) const;
void DeleteItem( long index );
void DeleteAllItems();
void DeleteColumn( int col );
void DeleteEverything();
void EnsureVisible( long index );
long FindItem( long start, const wxString& str, bool partial = false );
long FindItem( long start, wxUIntPtr data);
long FindItem( const wxPoint& pt );
long HitTest( int x, int y, int &flags ) const;
void InsertItem( wxListItem &item );
long InsertColumn( long col, const wxListItem &item );
int GetItemWidthWithImage(wxListItem * item);
void SortItems( wxListCtrlCompare fn, wxIntPtr data );
size_t GetItemCount() const;
bool IsEmpty() const { return GetItemCount() == 0; }
void SetItemCount(long count);
// change the current (== focused) item, send a notification event
void ChangeCurrent(size_t current);
void ResetCurrent() { ChangeCurrent((size_t)-1); }
bool HasCurrent() const { return m_current != (size_t)-1; }
// send out a wxListEvent
void SendNotify( size_t line,
wxEventType command,
const wxPoint& point = wxDefaultPosition );
// override base class virtual to reset m_lineHeight when the font changes
virtual bool SetFont(const wxFont& font) wxOVERRIDE
{
if ( !wxWindow::SetFont(font) )
return false;
m_lineHeight = 0;
return true;
}
// these are for wxListLineData usage only
// get the backpointer to the list ctrl
wxGenericListCtrl *GetListCtrl() const
{
return wxStaticCast(GetParent(), wxGenericListCtrl);
}
// get the height of all lines (assuming they all do have the same height)
wxCoord GetLineHeight() const;
// get the y position of the given line (only for report view)
wxCoord GetLineY(size_t line) const;
// get the brush to use for the item highlighting
wxBrush *GetHighlightBrush() const
{
return m_hasFocus ? m_highlightBrush : m_highlightUnfocusedBrush;
}
bool HasFocus() const wxOVERRIDE
{
return m_hasFocus;
}
protected:
// the array of all line objects for a non virtual list control (for the
// virtual list control we only ever use m_lines[0])
wxListLineDataArray m_lines;
// the list of column objects
wxListHeaderDataList m_columns;
// currently focused item or -1
size_t m_current;
// the number of lines per page
int m_linesPerPage;
// this flag is set when something which should result in the window
// redrawing happens (i.e. an item was added or deleted, or its appearance
// changed) and OnPaint() doesn't redraw the window while it is set which
// allows to minimize the number of repaintings when a lot of items are
// being added. The real repainting occurs only after the next OnIdle()
// call
bool m_dirty;
wxColour *m_highlightColour;
wxImageList *m_small_image_list;
wxImageList *m_normal_image_list;
int m_small_spacing;
int m_normal_spacing;
bool m_hasFocus;
bool m_lastOnSame;
wxTimer *m_renameTimer;
// incremental search data
wxString m_findPrefix;
wxTimer *m_findTimer;
// This flag is set to 0 if the bell is disabled, 1 if it is enabled and -1
// if it is globally enabled but has been temporarily disabled because we
// had already beeped for this particular search.
int m_findBell;
bool m_isCreated;
int m_dragCount;
wxPoint m_dragStart;
ColWidthArray m_aColWidths;
// for double click logic
size_t m_lineLastClicked,
m_lineBeforeLastClicked,
m_lineSelectSingleOnUp;
bool m_hasCheckBoxes;
protected:
wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE { return GetParent(); }
// the total count of items in a virtual list control
size_t m_countVirt;
// the object maintaining the items selection state, only used in virtual
// controls
wxSelectionStore m_selStore;
// common part of all ctors
void Init();
// get the line data for the given index
wxListLineData *GetLine(size_t n) const
{
wxASSERT_MSG( n != (size_t)-1, wxT("invalid line index") );
if ( IsVirtual() )
{
wxConstCast(this, wxListMainWindow)->CacheLineData(n);
n = 0;
}
return m_lines[n];
}
// get a dummy line which can be used for geometry calculations and such:
// you must use GetLine() if you want to really draw the line
wxListLineData *GetDummyLine() const;
// cache the line data of the n-th line in m_lines[0]
void CacheLineData(size_t line);
// get the range of visible lines
void GetVisibleLinesRange(size_t *from, size_t *to);
// force us to recalculate the range of visible lines
void ResetVisibleLinesRange() { m_lineFrom = (size_t)-1; }
// find the first item starting with the given prefix after the given item
size_t PrefixFindItem(size_t item, const wxString& prefix) const;
// get the colour to be used for drawing the rules
wxColour GetRuleColour() const
{
return wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT);
}
private:
// initialize the current item if needed
void UpdateCurrent();
// delete all items but don't refresh: called from dtor
void DoDeleteAllItems();
// Compute the minimal width needed to fully display the column header.
int ComputeMinHeaderWidth(const wxListHeaderData* header) const;
// Check if the given point is inside the checkbox of this item.
//
// Always returns false if there are no checkboxes.
bool IsInsideCheckBox(long item, int x, int y);
// the height of one line using the current font
wxCoord m_lineHeight;
// the total header width or 0 if not calculated yet
wxCoord m_headerWidth;
// the first and last lines being shown on screen right now (inclusive),
// both may be -1 if they must be calculated so never access them directly:
// use GetVisibleLinesRange() above instead
size_t m_lineFrom,
m_lineTo;
// the brushes to use for item highlighting when we do/don't have focus
wxBrush *m_highlightBrush,
*m_highlightUnfocusedBrush;
// wrapper around the text control currently used for in place editing or
// NULL if no item is being edited
wxListTextCtrlWrapper *m_textctrlWrapper;
wxDECLARE_EVENT_TABLE();
friend class wxGenericListCtrl;
friend class wxListCtrlMaxWidthCalculator;
};
#endif // wxUSE_LISTCTRL
#endif // _WX_GENERIC_LISTCTRL_PRIVATE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/generic/private/markuptext.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/private/markuptext.h
// Purpose: Generic wx*MarkupText classes for managing text with markup.
// Author: Vadim Zeitlin
// Created: 2011-02-21
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_PRIVATE_MARKUPTEXT_H_
#define _WX_GENERIC_PRIVATE_MARKUPTEXT_H_
#include "wx/defs.h"
#include "wx/gdicmn.h"
class WXDLLIMPEXP_FWD_CORE wxDC;
class wxMarkupParserOutput;
// ----------------------------------------------------------------------------
// wxMarkupText: allows to measure and draw the text containing markup.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMarkupTextBase
{
public:
virtual ~wxMarkupTextBase() {}
// Update the markup string.
void SetMarkup(const wxString& markup) { m_markup = markup; }
// Return the width and height required by the given string and optionally
// the height of the visible part above the baseline (i.e. ascent minus
// internal leading).
//
// The font currently selected into the DC is used for measuring (notice
// that it is changed by this function but normally -- i.e. if markup is
// valid -- restored to its original value when it returns).
wxSize Measure(wxDC& dc, int *visibleHeight = NULL) const;
protected:
wxMarkupTextBase(const wxString& markup)
: m_markup(markup)
{
}
// Return m_markup suitable for measuring by Measure, i.e. stripped of
// any mnenomics.
virtual wxString GetMarkupForMeasuring() const = 0;
wxString m_markup;
};
class WXDLLIMPEXP_CORE wxMarkupText : public wxMarkupTextBase
{
public:
// Constants for Render() flags.
enum
{
Render_Default = 0, // Don't show mnemonics visually.
Render_ShowAccels = 1 // Underline mnemonics.
};
// Initialize with the given string containing markup (which is supposed to
// be valid, the caller must check for it before constructing this object).
//
// Notice that the usual rules for mnemonics apply to the markup text: if
// it contains any '&' characters they must be escaped by doubling them,
// otherwise they indicate that the next character is the mnemonic for this
// field.
//
// TODO-MULTILINE-MARKUP: Currently only single line labels are supported,
// search for other occurrences of this comment to find the places which
// need to be updated to support multiline labels with markup.
wxMarkupText(const wxString& markup) : wxMarkupTextBase(markup)
{
}
// Default copy ctor, assignment operator and dtor are ok.
// Update the markup string.
//
// The same rules for mnemonics as in the ctor apply to this string.
void SetMarkup(const wxString& markup) { m_markup = markup; }
// Render the markup string into the given DC in the specified rectangle.
//
// Notice that while the function uses the provided rectangle for alignment
// (it centers the text in it), no clipping is done by it so use Measure()
// and set the clipping region before rendering if necessary.
void Render(wxDC& dc, const wxRect& rect, int flags);
protected:
virtual wxString GetMarkupForMeasuring() const wxOVERRIDE;
};
// ----------------------------------------------------------------------------
// wxItemMarkupText: variant of wxMarkupText for items without mnemonics
// ----------------------------------------------------------------------------
// This class has similar interface to wxItemMarkup, but no strings contain
// mnemonics and no escaping is done.
class WXDLLIMPEXP_CORE wxItemMarkupText : public wxMarkupTextBase
{
public:
// Initialize with the given string containing markup (which is supposed to
// be valid, the caller must check for it before constructing this object).
// Notice that mnemonics are not interpreted at all by this class, so
// literal ampersands shouldn't be escaped/doubled.
wxItemMarkupText(const wxString& markup) : wxMarkupTextBase(markup)
{
}
// Default copy ctor, assignment operator and dtor are ok.
// Similar to wxMarkupText::Render(), but uses wxRendererNative::DrawItemText()
// instead of generic wxDC::DrawLabel(), so is more suitable for use in
// controls that already use DrawItemText() for its items.
//
// The meaning of the flags here is different than in wxMarkupText too:
// they're passed to DrawItemText().
//
// Currently the only supported ellipsize modes are wxELLIPSIZE_NONE and
// wxELLIPSIZE_END, the others are treated as wxELLIPSIZE_END.
void Render(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int rendererFlags,
wxEllipsizeMode ellipsizeMode);
protected:
virtual wxString GetMarkupForMeasuring() const wxOVERRIDE { return m_markup; }
};
#endif // _WX_GENERIC_PRIVATE_MARKUPTEXT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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 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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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 "<", '>' to ">" and '&' to "&"
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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.