void Browse::setEditorDLL( const char * dll ) //------------------------------------------- { WString errMsg; bool enable; // the Goto-Definition item is enabled iff the Show-Detail is enable = menuManager()->menuEnabled( MIMenuID( MMDetail, DMDetail ) ); _editorDLLName = dll; delete _editorDLL; _editorDLL = new WEditDLL; _editorDLL->LoadDll( _editorDLLName, &errMsg ); if( !_editorDLL->isInitialized() ) { WMessageDialog::messagef( this, MsgError, MsgOk, BrowseTitle, errMsg.gets() ); delete _editorDLL; _editorDLL = NULL; enable = false; } menuManager()->enableMenu( MIMenuID( MMDetail, DMDefinition ), enable ); }
void GlobalViewList::findFirst() //------------------------------ { Symbol * sym; BusyNotice busy( "Searching..." ); if( _queryConfig->process() ) { for( _lastFound = 0; ; _lastFound ++ ) { sym = getSymbol( _lastFound ); if( sym == NULL || _findFilter->matches( sym ) ) { break; } } if( sym == NULL ) { errMessage( "Matching symbol not found" ); menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), false ); _lastFound = -1; } else { select( _lastFound ); menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), true ); } } }
void Outline::findNext() //---------------------- { BusyNotice busy( "Searching..." ); OutlineElement * elm; int i; elm = _findStack->removeLast(); while( elm != NULL ) { _findStack->append( elm ); if( elm->_child ) { elm = elm->_child; } else { elm = _findStack->removeLast(); // remove self from stack -- done while( elm->_lastSib ) { // remove finished parents elm = _findStack->removeLast(); } elm = elm->_sibling; } if( elm && _findFilter->matches( elm->symbol() ) ) { _findStack->append( elm ); break; } } if( !elm ) { errMessage( "Not Found" ); // FIXME -- not an error, don't use errMessage _findStack->clear(); menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), false ); } else { // expand all the parent nodes of this one (they are stored // in the find stack), but don't expand this node itself for( i = _findStack->entries() - 1; i > 0; i -= 1 ) { (*_findStack)[ i - 1 ]->expand( false ); } for( i = 0; i < count(); i += 1 ) { if( elm == element( i ) ) { select( i ); } } resetCache(); reset(); scrollToSelected(); menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), true ); } }
void GlobalViewList::changed( WWindow * ) //--------------------------------------- { int sel = selected(); bool enable = false; Symbol * sym = getSymbol( sel ); if( sym ) { enable = true; } menuManager()->enableMenu( MIMenuID( MMDetail, DMDetail ), enable ); menuManager()->enableMenu( MIMenuID( MMDetail, DMDefinition ), enable && browseTop->canEdit() ); menuManager()->enableMenu( MIMenuID( MMDetail, DMReferences ), enable ); menuManager()->enableMenu( MIMenuID( MMDetail, DMUsers ), enable ); menuManager()->enableMenu( MIMenuID( MMLocate, LMFindSelected ), enable ); }
Outline::Outline( const char * text ) : HotWindowList( text ) , GlobalViewTree( menuManager() ) , _findStack( NULL ) //---------------------------------------------------------------- { _sentinel = new OutlineElement; _queryConfig = new QueryConfig( this, "Find" ); _findFilter = new KeySymbol; _loadFilter = new KeySymbol( WBRWinBase::optManager()->getQueryFilt() ); onHotPress( this, (cbw) &Outline::toggleExpand ); onDblClick( this, (cbw) &Outline::detailView ); onChanged( this, (cbw) &Outline::changed ); menuManager()->trackPopup( this, MMTree ); viewManager()->registerForEvents( this ); resetCache(); }
DTViewSymbol::DTViewSymbol( const Symbol * sym, bool box ) : WBRWindow( "" ) , ViewSymbolDlg( topWindow ) , _useBox( box ) //---------------------------------------------------------------- { _symbol = Symbol::defineSymbol( sym ); // my own copy initialize(); setIcon( DetailIcons[ _symbol->symtype() ] ); menuManager()->trackPopup( this, MMDetail ); }
void DTViewSymbol::setMenus( MenuManager * mgr ) //---------------------------------------------- { int i; for( i = 0; i < NumViewSymMenus; i += 1 ) { mgr->registerForMenu( this, ViewSymMenus[ i ] ); } menuManager()->enableMenu( MIMenuID( MMDetail, DMDefinition ), browseTop->canEdit() ); }
void GlobalViewList::setMenus( MenuManager * mgr ) //------------------------------------------------ { int i; for( i = 0; i < NumListMenus; i += 1 ) { mgr->registerForMenu( this, ListMenus[ i ] ); } menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), false ); changed( NULL ); // disable menus }
void Outline::setMenus( MenuManager * mgr ) //-------------------------------------------- { int i; for( i = 0; i < NumOutlineMenus; i += 1 ) { mgr->registerForMenu( this, OutlineMenus[ i ] ); } menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), false ); GlobalViewTree::setMenus( mgr ); // NYI changed( NULL ); // disable menus }
void GlobalViewList::findNext() //----------------------------- { Symbol * sym; BusyNotice busy( "Searching..." ); ASSERTION( _lastFound >= 0 ); for( _lastFound += 1; ; _lastFound += 1 ) { sym = getSymbol( _lastFound ); if( sym == NULL || _findFilter->matches( sym ) ) { break; } } if( sym == NULL ) { errMessage( "No more matching symbols" ); menuManager()->enableMenu( MIMenuID(MMLocate,LMFindNext), false ); _lastFound = -1; } else { select( _lastFound ); } }
void Browse::setupMenus() //----------------------- { int i; menuManager()->setupMenus( this ); for( i = 0; i < NumBrowseMenus; i += 1 ) { menuManager()->registerForMenu( this, BrowseMenus[ i ] ); } viewManager()->setMenus( menuManager() ); optManager()->setMenus( menuManager() ); dbManager()->setMenus( menuManager() ); menuManager()->registerForViewEvents( viewManager() ); viewManager()->enableMenus( false ); }
void ProjectMenu::deactivated() { menuManager()->removeActivation(this); }
void ProjectMenu::activated() { menuManager()->addActivation(this); }