firemonkey

How to get currently logged in username?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 06:15:16
How do you get the currently logged in username in a Firemonkey Delphi project? I'm targeting both Windows and Mac. I have XE2, but I suppose any version solution is fine because I will upgrade if needed. RRUZ For Windows you can use the GetUserName WinAPi function, for OSX you can use the NSUserName and/or NSFullUserName methods. Try this sample for OSX {$APPTYPE CONSOLE} {$R *.res} uses Macapi.CoreFoundation, Macapi.Foundation, System.SysUtils; function NSUserName: Pointer; cdecl; external '/System/Library/Frameworks/Foundation.framework/Foundation' name _PU +'NSUserName'; function

How to store images in FireMonkey?

谁说胖子不能爱 提交于 2019-11-28 14:33:11
In VCL I had ImageList to store images. In FireMonkey there is no ImageList control. How do I store images in FireMonkey for later use? To add images in FireMonkey (XE4) Project -> Resources and Images Then to access it: procedure TForm1.Button1Click(Sender: TObject); var InStream: TResourceStream; begin InStream := TResourceStream.Create(HInstance, 'MyPng', RT_RCDATA); try Image1.Bitmap.LoadFromStream(InStream); finally InStream.Free; end; end; Thanks to Peter Vonča Because there is no ImageList in Delphi Android you have to: Add your Images to your Project Project -> Resources and Images

How to get Item.LookupData and SelectedValue (as integer) of an FMX TComboBox at runtime?

99封情书 提交于 2019-11-28 14:18:15
There is a ComboBox on the FMX Form. It is binded with a datasource (table that has an id -integer and speciality - varchar fields) in the following manner- object LinkFillControlToField1: TLinkFillControlToField Category = 'Quick Bindings' Control = ComboBox1 Track = True FillDataSource = BindSourceDB1 FillValueFieldName = 'id' FillDisplayFieldName = 'speciality' AutoFill = True BufferCount = -1 AutoBufferCount = False FillExpressions = <> FillHeaderExpressions = <> FillBreakGroups = <> end It is simple to get access to the value of chosen speciality (from ComboBox1.Selected.Text ) but I can

Messagedlg in Delphi xe7 android

混江龙づ霸主 提交于 2019-11-28 14:10:31
I m just trying to execute a sample given during the installation of Delphi xe7, the MessageAlerts on android platform, unfortunately it does not working, it gives the following error message: Blocking Dialogs not implemented in this platform procedure TMessageAlertsForm.btnMultiButtonAlertClick(Sender: TObject); begin { Show a multiple-button alert that triggers different code blocks according to your input } case MessageDlg('Choose a button:', System.UITypes.TMsgDlgType.mtInformation, [ System.UITypes.TMsgDlgBtn.mbYes, System.UITypes.TMsgDlgBtn.mbNo, System.UITypes.TMsgDlgBtn.mbCancel ], 0)

Delphi: How to Get All Images From Server Database by using App tethering?

若如初见. 提交于 2019-11-28 13:59:45
问题 Hi, EveryBody! I've Client and Server . I'm using Delphi-xe8. App ->Multi-Device Application Both Client and Server are using App tethering, SQLite Database. When Server adding image to database, it's perfectly adding, but In a Client side when Client click "Get Image List" button . Client Recieve only one image [I want All images]. 1. Quation: How to get All images from Server Database to Client Database. by using App tethering[SendStream]? I think Problem with AResource.Value.AsStream need

How to create splashscreen in FireMonkey?

落花浮王杯 提交于 2019-11-28 09:09:23
问题 I need to create a splashscreen while my FMX program is launching. The following code from VCL does not works anymore: SplashScreen := TSplashScreen.Create(Application); SplashScreen.Show; Application.Initialize; SplashScreen.Update; //No such function in FMX Application.Run; Problem is that in FMX forms are not created/repainted until Application.Run executed, as they use some FMX magic to repaint. Using VCL splashscreen is not an option since I need OSX support. How do I create a

Firemonkey TControl subclass cannot draw on component

泪湿孤枕 提交于 2019-11-28 08:55:37
问题 I want to try to create a firemonkey visual component and I have seen online that TControl gives the basic needs. This is what I have done so far: TMyTest = class(TControl) strict private //code... protected procedure Paint; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; //code... end; I have looked at the source code of a FMX component called PlotGrid and I have copied what it does. My class descends from TControl (like PlotGrid) and it

MessageDlg with custom button captions in Delphi FireMonkey

前提是你 提交于 2019-11-28 06:44:48
问题 With VCL you can use CreateMessageDialog to generate a message dialog with custom button captions. With FMX CreateMessageDialog does not seem to exist anymore (since XE3). Is there a way to customize the button captions with FireMonkey other than rebuilding the message dialog from scratch? What I would like to be able is to call a function as described here: MessageDlg( 'Really quit application ?', mtWarning, [ButtonInfo(mbNo, 'Do&n''t save'), ButtonInfo(mbCancel, '&Cancel'), ButtonInfo(mbYes

How to add nodes to FireMonkey's TreeView at runtime

久未见 提交于 2019-11-28 04:18:35
问题 I can't found any sample in the online documentation, or in the demos included with Delphi XE2, for adding nodes to a FMX.TreeView.TTreeView control at runtime. So, how can I add, remove, and traverse nodes of a FireMonkey TreeView at runtime? 回答1: I think we are all learning at this point... But from what I have seen the TTreeView use the principle that any control can parent another control. All you need to do is set the Parent Property to get the item to show up as a child. var Item1 :

Firemonkey - Message Handling

感情迁移 提交于 2019-11-28 04:09:27
问题 I'm currently trying to develop a project based upon Firemonkey. I'm using Firemonkey for it's UI features as the project consists of many smaller applications, each with a 3D aspect to it. I'm currently only developing/deploying to Windows with the FMX framework, but may go cross-platform at a later date. I've gotten around most issues I've come across by building a VCL Windows application in the background to perform a very specific action, and then building an FMX frontend. However, this