@@ -723,6 +723,7 @@ const int GraphicScrollBar::defLength= 200;
723723GraphicScrollBar::GraphicScrollBar(std::string containerName, std::string objName)
724724: GraphicComponent(containerName, objName) {
725725 lighted = false;
726+ activated = false;
726727 horizontal = false;
727728 elementCount = 0;
728729 visibleSize = 0;
@@ -741,13 +742,14 @@ void GraphicScrollBar::init(int x, int y, bool horizontal,int length, int thickn
741742 this->visibleStart=0;
742743 this->visibleCompPosStart=0;
743744 this->visibleCompPosEnd=length;
744- lighted= false;
745+ activated = false;
746+ lighted = false;
745747}
746748
747749bool GraphicScrollBar::mouseDown(int x, int y) {
748750 if(getVisible() && getEnabled() && getEditable())
749751 {
750- if(mouseMove(x,y) )
752+ if(activated )
751753 {
752754 if( elementCount>visibleSize) {
753755 int pos;
@@ -771,6 +773,11 @@ bool GraphicScrollBar::mouseDown(int x, int y) {
771773 return false;
772774}
773775
776+ void GraphicScrollBar::mouseUp(int x, int y) {
777+ activated = false;
778+ lighted = false;
779+ }
780+
774781void GraphicScrollBar::setVisibleStart(int vs){
775782 visibleStart=vs;
776783
@@ -806,20 +813,23 @@ void GraphicScrollBar::setVisibleSize(int visibleSize){
806813
807814bool GraphicScrollBar::mouseClick(int x, int y){
808815 bool result=GraphicComponent::mouseClick( x, y);
809- if(result)
816+ if(result) {
817+ activated = true;
818+ lighted = true;
810819 mouseDown( x, y);
811- return result;
820+ }
821+ return result;
812822}
813823
814824
815825bool GraphicScrollBar::mouseMove(int x, int y){
816- if(this->getVisible() == false) {
817- return false;
826+ bool inScrollBar = GraphicComponent::mouseMove(x, y);
827+ if (activated) {
828+ lighted = true;
829+ } else {
830+ lighted = inScrollBar;
818831 }
819-
820- bool b= GraphicComponent::mouseMove(x, y);
821- lighted= b;
822- return b;
832+ return inScrollBar;
823833}
824834
825835int GraphicScrollBar::getLength() const {
0 commit comments