org.kde.koala
public class KRuler extends QFrame
meters inches ------ <--- end mark --. ------ -- - -- <---little mark--. -- -- - -- --- --- <---medium mark - -- -- -- tiny mark---. - -- ---- -- - ---- <-----big mark -- -- - |>-- <--ruler pointer-. |>--There are tiny marks, little marks, medium marks, and big marks along the ruler. To receive mouse clicks or mouse moves, the class has to be overloaded. For performance reasons, the public methods don't call QWidget.repaint(). (Slots do, see documentation below.) All the changed settings will be painted once after leaving to the main event loop. For performance painting the slot methods should be used, they do a fast QWidget.repaint() call after changing the values. For setting multiple values like minValue(), maxValue(), offset() etc. using the public methods is recommended so the widget will be painted only once when entering the main event loop.
UNKNOWN: A ruler widget.
Field Summary | |
---|---|
static int | Centimetres |
static int | Custom
The types of units used. |
static int | Inch |
static int | Metres |
static int | Millimetres |
static int | Pixel |
Constructor Summary | |
---|---|
protected | KRuler(Class dummy) |
KRuler(QWidget parent, String name)
Constructs a horizontal ruler. | |
KRuler(QWidget parent) | |
KRuler() | |
KRuler(int orient, QWidget parent, String name, int f)
Constructs a ruler with orientation orient.
parent , name and f are passed to QFrame.
| |
KRuler(int orient, QWidget parent, String name) | |
KRuler(int orient, QWidget parent) | |
KRuler(int orient) | |
KRuler(int orient, int widgetWidth, QWidget parent, String name, int f)
Constructs a ruler with orientation orient and initial width widgetWidth.
The width sets the fixed width of the widget. | |
KRuler(int orient, int widgetWidth, QWidget parent, String name) | |
KRuler(int orient, int widgetWidth, QWidget parent) | |
KRuler(int orient, int widgetWidth) |
Method Summary | |
---|---|
int | bigMarkDistance()
Returns the distance between big marks. |
String | className() |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | drawContents(QPainter arg1) |
String | endLabel() |
int | endOffset() |
protected void | finalize() Deletes the wrapped C++ instance |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
int | length() |
boolean | lengthFixed() |
int | littleMarkDistance()
Returns the distance between little marks. |
int | maxValue()
Returns the maximal value of the ruler pointer. |
int | mediumMarkDistance() |
QMetaObject | metaObject() |
int | minValue()
Returns the minimal value of the ruler pointer. |
int | offset()
Returns the current ruler offset. |
double | pixelPerMark()
Returns the number of pixels between two base marks. |
void | setBigMarkDistance(int arg1)
Sets distance between big marks.
|
void | setEndLabel(String arg1)
Sets the label this is drawn at the beginning of the visible part
of the ruler to label |
void | setLength(int arg1)
Sets the length of the ruler, i.e. the difference between
the begin mark and the end mark of the ruler.
|
void | setLengthFixed(boolean fix)
Locks the length of the ruler, i.e. the difference between
the two end marks doesn't change when the widget is resized. |
void | setLittleMarkDistance(int arg1)
Sets the distance between little marks.
|
void | setMaxValue(int arg1)
Sets the maximum value of the ruler pointer (default is 100).
|
void | setMediumMarkDistance(int arg1)
Sets the distance between medium marks.
|
void | setMinValue(int arg1)
Sets the minimal value of the ruler pointer (default is 0).
|
void | setOffset(int offset)
Sets the ruler slide offset.
|
void | setPixelPerMark(double rate)
Sets the number of pixels between two base marks.
|
void | setRange(int min, int max)
Sets minimum and maximum values of the ruler pointer.
|
void | setRulerMetricStyle(int arg1)
Sets up the necessary tasks for the provided styles.
|
void | setShowBigMarks(boolean arg1)
Shows/hides big marks. |
void | setShowEndLabel(boolean arg1)
Show/hide number values of the end marks.
|
void | setShowEndMarks(boolean arg1)
Shows/hides end marks. |
void | setShowLittleMarks(boolean arg1)
Shows/hides little marks. |
void | setShowMediumMarks(boolean arg1)
Shows/hides medium marks. |
void | setShowPointer(boolean arg1)
Shows/hides the pointer. |
void | setShowTinyMarks(boolean arg1)
Shows/hides tiny marks. |
void | setTinyMarkDistance(int arg1)
Sets the distance between tiny marks.
|
void | setValue(int arg1)
Sets the value of the ruler pointer.
|
boolean | showBigMarks() |
boolean | showEndLabel() |
boolean | showEndMarks() |
boolean | showLittleMarks() |
boolean | showMediumMarks() |
boolean | showPointer() |
boolean | showTinyMarks() |
void | slideDown(int count)
Sets the number of pixels by which the ruler may slide down or right.
|
void | slideDown() |
void | slideUp(int count)
Sets the number of pixels by which the ruler may slide up or left.
|
void | slideUp() |
void | slotEndOffset(int arg1) |
void | slotNewOffset(int arg1)
Sets the ruler marks to a new position.
|
void | slotNewValue(int arg1)
Sets the pointer to a new position.
|
int | tinyMarkDistance()
Returns the distance between tiny marks. |
int | value() |
UNKNOWN: The types of units used.
UNKNOWN: Constructs a horizontal ruler.
orient.
parent
, name
and f
are passed to QFrame.
The default look is a raised widget
but may be changed with the inherited QFrame methods.Parameters: orient Orientation of the ruler. parent Will be handed over to QFrame. name Will be handed over to QFrame. f Will be handed over to QFrame.
UNKNOWN: Constructs a ruler with orientation orient.
orient
and initial width widgetWidth.
The width sets the fixed width of the widget. This is useful if you
want to draw the ruler bigger or smaller than the default size.
Note: The size of the marks doesn't change.
parent
, name
and f
are passed to QFrame.Parameters: orient Orientation of the ruler. widgetWidth Fixed width of the widget. parent Will be handed over to QFrame. name Will be handed over to QFrame. f Will be handed over to QFrame.
UNKNOWN: Constructs a ruler with orientation orient
and initial width widgetWidth.
UNKNOWN: Returns the distance between big marks.
UNKNOWN: Returns the distance between little marks.
UNKNOWN: Returns the maximal value of the ruler pointer.
UNKNOWN: Returns the minimal value of the ruler pointer.
UNKNOWN: Returns the current ruler offset.
UNKNOWN: Returns the number of pixels between two base marks.
UNKNOWN: Sets distance between big marks.
label
UNKNOWN: Sets the label this is drawn at the beginning of the visible part of the ruler to label
UNKNOWN: Sets the length of the ruler, i.
Parameters: fix fixes the length, if true
UNKNOWN: Locks the length of the ruler, i.
UNKNOWN: Sets the distance between little marks.
UNKNOWN: Sets the maximum value of the ruler pointer (default is 100).
UNKNOWN: Sets the distance between medium marks.
UNKNOWN: Sets the minimal value of the ruler pointer (default is 0).
Parameters: offset Number of pixel to move the ruler up or left from the beginning
UNKNOWN: Sets the ruler slide offset.
here.
Notice: The double type is only supported to give the possibility
of having some double values.
It should be used with care. Using values below 10.0
shows visible jumps of markpositions (e.g. 2.345).
Using whole numbers is highly recommended.
To use int
values use setPixelPerMark((int)your_int_value);
default: 1 mark per 10 pixelsUNKNOWN: Sets the number of pixels between two base marks.
UNKNOWN: Sets minimum and maximum values of the ruler pointer.
UNKNOWN: Sets up the necessary tasks for the provided styles.
UNKNOWN: Shows/hides big marks.
false.
UNKNOWN: Show/hide number values of the end marks.
UNKNOWN: Shows/hides end marks.
UNKNOWN: Shows/hides little marks.
UNKNOWN: Shows/hides medium marks.
UNKNOWN: Shows/hides the pointer.
UNKNOWN: Shows/hides tiny marks.
UNKNOWN: Sets the distance between tiny marks.
UNKNOWN: Sets the value of the ruler pointer.
Parameters: count Number of pixel moving up or left relative to the previous position
UNKNOWN: Sets the number of pixels by which the ruler may slide down or right.
Parameters: count Number of pixel moving up or left relative to the previous position
UNKNOWN: Sets the number of pixels by which the ruler may slide up or left.
UNKNOWN: Sets the ruler marks to a new position.
UNKNOWN: Sets the pointer to a new position.
UNKNOWN: Returns the distance between tiny marks.