Embarcadero: Firemonkey OOP
Embarcadero: Firemonkey C++
I implement simple painting application in Delphi FMX for Windows pc with touch screen. I am looking for a function which is invoked directly after the first touch on the screen and similar function invoked after finishing the touch. Very close to MouseDown and MouseUp and using TControl.Pressed. I tried to use mouse functions but unfortunately, many windows touch screens do not send this event after touching the screen (some of them do). I also tried Tap function but it is called only if you do not drag a finger over the screen. Finally, I wanted to use TGestureManager but it seems to focus on just Gestures like zoom, rotate, etc. Is there any other option to achieve my goal?Read More
This question already has an answer here: Best way to check if a Variable is nil? 2 answers When i read the modifications made in the original delphi source code (mostly in the firemonkey) I saw that embarcadero sometime replace if assigned(MyObj) then by if (MyObj <> nil) then. Is their any real reason to do this or it's simply purely cosmetic ?Read More
Is it possible to have a cursor that show a “hand” (like the picture below) under windows and MacOS? If yes how to do ?
I am using a descendant of TEdit and using TagObject to store an object. I'm using Firemonkey. In short, I am working with another object and want to assign a property of that object to my TMyEdit, so that whenever I load the object, the text gets updated, and when I change the text, the object gets updated. So I do it like this: Edit1 : TMyEdit; MyElement:TMyProperty; ... Edit1.TagObject:=TMyTextProperty(MyElement); (The typecast is necessary for other reasons. I mention it just in case it is related). The code works when MyElement is not nil to start with. If MyElement was nil, MyEdit automatically creates a new instance of TMyTextProperty and assigns it to tagObject. procedure TMyEdit.MyOnChange(Sender : TObject); begin if tagObject=nil then TagObject:=TMyTextProperty.Create(''); TMyTextProperty(TagObject).value:=text; end; I assume that since tagObject is a pointer and i pointed it to MyElement, then myElement would also be updated. But it isn't. Edit1.TagObject contains my value, but MyElement is stil nil. I need MyElement to be the newly created object. What am I doing wrong? How can I make sure that whenever the TagObject gets created, the MyElement points to the new object? Many thanksRead More
I added resource file in Project -> Resources and images. When I run app on Windows, resource is found, but not found when i run on Android device. TResourceStream * rs = new TResourceStream(HInstance, "String_ressource", RT_RCDATA); Why that ?Read More
Open: Performance of HTTP POSTS from Firemonkey Android app has suddenly collapsed when on mobile data
A Delphi 10.2.3 Firemonkey app on Android I've had this app running and in use for about 6 months, and it's been fine. I recompiled the code after Windows Spring Update (I don't know if this is related), and the performance of HTTP POSTS has dramatically slowed e.g. a 49 byte response (to a simple request) is taking over 10 seconds whereas on wifi it's about 0.1 seconds. It's not the server side, in the sense that the connection is very brief, as one would expect. To do the connection, I'm using idHTTP, which has always worked fine. No code changed, I've tried a number of different networks, good signal and bad (it makes no real difference). Checked all the usual things, connections closing, things are freed as they should be, etc. Any ideas? Is there some parameter I should look at? (Edit) * Just to add, any test app that only does this sort of connection has the same problem. 0.1 seconds on wifi, 16 seconds in mobile data. * I realised I hadn't checked a GET - they work fine, nice 0.1 sec response to the same request, but run as a get. So it looks like there's something weird about the POST. (Edit) Completed a fresh Windows & Delphi install, and tested using a small android app that with 2 buttons, Get & Post, calling web services that simply return the parameters. No change. POST takes 10-ish seconds, GET takes about 0.1. Any ideas would be very helpful.Read More
I'm running Delphi Tokyo and I'm looking for a way to play audio on Windows and Android (and maybe at some point iOS). On Windows I can do with something like PlaySound(PChar(ResourceName), 0, SND_RESOURCE or SND_ASYNC), but I'm stuck on Android. I've tried TMediaPlayer, but it takes about a second before it starts playing, which is too long for a mouse click or screen tap. Basically I've built a Minesweeper clone and I'm looking for sound support (if you want to know the background). Suggestions?Read More
Help me for my question. I cant understand why my component dont show on form.
That is what i have on my form:
I use TGrid, but I cant understanf why he dont rendering when I compiling my programm.
Starting at iOS 11 Apple now has a means of letting us identify devices that have used something up (e.g. a trial period etc.) without identifying any personally identifying information: https://developer.apple.com/documentation/devicecheck The above link describes these DeviceCheck APIs. How can we do this in an FMX app? Will also need for Android eventually too. My intent is to let users vote from the app - but only vote once. thanks, russRead More
I've built an app that can download SQLite data via http it C++ Builder. I want to now allow users to give feedback that will get pushed into a remote database without traversing internet unencrypted. The database can be a MySQL that can live on a Synology NAS (although I don't mind using any other approach that might be easier - even pay if not too expensive) at a static IP address on the internet. Very low data payload required. I want to do this in C++ in Rad Studio in a Firemonkey app. I'm a novice (my day job is engineer) and this is just for my enjoyment. How can I make a secure connection from my FMX app (iOS and/or Android) to the remote database using the FireDAC components or Indy. My head is swimming from all the information out there that is above my head. thanks, russRead More
Open: C++ Builder Tokyo 10.2.3 FMX Android application crash if I dont click on Next button on virtual keyboard
I use C++ Builder Tokyo 10.2.3 and trying to do something very simple on Android like typing some text into an Edit box. If I press Next or Done key on virtual keyboard everything is fine. If I press an Exit Button to go back the previous form it looks it is fine but then if I press Android Back button application crash. It took me hours to identify the problem but couldn't find any solution but trying to disable all other objects when user clicks in an Edit box and enable them if user click on Next.. It seems to me a bug but need to make sure before report it to Embarcadero. ThanksRead More
It's probably easy question, bu I can't find an answer. I want to change background color of TEdit component when I click on it (on Focus), and the background should back to previous color when I click somewhere else. P.S. I use a Firemonkey and it's multiplatform app, so I need to use a style.Read More
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 don't have the sources yet. Is there a DrawItem replacement in FMX? I may have missed it. If not, how do it get the needed information? Basically, the rectangle to draw in and ideally the style used. Problems The solution by Hans works, but has some major problems: Color Setting the color doesn't work, the text is always black. I tried various possibilities including this one: PROCEDURE TMyItem.Paint; BEGIN TextSettings.FontColor := TAlphaColorRec.Red; INHERITED; END; Speed Opening a box with 180 Items takes maybe two seconds. We need that many items and their count is actually the reason why we need a customized box (we provide filtering using the TEdit part of our component). A version using strings without TMyItem was faster (though probably slower than the VCL version), but using these items seems to slow it down even more (it's slower than filling an HTML list styled similarly). Or something else? Having no sources and practically no documentation I can't tell. I tried to cache the items for reuse, but this didn't help. It looks like using custom items is actually faster than using strings, (timing in milliseconds): nItems String TMyItem 200 672 12 2000 5604 267 20000 97322 18700 The speed problem seems to accumulate when the content changes multiple times. I was using FListBox.Items.Clear;, then I tried n := FListBox.Items.Count; FOR i := 0 TO n-1 DO FListBox.ListItems[n-1-i].Free; and finally FListBox.Clear;, which makes most sense (and which I found last). Still, in the end it seems to need 2 ms per item.Read More
In Delphi 7, controls (e.g. TImage) that had their Visible flag set to False would still be visible on the form designer. In recent versions of Delphi (Delphi 10.2), setting an FMX control's Visible flag to False hides the control during design time, making it harder to find on the form. I searched through Delphi's option and the web and couldn't find a way to restore the D7 behavior, is there a solution to this?Read More
how can i design my ui like the provided image
this is full screen and have status bar.
when i put full screen as true it hide the status bar
i also put status bar visibility as visibale or VisibleAndOverlap and select … … Read More