delphi-xe3

Undocumented Members of TPropInfo

空扰寡人 提交于 2019-12-04 01:27:08
问题 System.TypInfo.TPropInfo has two function members (at least in D-XE3): function NameFld: TTypeInfoFieldAccessor; inline; function Tail: PPropInfo; inline; I cannot find any documentation for them or any examples of their use. What are they for and how can they be used? (Hope that qualifies as one question.) 回答1: The NameFld function returns the name of a property as a TTypeInfoFieldAccessor . This allows you to do the following: MyPropertyName:= MyPropInfo.NameFld.ToString; if (PropInfoA

TChromium ChromeTabs Not Working

岁酱吖の 提交于 2019-12-03 23:09:34
I want do a Tabs for my TChromium. I have this: Browsers: array[0..1000] of TChromium; And this ChromeTabs procedures: procedure TForm1.ChromeTabsActiveTabChanged(Sender: TObject; ATab: TChromeTab); var c:integer; begin for c := 0 to ChromeTabs.Tabs.Count do if browsers[c]<>NIL then if c=ChromeTabs.ActiveTabIndex then browsers[c].Visible:=true else browsers[c].visible:=false; end; procedure TForm1.ChromeTabsButtonAddClick(Sender: TObject; var Handled: Boolean); begin browsers[ChromeTabs.ActiveTabIndex]:=TChromium.Create(Chromium); browsers[ChromeTabs.ActiveTabIndex].OnAddressChange:=Chromium

How do I get the SelectedValue of a ComboBox from code?

故事扮演 提交于 2019-12-03 17:37:00
I am trying to build something like a TLookupComboBox using LiveBindings. I have placed a normal TComboBox on a VCL form. I also have a data set with some rows that have the two fields id and text . Then I used the LiveBindings editor to create a TBindSourceDB and a TBindingsList . There is just one binding in it: object BindingsList1: TBindingsList Methods = <> OutputConverters = <> UseAppManager = True Left = 244 Top = 229 object LinkFillControlToField1: TLinkFillControlToField Category = 'Quick Bindings' Control = ComboBox1 Track = True FillDataSource = BindSourceDB1 FillValueFieldName =

Getting application path in Firemonkey

為{幸葍}努か 提交于 2019-12-03 16:11:02
问题 So in VCL, one would use the following line of code to retrieve the applications path: ExtractFilePath(Application.ExeName) I tried the same thing Firemokey and I noticed that ExeName was no longer available. What code can I use as an alternative to this? 回答1: Try using ParamStr(0) instead of Application.ExeName. 回答2: I'm using showmessage(System.SysUtils.GetCurrentDir); and works like a charm :) 来源: https://stackoverflow.com/questions/15218979/getting-application-path-in-firemonkey

How to get the type of the elements in a declared TList

回眸只為那壹抹淺笑 提交于 2019-12-02 18:46:32
问题 I'd like to know if there is a way to get the type of the elements of a declared, but not instantiated, TList. I can capture the class of an object property like this: MyList: TList<TMyObject> read FMyList; MyRTTIProperty: TRttiProperty; NewObject: TObject; PropertyClass: TClass; MyRttiProperty := MyRttiType.GetProperty('MyList'); PropertyClass := MyRTTIProperty.PropertyType.Handle.TypeData.ClassType; // (returns TList<TMyObject>) NewObject := PropertyClass.Create; This way I can instantiate

How to copy a locked file like .pst using delphi xe3

大城市里の小女人 提交于 2019-12-02 11:23:54
I am struggling to find an answer to the following problem. Any and all help would be appreciated. I am using the following code to try and copy an outlook.pst file while outlook is open. And i cannot get it to succeed. It does not give an error, it just doesnt copy the file. copyfile('C:\Users\Administrator\Documents\Outlook Files\Outlook.pst','F:\Outlook.pst'); If you guys know how i will be able to copy a locked file like that please assist. I have tried and found that TFilestream also does not work. And those 2 are the only options i know off. any help would be greatly appreciated. Thank

Move borderless form in Firemonkey

╄→尐↘猪︶ㄣ 提交于 2019-12-02 11:02:18
In VCL forms I use WM_SYSCOMMAND , but in firemonkey it is undeclared. I test this code: procedure TForm4.dragPanelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin isDraging := true; X0 := X; Y0 := Y; end; procedure TForm4.dragPanelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin if isDraging then begin Form4.Left := Trunc(Form4.Left + X - X0); Form4.Top := Trunc(Form4.Top + Y - Y0); end; end; procedure TForm4.dragPanelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin isDraging := False; end; this

Remove classes string name from compiled release exe

我只是一个虾纸丫 提交于 2019-12-02 10:16:46
I compile the release version of my application project. When I look with binary editor my compiled final exe i can see all the class name of my own created object, for example : TPolygon, TRectangle, etc..., as binary text data inside the exe. How i can remove this information from exe. I try to remove disabling RTTI using in dpr: {$WEAKLINKRTTI ON} {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} But not luck, any hints. If you were to remove class names from the executable, then your application would stop working. The .dfm files that are compiled into your application contain the

Install font in firemonkey

此生再无相见时 提交于 2019-12-02 10:00:25
How Can I use embedded font or install new fonts in my firemonkey application? I tried this solution but WM_FONTCHANGE is not defined in FMX! I want to use custom font in my application, how I can do this? I followed the instructions here, and they were of some help. I have a few extra hints that may help, The two inclusions that you will need to make this work is WinAPI.Windows and WinAPI.Messages. If you put these inclusions at the start of your "uses" clause, you're unlikely to have name conflicts with things like TBitmap. Now, I've adding the following code, procedure TMainForm.FormCreate

How to get the type of the elements in a declared TList

夙愿已清 提交于 2019-12-02 09:00:53
I'd like to know if there is a way to get the type of the elements of a declared, but not instantiated, TList. I can capture the class of an object property like this: MyList: TList<TMyObject> read FMyList; MyRTTIProperty: TRttiProperty; NewObject: TObject; PropertyClass: TClass; MyRttiProperty := MyRttiType.GetProperty('MyList'); PropertyClass := MyRTTIProperty.PropertyType.Handle.TypeData.ClassType; // (returns TList<TMyObject>) NewObject := PropertyClass.Create; This way I can instantiate my list correctly. But now I also want to get the class of the elements, TMyObject, so that I can