/[paragui]/paragui/src/widgets/pgwidget.cpp
ViewVC logotype

Diff of /paragui/src/widgets/pgwidget.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4.4.22.2.2 by braindead, Mon Nov 24 09:17:22 2003 UTC revision 1.4.4.22.2.3 by braindead, Tue Dec 2 15:27:59 2003 UTC
# Line 34  Line 34 
34  #include "pglog.h"  #include "pglog.h"
35  #include "pgdraw.h"  #include "pgdraw.h"
36  #include "pglayout.h"  #include "pglayout.h"
37    #include "pgtheme.h"
38    
39  bool PG_Widget::bBulkUpdate = false;  bool PG_Widget::bBulkUpdate = false;
40  PG_RectList PG_Widget::widgetList;  PG_RectList PG_Widget::widgetList;
# Line 306  void PG_Widget::eventHide() {} Line 307  void PG_Widget::eventHide() {}
307    
308  /**  */  /**  */
309  PG_Point PG_Widget::ClientToScreen(int sx, int sy) {  PG_Point PG_Widget::ClientToScreen(int sx, int sy) {
310          PG_Point p;          return PG_Point(sx + my_xpos, sy + my_ypos);
   
         p.x = sx + my_xpos;  
         p.y = sy + my_ypos;  
   
         return p;  
311  }  }
312    
313  PG_Point PG_Widget::ScreenToClient(int x, int y) {  PG_Point PG_Widget::ScreenToClient(int x, int y) {
314          PG_Point p;          return PG_Point(x - my_xpos, y - my_ypos);
   
         p.x = x - my_xpos;  
         p.y = y - my_ypos;  
   
         return p;  
315  }  }
316    
317  void PG_Widget::AddChild(PG_Widget * child) {  void PG_Widget::AddChild(PG_Widget * child) {
# Line 1040  void PG_Widget::SetFadeSteps(int steps) Line 1031  void PG_Widget::SetFadeSteps(int steps)
1031          my_internaldata->fadeSteps = steps;          my_internaldata->fadeSteps = steps;
1032  }  }
1033    
1034  bool PG_Widget::Action(PG_ACTION action) {  bool PG_Widget::Action(KeyAction action) {
1035          int x = my_xpos + my_width / 2;          int x = my_xpos + my_width / 2;
1036          int y = my_ypos + my_height / 2;          int y = my_ypos + my_height / 2;
1037    
1038          switch(action) {          switch(action) {
1039                  case PG_ACT_ACTIVATE:                  case ACT_ACTIVATE:
1040                          SDL_WarpMouse(x,y);                          SDL_WarpMouse(x,y);
1041                          eventMouseEnter();                          eventMouseEnter();
1042                          break;                          break;
1043    
1044                  case PG_ACT_DEACTIVATE:                  case ACT_DEACTIVATE:
1045                          eventMouseLeave();                          eventMouseLeave();
1046                          break;                          break;
1047    
1048                  case PG_ACT_OK:                  case ACT_OK:
1049                          SDL_MouseButtonEvent button;                          SDL_MouseButtonEvent button;
1050                          button.button = 1;                          button.button = 1;
1051                          button.x = x;                          button.x = x;
# Line 1062  bool PG_Widget::Action(PG_ACTION action) Line 1053  bool PG_Widget::Action(PG_ACTION action)
1053                          eventMouseButtonDown(&button);                          eventMouseButtonDown(&button);
1054                          SDL_Delay(200);                          SDL_Delay(200);
1055                          eventMouseButtonUp(&button);                          eventMouseButtonUp(&button);
1056                          Action(PG_ACT_ACTIVATE);                          Action(ACT_ACTIVATE);
1057                          break;                          break;
1058    
1059                  default:                  default:
# Line 1843  void PG_Widget::GetClipRects(PG_Rect& sr Line 1834  void PG_Widget::GetClipRects(PG_Rect& sr
1834          GetClipRects(src, dst, *this);          GetClipRects(src, dst, *this);
1835  }  }
1836    
1837  bool PG_Widget::eventMessage(MSG_MESSAGE* msg) {  /*bool PG_Widget::eventMessage(MSG_MESSAGE* msg) {
1838          bool rc = false;          bool rc = false;
1839    
1840      if (!msg)      if (!msg)
# Line 1864  bool PG_Widget::eventMessage(MSG_MESSAGE Line 1855  bool PG_Widget::eventMessage(MSG_MESSAGE
1855          }          }
1856    
1857          return rc;          return rc;
1858  }  }*/
1859    
1860  void PG_Widget::SetID(int id) {  void PG_Widget::SetID(int id) {
1861          my_internaldata->id = id;          my_internaldata->id = id;

Legend:
Removed from v.1.4.4.22.2.2  
changed lines
  Added in v.1.4.4.22.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26