예제 #1
0
bool GUIGetRestoredSize( gui_window *wnd, gui_rect *rect )
{
    HWND                top_hwnd;
    HWND                parent;
    WPI_RECT            new_rect;

    if( wnd->hwnd != NULLHANDLE ) {
        top_hwnd = GUIGetParentFrameHWND( wnd );
        parent = _wpi_getparent( top_hwnd );
        _wpi_getrestoredrect( top_hwnd, &new_rect );
        _wpi_mapwindowpoints( parent, HWND_DESKTOP, (WPI_LPPOINT)&new_rect, 2 );
        DoGetRelRect( top_hwnd, &new_rect, rect, ( wnd->style & GUI_POPUP ) );
        return( true );
    }

    return( false );
}
예제 #2
0
파일: wmdisim.c 프로젝트: hubei/open-watcom
/*
 * doMaximize - handle maximizing an edit window
 */
static void doMaximize( HWND hwnd )
{
    DWORD               style;
    mdi_data            *md;
    WPI_RECT            r;
    bool                iconic;
    WPI_RECTDIM         left;
    WPI_RECTDIM         top;
    WPI_RECTDIM         right;
    WPI_RECTDIM         bottom;

    setMaximizedMenuConfig( hwnd );

    md = MDI_DATA_FROM_HWND( hwnd );

    if( mdiInfo.start_max_restore != NULL ) {
        mdiInfo.start_max_restore( hwnd );
    }

    iconic = _wpi_isiconic( hwnd );
    if( iconic ) {
        _wpi_getrestoredrect( hwnd, &md->orig_size );
    } else {
        _wpi_getwindowrect( hwnd, &md->orig_size );
    }
    md->orig_state = md->curr_state;
    md->curr_state = STATE_MAX;

    if( mdiInfo.set_style != NULL ) {
        (mdiInfo.set_style)( hwnd, TRUE );
    } else {
        style = _wpi_getwindowlong( hwnd, GWL_STYLE );
        style &= ~mdiInfo.reg_style;
        style |= mdiInfo.max_style;
        _wpi_setwindowlong( hwnd, GWL_STYLE, style );
    }
    _wpi_setscrollrange( hwnd, SB_VERT, 1, 1, TRUE );
    _wpi_setscrollrange( hwnd, SB_HORZ, 1, 1, TRUE );
    _wpi_getwindowrect( mdiInfo.container, &r );

    _wpi_getrectvalues( r, &left, &top, &right, &bottom );

    if( !iconic ) {
        _wpi_offsetrect( mdiInfo.hinstance, &md->orig_size, -left, -top );
    }

    _wpi_setrectvalues( &r, 0, 0, right-left+1, bottom-top+1 );

    if( iconic ) {
        _wpi_setrestoredrect( hwnd, &r );
    } else {
        _wpi_getrectvalues( r, &left, &top, &right, &bottom );
        _wpi_movewindow( hwnd, left, top, right, bottom, TRUE );
    }

    if( mdiInfo.end_max_restore != NULL ) {
        mdiInfo.end_max_restore( hwnd );
    }

    _wpi_invalidaterect( hwnd, NULL, FALSE );

} /* doMaximize */