MapEditor.Mod 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. MODULE MapEditor;
  2. IMPORT G := Graph, S := SimpleGui, Out;
  3. VAR
  4. frmMain: S.Form;
  5. pnlButtons: S.Panel;
  6. btnSave: S.Button;
  7. btnExit: S.Button;
  8. pnlMap: S.Panel;
  9. btn2: S.Button;
  10. PROCEDURE InitInterface(): BOOLEAN;
  11. VAR W, H: INTEGER;
  12. color: G.Color;
  13. BEGIN
  14. G.GetScreenSize(W, H);
  15. frmMain := S.NewForm(0, 0, W, H);
  16. pnlButtons := S.NewPanel(frmMain, 4, 4, 104, 60);
  17. G.MakeCol(color, 40, 150, 40);
  18. S.SetBgColor(pnlButtons, color);
  19. btnSave := S.NewButton(pnlButtons, 4, 4, 96, 24, 'Сохранить');
  20. btnExit := S.NewButton(pnlButtons, 4, 32, 96, 24, 'Выйти');
  21. pnlMap := S.NewPanel(frmMain, 112, 4, W - 116, H - 8);
  22. G.MakeCol(color, 150, 90, 40);
  23. S.SetBgColor(pnlMap, color);
  24. btn2 := S.NewButton(pnlMap, 64, 64, 96, 96, 'ОГО!');
  25. RETURN TRUE END InitInterface;
  26. PROCEDURE Init(): BOOLEAN;
  27. VAR ok: BOOLEAN;
  28. BEGIN ok := FALSE;
  29. G.Init;
  30. S.Init;
  31. IF G.Done & S.Done & InitInterface() THEN
  32. ok := TRUE
  33. END
  34. RETURN ok END Init;
  35. PROCEDURE Close;
  36. BEGIN
  37. G.Close
  38. END Close;
  39. BEGIN
  40. IF Init() THEN S.Run ELSE Out.String('Error loading.'); Out.Ln END;
  41. Close
  42. END MapEditor.