⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ieproc.c

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
            PrintHintTextByID( WIE_SYSMENUOPERATIONS, NULL );
            break;
        }
#endif
        ShowHintText( wparam );
        break;

    case WM_COMMAND:
        cmdid = LOWORD( wparam );
        if( !IEIsMenuIDValid( hmenu, cmdid ) ) {
            break;
        }
        switch( cmdid ) {
        case IMGED_NEW:
            if( !ImgedIsDDE ) {
                if( !NewImage( UNDEF_IMG, NULL ) ) {
                    PrintHintTextByID( WIE_NEIMAGENOTCREATED, NULL );
                }
            }
            break;

        case IMGED_CLOSE:
            node = GetCurrentNode();
            if (node) {
                _wpi_sendmessage( node->hwnd, WM_CLOSE, 0, 0L );
            }
            break;

        case IMGED_CLOSEALL:
            CloseAllImages();
            break;

        case IMGED_HELP:
            IEHelpRoutine();
            break;

        case IMGED_ABOUT:
#ifndef __OS2_PM__
            ai.owner = hwnd;
            ai.inst = Instance;
            ai.name = IEAllocRCString( WIE_ABOUTTEXT );
            ai.version = banner1p2( _RESEDIT_VERSION_ );
            ai.first_cr_year = IEAllocRCString( WIE_ABOUTFIRSTYEAR );
            ai.title = IEAllocRCString( WIE_ABOUTTITLE );
            DoAbout( &ai );
            if( ai.name ) {
                IEFreeRCString( ai.name );
            }
            if( ai.title ) {
                IEFreeRCString( ai.title );
            }
            if( ai.first_cr_year ) {
                IEFreeRCString( ai.first_cr_year );
            }
#endif
            break;

#ifndef __OS2_PM__
        case IMGED_DDE_UPDATE_PRJ:
            IEUpdateDDEEditSession();
            break;
#endif

        case IMGED_SAVE_AS:
            SaveFile( SB_SAVE_AS );
            break;

        case IMGED_SAVE:
            SaveFile( SB_SAVE );
            break;

        case IMGED_OPEN:
            if( !ImgedIsDDE ) {
                OpenImage(NULL);
            }
            break;

        case IMGED_CLEAR:
            ClearImage();
            break;

        case IMGED_NEWIMG:
            AddNewIcon();
            break;

        case IMGED_SELIMG:
            SelectIconImg();
            break;

        case IMGED_DELIMG:
            DeleteIconImg();
            break;

        case IMGED_UNDO:
            UndoOp();
            break;

        case IMGED_REDO:
            RedoOp();
            break;

        case IMGED_REST:
            RestoreImage();
            break;

        case IMGED_SNAP:
#ifndef __OS2_PM__
            SnapPicture();
#endif
            break;

        case IMGED_RIGHT:
        case IMGED_LEFT:
        case IMGED_UP:
        case IMGED_DOWN:
            ShiftImage( cmdid );
            break;

        case IMGED_FLIPHORZ:
        case IMGED_FLIPVERT:
            FlipImage( cmdid );
            break;

        case IMGED_ROTATECC:
        case IMGED_ROTATECL:
            RotateImage( cmdid );
            break;

        case IMGED_PASTE:
            PlaceAndPaste();
            break;

        case IMGED_COPY:
            IECopyImage();
            break;

        case IMGED_CUT:
            CutImage();
            break;

        case IMGED_COLOUR:
            CheckPaletteItem( hmenu );
            break;

        case IMGED_VIEW:
            CheckViewItem( hmenu );
            break;

        case IMGED_TOOLBAR:
            CheckToolbarItem( hmenu );
            break;

        case IMGED_SQUARE:
            CheckSquareGrid( hmenu );
            break;

        case IMGED_SIZE:
            ChangeImageSize();
            break;

        case IMGED_GRID:
            CheckGridItem( hmenu );
            break;

        case IMGED_MAXIMIZE:
            MaximizeCurrentChild();
            break;

        case IMGED_SETTINGS:
            SelectOptions();
            break;

        case IMGED_2x2:
        case IMGED_3x3:
        case IMGED_4x4:
        case IMGED_5x5:
            checkBrushItem( hmenu, cmdid );
            break;

        case IMGED_CEDIT:
#ifndef __OS2_PM__
            EditColours();
#endif
            break;

        case IMGED_CRESET:
#ifndef __OS2_PM__
            RestoreColours();
#endif
            break;

        case IMGED_CSCREEN:
            ChooseBkColour();
            break;

        case IMGED_SCOLOUR:
#ifndef __OS2_PM__
            SaveColourPalette();
#endif
            break;

        case IMGED_LCOLOUR:
#ifndef __OS2_PM__
            if( LoadColourPalette() ) {
                _wpi_enablemenuitem( hmenu, IMGED_RCOLOUR, TRUE, FALSE );
            }
#endif
            break;

        case IMGED_RCOLOUR:
            RestoreColourPalette();
            break;

        case IMGED_FREEHAND:
        case IMGED_LINE:
        case IMGED_RECTO:
        case IMGED_RECTF:
        case IMGED_CIRCLEO:
        case IMGED_CIRCLEF:
        case IMGED_FILL:
        case IMGED_BRUSH:
        case IMGED_CLIP:
        case IMGED_HOTSPOT:
            SetToolType( cmdid );
            PushToolButton( cmdid );
            break;

        case IMGED_ARRANGE:
#ifndef __OS2_PM__
            SendMessage(ClientWindow, WM_MDIICONARRANGE, 0, 0L);
#endif
            break;

        case IMGED_TILE:
#ifndef __OS2_PM__
            SendMessage(ClientWindow, WM_MDITILE, MDITILE_VERTICAL, 0L);
#endif
            break;

        case IMGED_CASCADE:
#ifndef __OS2_PM__
            SendMessage(ClientWindow, WM_MDICASCADE, MDITILE_SKIPDISABLED, 0L);
#endif
            break;

        case IMGED_EXIT:
            _wpi_sendmessage( hwnd, WM_COMMAND, IMGED_CLOSEALL, 0L );

            if ( _wpi_getfirstchild( _wpi_getclient(ClientWindow) ) != NULL ) {
                break;
            }
#ifndef __OS2_PM__
            _wpi_destroywindow( _wpi_getframe(hwnd) );
#else
            _wpi_sendmessage( hwnd, WM_CLOSE, 0, 0 );
#endif
            break;

        default:
#if 1
            return( _imgwpi_defframeproc(hwnd, ClientWindow, msg, wparam,
                                                                    lparam) );
#else
            return 0;
#endif
        }
        return 0;

#ifndef __OS2_PM__
    case WM_COMPACTING:
        RelieveUndos();
        return 0;
#endif

    case WM_QUERYENDSESSION:
        if( _wpi_isiconic(_wpi_getframe(hwnd)) ) {
            if( ImgedConfigInfo.ismaximized ) {
                _wpi_maximizewindow( _wpi_getframe(hwnd) );
            } else {
                _wpi_showwindow( _wpi_getframe(hwnd), SW_SHOWNORMAL );
            }
        }
        _wpi_sendmessage( hwnd, WM_COMMAND, IMGED_CLOSEALL, 0L );

        if( _wpi_getfirstchild(_wpi_getclient(ClientWindow)) != NULL ) {
            return 0;
        }
        return (MRESULT)1;

    case WM_CLOSE:
        // wParam is non-zero if the DDE connection died
        if( !wparam && !ImgEdEnableMenuInput ) {
            // this prevents the user from closing the editor during
            // DDE initialization
            return 0;
        }
        _wpi_sendmessage( hwnd, WM_COMMAND, IMGED_CLOSEALL, 0L );
#ifdef __OS2_PM__
        return( _wpi_defwindowproc(hwnd, msg, wparam, lparam) );
#else

        if( _wpi_getfirstchild(_wpi_getclient(ClientWindow)) != NULL ) {
            return 0;
        }
        window_destroyed = TRUE;
        _wpi_destroywindow(_wpi_getframe(hwnd));
        return 0;
#endif

    case WM_DESTROY:
#ifndef __OS2_PM__
        WWinHelp( HMainWindow, "resimg.hlp", HELP_QUIT, 0 );
#endif
        FiniStatusLine();
        CleanupClipboard();
        CleanupCursors();
        CloseToolBar();
        CloseFunctionBar();
        _wpi_deletefont( SmallFont );
        _wpi_postquitmessage( 0 );
        return 0;
    default:
        break;
    }
    return( _imgwpi_defframeproc( hwnd, ClientWindow, msg, wparam, lparam ) );

} /* ImgEdFrameProc */

#ifdef __OS2_PM__
/*
 * This is necessary since the window does not paint itself
 */
MRESULT CALLBACK ClientProc( HWND hwnd, WPI_MSG msg, WPI_PARAM1 mp1,
                                                WPI_PARAM2 mp2 )
{
    RECTL       rect;
    WPI_PRES    pres;

    switch( msg ) {
    case WM_PAINT:
        pres = WinBeginPaint(hwnd, 0L, (PRECTL)&rect);
        WinFillRect(pres, (PRECTL)&rect, CLR_BACKGROUND );
        WinEndPaint(pres);
        break;
    default:
        return( _wpi_defwindowproc(hwnd, msg, mp1, mp2) );
    }
    return 0;

} /* ClientProc */
#endif

void IEHelpRoutine( void )
{
#ifndef __OS2_PM__
    WWinHelp( HMainWindow, "resimg.hlp", HELP_CONTENTS, 0 );
#endif
}

void CALLBACK IEHelpCallBack( void )
{
    IEHelpRoutine();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -