Exemplo n.º 1
0
void WdeSetBaseObject( int menu_selection )
{
    HMENU               menu;
    OBJ_ID              obj_id;
    int                 id;
    WdeToolBar          *tbar;

    if( WdeGetNumRes() == 0 ) {
        return;
    }

    tbar = WdeControls;
    menu = WdeGetResMenuHandle();
    id = WdeGetCToolID();
    obj_id = -1;

    if( id != -1 && id != menu_selection ) {
        CheckMenuItem( menu, id, MF_BYCOMMAND | MF_UNCHECKED );
        WdeSetToolBarItemState( tbar, id, BUTTON_UP );
    }

    if( menu_selection != -1 ) {
        obj_id = WdeGetOBJIDFromMenu( menu_selection );
        if( obj_id != -1 ) {
            SetBaseObjType( obj_id );
            CheckMenuItem( menu, menu_selection, MF_BYCOMMAND | MF_CHECKED );
            WdeSetToolBarItemState( tbar, menu_selection, BUTTON_DOWN );
            WdeSetStatusText( NULL, "", true );
        }
    }
}
Exemplo n.º 2
0
static void WdeActivateResourceWindow( WdeResInfo *res_info, WPARAM wParam, LPARAM lParam )
{
    WdeResInfo  *info;
    OBJPTR      current_obj;
    bool        fActivate;
    HWND        hwndDeact;
    int         id;

    _wde_touch( wParam );

    if( res_info == NULL ) {
        return;
    }

    fActivate = GET_WM_MDIACTIVATE_FACTIVATE( res_info->res_win, wParam, lParam );

    hwndDeact = GET_WM_MDIACTIVATE_HWNDDEACTIVATE( wParam, lParam );

    res_info->active = fActivate;

    if( fActivate ) {
        WdeSetCurrentRes( res_info );
        info = WdeResInfoFromWin( hwndDeact );
        if( info != NULL ) {
            info->active = FALSE;
        }
    }

    if( res_info->editting ) {
        InitState( res_info->forms_win );
        id = WdeGetCToolID();
        WdeSetBaseObject( id );
        if( fActivate ) {
            current_obj = GetCurrObject();
            if( current_obj != NULL ) {
                Notify( current_obj, PRIMARY_OBJECT, NULL );
            }
        }
    }
}