void GUISetWindowColours( gui_window *wnd, int num_colours, gui_colour_set *colours ) { GUIFreeColours( wnd ); GUIFreeBKBrush( wnd ); GUISetColours( wnd, num_colours, colours ); GUIWndDirty( wnd ); }
void GUISetWindowColours( gui_window *wnd, int num_attrs, gui_colour_set *colours ) { gui_control *control; GUIFreeColours( wnd ); GUISetColours( wnd, num_attrs, colours ); for( control = wnd->controls; control != NULL; control = control->sibling ) { GUIRefreshControl( control->parent, control->id ); } GUIWholeWndDirty( wnd ); }
void GUIFreeWindowMemory( gui_window *wnd, bool from_parent, bool dialog ) { gui_window *root; HWND capture; from_parent = from_parent; if( ( wnd->hwnd != NULLHANDLE ) && ( GUICurrWnd == wnd ) ) { capture = _wpi_getcapture(); if( capture == wnd->hwnd ) { _wpi_releasecapture(); } } if( wnd->font != NULL ) { _wpi_deletefont( wnd->font ); wnd->font = NULL; } if( wnd->icon != (WPI_HICON)NULL ) { _wpi_destroyicon( wnd->icon ); } GUIFreeColours( wnd ); GUIFreeBKBrush( wnd ); GUIControlDeleteAll( wnd ); GUICloseToolBar( wnd ); GUIFreeHint( wnd ); _wpi_setwindowlongptr( wnd->hwnd, GUI_EXTRA_WORD * EXTRA_SIZE, 0 ); if( wnd->root != NULLHANDLE ) { _wpi_setwindowlongptr( wnd->root, GUI_EXTRA_WORD * EXTRA_SIZE, 0 ); } if( !dialog ) { GUIMDIDelete( wnd ); if( GUICurrWnd == wnd ) { GUICurrWnd = NULL; } GUIFreePopupList( wnd ); } GUIDeleteFromList( wnd ); /* If the window being deleted was the current window, choose a new * window to bring to front. Don't do this if the window that's being * destroyed is being destroyed because it's parent is being destroyed * (ie never got WM_CLOSE so DOING_CLOSE isn't set). */ if( !dialog && ( wnd->flags & DOING_CLOSE ) && ( GUICurrWnd == NULL ) && !GUIIsParentADialog( wnd ) ) { // if the root window has received a WM_DESTROY then just run away root = GUIGetRootWindow(); if( root && !( root->flags & DOING_DESTROY ) ) { GUIBringNewToFront( wnd ); } } if( wnd->hdc != (WPI_PRES)NULL ) { _wpi_releasepres( wnd->hwnd, wnd->hdc ); wnd->hdc = NULLHANDLE; } #ifdef __OS2_PM__ GUIFreeWndPaintHandles( wnd, true ); if( wnd->root_pinfo.normal_pres != (WPI_PRES)NULL ) { _wpi_deleteos2normpres( wnd->root_pinfo.normal_pres ); wnd->root_pinfo.normal_pres = (WPI_PRES)NULL; } if( wnd->hwnd_pinfo.normal_pres != (WPI_PRES)NULL ) { _wpi_deleteos2normpres( wnd->hwnd_pinfo.normal_pres ); wnd->hwnd_pinfo.normal_pres = (WPI_PRES)NULL; } #endif GUIMemFree( wnd ); }