wxMaxima
Loading...
Searching...
No Matches
Public Member Functions
wxPdfListCtrlOptions Class Reference

Options that control how a wxListCtrl is rendered into a PDF document. More...

#include <pdflistctrl.h>

Public Member Functions

 wxPdfListCtrlOptions ()
 Default constructor.
 
void SetHeaderFont (const wxFont &font)
 Set the font for the column headers.
 
wxFont GetHeaderFont () const
 Get the font for the column headers.
 
void SetBodyFont (const wxFont &font)
 Set the font for the list items.
 
wxFont GetBodyFont () const
 Get the font for the list items.
 
void SetHeaderPdfFont (const wxPdfFont &font)
 Set the PDF font for the column headers (takes precedence over SetHeaderFont())
 
wxPdfFont GetHeaderPdfFont () const
 Get the PDF font for the column headers.
 
void SetBodyPdfFont (const wxPdfFont &font)
 Set the PDF font for the list items (takes precedence over SetBodyFont())
 
wxPdfFont GetBodyPdfFont () const
 Get the PDF font for the list items.
 
void SetHeaderBackgroundColour (const wxPdfColour &colour)
 Set the background colour for the column headers.
 
wxPdfColour GetHeaderBackgroundColour () const
 Get the background colour for the column headers.
 
void SetHeaderTextColour (const wxPdfColour &colour)
 Set the text colour for the column headers.
 
wxPdfColour GetHeaderTextColour () const
 Get the text colour for the column headers.
 
void SetAlternateRowBackgroundColour (const wxPdfColour &colour)
 Set the background colour for alternate rows.
 
wxPdfColour GetAlternateRowBackgroundColour () const
 Get the background colour for alternate rows.
 
void SetBorderColour (const wxPdfColour &colour)
 Set the colour for borders.
 
wxPdfColour GetBorderColour () const
 Get the colour for borders.
 
void SetDrawRowBorders (bool draw)
 Set whether to draw horizontal borders between rows.
 
bool GetDrawRowBorders () const
 Check whether to draw horizontal borders between rows.
 
void SetDrawColumnBorders (bool draw)
 Set whether to draw vertical borders between columns.
 
bool GetDrawColumnBorders () const
 Check whether to draw vertical borders between columns.
 
void SetShowContinued (bool show)
 Set whether to show "Continued on next page" and "(continued)" labels.
 
bool GetShowContinued () const
 Check whether to show "Continued on next page" and "(continued)" labels.
 
void SetFitToPage (bool fit)
 Set whether to stretch the table to the full printable page width.
 
bool GetFitToPage () const
 Check whether the table is stretched to the full printable page width.
 
void SetStyle (wxPdfListCtrlStyle style)
 Set the table rendering style.
 
wxPdfListCtrlStyle GetStyle () const
 Get the table rendering style.
 
void SetFromRow (int row)
 Set the starting row (1-indexed)
 
int GetFromRow () const
 Get the starting row (1-indexed)
 
void SetFromColumn (int column)
 Set the starting column (1-indexed)
 
int GetFromColumn () const
 Get the starting column (1-indexed)
 
void SetToRow (int row)
 Set the ending row (1-indexed, -1 for all)
 
int GetToRow () const
 Get the ending row (1-indexed, -1 for all)
 
void SetToColumn (int column)
 Set the ending column (1-indexed, -1 for all)
 
int GetToColumn () const
 Get the ending column (1-indexed, -1 for all)
 
void SetIncludeColumnHeaders (bool include)
 Set whether column headers should be exported.
 
bool GetIncludeColumnHeaders () const
 Check whether column headers should be exported.
 
void SetPageBreakHandler (const std::function< void()> &handler)
 Set a function to call instead of wxPdfDocument::AddPage() when the table fills a page.
 
const std::function< void()> & GetPageBreakHandler () const
 Get the function that starts each continuation page of the table.
 

Detailed Description

Options that control how a wxListCtrl is rendered into a PDF document.

Pass an instance to wxPdfDocument::AddList() or wxPdfDC::DrawList() to configure colours, fonts, borders, and layout behaviour.

Example
// Standard grid export
doc.AddPage();
options.SetHeaderBackgroundColour(wxPdfColour(220, 220, 255));
options.SetAlternateRowBackgroundColour(wxPdfColour(245, 245, 245));
doc.AddList(myListCtrl, options);
doc.SaveAsFile("grid.pdf");
// LaTeX booktabs-style export stretched to page width
doc2.AddPage();
simple.SetFitToPage(true);
doc2.AddList(myListCtrl, simple);
doc2.SaveAsFile("simple.pdf");
Class representing wxPdfDocument colours.
Definition: pdfcolour.h:40
Class representing a PDF document.
Definition: pdfdocument.h:176
virtual bool SaveAsFile(const wxString &name=wxEmptyString)
Saves the document to a file on disk.
Definition: pdfdocument.cpp:2233
virtual void AddPage(int orientation=-1, bool useDefaultPageSize=true)
Adds a new page to the document.
Definition: pdfdocument.cpp:686
Options that control how a wxListCtrl is rendered into a PDF document.
Definition: pdflistctrl.h:66
void SetStyle(wxPdfListCtrlStyle style)
Set the table rendering style.
Definition: pdflistctrl.h:226
void SetFitToPage(bool fit)
Set whether to stretch the table to the full printable page width.
Definition: pdflistctrl.h:211
@ wxPDF_LISTCTRL_STYLE_SIMPLE
Horizontal rules only — no vertical lines or cell fills (LaTeX booktabs style)
Definition: pdflistctrl.h:32
See also
wxPdfDocument::AddList(), wxPdfDC::DrawList()

Member Function Documentation

◆ GetAlternateRowBackgroundColour()

wxPdfColour wxPdfListCtrlOptions::GetAlternateRowBackgroundColour ( ) const
inline

Get the background colour for alternate rows.

Returns
The alternate row background colour

◆ GetBodyFont()

wxFont wxPdfListCtrlOptions::GetBodyFont ( ) const
inline

Get the font for the list items.

Returns
The body font

◆ GetBodyPdfFont()

wxPdfFont wxPdfListCtrlOptions::GetBodyPdfFont ( ) const
inline

Get the PDF font for the list items.

Returns
The body PDF font

◆ GetBorderColour()

wxPdfColour wxPdfListCtrlOptions::GetBorderColour ( ) const
inline

Get the colour for borders.

Returns
The border colour

◆ GetDrawColumnBorders()

bool wxPdfListCtrlOptions::GetDrawColumnBorders ( ) const
inline

Check whether to draw vertical borders between columns.

Returns
true if column borders should be drawn

◆ GetDrawRowBorders()

bool wxPdfListCtrlOptions::GetDrawRowBorders ( ) const
inline

Check whether to draw horizontal borders between rows.

Returns
true if row borders should be drawn

◆ GetFitToPage()

bool wxPdfListCtrlOptions::GetFitToPage ( ) const
inline

Check whether the table is stretched to the full printable page width.

Returns
true if full-page-width mode is active

◆ GetFromColumn()

int wxPdfListCtrlOptions::GetFromColumn ( ) const
inline

Get the starting column (1-indexed)

Returns
The starting column

◆ GetFromRow()

int wxPdfListCtrlOptions::GetFromRow ( ) const
inline

Get the starting row (1-indexed)

Returns
The starting row

◆ GetHeaderBackgroundColour()

wxPdfColour wxPdfListCtrlOptions::GetHeaderBackgroundColour ( ) const
inline

Get the background colour for the column headers.

Returns
The header background colour

◆ GetHeaderFont()

wxFont wxPdfListCtrlOptions::GetHeaderFont ( ) const
inline

Get the font for the column headers.

Returns
The header font

◆ GetHeaderPdfFont()

wxPdfFont wxPdfListCtrlOptions::GetHeaderPdfFont ( ) const
inline

Get the PDF font for the column headers.

Returns
The header PDF font

◆ GetHeaderTextColour()

wxPdfColour wxPdfListCtrlOptions::GetHeaderTextColour ( ) const
inline

Get the text colour for the column headers.

Returns
The header text colour

◆ GetIncludeColumnHeaders()

bool wxPdfListCtrlOptions::GetIncludeColumnHeaders ( ) const
inline

Check whether column headers should be exported.

Returns
true if column headers should be included

◆ GetPageBreakHandler()

const std::function< void()> & wxPdfListCtrlOptions::GetPageBreakHandler ( ) const
inline

Get the function that starts each continuation page of the table.

Returns
The page break handler, which is empty if the default is being used

◆ GetShowContinued()

bool wxPdfListCtrlOptions::GetShowContinued ( ) const
inline

Check whether to show "Continued on next page" and "(continued)" labels.

Returns
true if labels should be shown

◆ GetStyle()

wxPdfListCtrlStyle wxPdfListCtrlOptions::GetStyle ( ) const
inline

Get the table rendering style.

Returns
The current rendering style

◆ GetToColumn()

int wxPdfListCtrlOptions::GetToColumn ( ) const
inline

Get the ending column (1-indexed, -1 for all)

Returns
The ending column

◆ GetToRow()

int wxPdfListCtrlOptions::GetToRow ( ) const
inline

Get the ending row (1-indexed, -1 for all)

Returns
The ending row

◆ SetAlternateRowBackgroundColour()

void wxPdfListCtrlOptions::SetAlternateRowBackgroundColour ( const wxPdfColour &  colour)
inline

Set the background colour for alternate rows.

Parameters
colourThe background colour for even rows

◆ SetBodyFont()

void wxPdfListCtrlOptions::SetBodyFont ( const wxFont &  font)
inline

Set the font for the list items.

Parameters
fontThe font to use for items

◆ SetBodyPdfFont()

void wxPdfListCtrlOptions::SetBodyPdfFont ( const wxPdfFont &  font)
inline

Set the PDF font for the list items (takes precedence over SetBodyFont())

Parameters
fontThe wxPdfFont to use for items

◆ SetBorderColour()

void wxPdfListCtrlOptions::SetBorderColour ( const wxPdfColour &  colour)
inline

Set the colour for borders.

Parameters
colourThe border colour

◆ SetDrawColumnBorders()

void wxPdfListCtrlOptions::SetDrawColumnBorders ( bool  draw)
inline

Set whether to draw vertical borders between columns.

Parameters
drawtrue to draw column borders

◆ SetDrawRowBorders()

void wxPdfListCtrlOptions::SetDrawRowBorders ( bool  draw)
inline

Set whether to draw horizontal borders between rows.

Parameters
drawtrue to draw row borders

◆ SetFitToPage()

void wxPdfListCtrlOptions::SetFitToPage ( bool  fit)
inline

Set whether to stretch the table to the full printable page width.

When enabled, all columns are scaled proportionally so that the table fills the available width between the left and right margins, analogous to LaTeX's tabularx or tabular* with \linewidth. Multi-column layout is disabled when this option is active.

Parameters
fittrue to stretch to full page width

◆ SetFromColumn()

void wxPdfListCtrlOptions::SetFromColumn ( int  column)
inline

Set the starting column (1-indexed)

Parameters
columnThe starting column

◆ SetFromRow()

void wxPdfListCtrlOptions::SetFromRow ( int  row)
inline

Set the starting row (1-indexed)

Parameters
rowThe starting row

◆ SetHeaderBackgroundColour()

void wxPdfListCtrlOptions::SetHeaderBackgroundColour ( const wxPdfColour &  colour)
inline

Set the background colour for the column headers.

Parameters
colourThe background colour

◆ SetHeaderFont()

void wxPdfListCtrlOptions::SetHeaderFont ( const wxFont &  font)
inline

Set the font for the column headers.

Parameters
fontThe font to use for headers

◆ SetHeaderPdfFont()

void wxPdfListCtrlOptions::SetHeaderPdfFont ( const wxPdfFont &  font)
inline

Set the PDF font for the column headers (takes precedence over SetHeaderFont())

Parameters
fontThe wxPdfFont to use for headers

◆ SetHeaderTextColour()

void wxPdfListCtrlOptions::SetHeaderTextColour ( const wxPdfColour &  colour)
inline

Set the text colour for the column headers.

Parameters
colourThe text colour

◆ SetIncludeColumnHeaders()

void wxPdfListCtrlOptions::SetIncludeColumnHeaders ( bool  include)
inline

Set whether column headers should be exported.

Parameters
includetrue to include column headers

◆ SetPageBreakHandler()

void wxPdfListCtrlOptions::SetPageBreakHandler ( const std::function< void()> &  handler)
inline

Set a function to call instead of wxPdfDocument::AddPage() when the table fills a page.

The handler must start one new page, and may draw on the old and new pages.

Parameters
handlerThe function to call, or an empty function to use AddPage()

◆ SetShowContinued()

void wxPdfListCtrlOptions::SetShowContinued ( bool  show)
inline

Set whether to show "Continued on next page" and "(continued)" labels.

Parameters
showtrue to show the labels

◆ SetStyle()

void wxPdfListCtrlOptions::SetStyle ( wxPdfListCtrlStyle  style)
inline

Set the table rendering style.

wxPDF_LISTCTRL_STYLE_GRID (default) draws full cell borders and honours fill colours. wxPDF_LISTCTRL_STYLE_SIMPLE renders only a top rule, a rule below the header, and a bottom rule with no vertical lines or cell fills, analogous to the LaTeX booktabs package.

Parameters
styleThe rendering style

◆ SetToColumn()

void wxPdfListCtrlOptions::SetToColumn ( int  column)
inline

Set the ending column (1-indexed, -1 for all)

Parameters
columnThe ending column

◆ SetToRow()

void wxPdfListCtrlOptions::SetToRow ( int  row)
inline

Set the ending row (1-indexed, -1 for all)

Parameters
rowThe ending row

The documentation for this class was generated from the following file: