コード例 #1
0
ファイル: guitool.c プロジェクト: lycaner/open-watcom-v2
static bool FixToolbar( gui_window *wnd )
{
    gui_window  *parent;

    parent = wnd->parent;
    wnd->parent->tbinfo->switching = true;
    GUICloseWnd( wnd );
    parent->tbinfo->switching = false;
    return( GUIXCreateFixedToolbar( parent ) );
}
コード例 #2
0
ファイル: guixloop.c プロジェクト: bhanug/open-watcom-v2
static void ProcessMousePress( EVENT ev, gui_event gui_ev, ORD row, ORD col,
                               bool new_curr_wnd )
{
    gui_coord   point;
    ORD         wnd_row;
    ORD         wnd_col;
    resize_dir  dir;
    bool        use_gadgets;

    point.x = (gui_ord)col;
    point.y = (gui_ord)row;
    OldCol = col;
    OldRow = row;
    if( GUICurrWnd == NULL ) {
        return;
    }
    dir = RESIZE_NONE;
    if( MouseState == MOUSE_SIZE || MouseState == MOUSE_MOVE ) {
        return;
    }
    MouseState = MOUSE_FREE; /* default */
    if( !( GUICurrWnd->style & GUI_VISIBLE ) ) {
        return;
    }
    wnd_row = row - GUICurrWnd->screen.area.row;
    wnd_col = col - GUICurrWnd->screen.area.col;
    if( wnd_row < GUICurrWnd->use.row ) {
        use_gadgets = !new_curr_wnd || ( GUIGetWindowStyles() &
                      ( GUI_INACT_GADGETS | GUI_INACT_SAME ) );
        if( use_gadgets && GUI_HAS_CLOSER( GUICurrWnd ) &&
            ( wnd_col >= CLOSER_COL -1 ) && ( wnd_col <= CLOSER_COL+1 ) ) {
            if( ( GUICurrWnd->menu != NULL ) && ( ev == EV_MOUSE_PRESS ) ) {
                point.x = GUICurrWnd->screen.area.col;
                ev = GUICreatePopup( GUICurrWnd, &point );
            }
            if( (GUICurrWnd->style & GUI_CLOSEABLE) && (ev == EV_MOUSE_DCLICK) ) {
                if( GUICloseWnd( GUICurrWnd ) ) {
                    MouseState = MOUSE_FREE;
                }
            }
        } else if( use_gadgets && ValidMaxRestore( GUICurrWnd, wnd_row, wnd_col ) ) {
            if( GUI_WND_MAXIMIZED( GUICurrWnd ) ) {
                MouseState = MOUSE_RESTORE_START;
            } else {
                MouseState = MOUSE_MAX_START;
            }
        } else if( use_gadgets && ValidMin( GUICurrWnd, wnd_row, wnd_col ) &&
                   ( ev == EV_MOUSE_PRESS ) ) {
            MouseState = MOUSE_MIN_START;
        } else if( (GUICurrWnd->style & GUI_RESIZEABLE) && (ev == EV_MOUSE_PRESS) &&
                   ( ( wnd_col == 0) || (wnd_col == GUICurrWnd->screen.area.width-1) ) ) {
            dir = RESIZE_UP;
        } else if( ( ev == EV_MOUSE_DCLICK ) || ( ev == EV_MOUSE_PRESS ) ) {
            if( GUIStartMoveResize( GUICurrWnd, row, col, RESIZE_NONE ) ) {
                MouseState = MOUSE_MOVE;
            }
        }
    } else if( GUIPtInRect( &GUICurrWnd->use, wnd_row, wnd_col ) ) {
        MouseState = MOUSE_CLIENT;
        SendPointEvent( GUICurrWnd, gui_ev, &point );
    } else if( ( GUICurrWnd->style & GUI_RESIZEABLE ) && ( ev == EV_MOUSE_PRESS ) &&
               ( wnd_row == GUICurrWnd->screen.area.height-1 ) &&
               ( ( wnd_col == 0 ) || ( wnd_col == GUICurrWnd->screen.area.width-1 ) ) ) {
        dir = RESIZE_DOWN;
    }
    if( dir != RESIZE_NONE ) {
        if( wnd_col == 0 ) {
            dir |= RESIZE_LEFT;
        } else {
            dir |= RESIZE_RIGHT;
        }
        if( GUIStartMoveResize( GUICurrWnd, row, col, dir ) ) {
            MouseState = MOUSE_SIZE;
        }
    }
    GUIMouseWnd = GUICurrWnd;
}