Delphi

Delphi. Remove a border of TabSheet of PageControl

久未见 提交于 2019-12-31 21:16:12
问题 Your help is needed. Is it possible to remove a border of TabSheet (~4px)? I am using PageControl as a switch-panel instead of frames, windows etc. I want everything will be straight. Big thanks for help! 回答1: unit Unit1; interface uses ..., CommCtrl; type TPageControl = class(ComCtrls.TPageControl) private procedure TCMAdjustRect(var Msg: TMessage); message TCM_ADJUSTRECT; end; TForm1 = class(TForm) ... end; ... procedure TPageControl.TCMAdjustRect(var Msg: TMessage); begin inherited; if Msg

Nice bit of code to format an xml string

假装没事ソ 提交于 2019-12-31 19:59:53
问题 Anyone got a ready made function that will take an XML string and return a correctly indented string? eg <XML><TAG1>A</TAG1><TAG2><Tag3></Tag3></TAG2></XML> and will return nicely formatted String in return after inserting linebreaks and tabs or spaces? 回答1: The RTL has FormatXMLData in XMLDoc.pas that accepts and returns strings. 回答2: Using OmniXML: program TestIndentXML; {$APPTYPE CONSOLE} uses SysUtils, OmniXML, OmniXMLUtils; function IndentXML(const xml: string): string; var xmlDoc:

Any tool to suggest unit reference automatically for Delphi 2010?

最后都变了- 提交于 2019-12-31 19:28:10
问题 MS Visual Studio has a great feature: it automatically suggests the units to add in using clause when you typing the code with refrences to absent standard classes. Is there any 3-rd party tool to implement similar feature for Delphi? I'm tired to add all those SysUtils, Windows, Messages etc in each new unit. 回答1: If the unit which contains the reference is not yet in the uses list, this is how I save many manual steps: right-click on the underlined (error-insighted) text choose “Refactoring

How can I search faster for name/value pairs in a Delphi TStringList?

不羁岁月 提交于 2019-12-31 17:59:00
问题 I implemented language translation in an application by putting all strings at runtime in a TStringList with: procedure PopulateStringList; begin EnglishStringList.Append('CAN_T_FIND_FILE=It is not possible to find the file'); EnglishStringList.Append('DUMMY=Just a dummy record'); // total of 2000 record appended in the same way EnglishStringList.Sorted := True; // Updated comment: this is USELESS! end; Then I get the translation using: function GetTranslation(ResStr:String):String; var

How to simulate an OnDestroy event on a TFrame in Delphi?

两盒软妹~` 提交于 2019-12-31 17:55:50
问题 How can i simulate an OnDestroy event for a TFrame in Delphi? i nievely added a constructor and destructor to my frame, thinking that is what TForm does: TframeEditCustomer = class(TFrame) ... public constructor Create(AOwner: TComponent); override; destructor Destroy; override; ... end; constructor TframeEditCustomer.Create(AOwner: TComponent) begin inherited Create(AOwner); //allocate stuff end; destructor TframeEditCustomer.Destroy; begin //cleanup stuff inherited Destroy; end; The problem

Delphi with HTML/CSS interface

旧巷老猫 提交于 2019-12-31 09:48:10
问题 I want to develop a delphi application with an HTML/CSS graphical user interface, not necessarily running from within a web browser. I want to do this do create a richer graphical user interface with animations etc. and break away from normal VCL components / Windows look. Any suggestions? 回答1: In one of my applications I have an an embedded browser and I have implemented the IDocHostUIHandler interface. This allows me to expose a COM object via the "GetExternal" method. I simply have a COM

How to build using MSBuild and Delphi XE2

橙三吉。 提交于 2019-12-31 08:54:50
问题 I've been building projects using Delphi XE and MSBuild using the following simple example which works fine in a batch file. Project1 is an empty project created using 'File | New | VCL forms application in the IDE: call "c:\Program Files (x86)\Embarcadero\RAD Studio\8.0\bin\rsvars.bat" msbuild.exe /target:Build /p:config=Release "c:\scratch\test\project1.dproj" pause If I created a new empty project in Delphi XE2, save it as project1.dproj (the dproj is VERY different from XE) and run the

How to track down access violation “at address 00000000”

谁都会走 提交于 2019-12-31 08:44:49
问题 I know how to create a .map file to track down access violation errors when the error message includes an actual address. But what if the error message says Access violation at address 00000000. Read of address 00000000. Where do I start looking for the cause of this problem... ? 回答1: An access violation at anywhere near adress '00000000' indicates a null pointer access. You're using something before it's ever been created, most likely, or after it's been FreeAndNil()'d. A lot of times this

Converting a Delphi application to run as a service - is it necessary?

﹥>﹥吖頭↗ 提交于 2019-12-31 08:39:33
问题 I have a delphi app that logs data from various places and writes the data to a file. The app has quite an extensive GUI to allow display of the data, configuration of the options, etc. One user has requested that the app be changed to that it can be run as a service. His reasoning is that the app could then be started at boot time and run without any user being logged in and would be available regardless of who was logged in. My question is this: Is there any other solution that would enable

Can a desktop Delphi application be certified for Windows 8 (using Windows App Certification Kit)?

痞子三分冷 提交于 2019-12-31 08:08:09
问题 Apparently, Delphi (any version) does not support safe exception handlers (/SAFESEH switch in Visual Studio). This results in a warning when using Windows Desktop App Certification Kit on Windows 8. Per certification requirements for Windows 8 desktop apps: Your app must be compiled using the /SafeSEH flag to ensure safe exceptions handling Obviously Delphi lacks this switch, so it cannot be done. My questions are: Is my understanding correct, that even though the Kit displays only a warning