delphi-xe2

How to iterate a TDictionary and delete item?

懵懂的女人 提交于 2020-01-02 03:12:06
问题 I have a TDictionary and add some items to it: for index := 0 to 10 do dict.Add(IntToStr(index), index); Now, I need to iterate the container and remove items I wanted: pairEnum := dict.GetEnumerator; while pairEnum.MoveNext do begin if pairEnum.Current.Value mod 2 = 0 then dict.Remove(pairEunm.Current.Key); end; I expect I now only have odd number in the dictionary. But what I actually got are: key=1 value=1 key=3 value=3 key=5 value=5 key=7 value=7 key=9 value=9 key=8 value=8 <- Why the "8"

Delphi Xe2 with Firemonkey : Can you have a non-client area that is painted in a style other than the default Windows nonclient paint style?

a 夏天 提交于 2020-01-02 00:49:32
问题 Here is a sample of a delphi application I am making using firemonkey + Delphi XE2. As you can see, you can use the visual style "stylebook" in Firemonkey to customize the appearance of most things inside the window frame. However the outside of the window frame is drawn using whatever style Windows decides. Now if I was using VCL instead of Firemonkey, I could apply "VCL Styles" and "skin" the whole VCL application in a dark color scheme. My guess is that this is NOT YET posssible with

Can the TWebBrowser be used in a thread in Delphi without Application.ProcessMessages?

纵然是瞬间 提交于 2020-01-01 14:44:50
问题 I am trying to create screen captures of web pages in a Delphi server application (XE2) using TWebBrowser. The screen captures are initiated via web service calls to my server, so to preserve scalability, I would like to service the requests without relying on critical sections or Application.ProcessMessages to do the web page rendering. Can this be done with TWebBrowser? 回答1: I've done this already in a number of objects, and sadly enough the TWebBrowser object ties very much into it's

Delphi XE2 styles painting

£可爱£侵袭症+ 提交于 2020-01-01 14:38:08
问题 I am having trouble with incorrectly painted corners when drawing VCL-styled window elements. On styles that have rounded corners, I get a white background in the space between the control's bounding rect and the style's rounded window corner. The above image was run using Aqua Light Slate, but any style with rounded corners will show this same problem. What am I missing? type TSample = class(TCustomControl) protected procedure Paint; override; end; { TForm1 } procedure TForm1.FormCreate

Removing firemonkey from Windows taskbar

℡╲_俬逩灬. 提交于 2020-01-01 12:33:08
问题 Is there a way, to remove my firemonkey application form Windows XP/vista/7 taskbar? There is no info when i google. The problem: How to hide the form that is located in a dll from the Windows taskbar. 回答1: NB: Talibek answered his own question within the question, for clarity I have moved it here. You need to get your main form handle ( Form1.Handle ), because there is no Application.handle in firemonkey, then convert it with FmxHandleToHWND ( FMX.Platform.Win ) to normal window handle. From

Is it possible to add a history list dropdown to Delphi's TButtonedEdit?

倖福魔咒の 提交于 2020-01-01 12:32:31
问题 I'm using Delphi XE2's TButtonedEdit but I would like to add a dropdown list for the history (like TComboBox). I know that TComboBox is a glorified TEdit, so is there a message I can send to TButtonedEdit to add this functionality please? Thanks. 回答1: You can use the IAutoComplete2 interface to accomplish this task. Check this sample code (adapted for TButtonedEdit and Delphi XE2), based on this answer (Auto append/complete from text file to an edit box delphi) from Ken White uses Winapi

Is it possible to add a history list dropdown to Delphi's TButtonedEdit?

瘦欲@ 提交于 2020-01-01 12:32:02
问题 I'm using Delphi XE2's TButtonedEdit but I would like to add a dropdown list for the history (like TComboBox). I know that TComboBox is a glorified TEdit, so is there a message I can send to TButtonedEdit to add this functionality please? Thanks. 回答1: You can use the IAutoComplete2 interface to accomplish this task. Check this sample code (adapted for TButtonedEdit and Delphi XE2), based on this answer (Auto append/complete from text file to an edit box delphi) from Ken White uses Winapi

Performing OpenGL Drawing from within a Thread

狂风中的少年 提交于 2020-01-01 12:31:51
问题 I've been wrapping the core OpenGL functionality within a Delphi VCL custom control. Currently, I am doing a loop using a TTimer created within this control. I strongly feel using a timer is completely wrong, as drawing could both overlap and have delays. Instead, I would like to put this drawing loop within a thread. Please refer to my original question with some issues of flickering - which I'm putting the blame on the TTimer which I'm using. Question Is OpenGL safe to use inside of a

Performing OpenGL Drawing from within a Thread

时间秒杀一切 提交于 2020-01-01 12:31:09
问题 I've been wrapping the core OpenGL functionality within a Delphi VCL custom control. Currently, I am doing a loop using a TTimer created within this control. I strongly feel using a timer is completely wrong, as drawing could both overlap and have delays. Instead, I would like to put this drawing loop within a thread. Please refer to my original question with some issues of flickering - which I'm putting the blame on the TTimer which I'm using. Question Is OpenGL safe to use inside of a

MainFormOnTaskbar + tooltip causes focus-stealing

孤街浪徒 提交于 2020-01-01 12:04:11
问题 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