paragui-cvs
[Top][All Lists]
Advanced

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

[paragui-cvs] CVS: paragui/src/widgets pgcolumnitem.cpp,1.3.2.4,1.3.2.5


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/widgets pgcolumnitem.cpp,1.3.2.4,1.3.2.5 pglistbox.cpp,1.7.2.2,1.7.2.3 pglistboxbaseitem.cpp,1.5.2.1,1.5.2.2 pglistboxitem.cpp,1.6.2.4,1.6.2.5 pgwidget.cpp,1.13.2.8,1.13.2.9 pgwidgetlist.cpp,1.11.2.4,1.11.2.5pgwidgetlistex.cpp,1.4.2.1,1.4.2.2
Date: Mon, 03 Feb 2003 16:05:00 -0500

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

Modified Files:
      Tag: devel-opengl
        pgcolumnitem.cpp pglistbox.cpp pglistboxbaseitem.cpp 
        pglistboxitem.cpp pgwidget.cpp pgwidgetlist.cpp 
        pgwidgetlistex.cpp 
Log Message:
- some work on the factory and layout loader
- updated physfs version
- minor automake fixes



Index: pgcolumnitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgcolumnitem.cpp,v
retrieving revision 1.3.2.4
retrieving revision 1.3.2.5
diff -C2 -r1.3.2.4 -r1.3.2.5
*** pgcolumnitem.cpp    30 Oct 2002 09:16:29 -0000      1.3.2.4
--- pgcolumnitem.cpp    3 Feb 2003 21:04:57 -0000       1.3.2.5
***************
*** 67,71 ****
        PG_ListBoxItem::eventBlit(srf, src, dst);
  
-       // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
        if(my_srfIcon != NULL) {
                xshift = my_srfIcon->GetWidth();
--- 67,70 ----
***************
*** 82,87 ****
                GetTextSize(w, h, my_columntext[i].c_str());
  
!               DrawText(xshift, (my_itemheight - h)/2, 
my_columntext[i].c_str(), PG_Rect(xshift, 0, my_columnwidth[i]-5, 
my_itemheight));
!               //DrawText(xshift, (my_itemheight - h) >> 1, 
my_columntext[i].c_str());
  
                xshift += my_columnwidth[i];
--- 81,85 ----
                GetTextSize(w, h, my_columntext[i].c_str());
  
!               DrawText(xshift, (my_height - h)/2, my_columntext[i].c_str(), 
PG_Rect(xshift, 0, my_columnwidth[i]-5, my_height));
  
                xshift += my_columnwidth[i];

Index: pglistbox.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistbox.cpp,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -C2 -r1.7.2.2 -r1.7.2.3
*** pglistbox.cpp       4 Nov 2002 23:04:35 -0000       1.7.2.2
--- pglistbox.cpp       3 Feb 2003 21:04:57 -0000       1.7.2.3
***************
*** 28,31 ****
--- 28,32 ----
  
  #include "pglistbox.h"
+ #include "pglog.h"
  
  PG_ListBox::PG_ListBox(PG_Widget* parent, const PG_Rect& r, const char* 
style) : PG_WidgetList (parent, r, style) {
***************
*** 41,58 ****
  }
  
! /*void PG_ListBox::AddWidget(PG_Widget* w) {
!       PG_WidgetList::AddWidget(w);
! }*/
  
  void PG_ListBox::AddChild(PG_ListBoxBaseItem* item) {
      if (!item)
          return;
      
!     Sint16 neww = Width() - my_widthScrollbar - (my_bordersize << 1);
! 
!     if (neww < 0)
!         neww = 0;
!     
!       item->SizeWidget(neww, item->Height());
        item->SetIndent(my_indent);
        PG_WidgetList::AddChild(item);
--- 42,55 ----
  }
  
! void PG_ListBox::AddChild(PG_Widget* item) {
!       PG_LogDBG("PG_ListBox::AddChild(PG_Widget* item)");
! }
  
  void PG_ListBox::AddChild(PG_ListBoxBaseItem* item) {
+       PG_LogDBG("PG_ListBox::AddChild(PG_ListBoxBaseItem* item)");
      if (!item)
          return;
      
!       item->SizeWidget(GetItemWidth(), item->Height());
        item->SetIndent(my_indent);
        PG_WidgetList::AddChild(item);
***************
*** 174,176 ****
--- 171,182 ----
        
        return false;
+ }
+ 
+ Uint16 PG_ListBox::GetItemWidth() {
+     Sint16 neww = Width() - my_widthScrollbar - (my_bordersize << 1);
+ 
+     if (neww < 0)
+         neww = 0;
+       
+       return (Uint16)neww;
  }

Index: pglistboxbaseitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxbaseitem.cpp,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -r1.5.2.1 -r1.5.2.2
*** pglistboxbaseitem.cpp       31 Aug 2002 04:01:25 -0000      1.5.2.1
--- pglistboxbaseitem.cpp       3 Feb 2003 21:04:57 -0000       1.5.2.2
***************
*** 31,52 ****
  #include "pglog.h"
  
! PG_ListBoxBaseItem::PG_ListBoxBaseItem(PG_ListBox* parent, int height, void* 
userdata) : PG_Label(parent, PG_Rect(0,0,100,20), NULL) {
        my_userdata = userdata;
        my_selected = false;
        my_hover = false;
-       my_itemheight = height;
  
        SetAlignment(PG_TA_LEFT);
  
        if(parent != NULL) {
!               SizeWidget(parent->w, height);
        }
  }
  
  PG_ListBoxBaseItem::~PG_ListBoxBaseItem() {
- /*    if(GetParent()->GetSelectedItem() == this) {
-               GetParent()->SelectItem(NULL);
-               GetParent()->RemoveWidget(this, true, true);
-       }*/
  }
  
--- 31,48 ----
  #include "pglog.h"
  
! PG_ListBoxBaseItem::PG_ListBoxBaseItem(PG_ListBox* parent, int height, void* 
userdata) : PG_Label(parent, PG_Rect(0,0,100,height), NULL) {
        my_userdata = userdata;
        my_selected = false;
        my_hover = false;
  
        SetAlignment(PG_TA_LEFT);
  
        if(parent != NULL) {
!               SizeWidget(parent->GetItemWidth(), height);
!               parent->AddChild(this);
        }
  }
  
  PG_ListBoxBaseItem::~PG_ListBoxBaseItem() {
  }
  
***************
*** 74,86 ****
  }
  
- int PG_ListBoxBaseItem::Height() {
-       return my_itemheight;
- }
- 
  void PG_ListBoxBaseItem::eventSizeWidget(Uint16 w, Uint16 h) {
!       my_itemheight = h;
!       if(GetParent() != NULL) {
!               PG_Label::eventSizeWidget(GetParent()->w, h);
        }
  }
  
--- 70,80 ----
  }
  
  void PG_ListBoxBaseItem::eventSizeWidget(Uint16 w, Uint16 h) {
!       if(GetParent() == NULL) {
!               return;
        }
+       my_height = h;
+       my_width = GetParent()->GetItemWidth(); 
+       PG_Label::eventSizeWidget(GetParent()->GetItemWidth(), h);
  }
  

Index: pglistboxitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxitem.cpp,v
retrieving revision 1.6.2.4
retrieving revision 1.6.2.5
diff -C2 -r1.6.2.4 -r1.6.2.5
*** pglistboxitem.cpp   31 Oct 2002 10:38:04 -0000      1.6.2.4
--- pglistboxitem.cpp   3 Feb 2003 21:04:57 -0000       1.6.2.5
***************
*** 48,52 ****
  
        my_srfHover = PG_ThemeWidget::CreateThemedSurface(
!                         PG_Rect(0, 0, my_width, my_itemheight),
                          my_gradient[2],
                          my_background[2],
--- 48,52 ----
  
        my_srfHover = PG_ThemeWidget::CreateThemedSurface(
!                         PG_Rect(0, 0, my_width, my_height),
                          my_gradient[2],
                          my_background[2],
***************
*** 55,59 ****
  
        my_srfSelected = PG_ThemeWidget::CreateThemedSurface(
!                            PG_Rect(0, 0, my_width, my_itemheight),
                             my_gradient[1],
                             my_background[1],
--- 55,59 ----
  
        my_srfSelected = PG_ThemeWidget::CreateThemedSurface(
!                            PG_Rect(0, 0, my_width, my_height),
                             my_gradient[1],
                             my_background[1],
***************
*** 70,78 ****
  
  void PG_ListBoxItem::eventSizeWidget(Uint16 w, Uint16 h) {
        PG_ThemeWidget::DeleteThemedSurface(my_srfHover);
        PG_ThemeWidget::DeleteThemedSurface(my_srfSelected);
  
        my_srfHover = PG_ThemeWidget::CreateThemedSurface(
!                         PG_Rect(0, 0, w, my_itemheight),
                          my_gradient[2],
                          my_background[2],
--- 70,81 ----
  
  void PG_ListBoxItem::eventSizeWidget(Uint16 w, Uint16 h) {
+       my_width = GetParent()->GetItemWidth();
+       my_height = h;
+ 
        PG_ThemeWidget::DeleteThemedSurface(my_srfHover);
        PG_ThemeWidget::DeleteThemedSurface(my_srfSelected);
  
        my_srfHover = PG_ThemeWidget::CreateThemedSurface(
!                         PG_Rect(0, 0, my_width, my_height),
                          my_gradient[2],
                          my_background[2],
***************
*** 81,85 ****
  
        my_srfSelected = PG_ThemeWidget::CreateThemedSurface(
!                            PG_Rect(0, 0, w, my_itemheight),
                             my_gradient[1],
                             my_background[1],
--- 84,88 ----
  
        my_srfSelected = PG_ThemeWidget::CreateThemedSurface(
!                            PG_Rect(0, 0, my_width, my_height),
                             my_gradient[1],
                             my_background[1],

Index: pgwidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidget.cpp,v
retrieving revision 1.13.2.8
retrieving revision 1.13.2.9
diff -C2 -r1.13.2.8 -r1.13.2.9
*** pgwidget.cpp        9 Nov 2002 12:00:35 -0000       1.13.2.8
--- pgwidget.cpp        3 Feb 2003 21:04:57 -0000       1.13.2.9
***************
*** 466,470 ****
  
  bool PG_Widget::SizeWidget(Uint16 w, Uint16 h) {
!         PG_Draw::PG_Draw* draw = PG_Application::GetDrawingEnvironment();
        if((w == my_width) && (h == my_height)) {
                return false;
--- 466,473 ----
  
  bool PG_Widget::SizeWidget(Uint16 w, Uint16 h) {
!       Uint16 old_w = my_width;
!       Uint16 old_h = my_height;
!       
!       PG_Draw::PG_Draw* draw = PG_Application::GetDrawingEnvironment();
        if((w == my_width) && (h == my_height)) {
                return false;
***************
*** 487,495 ****
        }
  
-       eventSizeWidget(w, h);
- 
        my_width = w;
        my_height = h;
  
        Redraw();
  
--- 490,502 ----
        }
  
        my_width = w;
        my_height = h;
  
+       eventSizeWidget(w, h);
+ 
+       if(GetParent() != NULL) {
+               GetParent()->eventChildChangedSize(this, old_w, old_h);
+       }
+       
        Redraw();
  
***************
*** 1857,1859 ****
--- 1864,1869 ----
  bool PG_Widget::IsHidden() {
        return my_internaldata->hidden;
+ }
+ 
+ void PG_Widget::eventChildChangedSize(PG_Widget* child, Uint16 w_old, Uint16 
h_old) {
  }

Index: pgwidgetlist.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetlist.cpp,v
retrieving revision 1.11.2.4
retrieving revision 1.11.2.5
diff -C2 -r1.11.2.4 -r1.11.2.5
*** pgwidgetlist.cpp    31 Oct 2002 10:38:04 -0000      1.11.2.4
--- pgwidgetlist.cpp    3 Feb 2003 21:04:57 -0000       1.11.2.5
***************
*** 42,46 ****
        my_widgetCount = 0;
        my_listheight = my_listwidth = 0;
-       my_firstWidget = 0;
        my_enableVerticalScrollbar = true;
        my_enableHorizontalScrollbar = false;
--- 42,45 ----
***************
*** 55,63 ****
        // surface widths such as 32768 or 65535 when cast to an unsigned type.
        // This can lead to segfaults later on in, for example, DrawGradient...
!       if (my_widthScrollbar > r.my_width)
                my_widthScrollbar = r.my_width;
            
        if (my_heightHorizontalScrollbar > r.my_height)
!               my_heightHorizontalScrollbar = r.my_height;
  
        my_rectVerticalScrollbar.SetRect(
--- 54,62 ----
        // surface widths such as 32768 or 65535 when cast to an unsigned type.
        // This can lead to segfaults later on in, for example, DrawGradient...
!       /*if (my_widthScrollbar > r.my_width)
                my_widthScrollbar = r.my_width;
            
        if (my_heightHorizontalScrollbar > r.my_height)
!               my_heightHorizontalScrollbar = r.my_height;*/
  
        my_rectVerticalScrollbar.SetRect(
***************
*** 70,74 ****
            0,
            r.my_height - my_heightHorizontalScrollbar,
!           r.my_width - my_widthScrollbar,
            my_heightHorizontalScrollbar);
  
--- 69,73 ----
            0,
            r.my_height - my_heightHorizontalScrollbar,
!           (r.my_width - my_widthScrollbar) < 0 ? 0 : (r.my_width - 
my_widthScrollbar),
            my_heightHorizontalScrollbar);
  
***************
*** 76,79 ****
--- 75,80 ----
        my_objVerticalScrollbar->SetRange(0,0);
        my_widthScrollbar = my_objVerticalScrollbar->Width();
+       PG_LogDBG("my_widthScrollbar = %i", my_widthScrollbar);
+       
        my_objVerticalScrollbar->MoveWidget(r.my_width - my_widthScrollbar, 0);
        my_objVerticalScrollbar->SizeWidget(my_widthScrollbar, r.my_height);
***************
*** 156,164 ****
            my_heightHorizontalScrollbar);
  
!       my_objVerticalScrollbar->MoveWidget(my_rectVerticalScrollbar.my_xpos, 
my_rectVerticalScrollbar.my_ypos);
!       my_objVerticalScrollbar->SizeWidget(my_rectVerticalScrollbar.my_width, 
my_rectVerticalScrollbar.my_height);
! 
!       
my_objHorizontalScrollbar->MoveWidget(my_rectHorizontalScrollbar.my_xpos, 
my_rectHorizontalScrollbar.my_ypos);
!       
my_objHorizontalScrollbar->SizeWidget(my_rectHorizontalScrollbar.my_width, 
my_rectHorizontalScrollbar.my_height);
  
        CheckScrollBars(w, h);
--- 157,162 ----
            my_heightHorizontalScrollbar);
  
!       my_objVerticalScrollbar->MoveWidget(my_rectVerticalScrollbar);
!       my_objHorizontalScrollbar->MoveWidget(my_rectHorizontalScrollbar);
  
        CheckScrollBars(w, h);
***************
*** 194,197 ****
--- 192,196 ----
  
  void PG_WidgetList::eventShow() {
+       PG_LogDBG("PG_WidgetList::eventShow()");
        CheckScrollBars(my_width, my_height);
  }
***************
*** 297,302 ****
                }
  
!               my_widgetList[i]->MoveRect(r.my_xpos, r.my_ypos);
!       }
  
        Update();
--- 296,300 ----
                }
  
!               my_widgetList[i]->MoveRect(r.my_xpos, r.my_ypos);}
  
        Update();
***************
*** 411,422 ****
  
        if(my_listheight >= (Uint32)Height()) {
-               ScrollToY(my_firstWidget);
-       } else {
                ScrollToY(0);
        }
  
        if(my_listwidth >= (Uint32)Width()) {
-               ScrollToX(my_firstWidget);
-       } else {
                ScrollToX(0);
        }
--- 409,416 ----
***************
*** 587,589 ****
--- 581,611 ----
        
        return false;
+ }
+ 
+ void PG_WidgetList::eventChildChangedSize(PG_Widget* child, Uint16 w_old, 
Uint16 h_old) {
+       return;
+       
+       int i = FindIndex(child);
+       
+       if(i == -1) {
+               return;
+       }
+       
+       int dh = h_old - child->h;
+       
+       if(dh == 0) {
+               return;
+       }
+       
+       for(int j = i+1; j<my_widgetList.size(); j++) {
+               my_widgetList[j]->MoveRect(my_widgetList[j]->x, 
my_widgetList[j]->y + dh);
+       }
+       my_listheight += dh;
+       
+       UpdateScrollBarsPos();
+ 
+       //if(IsVisible()) {
+               CheckScrollBars(my_width, my_height);
+               Update();
+       //}
  }

Index: pgwidgetlistex.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetlistex.cpp,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -r1.4.2.1 -r1.4.2.2
*** pgwidgetlistex.cpp  31 Aug 2002 04:01:25 -0000      1.4.2.1
--- pgwidgetlistex.cpp  3 Feb 2003 21:04:58 -0000       1.4.2.2
***************
*** 105,118 ****
  
                        if(my_listheight >= (Uint32)Height()) {
!                               ScrollToY(my_firstWidget)
!                               ;
!                       } else {
                                ScrollToY(0);
                        }
  
                        if(my_listwidth >= (Uint32)Width()) {
!                               ScrollToX(my_firstWidget)
!                               ;
!                       } else {
                                ScrollToX(0);
                        }
--- 105,118 ----
  
                        if(my_listheight >= (Uint32)Height()) {
! //                            ScrollToY(my_firstWidget)
! //                            ;
! //                    } else {
                                ScrollToY(0);
                        }
  
                        if(my_listwidth >= (Uint32)Width()) {
! //                            ScrollToX(my_firstWidget)
! //                            ;
! //                    } else {
                                ScrollToX(0);
                        }





reply via email to

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