firemonkey

C++ Builder: Refresh FireMonkey Visual Component

我怕爱的太早我们不能终老 提交于 2019-12-11 07:32:57
问题 I have a problem with C++ Builder and FireMonkey. I am creating a mobile application connected with a Datasnap Rest WebService. Some requests are a little bit long so I want to display a waiting message. Here is my code: lbl_testConnexion->Text = "Please Wait..."; lbl_testConnexion->TextSettings->FontColor = TAlphaColorRec::Red; this->Invalidate(); //Call to the Web Service list<Colis>* l = WS->getListeColis("00DP0097"); lbl_testConnexion->Text = "Success!"; I tried functions Form->Invalidate

How to draw FMX.Surface.TBitmapSurface on FMX.Graphics.TBitmap

对着背影说爱祢 提交于 2019-12-11 07:29:00
问题 Follwing on: How to load large bitmap in FMX (fire monkey) I have come to a need to draw whats on TBitmapSurface on the FMX.Graphics.TBitmap , i have found a lot of answer regarding this on the web, but they are either in VLC instead of FMX or their goal is saving and loading instead of drawing on a TBitmap , which is why i asked a new question here. Now here is my current code for loading my image on the TBitmapSurface : var bitmapSurf: TBitmapSurface; path: string; begin path := 'image.jpg'

How to know the available disk space on android/ios?

只愿长相守 提交于 2019-12-11 07:27:00
问题 before to save a file to the cache directory i want to know how much space are available on the device (especially the space available where the cache directory is located). How to do this on android and ios ? i m on delphi berlin. 回答1: ok, here is the solution for all plateform (taken from https://github.com/Zeus64/alcinoe) : {$IFDEF ANDROID} aStatFS := TJStatFs.JavaClass.init(StringToJstring(aDir)); if (TJBuild_VERSION.JavaClass.SDK_INT < 18 {Android 4.3 - JELLY_BEAN_MR2}) then

How to intercept Menu shortcut event in Firemonkey

人盡茶涼 提交于 2019-12-11 07:24:53
问题 On a Firemonkey Form add a main menu and a single submenu item. Set the shortcut property for the submenu to Ctrl-A. Is there anyway to intercept the Ctrl-A before it gets to the menu? It seems that the form OnKeyDown doesn't see it. 回答1: The form checks if there are child components that want to handle the key. If the key is handled then that is the end of the story. Here's a quick&dirty way that prevents the TMenuItem from handling the key, using an interposer. type TMenuItem = class(FMX

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

Image canvas drawing ends up on form instead

二次信任 提交于 2019-12-11 05:28:21
问题 I'm trying to draw some custom shapes on the canvas of a TImage, but the output ends up on the TImage parent form's canvas instead. It appears I have to convert my points from local to absolute to make this work, but that causes problems too. See example: Does anyone know why Image.Canvas.DrawArc (etc) draws relative to the parent form instead of relative to the Image? If I go through the trouble of .LocalToAbsolute... why does the arc look so different? The project is simple: Firemonkey HD

Low quality delphi user interface design under Android when using TImage

你。 提交于 2019-12-11 05:23:28
问题 Since Android phones are released in many different screen resolutions and my user interface is "skinned" using multiple TImage components, I've hit a major development issue, I must scale each of my images relative to the device's screen resolution. For some reason which I can not understand, under Android, TImage is interpolated using a really low quality scaler (possibly nearest-neighbor), resulting in a very low quality image display (this happens even when the screen scale is taken into

How to properly restore an FMX form?

自古美人都是妖i 提交于 2019-12-11 03:57:23
问题 Minimizing an FMX form with the menu bar button and then restoring by clicking on the task bar icon will bring the form back to the foreground, but will not activate the window. The form is also minimized "directly" rather applying the animation that "shrinks" the window to the taskbar. The forms OnActivate event is not fired. Curiously, if I patch the WindowProc and call ShowWindow with SW_RESTORE upon deactivation the form will get restored properly after clicking the taskbar icon. I'm not

Add icons to the tabs of a Firemonkey TTabControl

≯℡__Kan透↙ 提交于 2019-12-11 03:45:19
问题 To add an icon to a TButton in Firemonkey one can add a TImage to the button. But how to add an icon to a tab of a TTabControl? Is this possible? 回答1: At the very least you'll need to modify the style (to add the image) and probably create a custom control descended from TTabControl to set the image data. 来源: https://stackoverflow.com/questions/15550494/add-icons-to-the-tabs-of-a-firemonkey-ttabcontrol

Loading style from resource on Mac OS X

纵饮孤独 提交于 2019-12-11 02:49:32
问题 Using Firemonkey (FMX) in C++ Builder XE6, I am attempting to load a style in my project's cpp file. Just before Application->Initialize () I have Fmx::Types::TFmxObject *style; style = TStyleStreaming::LoadFromResource((unsigned int)HInstance, L"MacJet", RT_RCDATA); TStyleManager::SetStyle (style); where the style named MacJet has been loaded as a resource into the project at design time. When I activate Win32 as the target platform, this runs fine, and the style shows properly in the