diff --git a/uppsrc/CtrlLib/SliderCtrl.cpp b/uppsrc/CtrlLib/SliderCtrl.cpp index ec64a5976..5c1496230 100644 --- a/uppsrc/CtrlLib/SliderCtrl.cpp +++ b/uppsrc/CtrlLib/SliderCtrl.cpp @@ -45,6 +45,8 @@ void SliderCtrl::Paint(Draw& w) w.DrawImage(SliderToClient(value), (size.cy - CtrlImg::hthumb().GetSize().cy) >> 1, HasCapture() || HasFocus() ? CtrlImg::hthumb1() : CtrlImg::hthumb()); } + if(HasFocus()) + DrawFocus(w, size); } bool SliderCtrl::Key(dword key, int repcnt) @@ -67,6 +69,7 @@ void SliderCtrl::LeftDown(Point pos, dword keyflags) { if(!IsEditable()) return; + SetWantFocus(); int thumb = SliderToClient(value); int p = HoVe(pos.x, pos.y); if(IsNull(thumb)) { @@ -209,6 +212,16 @@ void SliderCtrl::Inc() } } +void SliderCtrl::GotFocus() +{ + Refresh(); +} + +void SliderCtrl::LostFocus() +{ + Refresh(); +} + SliderCtrl::~SliderCtrl() {} END_UPP_NAMESPACE diff --git a/uppsrc/CtrlLib/SliderCtrl.h b/uppsrc/CtrlLib/SliderCtrl.h index 7a5c0aa8d..8507bf0b1 100644 --- a/uppsrc/CtrlLib/SliderCtrl.h +++ b/uppsrc/CtrlLib/SliderCtrl.h @@ -23,6 +23,8 @@ public: virtual void LeftRepeat(Point pos, dword keyflags); virtual void LeftUp(Point pos, dword keyflags); virtual void MouseMove(Point pos, dword keyflags); + virtual void GotFocus(); + virtual void LostFocus(); virtual void SetData(const Value& value); virtual Value GetData() const;