\section{KXYSelector Class Reference}
\label{classKXYSelector}\index{KXYSelector@{KXYSelector}}
KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimensional range of values.  


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

Inheritance diagram for KXYSelector:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=54pt]{classKXYSelector__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KXYSelector:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=82pt]{classKXYSelector__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf value\-Changed} (int {\bf x}, int {\bf y})
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KXYSelector} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf $\sim$KXYSelector} ()
\item 
void {\bf set\-Values} (int x\-Pos, int y\-Pos)
\item 
void {\bf set\-XValue} (int x\-Pos)
\item 
void {\bf set\-YValue} (int y\-Pos)
\item 
void {\bf set\-Range} (int min\-X, int min\-Y, int max\-X, int max\-Y)
\item 
int {\bf x\-Value} () const 
\item 
int {\bf y\-Value} () const 
\item 
{\bf QRect} {\bf contents\-Rect} () const 
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf draw\-Contents} ({\bf QPainter} $\ast$)
\item 
virtual void {\bf draw\-Cursor} ({\bf QPainter} $\ast$p, int xp, int yp)
\item 
virtual void {\bf paint\-Event} ({\bf QPaint\-Event} $\ast$e)\label{classKXYSelector_b2}

\item 
virtual void {\bf mouse\-Press\-Event} ({\bf QMouse\-Event} $\ast$e)\label{classKXYSelector_b3}

\item 
virtual void {\bf mouse\-Move\-Event} ({\bf QMouse\-Event} $\ast$e)\label{classKXYSelector_b4}

\item 
virtual void {\bf wheel\-Event} ({\bf QWheel\-Event} $\ast$)\label{classKXYSelector_b5}

\item 
void {\bf values\-From\-Position} (int {\bf x}, int {\bf y}, int \&x\-Val, int \&y\-Val) const 
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKXYSelector_b7}

\end{CompactItemize}
\subsection*{Properties}
\begin{CompactItemize}
\item 
int {\bf x\-Value}\label{classKXYSelector_00}

\item 
int {\bf y\-Value}\label{classKXYSelector_01}

\end{CompactItemize}


\subsection{Detailed Description}
KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimensional range of values. 

The currently chosen value is indicated by a cross. An example is the {\bf KHSSelector}{\rm (p.\,\pageref{classKHSSelector})} which allows to choose from a range of colors, and which is used in {\bf KColor\-Dialog}{\rm (p.\,\pageref{classKColorDialog})}.

A custom drawing routine for the widget surface has to be provided by the subclass. 



Definition at line 43 of file kselect.h.

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


Constructs a two-dimensional selector widget which has a value range of [0..100] in both directions. 



Definition at line 35 of file kselect.cpp.

References QPixmap::resize(), and QPixmap::set\-Optimization().\index{KXYSelector@{KXYSelector}!~KXYSelector@{$\sim$KXYSelector}}
\index{~KXYSelector@{$\sim$KXYSelector}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KXYSelector::$\sim${\bf KXYSelector} ()}\label{classKXYSelector_a1}


Destructs the widget. 



Definition at line 49 of file kselect.cpp.

\subsection{Member Function Documentation}
\index{KXYSelector@{KXYSelector}!setValues@{setValues}}
\index{setValues@{setValues}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::set\-Values (int {\em x\-Pos}, int {\em y\-Pos})}\label{classKXYSelector_a2}


Sets the current values in horizontal and vertical direction. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x\-Pos}]the horizontal value \item[{\em y\-Pos}]the veritcal value \end{description}
\end{Desc}


Definition at line 73 of file kselect.cpp.

References QWidget::height(), and QWidget::width().

Referenced by set\-XValue(), and set\-YValue().\index{KXYSelector@{KXYSelector}!setXValue@{setXValue}}
\index{setXValue@{setXValue}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::set\-XValue (int {\em x\-Pos})}\label{classKXYSelector_a3}


Sets the current horizontal value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x\-Pos}]the horizontal value \end{description}
\end{Desc}


Definition at line 63 of file kselect.cpp.

References set\-Values().\index{KXYSelector@{KXYSelector}!setYValue@{setYValue}}
\index{setYValue@{setYValue}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::set\-YValue (int {\em y\-Pos})}\label{classKXYSelector_a4}


Sets the current vertical value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em y\-Pos}]the veritcal value \end{description}
\end{Desc}


Definition at line 68 of file kselect.cpp.

References set\-Values().\index{KXYSelector@{KXYSelector}!setRange@{setRange}}
\index{setRange@{setRange}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::set\-Range (int {\em min\-X}, int {\em min\-Y}, int {\em max\-X}, int {\em max\-Y})}\label{classKXYSelector_a5}


Sets the range of possible values. 



Definition at line 53 of file kselect.cpp.\index{KXYSelector@{KXYSelector}!xValue@{xValue}}
\index{xValue@{xValue}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KXYSelector::x\-Value () const\hspace{0.3cm}{\tt  [inline]}}\label{classKXYSelector_a6}


\begin{Desc}
\item[Returns:]the current value in horizontal direction. \end{Desc}


Definition at line 88 of file kselect.h.\index{KXYSelector@{KXYSelector}!yValue@{yValue}}
\index{yValue@{yValue}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KXYSelector::y\-Value () const\hspace{0.3cm}{\tt  [inline]}}\label{classKXYSelector_a7}


\begin{Desc}
\item[Returns:]the current value in vertical direction. \end{Desc}


Definition at line 92 of file kselect.h.\index{KXYSelector@{KXYSelector}!contentsRect@{contentsRect}}
\index{contentsRect@{contentsRect}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QRect} KXYSelector::contents\-Rect () const}\label{classKXYSelector_a8}


\begin{Desc}
\item[Returns:]the rectangle on which subclasses should draw. \end{Desc}


Definition at line 94 of file kselect.cpp.

References QWidget::height(), and QWidget::width().

Referenced by KHSSelector::draw\-Contents(), and KHSSelector::draw\-Palette().\index{KXYSelector@{KXYSelector}!valueChanged@{valueChanged}}
\index{valueChanged@{valueChanged}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::value\-Changed (int {\em x}, int {\em y})\hspace{0.3cm}{\tt  [signal]}}\label{classKXYSelector_l0}


This signal is emitted whenever the user chooses a value, e.g. 

by clicking with the mouse on the widget. \index{KXYSelector@{KXYSelector}!drawContents@{drawContents}}
\index{drawContents@{drawContents}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::draw\-Contents ({\bf QPainter} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKXYSelector_b0}


Override this function to draw the contents of the widget. 

The default implementation does nothing.

Draw within {\bf contents\-Rect()}{\rm (p.\,\pageref{classKXYSelector_a8})} only. 

Reimplemented in {\bf KHSSelector} {\rm (p.\,\pageref{classKHSSelector_b2})}.

Definition at line 196 of file kselect.cpp.\index{KXYSelector@{KXYSelector}!drawCursor@{drawCursor}}
\index{drawCursor@{drawCursor}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::draw\-Cursor ({\bf QPainter} $\ast$ {\em p}, int {\em xp}, int {\em yp})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKXYSelector_b1}


Override this function to draw the cursor which indicates the currently selected value pair. 



Definition at line 200 of file kselect.cpp.

References QPainter::draw\-Line(), and QPainter::set\-Pen().\index{KXYSelector@{KXYSelector}!valuesFromPosition@{valuesFromPosition}}
\index{valuesFromPosition@{valuesFromPosition}!KXYSelector@{KXYSelector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KXYSelector::values\-From\-Position (int {\em x}, int {\em y}, int \& {\em x\-Val}, int \& {\em y\-Val}) const\hspace{0.3cm}{\tt  [protected]}}\label{classKXYSelector_b6}


Converts a pixel position to its corresponding values. 



Definition at line 154 of file kselect.cpp.

References QWidget::height(), and QWidget::width().

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