fpmcomp.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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.DoPrimaryFile;
  63. var
  64. D : PFileDialog;
  65. FileName : string;
  66. begin
  67. New(D, Init('*.pri;*.pas','Primary file','*.pri;*.pas',fdOpenButton,0));
  68. if Desktop^.ExecView(D)<>cmCancel then
  69. begin
  70. D^.GetFileName(FileName);
  71. SetPrimaryFile(FileName);
  72. UpdatePrimaryFile;
  73. end;
  74. end;
  75. procedure TIDEApp.DoClearPrimary;
  76. begin
  77. PrimaryFile:='';
  78. PrimaryFileMain:='';
  79. PrimaryFileSwitches:='';
  80. PrimaryFilePara:='';
  81. UpdatePrimaryFile;
  82. end;
  83. procedure TIDEApp.DoInformation;
  84. begin
  85. if ProgramInfoWindow=nil then
  86. begin
  87. New(ProgramInfoWindow, Init);
  88. Desktop^.Insert(ProgramInfoWindow);
  89. end;
  90. with ProgramInfoWindow^ do
  91. begin
  92. if not GetState(sfVisible) then
  93. Show;
  94. MakeFirst;
  95. end;
  96. end;
  97. procedure TIDEApp.DoCompilerMessages;
  98. begin
  99. if not CompilerMessageWindow^.GetState(sfVisible) then
  100. CompilerMessageWindow^.Show;
  101. CompilerMessageWindow^.MakeFirst;
  102. end;
  103. {
  104. $Log$
  105. Revision 1.7 2000-01-10 14:59:08 pierre
  106. * force recompiling if we change target OS
  107. Revision 1.6 1999/06/25 00:37:56 pierre
  108. + UpdateTarget to see current target main in Menu
  109. Revision 1.5 1999/04/07 21:55:49 peter
  110. + object support for browser
  111. * html help fixes
  112. * more desktop saving things
  113. * NODEBUG directive to exclude debugger
  114. Revision 1.4 1999/03/19 16:04:30 peter
  115. * new compiler dialog
  116. Revision 1.3 1999/03/12 01:13:59 peter
  117. * flag if trytoopen should look for other extensions
  118. + browser tab in the tools-compiler
  119. Revision 1.2 1998/12/28 15:47:46 peter
  120. + Added user screen support, display & window
  121. + Implemented Editor,Mouse Options dialog
  122. + Added location of .INI and .CFG file
  123. + Option (INI) file managment implemented (see bottom of Options Menu)
  124. + Switches updated
  125. + Run program
  126. Revision 1.1 1998/12/22 14:27:54 peter
  127. * moved
  128. Revision 1.3 1998/12/22 10:39:44 peter
  129. + Switches are now written/read
  130. + find and replace routines
  131. }