mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-28 14:17:02 -06:00
CtrlLib: SliderCtrl::Jump
git-svn-id: svn://ultimatepp.org/upp/trunk@1971 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9a6deed2ad
commit
09a9f908b3
2 changed files with 10 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ SliderCtrl::SliderCtrl()
|
|||
, max(100)
|
||||
, step(1)
|
||||
, round_step(true)
|
||||
, jump(false)
|
||||
{
|
||||
Transparent();
|
||||
NoWantFocus();
|
||||
|
|
@ -80,7 +81,13 @@ void SliderCtrl::LeftDown(Point pos, dword keyflags)
|
|||
else
|
||||
if(p >= thumb && p < thumb + HoVe(CtrlImg::hthumb().GetSize().cx, CtrlImg::vthumb().GetSize().cy))
|
||||
SetCapture();
|
||||
else {
|
||||
else
|
||||
if(jump) {
|
||||
value = ClientToSlider(p);
|
||||
WhenSlideFinish();
|
||||
UpdateActionRefresh();
|
||||
}
|
||||
else {
|
||||
if( ( ( p < thumb) && (min == Min() ) ) || ( (p > thumb) && ( min == Max() ) ) )
|
||||
Dec();
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ class SliderCtrl : public Ctrl {
|
|||
int value;
|
||||
int min, max, step;
|
||||
bool round_step;
|
||||
bool jump;
|
||||
|
||||
int SliderToClient(int value) const;
|
||||
int ClientToSlider(int x) const;
|
||||
|
|
@ -41,6 +42,7 @@ public:
|
|||
int GetMax() const { return max; }
|
||||
|
||||
bool IsVert() const;
|
||||
void Jump(bool v = true) { jump = v; }
|
||||
|
||||
SliderCtrl& Step(int _step, bool _r = true) { step = _step; round_step = _r; return *this; }
|
||||
int GetStep() const { return step; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue