fpmopts.inc 48 KB

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