delphi-xe6

Positioning Hints for Components in Delphi

霸气de小男生 提交于 2019-12-07 06:01:13
问题 Using Delphi XE6, I am creating a TdateTimePicker-like control, but for a couple of reasons, I am using a TButtonedEdit which has a TMonthCalendar "embedded" within it. A full bare-bones demo is: I have got it going as desired with the month calendar being SHOWn when the right button is clicked ( with Style=WS_POPUP ) and I HIDE it when a selection is made, the user navigates away, ESCapes etc. unit DateEditBare1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System

TPanel does not AutoSize when containing a TPanel

冷暖自知 提交于 2019-12-07 04:56:32
问题 I have a panel inside another: The inner panel is aligned alTop : And the outer panel is set to AutoSize=true : And everything sizes. If i changes the height of the inner panel at design time, the outer panel auto sizes to accommodate it: And now runtime Now i need to change the height of the inner panel at runtime: procedure TForm2.Button1Click(Sender: TObject); begin pnlInner.Height := pnlInner.Height + 50; lblPointer.Top := pnlOuter.Top + pnlInner.Height; end; Except when i change the

Issue with GCM Push notification service DELPHI XE6

余生长醉 提交于 2019-12-06 15:40:57
问题 I'm developing a GCM Push notification on delphi xe6. I use the code in this post https://stackoverflow.com/questions/21466094/start-android-activity-before-passing-the-gcm-intent (using the standars components in the AndroidManifest.xml) for my own app and I manage to use the service to receive the notification even if the app is not running. But I have a problem when I receive the notification and that is i cant capture the onclick event, so my apps open (great) but it doesn't do the desire

Delphi create JSON

人盡茶涼 提交于 2019-12-06 12:29:55
问题 I'm on Delphi XE6 and I search the best way for create JSON and for parse JSON. I try to work with REST.Json unit and this method : TJson.ObjectToJsonString TContrat = class private FdDateDeb: TDate; public property dDateDeb: TDate read FdDateDeb write FdDateDeb; end; TApprenant = class private FsNom : string; [JSONName('ListContrat')] FListContrat: TObjectList<TContrat>; public property sNom : string read FsNom write FsNom; property ListContrat: TObjectList<TContrat> read FListContrat write

Firemonkey TWebBrowser input alternative?

我的未来我决定 提交于 2019-12-06 03:32:38
问题 As Embarcadero said : " WebBrowser Does Not Accept Keyboard Input on Android On Android devices, the on-screen keyboard is not available in a TWebBrowser control. This means that a user cannot complete a web form, for example. The TWebBrowser control should be used for displaying information or documents. User interaction should be performed with FireMonkey controls. " Link This is very annoying if we have to use Clouds identification pages like Dropbox or Google Drive. Using Delphi XE5 with

Delphi & Indy & utf8

懵懂的女人 提交于 2019-12-06 01:08:04
i have a problem to access into websites whit utf8 charset, for example when i try to accesso at this www Click for example all utf8 characters are not correctly codified. This is my access routine: var Web : TIdHTTP; Sito : String; hIOHand : TIdSSLIOHandlerSocketOpenSSL; begin Url := TIdURI.URLEncode(Url); try Web := TIdHTTP.Create(nil); hIOHand := TIdSSLIOHandlerSocketOpenSSL.Create(nil); hIOHand.DefStringEncoding := IndyTextEncoding_UTF8; hIOHand.SSLOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2,sslvSSLv2,sslvSSLv3,sslvSSLv23]; Web.IOHandler := hIOHand; Web.Request.CharSet :=

TPanel does not AutoSize when containing a TPanel

冷暖自知 提交于 2019-12-05 10:33:17
I have a panel inside another: The inner panel is aligned alTop : And the outer panel is set to AutoSize=true : And everything sizes. If i changes the height of the inner panel at design time, the outer panel auto sizes to accommodate it: And now runtime Now i need to change the height of the inner panel at runtime : procedure TForm2.Button1Click(Sender: TObject); begin pnlInner.Height := pnlInner.Height + 50; lblPointer.Top := pnlOuter.Top + pnlInner.Height; end; Except when i change the height of the inner panel at runtime , the autosize panel does not autosize : This of course worked in

Positioning Hints for Components in Delphi

不打扰是莪最后的温柔 提交于 2019-12-05 09:48:41
Using Delphi XE6, I am creating a TdateTimePicker-like control, but for a couple of reasons, I am using a TButtonedEdit which has a TMonthCalendar "embedded" within it. A full bare-bones demo is: I have got it going as desired with the month calendar being SHOWn when the right button is clicked ( with Style=WS_POPUP ) and I HIDE it when a selection is made, the user navigates away, ESCapes etc. unit DateEditBare1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.ImgList, Vcl

How to check if the app is running on iOS device or simulator in Delphi XE6

依然范特西╮ 提交于 2019-12-05 06:03:32
Based on this link Conditional compilation (Delphi) CPUARM conditional if should be false for Simulator and true for device, the problem is it's not working for me. I am using Delphi XE6, iOS Simulator 7.1 This is my code {$IFDEF CPUARM} s := 'iOS device'; {$ELSE} s := 'iOS Simulator'; {$ENDIF} p.s iOS Simulator is running in a VMWare virtual machine. Checking for CPUARM is the correct solution. iOS binaries compiled for the simulator are not ARM, they are actually x86. Just make sure to wrap your iOS code with {$IFDEF IOS} : {$IFDEF IOS} {$IFDEF CPUARM} s := 'iOS device'; {$ELSE} s := 'iOS

Testing the type of a generic in delphi

本秂侑毒 提交于 2019-12-05 02:09:21
I want some way to write a function in delphi like the following procedure Foo<T>; begin if T = String then begin //Do something end; if T = Double then begin //Do something else end; end; ie: I want to be able to do different things based on a generic type I've tried using TypeInfo in System but this seems to be suited to objects rather than generic types. I'm not even sure this is possible in pascal TypeInfo should work: type TTest = class class procedure Foo<T>; end; class procedure TTest.Foo<T>; begin if TypeInfo(T) = TypeInfo(string) then Writeln('string') else if TypeInfo(T) = TypeInfo