X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcscrollbar.C;h=680341d0beebf0e990e1b74a5bf42c62670e9473;hb=34dd3a28727fc230ba5abbed50766d671a2b8055;hp=5de4db6b79618a83d9bb3f79a3930e970c2b722e;hpb=21c2e6b36d6a96c2f662a89459d607b5a387f4eb;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bcscrollbar.C b/cinelerra-5.1/guicast/bcscrollbar.C index 5de4db6b..680341d0 100644 --- a/cinelerra-5.1/guicast/bcscrollbar.C +++ b/cinelerra-5.1/guicast/bcscrollbar.C @@ -23,18 +23,13 @@ #include "bcresources.h" #include "bcscrollbar.h" #include "clip.h" -#include "colors.h" +#include "bccolors.h" #include "vframe.h" #include -BC_ScrollBar::BC_ScrollBar(int x, - int y, - int orientation, - int pixels, - int64_t length, - int64_t position, - int64_t handlelength, +BC_ScrollBar::BC_ScrollBar(int x, int y, int orientation, int pixels, + int64_t length, int64_t position, int64_t handlelength, VFrame **data) : BC_SubWindow(x, y, 0, 0, -1) { @@ -43,16 +38,15 @@ BC_ScrollBar::BC_ScrollBar(int x, this->handlelength = handlelength; this->selection_status = 0; this->highlight_status = 0; + this->stretch = orientation & SCROLL_STRETCH ? 1 : 0; + orientation &= ~SCROLL_STRETCH; this->orientation = orientation; this->pixels = pixels; - if(data) - this->data = data; - else - if(orientation == SCROLL_HORIZ) - this->data = BC_WindowBase::get_resources()->hscroll_data; - else - this->data = BC_WindowBase::get_resources()->vscroll_data; + if( !data ) data = orientation == SCROLL_HORIZ ? + BC_WindowBase::get_resources()->hscroll_data : + BC_WindowBase::get_resources()->vscroll_data ; + this->data = data; handle_pixel = 0; handle_pixels = 0; @@ -90,8 +84,6 @@ void BC_ScrollBar::set_images(VFrame **data) calculate_dimensions(w, h); } - - void BC_ScrollBar::calculate_dimensions(int &w, int &h) { switch(orientation) @@ -125,30 +117,18 @@ int BC_ScrollBar::get_span(int orientation) int BC_ScrollBar::get_span() { - switch(orientation) - { - case SCROLL_HORIZ: - return data[SCROLL_HANDLE_UP]->get_h(); - break; - - case SCROLL_VERT: - return data[SCROLL_HANDLE_UP]->get_w(); - break; + switch(orientation) { + case SCROLL_HORIZ: return data[SCROLL_HANDLE_UP]->get_h(); + case SCROLL_VERT: return data[SCROLL_HANDLE_UP]->get_w(); } return 0; } int BC_ScrollBar::get_arrow_pixels() { - switch(orientation) - { - case SCROLL_HORIZ: - return data[SCROLL_BACKARROW_UP]->get_w(); - break; - - case SCROLL_VERT: - return data[SCROLL_BACKARROW_UP]->get_h(); - break; + switch(orientation) { + case SCROLL_HORIZ: return data[SCROLL_BACKARROW_UP]->get_w(); + case SCROLL_VERT: return data[SCROLL_BACKARROW_UP]->get_h(); } return 0; } @@ -664,6 +644,7 @@ int BC_ScrollBar::update_value(int64_t value) int BC_ScrollBar::update_length(int64_t length, int64_t position, int64_t handlelength, int flush) { + if( stretch ) length += handlelength/4; this->length = length; this->position = position; this->handlelength = handlelength;