\hypertarget{class_grid_widget}{}\section{Grid\+Widget Class Reference} \label{class_grid_widget}\index{Grid\+Widget@{Grid\+Widget}} {\ttfamily \#include $<$grid.\+h$>$} Inheritance diagram for Grid\+Widget\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{class_grid_widget} \end{center} \end{figure} \subsection*{Signals} \begin{DoxyCompactItemize} \item \hypertarget{class_grid_widget_a03fb9de07df9c6d1e10050160ef0bce5}{}void {\bfseries cell\+Clicked} (Q\+Point pos)\label{class_grid_widget_a03fb9de07df9c6d1e10050160ef0bce5} \item \hypertarget{class_grid_widget_a4fe89ce12f526ca7b48dda9a97398807}{}void {\bfseries can\+Undo} (bool can)\label{class_grid_widget_a4fe89ce12f526ca7b48dda9a97398807} \item \hypertarget{class_grid_widget_a476721515464b1217486a1a3e6f573fc}{}void {\bfseries can\+Redo} (bool can)\label{class_grid_widget_a476721515464b1217486a1a3e6f573fc} \end{DoxyCompactItemize} \subsection*{Public Member Functions} \begin{DoxyCompactItemize} \item \hyperlink{class_grid_widget_ad3370c8905e4f03b666d1be221f4c412}{Grid\+Widget} (int row\+Count=100, int column\+Count=100, Q\+Widget $\ast$parent=0) \begin{DoxyCompactList}\small\item\em Constructor which receives the number of rows and columns in the grid. \end{DoxyCompactList}\item \hyperlink{class_grid_widget_a8d85ee082bf0dd38eb581697844f825d}{Grid\+Widget} (Q\+Widget $\ast$parent) \begin{DoxyCompactList}\small\item\em Default constructor. The properties of the grid are set as follows\+: \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a87a46b6a3e5522e851732093b757baae}{set\+Grid\+Size} (int row\+Count, int column\+Count) \begin{DoxyCompactList}\small\item\em Sets the number of columns and rows of the grid. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_ace3447d5fc329c47b55395a52a9eaf13}{switch\+On} (int x, int y, const Q\+Color \&color) \begin{DoxyCompactList}\small\item\em Saves the given color and position in the vector that represents the painted cells of the grid. \end{DoxyCompactList}\item Q\+Color \hyperlink{class_grid_widget_a50a2a9b2490de84dba08be23130fd9d4}{get\+Cell\+Color} (int x, int y) \begin{DoxyCompactList}\small\item\em Returns the color of the cell in position (x,y) \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_aca84a4a79a25f1adebaeb69f32022882}{switch\+Off} (int x, int y) \begin{DoxyCompactList}\small\item\em Removes the given position from the vector that represents the painted cells of the grid. \end{DoxyCompactList}\item int \hyperlink{class_grid_widget_a1b92c3f484ea93338f3c0b8348a334f9}{get\+Grid\+Columns} () \begin{DoxyCompactList}\small\item\em Returns the number of columns in the grid. \end{DoxyCompactList}\item int \hyperlink{class_grid_widget_afa1e34f8dbae400cf200fdeb2398f138}{get\+Grid\+Rows} () \begin{DoxyCompactList}\small\item\em Returns the number of rows in the grid. \end{DoxyCompactList}\item \hypertarget{class_grid_widget_a7979db95cc3533858a17946b8a70abe3}{}void \hyperlink{class_grid_widget_a7979db95cc3533858a17946b8a70abe3}{clear} ()\label{class_grid_widget_a7979db95cc3533858a17946b8a70abe3} \begin{DoxyCompactList}\small\item\em Clears the grid and sets it to its initial state. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a8a128f08a3471f751442dfe1306250f4}{set\+Cell\+Size} (int size) \begin{DoxyCompactList}\small\item\em Sets the size of the cells in the grid. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a242812c406b269657eb6092af4a0ae7e}{set\+Tool} (Q\+String tool) \begin{DoxyCompactList}\small\item\em Sets the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_abe71249d6d54e84698dcb831c9df4c17}{set\+Front} (Q\+String front) \begin{DoxyCompactList}\small\item\em Sets the color of the brush. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a64cd0418127923278bd7dd3ddd3bd459}{set\+Back} (Q\+String back) \begin{DoxyCompactList}\small\item\em Sets the color of the background. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_aca5c4e4edab002da08a7d76b7acf8ce7}{set\+Tool\+Size} (int size) \begin{DoxyCompactList}\small\item\em Sets the size of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_ac4b7dcf1fd4f6f3f00f6c83837af762d}{identify\+Tool} (Q\+String tool, int x, int y) \begin{DoxyCompactList}\small\item\em This function is called on each mouse\+Press\+Event inside the grid. It identifies the way the grid will be painted calling the function of the tool received in the parameters (dot, rowfill, column fill, diagonal, square, triangles and circles). \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a9eae49724fc8eb51dacb29cf0f1d0f7f}{Dot} (int x, int y, Q\+Color color\+Selected) \begin{DoxyCompactList}\small\item\em Receives the coordinates of the grid where the user clicked and paints that cell with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a85f85cefe91f2c4e9c79566b5e65d5df}{Row\+Major\+Fill} (int x, int y, Q\+Color color\+Clicked, Q\+Color tool\+Color) \begin{DoxyCompactList}\small\item\em Receives the coordinates of the grid where the user clicked and paints (from that point left and right) the longest row of the same color of the cell that was clicked with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a1850e0f0dde766350c7cff9668424633}{Col\+Major\+Fill} (int x, int y, Q\+Color color\+Clicked, Q\+Color tool\+Color) \begin{DoxyCompactList}\small\item\em Receives the coordinates of the grid where the user clicked and paints (from that point up and down) the longest column of the same color of the cell that was clicked with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a2de94a6b9cda8d27be4598ebd2b80ef1}{Diagonal\+Left} (int x, int y, Q\+Color color\+Clicked, Q\+Color tool\+Color) \begin{DoxyCompactList}\small\item\em Recieves the coordinates of the grid where the user clicked and paints (from that point) the longest left-\/diagonal of the color of the cell that was clicked with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a8ff474d6ac0e76685839e4107c85c10b}{Diagonal\+Right} (int x, int y, Q\+Color color\+Clicked, Q\+Color tool\+Color) \begin{DoxyCompactList}\small\item\em Recieves the coordinates of the grid where the user clicked and paints (from that point) the longest right-\/diagonal of the color of the cell that was clicked with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a3d25401530305223417a0a0313e7105b}{square} (int x, int y, Q\+Color tool\+Color, int tool\+Size) \begin{DoxyCompactList}\small\item\em Receives the coordinates of the grid where the user clicked and paints a square of the size and with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_abee64aeb022f670f15870500e9127cda}{triangle} (int x, int y, Q\+Color tool\+Color, int tool\+Size) \begin{DoxyCompactList}\small\item\em Receives the coordinates of the grid where the user clicked and paints a triangle of the size and with the color of the tool. \end{DoxyCompactList}\item void \hyperlink{class_grid_widget_a4de59f7c6dba342ff0406137ca87bf8d}{circle} (int x, int y, Q\+Color tool\+Color, int tool\+Size) \begin{DoxyCompactList}\small\item\em Receives the coordinates of the grid where the user clicked and paints a circle of the size and with the color of the tool. \end{DoxyCompactList}\item \hypertarget{class_grid_widget_a6426b82953f555dc84ede652cd44ee13}{}void \hyperlink{class_grid_widget_a6426b82953f555dc84ede652cd44ee13}{undo} ()\label{class_grid_widget_a6426b82953f555dc84ede652cd44ee13} \begin{DoxyCompactList}\small\item\em When the undo button is pressed the current state is pushed into the redo vector(new\+States) and the last state in the undo vector(old\+States) is painted on the grid. \end{DoxyCompactList}\item \hypertarget{class_grid_widget_a0a8b52721ac642d4f7261896ef2fff74}{}void \hyperlink{class_grid_widget_a0a8b52721ac642d4f7261896ef2fff74}{redo} ()\label{class_grid_widget_a0a8b52721ac642d4f7261896ef2fff74} \begin{DoxyCompactList}\small\item\em When the redo button is pressed the current state is pushed into the undo vector(old\+States) and the last state in the redo vector(new\+States) is painted on the grid. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Protected Member Functions} \begin{DoxyCompactItemize} \item void \hyperlink{class_grid_widget_a2b49b1ee6683c99f4a497f7ad89e8097}{draw\+Grid} (Q\+Paint\+Device $\ast$device) \begin{DoxyCompactList}\small\item\em Function that first sets the size of the \hyperlink{class_grid_widget}{Grid\+Widget}, then paints the cells with the color selected for the background and finally paints the lines to form the grid. \end{DoxyCompactList}\item virtual void \hyperlink{class_grid_widget_a727fa338640fe7e856519f4ed0078b33}{paint\+Event} (Q\+Paint\+Event $\ast$) \begin{DoxyCompactList}\small\item\em This function is automatically invoked each time the widget or its parent receives a repaint signal. \end{DoxyCompactList}\item virtual void \hyperlink{class_grid_widget_adbd85c9494fa35df467d912e2eb41742}{mouse\+Press\+Event} (Q\+Mouse\+Event $\ast$) \begin{DoxyCompactList}\small\item\em When the mouse is clicked on a cell of the grid it gets the x,y coordinates of the mouse and uses them to paint the tool at that location. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Private Attributes} \begin{DoxyCompactItemize} \item int \hyperlink{class_grid_widget_a2913542510201e3e0c7fffe81abf0253}{m\+Cell\+Size} \item int \hyperlink{class_grid_widget_a3d818ef6eb5868e53e26e1fd48f19057}{m\+Row\+Count} \item int \hyperlink{class_grid_widget_ab530d1fa7b44c05afe4e70c2e410e579}{m\+Column\+Count} \item Q\+Pixmap \hyperlink{class_grid_widget_a1b67bb85e389d27e03ef34e4f0b90750}{m\+Grid\+Pix} \item Q\+Hash$<$ int, Q\+Color $>$ \hyperlink{class_grid_widget_a65644f377d72a22e4925ad21fc9ccbf5}{m\+Colors} \item Q\+String \hyperlink{class_grid_widget_a53e89b667667aed308430da93a25b7a1}{Tool} \item int \hyperlink{class_grid_widget_a48b162752c6e7853b2ce3c6cb8db5661}{Tool\+Size} \item Q\+Color \hyperlink{class_grid_widget_a857bb9b33ae7f241a568f884f4e6f5bf}{front\+Color} \item Q\+Color \hyperlink{class_grid_widget_aa36b97142702844f4888a9bbee37b670}{back\+Color} \item Q\+Color \hyperlink{class_grid_widget_a6afb043b34520019af1acb14fb4682d4}{background} \item Q\+Vector$<$ Q\+Hash$<$ int, Q\+Color $>$ $>$ \hyperlink{class_grid_widget_aa41b383c851c5ef1c11871507aa1f28d}{old\+States} \item Q\+Vector$<$ Q\+Hash$<$ int, Q\+Color $>$ $>$ \hyperlink{class_grid_widget_a8c84952dfa2f11876ab8f1346667c565}{new\+States} \end{DoxyCompactItemize} \subsection{Detailed Description} \hyperlink{class_grid_widget}{Grid\+Widget}\+: Shows a Grid\+View without scrolling. If you want to have Scroll option, use Grid\+View instead. \hyperlink{class_grid_widget}{Grid\+Widget} also supports mouse selection, sends the signal cell\+Clicked with the associated grid coordinates. \subsection{Constructor \& Destructor Documentation} \hypertarget{class_grid_widget_ad3370c8905e4f03b666d1be221f4c412}{}\index{Grid\+Widget@{Grid\+Widget}!Grid\+Widget@{Grid\+Widget}} \index{Grid\+Widget@{Grid\+Widget}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Grid\+Widget}]{\setlength{\rightskip}{0pt plus 5cm}Grid\+Widget\+::\+Grid\+Widget ( \begin{DoxyParamCaption} \item[{int}]{row\+Count = {\ttfamily 100}, } \item[{int}]{column\+Count = {\ttfamily 100}, } \item[{Q\+Widget $\ast$}]{parent = {\ttfamily 0}} \end{DoxyParamCaption} )\hspace{0.3cm}{\ttfamily [explicit]}}\label{class_grid_widget_ad3370c8905e4f03b666d1be221f4c412} Constructor which receives the number of rows and columns in the grid. \begin{DoxyParams}{Parameters} {\em row\+Count} & number of rows in the grid \\ \hline {\em column\+Count} & number of columns in the grid \\ \hline {\em parent} & parent window\\ \hline \end{DoxyParams} Constructor que recibe el numero de filas y columnas en la cuadricula \begin{DoxyParams}{Parameters} {\em row\+Count} & numero de filas en la cuadricula \\ \hline {\em column\+Count} & numero de columnas en la cuadricula \\ \hline {\em parent} & ventana padre \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a8d85ee082bf0dd38eb581697844f825d}{}\index{Grid\+Widget@{Grid\+Widget}!Grid\+Widget@{Grid\+Widget}} \index{Grid\+Widget@{Grid\+Widget}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Grid\+Widget}]{\setlength{\rightskip}{0pt plus 5cm}Grid\+Widget\+::\+Grid\+Widget ( \begin{DoxyParamCaption} \item[{Q\+Widget $\ast$}]{parent} \end{DoxyParamCaption} )}\label{class_grid_widget_a8d85ee082bf0dd38eb581697844f825d} Default constructor. The properties of the grid are set as follows\+: \begin{DoxyItemize} \item m\+Cell\+Size\+: Sets the size of the cell to 10px \item m\+Row\+Count\+: Sets the number of rows in the grid to 39 \item m\+Column\+Count\+: Sets the number of columns in the grid to 27 \item Tool and Tool\+Size\+: Sets the Tool which is going to be used to draw the grid \item front\+Color\+: The color which will be used to paint to black \item back\+Color\+: Current clicked square \item background\+: Sets the background color to white \end{DoxyItemize} Constructor por defecto. Las propiedades de el grid se ajustan como sigue\+: \begin{DoxyItemize} \item m\+Cell\+Size\+: Ajusta el tamano de la celda a 10px \item m\+Row\+Count\+: Ajusta el numero de filas en la cuadricula a 39 \item Column\+Count\+: Ajusta el numero de columnas en el grid a 27 \item Tool and Tool\+Size\+: Ajusta la herramiento que se va a utilizar para dibujar el grid. \item front\+Color\+: El color que se utilizara para pintar a negro \item back\+Color\+: Cuadrado marcado actualmente \item background\+: El color del fondo en blanco \end{DoxyItemize} \subsection{Member Function Documentation} \hypertarget{class_grid_widget_a4de59f7c6dba342ff0406137ca87bf8d}{}\index{Grid\+Widget@{Grid\+Widget}!circle@{circle}} \index{circle@{circle}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{circle}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::circle ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{tool\+Color, } \item[{int}]{tool\+Size} \end{DoxyParamCaption} )}\label{class_grid_widget_a4de59f7c6dba342ff0406137ca87bf8d} Receives the coordinates of the grid where the user clicked and paints a circle of the size and with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline {\em tool\+Size} & size of the tool to be painted \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a1850e0f0dde766350c7cff9668424633}{}\index{Grid\+Widget@{Grid\+Widget}!Col\+Major\+Fill@{Col\+Major\+Fill}} \index{Col\+Major\+Fill@{Col\+Major\+Fill}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Col\+Major\+Fill}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::\+Col\+Major\+Fill ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{color\+Clicked, } \item[{Q\+Color}]{tool\+Color} \end{DoxyParamCaption} )}\label{class_grid_widget_a1850e0f0dde766350c7cff9668424633} Receives the coordinates of the grid where the user clicked and paints (from that point up and down) the longest column of the same color of the cell that was clicked with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em color\+Clicked} & current color of the clicked cell \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a2de94a6b9cda8d27be4598ebd2b80ef1}{}\index{Grid\+Widget@{Grid\+Widget}!Diagonal\+Left@{Diagonal\+Left}} \index{Diagonal\+Left@{Diagonal\+Left}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Diagonal\+Left}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::\+Diagonal\+Left ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{color\+Clicked, } \item[{Q\+Color}]{tool\+Color} \end{DoxyParamCaption} )}\label{class_grid_widget_a2de94a6b9cda8d27be4598ebd2b80ef1} Recieves the coordinates of the grid where the user clicked and paints (from that point) the longest left-\/diagonal of the color of the cell that was clicked with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em color\+Clicked} & current color of the clicked cell \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a8ff474d6ac0e76685839e4107c85c10b}{}\index{Grid\+Widget@{Grid\+Widget}!Diagonal\+Right@{Diagonal\+Right}} \index{Diagonal\+Right@{Diagonal\+Right}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Diagonal\+Right}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::\+Diagonal\+Right ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{color\+Clicked, } \item[{Q\+Color}]{tool\+Color} \end{DoxyParamCaption} )}\label{class_grid_widget_a8ff474d6ac0e76685839e4107c85c10b} Recieves the coordinates of the grid where the user clicked and paints (from that point) the longest right-\/diagonal of the color of the cell that was clicked with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em color\+Clicked} & current color of the clicked cell \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a9eae49724fc8eb51dacb29cf0f1d0f7f}{}\index{Grid\+Widget@{Grid\+Widget}!Dot@{Dot}} \index{Dot@{Dot}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Dot}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::\+Dot ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{tool\+Color} \end{DoxyParamCaption} )}\label{class_grid_widget_a9eae49724fc8eb51dacb29cf0f1d0f7f} Receives the coordinates of the grid where the user clicked and paints that cell with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a2b49b1ee6683c99f4a497f7ad89e8097}{}\index{Grid\+Widget@{Grid\+Widget}!draw\+Grid@{draw\+Grid}} \index{draw\+Grid@{draw\+Grid}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{draw\+Grid}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::draw\+Grid ( \begin{DoxyParamCaption} \item[{Q\+Paint\+Device $\ast$}]{device} \end{DoxyParamCaption} )\hspace{0.3cm}{\ttfamily [protected]}}\label{class_grid_widget_a2b49b1ee6683c99f4a497f7ad89e8097} Function that first sets the size of the \hyperlink{class_grid_widget}{Grid\+Widget}, then paints the cells with the color selected for the background and finally paints the lines to form the grid. \begin{DoxyParams}{Parameters} {\em device} & the panel to paint the grid \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a50a2a9b2490de84dba08be23130fd9d4}{}\index{Grid\+Widget@{Grid\+Widget}!get\+Cell\+Color@{get\+Cell\+Color}} \index{get\+Cell\+Color@{get\+Cell\+Color}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{get\+Cell\+Color}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Color Grid\+Widget\+::get\+Cell\+Color ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y} \end{DoxyParamCaption} )}\label{class_grid_widget_a50a2a9b2490de84dba08be23130fd9d4} Returns the color of the cell in position (x,y) \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} the color of the cell \end{DoxyReturn} \hypertarget{class_grid_widget_a1b92c3f484ea93338f3c0b8348a334f9}{}\index{Grid\+Widget@{Grid\+Widget}!get\+Grid\+Columns@{get\+Grid\+Columns}} \index{get\+Grid\+Columns@{get\+Grid\+Columns}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{get\+Grid\+Columns}]{\setlength{\rightskip}{0pt plus 5cm}int Grid\+Widget\+::get\+Grid\+Columns ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{class_grid_widget_a1b92c3f484ea93338f3c0b8348a334f9} Returns the number of columns in the grid. \begin{DoxyReturn}{Returns} number of columns in the grid \end{DoxyReturn} \hypertarget{class_grid_widget_afa1e34f8dbae400cf200fdeb2398f138}{}\index{Grid\+Widget@{Grid\+Widget}!get\+Grid\+Rows@{get\+Grid\+Rows}} \index{get\+Grid\+Rows@{get\+Grid\+Rows}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{get\+Grid\+Rows}]{\setlength{\rightskip}{0pt plus 5cm}int Grid\+Widget\+::get\+Grid\+Rows ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{class_grid_widget_afa1e34f8dbae400cf200fdeb2398f138} Returns the number of rows in the grid. \begin{DoxyReturn}{Returns} number of rows in the grid \end{DoxyReturn} \hypertarget{class_grid_widget_ac4b7dcf1fd4f6f3f00f6c83837af762d}{}\index{Grid\+Widget@{Grid\+Widget}!identify\+Tool@{identify\+Tool}} \index{identify\+Tool@{identify\+Tool}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{identify\+Tool}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::identify\+Tool ( \begin{DoxyParamCaption} \item[{Q\+String}]{tool, } \item[{int}]{x, } \item[{int}]{y} \end{DoxyParamCaption} )}\label{class_grid_widget_ac4b7dcf1fd4f6f3f00f6c83837af762d} This function is called on each mouse\+Press\+Event inside the grid. It identifies the way the grid will be painted calling the function of the tool received in the parameters (dot, rowfill, column fill, diagonal, square, triangles and circles). \begin{DoxyParams}{Parameters} {\em tool} & the tool to be called by the funtion \\ \hline {\em x} & coordinate x of the cell in the grid. \\ \hline {\em y} & coordinate y of the cell in the grid. \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_adbd85c9494fa35df467d912e2eb41742}{}\index{Grid\+Widget@{Grid\+Widget}!mouse\+Press\+Event@{mouse\+Press\+Event}} \index{mouse\+Press\+Event@{mouse\+Press\+Event}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{mouse\+Press\+Event}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::mouse\+Press\+Event ( \begin{DoxyParamCaption} \item[{Q\+Mouse\+Event $\ast$}]{event} \end{DoxyParamCaption} )\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}\label{class_grid_widget_adbd85c9494fa35df467d912e2eb41742} When the mouse is clicked on a cell of the grid it gets the x,y coordinates of the mouse and uses them to paint the tool at that location. \begin{DoxyParams}{Parameters} {\em event} & received event reference \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a727fa338640fe7e856519f4ed0078b33}{}\index{Grid\+Widget@{Grid\+Widget}!paint\+Event@{paint\+Event}} \index{paint\+Event@{paint\+Event}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{paint\+Event}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::paint\+Event ( \begin{DoxyParamCaption} \item[{Q\+Paint\+Event $\ast$}]{event} \end{DoxyParamCaption} )\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}\label{class_grid_widget_a727fa338640fe7e856519f4ed0078b33} This function is automatically invoked each time the widget or its parent receives a repaint signal. \begin{DoxyParams}{Parameters} {\em event} & received event reference \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a85f85cefe91f2c4e9c79566b5e65d5df}{}\index{Grid\+Widget@{Grid\+Widget}!Row\+Major\+Fill@{Row\+Major\+Fill}} \index{Row\+Major\+Fill@{Row\+Major\+Fill}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Row\+Major\+Fill}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::\+Row\+Major\+Fill ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{color\+Clicked, } \item[{Q\+Color}]{tool\+Color} \end{DoxyParamCaption} )}\label{class_grid_widget_a85f85cefe91f2c4e9c79566b5e65d5df} Receives the coordinates of the grid where the user clicked and paints (from that point left and right) the longest row of the same color of the cell that was clicked with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em color\+Clicked} & current color of the clicked cell \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a64cd0418127923278bd7dd3ddd3bd459}{}\index{Grid\+Widget@{Grid\+Widget}!set\+Back@{set\+Back}} \index{set\+Back@{set\+Back}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{set\+Back}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::set\+Back ( \begin{DoxyParamCaption} \item[{Q\+String}]{back} \end{DoxyParamCaption} )}\label{class_grid_widget_a64cd0418127923278bd7dd3ddd3bd459} Sets the color of the background. \begin{DoxyParams}{Parameters} {\em back} & background color \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a8a128f08a3471f751442dfe1306250f4}{}\index{Grid\+Widget@{Grid\+Widget}!set\+Cell\+Size@{set\+Cell\+Size}} \index{set\+Cell\+Size@{set\+Cell\+Size}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{set\+Cell\+Size}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::set\+Cell\+Size ( \begin{DoxyParamCaption} \item[{int}]{size} \end{DoxyParamCaption} )}\label{class_grid_widget_a8a128f08a3471f751442dfe1306250f4} Sets the size of the cells in the grid. \begin{DoxyParams}{Parameters} {\em size} & cell size \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_abe71249d6d54e84698dcb831c9df4c17}{}\index{Grid\+Widget@{Grid\+Widget}!set\+Front@{set\+Front}} \index{set\+Front@{set\+Front}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{set\+Front}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::set\+Front ( \begin{DoxyParamCaption} \item[{Q\+String}]{front} \end{DoxyParamCaption} )}\label{class_grid_widget_abe71249d6d54e84698dcb831c9df4c17} Sets the color of the brush. \begin{DoxyParams}{Parameters} {\em front} & brush color \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a87a46b6a3e5522e851732093b757baae}{}\index{Grid\+Widget@{Grid\+Widget}!set\+Grid\+Size@{set\+Grid\+Size}} \index{set\+Grid\+Size@{set\+Grid\+Size}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{set\+Grid\+Size}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::set\+Grid\+Size ( \begin{DoxyParamCaption} \item[{int}]{row\+Count, } \item[{int}]{column\+Count} \end{DoxyParamCaption} )}\label{class_grid_widget_a87a46b6a3e5522e851732093b757baae} Sets the number of columns and rows of the grid. \begin{DoxyParams}{Parameters} {\em row\+Count} & number of rows \\ \hline {\em column\+Count} & number of columns \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a242812c406b269657eb6092af4a0ae7e}{}\index{Grid\+Widget@{Grid\+Widget}!set\+Tool@{set\+Tool}} \index{set\+Tool@{set\+Tool}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{set\+Tool}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::set\+Tool ( \begin{DoxyParamCaption} \item[{Q\+String}]{tool} \end{DoxyParamCaption} )}\label{class_grid_widget_a242812c406b269657eb6092af4a0ae7e} Sets the tool. \begin{DoxyParams}{Parameters} {\em tool} & choosen tool \\ \hline {\em tool} & herramienta escogida \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_aca5c4e4edab002da08a7d76b7acf8ce7}{}\index{Grid\+Widget@{Grid\+Widget}!set\+Tool\+Size@{set\+Tool\+Size}} \index{set\+Tool\+Size@{set\+Tool\+Size}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{set\+Tool\+Size}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::set\+Tool\+Size ( \begin{DoxyParamCaption} \item[{int}]{size} \end{DoxyParamCaption} )}\label{class_grid_widget_aca5c4e4edab002da08a7d76b7acf8ce7} Sets the size of the tool. \begin{DoxyParams}{Parameters} {\em size} & tool size \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_a3d25401530305223417a0a0313e7105b}{}\index{Grid\+Widget@{Grid\+Widget}!square@{square}} \index{square@{square}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{square}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::square ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{tool\+Color, } \item[{int}]{tool\+Size} \end{DoxyParamCaption} )}\label{class_grid_widget_a3d25401530305223417a0a0313e7105b} Receives the coordinates of the grid where the user clicked and paints a square of the size and with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline {\em tool\+Size} & size of the tool to be painted \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_aca84a4a79a25f1adebaeb69f32022882}{}\index{Grid\+Widget@{Grid\+Widget}!switch\+Off@{switch\+Off}} \index{switch\+Off@{switch\+Off}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{switch\+Off}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::switch\+Off ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y} \end{DoxyParamCaption} )}\label{class_grid_widget_aca84a4a79a25f1adebaeb69f32022882} Removes the given position from the vector that represents the painted cells of the grid. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_ace3447d5fc329c47b55395a52a9eaf13}{}\index{Grid\+Widget@{Grid\+Widget}!switch\+On@{switch\+On}} \index{switch\+On@{switch\+On}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{switch\+On}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::switch\+On ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{const Q\+Color \&}]{color} \end{DoxyParamCaption} )}\label{class_grid_widget_ace3447d5fc329c47b55395a52a9eaf13} Saves the given color and position in the vector that represents the painted cells of the grid. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em color} & color to paint cell \\ \hline \end{DoxyParams} \hypertarget{class_grid_widget_abee64aeb022f670f15870500e9127cda}{}\index{Grid\+Widget@{Grid\+Widget}!triangle@{triangle}} \index{triangle@{triangle}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{triangle}]{\setlength{\rightskip}{0pt plus 5cm}void Grid\+Widget\+::triangle ( \begin{DoxyParamCaption} \item[{int}]{x, } \item[{int}]{y, } \item[{Q\+Color}]{tool\+Color, } \item[{int}]{tool\+Size} \end{DoxyParamCaption} )}\label{class_grid_widget_abee64aeb022f670f15870500e9127cda} Receives the coordinates of the grid where the user clicked and paints a triangle of the size and with the color of the tool. \begin{DoxyParams}{Parameters} {\em x} & coordinate x of the cell in the grid \\ \hline {\em y} & coordinate y of the cell in the grid \\ \hline {\em tool\+Color} & color of the cells painted by the tool \\ \hline {\em tool\+Size} & size of the tool to be painted \\ \hline \end{DoxyParams} \subsection{Member Data Documentation} \hypertarget{class_grid_widget_aa36b97142702844f4888a9bbee37b670}{}\index{Grid\+Widget@{Grid\+Widget}!back\+Color@{back\+Color}} \index{back\+Color@{back\+Color}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{back\+Color}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Color Grid\+Widget\+::back\+Color\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_aa36b97142702844f4888a9bbee37b670} background color of the cell / color del fondo de la celda \hypertarget{class_grid_widget_a6afb043b34520019af1acb14fb4682d4}{}\index{Grid\+Widget@{Grid\+Widget}!background@{background}} \index{background@{background}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{background}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Color Grid\+Widget\+::background\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a6afb043b34520019af1acb14fb4682d4} cell size / tamano del la celda \hypertarget{class_grid_widget_a857bb9b33ae7f241a568f884f4e6f5bf}{}\index{Grid\+Widget@{Grid\+Widget}!front\+Color@{front\+Color}} \index{front\+Color@{front\+Color}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{front\+Color}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Color Grid\+Widget\+::front\+Color\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a857bb9b33ae7f241a568f884f4e6f5bf} color of the front cell / color de la celda de frente \hypertarget{class_grid_widget_a2913542510201e3e0c7fffe81abf0253}{}\index{Grid\+Widget@{Grid\+Widget}!m\+Cell\+Size@{m\+Cell\+Size}} \index{m\+Cell\+Size@{m\+Cell\+Size}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{m\+Cell\+Size}]{\setlength{\rightskip}{0pt plus 5cm}int Grid\+Widget\+::m\+Cell\+Size\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a2913542510201e3e0c7fffe81abf0253} cell size / tamano del la celda \hypertarget{class_grid_widget_a65644f377d72a22e4925ad21fc9ccbf5}{}\index{Grid\+Widget@{Grid\+Widget}!m\+Colors@{m\+Colors}} \index{m\+Colors@{m\+Colors}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{m\+Colors}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Hash$<$int, Q\+Color $>$ Grid\+Widget\+::m\+Colors\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a65644f377d72a22e4925ad21fc9ccbf5} Hash of colors with the painted cells and their colors / Hash de colores con las celdas pintadas y sus colores \hypertarget{class_grid_widget_ab530d1fa7b44c05afe4e70c2e410e579}{}\index{Grid\+Widget@{Grid\+Widget}!m\+Column\+Count@{m\+Column\+Count}} \index{m\+Column\+Count@{m\+Column\+Count}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{m\+Column\+Count}]{\setlength{\rightskip}{0pt plus 5cm}int Grid\+Widget\+::m\+Column\+Count\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_ab530d1fa7b44c05afe4e70c2e410e579} column number / numero de columnas \hypertarget{class_grid_widget_a1b67bb85e389d27e03ef34e4f0b90750}{}\index{Grid\+Widget@{Grid\+Widget}!m\+Grid\+Pix@{m\+Grid\+Pix}} \index{m\+Grid\+Pix@{m\+Grid\+Pix}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{m\+Grid\+Pix}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Pixmap Grid\+Widget\+::m\+Grid\+Pix\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a1b67bb85e389d27e03ef34e4f0b90750} to paint the grid / para pintar la cuadricula \hypertarget{class_grid_widget_a3d818ef6eb5868e53e26e1fd48f19057}{}\index{Grid\+Widget@{Grid\+Widget}!m\+Row\+Count@{m\+Row\+Count}} \index{m\+Row\+Count@{m\+Row\+Count}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{m\+Row\+Count}]{\setlength{\rightskip}{0pt plus 5cm}int Grid\+Widget\+::m\+Row\+Count\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a3d818ef6eb5868e53e26e1fd48f19057} row number / numero de filas \hypertarget{class_grid_widget_a8c84952dfa2f11876ab8f1346667c565}{}\index{Grid\+Widget@{Grid\+Widget}!new\+States@{new\+States}} \index{new\+States@{new\+States}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{new\+States}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Vector$<$ Q\+Hash$<$int, Q\+Color $>$ $>$ Grid\+Widget\+::new\+States\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a8c84952dfa2f11876ab8f1346667c565} vector to implement undo/redo \hypertarget{class_grid_widget_aa41b383c851c5ef1c11871507aa1f28d}{}\index{Grid\+Widget@{Grid\+Widget}!old\+States@{old\+States}} \index{old\+States@{old\+States}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{old\+States}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Vector$<$ Q\+Hash$<$int, Q\+Color $>$ $>$ Grid\+Widget\+::old\+States\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_aa41b383c851c5ef1c11871507aa1f28d} vetor to implement undo/redo \hypertarget{class_grid_widget_a53e89b667667aed308430da93a25b7a1}{}\index{Grid\+Widget@{Grid\+Widget}!Tool@{Tool}} \index{Tool@{Tool}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Tool}]{\setlength{\rightskip}{0pt plus 5cm}Q\+String Grid\+Widget\+::\+Tool\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a53e89b667667aed308430da93a25b7a1} name of the tool selected / nombre de la herramienta seleccionada \hypertarget{class_grid_widget_a48b162752c6e7853b2ce3c6cb8db5661}{}\index{Grid\+Widget@{Grid\+Widget}!Tool\+Size@{Tool\+Size}} \index{Tool\+Size@{Tool\+Size}!Grid\+Widget@{Grid\+Widget}} \subsubsection[{Tool\+Size}]{\setlength{\rightskip}{0pt plus 5cm}int Grid\+Widget\+::\+Tool\+Size\hspace{0.3cm}{\ttfamily [private]}}\label{class_grid_widget_a48b162752c6e7853b2ce3c6cb8db5661} tool size / tamano del a herramienta The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize} \item grid.\+h\item grid.\+cpp\item tools.\+cpp\end{DoxyCompactItemize}