paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/src/widgets pgbutton.cpp,1.2,1.3 pgbuttongrou


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/widgets pgbutton.cpp,1.2,1.3 pgbuttongroup.cpp,1.2,1.3 pgcheckbutton.cpp,1.2,1.3 pgcolumnitem.cpp,1.2,1.3 pgdropdown.cpp,1.2,1.3 pgimage.cpp,1.2,1.3 pglabel.cpp,1.2,1.3 pglayout.cpp,1.1.1.1,1.2 pglineedit.cpp,1.2,1.3 pglistbox.cpp,1.2,1.3 pglistboxbaseitem.cpp,1.2,1.3 pglistboxitem.cpp,1.2,1.3 pgmaskedit.cpp,1.2,1.3 pgmessagebox.cpp,1.2,1.3 pgnotebook.cpp,1.2,1.3 pgpopupmenu.cpp,1.2,1.3 pgprogressbar.cpp,1.2,1.3 pgradiobutton.cpp,1.2,1.3 pgrichedit.cpp,1.2,1.3 pgscrollbar.cpp,1.2,1.3 pgslider.cpp,1.2,1.3 pgspinnerbox.cpp,1.2,1.3 pgthemewidget.cpp,1.2,1.3 pgwidget.cpp,1.2,1.3 pgwidgetdnd.cpp,1.2,1.3 pgwidgetlist.cpp,1.2,1.3 pgwidgetlistex.cpp,1.2,1.3 pgwindow.cpp,1.2,1.3
Date: Mon, 15 Apr 2002 09:35:41 -0400

Update of /cvsroot/paragui/paragui/src/widgets
In directory subversions:/tmp/cvs-serv21912/src/widgets

Modified Files:
        pgbutton.cpp pgbuttongroup.cpp pgcheckbutton.cpp 
        pgcolumnitem.cpp pgdropdown.cpp pgimage.cpp pglabel.cpp 
        pglayout.cpp pglineedit.cpp pglistbox.cpp 
        pglistboxbaseitem.cpp pglistboxitem.cpp pgmaskedit.cpp 
        pgmessagebox.cpp pgnotebook.cpp pgpopupmenu.cpp 
        pgprogressbar.cpp pgradiobutton.cpp pgrichedit.cpp 
        pgscrollbar.cpp pgslider.cpp pgspinnerbox.cpp 
        pgthemewidget.cpp pgwidget.cpp pgwidgetdnd.cpp 
        pgwidgetlist.cpp pgwidgetlistex.cpp pgwindow.cpp 
Log Message:
imported devel-1-0 branch



Index: pgbutton.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgbutton.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** pgbutton.cpp        15 Apr 2002 13:31:31 -0000      1.2
--- pgbutton.cpp        15 Apr 2002 13:35:36 -0000      1.3
***************
*** 37,41 ****
        SDL_Surface* srf_high;
        SDL_Surface* srf_down;
!       SDL_Surface* srf_icon[2];
  
        bool free_icons;
--- 37,41 ----
        SDL_Surface* srf_high;
        SDL_Surface* srf_down;
!       SDL_Surface* srf_icon[3];
  
        bool free_icons;
***************
*** 52,56 ****
  PG_Button::PG_Button(PG_Widget* parent, int id, const PG_Rect& r, const char* 
text, const char* style) : PG_Widget(parent, r) {
        SetDirtyUpdate(false);
!       
        my_internaldata = new PG_ButtonDataInternal;
  
--- 52,56 ----
  PG_Button::PG_Button(PG_Widget* parent, int id, const PG_Rect& r, const char* 
text, const char* style) : PG_Widget(parent, r) {
        SetDirtyUpdate(false);
! 
        my_internaldata = new PG_ButtonDataInternal;
  
***************
*** 61,64 ****
--- 61,65 ----
        my_internaldata->srf_icon[0] = NULL;
        my_internaldata->srf_icon[1] = NULL;
+       my_internaldata->srf_icon[2] = NULL;
  
        my_internaldata->free_icons = false;
***************
*** 111,115 ****
                SetFontColor(b);
  
!       const char  *iconup = 0, *icondown = 0;
  
        switch (GetID()) {
--- 112,116 ----
                SetFontColor(b);
  
!       const char  *iconup = 0, *icondown = 0, *iconover = 0;
  
        switch (GetID()) {
***************
*** 145,148 ****
--- 146,150 ----
                        iconup = "iconup";
                        icondown = "icondown";
+                       iconover = "iconover";
                        break;
        }
***************
*** 150,154 ****
        SetIcon(
            t->FindSurface(widgettype, objectname, iconup),
!           t->FindSurface(widgettype, objectname, icondown)
        );
  
--- 152,157 ----
        SetIcon(
            t->FindSurface(widgettype, objectname, iconup),
!           t->FindSurface(widgettype, objectname, icondown),
!           t->FindSurface(widgettype, objectname, iconover)
        );
  
***************
*** 292,295 ****
--- 295,303 ----
        }
  
+       if(my_internaldata->srf_icon[2]) {
+               PG_Application::UnloadSurface(my_internaldata->srf_icon[2]); // 
false
+               my_internaldata->srf_icon[2] = NULL;
+       }
+ 
        my_internaldata->free_icons = false;
  }
***************
*** 316,322 ****
  /**  */
  bool PG_Button::eventMouseButtonDown(const SDL_MouseButtonEvent* button) {
!     if (!button)
!         return false;
!     
        if(button->button == 1) {
                my_state = BTN_STATE_PRESSED;
--- 324,330 ----
  /**  */
  bool PG_Button::eventMouseButtonDown(const SDL_MouseButtonEvent* button) {
!       if (!button)
!               return false;
! 
        if(button->button == 1) {
                my_state = BTN_STATE_PRESSED;
***************
*** 332,338 ****
  /**  */
  bool PG_Button::eventMouseButtonUp(const SDL_MouseButtonEvent* button) {
!     if (!button)
!         return false;
!     
        if(button->button != 1) {
                return false;
--- 340,346 ----
  /**  */
  bool PG_Button::eventMouseButtonUp(const SDL_MouseButtonEvent* button) {
!       if (!button)
!               return false;
! 
        if(button->button != 1) {
                return false;
***************
*** 369,374 ****
  
  /**  */
! bool PG_Button::SetIcon(const char* filenameup, const char* filenamedown, 
Uint32 colorkey) {
!       if(!SetIcon(filenameup, filenamedown)) {
                return false;
        }
--- 377,382 ----
  
  /**  */
! bool PG_Button::SetIcon2(const char* filenameup, const char* filenamedown, 
const char* filenameover, Uint32 colorkey) {
!       if(!SetIcon2(filenameup, filenamedown, filenameover)) {
                return false;
        }
***************
*** 382,391 ****
        }
  
        return true;
  }
  
! bool PG_Button::SetIcon(const char* filenameup, const char* filenamedown) {
        SDL_Surface* icon0 = PG_Application::LoadSurface(filenameup);
        SDL_Surface* icon1 = PG_Application::LoadSurface(filenamedown);
  
        if(icon0 == NULL) {
--- 390,404 ----
        }
  
+       if(my_internaldata->srf_icon[2] != NULL) {
+               SDL_SetColorKey(my_internaldata->srf_icon[2], SDL_SRCCOLORKEY, 
colorkey);
+       }
+ 
        return true;
  }
  
! bool PG_Button::SetIcon2(const char* filenameup, const char* filenamedown, 
const char* filenameover) {
        SDL_Surface* icon0 = PG_Application::LoadSurface(filenameup);
        SDL_Surface* icon1 = PG_Application::LoadSurface(filenamedown);
+       SDL_Surface* icon2 = PG_Application::LoadSurface(filenameover);
  
        if(icon0 == NULL) {
***************
*** 397,400 ****
--- 410,414 ----
        my_internaldata->srf_icon[0] = icon0;
        my_internaldata->srf_icon[1] = icon1;
+       my_internaldata->srf_icon[2] = icon2;
        my_internaldata->free_icons = true;
  
***************
*** 403,410 ****
  }
  
  /**  */
! bool PG_Button::SetIcon(SDL_Surface* icon_up, SDL_Surface* icon_down) {
  
!       if(!icon_up && !icon_down) {
                return false;
        }
--- 417,434 ----
  }
  
+ 
  /**  */
! bool PG_Button::SetIcon(const char* filenameup, const char* filenamedown) {
!       return SetIcon2(filenameup, filenamedown, NULL);
! }
! 
! bool PG_Button::SetIcon(const char* filenameup, const char* filenamedown, 
Uint32 colorkey) {
!       return SetIcon2(filenameup, filenamedown, NULL, colorkey);
! }
! 
! /**  */
! bool PG_Button::SetIcon(SDL_Surface* icon_up, SDL_Surface* 
icon_down,SDL_Surface* icon_over) {
  
!       if(!icon_up && !icon_down && !icon_over) {
                return false;
        }
***************
*** 414,417 ****
--- 438,442 ----
        my_internaldata->srf_icon[0] = icon_up;
        my_internaldata->srf_icon[1] = icon_down;
+       my_internaldata->srf_icon[2] = icon_over;
  
        my_internaldata->free_icons = false;
***************
*** 420,423 ****
--- 445,452 ----
  }
  
+ bool PG_Button::SetIcon(SDL_Surface* icon_up, SDL_Surface* icon_down) {
+       return SetIcon(icon_up, icon_down, NULL);
+ }
+ 
  /**  */
  void PG_Button::SetBorderSize(int norm, int pressed, int high) {
***************
*** 467,477 ****
  }
  
  /**  */
  void PG_Button::eventButtonSurface(SDL_Surface** surface, int newstate, 
Uint16 w, Uint16 h) {
!     if (!surface)
!         return;
!     
        PG_Rect r(0, 0, w, h);
!     
        // remove the old button surface (if there are no more references)
        PG_ThemeWidget::DeleteThemedSurface(*surface);
--- 496,514 ----
  }
  
+ /**
+  * Set the moving distance of the image when we press on it
+  */
+ void PG_Button::SetShift(int pixelshift) {
+       my_pressShift = pixelshift;
+ }
+ 
+ 
  /**  */
  void PG_Button::eventButtonSurface(SDL_Surface** surface, int newstate, 
Uint16 w, Uint16 h) {
!       if (!surface)
!               return;
! 
        PG_Rect r(0, 0, w, h);
! 
        // remove the old button surface (if there are no more references)
        PG_ThemeWidget::DeleteThemedSurface(*surface);
***************
*** 505,510 ****
        if(my_internaldata->togglemode) {
                return my_internaldata->isPressed;
!       }
!       else {
                return (my_state == BTN_STATE_PRESSED);
        }
--- 542,546 ----
        if(my_internaldata->togglemode) {
                return my_internaldata->isPressed;
!       } else {
                return (my_state == BTN_STATE_PRESSED);
        }
***************
*** 556,560 ****
  
        // check for icon srf
!       SDL_Surface* iconsrf = (my_state == BTN_STATE_PRESSED) ? 
((my_internaldata->srf_icon[1] == 0) ? my_internaldata->srf_icon[0] : 
my_internaldata->srf_icon[1]) : my_internaldata->srf_icon[0];
  
        int tw = my_width;
--- 592,614 ----
  
        // check for icon srf
!       //
!       //SDL_Surface* iconsrf = (my_state == BTN_STATE_PRESSED) ? 
((my_internaldata->srf_icon[1] == 0) ? my_internaldata->srf_icon[0] : 
my_internaldata->srf_icon[1]) : my_internaldata->srf_icon[0];
! 
!       SDL_Surface* iconsrf;
!       if(my_state ==  BTN_STATE_PRESSED) {
!               if(my_internaldata->srf_icon[1] == 0) {
!                       iconsrf = my_internaldata->srf_icon[0];
!               } else {
!                       iconsrf = my_internaldata->srf_icon[1];
!               }
!       } else if(my_state ==BTN_STATE_HIGH) {
!               if(my_internaldata->srf_icon[2] == 0) {
!                       iconsrf = my_internaldata->srf_icon[0];
!               } else {
!                       iconsrf = my_internaldata->srf_icon[2];
!               }
!       } else {
!               iconsrf = my_internaldata->srf_icon[0];
!       }
  
        int tw = my_width;

Index: pgbuttongroup.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgbuttongroup.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgcheckbutton.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgcheckbutton.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgcolumnitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgcolumnitem.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgdropdown.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgdropdown.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgimage.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgimage.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pglabel.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglabel.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pglayout.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglayout.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** pglayout.cpp        15 Apr 2002 13:22:16 -0000      1.1.1.1
--- pglayout.cpp        15 Apr 2002 13:35:36 -0000      1.2
***************
*** 122,126 ****
                return;
        }
!       
        if(strlen(c) == 0) {
                return;
--- 122,126 ----
                return;
        }
! 
        if(strlen(c) == 0) {
                return;
***************
*** 141,146 ****
                if(parent == NULL) {
                        mx = ((i%2)==0) ? screen->w : screen->h;
!               }
!               else {
                        mx = ((i%2)==0) ? parent->w : parent->h;
                }
--- 141,145 ----
                if(parent == NULL) {
                        mx = ((i%2)==0) ? screen->w : screen->h;
!               } else {
                        mx = ((i%2)==0) ? parent->w : parent->h;
                }
***************
*** 397,401 ****
  
  static int SetUserButtonAtts(PG_Button *Widget, const char **atts, 
ParseUserData_t *XMLParser) {
!       char    *c,*c1;
        int i,j,k;
        int b;
--- 396,400 ----
  
  static int SetUserButtonAtts(PG_Button *Widget, const char **atts, 
ParseUserData_t *XMLParser) {
!       char    *c,*c1,*c2;
        int i,j,k;
        int b;
***************
*** 403,416 ****
        c = PG_Layout::GetParamStr(atts, "upimage");
        c1 = PG_Layout::GetParamStr(atts, "downimage");
        if (c1[0] == 0) {
                c1 = NULL;
        }
  
        if (c[0] != 0) {
                b = PG_Layout::GetParamInt(atts, "colorkey");
                if(b != -1) {
!                       Widget->SetIcon(c, c1, b);
                } else {
!                       Widget->SetIcon(c, c1);
                }
        }
--- 402,420 ----
        c = PG_Layout::GetParamStr(atts, "upimage");
        c1 = PG_Layout::GetParamStr(atts, "downimage");
+       c2 = PG_Layout::GetParamStr(atts, "overimage");
        if (c1[0] == 0) {
                c1 = NULL;
        }
  
+       if (c2[0] == 0) {
+               c2 = NULL;
+       }
+ 
        if (c[0] != 0) {
                b = PG_Layout::GetParamInt(atts, "colorkey");
                if(b != -1) {
!                       Widget->SetIcon2(c, c1, c2, b);
                } else {
!                       Widget->SetIcon2(c, c1, c2);
                }
        }
***************
*** 422,425 ****
--- 426,435 ----
        Widget->SetPressed(i == 1);
  
+       c = PG_Layout::GetParamStr(atts, "shift");
+       if (c[0] != 0) {
+               sscanf(c,"%d",&i);
+               Widget->SetShift(i);
+       }
+ 
        c = PG_Layout::GetParamStr(atts, "border");
        if (c[0] != 0) {
***************
*** 665,672 ****
  
                PG_Button       *Widget = new PG_Button(
!                       parent,
!                       0,
!                       Rect,
!                       PG_Layout::GetParamStr(atts, "text"));
  
                XMLParser->ParentObject = Widget;
--- 675,682 ----
  
                PG_Button       *Widget = new PG_Button(
!                                       parent,
!                                       0,
!                                       Rect,
!                                       PG_Layout::GetParamStr(atts, "text"));
  
                XMLParser->ParentObject = Widget;
***************
*** 903,911 ****
  
                PG_RadioButton *Widget = new PG_RadioButton(
!                       parent,
!                       0,
!                       Rect,
!                       (const char*)PG_Layout::GetParamStr(atts, "text"),
!                       (PG_RadioButton 
*)PG_Application::GetWidgetByName(PG_Layout::GetParamStr(atts, "group")));
  
                XMLParser->ParentObject = Widget;
--- 913,921 ----
  
                PG_RadioButton *Widget = new PG_RadioButton(
!                                            parent,
!                                            0,
!                                            Rect,
!                                            (const 
char*)PG_Layout::GetParamStr(atts, "text"),
!                                            (PG_RadioButton 
*)PG_Application::GetWidgetByName(PG_Layout::GetParamStr(atts, "group")));
  
                XMLParser->ParentObject = Widget;
***************
*** 921,928 ****
  
                PG_CheckButton *Widget = new PG_CheckButton(
!                       parent,
!                       0,
!                       Rect,
!                       PG_Layout::GetParamStr(atts, "text"));
  
                XMLParser->ParentObject = Widget;
--- 931,938 ----
  
                PG_CheckButton *Widget = new PG_CheckButton(
!                                            parent,
!                                            0,
!                                            Rect,
!                                            PG_Layout::GetParamStr(atts, 
"text"));
  
                XMLParser->ParentObject = Widget;
***************
*** 998,1004 ****
                Point.x=Rect.x;
                Point.y=Rect.y;
!               
                PG_PopupMenu* Widget = NULL;
!               
                // is the current popup a child of another popup ?
                if(XMLParser->Section & XML_SECTION_POPUPMENU) {
--- 1008,1014 ----
                Point.x=Rect.x;
                Point.y=Rect.y;
! 
                PG_PopupMenu* Widget = NULL;
! 
                // is the current popup a child of another popup ?
                if(XMLParser->Section & XML_SECTION_POPUPMENU) {
***************
*** 1006,1021 ****
                        PG_PopupMenu* menu = 
static_cast<PG_PopupMenu*>(XMLParser->ParentObject);
                        menu->addMenuItem(PG_Layout::GetParamStr(atts, 
"caption"), Widget);
!               }
!               else {
                        // is the popup a child of a menubar ?
                        if(XMLParser->Section & XML_SECTION_MENUBAR) {
                                Widget = new PG_PopupMenu(NULL, Point.x, 
Point.y, PG_Layout::GetParamStr(atts, "caption"));
                                
static_cast<PG_MenuBar*>(XMLParser->ParentObject)->Add(PG_Layout::GetParamStr(atts,
 "text"), Widget);
!                       }       
!                       else {
                                Widget = new PG_PopupMenu(parent, Point.x, 
Point.y, PG_Layout::GetParamStr(atts, "caption"));
                        }
                }
!               
                // register section popupmenu
                XMLParser->Section = XML_SECTION_POPUPMENU | XML_SECTION_BODY | 
XML_SECTION_COMWIDPARAMS;
--- 1016,1029 ----
                        PG_PopupMenu* menu = 
static_cast<PG_PopupMenu*>(XMLParser->ParentObject);
                        menu->addMenuItem(PG_Layout::GetParamStr(atts, 
"caption"), Widget);
!               } else {
                        // is the popup a child of a menubar ?
                        if(XMLParser->Section & XML_SECTION_MENUBAR) {
                                Widget = new PG_PopupMenu(NULL, Point.x, 
Point.y, PG_Layout::GetParamStr(atts, "caption"));
                                
static_cast<PG_MenuBar*>(XMLParser->ParentObject)->Add(PG_Layout::GetParamStr(atts,
 "text"), Widget);
!                       } else {
                                Widget = new PG_PopupMenu(parent, Point.x, 
Point.y, PG_Layout::GetParamStr(atts, "caption"));
                        }
                }
! 
                // register section popupmenu
                XMLParser->Section = XML_SECTION_POPUPMENU | XML_SECTION_BODY | 
XML_SECTION_COMWIDPARAMS;
***************
*** 1035,1042 ****
                PG_PopupMenu* menu = 
static_cast<PG_PopupMenu*>(XMLParser->ParentObject);
                menu->addMenuItem(PG_Layout::GetParamStr(atts, "caption"), 
PG_Layout::GetParamInt(atts, "id"));
!               
                return;
        }
!       
        //Tag <menubar> <MB>
        if(IsTag("menubar", "MB", XML_SECTION_BODY)) {
--- 1043,1050 ----
                PG_PopupMenu* menu = 
static_cast<PG_PopupMenu*>(XMLParser->ParentObject);
                menu->addMenuItem(PG_Layout::GetParamStr(atts, "caption"), 
PG_Layout::GetParamInt(atts, "id"));
! 
                return;
        }
! 
        //Tag <menubar> <MB>
        if(IsTag("menubar", "MB", XML_SECTION_BODY)) {
***************
*** 1110,1118 ****
  
        RestoreUserData(XMLParser);
!       
        if (WidgetToAdd == NULL) {
                return;
        }
!       
        ((PG_WidgetList *)(XMLParser->ParentObject))->AddWidget(WidgetToAdd);
  }
--- 1118,1126 ----
  
        RestoreUserData(XMLParser);
! 
        if (WidgetToAdd == NULL) {
                return;
        }
! 
        ((PG_WidgetList *)(XMLParser->ParentObject))->AddWidget(WidgetToAdd);
  }
***************
*** 1187,1199 ****
                }
  
!                 if (bytes_read == 0) {
!                         status = true;
!                         break;
!                 }
!         }
! 
!         if (XMLParser.Parser != NULL) {
!                 XML_ParserFree(XMLParser.Parser);
!         }
  
        delete f;
--- 1195,1207 ----
                }
  
!               if (bytes_read == 0) {
!                       status = true;
!                       break;
!               }
!       }
! 
!       if (XMLParser.Parser != NULL) {
!               XML_ParserFree(XMLParser.Parser);
!       }
  
        delete f;

Index: pglineedit.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglineedit.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pglistbox.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistbox.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pglistboxbaseitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxbaseitem.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pglistboxitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxitem.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgmaskedit.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgmaskedit.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgmessagebox.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgmessagebox.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgnotebook.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgnotebook.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgpopupmenu.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgpopupmenu.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgprogressbar.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgprogressbar.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgradiobutton.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgradiobutton.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgrichedit.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgrichedit.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgscrollbar.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgscrollbar.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgslider.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgslider.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgspinnerbox.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgspinnerbox.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgthemewidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgthemewidget.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgwidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidget.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** pgwidget.cpp        15 Apr 2002 13:31:31 -0000      1.2
--- pgwidget.cpp        15 Apr 2002 13:35:36 -0000      1.3
***************
*** 79,82 ****
--- 79,84 ----
        bool inDestruct;
        std::string name;
+       
+       bool hidden;
  };
  
***************
*** 150,153 ****
--- 152,156 ----
        my_internaldata->quitModalLoop = false;
        my_internaldata->visible = false;
+       my_internaldata->hidden = false;
        my_internaldata->firstredraw = true;
  
***************
*** 454,460 ****
--- 457,465 ----
                UpdateRect(horizontal);
                UpdateRect(my_internaldata->rectClip);
+               PG_Application::LockScreen();
                SDL_UpdateRects(my_srfScreen, 1, &my_internaldata->rectClip);
                SDL_UpdateRects(my_srfScreen, 1, &vertical);
                SDL_UpdateRects(my_srfScreen, 1, &horizontal);
+               PG_Application::UnlockScreen();
        }
  
***************
*** 618,621 ****
--- 623,630 ----
  void PG_Widget::SetVisible(bool visible) {
  
+       if(IsHidden()) {
+               return;
+       }
+       
        // Attempt to make object visible
        if(visible) {
***************
*** 647,654 ****
                while (list != my_internaldata->childList->end()) {
                        (*list)->SetVisible(visible);
!                       if(visible) {
!                               (*list)->eventShow();
!                       } else {
!                               (*list)->eventHide();
                        }
                        list++;
--- 656,665 ----
                while (list != my_internaldata->childList->end()) {
                        (*list)->SetVisible(visible);
!                       if(!(*list)->IsHidden()) {
!                               if(visible) {
!                                       (*list)->eventShow();
!                               } else {
!                                       (*list)->eventHide();
!                               }
                        }
                        list++;
***************
*** 662,667 ****
        widgetList.BringToFront(this);
  
        SetVisible(true);
! 
        eventShow();
  
--- 673,679 ----
        widgetList.BringToFront(this);
  
+       SetHidden(false);
        SetVisible(true);
!       
        eventShow();
  
***************
*** 684,687 ****
--- 696,700 ----
  
        if(!IsVisible()) {
+               SetHidden(true);
                return;
        }
***************
*** 712,718 ****
--- 725,735 ----
  
        if(!PG_Application::GetBulkMode()) {
+               PG_Application::LockScreen();
                SDL_UpdateRects(my_srfScreen, 1, &my_internaldata->rectClip);
+               PG_Application::UnlockScreen();
        }
  
+       SetHidden(true);
+ 
        return;
  }
***************
*** 986,989 ****
--- 1003,1009 ----
                d = 1;
        } // minimum step == 1
+       
+       PG_Application::LockScreen();
+       
        for(int i=my_internaldata->transparency; i<255; i += d) {
                RestoreBackground(NULL, true);
***************
*** 997,1000 ****
--- 1017,1022 ----
        SDL_BlitSurface(srfFade, NULL, my_srfScreen, this);
        SetVisible(false);
+       PG_Application::UnlockScreen();
+ 
        Update(false);
  
***************
*** 1017,1020 ****
--- 1039,1044 ----
        SDL_Surface* srfFade = PG_Draw::CreateRGBSurface(w, h);
  
+       PG_Application::LockScreen();
+       
        // blit the widget to temp surface
        PG_Draw::BlitSurface(my_srfScreen, my_internaldata->rectClip, srfFade, 
src);
***************
*** 1032,1035 ****
--- 1056,1061 ----
        }
  
+       PG_Application::UnlockScreen();
+ 
        Update();
  
***************
*** 1146,1153 ****
--- 1172,1181 ----
        SDL_Surface* screen = PG_Application::GetScreen();
  
+       PG_Application::LockScreen();
        PG_Application::RedrawBackground(r);
        SDL_SetClipRect(screen, (PG_Rect*)&r);
        widgetList.Intersect((PG_Rect*)&r).Blit(r);
        SDL_SetClipRect(screen, NULL);
+       PG_Application::UnlockScreen();
  }
  
***************
*** 1617,1625 ****
        }
        
!       SDL_GetClipRect(surface, &rect);
  
        if((y < rect.y) || (y >= (rect.y+rect.h))) {
                return;
!       }
  
        // clip to widget cliprect
--- 1645,1653 ----
        }
        
!       /*SDL_GetClipRect(surface, &rect);
  
        if((y < rect.y) || (y >= (rect.y+rect.h))) {
                return;
!       }*/
  
        // clip to widget cliprect
***************
*** 1629,1634 ****
  
        // clip to surface cliprect
!       x0 = PG_MAX(x0, rect.x);
!       x1 = PG_MIN(x1, rect.x+rect.w);
  
        int wl = (x1-x0);
--- 1657,1662 ----
  
        // clip to surface cliprect
!       /*x0 = PG_MAX(x0, rect.x);
!       x1 = PG_MIN(x1, rect.x+rect.w);*/
  
        int wl = (x1-x0);
***************
*** 1662,1670 ****
        }
        
!       SDL_GetClipRect(surface, &rect);
  
        if((x < rect.x) || (x >= (rect.x+rect.w))) {
                return;
!       }
  
        // clip to widget cliprect
--- 1690,1698 ----
        }
        
!       /*SDL_GetClipRect(surface, &rect);
  
        if((x < rect.x) || (x >= (rect.x+rect.w))) {
                return;
!       }*/
  
        // clip to widget cliprect
***************
*** 1674,1679 ****
  
        // clip to surface cliprect
!       y0 = PG_MAX(y0, rect.y);
!       y1 = PG_MIN(y1, rect.y+rect.h);
  
        int hl = (y1-y0);
--- 1702,1707 ----
  
        // clip to surface cliprect
!       /*y0 = PG_MAX(y0, rect.y);
!       y1 = PG_MIN(y1, rect.y+rect.h);*/
  
        int hl = (y1-y0);
***************
*** 1895,1897 ****
--- 1923,1934 ----
  bool PG_Widget::GetDirtyUpdate() {
        return my_internaldata->dirtyUpdate;
+ }
+ 
+ void PG_Widget::SetHidden(bool hidden) {
+       my_internaldata->hidden = hidden;
+ }
+ 
+       
+ bool PG_Widget::IsHidden() {
+       return my_internaldata->hidden;
  }

Index: pgwidgetdnd.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetdnd.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgwidgetlist.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetlist.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgwidgetlistex.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetlistex.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3

Index: pgwindow.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwindow.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]