Module ScaleGadgets

Share your advanced PureBasic knowledge/code with the community.
User avatar
mk-soft
Always Here
Always Here
Posts: 6204
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module ScaleGadgets

Post by mk-soft »

The column width is not automatically adjusted because it is defined in the gadget itself.
It must be adjusted subsequently.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Module ScaleGadgets

Post by Mindphazer »

Ok, I see. Thanks
Would be nice to have an option to resize all columns width proportionally, though :mrgreen:
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Module ScaleGadgets

Post 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
User avatar
mk-soft
Always Here
Always Here
Posts: 6204
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module ScaleGadgets

Post by mk-soft »

Thanks ;)

I have update my example ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply