Delphi

Can someone recommend a colour picker component for Delphi?

萝らか妹 提交于 2019-12-30 09:32:05
问题 I'm looking for a (preferably free) component for Delphi for users to easily select about 100 different colours. I've currently got one as part of DevExpress's editors, but it only has about 20 proper colours to choose, with a bunch of other 'Windows' colours like clHighlight, clBtnFace, etc. It's for regular users, so would like to avoid requiring them to manually select RGB values. Something similar to the colour picker in MS Paint might work, or something that lists X11/web colours: http:/

Can someone recommend a colour picker component for Delphi?

ぃ、小莉子 提交于 2019-12-30 09:31:05
问题 I'm looking for a (preferably free) component for Delphi for users to easily select about 100 different colours. I've currently got one as part of DevExpress's editors, but it only has about 20 proper colours to choose, with a bunch of other 'Windows' colours like clHighlight, clBtnFace, etc. It's for regular users, so would like to avoid requiring them to manually select RGB values. Something similar to the colour picker in MS Paint might work, or something that lists X11/web colours: http:/

Why is except not catching this error?

强颜欢笑 提交于 2019-12-30 09:28:28
问题 I have a program that simulates dice rolls and compares them to values in a chart (set of String lists). I currently get the value from a TEdit. If the box is empty it raises a EConvertError that should be caught by my Try/Except statement, but it's not. Thoughts and advice? Code below, Delphi 7. try //Shooting if ShootingRadio.Checked then BS := StrToInt(Edit1.Text); Randomize; Roll := RandomRange(1,7); Label3.Caption := IntToStr(Roll); if (Roll < StrToInt(ShootingHitChart[BS-1])) then begin

Why is except not catching this error?

陌路散爱 提交于 2019-12-30 09:28:23
问题 I have a program that simulates dice rolls and compares them to values in a chart (set of String lists). I currently get the value from a TEdit. If the box is empty it raises a EConvertError that should be caught by my Try/Except statement, but it's not. Thoughts and advice? Code below, Delphi 7. try //Shooting if ShootingRadio.Checked then BS := StrToInt(Edit1.Text); Randomize; Roll := RandomRange(1,7); Label3.Caption := IntToStr(Roll); if (Roll < StrToInt(ShootingHitChart[BS-1])) then begin

Is using TStringList to load huge text file the best way in Delphi?

微笑、不失礼 提交于 2019-12-30 08:38:49
问题 What is the best way to load huge text file data in delphi? Is there any component that can load text file superfast? Let's say I have a text file contains database and stored in fix length format. It contains 150 field with each at least 50 characters. 1. I need to load it into memory 2. I need to parse it and probably store it in a memdataset for processing My questions: 1. Is it enough if I use TStringList.loadFromFile method? 2. Is there any other better component to manipulate the text

Delphi: preferred way of protection using Critical Sections

孤街浪徒 提交于 2019-12-30 08:34:35
问题 I have an object x that needs to be accessed from several (5+ threads). The structure of the object is Tx = class private Fx: integer; public property x: integer read Fx read Fx; etc; What is the better (most elegant) way of protection: a) Tx = class private Fx: integer; public property x: integer read Fx read Fx; public constructor Create; <--- Create the criticalsection here destructor Destroy; <--destroy it here etc; var cs: TCriticalSection; Obj: Tx; function GetSafeObject(): Tx; begin CS

BCD math library for arbitrary big numbers?

眉间皱痕 提交于 2019-12-30 08:28:29
问题 I'm looking for a replacement of the stock Delphi Data.FmtBcd library because I just hit its limits like maximum decimal digits it can represent and program terminates with EBcdOverflowException . For the curious, I'm calculating arithmetic series members and need to handle very large numbers - hundred-thousands positions are not so uncommon. And also get results in a reasonable time. I did rewritten part of the code to Python 3.2 for the testing purposes and calculation speed would be

Delphi's Sharemem - When it is not needed

柔情痞子 提交于 2019-12-30 08:25:31
问题 I know that when I share strings between a Delphi APP and a Delphi DLL I need to add Sharemem in both app and dll project source as the first unit in uses clause. But, if the dll exports function that accept only Pchars but inside some of the dll methods I use strings , should I use sharemem as well? Let me shown a sample code: procedure ShowMyCustomMessage(aMessage : Pchar); var vUselessString : string; begin vUselessString := aMessage; ShowMessage(vUselessString); end; exports

Enumerating DOM nodes in TChromium

☆樱花仙子☆ 提交于 2019-12-30 08:24:20
问题 I am trying to enumerate DOM nodes using the following code (under XE2). I have borrowed most of this from answers given here in SO, but for some reason it's not doing anything. IOW, ProcessDOM() is not ever getting called. And, I am at my wits end. Could someone show me what I am doing wrong here. Thanks in advance. procedure ProcessNode(ANode: ICefDomNode); var Node1: ICefDomNode; begin if Assigned(ANode) then begin Node1 := ANode.FirstChild; while Assigned(Node1) do begin {Do stuff with

How does MSBuild find the Delphi search path?

瘦欲@ 提交于 2019-12-30 08:17:11
问题 If I launch the RAD Studio command prompt and run msbuild /t:Rebuild in a project directory, msbuild will show the full command line to invoke dcc32, including all path settings. Which kind of magic does MSBuild use to find the search paths, based on the IDE settings (stored in the registry) and the project file (which contains placeholders like $(DCC_UnitSearchPath)? The RAD Studio command prompt only sets the .Net environment for MSBuild. So there is something else working behind the scenes