Skip to content

Commit

Permalink
Add Slider and Scrollbar scrollvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Oct 6, 2024
1 parent 885a0d0 commit 26b11b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/cfl_valuator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ int Fl_Slider_slider_box(const Fl_Slider *self);

void Fl_Slider_set_slider_box(Fl_Slider *self, int c);

int Fl_Slider_scroll_value(Fl_Slider *self, int pos, int windowSize, int first_line, int total_lines);

VALUATOR_DECLARE(Fl_Slider)

WIDGET_DECLARE(Fl_Nice_Slider)
Expand Down Expand Up @@ -70,6 +72,8 @@ void Fl_Scrollbar_set_linesize(Fl_Scrollbar *self, int sz);

int Fl_Scrollbar_linesize(const Fl_Scrollbar *self);

int Fl_Scrollbar_scroll_value(Fl_Scrollbar *self, int pos, int windowSize, int first_line, int total_lines);

VALUATOR_DECLARE(Fl_Scrollbar)

WIDGET_DECLARE(Fl_Value_Slider)
Expand Down
10 changes: 10 additions & 0 deletions src/cfl_valuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ void Fl_Slider_set_slider_box(Fl_Slider *self, int c) {
LOCK(self->slider((Fl_Boxtype)c));
}

int Fl_Slider_scroll_value(Fl_Slider *self, int pos, int windowSize, int first_line, int total_lines) {
LOCK(auto ret = self->scrollvalue(pos, windowSize, first_line, total_lines));
return ret;
}

VALUATOR_DEFINE(Fl_Slider)

WIDGET_CLASS(Fl_Nice_Slider)
Expand Down Expand Up @@ -167,6 +172,11 @@ int Fl_Scrollbar_linesize(const Fl_Scrollbar *self) {
return ret;
}

int Fl_Scrollbar_scroll_value(Fl_Scrollbar *self, int pos, int windowSize, int first_line, int total_lines) {
LOCK(auto ret = self->value(pos, windowSize, first_line, total_lines));
return ret;
}

VALUATOR_DEFINE(Fl_Scrollbar)

WIDGET_CLASS(Fl_Value_Slider)
Expand Down

0 comments on commit 26b11b0

Please sign in to comment.