firemonkey

Change text size in Firemonkey StringGrid

一世执手 提交于 2019-12-30 11:38:28
问题 How to change text size in stringgrid header? 回答1: You could write an OnApplyStyleLookup event handler similar to this: procedure TForm1.StringGrid1ApplyStyleLookup(Sender: TObject); var Header: THeader; I: Integer; begin Header := THeader((Sender as TStringGrid).FindStyleResource('header')); if Assigned(Header) then begin for I := 0 to Header.Count - 1 do with Header.Items[I].Font do begin Size := 32; Style := [TFontStyle.fsBold]; end; Header.Height := 48; end; TStringGrid(Sender).Realign;

how to show the availble files in Android memory with Firemonkey

可紊 提交于 2019-12-30 10:46:06
问题 In Delphi for Windows one has the TOpenDialog and the commands such as FindFirst . In Firemonky/Android there is no TOpenDialog , but according to many forums FindFirst` should exist. However there are more who have problems with it, but no solution: In Windows the following functions properly: var iResult,n:integer; Filenaam,s:string; sr: TSearchRec; begin with form1 do begin L_toonactie.Text:='start file list'; M_filelist.lines.Clear; Filenaam:= System.IOUtils.tpath.GetDocumentsPath+'

How to call NSBeep from Delphi

你离开我真会死。 提交于 2019-12-30 08:00:14
问题 I'm looking for a MessageBeep replacement on the OS X. It seems that the proper function to call would be NSBeep but it is not supported by XE2 RTL. How do I call NSBeep from Delphi application? 回答1: It's just a plain C function: procedure NSBeep; cdecl; external '/System/Library/Frameworks/AppKit.framework/AppKit' name '_NSBeep'; 来源: https://stackoverflow.com/questions/10287149/how-to-call-nsbeep-from-delphi

XE4 ( Firemonkey + iOS Static Library) , Pascal conversion from Objective C Class?

混江龙づ霸主 提交于 2019-12-28 06:34:05
问题 How to Conversion ? (Objective C Class -> Delphi XE4 ) and How to use Objective-C Class in static Library from Delphi XE ? Following is the my first trial. But It makes error. Objective C Source // objective C : test.h ---------------------------------------- @interface objc_test : NSObject { BOOL busy; } - (int) test :(int) value; @end // objective C : test.m ---------------------------------------- @implementation objc_test - (int) test :(int) value { busy = true; return( value + 1); } @end

How to close android app in Delphi-XE5 Firemonkey application?

夙愿已清 提交于 2019-12-28 04:26:14
问题 I have this piece of code procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean); var msg: String; begin msg := 'Do you really want to exit?'; if MessageDlg(msg, TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0) = mrNo then CanClose := False else CanClose := True; { FIXME: don't want to work on Android } end; It works perfectly on Windows. Application closes if I choose 'Yes'. However, application does NOT close on Android. What I am doing wrong? 回答1:

Delphi resource string optimization

匆匆过客 提交于 2019-12-25 09:25:28
问题 I have written a class that is declared like this in the private section piaces: TCompStar; and I am using the following code on the form create event: begin pieces.Items[0].insert('string 1'); pieces.Items[0].insert('string 2'); pieces.Items[0].insert('string 3'); //I am adding other 12 elements end; This is under firemonkey. Now I have only 15 elements (just debug) but soon I could have (worst case) 12509 items. We have a delphi unit that contains all the strings that must be added with the

FMX TGrid OnGetValue after column moving

不问归期 提交于 2019-12-25 09:03:51
问题 I have Grid with enabled columns moving, and code: type TRec = record Col0, Col1, Col2: string; end; var Data: TArray<TRec>; procedure TFormMain.GridGetValue(Sender: TObject; const Col, Row: Integer; var Value: TValue); begin case Col of 0: Value := Data[Row].Col0; 1: Value := Data[Row].Col1; 2: Value := Data[Row].Col2; end; end; When column is moved this OnGetValue code works incorrectly (shown columns data on the previous positions). How to fix this? Should I use OnColumnMoved event and

Make an installer with Delphi

核能气质少年 提交于 2019-12-25 07:38:16
问题 In my Project I have some files to copy in program files directory and make a shortcut for one executable and other works like an installation. I want to do this in my application with store files in Packages, like CAB files and show installation in a progress bar. First I think about a msi wrapper, but some users said that is so slow! How can I do this in best way? 回答1: Here is a small template for start: unit Unit1; interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics,

How to add some buttons to selected ListBox item via style?

孤者浪人 提交于 2019-12-25 04:14:08
问题 Is there a way to add some buttons to the selected ListBoxItem by adding these buttons to a style which is being used for the selected item? I didn't yet find a suitable style FMX uses to display the selected item. My goal is to have some buttons on the selected item with context based functionality. While I can do this by reparenting a TButton created in code in the OnPaint event of the ListBox, this works for Android but not for Win32 as it is being overpainted by the selection. Other

The input is not a valid Base-64 string Error, My JSON uses double quotation marks instead of single quotations

我与影子孤独终老i 提交于 2019-12-25 03:18:57
问题 I am trying to send a JSON post, but my JSON seems to differ a little bit from what the site usually sends Here is what i am sending: {"CodeNumberTextBox":"","txusername":"yC6IBEbznlRlKOKv8zrhiA","txpass":"pAQAyrr5u9/hK35iTIlt7Q=="} Here is what the website sends when you click login: { CodeNumberTextBox:'', txusername:'yC6IBEbznlRlKOKv8zrhiA', txpass:'pAQAyrr5u9/hK35iTIlt7Q==' } Here is the error i get when i send my JSON: 'The input is not a valid Base-64 string as it contains a non-base 64