fpmcomp.inc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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, dialog_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, label_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. { we allways need to recompile if we change
  44. the target OS PM }
  45. if L<>RB^.Value then
  46. PrevMainFile:='';
  47. UpdateTarget;
  48. end;
  49. Dispose(D, Done);
  50. end;
  51. procedure TIDEApp.UpdateTarget;
  52. var TargetMenu : PMenuItem;
  53. begin
  54. TargetMenu:=PAdvancedMenuBar(MenuBar)^.GetMenuItem(cmTarget);
  55. if assigned(TargetMenu) then
  56. begin
  57. If assigned(TargetMenu^.Param) then
  58. DisposeStr(TargetMenu^.Param);
  59. TargetMenu^.Param:=NewStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
  60. end;
  61. end;
  62. procedure TIDEApp.UpdateMode;
  63. var ModeMenu : PMenuItem;
  64. begin
  65. ModeMenu:=PAdvancedMenuBar(MenuBar)^.GetMenuItem(cmSwitchesMode);
  66. if assigned(ModeMenu) then
  67. begin
  68. If assigned(ModeMenu^.Param) then
  69. DisposeStr(ModeMenu^.Param);
  70. ModeMenu^.Param:=NewStr(KillTilde(SwitchesModeName[SwitchesMode]));
  71. end;
  72. end;
  73. procedure TIDEApp.DoPrimaryFile;
  74. var
  75. D : PFileDialog;
  76. FileName : string;
  77. begin
  78. New(D, Init('*.pri;*.pas',label_primaryfile_primaryfile,'*.pri;*.pas',fdOpenButton,hidPrimaryFile));
  79. if Desktop^.ExecView(D)<>cmCancel then
  80. begin
  81. D^.GetFileName(FileName);
  82. SetPrimaryFile(FileName);
  83. UpdatePrimaryFile;
  84. end;
  85. end;
  86. procedure TIDEApp.DoClearPrimary;
  87. begin
  88. PrimaryFile:='';
  89. PrimaryFileMain:='';
  90. PrimaryFileSwitches:='';
  91. PrimaryFilePara:='';
  92. UpdatePrimaryFile;
  93. end;
  94. procedure TIDEApp.DoInformation;
  95. begin
  96. if ProgramInfoWindow=nil then
  97. begin
  98. New(ProgramInfoWindow, Init);
  99. Desktop^.Insert(ProgramInfoWindow);
  100. end;
  101. with ProgramInfoWindow^ do
  102. begin
  103. if not GetState(sfVisible) then
  104. Show;
  105. MakeFirst;
  106. end;
  107. end;
  108. procedure TIDEApp.DoCompilerMessages;
  109. begin
  110. if not CompilerMessageWindow^.GetState(sfVisible) then
  111. CompilerMessageWindow^.Show;
  112. CompilerMessageWindow^.MakeFirst;
  113. end;
  114. {
  115. $Log$
  116. Revision 1.2 2000-10-31 22:35:54 pierre
  117. * New big merge from fixes branch
  118. Revision 1.1.2.1 2000/10/18 21:53:27 pierre
  119. * several Gabor fixes
  120. Revision 1.1 2000/07/13 09:48:35 michael
  121. + Initial import
  122. Revision 1.9 2000/05/02 08:42:28 pierre
  123. * new set of Gabor changes: see fixes.txt
  124. Revision 1.8 2000/03/07 21:45:33 pierre
  125. + TIDEApp.UpdateMode
  126. Revision 1.7 2000/01/10 14:59:08 pierre
  127. * force recompiling if we change target OS
  128. Revision 1.6 1999/06/25 00:37:56 pierre
  129. + UpdateTarget to see current target main in Menu
  130. Revision 1.5 1999/04/07 21:55:49 peter
  131. + object support for browser
  132. * html help fixes
  133. * more desktop saving things
  134. * NODEBUG directive to exclude debugger
  135. Revision 1.4 1999/03/19 16:04:30 peter
  136. * new compiler dialog
  137. Revision 1.3 1999/03/12 01:13:59 peter
  138. * flag if trytoopen should look for other extensions
  139. + browser tab in the tools-compiler
  140. Revision 1.2 1998/12/28 15:47:46 peter
  141. + Added user screen support, display & window
  142. + Implemented Editor,Mouse Options dialog
  143. + Added location of .INI and .CFG file
  144. + Option (INI) file managment implemented (see bottom of Options Menu)
  145. + Switches updated
  146. + Run program
  147. Revision 1.1 1998/12/22 14:27:54 peter
  148. * moved
  149. Revision 1.3 1998/12/22 10:39:44 peter
  150. + Switches are now written/read
  151. + find and replace routines
  152. }