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

📄 winfract.c

📁 frasr200的win 版本源码(18.21),使用make文件,使用的vc版本较低,在我的环境下编译有问题! 很不错的分形程序代码!
💻 C
📖 第 1 页 / 共 5 页
字号:
                   if(Zooming) {
                      win_savedac();
                      ExecuteZoom();
                      }
                   else if(bMove)
                   {
                       extern POINT Center;

                       DragPoint = Center;
                       goto ExecZoom;
                   }
                   else if (win_oktocycle()) {
                       win_kill_all_zooming();
                       time_to_cycle = 1;
                       win_cyclerand = 2;
                       colorstate = 1;
                       }
                   break;

               case IDF_HOTNOZOOM:
                  win_kill_all_zooming();
                  if(Zooming)
                     CancelZoom();
                  else if(bMove)
                  {
                     extern POINT Center;

                     EndSelection(Center, &Rect);

                     ClearSelection(hWnd, &Rect, Shape);
                     bMove = bMoving = bTrack = FALSE;
		     win_title_text(-1);
                  }
                  break;

               case IDF_HOTCYCLEON:
               /* Space/etc.. toggles Color-cycling parameters */
                   win_kill_all_zooming();
                   if (time_to_cycle == 1) {
                       time_to_resume = 1;
                       time_to_cycle = 0;
                       }
                   else
                       if (win_oktocycle()) {
                            time_to_cycle = 1;
                            colorstate = 1;
                            }
                   break;
                   
               case IDF_HOTCYCLERIGHT: 
                   win_kill_all_zooming();
                   if (win_oktocycle()) {
                       time_to_cycle = 1;
                       win_cycledir = -1;
                       colorstate = 1;
                       }
                   break;

               case IDF_HOTCYCLELEFT: 
                   win_kill_all_zooming();
                   if (win_oktocycle()) {
                       time_to_cycle = 1;
                       win_cycledir = 1;
                       colorstate = 1;
                       }
                   break;
                   
               case IDF_HOTCYCLERSTEP: 
                   if (win_oktocycle()) {
                       time_to_cycle = 0;
                       win_cycledir = -1;
                       colorstate = 1;
                       spindac(win_cycledir,1);
                       }
                   break;
                   
               case IDF_HOTCYCLELSTEP: 
                   win_kill_all_zooming();
                   if (win_oktocycle()) {
                       time_to_cycle = 0;
                       win_cycledir = 1;
                       colorstate = 1;
                       spindac(win_cycledir,1);
                       }
                   break;

               case IDF_HOTCYCLEFAST: 
                   win_kill_all_zooming();
                   if (time_to_cycle != 0 && win_cycledelay > 4)
                       win_cycledelay -= 5;
                   break;

               case IDF_HOTCYCLESLOW: 
                   win_kill_all_zooming();
                   if (time_to_cycle != 0 && win_cycledelay < 100)
                       win_cycledelay += 5;
                   break;

		case IDM_ORBITS:
		    /* toggle orbits only if in pixel-by-pixel mode */
		    if (win_fastupdate)
                        time_to_orbit = 1;
	            break;
                   
                /* the following commands all cause a flag to be set
                   which causes the main fractal engine to return to
                   its main level, call SecondaryWndProc(), and then
                   either resume, restart, or exit */
                case IDM_EXIT:
                case IDM_OPEN:
                case IDF_OPEN:
                case IDM_NEW:
                case IDM_SAVE:
                case IDF_SAVE:
                case IDM_SAVEAS:
                case IDM_PRINT:
                case IDF_PRINT:
                case IDM_3D:
                case IDF_3D:
                case IDM_3DOVER:
                case IDF_3DOVER:
                case IDM_PARFILE:
                case IDF_PARFILE:
                case IDM_SAVEPAR:
                case IDF_SAVEPAR:
                case IDM_COPY:
                case IDC_EDIT:
                case IDM_FORMULA:
                case IDF_FORMULA:
                case IDM_DOODADX:
                case IDF_DOODADX:
                case IDM_DOODADY:
                case IDF_DOODADY:
	        case IDM_DOODADZ:
                case IDF_DOODADZ:
		case IDM_IFS3D:
                case IDF_IFS3D:
                case IDM_RESTART:
                case IDF_RESTART:
                case IDM_STARFIELD:
                case IDF_STARFIELD:
                case IDM_IMAGE:
                case IDF_IMAGE:
                case IDM_COORD:
		case IDM_SIZING:
                case IDM_PIXELS:
                case IDF_MAPIN:
                case IDF_MAPOUT:
                case IDM_MAPIN:
                case IDM_MAPOUT:
                case IDF_CYCLE:
                case IDM_CYCLE:
                case IDM_MATH_TOOLS:
                case IDM_ZOOMIN:
                case IDM_ZOOMOUT:
                case IDM_ZOOM:
                    win_kill_all_zooming();
                    time_to_cycle = 0;
                    SecondaryhWnd = hWnd;
                    Secondarymessage = message;
                    SecondarywParam = wParam;
                    SecondarylParam = lParam;
                    time_to_act = 1;
                    break;

            } 
            break;

        default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return (NULL);
}


void SecondaryWndProc()
{
    HWND hWnd;				/* handle to main window */
    unsigned message;
    WORD wParam;
    LONG lParam;

    RECT tempRect;
    HMENU hMenu;

    int Return;
    int i, fchoice;
    extern char FractintMenusStr[];
    extern char FractintPixelsStr[];

    hWnd    = SecondaryhWnd;
    message = Secondarymessage;
    wParam  = SecondarywParam;
    lParam  = SecondarylParam;

    switch (message) {

        case WM_COMMAND:
            
            switch (wParam) {

                /* File menu items */
                
                case IDF_OPEN:
                case IDF_3D:
                case IDF_3DOVER:
                    if (winfract_menustyle) {	/* Fractint prompts */
                        extern int display3d, overlay3d;
                        extern int tabmode, helpmode, initbatch;
                        extern char gifmask[];
                        int showfile;
                        char *hdg;
                        
                        win_kill_all_zooming();
                        time_to_resume = 1;
                        initbatch = 0;
                        display3d = 0;
                        overlay3d = 0;
                        if (wParam == IDM_3D || wParam == IDM_3DOVER
                            || wParam == IDF_3D || wParam == IDF_3DOVER)
                            display3d = 1;
                        if (wParam == IDM_3DOVER || wParam == IDF_3DOVER)
                            overlay3d = 1;
                        win_display3d = 0;
                        win_overlay3d = 0;
                        stackscreen();
                        tabmode = 0;
                        showfile = -1;
                        while (showfile <= 0) {		/* image is to be loaded */
                            if (overlay3d)
                                hdg = "Select File for 3D Overlay";
                            else if (display3d)
                                hdg = "Select File for 3D Transform";
                            else
                                hdg = "Select File to Restore";
                            if (showfile < 0 &&
                                getafilename(hdg,gifmask,readname) < 0) {
	                        showfile = 1;		     /* cancelled */
	                        break;
	                        }
                            showfile = 0;
                            tabmode = 1;
                            if (read_overlay() == 0)	     /* read hdr, get video mode */
	                        break; 		     /* got it, exit */
                            showfile = -1;		     /* retry */
                            }
                        if (!showfile) {
                            lstrcpy(FileName, readname);
                            time_to_load = 1;
                            time_to_cycle = 0;
                            if (wParam == IDM_3D || wParam == IDM_3DOVER
                                || wParam == IDF_3D || wParam == IDF_3DOVER)
                                win_display3d = 1;
                            if (wParam == IDM_3DOVER || wParam == IDF_3DOVER)
                                win_overlay3d = 1;
                            }
                        tabmode = 1;
                        unstackscreen();
                        break;
                        }
                case IDM_NEW:
                case IDM_OPEN:
                case IDM_3D:
                case IDM_3DOVER:
                    win_display3d = 0;
                    win_overlay3d = 0;
                    lstrcpy(DialogTitle,"File to Open");
                    if (wParam == IDM_3D || wParam == IDF_3D)
                        lstrcpy(DialogTitle,"File for 3D Transform");
                    if (wParam == IDM_3DOVER || wParam == IDF_3DOVER)
                        lstrcpy(DialogTitle,"File for 3D Overlay Transform");
                    lstrcpy(FileName, readname);
                    lstrcpy(DefSpec,"*.gif");
                    lstrcpy(DefExt,".gif");
                    Return = Win_OpenFile(FileName);
                    if (Return && (wParam == IDM_3D || wParam == IDM_3DOVER)) {
		        extern int glassestype;
                        lpSelect3D = MakeProcInstance(
                            (FARPROC) Select3D, hInst);
                        Return = DialogBox(hInst, "Select3D",
                             hWnd, lpSelect3D);
                        FreeProcInstance(lpSelect3D);
                         if (glassestype) {
                             int Return2;
                             lpSelectFunnyGlasses = MakeProcInstance(
                                 (FARPROC) SelectFunnyGlasses, hInst);
                             Return2 = DialogBox(hInst, "SelectFunnyGlasses",
                                 hWnd, lpSelectFunnyGlasses);
                             FreeProcInstance(lpSelectFunnyGlasses);
                             check_funnyglasses_name();
                             }
                        if (Return && !win_3dspherical) {
                            lpSelect3DPlanar = MakeProcInstance(
                                (FARPROC) Select3DPlanar, hInst);
                            Return = DialogBox(hInst, "Select3DPlanar",
                                 hWnd, lpSelect3DPlanar);
                            FreeProcInstance(lpSelect3DPlanar);
                            }
                        if (Return && win_3dspherical) {
                            lpSelect3DSpherical = MakeProcInstance(
                                (FARPROC) Select3DSpherical, hInst);
                            Return = DialogBox(hInst, "Select3DSpherical",
                                 hWnd, lpSelect3DSpherical);
                            FreeProcInstance(lpSelect3DSpherical);
                            }
                        if (Return && (ILLUMINE || RAY)) {
                            lpSelectLightSource = MakeProcInstance(
                                (FARPROC) SelectLightSource, hInst);
                            Return = DialogBox(hInst, "SelectLightSource",
                                 hWnd, lpSelectLightSource);
                            FreeProcInstance(lpSelectLightSource);
                            }
                        }
                    if (Return) {
                        lstrcpy(readname,FileName);
                        time_to_load = 1;
                        win_kill_all_zooming();
                        time_to_cycle = 0;
                        if (wParam == IDM_3D || wParam == IDM_3DOVER
                         || wParam == IDF_3D || wParam == IDF_3DOVER)
                            win_display3d = 1;
                        if (wParam == IDM_3DOVER || wParam == IDF_3DOVER)
                            win_overlay3d = 1;
                        }
                    break;

                case IDF_SAVE:
                    if (winfract_menustyle) {	/* Fractint prompts */
                        /* (no change) */
                        }
                case IDM_SAVE:
                case IDM_SAVEAS:
                    lstrcpy(DialogTitle,"File to SaveAs");
                    lstrcpy(FileName, readname);
                    lstrcpy(DefSpec,"*.gif");
                    lstrcpy(DefExt,".gif");
                    Return = Win_SaveFile(FileName);
                    if (Return)
                        time_to_save = 1;
                    if (time_to_save)
                    {
                       time_to_cycle = 0;

⌨️ 快捷键说明

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