Re: Module ScaleGadgets
Posted: Sun Apr 03, 2022 9:47 pm
The column width is not automatically adjusted because it is defined in the gadget itself.
It must be adjusted subsequently.
It must be adjusted subsequently.
http://www.purebasic.com
https://www.purebasic.fr/english/
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