00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef MMSSLIDERWIDGET_H_
00034 #define MMSSLIDERWIDGET_H_
00035
00036 #include "mmsgui/mmswidget.h"
00037
00038
00039
00040
00041
00042
00043
00044 class MMSSliderWidget : public MMSWidget {
00045 private:
00046 string className;
00047 MMSSliderWidgetClass *sliderWidgetClass;
00048 MMSSliderWidgetClass mySliderWidgetClass;
00049
00050 bool imagepath_set;
00051 bool selimagepath_set;
00052
00053 bool imagepath_p_set;
00054 bool selimagepath_p_set;
00055
00056 bool imagepath_i_set;
00057 bool selimagepath_i_set;
00058
00059 bool barimagepath_set;
00060 bool selbarimagepath_set;
00061
00062 MMSFBSurface *image;
00063 MMSFBSurface *selimage;
00064 MMSFBSurface *image_p;
00065 MMSFBSurface *selimage_p;
00066 MMSFBSurface *image_i;
00067 MMSFBSurface *selimage_i;
00068
00069 MMSFBSurface *barimage;
00070 MMSFBSurface *selbarimage;
00071
00072 bool vertical;
00073
00074
00075 bool current_fgset;
00076
00077
00078 MMSFBSurface *current_fgimage;
00079
00080
00081 MMSFBSurface *current_fgbarimage;
00082
00083 bool create(MMSWindow *root, string className, MMSTheme *theme);
00084
00085 bool init();
00086 bool release();
00087
00088 void getImage(MMSFBSurface **suf);
00089 void getBarImage(MMSFBSurface **suf);
00090 void calcPos(MMSFBSurface *suf, MMSFBRectangle *surfaceGeom, bool *vertical,
00091 MMSFBSurface *barsuf = NULL, MMSFBRectangle *src_barGeom = NULL, MMSFBRectangle *dst_barGeom = NULL);
00092
00093 void getForeground(MMSFBSurface **image, MMSFBSurface **barimage);
00094 bool enableRefresh(bool enable = true);
00095 bool checkRefreshStatus();
00096
00097 bool draw(bool *backgroundFilled = NULL);
00098 void switchArrowWidgets();
00099
00100 public:
00101 MMSSliderWidget(MMSWindow *root, string className, MMSTheme *theme = NULL);
00102 ~MMSSliderWidget();
00103
00104 MMSWidget *copyWidget();
00105
00106 bool scrollDown(unsigned int count = 1, bool refresh = true, bool test = false, bool leave_selection = false);
00107 bool scrollUp(unsigned int count = 1, bool refresh = true, bool test = false, bool leave_selection = false);
00108 bool scrollRight(unsigned int count = 1, bool refresh = true, bool test = false, bool leave_selection = false);
00109 bool scrollLeft(unsigned int count = 1, bool refresh = true, bool test = false, bool leave_selection = false);
00110
00111 bool scrollTo(int posx, int posy, bool refresh = true, bool *changed = NULL);
00112
00113 sigc::signal<bool, MMSWidget*>::accumulated<neg_bool_accumulator> *onSliderIncrement;
00114 sigc::signal<bool, MMSWidget*>::accumulated<neg_bool_accumulator> *onSliderDecrement;
00115
00116 public:
00117
00118 string getImagePath();
00119 string getImageName();
00120 string getSelImagePath();
00121 string getSelImageName();
00122 string getImagePath_p();
00123 string getImageName_p();
00124 string getSelImagePath_p();
00125 string getSelImageName_p();
00126 string getImagePath_i();
00127 string getImageName_i();
00128 string getSelImagePath_i();
00129 string getSelImageName_i();
00130 unsigned int getPosition();
00131 string getBarImagePath();
00132 string getBarImageName();
00133 string getSelBarImagePath();
00134 string getSelBarImageName();
00135
00136 void setImagePath(string imagepath, bool load = true, bool refresh = true);
00137 void setImageName(string imagename, bool load = true, bool refresh = true);
00138 void setImage(string imagepath, string imagename, bool load = true, bool refresh = true);
00139 void setSelImagePath(string selimagepath, bool load = true, bool refresh = true);
00140 void setSelImageName(string selimagename, bool load = true, bool refresh = true);
00141 void setSelImage(string selimagepath, string selimagename, bool load = true, bool refresh = true);
00142 void setImagePath_p(string imagepath_p, bool load = true, bool refresh = true);
00143 void setImageName_p(string imagename_p, bool load = true, bool refresh = true);
00144 void setImage_p(string imagepath_p, string imagename_p, bool load = true, bool refresh = true);
00145 void setSelImagePath_p(string selimagepath_p, bool load = true, bool refresh = true);
00146 void setSelImageName_p(string selimagename_p, bool load = true, bool refresh = true);
00147 void setSelImage_p(string selimagepath_p, string selimagename_p, bool load = true, bool refresh = true);
00148 void setImagePath_i(string imagepath_i, bool load = true, bool refresh = true);
00149 void setImageName_i(string imagename_i, bool load = true, bool refresh = true);
00150 void setImage_i(string imagepath_i, string imagename_i, bool load = true, bool refresh = true);
00151 void setSelImagePath_i(string selimagepath_i, bool load = true, bool refresh = true);
00152 void setSelImageName_i(string selimagename_i, bool load = true, bool refresh = true);
00153 void setSelImage_i(string selimagepath_i, string selimagename_i, bool load = true, bool refresh = true);
00154 void setPosition(unsigned int pos, bool refresh = true);
00155 void setBarImagePath(string barimagepath, bool load = true, bool refresh = true);
00156 void setBarImageName(string barimagename, bool load = true, bool refresh = true);
00157 void setBarImage(string barimagepath, string barimagename, bool load = true, bool refresh = true);
00158 void setSelBarImagePath(string selbarimagepath, bool load = true, bool refresh = true);
00159 void setSelBarImageName(string selbarimagename, bool load = true, bool refresh = true);
00160 void setSelBarImage(string selbarimagepath, string selbarimagename, bool load = true, bool refresh = true);
00161
00162 void updateFromThemeClass(MMSSliderWidgetClass *themeClass);
00163 };
00164
00165 #endif