From 83fa02412b33fc46e4c48963fa1271d5d2cd7a15 Mon Sep 17 00:00:00 2001
From: Tobias Schmidt <tobias.schmidt@unibas.ch>
Date: Tue, 17 May 2011 18:08:16 +0200
Subject: [PATCH] add documentation for ToolOptions, removed debug stuff

---
 modules/gui/doc/tools.rst            | 96 +++++++++++++++++++++++++++-
 modules/gui/src/tools/tool_option.cc |  5 --
 modules/gui/src/tools/tool_option.hh |  3 -
 3 files changed, 95 insertions(+), 9 deletions(-)

diff --git a/modules/gui/doc/tools.rst b/modules/gui/doc/tools.rst
index 9c0da468b..1b652f211 100644
--- a/modules/gui/doc/tools.rst
+++ b/modules/gui/doc/tools.rst
@@ -74,4 +74,98 @@ The example `Write a Tool in Python` demonstrates how to add a simple tool
 
        
     :rtype: :class:`ToolOptions`
-
+    
+    
+.. class:: ToolOption
+  
+  Currently, there are four different types of ToolOption which can be used to
+  build up your own tool. They will automatically generate the appropriate
+  QT widgets:
+  
+  * :class:`ToolOptionInt` generates a QLineEdit of integer type
+  * :class:`ToolOptionFloat` generates a QLineEdit of float type
+  * :class:`ToolOptionEnum` generates a QComboBox
+  * :class:`ToolOptionButton` generates a QPushButton
+  
+.. class:: ToolOptionInt(key, verbose_name, default_value, min_value, max_value)
+  
+  :param key: Internal key name
+  :type  name: str
+  :param verbose_name: Name used as label in the widget
+  :type  name: str
+  :param default_value: Default value
+  :param min_value: Minimum allowed value
+    Defaults to minimum possible value
+  :param max_value: Maximum allowed value
+    Defaults to maximum possible value
+    
+  .. method:: GetDefault()
+  
+  .. method:: GetUpperLimit()
+  
+  .. method:: GetLowerLimit()
+  
+  .. method:: GetValue()
+  
+  .. method:: SetValue(value)
+
+
+.. class:: ToolOptionFloat(key, verbose_name, default_value, min_value, max_value)
+  
+  :param key: Internal key name
+  :type  name: str
+  :param verbose_name: Name used as label in the widget
+  :type  name: str
+  :param default_value: Default value
+  :param min_value: Minimum allowed value
+    Defaults to minimum possible value
+  :param max_value: Maximum allowed value
+    Defaults to maximum possible value
+    
+  .. method:: GetDefault()
+  
+  .. method:: GetUpperLimit()
+  
+  .. method:: GetLowerLimit()
+  
+  .. method:: GetValue()
+  
+  .. method:: SetValue(value)
+
+.. class:: ToolOptionEnum(key, verbose_name)
+
+  :param key: Internal key name
+  :type  name: str
+  :param verbose_name: Name used as label in the widget
+  :type  verbose_name: str
+  
+  .. method:: Add(text, tag)
+  
+    :param text: Text in dropdown menu
+    :type text: str
+    :param tag: Index in dropdown menu
+    :type tag: int
+  
+  .. method:: SetIndex(index)
+  
+    :type index: int
+  
+  .. method:: GetIndex()
+  .. method:: GetValue()
+  
+  .. method:: Begin()
+  .. method:: End()
+  .. method:: Size()
+  
+.. class:: ToolOptionButton(key, verbose_name, QObject* receiver,
+                   const char *slot_method)
+  
+  :param key: Internal key name
+  :type  name: str 
+  :param verbose_name: Name used as label in the widget
+  :type  name: str 
+  :param slot_method: Name of slot method that should be invoked upon releasing the buton
+  :type slot_method: const char *
+  :param receiver: QObject that implements the slot method
+  :type receiver: QObject *
+  
\ No newline at end of file
diff --git a/modules/gui/src/tools/tool_option.cc b/modules/gui/src/tools/tool_option.cc
index 8f54a6c06..542c99ccd 100644
--- a/modules/gui/src/tools/tool_option.cc
+++ b/modules/gui/src/tools/tool_option.cc
@@ -68,9 +68,4 @@ ToolOptionButton::ToolOptionButton(const String& key,
 
 }
 
-void ToolOptionButton::RunMe()
-{
-  std::cout << "TOOL RUN ME RUN ME" << std::endl;
-}
-
 }}
diff --git a/modules/gui/src/tools/tool_option.hh b/modules/gui/src/tools/tool_option.hh
index ac035559e..7851000cd 100644
--- a/modules/gui/src/tools/tool_option.hh
+++ b/modules/gui/src/tools/tool_option.hh
@@ -124,7 +124,6 @@ private:
 };
 
 class DLLEXPORT_OST_GUI ToolOptionButton : public ToolOption {
-  Q_OBJECT
 public:
   ToolOptionButton(const String& key,
                    const String& verbose_name,
@@ -132,8 +131,6 @@ public:
                    const char *slot_method);
   const char* GetSlotMethod() const { return slot_method_; }
   QObject* GetReceiver() const { return receiver_; }
-public slots:
-  void RunMe();
 private:
   const char *slot_method_;
   QObject* receiver_;
-- 
GitLab