Ignore:
Timestamp:
Mar 15, 2008, 12:55:44 AM (11 years ago)
Author:
Sam Hocevar
Message:
  • Rename the "eh" variable to "wm" because it's a window manager, not an event handler.
  • No longer pass the window manager to functions, there's only one.

Inspired by Win32 Abuse changelog for January 28, 2001:

  • Starting work on singleton code; will get rid of all

references to an arbitrary window_manager* because
there's only going to be one, and it's not ever
going to change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/filesel.cpp

    r90 r106  
    2323  file_picker(int X, int Y, int ID, int Rows, ifield *Next);
    2424  virtual int total() { return tf+td; }
    25   virtual int item_width(window_manager *wm) { return wm->font()->width()*wid; }
    26   virtual int item_height(window_manager *wm) { return wm->font()->height()+1; }
    27   virtual void draw_item(window_manager *wm, image *screen, int x, int y, int num, int active);
    28   virtual void note_selection(window_manager *wm, image *screen, input_manager *inm, int x);
     25  virtual int item_width() { return wm->font()->width()*wid; }
     26  virtual int item_height() { return wm->font()->height()+1; }
     27  virtual void draw_item(image *screen, int x, int y, int num, int active);
     28  virtual void note_selection(image *screen, input_manager *inm, int x);
    2929  void free_up();
    3030  ~file_picker() { free_up(); }
     
    4242}
    4343
    44 void file_picker::note_selection(window_manager *wm, image *screen, input_manager *inm, int x)
     44void file_picker::note_selection(image *screen, input_manager *inm, int x)
    4545{
    4646  if (x<td)
     
    4949    {
    5050      int x1,y1,x2,y2;
    51       area(x1,y1,x2,y2,wm);
     51      area(x1,y1,x2,y2);
    5252      screen->bar(x1,y1,x2,y2,wm->medium_color());
    5353
     
    7272
    7373      reconfigure(); 
    74       draw_first(screen,wm);
     74      draw_first(screen);
    7575    }
    7676  } else
     
    7979    sprintf(nm,"%s/%s",cd,f[x-td]);
    8080    text_field *link=(text_field *)inm->get(sid);
    81     link->change_data(nm,strlen(nm),1,screen,wm);
     81    link->change_data(nm,strlen(nm),1,screen);
    8282  }
    8383
    8484}
    8585
    86 void file_picker::draw_item(window_manager *wm, image *screen, int x, int y, int num, int active)
     86void file_picker::draw_item(image *screen, int x, int y, int num, int active)
    8787{
    8888  if (active)
    89     screen->bar(x,y,x+item_width(wm)-1,y+item_height(wm)-1,wm->black());
     89    screen->bar(x,y,x+item_width()-1,y+item_height()-1,wm->black());
    9090
    9191  if (num<td)
     
    116116}
    117117
    118 jwindow *file_dialog(window_manager *wm, char const *prompt, char const *def,
     118jwindow *file_dialog(char const *prompt, char const *def,
    119119                     int ok_id, char const *ok_name, int cancel_id,
    120120                     char const *cancel_name, char const *FILENAME_str,
Note: See TracChangeset for help on using the changeset viewer.