home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 March / Chip_1998-03_cd.bin / tema / MINICAD / MC7DEMO / MINICAD.1 / CUSDIA.TXT < prev    next >
Text File  |  1997-04-22  |  3KB  |  95 lines

  1. <<!---------------------------------------------------------->
  2. Procedure AlignScreen(J,K: INTEGER; VAR TopL,BotR : INTEGER);
  3. VAR
  4.     scnx1,scny1,scnx2,scny2,Width : INTEGER;
  5. BEGIN
  6.     GetScreen(scnx1,scny1,scnx2,scny2);
  7.     Width:= K-J;
  8.     TopL:= ((scnx1 + scnx2) DIV 2) - (Width DIV 2);
  9.     BotR:= TopL + Width;
  10. END;
  11. <!---------------------------------------------------------->
  12. Procedure StdOKControl(ScreenHt,ScreenWid:INTEGER);
  13. BEGIN
  14.     AddButton('OK',1,1,ScreenWid - 68,(ScreenHt-100)-33,ScreenWid -10,(ScreenHt-100)-13);
  15. END;
  16. <!---------------------------------------------------------->
  17. Procedure StdControls(ScreenHt,ScreenWid:INTEGER);
  18. BEGIN
  19.     AddButton('OK',1,1,ScreenWid - 68,(ScreenHt-100)-33,ScreenWid -10,(ScreenHt-100)-13);
  20.     AddButton('Cancel',2,1,ScreenWid - 136,(ScreenHt-100)-33,ScreenWid -78,(ScreenHt-100)-13);
  21. END;
  22. <!---------------------------------------------------------->
  23. Procedure StdControls2(ScreenHt,ScreenWid:INTEGER);
  24. BEGIN
  25.     AddButton('OK',1,1,ScreenWid - 68,(ScreenHt-100)-63,ScreenWid -10,(ScreenHt-100)-43);
  26.     AddButton('Cancel',2,1,ScreenWid - 68,(ScreenHt-100)-33,ScreenWid -10,(ScreenHt-100)-13);
  27. END;
  28. <!---------------------------------------------------------->
  29. Procedure BoxToggle(theItem:INTEGER);
  30. BEGIN
  31.     IF ItemSel(theItem) THEN 
  32.         SetItem(theItem,False)
  33.     ELSE 
  34.         SetItem(theItem,True);
  35. END;
  36. <!---------------------------------------------------------->
  37. Procedure RadioToggle(Control1,Control2,ItemSelected:INTEGER);
  38. BEGIN
  39.         IF ItemSelected = Control1 THEN BEGIN
  40.             SetItem(Control1,True);
  41.             SetItem(Control2,False);
  42.         END
  43.         ELSE IF ItemSelected = Control2 THEN BEGIN
  44.             SetItem(Control1,False);
  45.             SetItem(Control2,True);
  46.         END;
  47. END;
  48. <!---------------------------------------------------------->
  49. Procedure RadioToggle3(Control1,Control2,Control3,ItemSelected:INTEGER);
  50. BEGIN
  51.         IF ItemSelected = Control1 THEN BEGIN
  52.             SetItem(Control1,True);
  53.             SetItem(Control2,False);
  54.             SetItem(Control3,False);
  55.         END
  56.         ELSE IF ItemSelected = Control2 THEN BEGIN
  57.             SetItem(Control1,False);
  58.             SetItem(Control2,True);
  59.             SetItem(Control3,False);
  60.         END
  61.         ELSE IF ItemSelected = Control3 THEN BEGIN
  62.             SetItem(Control1,False);
  63.             SetItem(Control2,False);
  64.             SetItem(Control3,True);
  65.         END;
  66. END;
  67. <!---------------------------------------------------------->
  68. Procedure RadioToggle4(Control1,Control2,Control3,Control4,ItemSelected:INTEGER);
  69. BEGIN
  70.         IF ItemSelected = Control1 THEN BEGIN
  71.             SetItem(Control1,True);
  72.             SetItem(Control2,False);
  73.             SetItem(Control3,False);
  74.             SetItem(Control4,False);
  75.         END
  76.         ELSE IF ItemSelected = Control2 THEN BEGIN
  77.             SetItem(Control1,False);
  78.             SetItem(Control2,True);
  79.             SetItem(Control3,False);
  80.             SetItem(Control4,False);
  81.         END
  82.         ELSE IF ItemSelected = Control3 THEN BEGIN
  83.             SetItem(Control1,False);
  84.             SetItem(Control2,False);
  85.             SetItem(Control3,True);
  86.             SetItem(Control4,False);
  87.         END
  88.         ELSE IF ItemSelected = Control4 THEN BEGIN
  89.             SetItem(Control1,False);
  90.             SetItem(Control2,False);
  91.             SetItem(Control3,False);
  92.             SetItem(Control4,True);
  93.         END;
  94. END;
  95.