fpmcomp.inc 4.7 KB

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