wxRichTextFormattingDialog Class Reference
[Rich Text]

#include <wx/richtext/richtextformatdlg.h>

Inheritance diagram for wxRichTextFormattingDialog:

wxPropertySheetDialog wxDialog wxTopLevelWindow wxWindow wxEvtHandler wxObject

List of all members.


Detailed Description

This dialog allows the user to edit a character and/or paragraph style.

In the constructor, specify the pages that will be created. Use wxRichTextFormattingDialog::GetStyle() to retrieve the common style for a given range, and then use wxRichTextFormattingDialog::ApplyStyle() to apply the user-selected formatting to a control.

For example:

        wxRichTextRange range;
        if (m_richTextCtrl-HasSelection())
            range = m_richTextCtrl-GetSelectionRange();
        else
            range = wxRichTextRange(0, m_richTextCtrl-GetLastPosition()+1);

        int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING| \
                    wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;

        wxRichTextFormattingDialog formatDlg(pages, this);
        formatDlg.GetStyle(m_richTextCtrl, range);

        if (formatDlg.ShowModal() == wxID_OK)
        {
            formatDlg.ApplyStyle(m_richTextCtrl, range);
        }

Library:  wxRichText

Category:  Rich Text

Public Member Functions

 wxRichTextFormattingDialog ()
 wxRichTextFormattingDialog (long flags, wxWindow *parent, const wxPoint &pos=wxDefaultPosition, const wxSize &sz=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE)
virtual ~wxRichTextFormattingDialog ()
virtual bool ApplyStyle (wxRichTextCtrl *ctrl, const wxRichTextRange &range, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE)
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)
wxImageListGetImageList () const
virtual bool GetStyle (wxRichTextCtrl *ctrl, const wxRichTextRange &range)
virtual wxRichTextStyleDefinitionGetStyleDefinition () const
virtual wxRichTextStyleSheetGetStyleSheet () const
void SetAttributes (const wxTextAttr &attr)
void SetImageList (wxImageList *imageList)
virtual bool SetStyle (const wxTextAttr &style, bool update=true)
virtual bool SetStyleDefinition (const wxRichTextStyleDefinition &styleDef, wxRichTextStyleSheet *sheet, bool update=true)
virtual bool UpdateDisplay ()
const wxTextAttrGetAttributes () const
wxTextAttrGetAttributes ()

Static Public Member Functions

static wxRichTextFormattingDialogGetDialog (wxWindow *win)
static wxTextAttrGetDialogAttributes (wxWindow *win)
static wxRichTextStyleDefinitionGetDialogStyleDefinition (wxWindow *win)
static
wxRichTextFormattingDialogFactory
GetFormattingDialogFactory ()
static void SetFormattingDialogFactory (wxRichTextFormattingDialogFactory *factory)

Constructor & Destructor Documentation

wxRichTextFormattingDialog::wxRichTextFormattingDialog (  ) 

Default ctor.

wxRichTextFormattingDialog::wxRichTextFormattingDialog ( long  flags,
wxWindow parent,
const wxPoint pos = wxDefaultPosition,
const wxSize sz = wxDefaultSize,
long  style = wxDEFAULT_DIALOG_STYLE 
)

Constructors.

Parameters:
flags The pages to show.
parent The dialog's parent.
pos The dialog's position.
sz The dialog's size.
style The dialog's window style.

virtual wxRichTextFormattingDialog::~wxRichTextFormattingDialog (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool wxRichTextFormattingDialog::ApplyStyle ( wxRichTextCtrl ctrl,
const wxRichTextRange range,
int  flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE 
) [virtual]

Apply attributes to the given range, only changing attributes that need to be changed.

bool wxRichTextFormattingDialog::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 
)

Creation: see wxRichTextFormattingDialog() "the constructor" for details about the parameters.

const wxTextAttr& wxRichTextFormattingDialog::GetAttributes (  )  const

Gets the attributes being edited.

wxTextAttr& wxRichTextFormattingDialog::GetAttributes (  ) 

Gets the attributes being edited.

static wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog ( wxWindow win  )  [static]

Helper for pages to get the top-level dialog.

static wxTextAttr* wxRichTextFormattingDialog::GetDialogAttributes ( wxWindow win  )  [static]

Helper for pages to get the attributes.

static wxRichTextStyleDefinition* wxRichTextFormattingDialog::GetDialogStyleDefinition ( wxWindow win  )  [static]

Helper for pages to get the style.

static wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::GetFormattingDialogFactory (  )  [static]

Returns the object to be used to customize the dialog and provide pages.

wxImageList* wxRichTextFormattingDialog::GetImageList (  )  const

Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.

virtual bool wxRichTextFormattingDialog::GetStyle ( wxRichTextCtrl ctrl,
const wxRichTextRange range 
) [virtual]

Gets common attributes from the given range and calls SetAttributes(). Attributes that do not have common values in the given range will be omitted from the style's flags.

virtual wxRichTextStyleDefinition* wxRichTextFormattingDialog::GetStyleDefinition (  )  const [virtual]

Gets the associated style definition, if any.

virtual wxRichTextStyleSheet* wxRichTextFormattingDialog::GetStyleSheet (  )  const [virtual]

Gets the associated style sheet, if any.

void wxRichTextFormattingDialog::SetAttributes ( const wxTextAttr attr  ) 

Sets the attributes to be edited.

static void wxRichTextFormattingDialog::SetFormattingDialogFactory ( wxRichTextFormattingDialogFactory factory  )  [static]

Sets the formatting factory object to be used for customization and page creation.

It deletes the existing factory object.

void wxRichTextFormattingDialog::SetImageList ( wxImageList imageList  ) 

Sets the image list associated with the dialog's property sheet.

virtual bool wxRichTextFormattingDialog::SetStyle ( const wxTextAttr style,
bool  update = true 
) [virtual]

Sets the attributes and optionally updates the display, if update is true.

virtual bool wxRichTextFormattingDialog::SetStyleDefinition ( const wxRichTextStyleDefinition styleDef,
wxRichTextStyleSheet sheet,
bool  update = true 
) [virtual]

Sets the style definition and optionally update the display, if update is true.

virtual bool wxRichTextFormattingDialog::UpdateDisplay (  )  [virtual]

Updates the display.



wxWidgets logo

[ top ]