lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.79k stars 885 forks source link

No UpDown Control with NumberEdit #688

Closed MaxBanister closed 3 years ago

MaxBanister commented 4 years ago

Hello, I'm new to the project but thank you for all the hard work you have put in.

One feature that I think would be nice to have is an UpDown companion control to the NumberEdit, like this:

Screenshot from 2020-05-17 21-09-20

Right now, I am emulating this feature by stacking two PushButtons in a GridLayout, which looks somewhat convincing, but getting the arrows to look native has proved a bit challenging:

Screenshot from 2020-05-17 21-09-32

I could use bitmaps or special fonts, but it would be nice to have this feature out of the box. If you have any suggestions on how to create this functionality, please let me know.

lxn commented 3 years ago

Initially NumberEdit used an UpDown control, but it just looked ugly on some Windows versions and seemed to be a waste of space, so it got removed. If you really need it, we may try to add it back as an option.

MaxBanister commented 3 years ago

I would appreciate it if there were some way to expose this functionality. I'm trying to recreate an existing win32 application, so UI parity is somewhat important.

lxn commented 3 years ago

Implemented in https://github.com/lxn/walk/commit/f7621aeb8225ff560a1b58a5f461735b291f05f8.

MaxBanister commented 3 years ago

Hmm, I see what you mean by ugly. The new SpinButton seems to be too narrow (tested on Wine). Somehow though, other applications, like the example I gave above, seem to not suffer this issue (maybe because it's not a "buddy" component?). Do you know of any workarounds for this?

Screenshot from 2020-09-04 17-41-42

Thanks for making this commit though, much appreciated.

MaxBanister commented 3 years ago

Update: looks fine on Windows 10

numberedit