diff options
Diffstat (limited to 'plugins/Skins/SkinLib/Field.cpp')
-rw-r--r-- | plugins/Skins/SkinLib/Field.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/Skins/SkinLib/Field.cpp b/plugins/Skins/SkinLib/Field.cpp new file mode 100644 index 0000000000..24b823bde6 --- /dev/null +++ b/plugins/Skins/SkinLib/Field.cpp @@ -0,0 +1,56 @@ +#include "globals.h"
+#include "Field.h"
+#include "FieldState.h"
+
+
+Field::Field(Dialog *aDlg, const char *aName)
+ : dlg(aDlg), name(aName), onChangeCallback(NULL), onChangeCallbackParam(NULL), enabled(true)
+{
+}
+
+Field::~Field()
+{
+}
+
+Dialog * Field::getDialog() const
+{
+ return dlg;
+}
+
+const char * Field::getName() const
+{
+ return name.c_str();
+}
+
+bool Field::isEnabled() const
+{
+ return enabled;
+}
+
+void Field::setEnabled(bool enabled)
+{
+ this->enabled = enabled;
+ fireOnChange();
+}
+
+const TCHAR * Field::getToolTip() const
+{
+ return tooltip.c_str();
+}
+
+void Field::setToolTip(const TCHAR *tooltip)
+{
+ this->tooltip = tooltip;
+}
+
+void Field::setOnChangeCallback(FieldCallback cb, void *param /*= NULL*/)
+{
+ onChangeCallback = cb;
+ onChangeCallbackParam = param;
+}
+
+void Field::fireOnChange() const
+{
+ if (onChangeCallback != NULL)
+ onChangeCallback(onChangeCallbackParam, this);
+}
|