Main Page | Class Hierarchy | Class List | File List | Class Members

aedSlider.h

00001 
00002 /*
00003  * The aedSlider class
00004  * This class draws a slider.
00005  * Initial design by Eduardo B. Fonseca <ebf@aedsolucoes.com.br>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the Free
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 #ifndef AEDSLIDER_H
00024 #define AEDSLIDER_H
00025 
00026 #include "aedWidget.h"
00027 
00028 // How to document enums?
00029 
00030 typedef enum
00031 {
00032     AED_HORIZONTAL,
00033     AED_VERTICAL
00034 } aedOrientation;
00035 
00038 class DLLEXPORT aedSlider:public aedWidget
00039 {
00040   public:
00041 
00044     aedSlider(aedOrientation orient = AED_VERTICAL);
00045     virtual ~ aedSlider();
00046 
00047     virtual int wm_update(Uint32 msdelta);
00048     virtual int wm_lbuttonup(Uint16 x, Uint16 y);
00049     virtual int wm_lbuttondown(Uint16 x, Uint16 y);
00050     virtual void render(void);
00051 
00053     void setValue(Uint32 val);
00054 
00056     Uint32 getValue() const
00057     {
00058         return m_Value;
00059     }
00060 
00064     void setRange(Uint32 minval, Uint32 maxval);
00065 
00070     void getRange(Uint32 * minval, Uint32 * maxval) const
00071     {
00072         if(minval)
00073             *minval = m_Min;
00074         if(maxval)
00075             *maxval = m_Max;
00076     }
00077 
00078     Uint32 getBigChange() const
00079     {
00080         return m_BigChange;
00081     }
00082 
00084     void setBigChange(Uint32 bigchange);
00085 
00087     aedOrientation getOrientation() const
00088     {
00089         return m_Orientation;
00090     }
00091 
00095     void setOrientation(aedOrientation orient)
00096     {
00097         if(orient != m_Orientation)
00098         {
00099             m_Orientation = orient;
00100             setRenderState(true);
00101         }
00102     }
00103 
00106     void incrementValue(bool bigChange = false);
00107 
00110     void decrementValue(bool bigChange = false);
00111 
00112     aedRect getElevatorRect();
00113 
00114   protected:
00115     bool m_Dragging;
00116 
00117   private:
00118     Uint32 m_Min, m_Max, m_Value;
00119     Uint32 m_BigChange;
00120     aedOrientation m_Orientation;       // horizontal or vertical
00121 };
00122 
00123 #if defined(_MSC_VER)
00124 DLLEXTERN template DLLEXPORT aedFunctor1Arg < stub, aedSlider >;
00125 #endif
00126 
00127 #endif /* AEDSLIDER_H */

Generated on Mon Mar 1 19:56:18 2004 for aedGUI by doxygen 1.3.6