Page 5 of 5

Re: Module ScaleGadgets

Posted: Sun Apr 03, 2022 9:47 pm
by mk-soft
The column width is not automatically adjusted because it is defined in the gadget itself.
It must be adjusted subsequently.

Re: Module ScaleGadgets

Posted: Mon Apr 04, 2022 8:56 am
by Mindphazer
Ok, I see. Thanks
Would be nice to have an option to resize all columns width proportionally, though :mrgreen:

Re: Module ScaleGadgets

Posted: Tue Jun 18, 2024 2:03 pm
by ChrisR
Nice ScaleGadgets module

2 small things seen:
The Create Button Drawn is not DPIAware
Once Drawn, If I reduce the window, it crashes on circle() when the radius is negative.

It didn't crash with PB 6.00 but the circle drawing was wrong, it has been fixed, now, it crashes for the following versions :) it shouldn't!
Another independent thing , during the crash, there's no way to return to the IDE to stop the program, only Ctrl+Alt+Del is available, not so great!

Code: Select all

    Procedure MyOwnerDrawCB(Gadget, x, y, Width, Height)
      If IsGadget(Gadget)
        ; DPIAware Width & Height : Or Width = OutputWidth() & Height = OutputHeight() after StartDrawing, without x, y, Width, Height parameters
        Width  = DesktopScaledX(Width)
        Height = DesktopScaledY(Height)
        StartDrawing(CanvasOutput(Gadget))
        Box(0, 0, Width, Height, #Green)
        DrawingMode(#PB_2DDrawing_Outlined)
        Box(1, 1, Width-2 , Height-2, #Black)
        DrawingMode(#PB_2DDrawing_Default)
        If Height > 8
          Circle(Width / 2, Height / 2, Height / 2 - 4, #Red)
        EndIf
        StopDrawing()
      EndIf
    EndProcedure

Re: Module ScaleGadgets

Posted: Fri Jun 21, 2024 3:47 pm
by mk-soft
Thanks ;)

I have update my example ...