Jump to content

XylemFlow

Members
  • Content Count

    66
  • Joined

  • Last visited

Community Reputation

6 Neutral

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. XylemFlow

    Group a collection of drawn objects to have a single opacity

    Unfortunately I need to draw everything directly on a single TCanvas. I cannot do it by layering controls on top of each other. One reason is because I need to export the resulting image. By sharing the same opacity I mean that they should be semi transparent and so show previously drawn objects underneath
  2. I need to be able to draw several objects to a form or TImage TCanvas, including lines, circles, polygons, text, etc and have them drawn as a group with a single opacity. If I draw them separately then it won't look correct where they overlap. I currently do this by drawing the objects to an offscreen TBitmap canvas with full opacity and then drawing the TBitmap to my form or TImage TCanvas with the opacity I want. However, this is slower and uses more memory. I'd also like to use Skia in future, but I understand that drawing to offscreen bitmaps is slower since it doesn't use the GPU. Is there a method to group objects in this way in default FMX or Skia without using an offscreen bitmap?
  3. If you want to change the style of the whole window then it's easier to download a theme style. You can download FMX styles or a VCL style and convert it to a VCL style using Bitmap Style Designer. You can then modify the style if needed. The critical part of the style for the window is windowborderstyle.
  4. XylemFlow

    Issue with TNumberBox

    It seems that this isn't only an issue with TNumberBox. TSpinBox does it too. I think anything descended from TCustomEdit. My best guess is that the control is validated when deleting selected text because there is no caret shown.
  5. XylemFlow

    Issue with TNumberBox

    Thanks Mike. Setting VertIncrement to 0 solves the first issue. I have also set HorzIncrement to 0 so that dragging selects the text without changing the value. Unfortunately that means that the arrow keys and mouse wheel no longer increment the value, but I was able to implement that myself using the KeyDown and MouseWheel events. So yes, it is a bit of a mess, but otherwise it works ok. One advantage is that it automatically prevents non numeric characters and supports copy and paste. Ctrl+A does work for me.
  6. XylemFlow

    Issue with TNumberBox

    I've not tried VCL, only FMX. Interesting that it's not happening in VCL though. Also, I'm using 11.2. I have some boxes ranging from -360 to 360, some from -180 to 180 and some from 0 to 100. They all behave the same way.
  7. XylemFlow

    Issue with TNumberBox

    When I select all the text in a TNumberBox (Ctrl+A or drag over the text) and hit Delete, the value gets reset to the Min value and the OnChange event is triggered. This is strange because clicking at the end of the number text and deleting all the characters one at a time until none are left doesn't do the same. A user is likely to want to quickly delete the text, type in a new value and hit enter. However, this doesn't work because the value automatically gets reset to the Min value when all the text is deleted at once. Is there any way I can prevent that? Note that I am running for Windows 32-bit.
  8. I have created a TFrame at design time using the form designer. I then create several instances of the frame at run time. Is there a way to set a property of the underlying TFrame for all instances at once instead of having to iterate over all instances? For example, when a user changes the language at run time the captions and hints of the buttons in the TFrame need to be updated for all instances.
  9. I have set the form's Transparent property to True. I have a TImage covering the form, which also has some fully transparent areas. When these transparent areas are clicked the window underneath is selected and the form loses focus. I'd like the form to keep focus and the TImage OnMouseDown event to trigger. So far the only solution I've found is to place a slightly opaque TRectangle over the form, however this is not ideal because it requires unnecessary alpha blending and also changes the colours slightly.
  10. XylemFlow

    User Drawing of Lines and Curves

    Funny. That bug was reported by me, but I hadn't considered that it would cause problems in my demo.
  11. XylemFlow

    Round corners on FMX form

    I would set the Form's Transparency property to True. https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Forms.TForm.Transparency Now you can put a TRectangle on the form and align it to client. Set its XRadius and YRadius to round the corners. Set it's Fill colour to that of the form. The rounded areas in the corners will not be considered part of the form. Clicking them will select object behind the form. The down side is that the form's title bar will be missing, but you could perhaps recreate it with some additional controls. But for a splash screen I guess you don't want the title bar anyway. I have the opposite problem. I have a transparent form and want the transparent areas to be considered part of the form and not select windows behind. The best way I've found is to place a very slightly opaque TRectangle over the form, but this isn't ideal. I'd like a method to make it fully transparent.
  12. XylemFlow

    Issue with TMenuBar and Alt key

    https://quality.embarcadero.com/browse/RSP-42144 Thanks
  13. XylemFlow

    Issue with TMenuBar and Alt key

    Regarding the above code edit. I decided it was better to just comment out that whole part and just leave the following since I don't want the menu to ever interact with the Alt key. Result := DefWindowProc(hwnd, uMsg, wParam, lParam);
  14. XylemFlow

    Issue with TMenuBar and Alt key

    Many thanks again. That has solved a few of the issues. However, the scale issue is now on my other screen. The issue is that I have 2 monitors set to different scales. Your GetScreenScale function always returns the scale of the main screen, not the screen that the active form is on. I do have a better solution now though, after seeking support from Embarcadero. The solution prevents the Alt key being processed while the mouse button is down, but it does require editing a local copy of FMX.Platform.Win. Change the code in "function WndProc(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;" for WM_SYSKEYUP to this: WM_SYSKEYUP: begin // Local Edit: Change to prevent Alt key being processed while left mouse button is down if ((wParam = VK_MENU) or (wParam = VK_F10)) and not (PlatformWin.FormInfo[LForm].WasLeftMouseButtonPressed) then begin LForm.EnterMenuLoop; Result := 0; end else Result := DefWindowProc(hwnd, uMsg, wParam, lParam); end; I'm happy to make this change. I will report the bug in the Quality portal so that it hopefully gets fixed in future.
  15. XylemFlow

    Issue with TMenuBar and Alt key

    Many thanks. That does work and it also works when the Alt key is pressed down before the mouse. However, there is a small issue on my screen that has scale set to 125% in display settings. My guess is that the click on the caption bar isn't working in that case. That may be a quick fix to take the screen scale into account. That part may cause other issues though. For example, if the window is set to border style none or transparent mode then there is no caption bar to click. Also I wonder how I would get this to work on a second form that isn't the main form.
×