Page Class Reference

[libkorigin Index] [libkorigin Heirarchy]


A Page for plots and other objects More...

#include </home/mh/korigin/korigin/doc/tmp/page.h>

Inherits: KDNDWidget

Public Members

Public Slots

Signals


Detailed Description

A Page for plots and other objects.

The Page class represents a page as it would be printed. It has some properties such as a size (in cm) and a color. From the size in cm and the widget size in pixels, one can calculate the pageīs scaling factors. A page can be printed on a printer or on the pageīs widget (future extension: on a pixmap). On a page, there are zero or more objects, so-called PageObjects. A page can store and restore the objects on it.

The objects on a page are PageObjectīs. The most common example for a PageObject is a Plot. (Also the first one implemented.) Other PageObjects (will) include Text, Images, and Arrows. The abstract base class, PageObject, defines the interface all objects on a page must conform. Note that plots are handled specially since they have a slot, plotSelectedColumns(), to plot data from the worksheet. Other PageObjects such as Text do not have this slot.

Since plots and other objects can be dragged around on a page, a Page isa KDNDWidget. It also has a KDNDDropZone (the whole page, that is) where plots can be dropped. Maybe once in a time users can even drop text and images on a page. See @ref PageObject for what can be on a page.


Page(double width, double height, QWidget* parent = 0, const char* name = 0)

Build an empty page, of size x times y cm. This is a scientific application, therefore we use cm. Some might call that SI units. (Well, almost. Meters would be SI units.) Others might call it continental European arrogance. Donīt hold back. You have ignored our Umlaute long enough to take some revenge.

Parameters:
width width of the page in cm (0 for default from config.)
height height of the page in cm (0 for default from config.)

~Page()

Destroy the page, and all plots on it. Note that it is up to the page to delete the plots on it; this is *not* task of the main tree view, since it was the page who created them.

"Der Herr hatīs gegeben, der Herr hatīs genommen, der Name des Herrn sei gelobt."

void storeOptions(KConfig*)

Store overall options for the page. Actually calls storeDefaults().

See Also:
Page::storeDefaultsrestoreOptionsoptionsDialog

void restoreOptions(KConfig*)

Restore overall options for the plot. Actually calls loadDefaults().

See Also:
storeOptionsoptionsDialog

bool store(QFile&, bool with_obj)

Store a page to a QFile. This function writes a page and, if with_obj==true, all its objects (plots, text) to the given QFile. Please note that QFile is already opened and positioned when passed to store(). Also note that QFile may already contain other plots and/or worksheets.

See Also:
Page::restore

static Page* restore_page(QFile&)

Restore a page from a QFile. This function reads a page from the given QFile. Please note that QFile is already opened and positioned when passed to restore(). Also note that QFile may already contain other plots and/or worksheets.

See Also:
store

QPixmap* icon()

Return the pixmap for the tree view. This varies if the page is the active page or not.

Returns:
pixmap for the page.

QPopupMenu* menu(QPopupMenu* predefined = 0)

Return appropriate "Page" submenu. This menu contains the entries "New plot", "Layout", and more.

Returns:
the main menu entry for the page.

TreeItem* treeitem()

Return pointer to the tree item of the page. The item is inserted into the main tree view. Note that the item may change; the pointer, however, remains the same until the page is deleted.

Oh, and BTW do *not* try to delete the treeitem! Deleting the tree item causes a segfault when you delete the page later.

virtual void activate()

Set active page and icon. This changes the pageīs icon to active.

virtual void deactivate()

Set inactive page icon. This changes the pageīs icon to inactive.

void getScaleFactors(double& xf, double& yf)

Get the scaling factors of the page. The scaling factors are needed for identifying plots under mouse events, and for painting the page.

void make_plot(Plot* prototype, bool fill=false)

Create a plot by colning the prototype, and let theplot fill itself.

This function is called by the centre, when the user wants to create a plot without creating an empty page first.

Parameters:
prototype The plotīs prototype. (Which will be cloned!)

void remove_object(PageObject* obj)

Remove and delete an object from the page. The object, a plot or some other PageObject, is removed from the page and deleted. If the object is not found on the page, nothing happens. (Only a message box pops up.)

Parameters:
obj the deliquent.

enum MouseModes ( MoveMode, TextMode, PlotMode )

Mouse modes. MoveMode drags plots around/resizes them. TextMode will (later) manipulate text objects. PlotMode passes mouse clicks on to the plot.

See Also:
mouseModesetMouseMode

static int mouseMode()

Query mouse mode. Returns MoveMode or TextMode.

See Also:
MouseModessetMouseMode

static void setMouseMode(int)

Set the mouse mode to MoveMode or TextMode.

See Also:
MouseModesmouseMode

static const char* start_mark()

Beginning-of-page mark in files.

static const char* end_mark()

End-of-page mark in files.

void printPage()

Print a page on the QPrinter. This function opens the QPrinter::setup() dialog, and if the user selects OK, prints the page and all its plots to the printer (or selected output file).

void optionsDialog()

Display the pageīs options dialog. That is, the default values for colors, size and the lot.

See Also:
storeOptionsrestoreOptions

void pageObjectChanged()

Actiavted when an object on the page changed itstree entry. For example, when a plot is actiavted and therefore changed its icon.

void activePageChanged(Page* p)

This signal is emitted when the active page has changed.(By clicking in an inactive page, which is activated this way.)

Parameters:
p the page to be made active

void activePlotChanged(Plot* p)

This signal is emitted when the active plot has changed.(By clicking in an inactive plot, which is activated this way.)

Parameters:
p the plot to be made active

void treeItemChanged()

This signal is emitted when the tree item of the page has changed.(By editing the caption, (de)activating the page, resizing, deleteing/inserting plots on the page.)

void addTreeChild(TreeItem.html">TreeItem* parent, TreeItem.html">TreeItem* child)

Emitted to request insertion of a tree item to the tree. This is the case whenever a new plot is created. The first TreeItem is the (already existing) parent, the second is the (to insert) child.

Parameters:
parent the parent TreeItem, i.e. the pageīs.
child the child TreeItem, to be inserted under parent.

  • Author: Patrick Schemitz
  • Documentation generated by mh@jeff_clever on Thu Feb 5 14:15:25 MET 1998
Kdoc