bool GUIClearText( gui_window *wnd, unsigned id ) { HWND control; control = _wpi_getdlgitem( wnd->hwnd, id ); if( control != (HWND)NULL ) { _wpi_setwindowtext( control, NULL ); } return( TRUE ); }
/* * MDISetMainWindowTitle - set the title of the main window */ void MDISetMainWindowTitle( char *fname ) { char buff[MAX_STR]; if( childrenMaximized ) { sprintf( buff, "%s - %s", mdiInfo.main_name, fname ); _wpi_setwindowtext( mdiInfo.root, buff ); } } /* MDISetMainWindowTitle */
/* * doRestoreAll - set all children as needing restoration */ static void doRestoreAll( void ) { mdi_data *md; if( !childrenMaximized ) { return; } _wpi_setwindowtext( mdiInfo.root, mdiInfo.main_name ); childrenMaximized = FALSE; md = mdiHead; while( md != NULL ) { doRestore( md->hwnd ); md = md->next; } MDIClearMaximizedMenuConfig(); deleteMaximizedMenuConfig(); } /* doRestoreAll */
/* * CloseAllImages - used in the close all menu option */ void CloseAllImages( void ) { img_node *head; img_node *current; WPI_PARAM1 p1; HWND parent; head = GetHeadNode(); if( !head ) { PrintHintTextByID( WIE_NOIMAGESTOCLOSE, NULL ); return; } current = head; while( current ) { if( !(current->issaved) ) { p1 = WPI_MAKEP1( current->hwnd, 0 ); parent = _wpi_getparent( current->hwnd ); #ifdef __OS2_PM__ _wpi_sendmessage(parent, WM_ACTIVATE, (WPI_PARAM1)p1, 0L); #else _wpi_sendmessage( parent, WM_MDIRESTORE, (WPI_PARAM1)p1, 0L ); _wpi_sendmessage(ClientWindow, WM_MDIACTIVATE, (WPI_PARAM1)p1, 0L); #endif if( !(lastChanceSave(current)) ) { return; } } current = current->next; } DeleteActiveImage(); while( head ) { closeTheImage( head ); head = GetHeadNode(); } ClearImageText(); GrayEditOptions(); PrintHintTextByID( WIE_ALLIMAGESCLOSED, NULL ); _wpi_setwindowtext( _wpi_getframe(HMainWindow), IEAppTitle ); } /* CloseAllImages */
/* * FocusOnImage - Selects one of the mdi children. */ void FocusOnImage( HWND hwnd ) { char current_file[ _MAX_PATH ]; char *text; if (activeImage) { RedrawPrevClip(activeImage->hwnd); SetRectExists( FALSE ); } activeImage = SelectImage( hwnd ); if (!activeImage) { WImgEditError( WIE_ERR_BAD_HWND, WIE_INTERNAL_001 ); return; } ResetViewWindow( activeImage->viewhwnd ); CreateDrawnImage( activeImage ); SetMenus( activeImage ); SetNumColours( 1<<(activeImage->bitcount) ); SetHotSpot( activeImage ); DisplayImageText( activeImage ); CheckForUndo( activeImage ); GetFnameFromPath( activeImage->fname, current_file ); text = (char *) MemAlloc( strlen( IEAppTitle ) + strlen( current_file ) + 3 + 1 ); if( text ) { strcpy( text, IEAppTitle ); strcat( text, " - " ); strcat( text, current_file ); _wpi_setwindowtext( _wpi_getframe(HMainWindow), text ); MemFree( text ); } #ifndef __OS2_PM__ RedrawWindow( hwnd, NULL, NULL, RDW_UPDATENOW ); #endif } /* FocusOnImage */
/* * SetIsSaved - set whether the given MDI child has been saved */ void SetIsSaved( HWND hwnd, BOOL fissaved ) { img_node *node; img_node *next_icon; char fname[_MAX_FNAME]; char dir[_MAX_DIR]; char ext[_MAX_EXT]; char drive[_MAX_DRIVE]; char title[_MAX_EXT + _MAX_FNAME + 2]; char *main_title; node = GetImageNode( hwnd ); if( node == NULL ) { return; } // We do not check whether or not the image needs to have its // title bars updated here because sometimes we will save images // that are not modified to different files. #if 0 if( fissaved == node->issaved ) { return; } #endif next_icon = node; while( next_icon != NULL ) { next_icon->issaved = fissaved; next_icon = next_icon->nexticon; } if( fissaved ) { _wpi_getwindowtext( _wpi_getframe( node->hwnd ), title, sizeof( title ) ); if( strnicmp( title, IEImageUntitled, strlen( IEImageUntitled ) ) == 0 && strnicmp( node->fname, IEImageUntitled, strlen( IEImageUntitled ) ) == 0 ) { return; } _splitpath( node->fname, drive, dir, fname, ext ); strcpy( title, strupr( fname ) ); strcat( title, strupr( ext ) ); _wpi_setwindowtext( _wpi_getframe( node->hwnd ), (LPSTR)title ); main_title = (char *)MemAlloc( strlen( IEAppTitle ) + strlen( title ) + 3 + 1 ); if( main_title != NULL ) { strcpy( main_title, IEAppTitle ); strcat( main_title, " - " ); strcat( main_title, title ); _wpi_setwindowtext( HMainWindow, main_title ); MemFree( main_title ); } } else { _wpi_getwindowtext( _wpi_getframe( node->hwnd ), title, sizeof( title ) ); if( strnicmp( title, IEImageUntitled, strlen( IEImageUntitled ) ) == 0 ) { return; } else if( title[strlen( title ) - 1] == '*' ) { return; } else { strcat( title, "*" ); _wpi_setwindowtext( _wpi_getframe( node->hwnd ), (LPSTR)title ); } } } /* SetIsSaved */
bool GUISetWindowText( gui_window *wnd, const char *data ) { _wpi_setwindowtext( GUIGetParentFrameHWND( wnd ), data ); GUIChangeMDITitle( wnd ); return( true ); }
/* * DeleteActiveImage - sets the active image to null. */ void DeleteActiveImage( void ) { activeImage = NULL; _wpi_setwindowtext( _wpi_getframe(HMainWindow), IEAppTitle ); } /* DeleteActiveImage */