fpmopts.inc 49 KB

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