![]() |
![]() |
You can get one of these from the page setup dialog and then pass it to the PrintOperation when printing. The benefit of splitting this out of the PrintSettings is that these affect the actual layout of the page, and thus need to be set long before the user prints.
The margins specified in this object are the "print margins", i.e. the parts of the page that the printer cannot print on. These are different from the layout margins that a word processor uses; they are typically used to determine the minimal size for the layout margins.
To obtain a PageSetup use PageSetup::create() to get the defaults, or use run_page_setup_dialog() to show the page setup dialog and receive the resulting page setup.
Public Member Functions | |
double | get_bottom_margin (Unit unit) const |
Gets the bottom margin in units of unit . | |
double | get_left_margin (Unit unit) const |
Gets the left margin in units of unit . | |
PageOrientation | get_orientation () const |
Gets the page orientation of the Gtk::PageSetup. | |
double | get_page_height (Unit unit) const |
Return value: the page height. | |
double | get_page_width (Unit unit) const |
Return value: the page width. | |
double | get_paper_height (Unit unit) const |
Return value: the paper height. | |
const PaperSize | get_paper_size () const |
Gets the paper size of the Gtk::PageSetup. | |
PaperSize | get_paper_size () |
Gets the paper size of the Gtk::PageSetup. | |
double | get_paper_width (Unit unit) const |
Return value: the paper width. | |
double | get_right_margin (Unit unit) const |
Gets the right margin in units of unit . | |
double | get_top_margin (Unit unit) const |
Gets the top margin in units of unit . | |
const GtkPageSetup* | gobj () const |
Provides access to the underlying C GObject. | |
GtkPageSetup* | gobj () |
Provides access to the underlying C GObject. | |
GtkPageSetup* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
bool | save_to_file (const std::string& file_name) const |
This function saves the information from setup to file_name . | |
void | save_to_key_file (Glib::KeyFile& key_file) |
This function adds the page setup from setup to key_file, in the group "Page Setup". | |
void | save_to_key_file (Glib::KeyFile& key_file, const Glib::ustring& group_name) |
This function adds the page setup from setup to key_file . | |
void | set_bottom_margin (double margin, Unit unit) |
Sets the bottom margin of the Gtk::PageSetup. | |
void | set_left_margin (double margin, Unit unit) |
Sets the left margin of the Gtk::PageSetup. | |
void | set_orientation (PageOrientation orientation) |
Sets the page orientation of the Gtk::PageSetup. | |
void | set_paper_size (const PaperSize& paper_size) |
Sets the paper size of the Gtk::PageSetup without changing the margins. | |
void | set_paper_size_and_default_margins (const PaperSize& paper_size) |
Sets the paper size of the Gtk::PageSetup and modifies the margins according to the new paper size. | |
void | set_right_margin (double margin, Unit unit) |
Sets the right margin of the Gtk::PageSetup. | |
void | set_top_margin (double margin, Unit unit) |
Sets the top margin of the Gtk::PageSetup. | |
virtual | ~PageSetup () |
Static Public Member Functions | |
static Glib::RefPtr<PageSetup> | create () |
Protected Member Functions | |
PageSetup () | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gtk::PageSetup> | wrap (GtkPageSetup* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
virtual Gtk::PageSetup::~PageSetup | ( | ) | [virtual] |
Gtk::PageSetup::PageSetup | ( | ) | [protected] |
static Glib::RefPtr<PageSetup> Gtk::PageSetup::create | ( | ) | [static] |
double Gtk::PageSetup::get_bottom_margin | ( | Unit | unit | ) | const |
Gets the bottom margin in units of unit .
unit | The unit for the return value. |
double Gtk::PageSetup::get_left_margin | ( | Unit | unit | ) | const |
Gets the left margin in units of unit .
unit | The unit for the return value. |
PageOrientation Gtk::PageSetup::get_orientation | ( | ) | const |
double Gtk::PageSetup::get_page_height | ( | Unit | unit | ) | const |
Return value: the page height.
unit | The unit for the return value. |
double Gtk::PageSetup::get_page_width | ( | Unit | unit | ) | const |
Return value: the page width.
unit | The unit for the return value. |
double Gtk::PageSetup::get_paper_height | ( | Unit | unit | ) | const |
Return value: the paper height.
unit | The unit for the return value. |
const PaperSize Gtk::PageSetup::get_paper_size | ( | ) | const |
PaperSize Gtk::PageSetup::get_paper_size | ( | ) |
double Gtk::PageSetup::get_paper_width | ( | Unit | unit | ) | const |
Return value: the paper width.
unit | The unit for the return value. |
double Gtk::PageSetup::get_right_margin | ( | Unit | unit | ) | const |
Gets the right margin in units of unit .
unit | The unit for the return value. |
double Gtk::PageSetup::get_top_margin | ( | Unit | unit | ) | const |
Gets the top margin in units of unit .
unit | The unit for the return value. |
const GtkPageSetup* Gtk::PageSetup::gobj | ( | ) | const [inline] |
GtkPageSetup* Gtk::PageSetup::gobj | ( | ) | [inline] |
GtkPageSetup* Gtk::PageSetup::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gtk::PageSetup::save_to_file | ( | const std::string & | file_name | ) | const |
This function saves the information from setup to file_name .
throws Glib::FileError
file_name | The file to save to. |
true
on successvoid Gtk::PageSetup::save_to_key_file | ( | Glib::KeyFile & | key_file | ) |
This function adds the page setup from setup to key_file, in the group "Page Setup".
key_file | The G::KeyFile to save the page setup to. |
void Gtk::PageSetup::save_to_key_file | ( | Glib::KeyFile & | key_file, | |
const Glib::ustring & | group_name | |||
) |
This function adds the page setup from setup to key_file .
key_file | The Glib::KeyFile to save the page setup to. | |
group_name | The group to add the settings to in key_file . |
void Gtk::PageSetup::set_bottom_margin | ( | double | margin, | |
Unit | unit | |||
) |
Sets the bottom margin of the Gtk::PageSetup.
margin | The new bottom margin in units of unit . | |
unit | The units for margin . |
void Gtk::PageSetup::set_left_margin | ( | double | margin, | |
Unit | unit | |||
) |
Sets the left margin of the Gtk::PageSetup.
margin | The new left margin in units of unit . | |
unit | The units for margin . |
void Gtk::PageSetup::set_orientation | ( | PageOrientation | orientation | ) |
Sets the page orientation of the Gtk::PageSetup.
orientation | A Gtk::PageOrientation value. |
void Gtk::PageSetup::set_paper_size | ( | const PaperSize& | paper_size | ) |
Sets the paper size of the Gtk::PageSetup without changing the margins.
See gtk_page_setup_set_paper_size_and_default_margins().
size | A Gtk::PaperSize. |
void Gtk::PageSetup::set_paper_size_and_default_margins | ( | const PaperSize& | paper_size | ) |
Sets the paper size of the Gtk::PageSetup and modifies the margins according to the new paper size.
size | A Gtk::PaperSize. |
void Gtk::PageSetup::set_right_margin | ( | double | margin, | |
Unit | unit | |||
) |
Sets the right margin of the Gtk::PageSetup.
margin | The new right margin in units of unit . | |
unit | The units for margin . |
void Gtk::PageSetup::set_top_margin | ( | double | margin, | |
Unit | unit | |||
) |
Sets the top margin of the Gtk::PageSetup.
margin | The new top margin in units of unit . | |
unit | The units for margin . |
Glib::RefPtr<Gtk::PageSetup> wrap | ( | GtkPageSetup * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |