delphi-xe5

Delphi XE5 RestClient and PHP generated JSON with boolean data types

雨燕双飞 提交于 2019-12-11 08:06:45
问题 I'm doing my first Android app with delphi XE5. I need to access data in a PostgreSQL database running on the intranet. Given that access to the database directly from mobile devices is not recommended, I have installed Apache Web server and PHP application to provide data. Everything works fine, but I have a problem with Boolean fields: This is a sample table: create table resources( resource_id integer not null primary key, resource_name varchar(50), is_working boolean not null default

Delphi XE5 Android - Screen resolution & device profiles

人走茶凉 提交于 2019-12-11 05:07:49
问题 I started doing an app for android in Delphi XE5, and encountered some troubles. First one was, when creating new profile for device in design time. I created new profile for my HTC One (M7), which has 4,7" screen at 1080x1920 resolution. When created profile with such data, I only got the top left part of picture after I ran it on the device itself. So, since then I'm running my app, so I can test at least the code I'm doing, in mode with default profile " 5,1" WVGA Android Phone (480dp x

PInvokeStackImbalance when calling Delphi dll function

匆匆过客 提交于 2019-12-11 03:59:31
问题 A (non-COM) Delphi dll has a function being exported: function GetQuestions(Digit1, Digit2: string; CountryISO: string):string; I have added this dll as an existing item in Visual Studio 2012 and have set its Build Action to None , Copy to Output Directory to Copy Always . The class containing the DllImportAttribute : public class RefundLibrary { [DllImport("RefundLibrary.dll", EntryPoint = "GetQuestions", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static

How to properly restore an FMX form?

自古美人都是妖i 提交于 2019-12-11 03:57:23
问题 Minimizing an FMX form with the menu bar button and then restoring by clicking on the task bar icon will bring the form back to the foreground, but will not activate the window. The form is also minimized "directly" rather applying the animation that "shrinks" the window to the taskbar. The forms OnActivate event is not fired. Curiously, if I patch the WindowProc and call ShowWindow with SW_RESTORE upon deactivation the form will get restored properly after clicking the taskbar icon. I'm not

How to populate a user-defined column in an FMX TGrid by LiveBindings

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 16:20:14
问题 I am trying to create a TCalendarEdit containing column inside a grid component in the following way. type TDatecell = class(TCalendarEdit) end; TDateColumn = class(TColumn) private function CreateCellControl: TStyledControl; override; public constructor Create(AOwner: TComponent); override; end; ... constructor TDateColumn.Create(AOwner: TComponent); begin inherited; end; function TDateColumn.CreateCellControl: TStyledControl; begin Result := TDatecell.Create(Self); end; It works fine. Then

delphi xe5 StrToFloat failure changing ThousandSeparator to ','

别来无恙 提交于 2019-12-10 13:43:45
问题 What am I doing wrong here? I simply want to convert a formatted string to a double and using the TFormatSettings passed in as a parameter to StrToFloat. I get the following exception: '3,332.1' is not a valid floating point value. The thousand separator and decimal separator are the expected values (',' and '.') in TFormatSettings. procedure TForm2.Button1Click(Sender: TObject); var FS: TFormatSettings; S: String; V: double; begin FS:= TFormatSettings.Create; codesite.Send('ThousandSeparator

Class segmentation fault (11)

大城市里の小女人 提交于 2019-12-10 13:36:44
问题 Please follow the steps below: Create New Firemonkey Moblie Application Add TGeustureManager component to the Form Add 2 TButton components to the Form Button1.Text: "Button1: Do something..." Button2.Text: "Button2: Exit Application..." Double click on Button2 Component and write the following code for OnClick Event: procedure TForm1.Button2Click(Sender: TObject); begin if MessageDlg('Are you sure you want to Exit?', TMsgDlgType.mtWarning, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0) = mrYes then

IDE Insight quit working

橙三吉。 提交于 2019-12-10 12:56:01
问题 At some point, my IDE Insight function stopped working. I have checked both the XE5 and XE6 versions that I have on my system and neither work, so it must be environmental. When I click on the menu item, nothing pops up. There is no error given, just no IDE Insert screen. The same results happen when using the shortcut. I am running Windows 7, Delphi Professional XE5 and XE6. Anyone know how to fix this? 回答1: The IDE Insight window was removed in XE5. Instead, there's an edit box top right of

Code behaves differently in Android and Windows

只谈情不闲聊 提交于 2019-12-09 23:47:58
问题 I try to draw on a bitmap. This works fine in Windows but creates a segmentation fault in Android (anyhow, that's what Delphi says, I just see no reaction on Android). I have a mobile project, form containing only a TToolbar, TSpeedButton, two TLabels and a TImage. There's just one eventhandler for the TSpeedButton click. When I comment out everything below the comment the code works fine in Android. When I try to follow with the debugger the code works fine to the end of the procedure.

How do I open URLs, PDFs, etc. with the default apps?

☆樱花仙子☆ 提交于 2019-12-09 09:59:47
问题 I am developing an Android application with Delphi XE5, and I would like to know how I can open a URL in the default browser, and a PDF file with the default reader. Developing for Windows, I used ShellExecute , but for Android and iOS what should I use? 回答1: For these kind pf task you can use the Intent class which is represented in Delphi by the JIntent interface. Try these samples Open a URL uses Androidapi.JNI.GraphicsContentViewText, FMX.Helpers.Android; procedure TForm3.Button1Click