a->setStatusTip( tip );
if ( reciever && member )
- connect( a, SIGNAL( activated() ), reciever, member );
+ connect( a, SIGNAL( triggered( bool ) ), reciever, member );
registerAction( id, a );
createMenu( RenameId, windowMenu, -1 );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
- createMenu( PreferencesId, fileMenu, 15, -1 );
- createMenu( separator(), fileMenu, -1, 15, -1 );
+ createMenu( PreferencesId, fileMenu, 50, -1 );
+ createMenu( separator(), fileMenu, -1, 50, -1 );
/*
createMenu( separator(), fileMenu, -1, 100, -1 );
#include <QWidget>
#include <QMainWindow>
-// VSR: Uncomment this #define in order to allow dynamic menus support
-// (emit signals when popup menu is pre-activated)
-// Currently this support is disabled.
-//#define ENABLE_DYNAMIC_MENU
-
/*!
\class QtxActionMenuMgr::MenuNode
\internal
{
if ( myMenu ) {
connect( myMenu, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-#ifdef ENABLE_DYNAMIC_MENU
- if ( myMenu->inherits( "QMenuBar" ) )
- connect( myMenu, SIGNAL( hovered( QAction* ) ), this, SLOT( onHighlighted( QAction* ) ) );
-#endif
}
}
{
if ( myMenu ) {
connect( myMenu, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-#ifdef ENABLE_DYNAMIC_MENU
- if ( myMenu->inherits( "QMenuBar" ) )
- connect( myMenu, SIGNAL( hovered( QAction* ) ), this, SLOT( onHighlighted( QAction* ) ) );
-#endif
}
}
connect( ma->menu(), SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
connect( ma->menu(), SIGNAL( aboutToHide() ), this, SLOT( onAboutToHide() ) );
-#ifdef ENABLE_DYNAMIC_MENU
- connect( ma->menu(), SIGNAL( hovered( QAction* ) ), this, SLOT( onHighlighted( QAction* ) ) );
-#endif
MenuNode* node = new MenuNode( pNode, myMenus.insert( gid, ma ).key(), idx, group );
myMenu = 0;
}
-/*!
- \brief Called when menu item is highlighted.
- \param id menu item being highlighted ID
-*/
-void QtxActionMenuMgr::onHighlighted( QAction* a )
-{
- const QObject* snd = sender();
- int pid = 0;
- if ( myMenu && snd == myMenu )
- pid = -1;
- else
- {
- for ( MenuMap::Iterator itr = myMenus.begin(); itr != myMenus.end(); ++itr )
- {
- if ( itr.value()->menu() && itr.value()->menu() == snd )
- pid = itr.key();
- }
- }
- if ( pid )
- {
- int realId = menuActionId( a );
- if ( realId != -1 )
- {
- emit menuHighlighted( pid, realId );
- triggerUpdate( realId );
- }
- }
-}
-
/*!
\brief Returns the menu widget.
*/
return (bool)find( id, pid, false );
}
+/*!
+ \brief Get menu by the specified identifier.
+ \param id menu item ID
+ \return \c menu poiter or 0 if menu is not found
+*/
+QMenu* QtxActionMenuMgr::findMenu( const int id ) const
+{
+ QMenu* m = 0;
+ QAction* a = menuAction( id );
+ if ( a )
+ m = a->menu();
+ return m;
+}
+
/*!
\brief Perform delayed menu update.
\param id menu item ID
\brief Emitted when the menu is about to be hidden.
\param m menu being hidden
*/
-
-/*!
- \fn void QtxActionMenuMgr::menuHighlighted( int, int )
- \brief Emitted when the menu is hightlighted [obsolete].
-*/
bool containsMenu( const QString&, const int ) const;
bool containsMenu( const int, const int ) const;
+ QMenu* findMenu( const int ) const;
+
private slots:
void onAboutToShow();
void onAboutToHide();
- void onHighlighted( QAction* );
void onDestroyed( QObject* );
signals:
void menuAboutToShow( QMenu* );
void menuAboutToHide( QMenu* );
- void menuHighlighted( int, int );
-
protected:
void setMenuWidget( QWidget* );
createMenu( FileNewId, fileMenu, 0 );
createMenu( FileOpenId, fileMenu, 0 );
- createMenu( FileCloseId, fileMenu, 0 );
- createMenu( separator(), fileMenu, -1, 0 );
- createMenu( FileSaveId, fileMenu, 0 );
- createMenu( FileSaveAsId, fileMenu, 0 );
- createMenu( separator(), fileMenu, -1, 0 );
+ createMenu( FileCloseId, fileMenu, 5 );
+ createMenu( separator(), fileMenu, -1, 5 );
+ createMenu( FileSaveId, fileMenu, 5 );
+ createMenu( FileSaveAsId, fileMenu, 5 );
+ createMenu( separator(), fileMenu, -1, 5 );
createMenu( separator(), fileMenu );
createMenu( FileExitId, fileMenu );
createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load"
createMenu( DumpStudyId, fileMenu, 10, -1 );
- createMenu( separator(), fileMenu, -1, 15, -1 );
+ createMenu( separator(), fileMenu, -1, 10, -1 );
createMenu( LoadScriptId, fileMenu, 10, -1 );
- createMenu( separator(), fileMenu, -1, 15, -1 );
+ createMenu( separator(), fileMenu, -1, 10, -1 );
createMenu( PropertiesId, fileMenu, 10, -1 );
- createMenu( separator(), fileMenu, -1, 15, -1 );
+ createMenu( separator(), fileMenu, -1, 10, -1 );
int toolsMenu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, MenuToolsId, 50 );
createMenu( CatalogGenId, toolsMenu, 10, -1 );
class ToolsGUI_IntervalWindow;
class ToolsGUI_InfoWindow;
-public:
ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent = 0 );
+
+public:
~ToolsGUI_RegWidget();
void SetListe();