예제 #1
0
bool GUIResizeWindow( gui_window *wnd, gui_rect *rect )
{
    gui_coord   pos;
    gui_coord   size;
    gui_window  *parent;
    HWND        frame;
    HWND        phwnd;
    HWND        rphwnd;
    WPI_POINT   pt;

    GUIInvalidatePaintHandles( wnd );
    if( wnd->hwnd != NULLHANDLE ) {
        frame = GUIGetParentFrameHWND( wnd );
        parent = wnd->parent;
        phwnd = HWND_DESKTOP;
        if( parent ) {
            phwnd = parent->hwnd;
        }
        GUICalcLocation( rect, &pos, &size, phwnd );
        if( wnd->flags & IS_DIALOG ) {
            // dialogs are owned by, but not children of, phwnd
            // so lets map pos to its real parent
            pt.x = pos.x;
            pt.y = pos.y;
            rphwnd = _wpi_getparent( frame );
            _wpi_mapwindowpoints( phwnd, rphwnd, &pt, 1 );
            _wpi_movewindow( frame, pt.x, pt.y, size.x, size.y, TRUE );

// The following is a bandaid 'till I find out why WM_SIZE's aren't
// generated for PM GUI dialogs by this fuction
#ifdef __OS2_PM__
            _wpi_getclientrect( frame, &wnd->hwnd_client );
            wnd->root_client = wnd->hwnd_client;
            GUISetRowCol( wnd, NULL );
            GUIScreenToScaleR( &size );
            GUIEVENTWND( wnd, GUI_RESIZE, &size );
#endif
        } else {
            _wpi_setwindowpos( frame, NULLHANDLE, pos.x, pos.y, size.x, size.y,
                               SWP_NOACTIVATE | SWP_NOZORDER | SWP_SIZE | SWP_MOVE );
                               //SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SIZE | SWP_MOVE );
        }
    }
    return( true );
}
예제 #2
0
/*
 * ResizeStatusBar - resize the status bar
 */
void ResizeStatusBar( WPI_PARAM2 lparam )
{
    short       width;
    short       height;
    short       y;

    if( statusBarWnd == NULL ) {
        return;
    }

#ifdef __OS2_PM__
    width = SHORT1FROMMP( lparam ) + 2;
    height = height;
    y = -1;
#else
    width = (int_16)LOWORD( lparam ) + 2;
    height = (int_16)HIWORD( lparam );
    y = max( height - StatusWidth + 1, FUNCTIONBAR_WIDTH );
#endif
    _wpi_setwindowpos( statusBarWnd, HWND_TOP, -1, y, width, StatusWidth,
                       SWP_SHOWWINDOW | SWP_MOVE | SWP_SIZE );

} /* ResizeStatusBar */