fpmcomp.inc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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,60,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.DoCompilerMessages;
  97. begin
  98. if not CompilerMessageWindow^.GetState(sfVisible) then
  99. CompilerMessageWindow^.Show;
  100. CompilerMessageWindow^.MakeFirst;
  101. end;
  102. {
  103. $Log$
  104. Revision 1.4 2004-11-08 20:28:26 peter
  105. * Breakpoints are now deleted when removed from source, disabling is
  106. still possible from the breakpoint list
  107. * COMPILER_1_0, FVISION, GABOR defines removed, only support new
  108. FV and 1.9.x compilers
  109. * Run directory added to Run menu
  110. * Useless programinfo window removed
  111. Revision 1.3 2004/11/03 12:05:54 florian
  112. + supported targets are now read dynamically from the included compiler
  113. Revision 1.2 2002/09/07 15:40:43 peter
  114. * old logs removed and tabs fixed
  115. }