00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <vos/corelibs/vos/vos.hh>
00024 #include <vos/metaobjects/property/property.hh>
00025 #include "input_numeric_slider.hh"
00026
00027 using namespace VOSGUI;
00028
00029
00030 SliderNumericInput::SliderNumericInput(MetaObject* s) : NumericInput(s),
00031 Input(s), Widget(s), MetaObject(s)
00032 {
00033 }
00034
00035
00036 SliderNumericInput::~SliderNumericInput() {
00037 }
00038
00039
00040 LocalSliderNumericInput::LocalSliderNumericInput(MetaObject* s) :
00041 SliderNumericInput(s), LocalNumericInput(s), NumericInput(s), LocalInput(s),
00042 Input(s), LocalWidget(s), Widget(s), MetaObject(s)
00043 {
00044 }
00045
00046 LocalSliderNumericInput::~LocalSliderNumericInput() {
00047 }
00048
00049
00050
00051 void LocalSliderNumericInput::initialize(PropertyAccessControl* ac) {
00052 LocalNumericInput::initialize(ac);
00053 }
00054
00055
00056
00057 RemoteSliderNumericInput::RemoteSliderNumericInput(MetaObject* s) :
00058 SliderNumericInput(s), RemoteNumericInput(s), NumericInput(s),
00059 RemoteInput(s), Input(s), RemoteWidget(s), Widget(s), MetaObject(s)
00060 {
00061
00062 }
00063
00064 RemoteSliderNumericInput::~RemoteSliderNumericInput() {
00065 }
00066
00067
00068
00069 const string SliderNumericInput::getType() {
00070 return string("gui:widget.input.numeric.slider");
00071 }
00072
00073
00074 void SliderNumericInput::registerExtenders() {
00075 LocalSite::addLocalObjectExtension(typeid(LocalSliderNumericInput).name(), &LocalSliderNumericInput::new_LocalSliderNumericInput);
00076 LocalSite::addLocalObjectExtension(typeid(SliderNumericInput).name(), &LocalSliderNumericInput::new_LocalSliderNumericInput);
00077 LocalSite::addLocalObjectExtension("gui:widget.input.numeric.slider", &LocalSliderNumericInput::new_LocalSliderNumericInput);
00078 RemoteSite::addRemoteObjectExtension(typeid(RemoteSliderNumericInput).name(), &RemoteSliderNumericInput::new_RemoteSliderNumericInput);
00079 RemoteSite::addRemoteObjectExtension(typeid(SliderNumericInput).name(), &RemoteSliderNumericInput::new_RemoteSliderNumericInput);
00080 RemoteSite::addRemoteObjectExtension("gui:widget.input.numeric.slider", &RemoteSliderNumericInput::new_RemoteSliderNumericInput);
00081 }
00082
00083
00084
00085 string SliderNumericInput::getOrientation() {
00086 string s;
00087 try {
00088 vRef<Vobject> v = &findObject("gui:orientation");
00089 Property* p = meta_cast<Property*>(&v);
00090 if(!p) throw bad_cast();
00091 p->read(s);
00092 } catch(...) {
00093 s = "vertical";
00094 }
00095 return s;
00096 }
00097
00098 void SliderNumericInput::setOrientation(const string& value, PropertyAccessControl* ac) {
00099 if(!ac) ac = accessControl;
00100 Property::setProperty(*this, "gui:orientation", value, "text/plain", ac);
00101 }
00102
00103 Property* SliderNumericInput::getOrientationObject() {
00104 return meta_cast<Property*>(&findObject("gui:orientation"));
00105 }
00106
00107 void SliderNumericInput::setOrientationObject(Property* newobj) {
00108 try {
00109 vRef<ParentChildRelation> pcr = findChild("gui:orientation");
00110 setChild(pcr->position, "gui:orientation", newobj);
00111 } catch (NoSuchObjectError) {
00112 insertChild(-1, "gui:orientation", newobj);
00113 }
00114 }
00115
00116 bool SliderNumericInput::getShowLabels() {
00117 return Property::getBoolProperty(*this, "gui:show-labels", true);
00118 }
00119
00120 void SliderNumericInput::setShowLabels(bool value, PropertyAccessControl* ac) {
00121 if(!ac) ac = accessControl;
00122 Property::setBoolProperty(*this, "gui:show-labels", value, ac);
00123 }
00124
00125 Property* SliderNumericInput::getShowLabelsObject() {
00126 return meta_cast<Property*>(&findObject("gui:show-labels"));
00127 }
00128
00129 void SliderNumericInput::setShowLabelsObject(Property* newobj) {
00130 try {
00131 vRef<ParentChildRelation> pcr = findChild("gui:show-labels");
00132 setChild(pcr->position, "gui:show-labels", newobj);
00133 } catch (NoSuchObjectError) {
00134 insertChild(-1, "gui:show-labels", newobj);
00135 }
00136 }
00137
00138
00139
00140
00141
00142 MetaObject* LocalSliderNumericInput::new_LocalSliderNumericInput(MetaObject *s, const string& type) {
00143 LocalSliderNumericInput* o = new LocalSliderNumericInput(s);
00144 return o;
00145 }
00146
00147 MetaObject* RemoteSliderNumericInput::new_RemoteSliderNumericInput(MetaObject *s, const string& type) {
00148 return new RemoteSliderNumericInput(s);
00149 }
00150