class KPanner

Kpanner is a simple widget, very similar to Motifs XmPanedWindow. More...

Definition#include <kpanner.h>
InheritsQWidget (qt)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Signals


Detailed Description

Kpanner is a simple widget, very similar to Motifs XmPanedWindow. Basically, KPanner creates two child widgets, separated by a dragable bar. The user can now resize the window areas by repositioning this bar.

How to use: -----------

The class name is KPanner.

KPanner *p = new KPanner(parent, name, flags, i_size);

flags can be a combination of the following (or zero):

KPanner::O_VERTICAL (default) KPanner::O_HORIZONTAL KPanner::U_PERCENT (default) KPanner::U_ABSOLUTE

i_size is the location of the separator.

The flag O_VERTICAL specifies that the separator is vertical and you therefore have a left and right pane. The O_HORIZONTAL flag means that you have an upper and a lower pane.

U_ABSOLUTE specifies that the location is in pixels and U_PERCENT means the location is measured in percent of full widget size, e.g. if you specify a value of 50, the client widgets will have exactly the same size.

To obtain the panners child widgets (which is necessary, because they will act as parents for the widgets to manage), KPanner provides two class methods:

QWidget *child0() returns the leftmost (or topmost for horizontal panners) child.

QWidget *child1() returns the rightmost (or bottom for horizontal panners) child

enum {O_VERTICAL = 0, O_HORIZONTAL = 1, U_PERCENT = 0, U_ABSOLUTE = 2}

some flags

void setSeparator (int)

(0 <= int <= 100)

set the separator, so that it will divide the clients at i_size percent of full widget size. For vertical panners, this is measured from the left edge, and for horizontal panners it is measured from the top edge.

If the value for i_size is invalid (less than 0 or greater than 100), it will be set to 50.

This also applies to the value of i_size used with the constructor.

void setAbsSeparator (int)

Same as setSeparator(), but i_size is interpreted as an absolute (pixel) value. The i_size parameter must be greater than current l_limit and less than current u_limit.

void setLimits (int, int)

Set lower and upper limits as a range for the divider widget. The divider cannot be moved outside of these limits. The values are pixel values. The lower limit (l_limit) must be a positive integer between 0 and the maximum width (height) of the panner. The upper limit (u_limit) may be either positive (if you want to measure it from the left (upper) edge), or negative (if you want to measure it from the right (lower) edge). If the panner was created in U_PERCENT mode, use values 0 to 100 also negatives for u_limit from right edge. To clear the limits, set both l_limit and u_limit to zero.

int getMaxValue ()

Get the maximum pixel value that the separator bar can be moved to.

int getSeparator ()

Get the current position of the separator bar as a percentage. This can be used to save the position to the config file so the panner can be reset back to a save state. Or if the panner is turned off & on again, the previous setting can be restored.

int getAbsSeparator ()

Get the current pixel position of the separator bar. This can be used to save the position to the config file so the panner can be reset back to a save state. Or if the panner is turned off & on again, the previous setting can be restored.


Generated by: root@jedi.mandrakesoft.com on Sat Dec 25 21:35:43 199.