void GUISetRestoredSize( gui_window *wnd, gui_rect *rect ) { gui_coord pos; gui_coord size; gui_window *parent; HWND frame; HWND phwnd; WPI_RECT new_rect; if( GUIIsMaximized( wnd ) || GUIIsMinimized( wnd ) ) { if( wnd->hwnd != NULLHANDLE ) { frame = GUIGetParentFrameHWND( wnd ); parent = wnd->parent; phwnd = HWND_DESKTOP; if( parent ) { phwnd = parent->hwnd; } GUICalcLocation( rect, &pos, &size, phwnd ); _wpi_setrectvalues( &new_rect, pos.x, pos.y, pos.x + size.x, pos.y + size.y ); if( GUIMDIMaximized( wnd ) ) { GUISetMDIRestoredSize( frame, &new_rect ); } else { _wpi_setrestoredrect( frame, &new_rect ); } } } else { GUIResizeWindow( wnd, rect ); } }
static void IconCount( gui_window *wnd, void *param ) { param = param; if( GUIIsMinimized( wnd ) ) { TotalWindows++; } }
bool WndIsMinimized( a_window wnd ) { gui_rect rect; if( GUIIsMinimized( wnd->gui ) ) return( true ); GUIGetClientRect( wnd->gui, &rect ); if( rect.width == 0 && rect.height == 0 ) return( true ); // work around GUI bug return( false ); }
void GUIMDIMoreWindows( void ) { int chosen; gui_window *wnd; chosen = GUIDlgPick( LIT( Select_Window ), &PickInit ); if( ( chosen >= 0 ) && ( chosen < TotalWindows ) ) { wnd = ChildWindows[chosen]; if( GUIIsMinimized( wnd ) ) { GUIRestoreWindow( wnd ); } GUIBringToFront( wnd ); } GUIMemFree( ChildWindows ); ChildWindows = NULL; TotalWindows = 0; }
bool DebugScreen( void ) { HWND hwnd; HWND fore; if( ScreenState == DEBUG_SCREEN ) return( FALSE ); if( _IsOn( SW_POWERBUILDER ) ) return( FALSE ); if( WndMain ) { ScreenState = DEBUG_SCREEN; hwnd = GUIGetSysHandle( WndGui( WndMain ) ); fore = GetForegroundWindow(); if( fore != hwnd ) { HwndFore = fore; } if( GUIIsMinimized( WndGui( WndMain ) ) ) GUIRestoreWindow( WndGui( WndMain ) ); if( IsWindow( hwnd ) ) SetForegroundWindow( hwnd ); if( _IsOn( SW_POWERBUILDER ) ) { WndRestoreWindow( WndMain ); } } return( FALSE ); }
static bool ProcessEvent( EVENT ev ) { gui_window *wnd; ev -= GUI_FIRST_USER_EVENT; if( ev == GUI_MDI_MORE_WINDOWS ) { GUIMDIMoreWindows(); return( TRUE ); } if( ( ev >= GUI_MDI_FIRST_WINDOW ) && ( ev <= ( GUI_MDI_FIRST_WINDOW + MAX_NUM_MDI_WINDOWS - 1 ) ) ) { wnd = GUIMDIGetWindow( ev ); if( wnd != NULL ) { if( GUIIsMinimized( wnd ) ) { GUIRestoreWindow( wnd ); } GUIBringToFront( wnd ); } return( TRUE ); } return( FALSE ); }