fpmcomp.inc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Compiler menu entries
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. procedure TIDEApp.Target;
  13. var R,R2: TRect;
  14. D: PCenterDialog;
  15. RB: PRadioButtons;
  16. TargetCount,I: integer;
  17. LastItem: PSItem;
  18. L: longint;
  19. begin
  20. TargetCount:=TargetSwitches^.ItemCount;
  21. R.Assign(0,0,36,4+TargetCount);
  22. New(D, Init(R, 'Target'));
  23. with D^ do
  24. begin
  25. GetExtent(R); R.Grow(-3,-1); Inc(R.A.Y);
  26. R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+TargetCount;
  27. LastItem:=nil;
  28. for I:=TargetCount-1 downto 0 do
  29. LastItem:=NewSItem(TargetSwitches^.ItemName(I), LastItem);
  30. New(RB, Init(R2, LastItem));
  31. L:=ord(TargetSwitches^.GetCurrSel);
  32. RB^.SetData(L);
  33. Insert(RB);
  34. R2.Copy(R);
  35. R2.B.Y:=R2.A.Y+1;
  36. Insert(New(PLabel, Init(R2, 'Target platform', RB)));
  37. end;
  38. InsertButtons(D);
  39. RB^.Select;
  40. if Desktop^.ExecView(D)=cmOK then
  41. begin
  42. TargetSwitches^.SetCurrSel(RB^.Value);
  43. UpdateTarget;
  44. end;
  45. Dispose(D, Done);
  46. end;
  47. procedure TIDEApp.UpdateTarget;
  48. var TargetMenu : PMenuItem;
  49. begin
  50. TargetMenu:=PAdvancedMenuBar(MenuBar)^.GetMenuItem(cmTarget);
  51. if assigned(TargetMenu) then
  52. begin
  53. If assigned(TargetMenu^.Param) then
  54. DisposeStr(TargetMenu^.Param);
  55. TargetMenu^.Param:=NewStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
  56. end;
  57. end;
  58. procedure TIDEApp.DoPrimaryFile;
  59. var
  60. D : PFileDialog;
  61. FileName : string;
  62. begin
  63. New(D, Init('*.pri;*.pas','Primary file','*.pri;*.pas',fdOpenButton,0));
  64. if Desktop^.ExecView(D)<>cmCancel then
  65. begin
  66. D^.GetFileName(FileName);
  67. SetPrimaryFile(FileName);
  68. UpdatePrimaryFile;
  69. end;
  70. end;
  71. procedure TIDEApp.DoClearPrimary;
  72. begin
  73. PrimaryFile:='';
  74. PrimaryFileMain:='';
  75. PrimaryFileSwitches:='';
  76. PrimaryFilePara:='';
  77. UpdatePrimaryFile;
  78. end;
  79. procedure TIDEApp.DoInformation;
  80. begin
  81. if ProgramInfoWindow=nil then
  82. begin
  83. New(ProgramInfoWindow, Init);
  84. Desktop^.Insert(ProgramInfoWindow);
  85. end;
  86. with ProgramInfoWindow^ do
  87. begin
  88. if not GetState(sfVisible) then
  89. Show;
  90. MakeFirst;
  91. end;
  92. end;
  93. procedure TIDEApp.DoCompilerMessages;
  94. begin
  95. if not CompilerMessageWindow^.GetState(sfVisible) then
  96. CompilerMessageWindow^.Show;
  97. CompilerMessageWindow^.MakeFirst;
  98. end;
  99. {
  100. $Log$
  101. Revision 1.6 1999-06-25 00:37:56 pierre
  102. + UpdateTarget to see current target main in Menu
  103. Revision 1.5 1999/04/07 21:55:49 peter
  104. + object support for browser
  105. * html help fixes
  106. * more desktop saving things
  107. * NODEBUG directive to exclude debugger
  108. Revision 1.4 1999/03/19 16:04:30 peter
  109. * new compiler dialog
  110. Revision 1.3 1999/03/12 01:13:59 peter
  111. * flag if trytoopen should look for other extensions
  112. + browser tab in the tools-compiler
  113. Revision 1.2 1998/12/28 15:47:46 peter
  114. + Added user screen support, display & window
  115. + Implemented Editor,Mouse Options dialog
  116. + Added location of .INI and .CFG file
  117. + Option (INI) file managment implemented (see bottom of Options Menu)
  118. + Switches updated
  119. + Run program
  120. Revision 1.1 1998/12/22 14:27:54 peter
  121. * moved
  122. Revision 1.3 1998/12/22 10:39:44 peter
  123. + Switches are now written/read
  124. + find and replace routines
  125. }