I needed something more fancy than spin buttons for changing value of floating point numbers.
The speed of changing numeric value depends on the position of slider.
The "lock" button can be easily removed.
Three events trigger callbacks (mechanism from http://www.newty.de/jakubik/callback.pdf):
- value is changing (when slider is dragged)
- value was changed (when slider is released or value was changed in wxTextCtrl)
- lock button was toggled
The source is in Fityk Subversion:
fancyrc.h
fancyrc.cpp
callback.h
and one tiny class KFTextCtrl from
cmn.h
cmn.cpp
Licence: wxWidgets (padlock icons are from GTK, on LGPL)
Tested on wxGTK and wxMSW, versions 2.6 and 2.8
FancyRealCtrl - numeric wxTextCtrl + wxSlider
FancyRealCtrl - numeric wxTextCtrl + wxSlider
- Attachments
-
- fancyrealctrl.png (4.65 KiB) Viewed 1826 times