Пример #1
0
/*
 * CloseCurrentImage - Gets the current image the user is editing and deletes
 *                     the node from the linked list and sends a message to
 *                     destroy the mdi child (this will activate another
 *                     child then).
 */
void CloseCurrentImage( HWND hwnd )
{
    img_node    *node;
    char        file_name[ _MAX_PATH ];
    BOOL        ret;

    node = SelectImage( hwnd );
    if (!node) return;
    ret = DestroyWindow( _wpi_getframe(node->viewhwnd) );
    GetFnameFromPath( node->fname, file_name );
    DeleteUndoStack( hwnd );
    if ( !DeleteNode(hwnd) ) {
        WImgEditError( WIE_ERR_BAD_HWND, WIE_INTERNAL_002 );
        return;
    }
    DeleteActiveImage();
    ClearImageText();

    GrayEditOptions();
    PrintHintTextByID( WIE_FILEHASBEENCLOSED, file_name );
    SetWindowText( _wpi_getframe(HMainWindow), IEAppTitle );

#ifdef __OS2_PM__
    ret = DestroyWindow( _wpi_getframe(hwnd) );
#else
    SendMessage(ClientWindow, WM_MDIDESTROY, (WPARAM)hwnd, 0L);
#endif
} /* CloseCurrentImage */
Пример #2
0
/*
 * closeTheImage - get the current image the user is editing, delete
 *                 the node from the linked list, and send a message to
 *                 destroy the MDI child (this will activate another child)
 */
static void closeTheImage( img_node *node )
{
    char        file_name[_MAX_PATH];
    BOOL        ret;
    HWND        hwnd;

    if( node == NULL ) {
        return;
    }

    ret = _wpi_destroywindow( _wpi_getframe( node->viewhwnd ) );
    GetFnameFromPath( node->fname, file_name );
    hwnd = node->hwnd;
    DeleteUndoStack( hwnd );
    if( !DeleteNode( hwnd ) ) {
        WImgEditError( WIE_ERR_BAD_HWND, WIE_INTERNAL_002 );
        return;
    }
#ifdef __OS2_PM__
    ret = DestroyWindow( _wpi_getframe( hwnd ) );
#else
    SendMessage( ClientWindow, WM_MDIDESTROY, (WPARAM)hwnd, 0L );
#endif

} /* closeTheImage */