

Rollo62
Members-
Content Count
1909 -
Joined
-
Last visited
-
Days Won
23
Everything posted by Rollo62
-
Is this a possible QC entry, as DocWiki is part of IDE help file ?
-
I really hate this type of paranoia constructions. What do you think about?
Rollo62 replied to Juan C.Cilleruelo's topic in Algorithms, Data Structures and Class Design
Goto: Where no man has gone before -
Is this method good to delete last character?
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Maybe this is helpful, http://docwiki.embarcadero.com/Libraries/XE7/en/System.SysUtils.TStringHelper.TrimEnd -
There had been Rumors around that new MacMinis wouldnt be IntelBased, but Arm64. Havent checked that recently, but if so it might cause issues with FMX in General. I would check compatibility before if I consider Mac Mini.
-
I had issues with Bluetooth LE on MacBook and iMac at High Sierra, so I downgraded to Sierra do get BLE connection again. It was definitifely not a hardware issue, and also not an RadStudio issue, but I'm not sure either what went wrong. There were problems even with the Apple mouse to get connected after the update. I have read about many different issues with High Sierra at that time in Apple forums (and now probably solved by Mojave), but I'm always a little reluctant with upgrading a running system too fast. Edit: Not sure how long I could postpone upgrade still (March 2019), but after upgrade I would need 100% Bluetooth support too, otherwise I will get into some big trouble. Not sure if any changes have been in the CoreBluetooth from Sierra, to High Sierre, to Mojave. I'm afraid I have to do some more compatibility tests soon.
-
Here is a lot of stuff included, from Luxophia, you know that ? Not sure about bumpmaps, but its worth to have a look.
-
How to type json properties that are arrays with mixed element types?
Rollo62 replied to Lars Fosdal's topic in Network, Cloud and Web
I've made some tests a while ago, and put them into an empty, commented region (for later unbury, if I need them). Maybe it helps somehow. class function TJson_Marshal_Base<T>.Internal_FromObject(AValue: TJSONObject ) : TJson_Marshal_Base<T>; var LMar: TJSONUnMarshal; begin Result := nil; if not Assigned( AValue ) then Exit; LMar := TJSONUnMarshal.Create(); // This sets DateTimeIsUTC internally by default try LMar.DateTimeIsUTC := True; // !! Important to ensure same Coding/Decoding {$REGION 'OptionalReverter'} // LMar.RegisterReverter(TToolPanel_Parcel, //TODO remove, since it never gets here // function (Data: TListOfStrings) : TObject // var // LObj : TToolPanel_Parcel; // begin // // if Length(Data) >= 9 then // begin // LObj := TToolPanel_Parcel.Create; // // LObj.FValueType := StrToIntDef(Data[0], -1); // LObj.FValueNum := Data[1]; // LObj.FValueUnit := Data[2]; // LObj.FTimestamp := StrToDateDef( Data[3], 0); // LObj.FTimestampColor := StrToIntDef( Data[4], Integer( TAlphaColorRec.Red )); // LObj.FLine1 := Data[5]; // LObj.FLine2 := Data[6]; // // LObj.FCoord.FromString_Location( Data[7] ); // // LObj.FGeoCode := Data[8]; // // if Length(Data) >= 10 then // LObj.FMultiLine := Data[9] // else // LObj.FMultiLine := ''; // // Result := LObj; // end // else // begin // Result := nil; // end; // // end // // ); {$ENDREGION} //UnMarshal will attempt to create a TTestObject from the TJSONObject data //using RTTI lookup - for that to function, the type MUST be defined in a unit Result := TJson_Marshal_Base<T>.Create; //( AData ); Result := LMar.CreateObject(TJson_Marshal_Base<T>, AValue, Result ) as TJson_Marshal_Base<T>; finally LMar.Free; end; end; -
How to type json properties that are arrays with mixed element types?
Rollo62 replied to Lars Fosdal's topic in Network, Cloud and Web
If so many people urgently (mis)use it that way, this should be a sign that there is a strong need 🙂 -
Hi folks, I'm trying to use TWebBrowser (embedded in the app) to show a special page in my mobile apps. These page is able to download images and other stuff from that page. When I use normal web browser such documents land in the downloads folder. Of coarse mobile apps life in a sandbox, and it seems that downloads don't land in public downloads folder. iOS seems to open the image in a separate page, which Android seems to do nothing. From the behaviour so far I can say that the embedded browsers behaves different than the default browser of the system. My questions are howto handle downloads via embedded TWebBrowser in Android and iOS ? Are downloads blocked completely on mobile ? Are downloads stored somewhere in the sandbox ? Can I configure somewhat in TWebBrowser (below surface), to finetune behaviour and where documents will land ? Can I hook into the click/ajax events of the TWebBrowser page (if I have no control over the page itself) ? Maybe a concept of control would be to use a local HTML5 wrapper page with frames around the target site, so to be able to get control about the inner events of the target site ? I would prefer to use the internal TWebBrowser, if possible, but also 3rd party solutions would be welcome Hope somebody of the mobile experts have found more insights and a good solution already. I cannot change the HTML5 page, by the way, to add something like a JS-bridge to Delphi directly, so I hope to find some hooks and tweaks around. Rollo
-
[Fmx,iOS,Android] TWebBrowser howto handle downloads
Rollo62 replied to Rollo62's topic in Cross-platform
Thanks, I still checking some stuff to get around this at all, with Indy and THttpClient, so far I prefer the new THttpClient. This may work for 90% of the needs, but may fail to work with a life-video stream via Ajax events, thats why I try to use TWebBrowser in the first place., since this will work in the native environment with full performance. But thats another story. I will check such JS "injections" on Android first, then iOS later, but indeed I had hope to find a general solution to all platforms. This seems to be a lot of handcafted work, each on Delphi as well as on HTML side. Maybe there is the simple possibility to send events somehow, like TMessage to be received via TMessageManager) from JS to Delphi ? -
Units design
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Maybe Uwe's MMX-Explorer might be a helpful tool clearing your units up. (be aware, I'm not sure if its already 100% Rio-ready yet, better check before) -
[Fmx,iOS,Android] TWebBrowser howto handle downloads
Rollo62 replied to Rollo62's topic in Cross-platform
Dear Eli, thank you very much for sharing and finding such nice solution. I will check later, but that looks good, seems be able to inject something into the browser. -
So you're looking for a pointer as alias 🙂 Maybe this will be the next language extension
-
Maybe be toggling the Visible flag for all entries from below the "Clicked" Header item to next Header item ? Certainly not nice, I know, but I think there is no grouping function included in FMX.ListView AFAIK. Not sure howto force Headers to fire events.
-
Do you mean like that ? https://community.embarcadero.com/blogs/entry/adding-headers-to-tlistview-programmatically This is done via TListItemPurpose.
-
Can you resolve this by building an empty test-app with XCode ? Usually XCode fixes (or at least warns) all issues, like missing/wrong provisionging files. After empty XCode app is running, you could try another empty app via Fmx.
-
As far as i understood EMBT, the IdeFixPack should be partly Integrated. Is there still tve need for the rest ?
-
Did you define a connection profile ?
-
Conditional compilation for various Delphi versions
Rollo62 replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I personally use ifdef as modularization option of common behaviours, for different customers or versions, e.g. in a common configuration file (*.inc normally). What I mean here is for example the support of special custom hardware modules (e.g. for connection to special hardware which is supported). To make the whole process more readable, I personally use a special signature for my ifdefs very often, which makes the whole status and situation very readable and clear for the status of switching ON and OFF., {$DEFINE _X_USE_MODULE_A} {$DEFINE _X_USE_MODULE_B} {$DEFINE ___USE_MODULE_C} {$DEFINE _X_USE_MODULE_D} {$DEFINE ___USE_MODULE_E} ... {$IFDEF _X_USE_MODULE_A} ... {$ENDIF _X_USE_MODULE_A} I know that mostly the notation of {.DEFINE Module_A} is used for switching off conditionals, but I very much dislike this for poor readability, especialy if you have switches for many similar options, like in above sample. This is just a possible, different way to to defines (which I have never seen anywhere else before, but this I don't care). Maybe somebody likes such "talking" defines too. -
Unable to deploy after unchecking 'include splash image'
Rollo62 replied to Yaron's topic in Delphi IDE and APIs
I've installed Rio right now, and testing ... So I had some time to check for your issue, not sure if this is what you want to achieve. When I use this settings And disable these files in the deployment manager My project APK results in missing those splash images under /res Still possible to compile, debug and launch with RadStudio -
Android 8.0 Permissions errors using Delphi Rio 10.3
Rollo62 replied to Jose Morango's topic in Cross-platform
I think it should be good practice to request permission short before desired access, Not to request this generally in FormCreate or FormShow. If you do so rhe request will popup directly after app launched, maybe not even fully prepared, and users (like me) will see this quite suspicious. -
I used something like this for testing purposes // Adds a new Bitmapitem to the ImageList acc. to InsertPos // iInsertPos = -1 = Append; iInsertPos = Insert(iPos, ... insert before // ASrcRect defines the CropRect of the SourceBmp, which is used in Destination // Return the just added ImgList ID function ImgList_Bitmap_Add( iInsertPos : Integer; const ADestImgList : TImageList; const ADestRect : TRectF; const ASrcBmp : TBitmap ) : Integer; var isi: TSourceItem; idi: TDestinationItem; lay: TLayer; sSrcName: string; bmi: TBitmapItem; ms: TMemoryStream; begin Result := -1; if not Assigned(ADestImgList) or not Assigned(ASrcBmp) then Exit; if (ASrcBmp.Width = 0) or (ASrcBmp.Height = 0) then Exit; try // Create new Source entry if iInsertPos < 0 then isi := ADestImgList.Source.Add as TSourceItem // Append else isi := ADestImgList.Source.Insert(iInsertPos) as TSourceItem; // Insert before if not Assigned(isi) then begin Exit; // Somethings wrong end; // Create MultiResBitmap w/ LAyer if isi.MultiResBitmap.Count = 0 then begin bmi := isi.MultiResBitmap.Add as TBitmapItem; if not Assigned(bmi) then begin Exit; // Somethings wrong end; // Add the Bitmap via Stream, to allow Format settings ms := TMemoryStream.Create; // Copy Bmp via Stream, so that PNG-Format is possible try ASrcBmp.SaveToStream( ms ); ms.Position := 0; bmi.Bitmap.CreateFromStream( ms ); finally ms.Free; end; end; // Get the unique SourceItem Name sSrcName := isi.Name; // Create new Destination entry if iInsertPos < 0 then idi := ADestImgList.Destination.Add as TDestinationItem // Append else idi := ADestImgList.Destination.Insert(iInsertPos) as TDestinationItem; // Insert before if not Assigned(idi) then begin Exit; // Somethings wrong end; // Add new Dest Layer, for output lay := idi.Layers.Add; if Assigned(lay) and (sSrcName <> '') then begin // Link the Layer with the Source, so that Output Bitmap is linked lay.Name := sSrcName; // Setup the link the the Source Bitmap here lay.SourceRect.Rect := ADestRect; // Region which crops within the soure-Rect // Finally new Bitmap is in list, return the destination ID Result := idi.Index; end; finally end; end;
-
Unable to deploy after unchecking 'include splash image'
Rollo62 replied to Yaron's topic in Delphi IDE and APIs
Not sure if that is a good idea. https://cyrilmottier.com/2013/01/23/android-app-launching-made-gorgeous/ Maybe simplest way is to provide a black PNG image. -
+1 But on desktop there is the title line at the bottom too (not sure on mobile), but still scroling is necessary.
-
Thanks for the great tool, I will check a little later. Good decision in general, to make projects futureproof, instead of trying to re-invent the past 👍