fpmopts.inc 49 KB

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