Changeset 26 for trunk/Classes/widgets/scrollbar.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/widgets/scrollbar.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/widgets/scrollbar.cpp
r4 r26 26 26 27 27 namespace { 28 const std::string scrollbar_top = "buttons/scrolltop .png";29 const std::string scrollbar_bottom = "buttons/scrollbottom .png";30 const std::string scrollbar_mid = "buttons/scrollmid .png";31 32 const std::string scrollbar_top_hl = "buttons/scrolltop -active.png";33 const std::string scrollbar_bottom_hl = "buttons/scrollbottom -active.png";34 const std::string scrollbar_mid_hl = "buttons/scrollmid -active.png";35 36 const std::string groove_top = "buttons/scrollgroove-top .png";37 const std::string groove_mid = "buttons/scrollgroove-mid .png";38 const std::string groove_bottom = "buttons/scrollgroove-bottom .png";28 const std::string scrollbar_top = "buttons/scrolltop2.png"; 29 const std::string scrollbar_bottom = "buttons/scrollbottom2.png"; 30 const std::string scrollbar_mid = "buttons/scrollmid2.png"; 31 32 const std::string scrollbar_top_hl = "buttons/scrolltop2.png"; //"buttons/scrolltop-active.png"; 33 const std::string scrollbar_bottom_hl = "buttons/scrollbottom2.png"; //"buttons/scrollbottom-active.png"; 34 const std::string scrollbar_mid_hl = "buttons/scrollmid2.png"; //"buttons/scrollmid-active.png"; 35 36 const std::string groove_top = "buttons/scrollgroove-top2.png"; 37 const std::string groove_mid = "buttons/scrollgroove-mid2.png"; 38 const std::string groove_bottom = "buttons/scrollgroove-bottom2.png"; 39 39 40 40 } … … 61 61 { 62 62 handler_vector h; 63 h.push_back(&uparrow_);64 h.push_back(&downarrow_);63 // h.push_back(&uparrow_); 64 // h.push_back(&downarrow_); 65 65 return h; 66 66 } … … 68 68 void scrollbar::update_location(SDL_Rect const &rect) 69 69 { 70 int uh = uparrow_.height(), dh = downarrow_.height(); 71 uparrow_.set_location(rect.x, rect.y); 72 downarrow_.set_location(rect.x, rect.y + rect.h - dh); 70 //int uh = uparrow_.height(), dh = downarrow_.height(); 71 int uh = 0, dh = 0; 72 //uparrow_.set_location(rect.x, rect.y); 73 //downarrow_.set_location(rect.x, rect.y + rect.h - dh); 73 74 SDL_Rect r = rect; 74 75 r.y += uh; … … 76 77 77 78 widget::update_location(r); 78 //bg_register(r);79 79 } 80 80 … … 82 82 { 83 83 widget::hide(value); 84 uparrow_.hide(value);85 downarrow_.hide(value);84 // uparrow_.hide(value); 85 // downarrow_.hide(value); 86 86 } 87 87 … … 103 103 return; 104 104 grip_position_ = pos; 105 uparrow_.enable(grip_position_ != 0);106 downarrow_.enable(grip_position_ < full_height_ - grip_height_);105 // uparrow_.enable(grip_position_ != 0); 106 // downarrow_.enable(grip_position_ < full_height_ - grip_height_); 107 107 set_dirty(); 108 108 } … … 160 160 bool scrollbar::is_valid_height(int height) const 161 161 { 162 int uh = uparrow_.height();163 int dh = downarrow_.height();162 int uh = 0; //uparrow_.height(); 163 int dh = 0; //downarrow_.height(); 164 164 if(uh + dh >= height) { 165 165 return false; … … 181 181 void scrollbar::process_event() 182 182 { 183 if (uparrow_.pressed())184 scroll_up();185 186 if (downarrow_.pressed())187 scroll_down();183 // if (uparrow_.pressed()) 184 // scroll_up(); 185 // 186 // if (downarrow_.pressed()) 187 // scroll_down(); 188 188 } 189 189 … … 191 191 { 192 192 SDL_Rect loc = location(); 193 int uh = uparrow_.height();194 int dh = downarrow_.height();193 int uh = 0; //uparrow_.height(); 194 int dh = 0; //downarrow_.height(); 195 195 if(uh + dh >= loc.h) { 196 196 loc.h = 0; … … 269 269 // surface const screen = video().getSurface(); 270 270 271 // KP: leave a little more space 272 groove.x += 4; 273 grip.x += 4; 274 271 275 // Draw scrollbar "groove" 272 276 blit_surface(groove.x, groove.y, top_grv); … … 287 291 return; 288 292 293 // KP: no longer handle scrollbar events 294 /* 289 295 STATE new_state = state_; 290 296 SDL_Rect const &grip = grip_area(); … … 347 353 } 348 354 state_ = new_state; 355 */ 349 356 } 350 357
Note: See TracChangeset
for help on using the changeset viewer.