fpmopts.inc 47 KB

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