Delphi

Delphi/FMX: How to add a dynamically created top-aligned component under all previously added top-aligned components, instead of second from the top?

自闭症网瘾萝莉.ら 提交于 2021-02-05 06:37:29
问题 I am making an app for Android with Delphi and FMX. In the onclick-procedure of a button I dynamically create a TPanel (with some components in it) which I then add to a TVertScrollBox. I want the TPanels to stack on top of each other, so I set the Align property to Top. procedure TMainForm.AddGroupButtonClick(Sender: TObject); var Group : TPanel; begin Group := TPanel.Create(Self); Group.Parent := Groups; // where Groups is a TVertScrollBox on the form Group.Align := TAlignLayout.Top; //Then

Delphi/FMX: How to add a dynamically created top-aligned component under all previously added top-aligned components, instead of second from the top?

送分小仙女□ 提交于 2021-02-05 06:37:25
问题 I am making an app for Android with Delphi and FMX. In the onclick-procedure of a button I dynamically create a TPanel (with some components in it) which I then add to a TVertScrollBox. I want the TPanels to stack on top of each other, so I set the Align property to Top. procedure TMainForm.AddGroupButtonClick(Sender: TObject); var Group : TPanel; begin Group := TPanel.Create(Self); Group.Parent := Groups; // where Groups is a TVertScrollBox on the form Group.Align := TAlignLayout.Top; //Then

How to prevent MultiView opacity from affecting children components texts in Delphi?

半世苍凉 提交于 2021-02-05 06:22:25
问题 I'm using MultiView with some TButton buttons in Firemonkey. The multiView is opaque at 0.5 and this causes the buttons to also be opaque. QUESTION : Is there a way to prevent MultiView opacity from affecting the button texts? That is, the text of the buttons would continue with bright colors, but the "body" of the buttons would be opaque. I've seen some applications with this visual feature, but I do not know what components were used for that purpose ... 回答1: Instead of the TMultiView , use

Call Delphi CLASS exported in DLL from C++ code

可紊 提交于 2021-02-04 21:40:16
问题 i have a problem to use delphi class from C++ code. delphi dll demo that export a function that return an object. my delphi Dll code is as follow: library DelphiTest; // uses part.... type IMyObject = interface procedure DoThis( n: Integer ); function DoThat : PWideChar; end; TMyObject = class(TInterfacedObject,IMyObject) procedure DoThis( n: Integer ); function DoThat: PChar; end; // TMyObject implementation go here ... procedure TMyObject.DoThis( n: Integer ); begin showmessage('you are

Call Delphi CLASS exported in DLL from C++ code

。_饼干妹妹 提交于 2021-02-04 21:39:14
问题 i have a problem to use delphi class from C++ code. delphi dll demo that export a function that return an object. my delphi Dll code is as follow: library DelphiTest; // uses part.... type IMyObject = interface procedure DoThis( n: Integer ); function DoThat : PWideChar; end; TMyObject = class(TInterfacedObject,IMyObject) procedure DoThis( n: Integer ); function DoThat: PChar; end; // TMyObject implementation go here ... procedure TMyObject.DoThis( n: Integer ); begin showmessage('you are

Store Array of Record in JSON

喜你入骨 提交于 2021-02-04 20:57:48
问题 How can an array of record be stored in JSON via SuperObject library. For example.. type TData = record str: string; int: Integer; bool: Boolean; flt: Double; end; var DataArray: Array[0..100] of TData; 回答1: Just use the superobject Marshalling TSuperRTTIContext program Project1; {$APPTYPE CONSOLE} {$R *.res} uses superobject, System.SysUtils; type TData = record str : string; int : Integer; bool : Boolean; flt : Double; end; TDataArray = Array [0 .. 100] of TData; procedure Test; var

Highlight specific text in DBGrid

穿精又带淫゛_ 提交于 2021-02-04 19:25:09
问题 I'm performing a query and displaying returned data in dbgrid. I would like to highlight the items matching the search criteria. Something like: Search by : " test " In DBGrid, returned data would be . ID Return 1 This is a **test** 2 **Test**ing The goal here is no doubt about querying data. But how to highlight specific text in DBGrid? Important: only the specific part of the text should be highlighted. NOTE: The information presented is to make it clear, not corresponding exactly to

How do I interpret the columns of the CPU window's disassembly pane?

十年热恋 提交于 2021-02-04 16:19:41
问题 There is a tool called the CPU window, which I get pressing Ctrl + Alt + C , that shows the disassembly of my code. A green arrow to the left of the memory address indicates the location of the current execution point, then there is the memory addresses, but what does the second column mean, and why does the compiler sometimes jump more than one address after an instruction? For example: |first column|second column|assembly| 004520F4 55 push ebp //continuous 004520F5 8BEC mov ebp, esp //jumps

How do I interpret the columns of the CPU window's disassembly pane?

放肆的年华 提交于 2021-02-04 16:19:25
问题 There is a tool called the CPU window, which I get pressing Ctrl + Alt + C , that shows the disassembly of my code. A green arrow to the left of the memory address indicates the location of the current execution point, then there is the memory addresses, but what does the second column mean, and why does the compiler sometimes jump more than one address after an instruction? For example: |first column|second column|assembly| 004520F4 55 push ebp //continuous 004520F5 8BEC mov ebp, esp //jumps

How can my form detect KeyDown events when another control has the focus?

与世无争的帅哥 提交于 2021-02-04 15:43:08
问题 procedure TMainForm.KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (GetKeyState(Ord('Q'))<0) and (GetKeyState(Ord('W'))<0) and (GetKeyState(Ord('E'))<0) then ShowMessage('You pressed it'); end; the above event only work if the Focus set to the Main Form. if i run the application and keep pressing Tab and changing the Focus to any control on the Form it will disable this event until we change the Focus again to the main form ? the Question is how i can detect the three