Пример #1
0
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 );
        }
    }
}
Пример #2
0
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 );
}
Пример #3
0
void DTViewClass::unsetMenus( MenuManager * mgr )
//-----------------------------------------------
{
    DTViewSymbol::unsetMenus( mgr );

#ifdef DETAIL_STUFF_IMPLEMENTED
    mgr->unRegister( MIMenuID( MMDetail, DMInheritance ) );
    mgr->unRegister( MIMenuID( MMDetail, DMStructure ) );
#endif
}
Пример #4
0
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 );
    }
}
Пример #5
0
void DTViewFunction::unsetMenus( MenuManager * mgr )
//----------------------------------------------
{
    DTViewSymbol::unsetMenus( mgr );

#ifdef DETAIL_STUFF_IMPLEMENTED
    mgr->unRegister( MIMenuID( MMDetail, DMCalls ) );
#endif
}
Пример #6
0
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 );
}
Пример #7
0
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() );
}
Пример #8
0
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
}
Пример #9
0
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
}
Пример #10
0
void GlobalViewTree::selChange()
//------------------------------
{
    ExpandState st = state();

    _menuManager->enableMenu( MIMenuID( MMDetail, DMDetail ),
                              (st != NoSymbol) );
    _menuManager->enableMenu( MIMenuID( MMDetail, DMDefinition ),
                              (st != NoSymbol) && browseTop->canEdit() );
    _menuManager->enableMenu( MIMenuID( MMDetail, DMReferences ),
                              (st != NoSymbol) );
    _menuManager->enableMenu( MIMenuID( MMDetail, DMUsers ),
                              (st != NoSymbol) );
    _menuManager->enableMenu( MIMenuID( MMLocate, LMFindSelected ),
                              (st != NoSymbol) );
    _menuManager->enableMenu( MIMenuID( MMTree, TMExpandBranch ),
                              st != NoSymbol );
    _menuManager->enableMenu( MIMenuID( MMTree, TMCollapseBranch ),
                              (st != NoSymbol ) );

    _menuManager->enableMenu( MIMenuID( MMTree, TMExpandOne ),
                              (st == Collapsed ) );
}
Пример #11
0
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 );
    }
}
Пример #12
0
        _symbolBox->show();
        _symbolBox->setFocus();

        height += __frame.r.h() - _symbolBoxR.r.y();    // this include 2 * dialogFrameHeight
    }


    width += 2 * WSystemMetrics::dialogFrameWidth();
    height += WSystemMetrics::captionSize();

    size( width, height );
    show();
}

static MIMenuID ViewSymMenus[] = {
    MIMenuID( MMDetail, DMDefinition ),
    MIMenuID( MMDetail, DMReferences ),
    MIMenuID( MMDetail, DMUsers )
};

#define NumViewSymMenus ( sizeof(ViewSymMenus) / sizeof(MIMenuID) )

void DTViewSymbol::setMenus( MenuManager * mgr )
//----------------------------------------------
{
    int i;

    for( i = 0; i < NumViewSymMenus; i += 1 ) {
        mgr->registerForMenu( this, ViewSymMenus[ i ] );
    }
Пример #13
0
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


#include "browse.h"
#include "gbvtrbas.h"
#include "view.h"
#include "menuids.h"
#include "menumgr.h"
#include "symbol.h"

static MIMenuID WantTreeMenus[] = {
    MIMenuID( MMDetail, DMDetail ),
    MIMenuID( MMDetail, DMDefinition ),
    MIMenuID( MMDetail, DMReferences ),
    MIMenuID( MMDetail, DMUsers ),

    MIMenuID( MMLocate, LMFindSelected ),
    MIMenuID( MMTree,   TMRoots ),
    MIMenuID( MMTree,   TMArrangeAll ),
    MIMenuID( MMTree,   TMExpandOne ),
    MIMenuID( MMTree,   TMExpandBranch ),
    MIMenuID( MMTree,   TMExpandAll ),
    MIMenuID( MMTree,   TMCollapseBranch ),
    MIMenuID( MMTree,   TMCollapseAll ),
};

#define NumWantTreeMenus ( sizeof( WantTreeMenus ) / sizeof( MIMenuID ) )
Пример #14
0
void ViewManager::kill()
//----------------------
{
    int         i;

    for( i = _killList->entries(); i > 0; --i ) {
        View *tmp = (*_killList)[i-1];
        _killList->removeLast();
        delete tmp;
    }
}


static MIMenuID ViewManagerMenus[] = {
    MIMenuID( MMView,           VMList ),
    MIMenuID( CMViewInherit,    VMInheritTree ),
    MIMenuID( CMViewInherit,    VMInheritOutline ),
    MIMenuID( CMViewCall,       VMCallTree ),
    MIMenuID( CMViewCall,       VMCallOutline ),
};

#define NumViewMgrMenus ( sizeof( ViewManagerMenus ) / sizeof( MIMenuID ) )

void ViewManager::setMenus( MenuManager * mgr )
//---------------------------------------------
{
    int i;

    _menuManager = mgr;
Пример #15
0
        query();
        break;
    default:
        NODEFAULT;
    }
}

ViewEvent Outline::wantEvents()
//-----------------------------
{
    return VEQueryFiltChange | VEBrowseFileChange;
}


static MIMenuID OutlineMenus[] = {
    MIMenuID( MMLocate, LMFind ),
    MIMenuID( MMLocate, LMFindNext ),
};

#define NumOutlineMenus (sizeof(OutlineMenus) / sizeof(MIMenuID) )

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 );
Пример #16
0
        case VEBrowseFileChange:
        case VEQueryFiltChange:
            reLoad();
            break;
        }
    }
}

ViewEvent GlobalViewList::wantEvents()
//------------------------------------
{
    return VEBrowseFileChange | VEQueryFiltChange | VEClose | VECreate;
}

static MIMenuID ListMenus[] = {
    MIMenuID( MMDetail, DMDetail ),
    MIMenuID( MMDetail, DMDefinition ),
    MIMenuID( MMDetail, DMUsers ),
    MIMenuID( MMDetail, DMReferences ),

    MIMenuID( MMLocate, LMFind ),
    MIMenuID( MMLocate, LMFindNext ),
    MIMenuID( MMLocate, LMFindSelected ),
};

#define NumListMenus (sizeof(ListMenus) / sizeof(MIMenuID) )

void GlobalViewList::setMenus( MenuManager * mgr )
//------------------------------------------------
{
    int i;
Пример #17
0
#ifdef REPORT_IMPLEMENTED
#  include "reportdg.h"
#endif

#include "browse.h"

#include <stdlib.h>
#include <string.h>

Browse  * browseTop = NULL;
WWindow * topWindow = browseTop;

static MIMenuID BrowseMenus[] = {
#if REPORT_IMPLEMENTED
    MIMenuID( MMFile, FMReport ),
#endif
    MIMenuID( MMFile, FMExit ),
    MIMenuID( MMHelp, HMContents ),
    MIMenuID( MMHelp, HMSearch ),
    MIMenuID( MMHelp, HMUsingHelp ),
    MIMenuID( MMHelp, HMAbout ),
};

#define _BrowseHelpFile     "wbrw.hlp"
#define _BrowseHtmlHelpFile "wbrw.chm"

#define NumBrowseMenus ( sizeof( BrowseMenus ) / sizeof( MIMenuID ) )

#pragma warning 438 9
static const char *BrowseTitle = { "About Open Watcom Source Browser" };