delphi-2010

Delphi 2010 RTTI : Use TValue to store data

大憨熊 提交于 2019-12-06 05:18:12
I would like to be able to use TValue to store Data in a TList<>. Like in : type TXmlBuilder = class type TXmlAttribute = class Name: String; Value: TValue; // TValue comes from Rtti end; TXmlNode = class Name: String; Parent: TXmlNode; Value: TXmlNode; Attributes: TList<TXmlAttribute>; Nodes: TList<TXmlNode>; function AsString(Indent: Integer): String; end; ... public ... function N(const Name: String): TXmlBuilder; function V(const Value: String): TXmlBuilder; function A(const Name: String; Value: TValue): TXmlBuilder; overload; function A<T>(const Name: String; Value: T): TXmlBuilder;

Delphi 2010 image on Tbutton fading/blinking

守給你的承諾、 提交于 2019-12-06 04:46:06
问题 When I set the imageindex and images property of a Button (from a imagelist component/pngs), start the program and click the button, the image is blinking slowly/ fading in and out. How to prevent this and what seems to be the problem? 回答1: Reviving an old topic... After searching for a solution on internet and found nothing, I took a look in the TCustomButton code. It happens that, internaly, a button control on Windows has an imagelist with 6 images, as follows: index 0: normal image index

Rtti data manipulation and consistency in Delphi 2010

这一生的挚爱 提交于 2019-12-06 03:33:22
Has anyone an idea, how I can make TValue using a reference to the original data? In my serialization project, I use (as suggested in XML-Serialization ) a generic serializer which stores TValues in an internal tree-structure (similar to the MemberMap in the example). This member-tree should also be used to create a dynamic setup form and manipulate the data. My idea was to define a property for the Data: TDataModel <T> = class {...} private FData : TValue; function GetData : T; procedure SetData (Value : T); public property Data : T read GetData write SetData; end; The implementation of the

How to change the font size of the editor tabs in Delphi 2010 IDE?

橙三吉。 提交于 2019-12-06 03:24:05
Does anybody knows a way to change the font size of the editor tabs in Delphi 2010 IDE? With my 1080p 22' monitor the font is too small to read and it causes pain in the eyes. Some notes It doesn't respect the system's DPI settings so changing that system setting doesn't help, moreover, I'm using 140% DPI already now, and it's Win7. I couldn't find any existing 3rd party tools to tweak that. I'll be willing to write an IDE expert to fix that problem if I know how to do it... There is not an option to change the font size of these elements, but as you say this can be done writting an expert.

Converting an AnsiString to a Unicode String

≯℡__Kan透↙ 提交于 2019-12-06 02:34:06
问题 I'm converting a D2006 program to D2010. I have a value stored in a single byte per character string in my database and I need to load it into a control that has a LoadFromStream, so my plan was to write the string to a stream and use that with LoadFromStream. But it did not work. In studying the problem, I see an issue that tells me that I don't really understand how conversion from AnsiString to Unicode string works. Here is a piece of standalone code that illustrates the issue I am

A simple debug visualizer for delphi 2010

为君一笑 提交于 2019-12-06 02:16:11
问题 I gather some experience with the trial version of delphi 2010. I am looking for a simple debug visualizer, because the sample debug visualizers are not part of the trail. I do a lot with the new rtti type TValue and TValue.ToString can't be call from the debugger (results in an exception), so my idea is to write a debug visualizer for it. The format shoul look like (<data-type)<ToString-value> examples (integer)5 (string)'Hello World' (Array<String>)['a', 'list', 'of', 'items'] With a simple

Does it make more sense to upgrade to Delphi 2009/2010 or to buy Software Assurance?

与世无争的帅哥 提交于 2019-12-06 02:03:56
问题 If you've purchased the Software Assurance, can you please share your experience? Was it worthwhile? I vaguely remember reading some negative comments about SA maybe 1 or 2 years ago. 回答1: If you normally upgrade each time a new version of Delphi is released, SA is great. It's slightly cheaper than the upgrade pricing, you get the new software right away (no wait for purchasing/ordering), and you get a couple of support incidents thrown in. It also makes it much easier for those of us who

Call Object Method using ASM

▼魔方 西西 提交于 2019-12-06 00:57:44
To better explain what I'm trying to accomplish, I'm going to start with something that works. Say we have a procedure that can call another procedure and pass a string parameter to it: procedure CallSaySomething(AProc: Pointer; const AValue: string); var LAddr: Integer; begin LAddr := Integer(PChar(AValue)); asm MOV EAX, LAddr CALL AProc; end; end; This is the procedure that we will call: procedure SaySomething(const AValue: string); begin ShowMessage( AValue ); end; Now I can call SaySomething like so(tested and works (: ): CallSaySomething(@SaySomething, 'Morning people!'); My question is,

Transparent image control with resampling in Delphi

杀马特。学长 韩版系。学妹 提交于 2019-12-06 00:57:15
问题 I have a form with a background image (painted on the form in Form1.Repaint). What I am a looking for: A transparent image control, that can smoothly resize (resample) the loaded image. (I need it to be transparent because the forms background image should be visible through) What I've tried: Standard TImage: It's transparent, but it does not resample. Graphics32 / Image32: Resamples beautifully, but it's not transparent. I have googled for several hours now for fixes or work-arounds, but

How use the insert query using parameters?

╄→尐↘猪︶ㄣ 提交于 2019-12-05 22:50:31
When i try with this query i get an error says that Perameter email doesn't exist, i am sure that the variables : email, login_pass, payment_method,operateur are valid and exists. SQLQuery2.sql.Text := 'INSERT INTO registered (email,login_pass,payment_method,operateur) VALUES (":email",":login_pass",":payment_method",":avecpuce")'; SQLQuery2.ParamByName('email').AsString := email; SQLQuery2.ParamByName('login_pass').AsString := login_pass; SQLQuery2.ParamByName('payment_method').AsString := payment_method; SQLQuery2.ParamByName('avecpuce').AsString := avecpuce; SQLQuery2.ExecSQL(true); I tried