fpmopts.inc 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  1. {
  2. This file is part of the Free Pascal Integrated Development Environment
  3. Copyright (c) 1998 by Berczi Gabor
  4. Options menu entries
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. procedure TIDEApp.SetSwitchesMode;
  12. var R,R2: TRect;
  13. D: PCenterDialog;
  14. RB: PRadioButtons;
  15. i : TSwitchMode;
  16. SwitchesCount : integer;
  17. LastItem: PSItem;
  18. L: longint;
  19. begin
  20. SwitchesCount:=ord(high(TSwitchMode))-ord(low(TSwitchMode))+1;
  21. R.Assign(0,0,36,4+SwitchesCount);
  22. New(D, Init(R, dialog_switchesmode));
  23. with D^ do
  24. begin
  25. HelpCtx:=hcSwitchesMode;
  26. GetExtent(R);
  27. R.Grow(-3,-1);
  28. Inc(R.A.Y);
  29. R2.Copy(R);
  30. Inc(R2.A.Y);
  31. R2.B.Y:=R2.A.Y+SwitchesCount;
  32. LastItem:=nil;
  33. for I:=high(TSwitchMode) downto low(TSwitchMode) do
  34. LastItem:=NewSItem(SwitchesModeName[I], LastItem);
  35. New(RB, Init(R2, LastItem));
  36. L:=ord(SwitchesMode);
  37. { ^^^ this is necessary, since TRadioButtons.GetData() reads a full
  38. longint and by just specifying the SwitchesMode var (only 1 bytes),
  39. the three bytes located next to it in the memory will determine the
  40. three most significant bytes of the longint. And if they aren't all
  41. zero, then we will select some items outside the actual ones... }
  42. RB^.SetData(L);
  43. Insert(RB);
  44. R2.Copy(R);
  45. R2.B.Y:=R2.A.Y+1;
  46. Insert(New(PLabel, Init(R2, static_switchesmode_switchesmode, RB)));
  47. end;
  48. InsertButtons(D);
  49. RB^.Select;
  50. if Desktop^.ExecView(D)=cmOK then
  51. SwitchesMode:=TSwitchMode(RB^.Value);
  52. Dispose(D, Done);
  53. UpdateMode;
  54. UpdateTarget;
  55. end;
  56. procedure TIDEApp.DoCompilerSwitch;
  57. var R,R2,R3,TabR,TabIR: TRect;
  58. D: PCenterDialog;
  59. CB1,CB2,CB3,CB4,CB5: PCheckBoxes;
  60. RB1,RB1b,RB2,RB3,RB4,RB5,RB6: PRadioButtons;
  61. Items: PSItem;
  62. IL: PEditorInputLine;
  63. IL2: PEditorInputLine;
  64. Count : integer;
  65. I,L: longint;
  66. Tab: PTab;
  67. Label11,Label12,
  68. Label21,Label22,Label23,Label23b,
  69. Label31,Label41,
  70. Label51,Label52,Label53: PLabel;
  71. begin
  72. R.Assign(0,0,76,21);
  73. New(D, Init(R, dialog_compilerswitches));
  74. with D^ do
  75. begin
  76. HelpCtx:=hcCompilerNoAltX;
  77. GetExtent(R);
  78. R.Grow(-2,-1);
  79. Dec(R.B.Y,2);
  80. TabR.Copy(R);
  81. Dec(TabR.B.Y,2);
  82. TabIR.Copy(R);
  83. Inc(TabIR.A.Y,2);
  84. TabIR.Grow(0,-1);
  85. { --- Sheet 1 --- }
  86. Count:=SyntaxSwitches^.ItemCount;
  87. R.Copy(TabIR);
  88. R2.Copy(R);
  89. R2.B.X:=(R2.A.X+(R2.B.X-R2.A.X) div 2)-3;{ R2.B.X:=R2.B.X-4;}
  90. { R2.B.Y:=R2.A.Y+((Count+1) div 2);}
  91. R2.B.Y:=R2.A.Y+Count;
  92. Items:=nil;
  93. for I:=Count-1 downto 0 do
  94. Items:=NewSItem(SyntaxSwitches^.ItemName(I), Items);
  95. New(CB1, Init(R2, Items));
  96. for I:=0 to Count-1 do
  97. if SyntaxSwitches^.GetBooleanItem(I) then
  98. CB1^.Press(I);
  99. Dec(R2.A.Y);
  100. R2.B.Y:=R2.A.Y+1;
  101. New(Label11, Init(R2, label_compiler_syntaxswitches, CB1));
  102. Count:=CompilerModeSwitches^.ItemCount;
  103. R.Copy(TabIR);
  104. R2.Copy(R);
  105. R2.A.X:=(R2.A.X+(R2.B.X-R2.A.X) div 2)-2;
  106. R2.B.X:=R2.B.X-3;
  107. { R2.B.Y:=R2.A.Y+((Count+1) div 2);}
  108. R2.B.Y:=R2.A.Y+Count;
  109. Items:=nil;
  110. for I:=Count-1 downto 0 do
  111. Items:=NewSItem(CompilerModeSwitches^.ItemName(I), Items);
  112. New(RB2, Init(R2, Items));
  113. L:=CompilerModeSwitches^.GetCurrSel;
  114. RB2^.SetData(L);
  115. Dec(R2.A.Y);
  116. R2.B.Y:=R2.A.Y+1;
  117. New(Label12, Init(R2, label_compiler_mode, RB2));
  118. { --- Sheet 2 --- }
  119. Count:=CodegenSwitches^.ItemCount;
  120. R2.Copy(TabIR);
  121. R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2-2;
  122. R2.B.Y:=R2.A.Y+Count;
  123. Items:=nil;
  124. for I:=Count-1 downto 0 do
  125. Items:=NewSItem(CodegenSwitches^.ItemName(I), Items);
  126. New(CB3, Init(R2, Items));
  127. for I:=0 to Count-1 do
  128. if CodegenSwitches^.GetBooleanItem(I) then
  129. CB3^.Press(I);
  130. Dec(R2.A.Y);
  131. R2.B.Y:=R2.A.Y+1;
  132. New(Label21, Init(R2, label_compiler_runtimechecks, CB3));
  133. Count:=OptimizingGoalSwitches^.ItemCount;
  134. R2.Copy(TabIR);
  135. R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
  136. Dec(R2.B.X,4);
  137. R2.B.Y:=R2.A.Y+Count;
  138. Items:=nil;
  139. for I:=Count-1 downto 0 do
  140. Items:=NewSItem(OptimizingGoalSwitches^.ItemName(I), Items);
  141. New(RB3, Init(R2, Items));
  142. L:=OptimizingGoalSwitches^.GetCurrSel;
  143. RB3^.SetData(L);
  144. Dec(R2.A.Y);
  145. R2.B.Y:=R2.A.Y+1;
  146. New(Label22, Init(R2, label_compiler_optimizations, RB3));
  147. Count:=OptimizationSwitches^.ItemCount;
  148. R2.Copy(TabIR);
  149. R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
  150. Dec(R2.B.X,4);
  151. Inc(R2.A.Y, OptimizingGoalSwitches^.ItemCount);
  152. R2.B.Y:=R2.A.Y+Count;
  153. Items:=nil;
  154. for I:=Count-1 downto 0 do
  155. Items:=NewSItem(OptimizationSwitches^.ItemName(I), Items);
  156. New(CB2, Init(R2, Items));
  157. for I:=0 to Count-1 do
  158. if OptimizationSwitches^.GetBooleanItem(I) then
  159. CB2^.Press(I);
  160. Dec(R2.A.Y);
  161. R2.B.Y:=R2.A.Y+1;
  162. { --- Sheet 3 --- }
  163. Count:=ProcessorOptimizationSwitches^.ItemCount;
  164. R.Copy(TabIR);
  165. R2.Copy(R);
  166. R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
  167. Dec(R2.B.X,4);
  168. R2.B.Y:=R2.A.Y+Count;
  169. Items:=nil;
  170. for I:=Count-1 downto 0 do
  171. Items:=NewSItem(ProcessorOptimizationSwitches^.ItemName(I), Items);
  172. New(RB1, Init(R2, Items));
  173. L:=ProcessorOptimizationSwitches^.GetCurrSel;
  174. RB1^.SetData(L);
  175. Dec(R2.A.Y);
  176. R2.B.Y:=R2.A.Y+1;
  177. New(Label23, Init(R2, label_compiler_opt_targetprocessor, RB1));
  178. Count:=ProcessorCodeGenerationSwitches^.ItemCount;
  179. R.Copy(TabIR);
  180. R2.Copy(R);
  181. R2.A.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
  182. R2.B.X:=R2.B.X-3;
  183. R2.B.Y:=R2.A.Y+Count;
  184. Items:=nil;
  185. for I:=Count-1 downto 0 do
  186. Items:=NewSItem(ProcessorCodeGenerationSwitches^.ItemName(I), Items);
  187. New(RB1b, Init(R2, Items));
  188. L:=ProcessorCodeGenerationSwitches^.GetCurrSel;
  189. RB1b^.SetData(L);
  190. Dec(R2.A.Y);
  191. R2.B.Y:=R2.A.Y+1;
  192. New(Label23b, Init(R2, label_compiler_codegen_targetprocessor, RB1b));
  193. { --- Sheet 4 --- }
  194. Count:=VerboseSwitches^.ItemCount;
  195. R.Copy(TabIR);
  196. R2.Copy(R);
  197. R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
  198. R2.B.Y:=R2.A.Y+Count;
  199. Items:=nil;
  200. for I:=Count-1 downto 0 do
  201. Items:=NewSItem(VerboseSwitches^.ItemName(I), Items);
  202. New(CB4, Init(R2, Items));
  203. for I:=0 to Count-1 do
  204. if VerboseSwitches^.GetBooleanItem(I) then
  205. CB4^.Press(I);
  206. Dec(R2.A.Y);
  207. R2.B.Y:=R2.A.Y+1;
  208. New(Label31, Init(R2, label_compiler_verboseswitches, CB4));
  209. { --- Sheet 5 --- }
  210. Count:=BrowserSwitches^.ItemCount;
  211. R.Copy(TabIR);
  212. R2.Copy(R);
  213. R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
  214. R2.B.Y:=R2.A.Y+Count;
  215. Items:=nil;
  216. for I:=Count-1 downto 0 do
  217. Items:=NewSItem(BrowserSwitches^.ItemName(I), Items);
  218. New(RB4, Init(R2, Items));
  219. L:=BrowserSwitches^.GetCurrSel;
  220. RB4^.SetData(L);
  221. Dec(R2.A.Y);
  222. R2.B.Y:=R2.A.Y+1;
  223. New(Label41, Init(R2, label_compiler_browser, RB4));
  224. { --- Sheet 6 --- }
  225. Count:=AsmReaderSwitches^.ItemCount;
  226. R2.Copy(TabIR);
  227. R2.B.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
  228. Dec(R2.B.X,4);
  229. R2.B.Y:=R2.A.Y+Count;
  230. Items:=nil;
  231. for I:=Count-1 downto 0 do
  232. Items:=NewSItem(AsmReaderSwitches^.ItemName(I), Items);
  233. New(RB5, Init(R2, Items));
  234. L:=AsmReaderSwitches^.GetCurrSel;
  235. RB5^.SetData(L);
  236. Dec(R2.A.Y);
  237. R2.B.Y:=R2.A.Y+1;
  238. New(Label51, Init(R2, label_compiler_assemblerreader, RB5));
  239. R2.Copy(TabIR);
  240. R2.B.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
  241. Dec(R2.B.X,4);
  242. R2.A.Y:=R2.A.Y+Count+2;
  243. Count:=AsmInfoSwitches^.ItemCount;
  244. R2.B.Y:=R2.A.Y+Count;
  245. Items:=nil;
  246. for I:=Count-1 downto 0 do
  247. Items:=NewSItem(AsmInfoSwitches^.ItemName(I), Items);
  248. New(CB5, Init(R2, Items));
  249. for I:=0 to Count-1 do
  250. if AsmInfoSwitches^.GetBooleanItem(I) then
  251. CB5^.Press(I);
  252. Dec(R2.A.Y);
  253. R2.B.Y:=R2.A.Y+1;
  254. New(Label52, Init(R2, label_compiler_assemblerinfo, CB5));
  255. Count:=AsmOutputSwitches^.ItemCount;
  256. R2.Copy(TabIR);
  257. R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
  258. Dec(R2.B.X,4);
  259. R2.B.Y:=R2.A.Y+Count;
  260. Items:=nil;
  261. UpdateAsmOutputSwitches;
  262. for I:=Count-1 downto 0 do
  263. Items:=NewSItem(AsmOutputSwitches^.ItemName(I), Items);
  264. New(RB6, Init(R2, Items));
  265. L:=AsmOutputSwitches^.GetCurrSel;
  266. RB6^.SetData(L);
  267. Dec(R2.A.Y);
  268. R2.B.Y:=R2.A.Y+1;
  269. New(Label53, Init(R2, label_compiler_assembleroutput, RB6));
  270. { create tabs }
  271. New(Tab, Init(TabR,
  272. NewTabDef(page_compiler_syntax,CB1,
  273. NewTabItem(Label11,
  274. NewTabItem(CB1,
  275. NewTabItem(Label12,
  276. NewTabItem(RB2,
  277. nil)))),
  278. NewTabDef(page_compiler_codegeneration,CB3,
  279. NewTabItem(Label21,
  280. NewTabItem(CB3,
  281. NewTabItem(Label22,
  282. NewTabItem(CB2,
  283. NewTabItem(RB3,
  284. nil))))),
  285. NewTabDef('~P~rocessor',RB1,
  286. NewTabItem(Label23,
  287. NewTabItem(RB1,
  288. NewTabItem(Label23b,
  289. NewTabItem(RB1b,
  290. nil)))),
  291. NewTabDef(page_compiler_verbose,CB4,
  292. NewTabItem(Label31,
  293. NewTabItem(CB4,
  294. nil)),
  295. NewTabDef(page_compiler_browser,RB4,
  296. NewTabItem(Label41,
  297. NewTabItem(RB4,
  298. nil)),
  299. NewTabDef(page_compiler_assembler,CB1,
  300. NewTabItem(Label51,
  301. NewTabItem(RB5,
  302. NewTabItem(Label52,
  303. NewTabItem(CB5,
  304. NewTabItem(Label53,
  305. NewTabItem(RB6,
  306. nil)))))),
  307. nil))))))));
  308. Tab^.GrowMode:=0;
  309. Insert(Tab);
  310. { conditionnals }
  311. R2.Copy(TabR); R2.A.Y:=R2.B.Y+1; R2.B.Y:=R2.A.Y+1; Dec(R2.B.X,4);
  312. New(IL, Init(R2, 255));
  313. IL^.Data^:=ConditionalSwitches^.GetStringItem(0);
  314. Insert(IL);
  315. R3.Copy(R2); R3.A.X:=R2.B.X+1; R3.B.X:=R3.A.X+3;
  316. Insert(New(PHistory, Init(R3, IL, hidConditionalDefines)));
  317. R2.Move(0,-1);
  318. Insert(New(PLabel, Init(R2,ConditionalSwitches^.ItemName(0), IL)));
  319. {custom }
  320. inc(R2.A.Y,3); inc(R2.B.Y,3);
  321. New(IL2, Init(R2, 255));
  322. IL2^.Data^:=CustomArg[SwitchesMode];
  323. Insert(IL2);
  324. R3.Copy(R2); R3.A.X:=R2.B.X+1; R3.B.X:=R3.A.X+3;
  325. Insert(New(PHistory, Init(R3, IL2, hidCompilerArgs)));
  326. R2.Move(0,-1);
  327. Insert(New(PLabel, Init(R2,label_debugger_compilerargs, IL2)));
  328. end;
  329. InsertButtons(D);
  330. if Desktop^.ExecView(D)=cmOK then
  331. begin
  332. for I:=0 to SyntaxSwitches^.ItemCount-1 do
  333. SyntaxSwitches^.SetBooleanItem(I,CB1^.Mark(I));
  334. CompilerModeSwitches^.SetCurrSel(RB2^.Value);
  335. for I:=0 to CodeGenSwitches^.ItemCount-1 do
  336. CodegenSwitches^.SetBooleanItem(I,CB3^.Mark(I));
  337. for I:=0 to OptimizationSwitches^.ItemCount-1 do
  338. OptimizationSwitches^.SetBooleanItem(I,CB2^.Mark(I));
  339. for I:=0 to VerboseSwitches^.ItemCount-1 do
  340. VerboseSwitches^.SetBooleanItem(I,CB4^.Mark(I));
  341. OptimizingGoalSwitches^.SetCurrSel(RB3^.Value);
  342. ProcessorOptimizationSwitches^.SetCurrSel(RB1^.Value);
  343. ProcessorCodeGenerationSwitches^.SetCurrSel(RB1b^.Value);
  344. AsmReaderSwitches^.SetCurrSel(RB5^.Value);
  345. for I:=0 to AsmInfoSwitches^.ItemCount-1 do
  346. AsmInfoSwitches^.SetBooleanItem(I,CB5^.Mark(I));
  347. AsmOutputSwitches^.SetCurrSel(RB6^.Value);
  348. BrowserSwitches^.SetCurrSel(RB4^.Value);
  349. ConditionalSwitches^.SetStringItem(0,IL^.Data^);
  350. CustomArg[SwitchesMode]:=IL2^.Data^;
  351. end;
  352. Dispose(D, Done);
  353. end;
  354. procedure TIDEApp.MemorySizes;
  355. var R,R2,R3: TRect;
  356. D: PCenterDialog;
  357. ILs: array[0..10] of PIntegerLine;
  358. I: integer;
  359. begin
  360. R.Assign(0,0,40,2+MemorySwitches^.ItemCount*2);
  361. New(D, Init(R, dialog_memorysizes));
  362. with D^ do
  363. begin
  364. HelpCtx:=hcmemorysizes;
  365. GetExtent(R); R.Grow(-3,-1);
  366. R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+1;
  367. for I:=0 to MemorySwitches^.ItemCount-1 do
  368. begin
  369. R3.Copy(R2); R3.A.X:=21; R3.B.X:=R3.A.X+10;
  370. New(ILs[I], Init(R3, MinMemSize, MaxMemSize));
  371. ILs[I]^.Data^:=IntToStr(MemorySwitches^.GetLongintItem(I));
  372. Insert(ILs[I]);
  373. R3.Copy(R2); R3.B.X:=21;
  374. Insert(New(PLabel, Init(R3, MemorySwitches^.ItemName(I), ILs[I])));
  375. R2.Move(0,2);
  376. end;
  377. { R3.Copy(R2); R3.A.X:=21; R3.B.X:=R3.A.X+10;
  378. New(IL2, Init(R3, MinHeapSize, MaxHeapSize));
  379. IL2^.Data^:=IntToStr(GetHeapSize);
  380. Insert(IL2);
  381. R3.Copy(R2); R3.B.X:=21;
  382. Insert(New(PLabel, Init(R3, 'Local ~h~eap size', IL2)));}
  383. end;
  384. InsertButtons(D);
  385. ILs[0]^.Select;
  386. if Desktop^.ExecView(D)=cmOK then
  387. begin
  388. for I:=0 to MemorySwitches^.ItemCount-1 do
  389. begin
  390. MemorySwitches^.SetLongintItem(I,StrToInt(ILs[I]^.Data^));
  391. end;
  392. { SetStackSize(StrToInt(IL1^.Data^));
  393. SetHeapSize(StrToInt(IL2^.Data^));}
  394. end;
  395. Dispose(D, Done);
  396. end;
  397. procedure TIDEApp.DoLinkerSwitch;
  398. var R,R2: TRect;
  399. D: PCenterDialog;
  400. RB2: PRadioButtons;
  401. CB,CB2 : PCheckBoxes;
  402. Count,I: longint;
  403. Items: PSItem;
  404. L: longint;
  405. begin
  406. R.Assign(0,0,66,8);
  407. New(D, Init(R, dialog_linker));
  408. with D^ do
  409. begin
  410. HelpCtx:=hclinker;
  411. GetExtent(R); R.Grow(-3,-1);
  412. Count:=LinkAfterSwitches^.ItemCount;
  413. R2.Copy(R);
  414. R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 - 1;
  415. Inc(R2.A.Y,1);
  416. R2.B.Y:=R2.A.Y+Count;
  417. Items:=nil;
  418. for I:=Count-1 downto 0 do
  419. Items:=NewSItem(LinkAfterSwitches^.ItemName(I), Items);
  420. New(CB, Init(R2, Items));
  421. for I:=0 to Count-1 do
  422. if LinkAfterSwitches^.GetBooleanItem(I) then
  423. CB^.Press(I);
  424. Insert(CB);
  425. Dec(R2.A.Y);
  426. R2.B.Y:=R2.A.Y+1;
  427. Insert(New(PLabel, Init(R2, label_compiler_linkafter, CB)));
  428. R2.Copy(R);
  429. R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 - 1;
  430. Inc(R2.A.Y,Count+2);
  431. R2.B.Y:=R2.A.Y+1;
  432. Items:=NewSItem(OtherLinkerSwitches^.ItemName(1), Nil);
  433. New(CB2, Init(R2, Items));
  434. if OtherLinkerSwitches^.GetBooleanItem(1) then
  435. CB2^.Press(0);
  436. Insert(CB2);
  437. R2.Copy(R); Inc(R2.A.Y);
  438. R2.B.Y:=R2.A.Y+LibLinkerSwitches^.ItemCount;
  439. R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2+1;
  440. Items:=nil;
  441. for I:=LibLinkerSwitches^.ItemCount-1 downto 0 do
  442. Items:=NewSItem(LibLinkerSwitches^.ItemName(I), Items);
  443. New(RB2, Init(R2, Items));
  444. L:=LibLinkerSwitches^.GetCurrSel;
  445. RB2^.SetData(L);
  446. Insert(RB2);
  447. R2.Copy(R); R2.B.Y:=R2.A.Y+1; R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2+1;
  448. Insert(New(PLabel, Init(R2, label_linker_preferredlibtype, RB2)));
  449. end;
  450. InsertButtons(D);
  451. RB2^.Select;
  452. if Desktop^.ExecView(D)=cmOK then
  453. begin
  454. { SetEXEFormat(TEXEFormat(RB1^.Value+1));}
  455. LibLinkerSwitches^.SetCurrSel(RB2^.Value);
  456. OtherLinkerSwitches^.SetBooleanItem(1,CB2^.Mark(0));
  457. if LibLinkerSwitches^.GetCurrSelParam='X' then
  458. if CompareText(TargetSwitches^.GetCurrSelParam,'Windows')=0 then
  459. if CompareText(AsmOutputSwitches^.GetCurrSelParam,'pecoff')<>0 then
  460. if ConfirmBox(
  461. FormatStrStr3(msg_xmustbesettoyforz_doyouwanttochangethis,
  462. label_compiler_assembleroutput,'pecoff','smartlinking'),nil,false)=cmYes then
  463. AsmOutputSwitches^.SetCurrSelParam('pecoff');
  464. for I:=0 to LinkAfterSwitches^.ItemCount-1 do
  465. LinkAfterSwitches^.SetBooleanItem(I,CB^.Mark(I));
  466. end;
  467. Dispose(D, Done);
  468. end;
  469. procedure TIDEApp.DoDebuggerSwitch;
  470. var R,R2,R3: TRect;
  471. D: PCenterDialog;
  472. RB,RB2 : PRadioButtons;
  473. CBStrip: PCheckBoxes;
  474. {$ifdef Windows}
  475. CB2: PCheckBoxes;
  476. {$endif Windows}
  477. {$ifdef Unix}
  478. IL: PEditorInputLine;
  479. {$endif Unix}
  480. L,I: longint;
  481. Items: PSItem;
  482. const
  483. {$ifdef Windows}
  484. OtherFieldLines = 3;
  485. {$else not Windows}
  486. {$ifdef Unix}
  487. OtherFieldLines = 3;
  488. {$else not Unix}
  489. OtherFieldLines = 0;
  490. {$endif Unix}
  491. {$endif Windows}
  492. begin
  493. R.Assign(0,0,60,2+DebugInfoSwitches^.ItemCount+1+2
  494. +ProfileInfoSwitches^.ItemCount+2+OtherFieldLines);
  495. New(D, Init(R, dialog_debugger));
  496. with D^ do
  497. begin
  498. HelpCtx:=hcdebugger;
  499. { Strip all }
  500. GetExtent(R); R.Grow(-3,-1);
  501. R2.Copy(R); Inc(R2.A.Y,2); R2.B.Y:=R2.A.Y+1;
  502. Items:=NewSItem(OtherLinkerSwitches^.ItemName(0), Nil);
  503. New(CBStrip, Init(R2, Items));
  504. if OtherLinkerSwitches^.GetBooleanItem(0) then
  505. CBStrip^.Press(0);
  506. Insert(CBStrip);
  507. GetExtent(R); R.Grow(-3,-1);
  508. R2.Copy(R); Inc(R2.A.Y,3); R2.B.Y:=R2.A.Y+DebugInfoSwitches^.ItemCount;
  509. Items:=nil;
  510. for I:=DebugInfoSwitches^.ItemCount-1 downto 0 do
  511. Items:=NewSItem(DebugInfoSwitches^.ItemName(I), Items);
  512. New(RB, Init(R2, Items));
  513. L:=DebugInfoSwitches^.GetCurrSel;
  514. RB^.SetData(L);
  515. Insert(RB);
  516. R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+1;
  517. Insert(New(PLabel, Init(R2, label_debugger_debuginfo, RB)));
  518. R2.Copy(R); Inc(R2.A.Y,3+DebugInfoSwitches^.ItemCount+2); R2.B.Y:=R2.A.Y+ProfileInfoSwitches^.ItemCount;
  519. Items:=nil;
  520. for I:=ProfileInfoSwitches^.ItemCount-1 downto 0 do
  521. Items:=NewSItem(ProfileInfoSwitches^.ItemName(I), Items);
  522. New(RB2, Init(R2, Items));
  523. L:=ProfileInfoSwitches^.GetCurrSel;
  524. RB2^.SetData(L);
  525. Insert(RB2);
  526. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  527. Insert(New(PLabel, Init(R2, label_debugger_profileswitches, RB2)));
  528. {$ifdef Windows}
  529. R2.Move(0,ProfileInfoSwitches^.ItemCount+3);
  530. New(CB2,Init(R2,NewSItem(label_debugger_useanotherconsole, nil)));
  531. Insert(CB2);
  532. if DebuggeeTTY<>'' then
  533. L:=1
  534. else
  535. L:=0;
  536. CB2^.SetData(L);
  537. R2.Move(0,-1);
  538. Insert(New(PLabel, Init(R2,label_debugger_redirection, CB2)));
  539. {$endif Windows}
  540. {$ifdef Unix}
  541. R2.Move(0,ProfileInfoSwitches^.ItemCount+3);
  542. New(IL, Init(R2, 255));
  543. IL^.Data^:=DebuggeeTTY;
  544. Insert(IL);
  545. R2.Move(0,-1);
  546. Insert(New(PLabel, Init(R2,label_debugger_useanothertty, IL)));
  547. {$endif Windows}
  548. end;
  549. InsertButtons(D);
  550. RB^.Select;
  551. if Desktop^.ExecView(D)=cmOK then
  552. begin
  553. DebugInfoSwitches^.SetCurrSel(RB^.Value);
  554. ProfileInfoSwitches^.SetCurrSel(RB2^.Value);
  555. OtherLinkerSwitches^.SetBooleanItem(0,CBStrip^.Mark(0));
  556. {$ifdef Windows}
  557. if CB2^.value<>0 then
  558. DebuggeeTTY:='on'
  559. else
  560. DebuggeeTTY:='';
  561. {$endif Windows}
  562. {$ifdef Unix}
  563. DebuggeeTTY:=IL^.Data^;
  564. {$endif Unix}
  565. end;
  566. Dispose(D, Done);
  567. end;
  568. {$ifdef SUPPORT_REMOTE}
  569. procedure TIDEApp.DoRemote;
  570. var R,R2: TRect;
  571. IL1,IL2,IL3,IL4,IL5,IL6: PEditorInputLine;
  572. D: PCenterDialog;
  573. const
  574. FieldLines = 6;
  575. begin
  576. {
  577. RemoteMachine : string = '';
  578. RemotePort : string = '2345';
  579. RemoteConfig : string = '';
  580. RemoteIdent : string = '';
  581. RemoteDir : string = '';
  582. RemoteSendCommand : string = 'scp $CONFIG $IDENT $LOCALFILE $REMOTEMACHINE:$REMOTEDIR';
  583. }
  584. R.Assign(0,0,60,2+2*FieldLines+2);
  585. New(D, Init(R, dialog_remote));
  586. with D^ do
  587. begin
  588. HelpCtx:=hcremotedialog;
  589. GetExtent(R); R.Grow(-3,-1);
  590. R2.Copy(R);
  591. R2.B.Y:=R2.A.Y+1;
  592. { remote machine name }
  593. R2.Move(0,3);
  594. New(IL1, Init(R2, 255));
  595. IL1^.Data^:=RemoteMachine;
  596. Insert(IL1);
  597. R2.Move(0,-1);
  598. Insert(New(PLabel, Init(R2,label_remote_machine, IL1)));
  599. { remote machine port }
  600. R2.Move(0,3);
  601. New(IL2, Init(R2, 255));
  602. IL2^.Data^:=RemotePort;
  603. Insert(IL2);
  604. R2.Move(0,-1);
  605. Insert(New(PLabel, Init(R2,label_remote_port, IL2)));
  606. { remote machine dir }
  607. R2.Move(0,3);
  608. New(IL3, Init(R2, 255));
  609. IL3^.Data^:=RemoteDir;
  610. Insert(IL3);
  611. R2.Move(0,-1);
  612. Insert(New(PLabel, Init(R2,label_remote_dir, IL3)));
  613. { remote machine config }
  614. R2.Move(0,3);
  615. New(IL4, Init(R2, 255));
  616. IL4^.Data^:=RemoteConfig;
  617. Insert(IL4);
  618. R2.Move(0,-1);
  619. Insert(New(PLabel, Init(R2,label_remote_config, IL4)));
  620. { remote machine ident }
  621. R2.Move(0,3);
  622. New(IL5, Init(R2, 255));
  623. IL5^.Data^:=RemoteIdent;
  624. Insert(IL5);
  625. R2.Move(0,-1);
  626. Insert(New(PLabel, Init(R2,label_remote_ident, IL5)));
  627. { remote machine command }
  628. R2.Move(0,3);
  629. New(IL6, Init(R2, 255));
  630. IL6^.Data^:=RemoteSendCommand;
  631. Insert(IL6);
  632. R2.Move(0,-1);
  633. Insert(New(PLabel, Init(R2,label_remote_command, IL6)));
  634. end;
  635. InsertButtons(D);
  636. if Desktop^.ExecView(D)=cmOK then
  637. begin
  638. RemoteMachine:=IL1^.Data^;
  639. RemotePort:=IL2^.Data^;
  640. RemoteDir:=IL3^.Data^;
  641. RemoteConfig:=IL4^.Data^;
  642. RemoteIdent:=IL5^.Data^;
  643. RemoteSendCommand:=IL6^.Data^;
  644. end;
  645. Dispose(D, Done);
  646. end;
  647. {$endif SUPPORT_REMOTE}
  648. procedure TIDEApp.directories;
  649. {Shows a window where the user can configure the directories the compilerproc
  650. will search files or output files to.}
  651. var tab:Ptab;
  652. tabR,R,R2:Trect;
  653. D:PCenterDialog;
  654. s,misc_string:string;
  655. E_units,E_includes,E_libraries,E_objects,e:Pfpmemo;
  656. L_units,L_includes,L_libraries,L_objects:Plabel;
  657. c:PunsortedStringCollection;
  658. count,i,j:integer;
  659. IL:array[0..11] of PEditorInputLine;
  660. misc_items:PTabItem;
  661. misc_tabfocus:Pview;
  662. const LW=25;
  663. begin
  664. R.assign(0,0,screenwidth*64 div 80,18);
  665. new(D,init(R,dialog_directories));
  666. if d^.size.x<72 then
  667. misc_string:='~M~isc.'
  668. else
  669. misc_string:='~M~iscellaneous';
  670. {Create editors.}
  671. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  672. new(E_units,init(R,nil,nil,nil));
  673. R.assign(1,3,d^.size.x-4,4);
  674. new(L_units,init(R,'Unit ~d~irectories:',E_units));
  675. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  676. new(E_includes,init(R,nil,nil,nil));
  677. R.assign(1,3,d^.size.x-4,4);
  678. new(L_includes,init(R,'Include ~d~irectories:',E_includes));
  679. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  680. new(E_libraries,init(R,nil,nil,nil));
  681. R.assign(1,3,d^.size.x-4,4);
  682. new(L_libraries,init(R,'Library ~d~irectories:',E_libraries));
  683. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  684. new(E_objects,init(R,nil,nil,nil));
  685. R.assign(1,3,d^.size.x-4,4);
  686. new(L_objects,init(R,'Object file ~d~irectories:',E_objects));
  687. {The switches that are put into the editors are of type multistring.
  688. We add multistrings to the editor. Other inputboxes are created on
  689. demand on the "Miscellaneous" tab.}
  690. R.assign(1,4,d^.size.x-5,5);
  691. count:=DirectorySwitches^.ItemCount;
  692. misc_items:=nil;
  693. misc_tabfocus:=nil;
  694. for i:=0 to count-1 do
  695. begin
  696. if directorySwitches^.GetItemTyp(i)=ot_MultiString then
  697. begin
  698. case directorySwitches^.itemParam(i)[3] of
  699. 'u':
  700. e:=E_units;
  701. 'i':
  702. e:=E_includes;
  703. 'l':
  704. e:=E_libraries;
  705. 'o':
  706. e:=E_objects;
  707. else
  708. messagebox('Internal error: Unknown switch.',nil,mfOkButton);
  709. end;
  710. e^.setcontent(directorySwitches^.getMultiStringItem(i));
  711. e^.addline(''); {Empty line so user can scroll below existing dirs.}
  712. IL[i]:=nil;
  713. end
  714. else
  715. begin
  716. R2.copy(R);
  717. R2.A.X:=LW;
  718. new(IL[i],init(R2,255));
  719. IL[i]^.data^:=DirectorySwitches^.GetStringItem(i);
  720. misc_items:=newTabItem(IL[i],misc_items);
  721. if misc_tabfocus=nil then
  722. misc_tabfocus:=IL[i];
  723. R2.copy(R);
  724. R2.B.X:=LW;
  725. misc_items:=newTabItem(
  726. new(Plabel,init(R2,
  727. DirectorySwitches^.ItemName(i),
  728. IL[i])),
  729. misc_items);
  730. R.move(0,2);
  731. end;
  732. end;
  733. {Create some tabs in the window.}
  734. tabR.assign(1,1,d^.size.x-2,d^.size.y-1);
  735. new(tab,init(tabR,
  736. newtabdef('~U~nits',e_units,
  737. NewTabItem(L_units,
  738. NewTabItem(E_units,
  739. nil)),
  740. NewTabDef('~I~nclude files',E_includes,
  741. NewTabItem(L_includes,
  742. NewTabItem(E_includes,
  743. nil)),
  744. NewTabDef('~L~ibraries',E_libraries,
  745. NewTabItem(L_libraries,
  746. NewTabItem(E_libraries,
  747. nil)),
  748. NewTabDef('~O~bject files',E_objects,
  749. NewTabItem(L_objects,
  750. NewTabItem(E_objects,
  751. nil)),
  752. NewTabDef(misc_string,misc_tabfocus,
  753. misc_items,
  754. nil)))))
  755. ));
  756. tab^.growmode:=0;
  757. d^.insert(tab);
  758. insertbuttons(D);
  759. if desktop^.execview(D)=cmOK then
  760. begin
  761. {Move the data from the window back into the switches.}
  762. for i:=0 to count-1 do
  763. if directorySwitches^.GetItemTyp(i)=ot_MultiString then
  764. begin
  765. case directorySwitches^.itemParam(i)[3] of
  766. 'u':
  767. e:=E_units;
  768. 'i':
  769. e:=E_includes;
  770. 'l':
  771. e:=E_libraries;
  772. 'o':
  773. e:=E_objects;
  774. else
  775. messagebox('Internal error: Unknown switch.',nil,mfOkButton);
  776. end;
  777. c:=directorySwitches^.getMultiStringItem(i);
  778. c^.freeall;
  779. for j:=0 to e^.getlinecount-1 do
  780. begin
  781. s:=e^.getlinetext(j);
  782. {Strip string.}
  783. while (length(s)>0) and (s[length(s)]=' ') do
  784. dec(s[0]);
  785. while (length(s)>0) and (s[1]=' ') do
  786. system.delete(s,1,1);
  787. if s<>'' then
  788. c^.insert(newstr(s));
  789. end;
  790. end
  791. else
  792. begin
  793. s:=IL[i]^.data^;
  794. {Strip string.}
  795. while (length(s)>0) and (s[length(s)]=' ') do
  796. dec(s[0]);
  797. while (length(s)>0) and (s[1]=' ') do
  798. system.delete(s,1,1);
  799. DirectorySwitches^.SetStringItem(i,s);
  800. end;
  801. end;
  802. dispose(D,done);
  803. end;
  804. procedure TIDEApp.Tools;
  805. var
  806. D : PToolsDialog;
  807. begin
  808. D:=New(PToolsDialog, Init);
  809. ExecuteDialog(D,nil);
  810. end;
  811. (*procedure TIDEApp.Preferences;
  812. var R,R2: TRect;
  813. D: PCenterDialog;
  814. RB1 : PRadioButtons;
  815. CountModes : integer;
  816. hp : pvideomodelist;
  817. items : PSItem;
  818. videomode : tvideomode;
  819. i,modevalue : longint;
  820. function ToStr(l : longint) : string;
  821. var
  822. s : string;
  823. begin
  824. str(l,s);
  825. ToStr:=s;
  826. end;
  827. const
  828. color2str : array[false..true] of string = ('in b/w','in color');
  829. begin
  830. GetVideoMode(videomode);
  831. CountModes:=0;
  832. i:=0;
  833. modevalue:=0;
  834. R.Assign(0,0,64,18);
  835. New(D, Init(R, 'Preferences'));
  836. with D^ do
  837. begin
  838. hp:=video.modes;
  839. items:=nil;
  840. r2.assign(2,3,24,17);
  841. while assigned(hp) do
  842. begin
  843. items:=NewSItem(ToStr(hp^.col)+'x'+ToStr(hp^.row)+' '+color2str[hp^.color],items);
  844. if (hp^.col=videomode.col) and (hp^.row=videomode.row) and
  845. (hp^.color=videomode.color) then
  846. modevalue:=i;
  847. inc(CountModes);
  848. { we can't display an infinite number of modes }
  849. if CountModes>=r.b.y-r.a.y+1 then
  850. break;
  851. inc(i);
  852. hp:=hp^.next;
  853. end;
  854. modevalue:=CountModes-modevalue-1;
  855. new(rb1,init(r2,items));
  856. insert(rb1);
  857. rb1^.value:=modevalue;
  858. r2.move(0,-1);r2.b.y:=r2.a.y+1;
  859. insert(new(plabel,init(r2,'~V~ideo mode',rb1)));
  860. end;
  861. InsertButtons(D);
  862. if Desktop^.ExecView(D)=cmOK then
  863. begin
  864. { change video mode ? }
  865. if rb1^.value<>modevalue then
  866. begin
  867. modevalue:=CountModes-rb1^.value-1;
  868. hp:=video.modes;
  869. for i:=1 to modevalue do
  870. hp:=hp^.next;
  871. videomode.col:=hp^.col;
  872. videomode.row:=hp^.row;
  873. videomode.color:=hp^.color;
  874. SetScreenVideoMode(videomode);
  875. end;
  876. end;
  877. Dispose(D, Done);
  878. end;*)
  879. type
  880. PVideoModeCollection = ^TVideoModeCollection;
  881. TVideoModeCollection = object(TSortedCollection)
  882. function Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
  883. procedure FreeItem(Item: Pointer); virtual;
  884. end;
  885. function TVideoModeCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
  886. var R: Sw_integer;
  887. K1: PVideoMode absolute Key1;
  888. K2: PVideoMode absolute Key2;
  889. begin
  890. if K1^.Col<K2^.Col then R:=-1 else
  891. if K1^.Col>K2^.Col then R:= 1 else
  892. if K1^.Row<K2^.Row then R:=-1 else
  893. if K1^.Row>K2^.Row then R:= 1 else
  894. if (K1^.Color=false) and (K2^.Color=true ) then R:=-1 else
  895. if (K1^.Color=true ) and (K2^.Color=false) then R:= 1 else
  896. R:=0;
  897. Compare:=R;
  898. end;
  899. procedure TVideoModeCollection.FreeItem(Item: Pointer);
  900. begin
  901. FreeMem(Item,sizeof(TVideoMode));
  902. end;
  903. procedure TIDEApp.Preferences;
  904. var R,R2: TRect;
  905. D: PCenterDialog;
  906. C: PVideoModeCollection;
  907. VMLB: PVideoModeListBox;
  908. OldScreenMode,VM: TVideoMode;
  909. ScreenModeInfo : array[1..3] of longint;
  910. CurVP,VP: PVideoMode;
  911. RB1: PPlainRadioButtons;
  912. CB1,CB2: PPlainCheckBoxes;
  913. CurIdx: integer;
  914. i : word;
  915. begin
  916. New(C, Init(10,50));
  917. for i:=0 to GetVideoModeCount-1 do
  918. begin
  919. GetVideoModeData(i,VM);
  920. GetMem(VP,sizeof(TVideoMode));
  921. Move(VM,VP^,sizeof(TVideoMode));
  922. C^.Insert(VP);
  923. if (VM.Row=ScreenMode.Row) and (VM.Col=ScreenMode.Col) and
  924. (VM.Color=ScreenMode.Color) then
  925. CurVP:=VP;
  926. end;
  927. R.Assign(0,0,64,15);
  928. New(D, Init(R, dialog_preferences));
  929. with D^ do
  930. begin
  931. HelpCtx:=hcpreferences;
  932. GetExtent(R); R.Grow(-2,-2);
  933. R.B.X:=R.A.X+(R.B.X-R.A.X) div 2 - 1;
  934. R.B.Y:=R.A.Y+3;
  935. R2.Copy(R); R2.Grow(-1,-1);
  936. New(VMLB, Init(R2, Min(4,C^.Count), C));
  937. if CurVP=nil then CurIdx:=-1 else
  938. CurIdx:=C^.IndexOf(CurVP);
  939. if CurIdx<>-1 then
  940. VMLB^.FocusItem(CurIdx);
  941. Insert(New(PGroupView, Init(R, label_preferences_videomode, VMLB)));
  942. Insert(VMLB);
  943. R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+4;
  944. R2.Copy(R); R2.Grow(-1,-1);
  945. New(RB1, Init(R2,
  946. NewSItem(label_preferences_currentdirectory,
  947. NewSItem(label_preferences_configdirectory,
  948. nil))));
  949. RB1^.Press(DesktopLocation);
  950. Insert(New(PGroupView, Init(R, label_preferences_desktopfile, RB1)));
  951. Insert(RB1);
  952. R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+5;
  953. R2.Copy(R); R2.Grow(-1,-1);
  954. New(CB1, Init(R2,
  955. NewSItem(label_preferences_editorfiles,
  956. NewSItem(label_preferences_environment,
  957. NewSItem(label_preferences_desktop,
  958. nil)))));
  959. CB1^.Value:=AutoSaveOptions;
  960. Insert(New(PGroupView, Init(R, label_preferences_autosave, CB1)));
  961. Insert(CB1);
  962. GetExtent(R); R.Grow(-2,-2);
  963. R.A.X:=R.B.X-(R.B.X-R.A.X) div 2 + 1;
  964. R.B.Y:=R.A.Y+7;
  965. R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+5;
  966. R2.Copy(R); R2.Grow(-1,-1);
  967. New(CB2, Init(R2,
  968. NewSItem(label_preferences_autotracksource,
  969. NewSItem(label_preferences_closeongotosource,
  970. NewSItem(label_preferences_changedironopen,
  971. nil)))));
  972. CB2^.Value:=MiscOptions;
  973. Insert(New(PGroupView, Init(R, label_preferences_options, CB2)));
  974. Insert(CB2);
  975. end;
  976. InsertButtons(D);
  977. if Desktop^.ExecView(D)=cmOK then
  978. begin
  979. if (C^.count>0) then
  980. begin
  981. with PVideoMode(C^.At(VMLB^.Focused))^ do
  982. begin
  983. VM.Col:=Col;
  984. VM.Row:=Row;
  985. VM.Color:=Color;
  986. end;
  987. if (VM.Col<>ScreenMode.Col) or (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color) then
  988. Begin
  989. OldScreenMode:=ScreenMode;
  990. SetScreenVideoMode(VM);
  991. if (VM.Col<>ScreenMode.Col) or (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color) then
  992. begin
  993. SetScreenVideoMode(OldScreenMode);
  994. ScreenModeInfo[1]:=VM.col;
  995. ScreenModeInfo[2]:=VM.row;
  996. ScreenModeInfo[3]:=byte(VM.color);
  997. ErrorBox(msg_cantsetscreenmode,@ScreenModeInfo);
  998. end
  999. else
  1000. if TimedMessageBox (msg_confirmnewscreenmode, nil,
  1001. mfConfirmation or mfOKCancel, 15) = cmCancel then
  1002. begin
  1003. SetScreenVideoMode (OldScreenMode);
  1004. ScreenModeInfo [1] := VM.Col;
  1005. ScreenModeInfo [2] := VM.Row;
  1006. ScreenModeInfo [3] := byte (VM.Color);
  1007. end;
  1008. End;
  1009. end;
  1010. AutoSaveOptions:=CB1^.Value;
  1011. MiscOptions:=CB2^.Value;
  1012. DesktopLocation:=RB1^.Value;
  1013. end;
  1014. Dispose(D, Done);
  1015. Dispose(C, Done);
  1016. end;
  1017. procedure TIDEApp.EditorOptions(Editor: PEditor);
  1018. var D: PCenterDialog;
  1019. R,R2,R3: TRect;
  1020. CB: PCheckBoxes;
  1021. ILTab,ILIdent: PIntegerLine;
  1022. ExtIL,TabExtIL: PEditorInputLine;
  1023. TabSize,IndentSize: Integer;
  1024. EFlags,EFValue: Longint;
  1025. Title: string;
  1026. begin
  1027. if Editor=nil then
  1028. begin
  1029. TabSize:=DefaultTabSize; EFlags:=DefaultCodeEditorFlags;
  1030. IndentSize:=DefaultIndentSize;
  1031. Title:=dialog_defaulteditoroptions;
  1032. end
  1033. else
  1034. begin
  1035. TabSize:=Editor^.GetTabSize; EFlags:=Editor^.GetFlags;
  1036. IndentSize:=Editor^.GetIndentSize;
  1037. Title:=dialog_editoroptions;
  1038. end;
  1039. EFValue:=0;
  1040. if (EFlags and efBackupFiles )<>0 then EFValue:=EFValue or (1 shl 0);
  1041. if (EFlags and efInsertMode )<>0 then EFValue:=EFValue or (1 shl 1);
  1042. if (EFlags and efAutoIndent )<>0 then EFValue:=EFValue or (1 shl 2);
  1043. if (EFlags and efUseTabCharacters )<>0 then EFValue:=EFValue or (1 shl 3);
  1044. if (EFlags and efBackSpaceUnindents)<>0 then EFValue:=EFValue or (1 shl 4);
  1045. if (EFlags and efPersistentBlocks )<>0 then EFValue:=EFValue or (1 shl 5);
  1046. if (EFlags and efSyntaxHighlight )<>0 then EFValue:=EFValue or (1 shl 6);
  1047. if (EFlags and efBlockInsCursor )<>0 then EFValue:=EFValue or (1 shl 7);
  1048. if (EFlags and efVerticalBlocks )<>0 then EFValue:=EFValue or (1 shl 8);
  1049. if (EFlags and efHighlightColumn )<>0 then EFValue:=EFValue or (1 shl 9);
  1050. if (EFlags and efHighlightRow )<>0 then EFValue:=EFValue or (1 shl 10);
  1051. if (EFlags and efAutoBrackets )<>0 then EFValue:=EFValue or (1 shl 11);
  1052. if (EFlags and efKeepTrailingSpaces)<>0 then EFValue:=EFValue or (1 shl 12);
  1053. if (EFlags and efCodeComplete )<>0 then EFValue:=EFValue or (1 shl 13);
  1054. if (EFlags and efFolds )<>0 then EFValue:=EFValue or (1 shl 14);
  1055. R.Assign(0,0,66,20);
  1056. New(D, Init(R, Title));
  1057. with D^ do
  1058. begin
  1059. HelpCtx:=hcEditor;
  1060. GetExtent(R); R.Grow(-2,-2); R.B.Y:=R.A.Y+9;
  1061. R2.Copy(R); Inc(R2.A.Y);
  1062. New(CB, Init(R2,
  1063. NewSItem(label_editor_backupfiles,
  1064. NewSItem(label_editor_insertmode,
  1065. NewSItem(label_editor_autoindentmode,
  1066. NewSItem(label_editor_usetabcharacters,
  1067. NewSItem(label_editor_backspaceunindents,
  1068. NewSItem(label_editor_persistentblocks,
  1069. NewSItem(label_editor_syntaxhighlight,
  1070. NewSItem(label_editor_blockinsertcursor,
  1071. NewSItem(label_editor_verticalblocks,
  1072. NewSItem(label_editor_highlightcolumn,
  1073. NewSItem(label_editor_highlightrow,
  1074. NewSItem(label_editor_autoclosingbrackets,
  1075. NewSItem(label_editor_keeptrailingspaces,
  1076. NewSItem(label_editor_codecomplete,
  1077. NewSItem(label_editor_folds,
  1078. nil)))))))))))))))));
  1079. CB^.Value:=EFValue;
  1080. Insert(CB);
  1081. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1082. Insert(New(PLabel, Init(R2, label_editor_editoroptions, CB)));
  1083. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+1;
  1084. R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y;
  1085. R3.Copy(R); Inc(R3.A.X,10); R3.B.X:=R3.A.X+5;
  1086. New(ILTab, Init(R3, 0,100));
  1087. ILTab^.Data^:=IntToStr(TabSize);
  1088. Insert(ILTab);
  1089. R3.Copy(R); R3.B.X:=R3.A.X+10;
  1090. Insert(New(PLabel, Init(R3, label_editor_tabsize, ILTab)));
  1091. R3.Copy(R); Inc(R3.A.X,40); R3.B.X:=R3.A.X+5;
  1092. New(ILIdent, Init(R3, 0,100));
  1093. ILIdent^.Data^:=IntToStr(IndentSize);
  1094. Insert(ILIdent);
  1095. R3.Copy(R); Inc(R3.A.X,28); R3.B.X:=R3.A.X+12;
  1096. Insert(New(PLabel, Init(R3, label_editor_IndentSize, ILIdent)));
  1097. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+2;
  1098. R2.Copy(R); Inc(R2.A.Y);
  1099. New(ExtIL, Init(R2, 128));
  1100. ExtIL^.SetData(HighlightExts);
  1101. Insert(ExtIL);
  1102. R2.Move(0,-1);
  1103. Insert(New(PLabel, Init(R2, label_editor_highlightextensions, ExtIL)));
  1104. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+2;
  1105. R2.Copy(R); Inc(R2.A.Y);
  1106. New(TabExtIL, Init(R2, 128));
  1107. TabExtIL^.SetData(TabsPattern);
  1108. Insert(TabExtIL);
  1109. R2.Move(0,-1);
  1110. Insert(New(PLabel, Init(R2, label_editor_filepatternsneedingtabs, TabExtIL)));
  1111. end;
  1112. InsertButtons(D);
  1113. CB^.Select;
  1114. if Desktop^.ExecView(D)=cmOK then
  1115. begin
  1116. EFlags:=0;
  1117. if (CB^.Value and (1 shl 0))<>0 then EFlags:=EFlags or efBackupFiles;
  1118. if (CB^.Value and (1 shl 1))<>0 then EFlags:=EFlags or efInsertMode;
  1119. if (CB^.Value and (1 shl 2))<>0 then EFlags:=EFlags or efAutoIndent;
  1120. if (CB^.Value and (1 shl 3))<>0 then EFlags:=EFlags or efUseTabCharacters;
  1121. if (CB^.Value and (1 shl 4))<>0 then EFlags:=EFlags or efBackSpaceUnindents;
  1122. if (CB^.Value and (1 shl 5))<>0 then EFlags:=EFlags or efPersistentBlocks;
  1123. if (CB^.Value and (1 shl 6))<>0 then EFlags:=EFlags or efSyntaxHighlight;
  1124. if (CB^.Value and (1 shl 7))<>0 then EFlags:=EFlags or efBlockInsCursor;
  1125. if (CB^.Value and (1 shl 8))<>0 then EFlags:=EFlags or efVerticalBlocks;
  1126. if (CB^.Value and (1 shl 9))<>0 then EFlags:=EFlags or efHighlightColumn;
  1127. if (CB^.Value and (1 shl 10))<>0 then EFlags:=EFlags or efHighlightRow;
  1128. if (CB^.Value and (1 shl 11))<>0 then EFlags:=EFlags or efAutoBrackets;
  1129. if (CB^.Value and (1 shl 12))<>0 then EFlags:=EFlags or efKeepTrailingSpaces;
  1130. if (CB^.Value and (1 shl 13))<>0 then EFlags:=EFlags or efCodeComplete;
  1131. if (CB^.Value and (1 shl 14))<>0 then EFlags:=EFlags or efFolds;
  1132. TabSize:=StrToInt(ILTab^.Data^);
  1133. IndentSize:=StrToInt(ILIdent^.Data^);
  1134. if Editor=nil then
  1135. begin
  1136. DefaultTabSize:=TabSize;
  1137. DefaultIndentSize:=IndentSize;
  1138. DefaultCodeEditorFlags:=EFlags;
  1139. end
  1140. else
  1141. begin
  1142. Editor^.SetIndentSize(IndentSize);
  1143. Editor^.SetTabSize(TabSize);
  1144. Editor^.SetFlags(EFlags);
  1145. end;
  1146. ExtIL^.GetData(HighlightExts);
  1147. TabExtIL^.GetData(TabsPattern);
  1148. end;
  1149. Dispose(D, Done);
  1150. end;
  1151. procedure TIDEApp.CodeComplete;
  1152. var
  1153. D : PCodeCompleteDialog;
  1154. begin
  1155. D:=New(PCodeCompleteDialog, Init);
  1156. ExecuteDialog(D,nil);
  1157. end;
  1158. procedure TIDEApp.CodeTemplates;
  1159. begin
  1160. ExecuteDialog(New(PCodeTemplatesDialog, Init(false,'')),nil);
  1161. end;
  1162. procedure TIDEApp.BrowserOptions(Browser: PBrowserWindow);
  1163. var D: PCenterDialog;
  1164. R,R2,R3 : TRect;
  1165. TitleS: string;
  1166. CB1,CB2: PCheckBoxes;
  1167. RB1,RB2: PRadioButtons;
  1168. begin
  1169. if Browser=nil then
  1170. TitleS:=dialog_browseroptions
  1171. else
  1172. TitleS:=dialog_localbrowseroptions;
  1173. R.Assign(0,0,56,15);
  1174. New(D, Init(R, TitleS));
  1175. with D^ do
  1176. begin
  1177. HelpCtx:=hcBrowser;
  1178. GetExtent(R); R.Grow(-2,-2);
  1179. R.B.Y:=R.A.Y+1+3; R2.Copy(R); Inc(R2.A.Y);
  1180. New(CB1, Init(R2,
  1181. NewSItem(RExpand(label_browser_labels,21+2),
  1182. NewSItem(label_browser_constants,
  1183. NewSItem(label_browser_types,
  1184. NewSItem(label_browser_variables,
  1185. NewSItem(label_browser_procedures,
  1186. NewSItem(label_browser_inherited,
  1187. nil)))))))
  1188. );
  1189. Insert(CB1);
  1190. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1191. Insert(New(PLabel, Init(R2, label_browser_symbols, CB1)));
  1192. R.Move(0,R.B.Y-R.A.Y+1);
  1193. R.B.Y:=R.A.Y+1+2; R2.Copy(R);
  1194. R3.Copy(R2); R3.B.X:=R3.A.X+(R3.B.X-R3.A.X) div 2-1; Inc(R3.A.Y);
  1195. New(RB1, Init(R3,
  1196. NewSItem(label_browser_newbrowser,
  1197. NewSItem(label_browser_currentbrowser,
  1198. nil)))
  1199. );
  1200. Insert(RB1);
  1201. R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
  1202. Insert(New(PLabel, Init(R3, label_browser_subbrowsing, RB1)));
  1203. R3.Copy(R2); R3.A.X:=R3.B.X-(R3.B.X-R3.A.X) div 2+1; Inc(R3.A.Y);
  1204. New(RB2, Init(R3,
  1205. NewSItem(label_browser_scope,
  1206. NewSItem(label_browser_reference,
  1207. nil)))
  1208. );
  1209. Insert(RB2);
  1210. R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
  1211. Insert(New(PLabel, Init(R3, label_browser_preferredpane, RB2)));
  1212. R.Move(0,R.B.Y-R.A.Y+1);
  1213. R.B.Y:=R.A.Y+1+1; R2.Copy(R); Inc(R2.A.Y);
  1214. New(CB2, Init(R2,
  1215. NewSItem(RExpand(label_browser_qualifiedsymbols,21+2),
  1216. NewSItem(label_browser_sortsymbols,
  1217. nil)))
  1218. );
  1219. Insert(CB2);
  1220. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1221. Insert(New(PLabel, Init(R2, label_browser_display, CB2)));
  1222. end;
  1223. InsertButtons(D);
  1224. CB1^.Select;
  1225. if Desktop^.ExecView(D)=cmOK then
  1226. begin
  1227. end;
  1228. Dispose(D, Done);
  1229. end;
  1230. procedure TIDEApp.Startup;
  1231. begin
  1232. NotImplemented;
  1233. end;
  1234. procedure TIDEApp.DesktopOptions;
  1235. var R: TRect;
  1236. D: PCenterDialog;
  1237. CB: PCheckBoxes;
  1238. begin
  1239. R.Assign(0,0,40,12);
  1240. New(D, Init(R, dialog_desktoppreferences));
  1241. with D^ do
  1242. begin
  1243. HelpCtx:=hcDesktopOptions;
  1244. GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.Y:=R.A.Y+8;
  1245. New(CB, Init(R,
  1246. NewSItem(label_desktop_historylists,
  1247. NewSItem(label_desktop_clipboard,
  1248. NewSItem(label_desktop_watches,
  1249. NewSItem(label_desktop_breakpoints,
  1250. NewSItem(label_desktop_openwindow,
  1251. NewSItem(label_desktop_symbolinfo,
  1252. NewSItem(label_desktop_codecompletewords,
  1253. NewSItem(label_desktop_codetemplates,
  1254. nil))))))))));
  1255. CB^.Value:=DesktopFileFlags;
  1256. Insert(CB);
  1257. R.Move(0,-1); R.B.Y:=R.A.Y+1;
  1258. Insert(New(PLabel, Init(R, label_desktop_preservedacrosssessions, CB)));
  1259. end;
  1260. InsertButtons(D);
  1261. CB^.Select;
  1262. if Desktop^.ExecView(D)=cmOK then
  1263. begin
  1264. DesktopFileFlags:=CB^.Value;
  1265. end;
  1266. Dispose(D, Done);
  1267. end;
  1268. procedure TIDEApp.Mouse;
  1269. var R,R2: TRect;
  1270. D: PCenterDialog;
  1271. SB: PScrollBar;
  1272. CB: PCheckBoxes;
  1273. RB1,RB2,RBKB: PRadioButtons;
  1274. begin
  1275. R.Assign(0,0,62,19);
  1276. New(D, Init(R, dialog_mouseoptions));
  1277. with D^ do
  1278. begin
  1279. HelpCtx:=hcMouse;
  1280. GetExtent(R); R.Grow(-3,-2); inc(R.A.Y); R.B.Y:=R.A.Y+2;
  1281. New(RBkb, Init(R,
  1282. NewSItem('~C~UA-91 convention (Shift+Del,Ctrl+Ins,Shift+Ins)',
  1283. NewSItem('~M~icrosoft convention (Ctrl+X,Ctrl+C,Ctrl+V)',
  1284. nil))));
  1285. RBkb^.Press(integer(EditKeys));
  1286. Insert(RBkb);
  1287. R.move(0,-1); R.B.Y:=R.A.Y+1;
  1288. Insert(New(PLabel, Init(R, '~K~eys for cut, copy and paste:', RBkb)));
  1289. R.Move(0,(R.B.Y-R.A.Y)+3); R.B.Y:=R.A.Y+3;
  1290. R2.Copy(R); Inc(R2.A.Y,2); R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 -1;
  1291. New(SB, Init(R2)); SB^.GrowMode:=0; SB^.Options:=SB^.Options or ofSelectable;
  1292. SB^.SetParams(DoubleDelay,1,20,1,1);
  1293. Insert(SB);
  1294. R2.Move(0,-1);
  1295. Insert(New(PStaticText, Init(R2, label_mouse_speedbar)));
  1296. R2.Move(-1,-1);
  1297. Insert(New(PLabel, Init(R2, label_mouse_doubleclickspeed, SB)));
  1298. R2.Copy(R); Inc(R2.A.Y,2); R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2 +1;
  1299. New(CB, Init(R2, NewSItem(label_mouse_reversebuttons, nil) ));
  1300. if MouseReverse then CB^.Press(0);
  1301. Insert(CB);
  1302. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+8;
  1303. R2.Copy(R); Inc(R2.A.Y); R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 -1;
  1304. New(RB1, Init(R2,
  1305. NewSItem(label_mouse_act_nothing,
  1306. NewSItem(label_mouse_act_topicsearch,
  1307. NewSItem(label_mouse_act_gotocursor,
  1308. NewSItem(label_mouse_act_breakpoint,
  1309. NewSItem(label_mouse_act_evaluate,
  1310. NewSItem(label_mouse_act_addwatch,
  1311. NewSItem(label_mouse_act_browsesymbol,
  1312. nil)))))))));
  1313. RB1^.Press(CtrlMouseAction);
  1314. Insert(RB1);
  1315. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1316. Insert(New(PLabel, Init(R2, label_mouse_crtlrightmousebuttonaction, RB1)));
  1317. R2.Copy(R); Inc(R2.A.Y); R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2 +1;
  1318. New(RB2, Init(R2,
  1319. NewSItem(label_mouse_act_nothing,
  1320. NewSItem(label_mouse_act_topicsearch,
  1321. NewSItem(label_mouse_act_gotocursor,
  1322. NewSItem(label_mouse_act_breakpoint,
  1323. NewSItem(label_mouse_act_evaluate,
  1324. NewSItem(label_mouse_act_addwatch,
  1325. NewSItem(label_mouse_act_browsesymbol,
  1326. nil)))))))));
  1327. RB2^.Press(AltMouseAction);
  1328. Insert(RB2);
  1329. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1330. Insert(New(PLabel, Init(R2, label_mouse_altrightmousebuttonaction, RB2)));
  1331. end;
  1332. InsertButtons(D);
  1333. RBkb^.Select;
  1334. if Desktop^.ExecView(D)=cmOK then
  1335. begin
  1336. MouseReverse:=CB^.Mark(0);
  1337. DoubleDelay:=SB^.Value;
  1338. CtrlMouseAction:=RB1^.Value;
  1339. AltMouseAction:=RB2^.Value;
  1340. if Tedit_key_modes(RBkb^.value)<>EditKeys then
  1341. begin
  1342. EditKeys:=Tedit_key_modes(RBkb^.value);
  1343. reload_menubar;
  1344. end;
  1345. end;
  1346. Dispose(D, Done);
  1347. end;
  1348. procedure TIDEApp.Colors;
  1349. {$Ifdef COLORSEL}
  1350. var D: PColorDialog;
  1351. begin
  1352. New(D, Init(AppPalette,
  1353. ColorGroup(label_colors_grp_browser,
  1354. ColorItem(label_colors_framepassive , 215,
  1355. ColorItem(label_colors_frameactive , 216,
  1356. ColorItem(label_colors_frameicon , 217,
  1357. ColorItem(label_colors_scrollbarpage , 218,
  1358. ColorItem(label_colors_scrollbaricons , 219,
  1359. ColorItem(label_colors_normaltext , 220,
  1360. ColorItem(label_colors_selectedtext , 221,
  1361. ColorItem(label_colors_activeitem , 222,
  1362. ColorItem(label_colors_inactiveitem , 223,
  1363. ColorItem(label_colors_focuseditem , 224,
  1364. ColorItem(label_colors_selecteditem , 225,
  1365. ColorItem(label_colors_divider , 226,
  1366. nil)))))))))))),
  1367. ColorGroup(label_colors_grp_clock,
  1368. ColorItem(label_colors_clockview , 227,
  1369. nil),
  1370. ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
  1371. ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
  1372. ColorGroup(label_colors_grp_editor,
  1373. ColorItem(label_colors_framepassive , 167,
  1374. ColorItem(label_colors_frameactive , 168,
  1375. ColorItem(label_colors_frameicon , 169,
  1376. ColorItem(label_colors_scrollbarpage , 170,
  1377. ColorItem(label_colors_scrollbaricons , 171,
  1378. ColorItem(label_colors_normaltext , 199,
  1379. ColorItem(label_colors_selectedtext , 208,
  1380. ColorItem(label_colors_highlighcolumn , 209,
  1381. ColorItem(label_colors_highlightrow , 210,
  1382. ColorItem(label_colors_errormessages , 214,
  1383. nil)))))))))),
  1384. ColorGroup(label_colors_grp_help,
  1385. ColorItem(label_colors_framepassive , 128,
  1386. ColorItem(label_colors_frameactive , 129,
  1387. ColorItem(label_colors_frameicon , 130,
  1388. ColorItem(label_colors_scrollbarpage , 131,
  1389. ColorItem(label_colors_scrollbaricons , 132,
  1390. ColorItem(label_colors_helptext , 160,
  1391. ColorItem(label_colors_helplinks , 161,
  1392. ColorItem(label_colors_selectedlink , 162,
  1393. ColorItem(label_colors_selectedtext , 163,
  1394. ColorItem(label_colors_html_heading1 , 229,
  1395. ColorItem(label_colors_html_heading2 , 230,
  1396. ColorItem(label_colors_html_heading3 , 231,
  1397. ColorItem(label_colors_html_heading4 , 232,
  1398. ColorItem(label_colors_html_heading5 , 233,
  1399. ColorItem(label_colors_html_heading6 , 234,
  1400. nil))))))))))))))),
  1401. ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
  1402. ColorGroup(label_colors_grp_syntax,
  1403. ColorItem(label_colors_whitespace , 200,
  1404. ColorItem(label_colors_comments , 201,
  1405. ColorItem(label_colors_reservedwords , 202,
  1406. ColorItem(label_colors_identifiers , 203,
  1407. ColorItem(label_colors_strings , 204,
  1408. ColorItem(label_colors_numbers , 205,
  1409. ColorItem(label_colors_hexnumbers , 212,
  1410. ColorItem(label_colors_assembler , 206,
  1411. ColorItem(label_colors_symbols , 207,
  1412. ColorItem(label_colors_directives , 211,
  1413. ColorItem(label_colors_tabs , 213,
  1414. nil))))))))))),
  1415. nil))))))))));
  1416. D^.HelpCtx:=hcColors;
  1417. if ExecuteDialog(D, @AppPalette)=cmOK then
  1418. begin
  1419. DoneMemory;
  1420. Message(Application,evBroadcast,cmUpdate,nil);
  1421. ReDraw;
  1422. UpdateScreen(true);
  1423. end;
  1424. end;
  1425. {$else COLORSEL}
  1426. begin
  1427. end;
  1428. {$endif COLORSEL}
  1429. procedure TIDEApp.OpenINI;
  1430. var D: PFileDialog;
  1431. FileName: string;
  1432. begin
  1433. New(D, Init('*'+ExtOf(INIFileName),dialog_openoptions,dialog_ini_filename,fdOpenButton,hidOpenIniFile));
  1434. D^.HelpCtx:=hcOpenIni;
  1435. if Desktop^.ExecView(D)<>cmCancel then
  1436. begin
  1437. D^.GetFileName(FileName);
  1438. if ExistsFile(FileName)=false then ErrorBox(msg_cantopenconfigfile,nil) else
  1439. begin
  1440. IniFileName:=FileName;
  1441. ReadINIFile;
  1442. Message(Application,evBroadcast,cmUpdate,nil);
  1443. end;
  1444. end;
  1445. Dispose(D, Done);
  1446. end;
  1447. procedure TIDEApp.SaveINI;
  1448. begin
  1449. if WriteINIFile(false)=false then
  1450. ErrorBox(msg_errorsavingconfigfile,nil);
  1451. end;
  1452. procedure TIDEApp.SaveAsINI;
  1453. var D: PFileDialog;
  1454. FileName: string;
  1455. CanWrite: boolean;
  1456. begin
  1457. New(D, Init('*'+ExtOf(INIFileName),dialog_saveoptions,dialog_ini_filename,fdOpenButton,hidSaveIniFile));
  1458. D^.HelpCtx:=hcSaveAsINI;
  1459. if Desktop^.ExecView(D)<>cmCancel then
  1460. begin
  1461. D^.GetFileName(FileName);
  1462. CanWrite:=(ExistsFile(FileName)=false);
  1463. if CanWrite=false then
  1464. CanWrite:=ConfirmBox(FormatStrStr(msg_filealreadyexistsoverwrite,SmartPath(FileName)),nil,false)=cmYes;
  1465. if CanWrite then
  1466. begin
  1467. IniFileName:=FileName;
  1468. if WriteINIFile(true)=false then
  1469. ErrorBox(msg_errorsavingconfigfile,nil);
  1470. Message(Application,evBroadcast,cmUpdate,nil);
  1471. end;
  1472. end;
  1473. Dispose(D, Done);
  1474. end;