\section{KRuler Class Reference}
\label{classKRuler}\index{KRuler@{KRuler}}
A ruler widget. A ruler widget.  


{\tt \#include $<$kruler.h$>$}

Inheritance diagram for KRuler:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=44pt]{classKRuler__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KRuler:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=129pt]{classKRuler__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Metric\-Style} \{ \par
{\bf Custom} = 0, 
{\bf Pixel}, 
{\bf Inch}, 
{\bf Millimetres}, 
\par
{\bf Centimetres}, 
{\bf Metres}
 \}
\end{CompactItemize}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-New\-Value} (int)
\item 
void {\bf slot\-New\-Offset} (int)
\item 
void {\bf slot\-End\-Offset} (int)\label{classKRuler_i2}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRuler} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KRuler} (Orientation orient, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0, WFlags f=0)
\item 
{\bf KRuler} (Orientation orient, int widget\-Width, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0, WFlags f=0)
\item 
{\bf $\sim$KRuler} ()
\item 
void {\bf set\-Min\-Value} (int)
\item 
int {\bf min\-Value} () const 
\item 
void {\bf set\-Max\-Value} (int)
\item 
int {\bf max\-Value} () const 
\item 
void {\bf set\-Range} (int min, int max)
\item 
void {\bf set\-Value} (int)
\item 
int {\bf value} () const \label{classKRuler_a10}

\item 
void {\bf set\-Tiny\-Mark\-Distance} (int)
\item 
int {\bf tiny\-Mark\-Distance} () const 
\item 
void {\bf set\-Little\-Mark\-Distance} (int)
\item 
int {\bf little\-Mark\-Distance} () const 
\item 
void {\bf set\-Medium\-Mark\-Distance} (int)
\item 
int {\bf medium\-Mark\-Distance} () const \label{classKRuler_a16}

\item 
void {\bf set\-Big\-Mark\-Distance} (int)
\item 
int {\bf big\-Mark\-Distance} () const 
\item 
void {\bf set\-Show\-Tiny\-Marks} (bool)
\item 
bool {\bf show\-Tiny\-Marks} () const \label{classKRuler_a20}

\item 
void {\bf set\-Show\-Little\-Marks} (bool)
\item 
bool {\bf show\-Little\-Marks} () const \label{classKRuler_a22}

\item 
void {\bf set\-Show\-Medium\-Marks} (bool)
\item 
bool {\bf show\-Medium\-Marks} () const \label{classKRuler_a24}

\item 
void {\bf set\-Show\-Big\-Marks} (bool)
\item 
bool {\bf show\-Big\-Marks} () const \label{classKRuler_a26}

\item 
void {\bf set\-Show\-End\-Marks} (bool)
\item 
bool {\bf show\-End\-Marks} () const \label{classKRuler_a28}

\item 
void {\bf set\-Show\-Pointer} (bool)
\item 
bool {\bf show\-Pointer} () const \label{classKRuler_a30}

\item 
void {\bf set\-Value\-Per\-Little\-Mark} (int) KDE\_\-DEPRECATED
\item 
void {\bf set\-Value\-Per\-Medium\-Mark} (int) KDE\_\-DEPRECATED
\item 
void {\bf set\-Value\-Per\-Big\-Mark} (int) KDE\_\-DEPRECATED
\item 
void {\bf set\-Show\-End\-Label} (bool)
\item 
bool {\bf show\-End\-Label} () const \label{classKRuler_a35}

\item 
void {\bf set\-End\-Label} (const {\bf QString} \&)
\item 
{\bf QString} {\bf end\-Label} () const \label{classKRuler_a37}

\item 
void {\bf set\-Ruler\-Metric\-Style} ({\bf KRuler::Metric\-Style})
\item 
void {\bf set\-Pixel\-Per\-Mark} (double rate)
\item 
double {\bf pixel\-Per\-Mark} () const 
\item 
void {\bf set\-Length} (int)
\item 
int {\bf length} () const \label{classKRuler_a42}

\item 
void {\bf set\-Length\-Fixed} (bool fix)
\item 
bool {\bf length\-Fixed} () const \label{classKRuler_a44}

\item 
void {\bf slide\-Up} (int count=1)
\item 
void {\bf slide\-Down} (int count=1)
\item 
void {\bf set\-Offset} (int offset)
\item 
int {\bf offset} () const 
\item 
int {\bf end\-Offset} () const \label{classKRuler_a49}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf draw\-Contents} ({\bf QPainter} $\ast$)\label{classKRuler_b0}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKRuler_b1}

\end{CompactItemize}
\subsection*{Properties}
\begin{CompactItemize}
\item 
int {\bf min\-Value}\label{classKRuler_00}

\item 
int {\bf max\-Value}\label{classKRuler_01}

\item 
int {\bf value}\label{classKRuler_02}

\item 
bool {\bf show\-Tiny\-Marks}\label{classKRuler_03}

\item 
bool {\bf show\-Little\-Marks}\label{classKRuler_04}

\item 
bool {\bf show\-Medium\-Marks}\label{classKRuler_05}

\item 
bool {\bf show\-Big\-Marks}\label{classKRuler_06}

\item 
bool {\bf show\-Pointer}\label{classKRuler_07}

\item 
bool {\bf show\-End\-Label}\label{classKRuler_08}

\item 
int {\bf tiny\-Mark\-Distance}\label{classKRuler_09}

\item 
int {\bf little\-Mark\-Distance}\label{classKRuler_010}

\item 
int {\bf medium\-Mark\-Distance}\label{classKRuler_011}

\item 
int {\bf big\-Mark\-Distance}\label{classKRuler_012}

\item 
double {\bf pixel\-Per\-Mark}\label{classKRuler_013}

\item 
bool {\bf length\-Fixed}\label{classKRuler_014}

\end{CompactItemize}


\subsection{Detailed Description}
A ruler widget. A ruler widget. 

The vertical ruler looks similar to this:



\footnotesize\begin{verbatim}    meters                       inches

    ------   <--- end mark  ---> ------
        --                            -
        --   <---little mark--->     --
        --                            -
        --                          ---
       ---   <---medium mark          -
        --                           --
        --        tiny mark---->      -
        --                         ----
        --                            -
      ----   <-----big mark          --
        --                            -
      |>--   <--ruler pointer-->   |>--
\end{verbatim}
\normalsize


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 {\bf 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 {\bf QWidget::repaint()} call after changing the values. For setting multiple values like {\bf min\-Value()}{\rm (p.\,\pageref{classKRuler_a5})}, {\bf max\-Value()}{\rm (p.\,\pageref{classKRuler_a7})}, {\bf offset()}{\rm (p.\,\pageref{classKRuler_a48})} etc. using the public methods is recommended so the widget will be painted only once when entering the main event loop.

\begin{Desc}
\item[Author:]J\"{o}rg Habenicht \end{Desc}




Definition at line 71 of file kruler.h.

\subsection{Member Enumeration Documentation}
\index{KRuler@{KRuler}!MetricStyle@{MetricStyle}}
\index{MetricStyle@{MetricStyle}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf enum} {\bf KRuler::Metric\-Style}}\label{classKRuler_w6}


The types of units used. 



Definition at line 104 of file kruler.h.

\subsection{Constructor \& Destructor Documentation}
\index{KRuler@{KRuler}!KRuler@{KRuler}}
\index{KRuler@{KRuler}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRuler::KRuler ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKRuler_a0}


Constructs a horizontal ruler. 



Definition at line 94 of file kruler.cpp.\index{KRuler@{KRuler}!KRuler@{KRuler}}
\index{KRuler@{KRuler}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRuler::KRuler (Orientation {\em orient}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}, WFlags {\em f} = {\tt 0})}\label{classKRuler_a1}


Constructs a ruler with orientation {\tt orient}. 

{\tt parent}, {\tt name} and {\tt f} are passed to {\bf QFrame}. The default look is a raised widget but may be changed with the inherited {\bf QFrame} methods.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em orient}]Orientation of the ruler. \item[{\em parent}]Will be handed over to {\bf QFrame}. \item[{\em name}]Will be handed over to {\bf QFrame}. \item[{\em f}]Will be handed over to {\bf QFrame}. \end{description}
\end{Desc}


Definition at line 104 of file kruler.cpp.\index{KRuler@{KRuler}!KRuler@{KRuler}}
\index{KRuler@{KRuler}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRuler::KRuler (Orientation {\em orient}, int {\em widget\-Width}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}, WFlags {\em f} = {\tt 0})}\label{classKRuler_a2}


Constructs a ruler with orientation {\tt orient} and initial width {\tt widget\-Width}. 

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. {\tt parent}, {\tt name} and {\tt f} are passed to {\bf QFrame}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em orient}]Orientation of the ruler. \item[{\em widget\-Width}]Fixed width of the widget. \item[{\em parent}]Will be handed over to {\bf QFrame}. \item[{\em name}]Will be handed over to {\bf QFrame}. \item[{\em f}]Will be handed over to {\bf QFrame}. \end{description}
\end{Desc}


Definition at line 118 of file kruler.cpp.\index{KRuler@{KRuler}!~KRuler@{$\sim$KRuler}}
\index{~KRuler@{$\sim$KRuler}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRuler::$\sim${\bf KRuler} ()}\label{classKRuler_a3}


Destructor. 



Definition at line 157 of file kruler.cpp.

\subsection{Member Function Documentation}
\index{KRuler@{KRuler}!setMinValue@{setMinValue}}
\index{setMinValue@{setMinValue}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Min\-Value (int)}\label{classKRuler_a4}


Sets the minimal value of the ruler pointer (default is 0). 

This method calls update() so that the widget is painted after leaving to the main event loop. 

Definition at line 163 of file kruler.cpp.

References QFrame::contents\-Rect(), QRange\-Control::max\-Value(), QRange\-Control::min\-Value(), and QRange\-Control::set\-Range().\index{KRuler@{KRuler}!minValue@{minValue}}
\index{minValue@{minValue}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRuler::min\-Value () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a5}


Returns the minimal value of the ruler pointer. 

\index{KRuler@{KRuler}!setMaxValue@{setMaxValue}}
\index{setMaxValue@{setMaxValue}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Max\-Value (int)}\label{classKRuler_a6}


Sets the maximum value of the ruler pointer (default is 100). 

This method calls update() so that the widget is painted after leaving to the main event loop. 

Definition at line 172 of file kruler.cpp.

References QFrame::contents\-Rect(), QRange\-Control::max\-Value(), QRange\-Control::min\-Value(), and QRange\-Control::set\-Range().\index{KRuler@{KRuler}!maxValue@{maxValue}}
\index{maxValue@{maxValue}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRuler::max\-Value () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a7}


Returns the maximal value of the ruler pointer. 

\index{KRuler@{KRuler}!setRange@{setRange}}
\index{setRange@{setRange}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Range (int {\em min}, int {\em max})}\label{classKRuler_a8}


Sets minimum and maximum values of the ruler pointer. 

This method calls update() so that the widget is painted after leaving to the main event loop. 

Definition at line 181 of file kruler.cpp.

References QFrame::contents\-Rect(), QRange\-Control::max\-Value(), QRange\-Control::min\-Value(), and QRange\-Control::set\-Range().\index{KRuler@{KRuler}!setValue@{setValue}}
\index{setValue@{setValue}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Value (int)}\label{classKRuler_a9}


Sets the value of the ruler pointer. 

The value is indicated by painting the ruler pointer at the corresponding position. This method calls update() so that the widget is painted after leaving to the main event loop. 

Definition at line 190 of file kruler.cpp.

References QFrame::contents\-Rect(), and QRange\-Control::set\-Value().\index{KRuler@{KRuler}!setTinyMarkDistance@{setTinyMarkDistance}}
\index{setTinyMarkDistance@{setTinyMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Tiny\-Mark\-Distance (int)}\label{classKRuler_a11}


Sets the distance between tiny marks. 

This is mostly used in the English system (inches) with distance of 1. 

Definition at line 197 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!tinyMarkDistance@{tinyMarkDistance}}
\index{tinyMarkDistance@{tinyMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRuler::tiny\-Mark\-Distance () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a12}


Returns the distance between tiny marks. 

\index{KRuler@{KRuler}!setLittleMarkDistance@{setLittleMarkDistance}}
\index{setLittleMarkDistance@{setLittleMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Little\-Mark\-Distance (int)}\label{classKRuler_a13}


Sets the distance between little marks. 

The default value is 1 in the metric system and 2 in the English (inches) system. 

Definition at line 206 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!littleMarkDistance@{littleMarkDistance}}
\index{littleMarkDistance@{littleMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRuler::little\-Mark\-Distance () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a14}


Returns the distance between little marks. 

\index{KRuler@{KRuler}!setMediumMarkDistance@{setMediumMarkDistance}}
\index{setMediumMarkDistance@{setMediumMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Medium\-Mark\-Distance (int)}\label{classKRuler_a15}


Sets the distance between medium marks. 

For English (inches) styles it defaults to twice the little mark distance. For metric styles it defaults to five times the little mark distance. 

Definition at line 215 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setBigMarkDistance@{setBigMarkDistance}}
\index{setBigMarkDistance@{setBigMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Big\-Mark\-Distance (int)}\label{classKRuler_a17}


Sets distance between big marks. 

For English (inches) or metric styles it is twice the medium mark distance. 

Definition at line 224 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!bigMarkDistance@{bigMarkDistance}}
\index{bigMarkDistance@{bigMarkDistance}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRuler::big\-Mark\-Distance () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a18}


Returns the distance between big marks. 

\index{KRuler@{KRuler}!setShowTinyMarks@{setShowTinyMarks}}
\index{setShowTinyMarks@{setShowTinyMarks}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-Tiny\-Marks (bool)}\label{classKRuler_a19}


Shows/hides tiny marks. 



Definition at line 233 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setShowLittleMarks@{setShowLittleMarks}}
\index{setShowLittleMarks@{setShowLittleMarks}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-Little\-Marks (bool)}\label{classKRuler_a21}


Shows/hides little marks. 



Definition at line 248 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setShowMediumMarks@{setShowMediumMarks}}
\index{setShowMediumMarks@{setShowMediumMarks}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-Medium\-Marks (bool)}\label{classKRuler_a23}


Shows/hides medium marks. 



Definition at line 263 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setShowBigMarks@{setShowBigMarks}}
\index{setShowBigMarks@{setShowBigMarks}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-Big\-Marks (bool)}\label{classKRuler_a25}


Shows/hides big marks. 



Definition at line 278 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setShowEndMarks@{setShowEndMarks}}
\index{setShowEndMarks@{setShowEndMarks}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-End\-Marks (bool)}\label{classKRuler_a27}


Shows/hides end marks. 



Definition at line 294 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setShowPointer@{setShowPointer}}
\index{setShowPointer@{setShowPointer}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-Pointer (bool)}\label{classKRuler_a29}


Shows/hides the pointer. 



Definition at line 309 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setValuePerLittleMark@{setValuePerLittleMark}}
\index{setValuePerLittleMark@{setValuePerLittleMark}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Value\-Per\-Little\-Mark (int)}\label{classKRuler_a31}


\begin{Desc}
\item[{\bf Deprecated}]This method has no effect other than an update. Do not use. \end{Desc}


Definition at line 325 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setValuePerMediumMark@{setValuePerMediumMark}}
\index{setValuePerMediumMark@{setValuePerMediumMark}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Value\-Per\-Medium\-Mark (int)}\label{classKRuler_a32}


\begin{Desc}
\item[{\bf Deprecated}]This method has no effect other than an update. Do not use. \end{Desc}


Definition at line 331 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setValuePerBigMark@{setValuePerBigMark}}
\index{setValuePerBigMark@{setValuePerBigMark}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Value\-Per\-Big\-Mark (int)}\label{classKRuler_a33}


\begin{Desc}
\item[{\bf Deprecated}]This method has no effect other than an update. Do not use. \end{Desc}


Definition at line 337 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setShowEndLabel@{setShowEndLabel}}
\index{setShowEndLabel@{setShowEndLabel}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Show\-End\-Label (bool)}\label{classKRuler_a34}


Show/hide number values of the end marks. 

Default is {\tt false}. 

Definition at line 343 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setEndLabel@{setEndLabel}}
\index{setEndLabel@{setEndLabel}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-End\-Label (const {\bf QString} \&)}\label{classKRuler_a36}


Sets the label this is drawn at the beginning of the visible part of the ruler to {\tt label}. 



Definition at line 360 of file kruler.cpp.

References QFrame::contents\-Rect(), QFont::set\-Point\-Size(), and QFont\-Metrics::width().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!setRulerMetricStyle@{setRulerMetricStyle}}
\index{setRulerMetricStyle@{setRulerMetricStyle}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Ruler\-Metric\-Style ({\bf KRuler::Metric\-Style})}\label{classKRuler_a38}


Sets up the necessary tasks for the provided styles. 

A convenience method. 

Definition at line 380 of file kruler.cpp.

References QFrame::contents\-Rect(), set\-Big\-Mark\-Distance(), set\-End\-Label(), set\-Little\-Mark\-Distance(), set\-Medium\-Mark\-Distance(), set\-Pixel\-Per\-Mark(), set\-Show\-Big\-Marks(), set\-Show\-End\-Marks(), set\-Show\-Little\-Marks(), set\-Show\-Medium\-Marks(), set\-Show\-Tiny\-Marks(), and set\-Tiny\-Mark\-Distance().\index{KRuler@{KRuler}!setPixelPerMark@{setPixelPerMark}}
\index{setPixelPerMark@{setPixelPerMark}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Pixel\-Per\-Mark (double {\em rate})}\label{classKRuler_a39}


Sets the number of pixels between two base marks. 

Calling this method stretches or shrinks your ruler.

For pixel display ( Metric\-Style) the value is 10.0 marks per pixel ;-) For English (inches) it is 9.0, and for centimetres $\sim$2.835 -$>$ 3.0 . If you want to magnify your part of display, you have to adjust the mark distance {\tt 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 {\tt int} values use set\-Pixel\-Per\-Mark((int)your\_\-int\_\-value); default: 1 mark per 10 pixels 

Definition at line 457 of file kruler.cpp.

References QFrame::contents\-Rect().

Referenced by set\-Ruler\-Metric\-Style().\index{KRuler@{KRuler}!pixelPerMark@{pixelPerMark}}
\index{pixelPerMark@{pixelPerMark}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double KRuler::pixel\-Per\-Mark () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a40}


Returns the number of pixels between two base marks. 

\index{KRuler@{KRuler}!setLength@{setLength}}
\index{setLength@{setLength}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Length (int)}\label{classKRuler_a41}


Sets the length of the ruler, i.e. 

the difference between the begin mark and the end mark of the ruler.

Same as (width() - {\bf offset()}{\rm (p.\,\pageref{classKRuler_a48})})

when the length is not locked, it gets adjusted with the length of the widget. 

Definition at line 465 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setLengthFixed@{setLengthFixed}}
\index{setLengthFixed@{setLengthFixed}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Length\-Fixed (bool {\em fix})}\label{classKRuler_a43}


Locks the length of the ruler, i.e. 

the difference between the two end marks doesn't change when the widget is resized.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fix}]fixes the length, if true \end{description}
\end{Desc}


Definition at line 491 of file kruler.cpp.\index{KRuler@{KRuler}!slideUp@{slideUp}}
\index{slideUp@{slideUp}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::slide\-Up (int {\em count} = {\tt 1})}\label{classKRuler_a45}


Sets the number of pixels by which the ruler may slide up or left. 

The number of pixels moved is realive to the previous position. The Method makes sense for updating a ruler, which is working with a scrollbar.

This doesn't affect the position of the ruler pointer. Only the visible part of the ruler is moved.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em count}]Number of pixel moving up or left relative to the previous position \end{description}
\end{Desc}


Definition at line 522 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!slideDown@{slideDown}}
\index{slideDown@{slideDown}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::slide\-Down (int {\em count} = {\tt 1})}\label{classKRuler_a46}


Sets the number of pixels by which the ruler may slide down or right. 

The number of pixels moved is realive to the previous position. The Method makes sense for updating a ruler, which is working with a scrollbar.

This doesn't affect the position of the ruler pointer. Only the visible part of the ruler is moved.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em count}]Number of pixel moving up or left relative to the previous position \end{description}
\end{Desc}


Definition at line 531 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!setOffset@{setOffset}}
\index{setOffset@{setOffset}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::set\-Offset (int {\em offset})}\label{classKRuler_a47}


Sets the ruler slide offset. 

This is like slideup() or slidedown() with an absolute offset from the start of the ruler.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em offset}]Number of pixel to move the ruler up or left from the beginning \end{description}
\end{Desc}


Definition at line 503 of file kruler.cpp.

References QFrame::contents\-Rect().\index{KRuler@{KRuler}!offset@{offset}}
\index{offset@{offset}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRuler::offset () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRuler_a48}


Returns the current ruler offset. 



Definition at line 518 of file kruler.h.\index{KRuler@{KRuler}!slotNewValue@{slotNewValue}}
\index{slotNewValue@{slotNewValue}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::slot\-New\-Value (int)\hspace{0.3cm}{\tt  [slot]}}\label{classKRuler_i0}


Sets the pointer to a new position. 

The offset is NOT updated. {\bf QWidget::repaint()} is called afterwards. 

Definition at line 541 of file kruler.cpp.

References QRange\-Control::set\-Value(), QRect::unite(), and QRange\-Control::value().\index{KRuler@{KRuler}!slotNewOffset@{slotNewOffset}}
\index{slotNewOffset@{slotNewOffset}!KRuler@{KRuler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRuler::slot\-New\-Offset (int)\hspace{0.3cm}{\tt  [slot]}}\label{classKRuler_i1}


Sets the ruler marks to a new position. 

The pointer is NOT updated. {\bf QWidget::repaint()} is called afterwards. 

Definition at line 567 of file kruler.cpp.

References QFrame::contents\-Rect().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kruler.h\item 
kruler.cpp\end{CompactItemize}
