home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d547 / powersource.lha / PowerSource / source.lzh / source / Med.c < prev    next >
C/C++ Source or Header  |  1991-09-15  |  16KB  |  530 lines

  1. /*----------------------------------------------------------------------*
  2.     Med.c version 3.0 - © Copyright 1991 Jaba Development
  3.  
  4.     Author : Jan van den Baard
  5.     Purpose: The editing of menus.
  6.  *----------------------------------------------------------------------*/
  7. /*---------------------------------------------------*
  8.   Gadgets created with GadgetEd V2.5
  9.   which is (c) Copyright 1990-91 by Jaba Development
  10.   written by Jan van den Baard
  11.  *---------------------------------------------------*/
  12.  
  13. static SHORT Border0_pairs[] = {
  14.   -1,-1,266,-1,266,85,-1,85,-1,-1 };
  15. static SHORT Border1_pairs[] = {
  16.   -1,-1,266,-1,266,9,-1,9,-1,-1 };
  17.  
  18. static struct Border Border_bord[] = {
  19.   3,2,0,0,JAM1,5,(SHORT *)&Border0_pairs,&Border_bord[1],
  20.   3,2,0,0,JAM1,5,(SHORT *)&Border1_pairs,NULL };
  21.  
  22. static struct IntuiText Render_text = {
  23.   0,1,JAM1,100,3,NULL,(UBYTE *)"Edit Menu",NULL };
  24.  
  25. static SHORT FORMAT_pairs0[] = {
  26.   -1,-1,124,-1,124,9,-1,9,-1,-1 };
  27.  
  28. static struct Border FORMAT_bord = {
  29.   0,0,0,0,JAM1,5,(SHORT *)&FORMAT_pairs0,NULL };
  30.  
  31. #define FORMAT_ID    8
  32.  
  33. static struct Gadget FORMAT = {
  34.   NULL,9,34,124,9,
  35.   GADGHCOMP,
  36.   RELVERIFY,
  37.   BOOLGADGET,
  38.   (APTR)&FORMAT_bord,NULL,
  39.   NULL,NULL,NULL,FORMAT_ID,NULL };
  40.  
  41. static SHORT CANCEL_pairs0[] = {
  42.   -1,-1,58,-1,58,35,-1,35,-1,-1 };
  43.  
  44. static struct Border CANCEL_bord = {
  45.   0,0,0,0,JAM1,5,(SHORT *)&CANCEL_pairs0,NULL };
  46.  
  47. static struct IntuiText CANCEL_text = {
  48.   0,1,JAM1,5,14,NULL,(UBYTE *)"CANCEL",NULL };
  49.  
  50. #define CANCEL_ID    7
  51.  
  52. static struct Gadget CANCEL = {
  53.   &FORMAT,205,48,58,35,
  54.   GADGHCOMP,
  55.   RELVERIFY,
  56.   BOOLGADGET,
  57.   (APTR)&CANCEL_bord,NULL,
  58.   &CANCEL_text,NULL,NULL,CANCEL_ID,NULL };
  59.  
  60. static SHORT OKIDOKI_pairs0[] = {
  61.   -1,-1,58,-1,58,35,-1,35,-1,-1 };
  62.  
  63. static struct Border OKIDOKI_bord = {
  64.   0,0,0,0,JAM1,5,(SHORT *)&OKIDOKI_pairs0,NULL };
  65.  
  66. static struct IntuiText OKIDOKI_text = {
  67.   0,1,JAM1,21,14,NULL,(UBYTE *)"OK",NULL };
  68.  
  69. #define OKIDOKI_ID    6
  70.  
  71. static struct Gadget OKIDOKI = {
  72.   &CANCEL,140,48,58,35,
  73.   GADGHCOMP,
  74.   RELVERIFY,
  75.   BOOLGADGET,
  76.   (APTR)&OKIDOKI_bord,NULL,
  77.   &OKIDOKI_text,NULL,NULL,OKIDOKI_ID,NULL };
  78.  
  79. static UBYTE HEIGHT_buf[5] = "0";
  80.  
  81. static struct StringInfo HEIGHT_info = {
  82.   (UBYTE *)&HEIGHT_buf,NULL,0,5,0,0,0,0,0,0,NULL,NULL,NULL };
  83.  
  84. static SHORT HEIGHT_pairs0[] = {
  85.   -1,-1,59,-1,59,8,-1,8,-1,-1 };
  86.  
  87. static struct Border HEIGHT_bord = {
  88.   0,0,2,0,JAM1,5,(SHORT *)&HEIGHT_pairs0,NULL };
  89.  
  90. static struct IntuiText HEIGHT_text = {
  91.   0,1,JAM2,5,-9,NULL,(UBYTE *)"HEIGHT",NULL };
  92.  
  93. #define HEIGHT_ID    5
  94.  
  95. static struct Gadget HEIGHT = {
  96.   &OKIDOKI,73,75,59,8,
  97.   GADGHCOMP+GADGDISABLED,
  98.   RELVERIFY+STRINGCENTER+LONGINT,
  99.   STRGADGET,
  100.   (APTR)&HEIGHT_bord,NULL,
  101.   &HEIGHT_text,NULL,(APTR)&HEIGHT_info,HEIGHT_ID,NULL };
  102.  
  103. static UBYTE WIDTH_buf[5] = "0";
  104.  
  105. static struct StringInfo WIDTH_info = {
  106.   (UBYTE *)&WIDTH_buf,NULL,0,5,0,0,0,0,0,0,NULL,NULL,NULL };
  107.  
  108. static SHORT WIDTH_pairs0[] = {
  109.   -1,-1,59,-1,59,8,-1,8,-1,-1 };
  110.  
  111. static struct Border WIDTH_bord = {
  112.   0,0,2,0,JAM1,5,(SHORT *)&WIDTH_pairs0,NULL };
  113.  
  114. static struct IntuiText WIDTH_text = {
  115.   0,1,JAM2,10,-9,NULL,(UBYTE *)"WIDTH",NULL };
  116.  
  117. #define WIDTH_ID    4
  118.  
  119. static struct Gadget WIDTH = {
  120.   &HEIGHT,9,75,59,8,
  121.   GADGHCOMP+GADGDISABLED,
  122.   RELVERIFY+STRINGCENTER+LONGINT,
  123.   STRGADGET,
  124.   (APTR)&WIDTH_bord,NULL,
  125.   &WIDTH_text,NULL,(APTR)&WIDTH_info,WIDTH_ID,NULL };
  126.  
  127. static UBYTE TOP_buf[5] = "0";
  128.  
  129. static struct StringInfo TOP_info = {
  130.   (UBYTE *)&TOP_buf,NULL,0,5,0,0,0,0,0,0,NULL,NULL,NULL };
  131.  
  132. static SHORT TOP_pairs0[] = {
  133.   -1,-1,59,-1,59,8,-1,8,-1,-1 };
  134.  
  135. static struct Border TOP_bord = {
  136.   0,0,2,0,JAM1,5,(SHORT *)&TOP_pairs0,NULL };
  137.  
  138. static struct IntuiText TOP_text = {
  139.   0,1,JAM2,16,-9,NULL,(UBYTE *)"TOP",NULL };
  140.  
  141. #define TOP_ID    3
  142.  
  143. static struct Gadget TOP = {
  144.   &WIDTH,73,56,59,8,
  145.   GADGHCOMP+GADGDISABLED,
  146.   RELVERIFY+STRINGCENTER+LONGINT,
  147.   STRGADGET,
  148.   (APTR)&TOP_bord,NULL,
  149.   &TOP_text,NULL,(APTR)&TOP_info,TOP_ID,NULL };
  150.  
  151. static UBYTE LEFT_buf[5] = "0";
  152.  
  153. static struct StringInfo LEFT_info = {
  154.   (UBYTE *)&LEFT_buf,NULL,0,5,0,0,0,0,0,0,NULL,NULL,NULL };
  155.  
  156. static SHORT LEFT_pairs0[] = {
  157.   -1,-1,59,-1,59,8,-1,8,-1,-1 };
  158.  
  159. static struct Border LEFT_bord = {
  160.   0,0,2,0,JAM1,5,(SHORT *)&LEFT_pairs0,NULL };
  161.  
  162. static struct IntuiText LEFT_text = {
  163.   0,1,JAM2,15,-9,NULL,(UBYTE *)"LEFT",NULL };
  164.  
  165. #define LEFT_ID    2
  166.  
  167. static struct Gadget LEFT = {
  168.   &TOP,9,56,59,8,
  169.   GADGHCOMP+GADGDISABLED,
  170.   RELVERIFY+STRINGCENTER+LONGINT,
  171.   STRGADGET,
  172.   (APTR)&LEFT_bord,NULL,
  173.   &LEFT_text,NULL,(APTR)&LEFT_info,LEFT_ID,NULL };
  174.  
  175. static SHORT ENABLE_pairs0[] = {
  176.   -1,-1,124,-1,124,9,-1,9,-1,-1 };
  177.  
  178. static struct Border ENABLE_bord = {
  179.   0,0,0,0,JAM1,5,(SHORT *)&ENABLE_pairs0,NULL };
  180.  
  181. static struct IntuiText ENABLE_text = {
  182.   0,1,JAM1,18,1,NULL,(UBYTE *)"MENUENABLED",NULL };
  183.  
  184. #define ENABLE_ID    1
  185.  
  186. static struct Gadget ENABLE = {
  187.   &LEFT,140,34,124,9,
  188.   GADGHCOMP+SELECTED,
  189.   TOGGLESELECT+GADGIMMEDIATE,
  190.   BOOLGADGET,
  191.   (APTR)&ENABLE_bord,NULL,
  192.   &ENABLE_text,NULL,NULL,ENABLE_ID,NULL };
  193.  
  194. static UBYTE MNAME_buf[33];
  195.  
  196. static struct StringInfo MNAME_info = {
  197.   (UBYTE *)&MNAME_buf,NULL,0,33,0,0,0,0,0,0,NULL,NULL,NULL };
  198.  
  199. static SHORT MNAME_pairs0[] = {
  200.   -1,-1,255,-1,255,8,-1,8,-1,-1 };
  201.  
  202. static struct Border MNAME_bord = {
  203.   0,0,2,0,JAM1,5,(SHORT *)&MNAME_pairs0,NULL };
  204.  
  205. static struct IntuiText MNAME_text = {
  206.   0,1,JAM1,92,-9,NULL,(UBYTE *)"MENU NAME",NULL };
  207.  
  208. #define MNAME_ID    0
  209.  
  210. static struct Gadget MNAME = {
  211.   &ENABLE,9,22,255,8,
  212.   GADGHCOMP,
  213.   RELVERIFY+STRINGCENTER,
  214.   STRGADGET,
  215.   (APTR)&MNAME_bord,NULL,
  216.   &MNAME_text,NULL,(APTR)&MNAME_info,MNAME_ID,NULL };
  217.  
  218. static struct NewWindow nw_menu = {
  219.   24,15,272,89,0,1,
  220.   GADGETDOWN+GADGETUP+CLOSEWINDOW,
  221.   NOCAREREFRESH+SMART_REFRESH+ACTIVATE+RMBTRAP+BORDERLESS,
  222.   NULL,NULL,
  223.   NULL,NULL,NULL,
  224.   150,50,320,256,CUSTOMSCREEN };
  225.  
  226. extern struct Window        *MainWindow;
  227. extern struct Screen        *MainScreen;
  228. extern struct RastPort      *MainRP;
  229. extern struct Gadget        *Gadget;
  230. extern struct MemoryChain    Memory;
  231. extern struct MyMenu        *MenuStrip;
  232. extern struct MenuItem       dummy;
  233. extern struct Menu           MainMenuStrip[];
  234. extern struct MenuItem       MainItem[];
  235. extern struct ListItem      *MenusList;
  236.  
  237. extern ULONG                 Class;
  238. extern UWORD                 Code, MenuCount, MenuTotal;
  239.  
  240. static struct Window    *MedWindow;
  241. static UWORD             CycleNum = 0L;
  242. static UBYTE             Buffer[33];
  243.  
  244. static struct IntuiText  CycleText[] = {
  245.     0,1,JAM2,18,1,NULL,(UBYTE *)"AUTO FORMAT",NULL,
  246.     0,1,JAM2,18,1,NULL,(UBYTE *)"USER FORMAT",NULL
  247. };
  248.  
  249. struct MyMenu *MakeMenu( void )
  250. {
  251.     struct MyMenu   *menu;
  252.     WORD             left;
  253.  
  254.     left = StripWidth();
  255.  
  256.     if(NOT MNAME_buf[0]) return(NULL);
  257.  
  258.     if((left + TEXT_WIDTH(MainRP,(char *)&MNAME_buf[0]) + MENUSPACING) <= MainScreen->Width) {
  259.         if((menu = (struct MyMenu *)AllocItem(&Memory,(ULONG)sizeof(struct MyMenu),MEMF_PUBLIC))) {
  260.             if(NOT CycleNum) {
  261.                 menu->LeftEdge = left;
  262.                 menu->Width    = TEXT_WIDTH(MainRP,(char *)&MNAME_buf[0]) + MENUSPACING;
  263.                 menu->Height   = TEXT_HEIGHT(MainRP);
  264.             } else {
  265.                 menu->LeftEdge     = LEFT_info.LongInt;
  266.                 menu->TopEdge      = TOP_info.LongInt;
  267.                 menu->Width        = WIDTH_info.LongInt;
  268.                 menu->Height       = HEIGHT_info.LongInt;
  269.                 menu->SpecialFlags = USERFORMAT;
  270.             }
  271.  
  272.             menu->MenuName = &menu->TheMenuName[0];
  273.  
  274.             if(SelectTest(&ENABLE))
  275.                 menu->Flags = MENUENABLED;
  276.  
  277.             strcpy((char *)&menu->TheMenuName[0],(char *)&MNAME_buf[0]);
  278.             menu->FirstItem = (struct MyMenuItem *)&dummy;
  279.             MenuCount++;
  280.             MenuTotal++;
  281.             return(menu);
  282.         } else {
  283.             enable_window();
  284.             ok();
  285.             Error("Out of memory!");
  286.         }
  287.     } else {
  288.         enable_window();
  289.         ok();
  290.         Error("Menu won't fit!");
  291.     }
  292.     return(NULL);
  293. }
  294.  
  295. void NIL( void )
  296. {
  297.     register struct Gadget  *g;
  298.  
  299.     for(g = &MNAME; g; g = g->NextGadget) {
  300.         if(TestBits((ULONG)g->GadgetType,BOOLGADGET))
  301.             g->Flags = NULL;
  302.     }
  303.  
  304.     ENABLE.Flags = SELECTED;
  305.  
  306.     LEFT.Flags   = GADGDISABLED;
  307.     TOP.Flags    = GADGDISABLED;
  308.     WIDTH.Flags  = GADGDISABLED;
  309.     HEIGHT.Flags = GADGDISABLED;
  310.  
  311.     CycleNum = 0L;
  312.  
  313.     redisplay(&MNAME);
  314. }
  315.  
  316. void RemoveMenu( struct ListItem *l )
  317. {
  318.     struct MyMenu   *menu, *pmenu;
  319.     struct ListItem *pred;
  320.     UWORD            count;
  321.     UBYTE            message[36];
  322.  
  323.     menu = l->Menu;
  324.  
  325.     StringFormat((char *)&message,"Delete: %.27s",menu->MenuName);
  326.     if(Ask(&message[0],"Are you sure?") == FALSE)
  327.         return;
  328.  
  329.     ClearMenuStrip(MainWindow);
  330.  
  331.     if(l == MenusList) {
  332.         for(count = 3; count < 7; count++)
  333.             MainItem[count].SubItem = l->AItem.NextItem;
  334.         MenusList = (struct ListItem *)l->AItem.NextItem;
  335.     } else {
  336.         pred = (struct ListItem *)FindPredItem(MenusList, l);
  337.         pred->AItem.NextItem = l->AItem.NextItem;
  338.     }
  339.  
  340.     if(menu == MenuStrip)
  341.         MenuStrip = menu->NextMenu;
  342.     else {
  343.         pmenu = (struct MyMenu *)FindPredMenu(menu);
  344.         pmenu->NextMenu = menu->NextMenu;
  345.     }
  346.     FreeMenu(menu);
  347.     MenuCount--;
  348.     MenuTotal--;
  349.     ReformatM();
  350.     ReformatList(MENUED);
  351.     SetMenuStrip(MainWindow,&MainMenuStrip[0]);
  352.     SetMainMenus();
  353. }
  354.  
  355. void CheckNumbers( LONG l, LONG t, LONG w, LONG h )
  356. {
  357.     if(l < 0 || l > MainScreen->Width)  DisplayBeep(NULL);
  358.     if(t < 0 || t > MainScreen->Height) DisplayBeep(NULL);
  359.     if(w > MainScreen->Width)           DisplayBeep(NULL);
  360.     if(h > MainScreen->Height)          DisplayBeep(NULL);
  361.     if((l+w) > MainScreen->Width)       DisplayBeep(NULL);
  362.     if((t+h) > MainScreen->Height)      DisplayBeep(NULL);
  363. }
  364.  
  365. struct MyMenu *EditMenu( struct ListItem *l, ULONG ModeIns)
  366. {
  367.     struct MyMenu   *TheMenu, *Last, *Edit;
  368.     BOOL             running = TRUE;
  369.     WORD             width;
  370.  
  371.     NIL();
  372.  
  373.     if((NOT l) || ModeIns) {
  374.         MNAME_buf[0] = 0;
  375.         ENABLE.Flags = GADGHCOMP+SELECTED;
  376.         LEFT_info.LongInt   = StripWidth();
  377.         TOP_info.LongInt    = 0;
  378.         WIDTH_info.LongInt  = 10;
  379.         HEIGHT_info.LongInt = 9;
  380.         StringFormat((char *)&LEFT_buf[0],"%ld",StripWidth());
  381.         strcpy((char *)&TOP_buf[0],"0");
  382.         strcpy((char *)&WIDTH_buf[0],"10");
  383.         strcpy((char *)&HEIGHT_buf[0],"9");
  384.     } else if(l && (NOT ModeIns)) {
  385.         Edit = l->Menu;
  386.         strcpy((char *)&MNAME_buf[0],Edit->MenuName);
  387.         strcpy((char *)&Buffer[0],Edit->MenuName);
  388.         if(TestBits((ULONG)Edit->Flags,MENUENABLED))
  389.             ENABLE.Flags = GADGHCOMP+SELECTED;
  390.         else
  391.             ENABLE.Flags = GADGHCOMP;
  392.         LEFT_info.LongInt   = Edit->LeftEdge;
  393.         TOP_info.LongInt    = Edit->TopEdge;
  394.         WIDTH_info.LongInt  = Edit->Width;
  395.         HEIGHT_info.LongInt = Edit->Height;
  396.         StringFormat((char *)&LEFT_buf[0],"%ld",Edit->LeftEdge);
  397.         StringFormat((char *)&TOP_buf[0],"%ld",Edit->TopEdge);
  398.         StringFormat((char *)&WIDTH_buf[0],"%ld",Edit->Width);
  399.         StringFormat((char *)&HEIGHT_buf[0],"%ld",Edit->Height);
  400.         if(TestBits((ULONG)Edit->SpecialFlags,USERFORMAT)) {
  401.             CycleNum = 1L;
  402.             LEFT.Flags   = GADGHCOMP;
  403.             TOP.Flags    = GADGHCOMP;
  404.             WIDTH.Flags  = GADGHCOMP;
  405.             HEIGHT.Flags = GADGHCOMP;
  406.         }
  407.     }
  408.  
  409.     FORMAT.GadgetText = &CycleText[CycleNum];
  410.     nw_menu.Screen = MainScreen;
  411.  
  412.     if(NOT(MedWindow = (struct Window *)OpenWindow(&nw_menu)))
  413.         return(NULL);
  414.  
  415.     disable_window();
  416.     buisy();
  417.  
  418.     draw(MedWindow,&MNAME,&Border_bord[0],&Render_text);
  419.     ActivateGadget(&MNAME,MedWindow,NULL);
  420.  
  421.     do {
  422.         WaitPort(MedWindow->UserPort);
  423.         while(read_msg(MedWindow)) {
  424.             switch(Class) {
  425.                 case GADGETUP:
  426.                     switch(Gadget->GadgetID) {
  427.                         case    OKIDOKI_ID:
  428.                             if(NOT MNAME_buf[0]) {
  429.                                 DisplayBeep(MainScreen);
  430.                                 break;
  431.                             }
  432.                         case    CANCEL_ID:
  433.                             running = FALSE;
  434.                             break;
  435.                         case    FORMAT_ID:
  436.                             if(CycleNum) {
  437.                                 OffGList(MedWindow,&LEFT,NULL,4);
  438.                                 FORMAT.GadgetText = &CycleText[0];
  439.                                 CycleNum = 0;
  440.                             } else {
  441.                                 OnGList(MedWindow,&LEFT,NULL,4);
  442.                                 FORMAT.GadgetText = &CycleText[1];
  443.                                 CycleNum = 1;
  444.                             }
  445.                             SetAPen(MedWindow->RPort,1);
  446.                             RectFill(MedWindow->RPort,9,34,133,43);
  447.                             RefreshGList(&FORMAT,MedWindow,NULL,1);
  448.                             break;
  449.                         case    MNAME_ID:
  450.                             width = StripWidth();
  451.                             if(l) {
  452.                                 if(((width - Edit->Width) + TEXT_WIDTH(MainRP,(char *)&MNAME_buf[0]) + MENUSPACING) > MainScreen->Width) {
  453.                                     DisplayBeep(MainScreen);
  454.                                     strcpy((char *)&MNAME_buf[0],(char *)&Buffer[0]);
  455.                                     RefreshGList(&MNAME,MedWindow,NULL,1);
  456.                                 }
  457.                             } else {
  458.                                 if((width + TEXT_WIDTH(MainRP,(char *)&MNAME_buf[0]) + MENUSPACING) > MainScreen->Width)
  459.                                     DisplayBeep(NULL);
  460.                             }
  461.                             break;
  462.                         case    LEFT_ID:
  463.                         case    TOP_ID:
  464.                         case    WIDTH_ID:
  465.                         case    HEIGHT_ID:
  466.                             CheckNumbers(LEFT_info.LongInt,TOP_info.LongInt,WIDTH_info.LongInt, HEIGHT_info.LongInt);
  467.                             break;
  468.                     }
  469.             }
  470.         }
  471.     } while(running == TRUE);
  472.     CloseWindow(MedWindow);
  473.  
  474.     if(Gadget->GadgetID == OKIDOKI_ID && ModeIns && l) {
  475.         if((TheMenu = MakeMenu())) {
  476.             if(l->Menu == MenuStrip) {
  477.                 TheMenu->NextMenu = MenuStrip;
  478.                 MenuStrip = TheMenu;
  479.             } else {
  480.                 Last = (struct MyMenu *)FindPredMenu(l->Menu);
  481.                 Last->NextMenu = TheMenu;
  482.                 TheMenu->NextMenu = l->Menu;
  483.             }
  484.             TheMenu->ItsListItem = (struct ListItem *)CreateListItem((APTR)TheMenu, MENUED, TRUE, l, TRUE);
  485.             ReformatM();
  486.             enable_window();
  487.             ok();
  488.             return(NULL);
  489.         } else
  490.             return(NULL);
  491.     } else if(Gadget->GadgetID == OKIDOKI_ID && (NOT l)) {
  492.         if((TheMenu = MakeMenu())) {
  493.             if(NOT MenuStrip)
  494.                 MenuStrip = TheMenu;
  495.             else {
  496.                 Last           = (struct MyMenu *)LastMenu();
  497.                 Last->NextMenu = TheMenu;
  498.             }
  499.             TheMenu->ItsListItem = (struct ListItem *)CreateListItem((APTR)TheMenu, MENUED, FALSE, NULL,TRUE);
  500.             enable_window();
  501.             ok();
  502.             return(NULL);
  503.         } else
  504.             return(NULL);
  505.     } else if(Gadget->GadgetID && l && (NOT ModeIns)) {
  506.         if(SelectTest(&ENABLE))
  507.             Edit->Flags = MENUENABLED;
  508.         else
  509.             Edit->Flags = NULL;
  510.         strcpy(Edit->MenuName,(char *)&MNAME_buf[0]);
  511.         strncpy((char *)&l->Letters[0],Edit->MenuName,9);
  512.         if(NOT CycleNum) {
  513.             Edit->Width = TEXT_WIDTH(MainRP,Edit->MenuName) + MENUSPACING;
  514.             Edit->SpecialFlags = NULL;
  515.         } else {
  516.             Edit->LeftEdge = LEFT_info.LongInt;
  517.             Edit->TopEdge  = TOP_info.LongInt;
  518.             Edit->Width    = WIDTH_info.LongInt;
  519.             Edit->Height   = HEIGHT_info.LongInt;
  520.             Edit->SpecialFlags = USERFORMAT;
  521.         }
  522.         ReformatM();
  523.         enable_window();
  524.         ok();
  525.     }
  526.     enable_window();
  527.     ok();
  528.     return(NULL);
  529. }
  530.