Changeset 106 for abuse/trunk/src/menu.cpp
- Timestamp:
- Mar 15, 2008, 12:55:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/menu.cpp
r88 r106 148 148 int tl=strlen(title)*font->width(); 149 149 int tx=screen->width()/2-tl/2; 150 dark_wiget(tx-2,my-font->height()-4,tx+tl+2,my-2, eh->medium_color(),eh->dark_color(),180);151 font->put_string(screen,tx+1,my-font->height()-2,title, eh->bright_color());150 dark_wiget(tx-2,my-font->height()-4,tx+tl+2,my-2,wm->medium_color(),wm->dark_color(),180); 151 font->put_string(screen,tx+1,my-font->height()-2,title,wm->bright_color()); 152 152 } 153 153 154 dark_wiget(mx,my,mx+mw-1,my+mh-1, eh->medium_color(),eh->dark_color(),200);154 dark_wiget(mx,my,mx+mw-1,my+mh-1,wm->medium_color(),wm->dark_color(),200); 155 155 156 156 … … 159 159 { 160 160 char *ms=men_str(CAR(c)); 161 font->put_string(screen,mx+10+1,y+1,ms, eh->black());162 font->put_string(screen,mx+10,y,ms, eh->bright_color());161 font->put_string(screen,mx+10+1,y+1,ms,wm->black()); 162 font->put_string(screen,mx+10,y,ms,wm->bright_color()); 163 163 y+=font->height()+1; 164 164 } 165 165 166 eh->flush_screen();166 wm->flush_screen(); 167 167 event ev; 168 168 int choice=0,done=0; … … 176 176 do 177 177 { 178 eh->flush_screen();179 if ( eh->event_waiting())180 { 181 eh->get_event(ev);178 wm->flush_screen(); 179 if (wm->event_waiting()) 180 { 181 wm->get_event(ev); 182 182 if (ev.type==EV_KEY) 183 183 { … … 228 228 229 229 char *cur=men_str(nth(choice,args)); 230 font->put_string(screen,mx+10+1,by1+3,cur, eh->black());231 font->put_string(screen,mx+10,by1+2,cur, eh->bright_color());232 screen->rectangle(mx+1,by1,mx+mw-2,by2, eh->bright_color());230 font->put_string(screen,mx+10+1,by1+3,cur,wm->black()); 231 font->put_string(screen,mx+10,by1+2,cur,wm->bright_color()); 232 screen->rectangle(mx+1,by1,mx+mw-2,by2,wm->bright_color()); 233 233 234 234 color+=cdir; … … 239 239 color+=cdir; 240 240 } 241 eh->flush_screen();241 wm->flush_screen(); 242 242 save->put_image(screen,mx+1,by1); 243 243 } else milli_wait(10); … … 287 287 static void create_volume_window() 288 288 { 289 /* int vx=WINDOW_FRAME_LEFT,vy=WINDOW_FRAME_TOP+ eh->font()->height()*2,scroller_height=130,bh=eh->font()->height()+5;290 291 volume_window= eh->new_window(prop->getd("volume_x",xres/2-20),289 /* int vx=WINDOW_FRAME_LEFT,vy=WINDOW_FRAME_TOP+wm->font()->height()*2,scroller_height=130,bh=wm->font()->height()+5; 290 291 volume_window=wm->new_window(prop->getd("volume_x",xres/2-20), 292 292 prop->getd("volume_y",yres/2-50), 293 293 -1, … … 299 299 do 300 300 { 301 eh->flush_screen();302 eh->get_event(ev);301 wm->flush_screen(); 302 wm->get_event(ev); 303 303 if (ev.type==EV_CLOSE_WINDOW && ev.window==volume_window) done=1; 304 304 } while (!done); 305 eh->close_window(volume_window);305 wm->close_window(volume_window); 306 306 volume_window=NULL; */ 307 307 … … 320 320 slider=cash.reg(ff,"volume_slide",t,1); 321 321 322 volume_window= eh->new_window(prop->getd("volume_x",xres/2-20),322 volume_window=wm->new_window(prop->getd("volume_x",xres/2-20), 323 323 prop->getd("volume_y",yres/2-50), 324 324 41-WINDOW_FRAME_LEFT-WINDOW_FRAME_RIGHT-2, … … 337 337 draw_sfx_vol(slider); 338 338 volume_window->inm->redraw(); 339 eh->grab_focus(volume_window);340 eh->flush_screen();339 wm->grab_focus(volume_window); 340 wm->flush_screen(); 341 341 342 342 volume_window->inm->allow_no_selections(); … … 346 346 do 347 347 { 348 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());349 eh->flush_screen();348 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 349 wm->flush_screen(); 350 350 if (ev.type==EV_MESSAGE) 351 351 { … … 396 396 } else if (ev.type==EV_CLOSE_WINDOW || (ev.type==EV_KEY && ev.key==JK_ESC)) 397 397 { 398 eh->close_window(volume_window);398 wm->close_window(volume_window); 399 399 volume_window=NULL; 400 400 } … … 448 448 { 449 449 image blank(2,2); blank.clear(); 450 eh->set_mouse_shape(blank.copy(),0,0); // don't show mouse450 wm->set_mouse_shape(blank.copy(),0,0); // don't show mouse 451 451 452 452 ss=symbol_value(ss); … … 459 459 event ev; 460 460 do 461 { eh->flush_screen();462 eh->get_event(ev);461 { wm->flush_screen(); 462 wm->get_event(ev); 463 463 } while (ev.type!=EV_KEY); 464 464 if (ev.key==JK_ESC && abortable) … … 467 467 ss=CDR(ss); 468 468 } 469 eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);469 wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1); 470 470 } 471 471 } … … 572 572 inm->redraw(); 573 573 fade_in(NULL,8); 574 eh->flush_screen();574 wm->flush_screen(); 575 575 576 576 } break; … … 580 580 { 581 581 if (ev.window==volume_window) 582 { eh->close_window(volume_window); volume_window=NULL; }582 { wm->close_window(volume_window); volume_window=NULL; } 583 583 } break; 584 584 } … … 708 708 list=make_default_buttons(xres-33,y,list); 709 709 710 input_manager *inm=new input_manager(screen, eh,list);710 input_manager *inm=new input_manager(screen,list); 711 711 inm->allow_no_selections(); 712 712 inm->clear_current(); … … 718 718 int stop_menu=0; 719 719 time_marker start; 720 eh->flush_screen();720 wm->flush_screen(); 721 721 do 722 722 { 723 723 time_marker new_time; 724 724 725 if ( eh->event_waiting())725 if (wm->event_waiting()) 726 726 { 727 727 do 728 728 { 729 eh->get_event(ev);730 } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());731 inm->handle_event(ev,NULL ,eh);729 wm->get_event(ev); 730 } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 731 inm->handle_event(ev,NULL); 732 732 if (ev.type==EV_KEY && ev.key==JK_ESC) 733 eh->push_event(new event(ID_QUIT,NULL));733 wm->push_event(new event(ID_QUIT,NULL)); 734 734 735 735 menu_handler(ev,inm); 736 736 start.get_time(); 737 737 738 eh->flush_screen();738 wm->flush_screen(); 739 739 } 740 740 else
Note: See TracChangeset
for help on using the changeset viewer.