delphi-xe2

How to call object method for any object in my metaclass?

醉酒当歌 提交于 2019-12-11 19:21:26
问题 I have basically this object structure: TJSONStructure = class(TObject); TReqBase = class(TJSONStructure) private token: Int64; public procedure FillWithTemplateData; virtual; end; TReqLogin = class(TReqBase) private username, password: String; module : Integer; public procedure FillWithTemplateData; override; end; procedure TReqBase.FillWithTemplateData; begin token := ...; end; procedure TReqLogin.FillWithTemplateData; begin inherited; username := ...; password := ...; module := ...; end;

How to turn off the antialiasing in TChart for Firemonkey?

∥☆過路亽.° 提交于 2019-12-11 18:49:37
问题 Does anyone know how to turn off the anti-aliasing in TChart for Firemonkey in Delphi XE2? 回答1: FireMonkey Canvas does not allow enabling or disabling anti-alias for individual controls. It must be done at form level (starting with XE4), using the Form1.Quality property. 来源: https://stackoverflow.com/questions/14672890/how-to-turn-off-the-antialiasing-in-tchart-for-firemonkey

How to block all incoming message to a form while thread is executing

纵然是瞬间 提交于 2019-12-11 18:35:02
问题 i have the current scenario, im using omnithreadlibrary for some generic background work like this: TMethod = procedure of object; TThreadExecuter = class; IPresentationAnimation = interface ['{57DB6925-5A8B-4B2B-9CDD-0D45AA645592}'] procedure IsBusy(); procedure IsAvaliable(); end; procedure TThreadExecuter.Execute(AMethod: TMethod); overload; var ATask : IOmniTaskControl; begin ATask := CreateTask( procedure(const ATask : IOmniTask) begin AMethod(); end ).OnTerminated( procedure begin ATask

How to autodraw the text based on graphiccontrols size

左心房为你撑大大i 提交于 2019-12-11 18:05:09
问题 I have a graphiccontrol and trying to draw text onto the canvas. Currently i am doing a Canvas.Textout() but becuase i set the values manually if the canvas area grows the text does not. I would like to make the text also grow. For example. {Sets the cards power and draws it on the tcard} //------------------------------------------------------------ procedure TCard.DrawLPower(value: string);//left number //------------------------------------------------------------ begin if fbigcard = false

RegisterPowerSettingNotification use in Delphi

妖精的绣舞 提交于 2019-12-11 17:57:54
问题 How to use the RegisterPowerSettingNotification in conjuction with GUID_MONITOR_POWER_ON in Delphi XE2? 回答1: You have to call RegisterPowerSettingNotification with the desired GUID Power Setting GUIDs to registers the application to receive power setting notifications for a specific power setting event, if not needed anymore the call UnregisterPowerSettingNotification. A delphi example could look like this: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,

How can I loop through a delimited string and assign the contents of the string to local delphi variables?

烈酒焚心 提交于 2019-12-11 16:32:28
问题 I have written a Delphi function that loads data from a .dat file into a string list. It then decodes the string list and assigns to a string variable. The contents of the string use the '#' symbol as a separator. How can I then take the contents of this string and then assign its contents to local variables? // Function loads data from a dat file and assigns to a String List. function TfrmMain.LoadFromFile; var index, Count : integer; profileFile, DecodedString : string; begin // Open a file

Delphi HID in Delphi7 and Delphi XE2

爷,独闯天下 提交于 2019-12-11 16:06:45
问题 I made a small program in Delphi 7 to show some details of all attached HID devices. I only used system files like SetupAPI , Moduleloader and HID.pas . This works perfect. When I take the same code and compile it in Delphi XE2 or (2010 for that matter), it fails to produce the required output. Probably this has something to do with pointer casting or so, but I cannot find the root cause. Can anyone help. This is my code: unit Unit1; interface uses Windows, Messages, SysUtils, Variants,

Delphi overwrite file and wrong modified date time

元气小坏坏 提交于 2019-12-11 15:55:49
问题 I'd like to get a file last modified time in Delphi. Normally something like FileAge() would do the trick, only the problem is: if I overwrite * File A * with File B using CopyFile , File A's modified date is not updated with current overwrite time as it should(?) I get that: CopyFile also copy file attributes, but I really need to get the modified date that also works when a file is overwritten. Is there such function? My whole application relies on modification time to decide whether or not

How to manage constantly changing project run-time parameters in the IDE?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 14:56:29
问题 In my (XE2) IDE I constantly have to switch the settings for Project Options/ Debugger / Parameters because I'm testing for different client configurations, databases etc. The Parameters dropdown list is becoming unmanageable. Since these have no descriptions either, it's even hard to figure out which ones to remove (How can I clean the Parameters field in the Run -> Parameters menu?). Any smart ideas on managing these? In an ideal word I would like to give them a tag/description, reorder

Enumerate list of network computers and shared folders in a tree view?

删除回忆录丶 提交于 2019-12-11 14:28:26
问题 I know there's plenty ways of enumerating computers and devices on a network, but how do I show just computers available for Windows file sharing? I need to provide a tree view of network computers and their shared folders. I know I could use existing shell controls for this, but I would rather keep it in my own tree view. It will only list those computers on the network which have shared folders. Past the computers and their shared folders, I can do the individual directory listing part