delphi-10.1-berlin

Hints on Firemonkey not displaying in Delphi Seattle

安稳与你 提交于 2019-12-12 12:43:26
问题 It is nice that Firemonkey got again the Hint property for controls, at least in Delphi Berlin and Seattle. However, the implementation seems to be a bit flawed yet. One weird issue is that the displaying of the Hint seems related to the form's BorderIcons property. If the BorderIcons are left with the default values (Maximize, Minimize, SystemMenu), the hint shows. But if I change some of the border icons, the hints don't show any more. I don't see any logic for it, so it looks like a bug. I

Object with auto execute procedures

北战南征 提交于 2019-12-11 09:45:24
问题 Is there a way to create an object with auto execute procedures? For example if a variable within this object has changed a private procedure kicks in and starts to do something? 回答1: The language offers no such functionality. You have to implement it yourself. Typically that's done by hiding the variable as a private , or better a strict private , and then ensure that all access to the variable is routed through a property. Then you can take whatever action you need in the property setter

How to make ComboBox drop-down list be *Narrower* than the ComboBox itself

筅森魡賤 提交于 2019-12-11 09:03:32
问题 Is it possible to make a ComboBox Drop-down list be Narrower than the Combobox itself? There are plenty of examples setting the width using SendMessage(Handle, CB_SETDROPPEDWIDTH, 100, 200); but the minimum value is taken from the combobox itself, regardless of what is specificed here. All these examples make it bigger. 回答1: Before the drop-down list is to be painted, a WM_CTLCOLORLISTBOX message is issued. By overriding the combobox WindowProc it is possible to shrink the drop down list

How to access the private method TStreamReader.FillBuffer in Delphi 10.1 Berlin? [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-11 08:17:35
问题 This question already has answers here : How to access private methods without helpers? (6 answers) Closed 3 years ago . How to access the private method TStreamReader.FillBuffer in Delphi 10.1 Berlin, we did it with a class helper before 10.1 - but the proposed solution does not work: uses System.Rtti; procedure TForm1.FormCreate(Sender: TObject); begin Assert(Assigned(TRttiContext.Create.GetType(TStreamReader).GetMethod('FillBuffer')), 'Failed'); end; it fails just because GetMethod returns

FMX on iOS: how to perform partial invalidation?

試著忘記壹切 提交于 2019-12-11 06:37:12
问题 When I invalidate one control on a form, then the Paint method is called for ALL controls on that form. This happens on iOS, while on Windows the local invalidation works and only the requested control is being painted. To verify this, I made a small test program with just two TPaintBox on a form and assigned these Click and Paint methods to them: procedure TForm1.PaintBox1Click(Sender: TObject); var lPaintBox: TPaintBox; begin lPaintBox := TPaintBox(Sender); lPaintBox.InvalidateRect

fmx delphi berlin how to change font color in rows of Tgrid

时光毁灭记忆、已成空白 提交于 2019-12-11 00:38:28
问题 NEED HELP..I am using delphi 10.1 berlin. There are some different with other previus version of Embarcadero Delphy Code Gear. I need to change font color in rows of TGrid. Whith this next code i will change backgrond color but i need to change only Font Color : aRowColor.Color := arSTATUS_GRID_COLOR[0]; Canvas.FillRect(Bounds, 0, 0, [], 1, aRowColor); Column.DefaultDrawCell(Canvas, Bounds, Row, Value, State); 回答1: Instead of calling Column.DefaultDrawCell() , you can use FMX.Graphics.TCanvas

Why won't controls span multiple columns or rows in an Android FireMonkey app?

谁说胖子不能爱 提交于 2019-12-11 00:16:31
问题 I have a FireMonkey app with a GridPanelLayout, aligned to client. It's got 6 columns and 16 rows. Controls include glyphs, edits, and buttons. The TEdits span multiple columns, and the TButtons span both multiple columns and rows. The controls are currently all aligned to client. When I compile and run on Windows everything looks and acts as expected. However, on Android devices (I tried two, Android 6.0.1, and Amazon FireOS) none of the controls span more than one column or row. They're

TParallel.For: Store values in a TList while they are calculated in a TParallel.For loop

谁说我不能喝 提交于 2019-12-10 20:12:32
问题 I want to use a TParallel.&For loop to calculate, for example, the prime numbers between 1 and 100000 and save all these prime numbers in AList: TList<Integer> : procedure TForm1.Button1Click(Sender: TObject); var i: Integer; AList: TList<Integer>; LoopResult: Tparallel.TLoopResult; begin AList:=TList<Integer>.Create; TParallel.&For(1, 100000, procedure(AIndex: Integer) begin if IsPrime(AIndex) then begin //add the prime number to AList end; end); //show the list for i := 0 to AList.Count-1

Delphi delete FireMonkey element from Form on Android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 21:53:28
问题 I created an element on my Form with this code in the OnShow event: procedure TForm4.FormShow(Sender: TObject); var VertScrollLink:TVertScrollBox; begin VertScrollLink := TVertScrollBox.Create(form4); VertScrollLink.Align := TAlignLayout.Client; VertScrollLink.Parent := form4; end; On some action, I need to delete the layout dynamically: for LIndex := form4.ComponentCount-1 downto 0 do begin if (form4.Components[LIndex].ToString='TVertScrollBox') then begin //showmessage(form4.Components

Colors of the TDialogService.MessageDialog

孤街浪徒 提交于 2019-12-08 12:50:42
问题 Can you explain how I can get used colors of the TDialogService.MessageDialog window? Update: Which created using this command: TDialogService.MessageDialog('Test3: Confirmation', MsgDlgType.mtConfirmation, [TMsgDlgBtn.mbOK], TMsgDlgBtn.mbOK, 0, procedure(const AResult: TModalResult) begin end); I need color of the bottom panel (Button parent) and background color of the message. I need this color to make my own dialog looks like FMX default dialog. Currently I have my own highly customizable