delphi-xe2

MainFormOnTaskbar + tooltip causes focus-stealing

坚强是说给别人听的谎言 提交于 2020-01-01 12:03:14
问题 I built the code below using Delphi XE2. It creates Form1, and Form1 immediately creates an instance of Form2. When I press the button on Form2 a second Form2 is created. Now if I hover the mouse over the button on this second, topmost, Form2 and wait for the tooltip to appear, the moment the tooltip appears, the first Form2 comes to the front, stealing focus. The problem occurs only if Application.MainFormOnTaskbar is True . It also relies on the first Form2 being created from Form1's

How to create a custom control which can scroll with a fixed row and column?

醉酒当歌 提交于 2020-01-01 09:57:15
问题 I'm trying to figure out how I can make a custom control in a way where user can scroll in all directions, but with a fixed row and column. A grid is not suitable for what I'm trying to do, because it scrolls column by column. I need horizontal scrolling to be smooth, pixel by pixel. I have no use for columns, only visual grid lines. Vertical scrolling should scroll not only the area on the right, but also the fixed region on the left. Same with horizontal scrolling: the header row should

Parsing xml file Delphi

我的梦境 提交于 2020-01-01 07:03:19
问题 Firstly, I'm new to coding and Delphi, been on and off with it for a few months. Below is a sample xml file. What I'm trying to achieve is to Parse all data in each 'Name' section of the .xml file. I have never done this before. Some guidance would be appreciated. I have looked at other questions on here similar to this but I cant quite get to grips with it. I have no code example to provide....this is how stuck I am, I do not know where to begin. <ds> <Customers> <Name> <address_name>test 1<

Is it safe to type-cast TArray<X> to array of X?

江枫思渺然 提交于 2020-01-01 04:08:11
问题 Today I discovered a compiler bug (QC#108577). The following program fails to compile: program Project1; {$APPTYPE CONSOLE} procedure P(M: TArray<TArray<Integer>>); begin SetLength(M, 1, 2); end; begin end. The compiler gags on the SetLength line and says: [dcc32 Error] E2029 ')' expected but ',' found I know I could fix it like this: procedure P(M: TArray<TArray<Integer>>); var i: Integer; begin SetLength(M, 1); for i := low(M) to high(M) do SetLength(M[i], 2); end; but naturally I'm keen to

Is it safe to type-cast TArray<X> to array of X?

≯℡__Kan透↙ 提交于 2020-01-01 04:08:11
问题 Today I discovered a compiler bug (QC#108577). The following program fails to compile: program Project1; {$APPTYPE CONSOLE} procedure P(M: TArray<TArray<Integer>>); begin SetLength(M, 1, 2); end; begin end. The compiler gags on the SetLength line and says: [dcc32 Error] E2029 ')' expected but ',' found I know I could fix it like this: procedure P(M: TArray<TArray<Integer>>); var i: Integer; begin SetLength(M, 1); for i := low(M) to high(M) do SetLength(M[i], 2); end; but naturally I'm keen to

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

Designintf.dcu not found in custom component

北城余情 提交于 2019-12-31 01:22:05
问题 I am here converting some customize delphi component to latest delphi xe5. I already build it in delphi xe5 ide and where desgninf i replaced with designintf and design editor. i also include designide.dcp in reference . it build and install sucessfully . but there some packages while i try to use and complie error like designinf.dcu not found come . i study on internet for solution as after delphi 6 their delphi not redistributed their design time packges. but because it in delphi 5 and

How to load and display tiff images in TImage control?

一曲冷凌霜 提交于 2019-12-31 00:39:29
问题 I am currently working on Delphi XE2 trial version. I want to load and display TIFF images in TImage control without using any third party component/library. I tried below code but it is not woking for me. Procedure TForm1.Button1Click(Sender: TObject); Var OleGraphic : TOleGraphic; fs : TFileStream; Source : TImage; BMP : TBitmap; Begin Try OleGraphic := TOleGraphic.Create; fs := TFileStream.Create('c:\testtiff.dat', fmOpenRead Or fmSharedenyNone); OleGraphic.LoadFromStream(fs); Source :=

string := const : why different implementation for local and result?

跟風遠走 提交于 2019-12-30 17:26:07
问题 In Delphi function result is frequently implemented as var-parameter (not out-parameter despite QC ticket). String constants are basically variables with negative refcounter, which should suppress automatic memory [de]allocation. http://docwiki.embarcadero.com/RADStudio/XE3/en/Internal_Data_Formats#Long_String_Types It really does suppress it: the code below does not leak. type TDealRecord = record id_Type: Integer; Price: extended; Remark: String; end; const const_loop = 100000000; function

VCL-Styles embedded in dll?

偶尔善良 提交于 2019-12-30 09:35:27
问题 How do I embed Delphi XE2 VCL-Styles in a dll? The Application - Appearance page is not visible in project settings for DLL-projects. I tried defining them in a rc-file included with a $R directive which works but if there is a better way I'd like to know. RC-file example: GOLDENGRAPHITE VCLSTYLE "C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\Redist\styles\vcl\GoldenGraphite.vsf" CARBON VCLSTYLE "C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\Redist\styles\vcl\Carbon.vsf" In particular