Jump to content

XylemFlow

Members
  • Content Count

    75
  • Joined

  • Last visited

Everything posted by XylemFlow

  1. XylemFlow

    Windows App hosting options?

    Thanks, but I've used this funding model for some time and it's already proved to be easily profitable enough and I've had no complaints about the ads. The whole internet seems to be based on advertising so I think people are used to it. On the other hand, very few people are willing to pay for software in my experience. I've found that a lot more income can be made from free software with advertising compared to the same paid software without advertising, simply because it is much more likely to become popular. Of course it depends on the type of software and the target users
  2. I use .ini for language files. This makes it easy for users to create their own language files. Is there any specific advantage of the .lng format over .ini?
  3. XylemFlow

    Creating Gradient by code

    What platform are you running it on and which implementation of TCanvas? There are many issues with GPU canvas. Have you read this? https://stackoverflow.com/questions/53561919/fmx-multi-point-gradients
  4. XylemFlow

    Draw a path with winding fill mode?

    TCanvas doesn't appear to provide a way to switch between 'alternate' and 'winding' fill modes. The default is alternate. This is important when paths intersect themselves and prevents me rendering certain objects how I would like. I created a new feature request for this on the quality page a while ago. It got the following comment. I'd like to try to do that as my application is currently Windows only. However, how do I actually go about calling implementation specific functions like Path.SetFillMode(D2D1_FILL_MODE_WINDING) in my code? I know how to find out the current implementation of a TCanvas with ACanvas.ClassName.
  5. XylemFlow

    Draw a path with winding fill mode?

    I made some progress on this by copying FMX.Canvas.D2D.pas locally and adding Path.SetFillMode(D2D1_FILL_MODE_WINDING); in TCanvasD2D.CreatePathGeometry just after Geometry.Open(Path). It works but modifying Delphi code is a horrible solution and to be able to switch fill mode at run time I would also need to add a property for it in TCanvas in FMX.Graphics.pas. Then I would need to modify FMX.Canvas.GDI.pas and FMX.Canvas.GPU.pas to make the same change. It's not a huge amount of work though. The interface for fill mode is already there. I wonder why they didn't implement such a basic feature?
  6. XylemFlow

    Newbee: FMX: Can't find DirectoryListBox or FileListBox

    TListBox is there in FMX. I'm not sure why you think it's not. Regarding rotating images. You may know this already but the best way to do it is by setting the Matrix property of the TCanvas you're drawing to. Use TMatrix.CreateRotation to create the matrix from a rotation angle. The advantage of this method is that the GPU takes care of all the transformations. It's also easy to combine with other transformations such as scaling or translation. TBitmap.Rotate is essentially doing that for you, but gives you less control.
  7. XylemFlow

    is there a complete guide to converting VCL to FMX?

    I have done this myself. I don't know of a guide to doing it. I'd just recommend to familiarise yourself with FMX first. You will have to rebuild your forms from scratch. You can then copy and paste most of the code and link the events, but some changes will be needed. The drawing commands are different and you need to get used to wrapping drawing commands with BeginScene and EndScene. Code using strings may need to be modified because of unicode. Finally, some visual components are just different and have differently named properties (the most common is that you will have to change .Caption to .Text). Other than that it's not too bad and you get quicker once you get into it.
  8. XylemFlow

    Converting simple VCL form to FMX

    When I ported my application from VCL to FMX I remade each form by hand. There are 17 forms so it took a while, but this was not the most time consuming part of the porting process by far. The RAD interface makes it quick and easy.
  9. XylemFlow

    Can you mix VCL and FMX?

    Yes you can, but of course it will only compile under Windows. I have used several VCL features in my FMX application. I just place them inside {$IFDEF MSWINDOWS} so they don't compile under other platforms.
  10. I'm looking for a component or code sample that allows a user to select a font family. An example is shown attached, which is taken from Inkscape. I already have code to collect a list of the installed fonts from Windows. The selector should show the list of fonts as well as a sample using the actual font. It should also have a search functionality that allows you to type in and it will filter the list based on the input. I would have thought that something similar would be included. I've already made some progress with making my own using a TListBox with custom styles, but thought I would ask in case something is already available online?
  11. XylemFlow

    Font Family selector component needed for FMX

    I've solved some of the issues with the font selector. The cursor now changes correctly. I'm quite happy with it now. The locking issue still happens but I discovered that this was not due to the number of fonts in the list but a particular font that is slow to render that I have installed (Surfing Capital). If I remove that font from the list then all is fine. I found that this font is also causing issues with the font selectors in other apps such as MS Paint, so it may not be worth doing anything about. FontSelector_v2.zip
  12. XylemFlow

    Font Family selector component needed for FMX

    I've made some progress on this, which you can see in the attached demo. I've made my own font selector which automatically collects installed fonts from Windows, has autocomplete when typing and shows each font in its own font for preview. However, there are a couple of issues that I could use some help with. There's quite a lot of lag sometimes when scrolling through the list using the scrollbar. It will often lock up and take several seconds to recover, during which time the CPU is fully occupied with something. I do have 528 fonts in the list, which is likely part of the issue, but similar font selectors in other apps, such as Inkscape don't have a similar issue. If I comment out the code for setting the font family of the list items (lines 109-111 of FontSelector.pas), then there's no such issue. I'd like the cursor to show crDefault when over the dropdown button instead of the text bar. I think this is due to the parent of the TButton being the TEdit. Any suggestions for solving these issues or other general improvements are welcome. FontSelector.zip
  13. A small proportion of users are reporting an Access Violation error during startup of my FMX Windows application. I've not been able to replicate it myself, but I have determined a number of things by sending variations to the users. Here are the facts. The vast majority of users do not have the issue All users with the issue have what looks like a normal Windows 10 setup The error occurs after the forms have been created but before the OnCreate events for each form start to get called. Perhaps somewhere early in Application.Run. The error does not occur with earlier version of my app built in Delphi 10.4. The error does not occur when I build the latest version of my app in Delphi 10.4. The error does not occur when run using Windows XP compatibility mode. This is strange since I didn't think FMX apps could run at all in Windows XP. I'm using one 3rd party component (FFVCL) but another app using that component and built in Delphi 11 does not cause the error. Does anyone know of a Delphi 11.0 issue that could be causing this? Would it help for me to upgrade to 11.2? If not, can anyone suggest ideas for further investigation? Why would some apps work when built in the same version and this one doesn't? Why would it work in Windows XP compatibility mode?
  14. This issue is now solved thanks to the support team at Embarcadero. The issue was happening for users who had an old version of Windows 10. The users who reported the error had not installed any Windows 10 updates in years! New DPI code added in Delphi 11 related to menu items was calling a Windows 10 function that did not exist in early versions of Windows 10 and so was causing the error. The fix was to modify line 297 of FMX.Helpers.Win.pas to the following. if (TOSVersion.Major >= 10) and (TOSVersion.Build >= 14393) then The issue has been reported so that it can be fixed permanently in future updates. Thanks for everyone's help. The extra debug info from the callstack made the difference.
  15. XylemFlow

    How can i add a custom font to a windows fmx application

    I have a custom font in my Windows app. I created the font as a .ttf file. It gets installed under Windows with the app using Inno Setup. It can then be used like any other font within the app. You can do something similar for other platforms.
  16. Another update on this issue. I have created a minimal application in D11 with just a TMainMenu linked to a TImageList. The main menu has a single item with an image. This still causes the error for the user, which confirms that the issue is related to main menu linked to an image list. Still no progress on working out how the user's computer is different from mine and most other users.
  17. Did you follow the tutorial exactly? If you provide the code then we'd be able to help a lot more.
  18. XylemFlow

    Percent Calculations

    I have done this too in some cases. I assume it's because the range of the variable being adjusted is 0-255 (for example the luminance of a colour or the opacity), but providing a percentage is much more understandable to the user.
  19. Thanks for your suggestions @Serge_G . Here is a colour selector form that I designed for my app with the modified TSpinBoxes bottom right (the default style takes up far too much space). A further update on my Access violation issue though, the styles may not be an issue as I previously thought. I'm now in communication with Embarcadero support and they pointed out that an error is shown earlier in the call stack. The issue may be related to the images in the main menu. I have confirmed that this is the issue by creating a version without the TImageList linked to the main menu. The user has said that the error is gone. Any idea why Delphi 11 would cause an access violation for a main menu linked to an image list on some computers? Here's the full stack trace. main thread ($21b0): 0069e7e3 +003 myapp.exe FMX.Forms TFormBorder.GetSupported 0069e8b5 +005 myapp.exe FMX.Forms TFormBorder.StyleChanged 006aafb5 +00d myapp.exe FMX.Forms TCommonCustomForm.UpdateStyleBook 006ac5e3 +05f myapp.exe FMX.Forms TCustomForm.UpdateStyleBook 006ab222 +092 myapp.exe FMX.Forms TCommonCustomForm.SetStyleBook 006a3946 +03e myapp.exe FMX.Forms TCommonCustomForm.Notification 006ac47a +016 myapp.exe FMX.Forms TCustomForm.Notification 002762b5 +035 myapp.exe System.Classes TComponent.RemoveFreeNotifications 002760dc +014 myapp.exe System.Classes TComponent.Destroy 00670e20 +098 myapp.exe FMX.Types TFmxObject.Destroy 0046bb47 +077 myapp.exe FMX.Controls TStyleBook.Destroy 00139030 +008 myapp.exe System 34 +0 TObject.Free 00671c6e +056 myapp.exe FMX.Types TFmxObject.DoDeleteChildren 00139030 +008 myapp.exe System 34 +0 TObject.Free 002a4c99 +071 myapp.exe System.Messaging TFixedMessageManager.SendMessage 00671d0a +002 myapp.exe FMX.Types TFmxObject.DeleteChildren 00670df2 +06a myapp.exe FMX.Types TFmxObject.Destroy 006a020f +2eb myapp.exe FMX.Forms TCommonCustomForm.Destroy 006ab31f +04b myapp.exe FMX.Forms TCustomForm.Destroy 7725ad8a +00a ntdll.dll KiUserExceptionDispatcher 746541ef +06f KERNELBASE.dll RaiseException 0013918a +032 myapp.exe System 34 +0 TObject.GetInterface 00277838 +018 myapp.exe System.Classes TComponent.QueryInterface 00633c47 +0df myapp.exe FMX.Platform.Menu.Win TWinMenuService.UpdateMenuItem 004164e1 +045 myapp.exe FMX.Menus TMenuItem.DoBitmapChanged 00418641 +049 myapp.exe FMX.Menus TMenuItem.ImagesChanged 0040361d +011 myapp.exe FMX.ImgList TGlyphImageLink.Change 002c1d0b +02f myapp.exe System.ImageList TImageLink.SetImageList 00418682 +006 myapp.exe FMX.Menus TMenuItem.SetImages 00418634 +03c myapp.exe FMX.Menus TMenuItem.ImagesChanged 0040361d +011 myapp.exe FMX.ImgList TGlyphImageLink.Change 002c1d0b +02f myapp.exe System.ImageList TImageLink.SetImageList 00418682 +006 myapp.exe FMX.Menus TMenuItem.SetImages 0041c61f +06b myapp.exe FMX.Menus TMainMenu.ImagesChanged 0041c5aa +00e myapp.exe FMX.Menus TMainMenu.Loaded 0025c4b9 +02d myapp.exe System.Classes NotifyGlobalLoading 0025c654 +07c myapp.exe System.Classes InitInheritedComponent 0069eeac +1a8 myapp.exe FMX.Forms TCommonCustomForm.Create 006ab34a +016 myapp.exe FMX.Forms TCustomForm.Create 0069aeb6 +05a myapp.exe FMX.Forms TApplication.CreateForm 0069b0a9 +075 myapp.exe FMX.Forms TApplication.RealCreateForms 0064283c +018 myapp.exe FMX.Platform.Win TPlatformWin.Run 0069e35f +03f myapp.exe FMX.Forms TApplication.Run 00a4aab3 +3c7 myapp.exe myapp 126 +64 initialization 766b3742 +022 KERNEL32.DLL BaseThreadInitThunk
  20. That doesn't get me much closer to solving this though. Now all I know is that it's the fault of something in Delphi styles. I'm not even sure which form is causing the issue, although I could work that out by trial and error. I still don't understand what's different about the users' setup that causes the error with styles when most others do not? Also, what changed in Delphi 11 to cause this issue, which does not happen in Delphi 10? I'm using custom styles to adjust the look of some of the controls. For example, the TSpinBox has big arrow buttons on each side. I used styles to make the buttons smaller so that the control takes up less space. Does anyone know how I can do that without using styles and without building my own TSpinBox component? Could I create a class deriving from TSpinBox and then override some of the functionality perhaps? The other annoying thing with styles is that I have to create the style for each platform, including each Windows version. I think that the reason the exception didn't happen in Windows XP compatibility mode is because there was no style for it.
  21. After adding call stack logging I have determined that the error occurs in FMX.Forms TFormBorder.GetSupported. The issue may be related to custom styles, which I am using on some forms. A similar question was asked previously. App produces an exception on target computers
  22. Thanks. However, I was using 11.0 when the problem first appeared and that doesn't have the ASLR updates. I've now updated to 11.2 and the issue is still there. My application is 32 bit. What are the chances that the issue is display related? I know that there were some changes to support high DPI scaling in D11. Maybe I should ask the users about their display settings?
  23. Thanks. There's not much information there about how to do that, or on the JEDI wiki site. I did find the following blog post though. Can I assume that this is still relevant, or is it out of date? https://blog.dummzeuch.de/2014/03/08/using-jcldebug/ @dummzeuch
  24. Thanks. I was hoping there was a chance that someone else had a similar issue based on the info I gave. It seems to me that this is a Delphi 11 issue rather than anything in my code, but I don't know for sure. MadExcept looks great, but it's a VCL component. Can I use it in FMX applications as long as I'm building for Windows?
  25. XylemFlow

    Create animated GIF in FireMonley

    I use the FFVCL component. It allows encoding using FFmpeg to many formats including animated Gif and animated PNG. FMX is supported and platforms Windows, Mac and Android. It's not free though and does require that you include the ffmpeg libraries with your app, which are quite large. The old gifimage code by Anders Melander works on VCL, but not FMX unfortunately. If you're running on Windows only then that may be an option though. http://www.delphiffmpeg.com/ https://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.Imaging.GIFImg.TGIFImage
×