Page 1 of 1

GadgetHeight/Width, CanvasGadget and Dialogs

Posted: Thu Feb 22, 2024 2:53 pm
by Cyllceaux
I use my own controls. All of them use the CanvasGadget.

So, my Problem is, I like the DialogManager.

The DialogManager use this

Code: Select all

GadgetHeight(gadget,#PB_Gadget_RequiredSize)
GadgetWidth(gadget,#PB_Gadget_RequiredSize)
for Gadgets to know the required size. Is there a posibility to override or set this for a CanvasGadget? So I can give my own controls a "fixed" initial heigth and with? I don't mean the xml attributes, I really mean this for the gadgets.

Re: GadgetHeight/Width, CanvasGadget and Dialogs

Posted: Thu Feb 22, 2024 3:19 pm
by RASHAD
1- Use Dummy Text gadget to get the proper dimensions
2- Create your Canvas gadget with these dimensions
3- Free the Dummy text gadget

Re: GadgetHeight/Width, CanvasGadget and Dialogs

Posted: Thu Feb 22, 2024 3:28 pm
by Cyllceaux
yes... this is what I do most. But it's not the same.

For example I create a button with images, Text (multi-line) and Styles. It sizes with the images and texts.
My CanvasGadget knows it exact height and width. I cant use the TextGadget for this. :(

Re: GadgetHeight/Width, CanvasGadget and Dialogs

Posted: Thu Feb 22, 2024 4:37 pm
by Fred
2 new attributes for the canvasgadget could help with this. I will see what can be done

Re: GadgetHeight/Width, CanvasGadget and Dialogs

Posted: Thu Feb 22, 2024 4:39 pm
by Cyllceaux
:oops: This would be so nice!