native-windows-gui
native-windows-gui copied to clipboard
Controls should provide functions to return their preferred size
E.g. for a Button this would mean to return the minimum size that is required not cut off any text or image. For text fields or labels this should consider the set text, too.
For an inspiration, you may look at the implementation for Button in SWT (search for computeSizeInPixels
)
This is a fundamental requirement to set the correct control's size, to implement layout managers on top of the controls.
Some control implements way to find this (ex: BCM_GETIDEALSIZE
for Button). Not sure all controls have this though. Will probably take some time to implement
If I would have enough Rust experience* I'd start with the most important ones: buttons, checkboxes, radiobuttons, single line input fields. The others like multiline input fields, tables and trees can return a hard coded size, IMHO.
*) For my first project to start learning Rust I need a decent GUI library and yours looks the most feature-complete (though it is limited to Windows only).
Probably not that important for an input, as it scrolls. Labels though... Would greatly appreciate this.