firemonkey

Dim Screen Android Firemonkey

你说的曾经没有我的故事 提交于 2019-12-10 19:06:12
问题 Does anyone know how to dim the screen on Delphi Firemonkey for Android? I've been googling around and searching but could only find how to remove the auto dim for android by acquiring a Wakelock (Delphi XE5 Android. How to use PowerManager.WakeLock?). At best I'd like to achieve two states: Evening = 20% brightness Daytime = 100% brightness I am using Delphi 10.1 Berlin. Thank you for your help. 回答1: Taking this Stack Overflow question, which has the Java solution, as a guide I rustled up

iOS objective-c object: When to use release and when to not use it

你。 提交于 2019-12-10 18:23:43
问题 I m under iOS and I m developping with delphi Tokyo, and this is my code : aUIImage := TUIImage.Wrap(TUIImage.alloc.initWithCGImage(aCGImageRef)); try aData := TNSData.Wrap(UIImageJPEGRepresentation((aUIImage as ILocalObject).GetObjectID, cWin_DefaultJPGCompressionRate / 100)); try aWorkPicStream.WriteBuffer(aData.bytes^, aData.length); finally aData.release; // << this make my code will crash (later not now) end; finally aUIImage.release; end; After executing the code before I have a little

Transparent background TStringGrid

主宰稳场 提交于 2019-12-10 17:34:23
问题 The question is about creating a transparent background in the TStringGrid control. The idea was to modify the white color that is created by default in the grid and use a null color, but I have not succeeded. I share here what has been done so far. After researching the issue, I was able to show some transperence in the StringGrid by modifying the opacity property, through "Edit Custum Style" in the Background section. This solution is not perfect because it affects the associated TScrollBox

How to free a control in its own event?

谁说我不能喝 提交于 2019-12-10 16:37:52
问题 I have a list of TPanels in a FMX application and I want to free a panel if I click on it. To free them directly in the Onclick-handler is not the right way, because I get an access-violation. And I don't want to use windowsmessages (recommended in How to free control inside its event handler? and Why does my program crash when I destroy a button in its own OnClick handler?) because it is a firemonkey application and I do not know how these messages work on android and mac. Is there another

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 EMS FireDAC: How to pass parameter from client to server using EMS?

℡╲_俬逩灬. 提交于 2019-12-10 15:48:28
问题 I am working on the simple client server application using EMS (i.e: for future iOS application) in Delphi. On the client unit, I have EMSProvider and EMSFireDACClient which fetches data from a Database (MSSQL) through a Datasource. On the server unit, I have FDConnection and TFDQuery which deals with my Database. So far everything is working fine. Question: Now I need to pass some parameters from client to the server and that fetches the result data. How should I do using EMS ? Any functions

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

In Delphi XE2 FireMonkey - How do i change the color of a button after pressing it

孤街醉人 提交于 2019-12-10 13:14:48
问题 I just want to change the color of a button after I press it. Do I have to use "styles" to do this or....? 回答1: You can change the button.StyleLookup property to change the style (color). You need to add a new style to the Stylebook. Select 'Edit custom style ...' in the Right mouse button menu from a button. Change the Fill.Color property from the TRectangle items under the background:TRectangle Apply and Close Stylebook Clear button.stylelookup Change the button.stylelookup in your

Issue with TFDQuery on a form connecting to a datamodule

≯℡__Kan透↙ 提交于 2019-12-10 12:19:55
问题 I have a datamodule with a TFDConnection connecting to a SQLLite db. Queries on the datamodule work fine. But if I have a query on a form connecting to the connection on the datamodule when setting Active to true I get the error: exception message : [FireDAC][Comp][Clnt]-512. Connection is not defined for [FDQuery1]. Possible reason: Connection and ConnectionName property values This happens in design time. This is with Delphi Tokyo in a Firemonkey mobile app. 回答1: I think this may be a

Firemonkey: How to align properly label on the right?

天大地大妈咪最大 提交于 2019-12-10 11:39:24
问题 If I do RectangleCont.beginUpdate; myText1 := TText.Create(RectangleCont); myText1.parent := RectangleCont; myText1.text := 'a long text'; myText1.Position.x := RectangleCont.width - myText1.width; // 150px for exemple myText1.align := TalignLayout.right; myText2 := TText.Create(RectangleCont); myText2.parent := RectangleCont; myText2.text := 'OK'; myText2.Position.x := RectangleCont.width - myText1.width - myText2.width; // 50px for exemple myText2.align := TalignLayout.right; myText3 :=