Changeset 106 for abuse/trunk/src/gamma.cpp
- Timestamp:
- Mar 15, 2008, 12:55:44 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/gamma.cpp
r88 r106 30 30 public: 31 31 int sc; 32 virtual void draw_item( window_manager *wm,image *screen, int x, int y, int num, int active)33 { 34 long x2 = x + item_width( wm) - 1;35 long y2 = y + item_height( wm) - 1;32 virtual void draw_item(image *screen, int x, int y, int num, int active) 33 { 34 long x2 = x + item_width() - 1; 35 long y2 = y + item_height() - 1; 36 36 screen->bar( x, y, x2, y2, 0 ); 37 37 screen->bar( x, y, x2 - 3, y2, sc + num ); … … 43 43 void set_pos( int x ) { cur_sel = x; } 44 44 virtual int total() { return 32; } 45 virtual int item_width( window_manager *wm) { return 12; }46 virtual int item_height( window_manager *wm) { return 20; }45 virtual int item_width() { return 12; } 46 virtual int item_height() { return 20; } 47 47 virtual int activate_on_mouse_move() { return 0; } 48 48 … … 94 94 gray_pal->load(); 95 95 96 int wm_bc = eh->bright_color(), wm_mc = eh->medium_color(), wm_dc = eh->dark_color();96 int wm_bc = wm->bright_color(), wm_mc = wm->medium_color(), wm_dc = wm->dark_color(); 97 97 98 98 int br_r = pal->red( wm_bc ) + 20; … … 144 144 } 145 145 146 eh->set_colors( gray_pal->find_closest( br_r, br_g, br_b ),146 wm->set_colors( gray_pal->find_closest( br_r, br_g, br_b ), 147 147 gray_pal->find_closest( md_r, md_g, md_b ), 148 148 gray_pal->find_closest( dr_r, dr_g, dr_b ) ); 149 149 150 150 int wl = WINDOW_FRAME_LEFT, wh = WINDOW_FRAME_TOP; 151 int sh = eh->font()->height() + 35;151 int sh = wm->font()->height() + 35; 152 152 button *but = new button( wl + 5, wh + 5 + sh * 3, ID_GAMMA_OK, cash.img( ok_button ), 153 153 new info_field( wl + 35, wh + 10 + sh * 3, ID_NULL, lang_string( "gamma_msg" ), 0 ) ); … … 156 156 gp->set_pos( dg / 4 ); 157 157 158 jwindow *gw = eh->new_window( xres / 2 - 190, yres / 2 - 90, -1, -1, gp);158 jwindow *gw = wm->new_window( xres / 2 - 190, yres / 2 - 90, -1, -1, gp); 159 159 160 160 event ev; 161 eh->flush_screen();161 wm->flush_screen(); 162 162 do 163 163 { 164 164 do 165 165 { 166 eh->get_event(ev);167 } while( ev.type == EV_MOUSE_MOVE && eh->event_waiting() );168 eh->flush_screen();166 wm->get_event(ev); 167 } while( ev.type == EV_MOUSE_MOVE && wm->event_waiting() ); 168 wm->flush_screen(); 169 169 if( ev.type == EV_CLOSE_WINDOW) 170 170 { … … 179 179 dg = ( (spicker *)gw->inm->get( ID_GREEN_PICKER ) )->first_selected() * 4; 180 180 181 eh->close_window( gw );182 eh->flush_screen();183 184 eh->set_colors( wm_bc, wm_mc, wm_dc);181 wm->close_window( gw ); 182 wm->flush_screen(); 183 184 wm->set_colors( wm_bc, wm_mc, wm_dc); 185 185 delete gray_pal; 186 186
Note: See TracChangeset
for help on using the changeset viewer.