fpmcomp.inc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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.2 2002-09-07 15:40:43 peter
  119. * old logs removed and tabs fixed
  120. }