fpmopts.inc 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  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: PEditorInputLine;
  556. D: PCenterDialog;
  557. const
  558. FieldLines = 6;
  559. begin
  560. {
  561. RemoteMachine : string = '';
  562. RemotePort : string = '2345';
  563. RemoteConfig : string = '';
  564. RemoteIdent : string = '';
  565. RemoteDir : string = '';
  566. RemoteSendCommand : string = 'scp $CONFIG $IDENT $LOCALFILE $REMOTEMACHINE:$REMOTEDIR';
  567. }
  568. R.Assign(0,0,60,2+2*FieldLines+2);
  569. New(D, Init(R, dialog_remote));
  570. with D^ do
  571. begin
  572. HelpCtx:=hcremotedialog;
  573. GetExtent(R); R.Grow(-3,-1);
  574. R2.Copy(R);
  575. R2.B.Y:=R2.A.Y+1;
  576. { remote machine name }
  577. R2.Move(0,3);
  578. New(IL1, Init(R2, 255));
  579. IL1^.Data^:=RemoteMachine;
  580. Insert(IL1);
  581. R2.Move(0,-1);
  582. Insert(New(PLabel, Init(R2,label_remote_machine, IL1)));
  583. { remote machine port }
  584. R2.Move(0,3);
  585. New(IL2, Init(R2, 255));
  586. IL2^.Data^:=RemotePort;
  587. Insert(IL2);
  588. R2.Move(0,-1);
  589. Insert(New(PLabel, Init(R2,label_remote_port, IL2)));
  590. { remote machine dir }
  591. R2.Move(0,3);
  592. New(IL3, Init(R2, 255));
  593. IL3^.Data^:=RemoteDir;
  594. Insert(IL3);
  595. R2.Move(0,-1);
  596. Insert(New(PLabel, Init(R2,label_remote_dir, IL3)));
  597. { remote machine config }
  598. R2.Move(0,3);
  599. New(IL4, Init(R2, 255));
  600. IL4^.Data^:=RemoteConfig;
  601. Insert(IL4);
  602. R2.Move(0,-1);
  603. Insert(New(PLabel, Init(R2,label_remote_config, IL4)));
  604. { remote machine ident }
  605. R2.Move(0,3);
  606. New(IL5, Init(R2, 255));
  607. IL5^.Data^:=RemoteIdent;
  608. Insert(IL5);
  609. R2.Move(0,-1);
  610. Insert(New(PLabel, Init(R2,label_remote_ident, IL5)));
  611. { remote machine command }
  612. R2.Move(0,3);
  613. New(IL6, Init(R2, 255));
  614. IL6^.Data^:=RemoteSendCommand;
  615. Insert(IL6);
  616. R2.Move(0,-1);
  617. Insert(New(PLabel, Init(R2,label_remote_command, IL6)));
  618. end;
  619. InsertButtons(D);
  620. if Desktop^.ExecView(D)=cmOK then
  621. begin
  622. RemoteMachine:=IL1^.Data^;
  623. RemotePort:=IL2^.Data^;
  624. RemoteDir:=IL3^.Data^;
  625. RemoteConfig:=IL4^.Data^;
  626. RemoteIdent:=IL5^.Data^;
  627. RemoteSendCommand:=IL6^.Data^;
  628. end;
  629. Dispose(D, Done);
  630. end;
  631. {$endif SUPPORT_REMOTE}
  632. procedure TIDEApp.directories;
  633. {Shows a window where the user can configure the directories the compilerproc
  634. will search files or output files to.}
  635. var tab:Ptab;
  636. tabR,R,R2:Trect;
  637. D:PCenterDialog;
  638. s,misc_string:string;
  639. E_units,E_includes,E_libraries,E_objects,e:Pfpmemo;
  640. L_units,L_includes,L_libraries,L_objects:Plabel;
  641. c:PunsortedStringCollection;
  642. count,i,j:integer;
  643. IL:array[0..11] of PEditorInputLine;
  644. misc_items:PTabItem;
  645. misc_tabfocus:Pview;
  646. newmisc_items,
  647. temp : PTabItem;
  648. const LW=25;
  649. begin
  650. R.assign(0,0,screenwidth*64 div 80,18);
  651. new(D,init(R,dialog_directories));
  652. if d^.size.x<72 then
  653. misc_string:='~M~isc.'
  654. else
  655. misc_string:='~M~iscellaneous';
  656. {Create editors.}
  657. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  658. new(E_units,init(R,nil,nil,nil));
  659. R.assign(1,3,d^.size.x-4,4);
  660. new(L_units,init(R,'Unit ~d~irectories:',E_units));
  661. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  662. new(E_includes,init(R,nil,nil,nil));
  663. R.assign(1,3,d^.size.x-4,4);
  664. new(L_includes,init(R,'Include ~d~irectories:',E_includes));
  665. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  666. new(E_libraries,init(R,nil,nil,nil));
  667. R.assign(1,3,d^.size.x-4,4);
  668. new(L_libraries,init(R,'Library ~d~irectories:',E_libraries));
  669. R.assign(1,4,d^.size.x-4,d^.size.y-4);
  670. new(E_objects,init(R,nil,nil,nil));
  671. R.assign(1,3,d^.size.x-4,4);
  672. new(L_objects,init(R,'Object file ~d~irectories:',E_objects));
  673. {The switches that are put into the editors are of type multistring.
  674. We add multistrings to the editor. Other inputboxes are created on
  675. demand on the "Miscellaneous" tab.}
  676. R.assign(1,4,d^.size.x-5,5);
  677. count:=DirectorySwitches^.ItemCount;
  678. misc_items:=nil;
  679. misc_tabfocus:=nil;
  680. for i:=0 to count-1 do
  681. begin
  682. if directorySwitches^.GetItemTyp(i)=ot_MultiString then
  683. begin
  684. case directorySwitches^.itemParam(i)[3] of
  685. 'u':
  686. e:=E_units;
  687. 'i':
  688. e:=E_includes;
  689. 'l':
  690. e:=E_libraries;
  691. 'o':
  692. e:=E_objects;
  693. else
  694. messagebox('Internal error: Unknown switch.',nil,mfOkButton);
  695. end;
  696. e^.setcontent(directorySwitches^.getMultiStringItem(i));
  697. e^.addline(''); {Empty line so user can scroll below existing dirs.}
  698. IL[i]:=nil;
  699. end
  700. else
  701. begin
  702. R2.copy(R);
  703. R2.A.X:=LW;
  704. new(IL[i],init(R2,255));
  705. IL[i]^.data^:=DirectorySwitches^.GetStringItem(i);
  706. misc_items:=newTabItem(IL[i],misc_items);
  707. if misc_tabfocus=nil then
  708. misc_tabfocus:=IL[i];
  709. R2.copy(R);
  710. R2.B.X:=LW;
  711. misc_items:=newTabItem(
  712. new(Plabel,init(R2,
  713. DirectorySwitches^.ItemName(i),
  714. IL[i])),
  715. misc_items);
  716. R.move(0,2);
  717. end;
  718. end;
  719. { revert items for correct tab order }
  720. newmisc_items:=nil;
  721. while assigned(misc_items) do
  722. begin
  723. { get element }
  724. temp:=misc_items;
  725. misc_items:=temp^.next;
  726. { put element }
  727. temp^.next:=newmisc_items;
  728. newmisc_items:=temp;
  729. end;
  730. misc_items:=newmisc_items;
  731. {Create some tabs in the window.}
  732. tabR.assign(1,1,d^.size.x-2,d^.size.y-1);
  733. new(tab,init(tabR,
  734. newtabdef('~U~nits',e_units,
  735. NewTabItem(L_units,
  736. NewTabItem(E_units,
  737. nil)),
  738. NewTabDef('~I~nclude files',E_includes,
  739. NewTabItem(L_includes,
  740. NewTabItem(E_includes,
  741. nil)),
  742. NewTabDef('~L~ibraries',E_libraries,
  743. NewTabItem(L_libraries,
  744. NewTabItem(E_libraries,
  745. nil)),
  746. NewTabDef('~O~bject files',E_objects,
  747. NewTabItem(L_objects,
  748. NewTabItem(E_objects,
  749. nil)),
  750. NewTabDef(misc_string,misc_tabfocus,
  751. misc_items,
  752. nil)))))
  753. ));
  754. tab^.growmode:=0;
  755. d^.insert(tab);
  756. insertbuttons(D);
  757. if desktop^.execview(D)=cmOK then
  758. begin
  759. {Move the data from the window back into the switches.}
  760. for i:=0 to count-1 do
  761. if directorySwitches^.GetItemTyp(i)=ot_MultiString then
  762. begin
  763. case directorySwitches^.itemParam(i)[3] of
  764. 'u':
  765. e:=E_units;
  766. 'i':
  767. e:=E_includes;
  768. 'l':
  769. e:=E_libraries;
  770. 'o':
  771. e:=E_objects;
  772. else
  773. messagebox('Internal error: Unknown switch.',nil,mfOkButton);
  774. end;
  775. c:=directorySwitches^.getMultiStringItem(i);
  776. c^.freeall;
  777. for j:=0 to e^.getlinecount-1 do
  778. begin
  779. s:=e^.getlinetext(j);
  780. {Strip string.}
  781. while (length(s)>0) and (s[length(s)]=' ') do
  782. dec(s[0]);
  783. while (length(s)>0) and (s[1]=' ') do
  784. system.delete(s,1,1);
  785. if s<>'' then
  786. c^.insert(newstr(s));
  787. end;
  788. end
  789. else
  790. begin
  791. s:=IL[i]^.data^;
  792. {Strip string.}
  793. while (length(s)>0) and (s[length(s)]=' ') do
  794. dec(s[0]);
  795. while (length(s)>0) and (s[1]=' ') do
  796. system.delete(s,1,1);
  797. DirectorySwitches^.SetStringItem(i,s);
  798. end;
  799. end;
  800. dispose(D,done);
  801. end;
  802. procedure TIDEApp.Tools;
  803. var
  804. D : PToolsDialog;
  805. begin
  806. D:=New(PToolsDialog, Init);
  807. ExecuteDialog(D,nil);
  808. end;
  809. (*procedure TIDEApp.Preferences;
  810. var R,R2: TRect;
  811. D: PCenterDialog;
  812. RB1 : PRadioButtons;
  813. CountModes : integer;
  814. hp : pvideomodelist;
  815. items : PSItem;
  816. videomode : tvideomode;
  817. i,modevalue : longint;
  818. function ToStr(l : longint) : string;
  819. var
  820. s : string;
  821. begin
  822. str(l,s);
  823. ToStr:=s;
  824. end;
  825. const
  826. color2str : array[false..true] of string = ('in b/w','in color');
  827. begin
  828. GetVideoMode(videomode);
  829. CountModes:=0;
  830. i:=0;
  831. modevalue:=0;
  832. R.Assign(0,0,64,18);
  833. New(D, Init(R, 'Preferences'));
  834. with D^ do
  835. begin
  836. hp:=video.modes;
  837. items:=nil;
  838. r2.assign(2,3,24,17);
  839. while assigned(hp) do
  840. begin
  841. items:=NewSItem(ToStr(hp^.col)+'x'+ToStr(hp^.row)+' '+color2str[hp^.color],items);
  842. if (hp^.col=videomode.col) and (hp^.row=videomode.row) and
  843. (hp^.color=videomode.color) then
  844. modevalue:=i;
  845. inc(CountModes);
  846. { we can't display an infinite number of modes }
  847. if CountModes>=r.b.y-r.a.y+1 then
  848. break;
  849. inc(i);
  850. hp:=hp^.next;
  851. end;
  852. modevalue:=CountModes-modevalue-1;
  853. new(rb1,init(r2,items));
  854. insert(rb1);
  855. rb1^.value:=modevalue;
  856. r2.move(0,-1);r2.b.y:=r2.a.y+1;
  857. insert(new(plabel,init(r2,'~V~ideo mode',rb1)));
  858. end;
  859. InsertButtons(D);
  860. if Desktop^.ExecView(D)=cmOK then
  861. begin
  862. { change video mode ? }
  863. if rb1^.value<>modevalue then
  864. begin
  865. modevalue:=CountModes-rb1^.value-1;
  866. hp:=video.modes;
  867. for i:=1 to modevalue do
  868. hp:=hp^.next;
  869. videomode.col:=hp^.col;
  870. videomode.row:=hp^.row;
  871. videomode.color:=hp^.color;
  872. SetScreenVideoMode(videomode);
  873. end;
  874. end;
  875. Dispose(D, Done);
  876. end;*)
  877. type
  878. PVideoModeCollection = ^TVideoModeCollection;
  879. TVideoModeCollection = object(TSortedCollection)
  880. function Compare(Key1, Key2: Pointer): Sw_Integer; virtual;
  881. procedure FreeItem(Item: Pointer); virtual;
  882. end;
  883. function TVideoModeCollection.Compare(Key1, Key2: Pointer): Sw_Integer;
  884. var R: Sw_integer;
  885. K1: PVideoMode absolute Key1;
  886. K2: PVideoMode absolute Key2;
  887. begin
  888. if K1^.Col<K2^.Col then R:=-1 else
  889. if K1^.Col>K2^.Col then R:= 1 else
  890. if K1^.Row<K2^.Row then R:=-1 else
  891. if K1^.Row>K2^.Row then R:= 1 else
  892. if (K1^.Color=false) and (K2^.Color=true ) then R:=-1 else
  893. if (K1^.Color=true ) and (K2^.Color=false) then R:= 1 else
  894. R:=0;
  895. Compare:=R;
  896. end;
  897. procedure TVideoModeCollection.FreeItem(Item: Pointer);
  898. begin
  899. FreeMem(Item,sizeof(TVideoMode));
  900. end;
  901. procedure TIDEApp.Preferences;
  902. var R,R2: TRect;
  903. D: PCenterDialog;
  904. C: PVideoModeCollection;
  905. VMLB: PVideoModeListBox;
  906. OldScreenMode,VM: TVideoMode;
  907. ScreenModeInfo : array[1..3] of longint;
  908. CurVP,VP: PVideoMode;
  909. RB1: PPlainRadioButtons;
  910. CB1,CB2: PPlainCheckBoxes;
  911. CurIdx: integer;
  912. i : word;
  913. begin
  914. New(C, Init(10,50));
  915. CurVP:=nil;
  916. for i:=0 to GetVideoModeCount-1 do
  917. begin
  918. GetVideoModeData(i,VM);
  919. GetMem(VP,sizeof(TVideoMode));
  920. Move(VM,VP^,sizeof(TVideoMode));
  921. C^.Insert(VP);
  922. if (VM.Row=ScreenMode.Row) and (VM.Col=ScreenMode.Col) and
  923. (VM.Color=ScreenMode.Color) then
  924. CurVP:=VP;
  925. end;
  926. R.Assign(0,0,64,15);
  927. New(D, Init(R, dialog_preferences));
  928. with D^ do
  929. begin
  930. HelpCtx:=hcpreferences;
  931. GetExtent(R); R.Grow(-2,-2);
  932. R.B.X:=R.A.X+(R.B.X-R.A.X) div 2 - 1;
  933. R.B.Y:=R.A.Y+3;
  934. R2.Copy(R); R2.Grow(-1,-1);
  935. New(VMLB, Init(R2, Min(4,C^.Count), C));
  936. if CurVP=nil then CurIdx:=-1 else
  937. CurIdx:=C^.IndexOf(CurVP);
  938. if CurIdx<>-1 then
  939. VMLB^.FocusItem(CurIdx);
  940. Insert(New(PGroupView, Init(R, label_preferences_videomode, VMLB)));
  941. Insert(VMLB);
  942. R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+4;
  943. R2.Copy(R); R2.Grow(-1,-1);
  944. New(RB1, Init(R2,
  945. NewSItem(label_preferences_currentdirectory,
  946. NewSItem(label_preferences_configdirectory,
  947. nil))));
  948. RB1^.Press(DesktopLocation);
  949. Insert(New(PGroupView, Init(R, label_preferences_desktopfile, RB1)));
  950. Insert(RB1);
  951. R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+5;
  952. R2.Copy(R); R2.Grow(-1,-1);
  953. New(CB1, Init(R2,
  954. NewSItem(label_preferences_editorfiles,
  955. NewSItem(label_preferences_environment,
  956. NewSItem(label_preferences_desktop,
  957. nil)))));
  958. CB1^.Value:=AutoSaveOptions;
  959. Insert(New(PGroupView, Init(R, label_preferences_autosave, CB1)));
  960. Insert(CB1);
  961. GetExtent(R); R.Grow(-2,-2);
  962. R.A.X:=R.B.X-(R.B.X-R.A.X) div 2 + 1;
  963. R.B.Y:=R.A.Y+7;
  964. R.Move(0,R.B.Y-R.A.Y{+1}); R.B.Y:=R.A.Y+5;
  965. R2.Copy(R); R2.Grow(-1,-1);
  966. New(CB2, Init(R2,
  967. NewSItem(label_preferences_autotracksource,
  968. NewSItem(label_preferences_closeongotosource,
  969. NewSItem(label_preferences_changedironopen,
  970. nil)))));
  971. CB2^.Value:=MiscOptions;
  972. Insert(New(PGroupView, Init(R, label_preferences_options, CB2)));
  973. Insert(CB2);
  974. end;
  975. InsertButtons(D);
  976. if Desktop^.ExecView(D)=cmOK then
  977. begin
  978. if (C^.count>0) then
  979. begin
  980. with PVideoMode(C^.At(VMLB^.Focused))^ do
  981. begin
  982. VM.Col:=Col;
  983. VM.Row:=Row;
  984. VM.Color:=Color;
  985. end;
  986. if (VM.Col<>ScreenMode.Col) or (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color) then
  987. Begin
  988. OldScreenMode:=ScreenMode;
  989. SetScreenVideoMode(VM);
  990. if (VM.Col<>ScreenMode.Col) or (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color) then
  991. begin
  992. SetScreenVideoMode(OldScreenMode);
  993. ScreenModeInfo[1]:=VM.col;
  994. ScreenModeInfo[2]:=VM.row;
  995. ScreenModeInfo[3]:=byte(VM.color);
  996. ErrorBox(msg_cantsetscreenmode,@ScreenModeInfo);
  997. end
  998. else
  999. if TimedMessageBox (msg_confirmnewscreenmode, nil,
  1000. mfConfirmation or mfOKCancel, 15) = cmCancel then
  1001. begin
  1002. SetScreenVideoMode (OldScreenMode);
  1003. ScreenModeInfo [1] := VM.Col;
  1004. ScreenModeInfo [2] := VM.Row;
  1005. ScreenModeInfo [3] := byte (VM.Color);
  1006. end;
  1007. End;
  1008. end;
  1009. AutoSaveOptions:=CB1^.Value;
  1010. MiscOptions:=CB2^.Value;
  1011. DesktopLocation:=RB1^.Value;
  1012. end;
  1013. Dispose(D, Done);
  1014. Dispose(C, Done);
  1015. end;
  1016. procedure TIDEApp.EditorOptions(Editor: PEditor);
  1017. var D: PCenterDialog;
  1018. R,R2,R3: TRect;
  1019. CB: PCheckBoxes;
  1020. ILTab,ILIdent: PIntegerLine;
  1021. ExtIL,TabExtIL: PEditorInputLine;
  1022. TabSize,IndentSize: Integer;
  1023. EFlags,EFValue: Longint;
  1024. Title: string;
  1025. begin
  1026. if Editor=nil then
  1027. begin
  1028. TabSize:=DefaultTabSize; EFlags:=DefaultCodeEditorFlags;
  1029. IndentSize:=DefaultIndentSize;
  1030. Title:=dialog_defaulteditoroptions;
  1031. end
  1032. else
  1033. begin
  1034. TabSize:=Editor^.GetTabSize; EFlags:=Editor^.GetFlags;
  1035. IndentSize:=Editor^.GetIndentSize;
  1036. Title:=dialog_editoroptions;
  1037. end;
  1038. EFValue:=0;
  1039. if (EFlags and efBackupFiles )<>0 then EFValue:=EFValue or (1 shl 0);
  1040. if (EFlags and efInsertMode )<>0 then EFValue:=EFValue or (1 shl 1);
  1041. if (EFlags and efAutoIndent )<>0 then EFValue:=EFValue or (1 shl 2);
  1042. if (EFlags and efUseTabCharacters )<>0 then EFValue:=EFValue or (1 shl 3);
  1043. if (EFlags and efBackSpaceUnindents)<>0 then EFValue:=EFValue or (1 shl 4);
  1044. if (EFlags and efPersistentBlocks )<>0 then EFValue:=EFValue or (1 shl 5);
  1045. if (EFlags and efSyntaxHighlight )<>0 then EFValue:=EFValue or (1 shl 6);
  1046. if (EFlags and efBlockInsCursor )<>0 then EFValue:=EFValue or (1 shl 7);
  1047. if (EFlags and efVerticalBlocks )<>0 then EFValue:=EFValue or (1 shl 8);
  1048. if (EFlags and efHighlightColumn )<>0 then EFValue:=EFValue or (1 shl 9);
  1049. if (EFlags and efHighlightRow )<>0 then EFValue:=EFValue or (1 shl 10);
  1050. if (EFlags and efAutoBrackets )<>0 then EFValue:=EFValue or (1 shl 11);
  1051. if (EFlags and efKeepTrailingSpaces)<>0 then EFValue:=EFValue or (1 shl 12);
  1052. if (EFlags and efCodeComplete )<>0 then EFValue:=EFValue or (1 shl 13);
  1053. if (EFlags and efFolds )<>0 then EFValue:=EFValue or (1 shl 14);
  1054. R.Assign(0,0,66,20);
  1055. New(D, Init(R, Title));
  1056. with D^ do
  1057. begin
  1058. HelpCtx:=hcEditor;
  1059. GetExtent(R); R.Grow(-2,-2); R.B.Y:=R.A.Y+9;
  1060. R2.Copy(R); Inc(R2.A.Y);
  1061. New(CB, Init(R2,
  1062. NewSItem(label_editor_backupfiles,
  1063. NewSItem(label_editor_insertmode,
  1064. NewSItem(label_editor_autoindentmode,
  1065. NewSItem(label_editor_usetabcharacters,
  1066. NewSItem(label_editor_backspaceunindents,
  1067. NewSItem(label_editor_persistentblocks,
  1068. NewSItem(label_editor_syntaxhighlight,
  1069. NewSItem(label_editor_blockinsertcursor,
  1070. NewSItem(label_editor_verticalblocks,
  1071. NewSItem(label_editor_highlightcolumn,
  1072. NewSItem(label_editor_highlightrow,
  1073. NewSItem(label_editor_autoclosingbrackets,
  1074. NewSItem(label_editor_keeptrailingspaces,
  1075. NewSItem(label_editor_codecomplete,
  1076. NewSItem(label_editor_folds,
  1077. nil)))))))))))))))));
  1078. CB^.Value:=EFValue;
  1079. Insert(CB);
  1080. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1081. Insert(New(PLabel, Init(R2, label_editor_editoroptions, CB)));
  1082. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+1;
  1083. R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y;
  1084. R3.Copy(R); Inc(R3.A.X,10); R3.B.X:=R3.A.X+5;
  1085. New(ILTab, Init(R3, 0,100));
  1086. ILTab^.Data^:=IntToStr(TabSize);
  1087. Insert(ILTab);
  1088. R3.Copy(R); R3.B.X:=R3.A.X+10;
  1089. Insert(New(PLabel, Init(R3, label_editor_tabsize, ILTab)));
  1090. R3.Copy(R); Inc(R3.A.X,40); R3.B.X:=R3.A.X+5;
  1091. New(ILIdent, Init(R3, 0,100));
  1092. ILIdent^.Data^:=IntToStr(IndentSize);
  1093. Insert(ILIdent);
  1094. R3.Copy(R); Inc(R3.A.X,28); R3.B.X:=R3.A.X+12;
  1095. Insert(New(PLabel, Init(R3, label_editor_IndentSize, ILIdent)));
  1096. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+2;
  1097. R2.Copy(R); Inc(R2.A.Y);
  1098. New(ExtIL, Init(R2, 128));
  1099. ExtIL^.SetData(HighlightExts);
  1100. Insert(ExtIL);
  1101. R2.Move(0,-1);
  1102. Insert(New(PLabel, Init(R2, label_editor_highlightextensions, ExtIL)));
  1103. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+2;
  1104. R2.Copy(R); Inc(R2.A.Y);
  1105. New(TabExtIL, Init(R2, 128));
  1106. TabExtIL^.SetData(TabsPattern);
  1107. Insert(TabExtIL);
  1108. R2.Move(0,-1);
  1109. Insert(New(PLabel, Init(R2, label_editor_filepatternsneedingtabs, TabExtIL)));
  1110. end;
  1111. InsertButtons(D);
  1112. CB^.Select;
  1113. if Desktop^.ExecView(D)=cmOK then
  1114. begin
  1115. EFlags:=0;
  1116. if (CB^.Value and (1 shl 0))<>0 then EFlags:=EFlags or efBackupFiles;
  1117. if (CB^.Value and (1 shl 1))<>0 then EFlags:=EFlags or efInsertMode;
  1118. if (CB^.Value and (1 shl 2))<>0 then EFlags:=EFlags or efAutoIndent;
  1119. if (CB^.Value and (1 shl 3))<>0 then EFlags:=EFlags or efUseTabCharacters;
  1120. if (CB^.Value and (1 shl 4))<>0 then EFlags:=EFlags or efBackSpaceUnindents;
  1121. if (CB^.Value and (1 shl 5))<>0 then EFlags:=EFlags or efPersistentBlocks;
  1122. if (CB^.Value and (1 shl 6))<>0 then EFlags:=EFlags or efSyntaxHighlight;
  1123. if (CB^.Value and (1 shl 7))<>0 then EFlags:=EFlags or efBlockInsCursor;
  1124. if (CB^.Value and (1 shl 8))<>0 then EFlags:=EFlags or efVerticalBlocks;
  1125. if (CB^.Value and (1 shl 9))<>0 then EFlags:=EFlags or efHighlightColumn;
  1126. if (CB^.Value and (1 shl 10))<>0 then EFlags:=EFlags or efHighlightRow;
  1127. if (CB^.Value and (1 shl 11))<>0 then EFlags:=EFlags or efAutoBrackets;
  1128. if (CB^.Value and (1 shl 12))<>0 then EFlags:=EFlags or efKeepTrailingSpaces;
  1129. if (CB^.Value and (1 shl 13))<>0 then EFlags:=EFlags or efCodeComplete;
  1130. if (CB^.Value and (1 shl 14))<>0 then EFlags:=EFlags or efFolds;
  1131. TabSize:=StrToInt(ILTab^.Data^);
  1132. IndentSize:=StrToInt(ILIdent^.Data^);
  1133. if Editor=nil then
  1134. begin
  1135. DefaultTabSize:=TabSize;
  1136. DefaultIndentSize:=IndentSize;
  1137. DefaultCodeEditorFlags:=EFlags;
  1138. end
  1139. else
  1140. begin
  1141. Editor^.SetIndentSize(IndentSize);
  1142. Editor^.SetTabSize(TabSize);
  1143. Editor^.SetFlags(EFlags);
  1144. end;
  1145. ExtIL^.GetData(HighlightExts);
  1146. TabExtIL^.GetData(TabsPattern);
  1147. end;
  1148. Dispose(D, Done);
  1149. end;
  1150. procedure TIDEApp.CodeComplete;
  1151. var
  1152. D : PCodeCompleteDialog;
  1153. begin
  1154. D:=New(PCodeCompleteDialog, Init);
  1155. ExecuteDialog(D,nil);
  1156. end;
  1157. procedure TIDEApp.CodeTemplates;
  1158. begin
  1159. ExecuteDialog(New(PCodeTemplatesDialog, Init(false,'')),nil);
  1160. end;
  1161. procedure TIDEApp.BrowserOptions(Browser: PBrowserWindow);
  1162. var D: PCenterDialog;
  1163. R,R2,R3 : TRect;
  1164. TitleS: string;
  1165. CB1,CB2: PCheckBoxes;
  1166. RB1,RB2: PRadioButtons;
  1167. begin
  1168. if Browser=nil then
  1169. TitleS:=dialog_browseroptions
  1170. else
  1171. TitleS:=dialog_localbrowseroptions;
  1172. R.Assign(0,0,56,15);
  1173. New(D, Init(R, TitleS));
  1174. with D^ do
  1175. begin
  1176. HelpCtx:=hcBrowser;
  1177. GetExtent(R); R.Grow(-2,-2);
  1178. R.B.Y:=R.A.Y+1+3; R2.Copy(R); Inc(R2.A.Y);
  1179. New(CB1, Init(R2,
  1180. NewSItem(RExpand(label_browser_labels,21+2),
  1181. NewSItem(label_browser_constants,
  1182. NewSItem(label_browser_types,
  1183. NewSItem(label_browser_variables,
  1184. NewSItem(label_browser_procedures,
  1185. NewSItem(label_browser_inherited,
  1186. nil)))))))
  1187. );
  1188. Insert(CB1);
  1189. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1190. Insert(New(PLabel, Init(R2, label_browser_symbols, CB1)));
  1191. R.Move(0,R.B.Y-R.A.Y+1);
  1192. R.B.Y:=R.A.Y+1+2; R2.Copy(R);
  1193. R3.Copy(R2); R3.B.X:=R3.A.X+(R3.B.X-R3.A.X) div 2-1; Inc(R3.A.Y);
  1194. New(RB1, Init(R3,
  1195. NewSItem(label_browser_newbrowser,
  1196. NewSItem(label_browser_currentbrowser,
  1197. nil)))
  1198. );
  1199. Insert(RB1);
  1200. R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
  1201. Insert(New(PLabel, Init(R3, label_browser_subbrowsing, RB1)));
  1202. R3.Copy(R2); R3.A.X:=R3.B.X-(R3.B.X-R3.A.X) div 2+1; Inc(R3.A.Y);
  1203. New(RB2, Init(R3,
  1204. NewSItem(label_browser_scope,
  1205. NewSItem(label_browser_reference,
  1206. nil)))
  1207. );
  1208. Insert(RB2);
  1209. R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
  1210. Insert(New(PLabel, Init(R3, label_browser_preferredpane, RB2)));
  1211. R.Move(0,R.B.Y-R.A.Y+1);
  1212. R.B.Y:=R.A.Y+1+1; R2.Copy(R); Inc(R2.A.Y);
  1213. New(CB2, Init(R2,
  1214. NewSItem(RExpand(label_browser_qualifiedsymbols,21+2),
  1215. NewSItem(label_browser_sortsymbols,
  1216. nil)))
  1217. );
  1218. Insert(CB2);
  1219. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1220. Insert(New(PLabel, Init(R2, label_browser_display, CB2)));
  1221. end;
  1222. InsertButtons(D);
  1223. CB1^.Select;
  1224. if Desktop^.ExecView(D)=cmOK then
  1225. begin
  1226. end;
  1227. Dispose(D, Done);
  1228. end;
  1229. procedure TIDEApp.Startup;
  1230. begin
  1231. NotImplemented;
  1232. end;
  1233. procedure TIDEApp.DesktopOptions;
  1234. var R: TRect;
  1235. D: PCenterDialog;
  1236. CB: PCheckBoxes;
  1237. begin
  1238. R.Assign(0,0,40,12);
  1239. New(D, Init(R, dialog_desktoppreferences));
  1240. with D^ do
  1241. begin
  1242. HelpCtx:=hcDesktopOptions;
  1243. GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.Y:=R.A.Y+8;
  1244. New(CB, Init(R,
  1245. NewSItem(label_desktop_historylists,
  1246. NewSItem(label_desktop_clipboard,
  1247. NewSItem(label_desktop_watches,
  1248. NewSItem(label_desktop_breakpoints,
  1249. NewSItem(label_desktop_openwindow,
  1250. NewSItem(label_desktop_symbolinfo,
  1251. NewSItem(label_desktop_codecompletewords,
  1252. NewSItem(label_desktop_codetemplates,
  1253. nil))))))))));
  1254. CB^.Value:=DesktopFileFlags;
  1255. Insert(CB);
  1256. R.Move(0,-1); R.B.Y:=R.A.Y+1;
  1257. Insert(New(PLabel, Init(R, label_desktop_preservedacrosssessions, CB)));
  1258. end;
  1259. InsertButtons(D);
  1260. CB^.Select;
  1261. if Desktop^.ExecView(D)=cmOK then
  1262. begin
  1263. DesktopFileFlags:=CB^.Value;
  1264. end;
  1265. Dispose(D, Done);
  1266. end;
  1267. procedure TIDEApp.Mouse;
  1268. var R,R2: TRect;
  1269. D: PCenterDialog;
  1270. SB: PScrollBar;
  1271. CB: PCheckBoxes;
  1272. RB1,RB2,RBKB: PRadioButtons;
  1273. begin
  1274. R.Assign(0,0,62,19);
  1275. New(D, Init(R, dialog_mouseoptions));
  1276. with D^ do
  1277. begin
  1278. HelpCtx:=hcMouse;
  1279. GetExtent(R); R.Grow(-3,-2); inc(R.A.Y); R.B.Y:=R.A.Y+2;
  1280. New(RBkb, Init(R,
  1281. NewSItem('~C~UA-91 convention (Shift+Del,Ctrl+Ins,Shift+Ins)',
  1282. NewSItem('~M~icrosoft convention (Ctrl+X,Ctrl+C,Ctrl+V)',
  1283. nil))));
  1284. RBkb^.Press(integer(EditKeys));
  1285. Insert(RBkb);
  1286. R.move(0,-1); R.B.Y:=R.A.Y+1;
  1287. Insert(New(PLabel, Init(R, '~K~eys for cut, copy and paste:', RBkb)));
  1288. R.Move(0,(R.B.Y-R.A.Y)+3); R.B.Y:=R.A.Y+3;
  1289. R2.Copy(R); Inc(R2.A.Y,2); R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 -1;
  1290. New(SB, Init(R2)); SB^.GrowMode:=0; SB^.Options:=SB^.Options or ofSelectable;
  1291. SB^.SetParams(DoubleDelay,1,20,1,1);
  1292. Insert(SB);
  1293. R2.Move(0,-1);
  1294. Insert(New(PStaticText, Init(R2, label_mouse_speedbar)));
  1295. R2.Move(-1,-1);
  1296. Insert(New(PLabel, Init(R2, label_mouse_doubleclickspeed, SB)));
  1297. R2.Copy(R); Inc(R2.A.Y,2); R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2 +1;
  1298. New(CB, Init(R2, NewSItem(label_mouse_reversebuttons, nil) ));
  1299. if MouseReverse then CB^.Press(0);
  1300. Insert(CB);
  1301. R.Move(0,(R.B.Y-R.A.Y)+1); R.B.Y:=R.A.Y+8;
  1302. R2.Copy(R); Inc(R2.A.Y); R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2 -1;
  1303. New(RB1, Init(R2,
  1304. NewSItem(label_mouse_act_nothing,
  1305. NewSItem(label_mouse_act_topicsearch,
  1306. NewSItem(label_mouse_act_gotocursor,
  1307. NewSItem(label_mouse_act_breakpoint,
  1308. NewSItem(label_mouse_act_evaluate,
  1309. NewSItem(label_mouse_act_addwatch,
  1310. NewSItem(label_mouse_act_browsesymbol,
  1311. nil)))))))));
  1312. RB1^.Press(CtrlMouseAction);
  1313. Insert(RB1);
  1314. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1315. Insert(New(PLabel, Init(R2, label_mouse_crtlrightmousebuttonaction, RB1)));
  1316. R2.Copy(R); Inc(R2.A.Y); R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2 +1;
  1317. New(RB2, Init(R2,
  1318. NewSItem(label_mouse_act_nothing,
  1319. NewSItem(label_mouse_act_topicsearch,
  1320. NewSItem(label_mouse_act_gotocursor,
  1321. NewSItem(label_mouse_act_breakpoint,
  1322. NewSItem(label_mouse_act_evaluate,
  1323. NewSItem(label_mouse_act_addwatch,
  1324. NewSItem(label_mouse_act_browsesymbol,
  1325. nil)))))))));
  1326. RB2^.Press(AltMouseAction);
  1327. Insert(RB2);
  1328. R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
  1329. Insert(New(PLabel, Init(R2, label_mouse_altrightmousebuttonaction, RB2)));
  1330. end;
  1331. InsertButtons(D);
  1332. RBkb^.Select;
  1333. if Desktop^.ExecView(D)=cmOK then
  1334. begin
  1335. MouseReverse:=CB^.Mark(0);
  1336. DoubleDelay:=SB^.Value;
  1337. CtrlMouseAction:=RB1^.Value;
  1338. AltMouseAction:=RB2^.Value;
  1339. if Tedit_key_modes(RBkb^.value)<>EditKeys then
  1340. begin
  1341. EditKeys:=Tedit_key_modes(RBkb^.value);
  1342. reload_menubar;
  1343. end;
  1344. end;
  1345. Dispose(D, Done);
  1346. end;
  1347. procedure TIDEApp.Colors;
  1348. {$Ifdef COLORSEL}
  1349. var D: PColorDialog;
  1350. begin
  1351. New(D, Init(AppPalette,
  1352. ColorGroup(label_colors_grp_browser,
  1353. ColorItem(label_colors_framepassive , 215,
  1354. ColorItem(label_colors_frameactive , 216,
  1355. ColorItem(label_colors_frameicon , 217,
  1356. ColorItem(label_colors_scrollbarpage , 218,
  1357. ColorItem(label_colors_scrollbaricons , 219,
  1358. ColorItem(label_colors_normaltext , 220,
  1359. ColorItem(label_colors_selectedtext , 221,
  1360. ColorItem(label_colors_activeitem , 222,
  1361. ColorItem(label_colors_inactiveitem , 223,
  1362. ColorItem(label_colors_focuseditem , 224,
  1363. ColorItem(label_colors_selecteditem , 225,
  1364. ColorItem(label_colors_divider , 226,
  1365. nil)))))))))))),
  1366. ColorGroup(label_colors_grp_clock,
  1367. ColorItem(label_colors_clockview , 227,
  1368. nil),
  1369. ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
  1370. ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
  1371. ColorGroup(label_colors_grp_editor,
  1372. ColorItem(label_colors_framepassive , 167,
  1373. ColorItem(label_colors_frameactive , 168,
  1374. ColorItem(label_colors_frameicon , 169,
  1375. ColorItem(label_colors_scrollbarpage , 170,
  1376. ColorItem(label_colors_scrollbaricons , 171,
  1377. ColorItem(label_colors_normaltext , 199,
  1378. ColorItem(label_colors_selectedtext , 208,
  1379. ColorItem(label_colors_highlighcolumn , 209,
  1380. ColorItem(label_colors_highlightrow , 210,
  1381. ColorItem(label_colors_errormessages , 214,
  1382. nil)))))))))),
  1383. ColorGroup(label_colors_grp_help,
  1384. ColorItem(label_colors_framepassive , 128,
  1385. ColorItem(label_colors_frameactive , 129,
  1386. ColorItem(label_colors_frameicon , 130,
  1387. ColorItem(label_colors_scrollbarpage , 131,
  1388. ColorItem(label_colors_scrollbaricons , 132,
  1389. ColorItem(label_colors_helptext , 160,
  1390. ColorItem(label_colors_helplinks , 161,
  1391. ColorItem(label_colors_selectedlink , 162,
  1392. ColorItem(label_colors_selectedtext , 163,
  1393. ColorItem(label_colors_html_heading1 , 229,
  1394. ColorItem(label_colors_html_heading2 , 230,
  1395. ColorItem(label_colors_html_heading3 , 231,
  1396. ColorItem(label_colors_html_heading4 , 232,
  1397. ColorItem(label_colors_html_heading5 , 233,
  1398. ColorItem(label_colors_html_heading6 , 234,
  1399. nil))))))))))))))),
  1400. ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
  1401. ColorGroup(label_colors_grp_syntax,
  1402. ColorItem(label_colors_whitespace , 200,
  1403. ColorItem(label_colors_comments , 201,
  1404. ColorItem(label_colors_reservedwords , 202,
  1405. ColorItem(label_colors_identifiers , 203,
  1406. ColorItem(label_colors_strings , 204,
  1407. ColorItem(label_colors_numbers , 205,
  1408. ColorItem(label_colors_hexnumbers , 212,
  1409. ColorItem(label_colors_assembler , 206,
  1410. ColorItem(label_colors_symbols , 207,
  1411. ColorItem(label_colors_directives , 211,
  1412. ColorItem(label_colors_tabs , 213,
  1413. nil))))))))))),
  1414. nil))))))))));
  1415. D^.HelpCtx:=hcColors;
  1416. if ExecuteDialog(D, @AppPalette)=cmOK then
  1417. begin
  1418. DoneMemory;
  1419. Message(Application,evBroadcast,cmUpdate,nil);
  1420. ReDraw;
  1421. UpdateScreen(true);
  1422. end;
  1423. end;
  1424. {$else COLORSEL}
  1425. begin
  1426. end;
  1427. {$endif COLORSEL}
  1428. procedure TIDEApp.OpenINI;
  1429. var D: PFileDialog;
  1430. FileName: string;
  1431. begin
  1432. New(D, Init('*'+ExtOf(INIFileName),dialog_openoptions,dialog_ini_filename,fdOpenButton,hidOpenIniFile));
  1433. D^.HelpCtx:=hcOpenIni;
  1434. if Desktop^.ExecView(D)<>cmCancel then
  1435. begin
  1436. D^.GetFileName(FileName);
  1437. if ExistsFile(FileName)=false then ErrorBox(msg_cantopenconfigfile,nil) else
  1438. begin
  1439. IniFileName:=FileName;
  1440. ReadINIFile;
  1441. Message(Application,evBroadcast,cmUpdate,nil);
  1442. end;
  1443. end;
  1444. Dispose(D, Done);
  1445. end;
  1446. procedure TIDEApp.SaveINI;
  1447. begin
  1448. if WriteINIFile(false)=false then
  1449. ErrorBox(msg_errorsavingconfigfile,nil);
  1450. end;
  1451. procedure TIDEApp.SaveAsINI;
  1452. var D: PFileDialog;
  1453. FileName: string;
  1454. CanWrite: boolean;
  1455. begin
  1456. New(D, Init('*'+ExtOf(INIFileName),dialog_saveoptions,dialog_ini_filename,fdOpenButton,hidSaveIniFile));
  1457. D^.HelpCtx:=hcSaveAsINI;
  1458. if Desktop^.ExecView(D)<>cmCancel then
  1459. begin
  1460. D^.GetFileName(FileName);
  1461. CanWrite:=(ExistsFile(FileName)=false);
  1462. if CanWrite=false then
  1463. CanWrite:=ConfirmBox(FormatStrStr(msg_filealreadyexistsoverwrite,SmartPath(FileName)),nil,false)=cmYes;
  1464. if CanWrite then
  1465. begin
  1466. IniFileName:=FileName;
  1467. if WriteINIFile(true)=false then
  1468. ErrorBox(msg_errorsavingconfigfile,nil);
  1469. Message(Application,evBroadcast,cmUpdate,nil);
  1470. end;
  1471. end;
  1472. Dispose(D, Done);
  1473. end;