wxRuby Documentation Home

# Wx::RichTextHeaderFooterData

This class represents header and footer data to be passed to the RichTextPrinting and
RichTextPrintout 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.

- `DATE`: the current date.
- `PAGESCNT`: the total number of pages.
- `PAGENUM`: the current page number.
- `TIME`: the current time.
- `TITLE`: the title of the document, as passed to the RichTextPrinting or RichTextLayout constructor.

## Derived from

Object

## 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 RichTextOddEvenPage { RICHTEXT_PAGE_ODD, RICHTEXT_PAGE_EVEN, RICHTEXT_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 RichTextPageLocation { RICHTEXT_PAGE_LEFT, RICHTEXT_PAGE_CENTRE, RICHTEXT_PAGE_RIGHT }

## Methods

- RichTextHeaderFooterData.new
- RichTextHeaderFooterData#clear
- RichTextHeaderFooterData#copy
- RichTextHeaderFooterData#get_font
- RichTextHeaderFooterData#get_footer_margin
- RichTextHeaderFooterData#get_footer_text
- RichTextHeaderFooterData#get_header_margin
- RichTextHeaderFooterData#get_header_text
- RichTextHeaderFooterData#get_show_on_first_page
- RichTextHeaderFooterData#get_text
- RichTextHeaderFooterData#get_text_colour
- RichTextHeaderFooterData#init
- RichTextHeaderFooterData#set_font
- RichTextHeaderFooterData#set_footer_text
- RichTextHeaderFooterData#set_header_text
- RichTextHeaderFooterData#set_margins
- RichTextHeaderFooterData#set_show_on_first_page
- RichTextHeaderFooterData#set_text
- RichTextHeaderFooterData#set_text_colour

### RichTextHeaderFooterData.new

RichTextHeaderFooterData.new(%(arg-type)RichTextHeaderFooterData% data)

Constructors.

### RichTextHeaderFooterData#clear

clear()

Clears all text.

### RichTextHeaderFooterData#copy

copy(%(arg-type)RichTextHeaderFooterData% data)

Copies the data.

### RichTextHeaderFooterData#get_font

Font get_font()

Returns the font specified for printing the header and footer.

### RichTextHeaderFooterData#get_footer_margin

Integer get_footer_margin()

Returns the margin between the text and the footer.

### RichTextHeaderFooterData#get_footer_text

String get_footer_text(%(arg-type)RichTextOddEvenPage% page = RICHTEXT_PAGE_EVEN, RichTextPageLocation location = RICHTEXT_PAGE_CENTRE)

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

### RichTextHeaderFooterData#get_header_margin

Integer get_header_margin()

Returns the margin between the text and the header.

### RichTextHeaderFooterData#get_header_text

String get_header_text(%(arg-type)RichTextOddEvenPage% page = RICHTEXT_PAGE_EVEN, RichTextPageLocation location = RICHTEXT_PAGE_CENTRE)

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

### RichTextHeaderFooterData#get_show_on_first_page

Boolean get_show_on_first_page()

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

### RichTextHeaderFooterData#get_text

String get_text(%(arg-type)Integer% headerFooter, RichTextOddEvenPage page, RichTextPageLocation location)

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).

### RichTextHeaderFooterData#get_text_colour

Colour get_text_colour()

Returns the text colour for drawing the header and footer.

### RichTextHeaderFooterData#init

init()

Initialises the object.

### RichTextHeaderFooterData#set_font

set_font(%(arg-type)Font% font)

Sets the font for drawing the header and footer.

### RichTextHeaderFooterData#set_footer_text

set_footer_text(%(arg-type)String% text, RichTextOddEvenPage page = RICHTEXT_PAGE_ALL, RichTextPageLocation location = RICHTEXT_PAGE_CENTRE)

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

### RichTextHeaderFooterData#set_header_text

set_header_text(%(arg-type)String% text, RichTextOddEvenPage page = RICHTEXT_PAGE_ALL, RichTextPageLocation location = RICHTEXT_PAGE_CENTRE)

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

### RichTextHeaderFooterData#set_margins

set_margins(%(arg-type)Integer% headerMargin, Integer footerMargin)

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

### RichTextHeaderFooterData#set_show_on_first_page

set_show_on_first_page(%(arg-type)Boolean% showOnFirstPage)

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

### RichTextHeaderFooterData#set_text

set_text(%(arg-type)String% text, Integer headerFooter, RichTextOddEvenPage page, RichTextPageLocation 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).

### RichTextHeaderFooterData#set_text_colour

set_text_colour(%(arg-type)Colour% col)

Sets the text colour for drawing the header and footer.

### RichTextHeaderFooterData::operator=

void operator operator=(%(arg-type)RichTextHeaderFooterData% data)

Assignment operator.

[This page automatically generated from the Textile source at 2023-06-09 00:45:30 +0000]