Ignore:
Timestamp:
2010-05-28 07:39:52 (2 years ago)
Author:
kpoole
Message:

Episode 5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Classes/widgets/scrollbar.cpp

    r4 r26  
    2626 
    2727namespace { 
    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"; 
    3939 
    4040} 
     
    6161{ 
    6262    handler_vector h; 
    63     h.push_back(&uparrow_); 
    64     h.push_back(&downarrow_); 
     63//  h.push_back(&uparrow_); 
     64//  h.push_back(&downarrow_); 
    6565    return h; 
    6666} 
     
    6868void scrollbar::update_location(SDL_Rect const &rect) 
    6969{ 
    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); 
    7374    SDL_Rect r = rect; 
    7475    r.y += uh; 
     
    7677 
    7778    widget::update_location(r); 
    78     //bg_register(r); 
    7979} 
    8080 
     
    8282{ 
    8383    widget::hide(value); 
    84     uparrow_.hide(value); 
    85     downarrow_.hide(value); 
     84//  uparrow_.hide(value); 
     85//  downarrow_.hide(value); 
    8686} 
    8787 
     
    103103        return; 
    104104    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_); 
    107107    set_dirty(); 
    108108} 
     
    160160bool scrollbar::is_valid_height(int height) const 
    161161{ 
    162     int uh = uparrow_.height(); 
    163     int dh = downarrow_.height(); 
     162    int uh = 0; //uparrow_.height(); 
     163    int dh = 0; //downarrow_.height(); 
    164164    if(uh + dh >= height) { 
    165165        return false; 
     
    181181void scrollbar::process_event() 
    182182{ 
    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(); 
    188188} 
    189189 
     
    191191{ 
    192192    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(); 
    195195    if(uh + dh >= loc.h) { 
    196196        loc.h = 0; 
     
    269269//  surface const screen = video().getSurface(); 
    270270 
     271    // KP: leave a little more space 
     272    groove.x += 4; 
     273    grip.x += 4; 
     274     
    271275    // Draw scrollbar "groove" 
    272276    blit_surface(groove.x, groove.y, top_grv); 
     
    287291        return; 
    288292 
     293// KP: no longer handle scrollbar events 
     294/* 
    289295    STATE new_state = state_; 
    290296    SDL_Rect const &grip = grip_area(); 
     
    347353    } 
    348354    state_ = new_state; 
     355*/ 
    349356} 
    350357 
Note: See TracChangeset for help on using the changeset viewer.