delphi-10.2-tokyo

Delphi cxtreelist looping through nodes

心已入冬 提交于 2019-12-11 04:52:05
问题 I have a tcxTreeList with 3 columns the first column has set property of Node.CheckGroupType := ncgCheckGroup; , and 2nd column contains Key of the First root node and third column contains the keys of all child nodes under the root node. How can i get the key of root node whether it is checked or not and keys of all checked child nodes into 2 variables to insert into db and Load back items from keys we get from DB My code for adding items is as below APNode := tv.Add; APNode.CheckGroupType :

Frame on main form with FormStyle = fsMDIForm

…衆ロ難τιáo~ 提交于 2019-12-11 04:42:40
问题 Is there a way to show MDI child forms ( FormStyle = fsMDIChild ) on the main form that has a frame with Align = alClient ? Creating a frame on the main form: Frame := TfrCalendar.Create(Self); Frame.Parent := Self; Creating MDI child form on the main form: if Assigned(FMDIRef) then FMDIRef.BringToFront else begin FMDIRef := TFReference.Create(Application); FMDIRef.Show; end; After this, the child form is not visible. If you do not create a frame, the form is visible. If you first show the

Can't use default parametr values with comparer in Spring4D

一曲冷凌霜 提交于 2019-12-11 04:06:29
问题 I'm not sure if this is some generic problem or it's because of Spring4D implementation, but I can't use default parameter values for creating comparer. type TMyClass = class class function MyComparer(AParam: Boolean = False): IComparer<TMyClass>; end; implementation class function TMyClass.MyComparer(AParam: Boolean): IComparer<TMyClass>; begin Result := TComparer<TMyClass>.Construct( function (const L, R: TMyClass): Integer begin Result := 0; end); end; When I create a list without the

Setting up a second TFDPhysFBDriverLink - possible and necessary?

感情迁移 提交于 2019-12-11 02:36:27
问题 My application has a design time TFDConnection and TFDPhysFBDriverLink as source connection. This may or may not be opened in Firebird embedded mode (if so, FDPhysFBDriverLink.VendorLib := 'fbembed.dll' is set (32 bits)). I create a run-time target TFDConnection which must use embedded Firebird because we do not know if Firebird is installed on the PC (our setup supplies fbembed.dll ). How do I set this up? At runtime I can create another TFDPhysFBDriverLink and set its VendorLib, but how

Has function initialization code changed from Seattle to Tokyo?

﹥>﹥吖頭↗ 提交于 2019-12-10 15:31:37
问题 I am in the process of upgrading code from Delphi 10 Seattle to Delphi 10.2 Tokyo and get a lot of H2077 hints Value assigned to ... never used on assignments. (Even in places where these were explicitly added in the past to get rid of 'may not have a value' warnings). These are all function initialized like: Result := 0; ... Or: Result := ftType1; // where ftType1 is an enumerated type ... Did the compiler get smarter in detecting these or has something changed regarding the initial return

Delphi compiler difference between IntToStr() and Integer.ToString()?

穿精又带淫゛_ 提交于 2019-12-10 14:19:19
问题 What is the basic difference between IntToStr() and Integer.ToString() when converting an Integer to a string . Which one is faster? var VarInt: integer; VarStr: string; begin VarInt := 5; VarStr := IntToStr(VarInt); VarStr := VarInt.ToString; end; 回答1: Disclaimer : The following text contains details that only apply to Delphi 10.2.1 (and also 10.2.2) which seems to have made something worse about inlining and RVO: The code produced by the compiler indeed differs (regardless the compiler

Custom drawing of TCustomListbox items

若如初见. 提交于 2019-12-08 19:51:38
问题 I'm rewriting a VCL component showing a customized TCustomListbox to Firemonkey in Delphi 10.2. The customization used an overridden DrawItem , basically adding some indentation and setting the text color depending on the item text and index. DrawItem made it rather easy, but there seem to be nothing like that in FMX. I can override PaintChildren and draw every item myself, but then it looks differently and I have to deal with scrolling and everything myself. I'm just starting with FMX and

Firemonkey android read_phone_state runtime permission asks to get IMEI

吃可爱长大的小学妹 提交于 2019-12-06 22:08:30
问题 How can I get read_phone_state permission at runtime to get IMEI number? if not HasPermission('android.permission.READ_PHONE_STATE') then begin //ASK AND GET PERMISSION ? end; function TForm1.HasPermission(const Permission: string): Boolean; begin //Permissions listed at http://d.android.com/reference/android/Manifest.permission.html {$IF RTLVersion >= 30} Result := TAndroidHelper.Context.checkCallingOrSelfPermission( {$ELSE} Result := SharedActivityContext.checkCallingOrSelfPermission( {

Delphi FireMonkey - Setting Wallpaper on Win 10 does not work when deployed as APPX

冷暖自知 提交于 2019-12-06 13:12:54
I have created a simple application using Delphi 10.2 Tokyo (using FireMonkey) that displays images and allows you to set the desktop wallpaper for a selected image. The main code that sets the desktop wallpaper is: class procedure TUtilityWin.SetWallpaper(AFileName: String); begin SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, pChar(AFileName), (SPIF_UPDATEINIFILE OR SPIF_SENDWININICHANGE)); end; While this works great when the application runs on the desktop (as a standalone install), it fails when run as an APPX (during the certification process) of submitting to the Windows 10 App Store.

Delphi Android app API level 26?

霸气de小男生 提交于 2019-12-04 07:22:42
I got my app into Google Play's app store but I also got this warning: Your app currently targets API level 14 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance. From August 2018, new apps must target at least Android 8.0 (API level 26). From November 2018, app updates must target Android 8.0 (API level 26). How do I get Delphi 10.2.3 to "target API level 26"? Marlon Nardi See https://community.embarcadero.com/blogs/entry/deadline-approaching-google-s-new-android-api-level-26-requirements . Option 1: Get the 10.3 Beta Release