Exemplo n.º 1
0
void ViewManager::showDetailView( const Symbol * sym, DetailView::ViewType vt )
//-----------------------------------------------------------------------------
{
    DetailView * dtv;

    dtv = findDetailView( sym, vt );

    if( !dtv ) {
        dtv = DetailView::createView( sym, vt );

        #if DEBUG   // FIXME -- TAKE OUT AS SOON AS TEXTREE, STRUCVIEW ARE VIEWS
        if( dtv == NULL ) {
            return;
        }
        #endif

        _detailViews->append( dtv );

        eventOccured( VECreate, dtv );
        eventOccured( VEGettingFocus, dtv );
    }

    REQUIRE( dtv != NULL, "ViewManager::showDetailView -- dtv == NULL" );

    dtv->showWin( WWinStateShowNormal );
    dtv->setFocusWin();
}
Exemplo n.º 2
0
void GlobalViewList::event( ViewEvent ve, View * view )
//-----------------------------------------------------
{
    if( ve == VEClose || ve == VECreate ) {
        if( view->identity() == VIDetailView ) {
            int             i;
            int             maxRows = getRows() + _topIndex;
            DetailView *    dtv = (DetailView *) view;
            drmem_hdl       drhdl = dtv->symHandle();

            for( i = _topIndex; i < maxRows; i += 1 ) {
                Symbol * sym = getSymbol( i );

                if( sym == NULL ) {
                    break;
                }
                if( drhdl == sym->getHandle() ) {
                    invalidateRow( i - _topIndex );
                    break;
                }
            }
        }
    } else {
        switch( ve ) {
        case VEBrowseFileChange:
        case VEQueryFiltChange:
            reLoad();
            break;
        }
    }
}
Exemplo n.º 3
0
DetailView * ViewManager::findDetailView( dr_handle hdl, DetailView::ViewType vt )
//--------------------------------------------------------------------------------
{
    int             i;
    DetailView *    testView;

    for( i = 0; i < _detailViews->entries(); i += 1 ) {
        testView = (*_detailViews)[ i ];

        if( ( testView->symHandle() == hdl ) && ( testView->viewType() == vt ) ) {
            return testView;
        }
    }

    return NULL;
}
Exemplo n.º 4
0
static PyObject *show_detail(PyObject *, PyObject *args)
{
    PyObject *dict = NULL;
    if (!PyArg_ParseTuple(args, "O", &dict))
        return NULL;
    DetailView *detailview;
    if (webvideo->count() == 4) // DetailView page has been created
        detailview = static_cast<DetailView*>(webvideo->widget(3));
    else
    {
        detailview = new DetailView(res_library);
        webvideo->addTab(detailview, "");
    }
    PyObject *retVal = detailview->loadDetail(dict);
    webvideo->setCurrentWidget(detailview);
    webvideo->setTabText(3, detailview->windowTitle());
    return retVal;
}
Exemplo n.º 5
0
void ViewManager::eventOccured( ViewEvent ve, View * view )
//---------------------------------------------------------
// call kill on VEGettingFocus and VELosingFocus events
// since under OS/2, these occur before the window is
// destroyed!!
{
    int i;

    // perform special actions on some events //
    switch( ve ) {
    case VEGettingFocus:
        if( view != _hasFocus ) {
            _hasFocus = view;
            sendEvent( ve, view );
        }
        break;

    case VELosingFocus:
        if( view == _hasFocus ) {
            sendEvent( ve, view );
        }
        _hasFocus = NULL;
        break;

    case VEBrowseFileChange:
        /* the loop has to be in reverse order since the aboutToClose
         * call removes the receiver from the array
         */
        for( i = _detailViews->entries(); i > 0; i -= 1 ) {
            DetailView * dtv = (*_detailViews)[ i - 1 ];

            dtv->aboutToClose();
        }
        sendEvent( ve, view );
        kill();

        break;

    default:
        sendEvent( ve, view );
        kill();
    }
}
Exemplo n.º 6
0
void GlobalViewList::toggleDetail( WWindow * )
//--------------------------------------------
{
    WRect           rect;
    int             sel = selected();
    Symbol *        sym;
    DetailView *    dtv;

    sym = getSymbol( sel );
    if( sym ) {
        dtv = viewManager()->findDetailView( sym, DetailView::ViewDetail );

        if( !dtv ) {
            popDetail( sym );
        } else {
            dtv->aboutToClose();
            viewManager()->kill();
        }
    }
}