Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / Qtx / QtxListAction.cxx
index 440228a24ce3293d9a2f46700050aaa4f7fe112e..84fbed93b90c360b90d052b4aac588f37d7a2bd2 100755 (executable)
@@ -1,3 +1,21 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
 // File:      QtxListAction.cxx
 // Author:    Sergey TELKOV (Based on code by Eugene AKSENOV)
 
@@ -28,10 +46,9 @@ static const char* list_arrow_icon[] = {
 };
 
 /*!
-       Class: QtxListAction::ToolButton
-       Level: Internal
+  \class QtxListAction::ToolButton
+  Custom tool button
 */
-
 class QtxListAction::ToolButton : public QToolButton
 {
 public:
@@ -44,6 +61,9 @@ private:
   QtxListAction* myAction;
 };
 
+/*!
+  Constructor
+*/
 QtxListAction::ToolButton::ToolButton( QtxListAction* a, QWidget* parent, const char* name )
 : QToolButton( parent, name ),
 myAction( a )
@@ -51,12 +71,18 @@ myAction( a )
   setIconSet( QPixmap( list_arrow_icon ) );
 }
 
+/*!
+  Destructor
+*/
 QtxListAction::ToolButton::~ToolButton()
 {
   if ( myAction )
     myAction->controlDeleted( this );
 }
 
+/*!
+  \return the recommended size for the widget
+*/
 QSize QtxListAction::ToolButton::sizeHint() const
 {
   QSize sz = iconSet().pixmap().size();
@@ -64,16 +90,9 @@ QSize QtxListAction::ToolButton::sizeHint() const
 }
 
 /*!
-       Class: QtxListAction
-       Level: Public
+  Constructs an list action with given parent and name. If toggle is true the
+  action will be a toggle action, otherwise it will be a command action.
 */
-
-/*!
-       Name: QtxListAction [public]
-       Desc: Constructs an list action with given parent and name. If toggle is true the
-                   action will be a toggle action, otherwise it will be a command action.
-*/
-
 QtxListAction::QtxListAction( QObject* parent, const char* name, bool toggle )
 : QtxAction( parent, name, toggle ),
 myFrame( 0 ),
@@ -84,12 +103,11 @@ myRaise( false )
 }
 
 /*!
-       Name: QtxListAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                   description text, the icon or iconset icon, the menu text and keyboard
-                   accelerator. It is a child of given parent and named specified name.
-                   If toggle is true the action will be a toggle action, otherwise it will
-                   be a command action.
+  This constructor creates an action with the following properties: the
+  description text, the icon or iconset icon, the menu text and keyboard
+  accelerator. It is a child of given parent and named specified name.
+  If toggle is true the action will be a toggle action, otherwise it will
+  be a command action.
 */
 
 QtxListAction::QtxListAction( const QString& text, const QIconSet& icon,
@@ -104,11 +122,10 @@ myRaise( false )
 }
 
 /*!
-       Name: QtxListAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                 description text, the menu text and keyboard accelerator. It is a child
-                 of given parent and named specified name. If toggle is true the action
-                 will be a toggle action, otherwise it will be a command action.
+  This constructor creates an action with the following properties: the
+  description text, the menu text and keyboard accelerator. It is a child
+  of given parent and named specified name. If toggle is true the action
+  will be a toggle action, otherwise it will be a command action.
 */
 
 QtxListAction::QtxListAction( const QString& text, const QString& menuText,
@@ -122,8 +139,7 @@ myRaise( false )
 }
 
 /*!
-       Name: ~QtxListAction [virtual public]
-       Desc: Destructor.
+  Destructor.
 */
 
 QtxListAction::~QtxListAction()
@@ -155,6 +171,9 @@ void QtxListAction::setPopupMode( const int mode )
   myMode = mode;
 }
 
+/*!
+  \return list of names
+*/
 QStringList QtxListAction::names() const
 {
   QStringList lst;
@@ -487,6 +506,9 @@ void QtxListAction::onExpand( bool on )
     myFrame->hide();
 }
 
+/*!
+  SLOT: called when frame is hidden
+*/
 void QtxListAction::onHided()
 {
   for ( ButtonsMap::Iterator bit = myButtons.begin(); bit != myButtons.end(); ++bit )
@@ -606,12 +628,10 @@ void QtxListAction::controlDeleted( QWidget* wid )
   }
 }
 
-/**********************************************************************
-**  Class:  QtxListFrame
-**  Descr:  Frame for the list of actions
-**  Level:  Internal
-***********************************************************************/
-
+/*!
+  \class QtxListFrame
+  Frame for the list of actions
+*/
 class QtxListFrame::ScrollEvent : public QCustomEvent
 {
 public:
@@ -675,6 +695,9 @@ myScrollBlock( false )
   setFrameStyle( Panel | Raised );
 }
 
+/*!
+  Destructor
+*/
 QtxListFrame::~QtxListFrame()
 {
   if ( myAction )
@@ -691,6 +714,11 @@ void QtxListFrame::clear()
        setNames( myNames );
 }
 
+/*!
+    Adds a names to the list. Truncates the name to fit to the frame width.
+    Use QtxListAction::setMaxLineChar( int ) to set the width in characters. [ public ]
+*/
+  
 void QtxListFrame::addNames( const QStringList& names )
 {
        for ( QStringList::ConstIterator it = names.begin(); it != names.end(); ++it )
@@ -736,6 +764,9 @@ void QtxListFrame::setNames( const QStringList& names )
   }
 }
 
+/*!
+  \return list of names
+*/
 const QStringList QtxListFrame::names() const
 {
        return myNames;
@@ -804,6 +835,10 @@ void QtxListFrame::updateComment()
   myComment->setText( com );
 }
 
+/*!
+  Sets owner
+  \param wo - new owner
+*/
 void QtxListFrame::setOwner( QWidget* wo )
 {
   myOwner = wo;
@@ -987,6 +1022,9 @@ bool QtxListFrame::handleMouseEvent( QObject* o, QMouseEvent* e )
   return true;
 }
 
+/*!
+  Custom event filter
+*/
 bool QtxListFrame::event( QEvent* e )
 {
   if ( e->type() != (int)ScrollEvent::Scroll )
@@ -1071,6 +1109,9 @@ void QtxListFrame::setSelected( const int lastSel )
   updateComment();
 }
 
+/*!
+  return number of selected items
+*/
 int QtxListFrame::selected() const
 {
        uint sel = 0;