fpmcomp.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. { 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','Primary file','*.pri;*.pas',fdOpenButton,0));
  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.8 2000-03-07 21:45:33 pierre
  117. + TIDEApp.UpdateMode
  118. Revision 1.7 2000/01/10 14:59:08 pierre
  119. * force recompiling if we change target OS
  120. Revision 1.6 1999/06/25 00:37:56 pierre
  121. + UpdateTarget to see current target main in Menu
  122. Revision 1.5 1999/04/07 21:55:49 peter
  123. + object support for browser
  124. * html help fixes
  125. * more desktop saving things
  126. * NODEBUG directive to exclude debugger
  127. Revision 1.4 1999/03/19 16:04:30 peter
  128. * new compiler dialog
  129. Revision 1.3 1999/03/12 01:13:59 peter
  130. * flag if trytoopen should look for other extensions
  131. + browser tab in the tools-compiler
  132. Revision 1.2 1998/12/28 15:47:46 peter
  133. + Added user screen support, display & window
  134. + Implemented Editor,Mouse Options dialog
  135. + Added location of .INI and .CFG file
  136. + Option (INI) file managment implemented (see bottom of Options Menu)
  137. + Switches updated
  138. + Run program
  139. Revision 1.1 1998/12/22 14:27:54 peter
  140. * moved
  141. Revision 1.3 1998/12/22 10:39:44 peter
  142. + Switches are now written/read
  143. + find and replace routines
  144. }