#include <KDGanttMinimizeSplitter.h>
Public Types | |
enum | ResizeMode { Stretch , KeepSize , FollowSizeHint } |
enum | Direction { Left , Right , Up , Down } |
Public Member Functions | |
KDGanttMinimizeSplitter (TQWidget *parent=0, const char *name=0) | |
KDGanttMinimizeSplitter (TQt::Orientation, TQWidget *parent=0, const char *name=0) | |
~KDGanttMinimizeSplitter () | |
virtual void | setOrientation (TQt::Orientation) |
TQt::Orientation | orientation () const |
void | setMinimizeDirection (Direction) |
Direction | minimizeDirection () const |
virtual void | setResizeMode (TQWidget *w, ResizeMode) |
virtual void | setOpaqueResize (bool=TRUE) |
bool | opaqueResize () const |
void | moveToFirst (TQWidget *) |
void | moveToLast (TQWidget *) |
void | refresh () |
virtual TQSize | sizeHint () const |
virtual TQSize | minimumSizeHint () const |
TQValueList< int > | sizes () const |
void | setSizes (TQValueList< int >) |
void | expandPos (int id, int *min, int *max) |
Protected Member Functions | |
void | childEvent (TQChildEvent *) |
bool | event (TQEvent *) |
void | resizeEvent (TQResizeEvent *) |
int | idAfter (TQWidget *) const |
void | moveSplitter (TQCOORD pos, int id) |
virtual void | drawSplitter (TQPainter *, TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h) |
void | styleChange (TQStyle &) |
int | adjustPos (int, int) |
virtual void | setRubberband (int) |
void | getRange (int id, int *, int *) |
Friends | |
class | KDGanttSplitterHandle |
Detailed Description
The KDGanttMinimizeSplitter class implements a splitter widget with minimize buttons.
This class (and its documentation) is largely a copy of TQt's TQSplitter; the copying was necessary because TQSplitter is not extensible at all. TQSplitter and its documentation are licensed according to the GPL and the TQt Professional License (if you hold such a license) and are (C) Trolltech AS.
A splitter lets the user control the size of child widgets by dragging the boundary between the children. Any number of widgets may be controlled.
To show a TQListBox, a TQListView and a TQTextEdit side by side:
In KDGanttMinimizeSplitter, the boundary can be either horizontal or vertical. The default is horizontal (the children are side by side) but you can use setOrientation( TQSplitter::Vertical ) to set it to vertical.
Use setResizeMode() to specify that a widget should keep its size when the splitter is resized.
Although KDGanttMinimizeSplitter normally resizes the children only at the end of a resize operation, if you call setOpaqueResize( TRUE ) the widgets are resized as often as possible.
The initial distribution of size between the widgets is determined by the initial size of each widget. You can also use setSizes() to set the sizes of all the widgets. The function sizes() returns the sizes set by the user.
If you hide() a child, its space will be distributed among the other children. It will be reinstated when you show() it again. It is also possible to reorder the widgets within the splitter using moveToFirst() and moveToLast().
Definition at line 43 of file KDGanttMinimizeSplitter.h.
Member Enumeration Documentation
◆ Direction
The values of this enumeration describe into which direction the splitter will collapse its child widgets. By extension, it also specifies the orientation of the splitter; collapsing to the left or to the right results in a horizontal splitter, collapsing to the top or bottom in a vertical splitter.
Definition at line 53 of file KDGanttMinimizeSplitter.h.
◆ ResizeMode
This enum type describes how KDGanttMinimizeSplitter will resize each of its child widgets. The currently defined values are:
Stretch: the widget will be resized when the splitter itself is resized.
KeepSize: KDGanttMinimizeSplitter will try to keep this widget's size unchanged.
FollowSizeHint: KDGanttMinimizeSplitter will resize the widget when the widget's size hint changes.
Definition at line 52 of file KDGanttMinimizeSplitter.h.
Constructor & Destructor Documentation
◆ KDGanttMinimizeSplitter() [1/2]
KDGanttMinimizeSplitter::KDGanttMinimizeSplitter | ( | TQWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Constructs a horizontal splitter with the parent and name arguments being passed on to the TQFrame constructor.
Definition at line 384 of file KDGanttMinimizeSplitter.cpp.
◆ KDGanttMinimizeSplitter() [2/2]
KDGanttMinimizeSplitter::KDGanttMinimizeSplitter | ( | TQt::Orientation | o, |
TQWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructs a splitter with orientation o with the parent and name arguments being passed on to the TQFrame constructor.
Definition at line 395 of file KDGanttMinimizeSplitter.cpp.
◆ ~KDGanttMinimizeSplitter()
KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter | ( | ) |
Destroys the splitter and any children.
Definition at line 405 of file KDGanttMinimizeSplitter.cpp.
Member Function Documentation
◆ adjustPos()
|
protected |
Returns the closest legal position to p of the splitter with id id.
- See also
- idAfter()
Definition at line 860 of file KDGanttMinimizeSplitter.cpp.
◆ childEvent()
|
protected |
Tells the splitter that a child widget has been inserted or removed. The event is passed in c.
Definition at line 509 of file KDGanttMinimizeSplitter.cpp.
◆ drawSplitter()
|
protectedvirtual |
Draws the splitter handle in the rectangle described by x, y, w, h using painter p.
- See also
- TQStyle::drawPrimitive()
Definition at line 601 of file KDGanttMinimizeSplitter.cpp.
◆ event()
|
protected |
Reimplemented from superclass.
Definition at line 583 of file KDGanttMinimizeSplitter.cpp.
◆ getRange()
|
protected |
Returns the valid range of the splitter with id id in *min and *max.
- See also
- idAfter()
Definition at line 804 of file KDGanttMinimizeSplitter.cpp.
◆ idAfter()
|
protected |
Returns the id of the splitter to the right of or below the widget w, or 0 if there is no such splitter (i.e. it is either not in this KDGanttMinimizeSplitter or it is at the end).
Definition at line 615 of file KDGanttMinimizeSplitter.cpp.
◆ minimizeDirection()
KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection | ( | ) | const |
Returns the direction of the minimize buttons.
Definition at line 1338 of file KDGanttMinimizeSplitter.cpp.
◆ minimumSizeHint()
|
virtual |
- Reimplemented from superclass.
Definition at line 1138 of file KDGanttMinimizeSplitter.cpp.
◆ moveSplitter()
|
protected |
Moves the left/top edge of the splitter handle with id id as close as possible to position p, which is the distance from the left (or top) edge of the widget.
For Arabic and Hebrew the layout is reversed, and using this function to set the position of the splitter might lead to unexpected results, since in Arabic and Hebrew the position of splitter one is to the left of the position of splitter zero.
- See also
- idAfter()
Definition at line 642 of file KDGanttMinimizeSplitter.cpp.
◆ moveToFirst()
void KDGanttMinimizeSplitter::moveToFirst | ( | TQWidget * | w | ) |
Moves widget w to the leftmost/top position.
Definition at line 1041 of file KDGanttMinimizeSplitter.cpp.
◆ moveToLast()
void KDGanttMinimizeSplitter::moveToLast | ( | TQWidget * | w | ) |
Moves widget w to the rightmost/bottom position.
Definition at line 1070 of file KDGanttMinimizeSplitter.cpp.
◆ opaqueResize()
bool KDGanttMinimizeSplitter::opaqueResize | ( | ) | const |
Returns TRUE if opaque resize is on; otherwise returns FALSE.
- See also
- setOpaqueResize()
Definition at line 1017 of file KDGanttMinimizeSplitter.cpp.
◆ orientation()
|
inline |
Returns the orientation of the splitter.
Definition at line 60 of file KDGanttMinimizeSplitter.h.
◆ resizeEvent()
|
protected |
Reimplemented from superclass.
Definition at line 453 of file KDGanttMinimizeSplitter.cpp.
◆ setMinimizeDirection()
void KDGanttMinimizeSplitter::setMinimizeDirection | ( | Direction | direction | ) |
Specifies the direction of the minimize buttons. If the orientation of the splitter is horizontal then with KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used, otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down should be used.
Definition at line 1330 of file KDGanttMinimizeSplitter.cpp.
◆ setOpaqueResize()
|
virtual |
If on is TRUE then opaque resizing is turned on; otherwise opaque resizing is turned off. Opaque resizing is initially turned off.
- See also
- opaqueResize()
Definition at line 1031 of file KDGanttMinimizeSplitter.cpp.
◆ setOrientation()
|
virtual |
the orientation of the splitter
By default the orientation is horizontal (the widgets are side by side). The possible orientations are TQt:Vertical and TQt::Horizontal (the default).
Definition at line 429 of file KDGanttMinimizeSplitter.cpp.
◆ setResizeMode()
|
virtual |
Sets resize mode of w to mode.
- See also
- ResizeMode
Definition at line 995 of file KDGanttMinimizeSplitter.cpp.
◆ setRubberband()
|
protectedvirtual |
Shows a rubber band at position p. If p is negative, the rubber band is removed.
Definition at line 556 of file KDGanttMinimizeSplitter.cpp.
◆ setSizes()
void KDGanttMinimizeSplitter::setSizes | ( | TQValueList< int > | list | ) |
Sets the size parameters to the values given in list. If the splitter is horizontal, the values set the sizes from left to right. If it is vertical, the sizes are applied from top to bottom. Extra values in list are ignored.
If list contains too few values, the result is undefined but the program will still be well-behaved.
- See also
- sizes()
Definition at line 1279 of file KDGanttMinimizeSplitter.cpp.
◆ sizeHint()
|
virtual |
Reimplemented from superclass.
Reimplemented in KDGanttView.
Definition at line 1108 of file KDGanttMinimizeSplitter.cpp.
◆ sizes()
TQValueList< int > KDGanttMinimizeSplitter::sizes | ( | ) | const |
Returns a list of the size parameters of all the widgets in this splitter.
Giving the values to another splitter's setSizes() function will produce a splitter with the same layout as this one.
Note that if you want to iterate over the list, you should iterate over a copy, e.g.
- See also
- setSizes()
Definition at line 1248 of file KDGanttMinimizeSplitter.cpp.
◆ styleChange()
|
protected |
Reimplemented from superclass.
Definition at line 1310 of file KDGanttMinimizeSplitter.cpp.
The documentation for this class was generated from the following files: