00001
00002
00003
00004
00005 #ifndef OglGui_CheckBoxValueBar_h
00006 #define OglGui_CheckBoxValueBar_h
00007
00008 #ifndef OglGui_CheckBox_h
00009 #include "OglGui/CheckBox.h"
00010 #endif
00011
00012 #include "OglGui/DirectionButton.h"
00013
00014 namespace OglGui {
00015
00016 class CheckBoxValueBar : public Window
00017 {
00018 typedef std::string string;
00019 public:
00020
00021 CheckBoxValueBar(Window* parent, int w, int h, strconst str,
00022 ULONG color, int cbW=120, bool menuBtn=false) :
00023 Window(parent,w,h,true)
00024 {
00025 Init(w,h,str,color,cbW,menuBtn);
00026 }
00027
00028 CheckBoxValueBar(Window* parent,int x, int y, int w, int h, strconst str,
00029 ULONG color, int cbW=120, bool menuBtn=false) :
00030 Window(parent,x,y,w,h,true)
00031 {
00032 Init(w,h,str,color,cbW,menuBtn);
00033 }
00034
00035 string Name() { return mChBox->GetText(); }
00036 void Name(strconst str) { mChBox->SetText(str); }
00037 ULONG Color() { return mChBox->GetBorderBackground();}
00038 bool Selected() { return mChBox->GetSelected(); }
00039 void Selected(bool mode) { mChBox->SetSelected(mode); }
00040 void ValueStr(strconst s) { mValueText->SetText(s); }
00041 string ValueStr() { return mValueText->GetText(); }
00042
00043 CheckBox* ChBox() { return mChBox; }
00044 StaticText* ValueText() { return mValueText; }
00045 Window* ValueBar() { return mValueBar; }
00046 DirectionButton* MenuBtn() { return mMenuBtn; }
00047
00048 private:
00049 CheckBox* mChBox;
00050 StaticText* mValueText;
00051 Window* mValueBar;
00052 DirectionButton* mMenuBtn;
00053
00054 void Init(int w, int h, strconst str, ULONG color, int cbW, bool menu)
00055 {
00056 mChBox = new CheckBox(this,0,0,cbW,h,str,false,BEV_ETCHED);
00057 mChBox->SetRoundedCheck(false);
00058 mChBox->SetBoxFrameType(BEV_ETCHED);
00059 mChBox->SetBorderFillShaded(0);
00060 mChBox->SetBorderBackground(color);
00061 mChBox->SetDoStateFeedback(false);
00062
00063 mMenuBtn = 0;
00064 if (menu)
00065 {
00066 mMenuBtn = new DirectionButton(mChBox,cbW-h+3,3,h-6,h-6,0);
00067 mMenuBtn->SetDirectionFeedback(true);
00068 }
00069
00070 mValueText = new StaticText(this,cbW,0,50,h,"");
00071 mValueText->SetAlign(oglLeftAlign, oglCenterAlign);
00072
00073 mValueBar = new Window(this,cbW+52,2,20,h-4);
00074 mValueBar->SetBackground(color);
00075 mValueBar->SetBorderType(BEV_RAISED);
00076 }
00077 };
00078
00079 }
00080 #endif
00081