FancyRealCtrl - numeric wxTextCtrl + wxSlider

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
marcin
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sat Feb 17, 2007 8:50 pm

FancyRealCtrl - numeric wxTextCtrl + wxSlider

Post by marcin »

I needed something more fancy than spin buttons for changing value of floating point numbers.

Image

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
Attachments
fancyrealctrl.png
fancyrealctrl.png (4.65 KiB) Viewed 1826 times
Post Reply