Contents Up Previous Next

wxRichTextHeaderFooterData

This class represents header and footer data to be passed to the wxRichTextPrinting and wxRichTextPrintout classes.

Headers and footers can be specified independently for odd, even or both page sides. Different text can be specified for left, centre and right locations on the page, and the font and text colour can also be specified. You can specify the following keywords in header and footer text, which will be substituted for the actual values during printing and preview.

Derived from

wxObject

Include files

<wx/richtex/richtextprint.h>

Data structures

These are the header and footer page identifiers, passed to functions such as SetFooterText to specify the odd or even page for the text:

enum wxRichTextOddEvenPage {
    wxRICHTEXT_PAGE_ODD,
    wxRICHTEXT_PAGE_EVEN,
    wxRICHTEXT_PAGE_ALL,
}
These are the location identifiers for passing to functions such as SetFooterText, to specify whether the text is on the left, centre or right of the page:

enum wxRichTextPageLocation {
    wxRICHTEXT_PAGE_LEFT,
    wxRICHTEXT_PAGE_CENTRE,
    wxRICHTEXT_PAGE_RIGHT
}
Members

wxRichTextHeaderFooterData::wxRichTextHeaderFooterData
wxRichTextHeaderFooterData::Clear
wxRichTextHeaderFooterData::Copy
wxRichTextHeaderFooterData::GetFont
wxRichTextHeaderFooterData::GetFooterMargin
wxRichTextHeaderFooterData::GetFooterText
wxRichTextHeaderFooterData::GetHeaderMargin
wxRichTextHeaderFooterData::GetHeaderText
wxRichTextHeaderFooterData::GetShowOnFirstPage
wxRichTextHeaderFooterData::GetText
wxRichTextHeaderFooterData::GetTextColour
wxRichTextHeaderFooterData::Init
wxRichTextHeaderFooterData::SetFont
wxRichTextHeaderFooterData::SetFooterText
wxRichTextHeaderFooterData::SetHeaderText
wxRichTextHeaderFooterData::SetMargins
wxRichTextHeaderFooterData::SetShowOnFirstPage
wxRichTextHeaderFooterData::SetText
wxRichTextHeaderFooterData::SetTextColour
wxRichTextHeaderFooterData::operator=


wxRichTextHeaderFooterData::wxRichTextHeaderFooterData

wxRichTextHeaderFooterData()

wxRichTextHeaderFooterData(const wxRichTextHeaderFooterData& data)

Constructors.


wxRichTextHeaderFooterData::Clear

void Clear()

Clears all text.


wxRichTextHeaderFooterData::Copy

void Copy(const wxRichTextHeaderFooterData& data)

Copies the data.


wxRichTextHeaderFooterData::GetFont

const wxFont& GetFont() const

Returns the font specified for printing the header and footer.


wxRichTextHeaderFooterData::GetFooterMargin

int GetFooterMargin() const

Returns the margin between the text and the footer.


wxRichTextHeaderFooterData::GetFooterText

wxString GetFooterText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const

Returns the footer text on odd or even pages, and at a given position on the page (left, centre or right).


wxRichTextHeaderFooterData::GetHeaderMargin

int GetHeaderMargin() const

Returns the margin between the text and the header.


wxRichTextHeaderFooterData::GetHeaderText

wxString GetHeaderText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const

Returns the header text on odd or even pages, and at a given position on the page (left, centre or right).


wxRichTextHeaderFooterData::GetShowOnFirstPage

bool GetShowOnFirstPage() const

Returns true if the header and footer will be shown on the first page.


wxRichTextHeaderFooterData::GetText

wxString GetText(int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location) const

Helper function for getting the header or footer text, odd or even pages, and at a given position on the page (left, centre or right).


wxRichTextHeaderFooterData::GetTextColour

const wxColour& GetTextColour() const

Returns the text colour for drawing the header and footer.


wxRichTextHeaderFooterData::Init

void Init()

Initialises the object.


wxRichTextHeaderFooterData::SetFont

void SetFont(const wxFont& font)

Sets the font for drawing the header and footer.


wxRichTextHeaderFooterData::SetFooterText

void SetFooterText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE)

Sets the footer text on odd or even pages, and at a given position on the page (left, centre or right).


wxRichTextHeaderFooterData::SetHeaderText

void SetHeaderText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE)

Sets the header text on odd or even pages, and at a given position on the page (left, centre or right).


wxRichTextHeaderFooterData::SetMargins

void SetMargins(int headerMargin, int footerMargin)

Sets the margins between text and header or footer, in tenths of a millimeter.


wxRichTextHeaderFooterData::SetShowOnFirstPage

void SetShowOnFirstPage(bool showOnFirstPage)

Pass true to show the header or footer on first page (the default).


wxRichTextHeaderFooterData::SetText

void SetText(const wxString& text, int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location)

Helper function for setting the header or footer text, odd or even pages, and at a given position on the page (left, centre or right).


wxRichTextHeaderFooterData::SetTextColour

void SetTextColour(const wxColour& col)

Sets the text colour for drawing the header and footer.


wxRichTextHeaderFooterData::operator=

void operator operator=(const wxRichTextHeaderFooterData& data)

Assignment operator.