[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/widgets pgcolumnitem.cpp,1.3,1.4 pgdropdo
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/widgets pgcolumnitem.cpp,1.3,1.4 pgdropdown.cpp,1.8,1.9 pglayout.cpp,1.2,1.3 pglistbox.cpp,1.7,1.8 pglistboxbaseitem.cpp,1.5,1.6 pglistboxitem.cpp,1.6,1.7 pgpopupmenu.cpp,1.7,1.8 pgrichedit.cpp,1.4,1.5 pgtabbar.cpp,1.5,1.6 pgwidget.cpp,1.14,1.15 pgwidgetlist.cpp,1.11,1.12 pgwidgetlistex.cpp,1.4,1.5 |
Date: |
Wed, 26 Jun 2002 12:00:25 -0400 |
Update of /cvsroot/paragui/paragui/src/widgets
In directory subversions:/tmp/cvs-serv21071/src/widgets
Modified Files:
pgcolumnitem.cpp pgdropdown.cpp pglayout.cpp pglistbox.cpp
pglistboxbaseitem.cpp pglistboxitem.cpp pgpopupmenu.cpp
pgrichedit.cpp pgtabbar.cpp pgwidget.cpp pgwidgetlist.cpp
pgwidgetlistex.cpp
Log Message:
redesign of widgetlist/listbox.
items can now be added by specifing the list in the item's constructor.
PG_WidgetListEx may be seriously broken !!!
Index: pgcolumnitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgcolumnitem.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** pgcolumnitem.cpp 15 Apr 2002 13:35:36 -0000 1.3
--- pgcolumnitem.cpp 26 Jun 2002 16:00:21 -0000 1.4
***************
*** 29,33 ****
#include "pgcolumnitem.h"
! PG_ColumnItem::PG_ColumnItem(Uint32 columns, Uint32 height, void* userdata) :
PG_ListBoxItem(height) {
SetUserData(userdata);
my_columncount = columns;
--- 29,33 ----
#include "pgcolumnitem.h"
! PG_ColumnItem::PG_ColumnItem(PG_ListBox* parent, Uint32 columns, Uint32
height, void* userdata) : PG_ListBoxItem(parent, height) {
SetUserData(userdata);
my_columncount = columns;
Index: pgdropdown.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgdropdown.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** pgdropdown.cpp 6 May 2002 10:40:50 -0000 1.8
--- pgdropdown.cpp 26 Jun 2002 16:00:21 -0000 1.9
***************
*** 65,70 ****
PG_FontEngine::GetTextSize(text, GetFont(), NULL, NULL, NULL, NULL, &h);
! PG_ListBoxItem* item = new PG_ListBoxItem(h+2, text, NULL, userdata);
! my_DropList->AddItem(item);
}
--- 65,69 ----
PG_FontEngine::GetTextSize(text, GetFont(), NULL, NULL, NULL, NULL, &h);
! PG_ListBoxItem* item = new PG_ListBoxItem(my_DropList, h+2, text, NULL,
userdata);
}
Index: pglayout.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglayout.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** pglayout.cpp 15 Apr 2002 13:35:36 -0000 1.2
--- pglayout.cpp 26 Jun 2002 16:00:21 -0000 1.3
***************
*** 862,867 ****
}
! PG_ListBoxItem *Widget = new PG_ListBoxItem(h,
PG_Layout::GetParamStr(atts, "ltext"));
! ((PG_ListBox *)XMLParser->ParentObject)->AddItem(Widget);
XMLParser->ParentObject = Widget;
--- 862,867 ----
}
! PG_ListBoxItem *Widget = new
PG_ListBoxItem((PG_ListBox*)(PG_ListBox *)XMLParser->ParentObject, h,
PG_Layout::GetParamStr(atts, "ltext"));
! //((PG_ListBox *)XMLParser->ParentObject)->AddChild(Widget);
XMLParser->ParentObject = Widget;
***************
*** 874,879 ****
XMLParser->Section = XML_SECTION_COLUMNITEM |
XML_SECTION_COMWIDPARAMS;
! PG_ColumnItem *Widget = new
PG_ColumnItem(PG_Layout::GetParamInt(atts,
"columns"),PG_Layout::GetParamInt(atts, "height"));
! ((PG_ListBox *)XMLParser->ParentObject)->AddItem(Widget);
XMLParser->ParentObject = Widget;
--- 874,879 ----
XMLParser->Section = XML_SECTION_COLUMNITEM |
XML_SECTION_COMWIDPARAMS;
! PG_ColumnItem *Widget = new PG_ColumnItem((PG_ListBox
*)XMLParser->ParentObject, PG_Layout::GetParamInt(atts,
"columns"),PG_Layout::GetParamInt(atts, "height"));
! //((PG_ListBox *)XMLParser->ParentObject)->AddChild(Widget);
XMLParser->ParentObject = Widget;
***************
*** 1123,1127 ****
}
! ((PG_WidgetList *)(XMLParser->ParentObject))->AddWidget(WidgetToAdd);
}
--- 1123,1127 ----
}
! ((PG_WidgetList *)(XMLParser->ParentObject))->AddChild(WidgetToAdd);
}
Index: pglistbox.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistbox.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** pglistbox.cpp 6 May 2002 06:24:29 -0000 1.7
--- pglistbox.cpp 26 Jun 2002 16:00:21 -0000 1.8
***************
*** 40,48 ****
PG_ListBox::~PG_ListBox() {}
! void PG_ListBox::AddWidget(PG_Widget* w) {
PG_WidgetList::AddWidget(w);
! }
! void PG_ListBox::AddItem(PG_ListBoxItem* item) {
if (!item)
return;
--- 40,48 ----
PG_ListBox::~PG_ListBox() {}
! /*void PG_ListBox::AddWidget(PG_Widget* w) {
PG_WidgetList::AddWidget(w);
! }*/
! void PG_ListBox::AddChild(PG_ListBoxBaseItem* item) {
if (!item)
return;
***************
*** 55,59 ****
item->SizeWidget(neww, item->Height());
item->SetIndent(my_indent);
! AddWidget(item);
}
--- 55,59 ----
item->SizeWidget(neww, item->Height());
item->SetIndent(my_indent);
! PG_WidgetList::AddChild(item);
}
Index: pglistboxbaseitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxbaseitem.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** pglistboxbaseitem.cpp 30 Apr 2002 10:18:39 -0000 1.5
--- pglistboxbaseitem.cpp 26 Jun 2002 16:00:21 -0000 1.6
***************
*** 30,34 ****
#include "pglistbox.h"
! PG_ListBoxBaseItem::PG_ListBoxBaseItem(int height, void* userdata) :
PG_Label(NULL, PG_Rect(0,0,100,20), NULL) {
my_userdata = userdata;
my_selected = false;
--- 30,34 ----
#include "pglistbox.h"
! PG_ListBoxBaseItem::PG_ListBoxBaseItem(PG_ListBox* parent, int height, void*
userdata) : PG_Label(NULL, PG_Rect(0,0,100,20), NULL) {
my_userdata = userdata;
my_selected = false;
***************
*** 37,40 ****
--- 37,41 ----
SetAlignment(PG_TA_LEFT);
+ parent->AddChild(this);
}
Index: pglistboxitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxitem.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** pglistboxitem.cpp 27 Apr 2002 15:36:55 -0000 1.6
--- pglistboxitem.cpp 26 Jun 2002 16:00:21 -0000 1.7
***************
*** 31,35 ****
#include "pgtheme.h"
! PG_ListBoxItem::PG_ListBoxItem(int height, const char* text, SDL_Surface*
icon, void* userdata, const char* style) : PG_ListBoxBaseItem(height, userdata)
{
for(int i=0; i<3; i++) {
--- 31,35 ----
#include "pgtheme.h"
! PG_ListBoxItem::PG_ListBoxItem(PG_ListBox* parent, int height, const char*
text, SDL_Surface* icon, void* userdata, const char* style) :
PG_ListBoxBaseItem(parent, height, userdata) {
for(int i=0; i<3; i++) {
Index: pgpopupmenu.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgpopupmenu.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** pgpopupmenu.cpp 7 May 2002 12:47:48 -0000 1.7
--- pgpopupmenu.cpp 26 Jun 2002 16:00:21 -0000 1.8
***************
*** 758,761 ****
--- 758,763 ----
if (tracking)
SetCapture();
+
+ current = stop;
}
Index: pgrichedit.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgrichedit.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** pgrichedit.cpp 28 Apr 2002 16:35:30 -0000 1.4
--- pgrichedit.cpp 26 Jun 2002 16:00:21 -0000 1.5
***************
*** 89,93 ****
void PG_RichEdit::AddWidget(PG_Widget* w) {
! PG_WidgetListEx::AddWidget(w);
CompleteLines();
}
--- 89,93 ----
void PG_RichEdit::AddWidget(PG_Widget* w) {
! PG_WidgetListEx::AddChild(w);
CompleteLines();
}
Index: pgtabbar.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgtabbar.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** pgtabbar.cpp 6 May 2002 10:40:50 -0000 1.5
--- pgtabbar.cpp 26 Jun 2002 16:00:21 -0000 1.6
***************
*** 40,44 ****
b->sigButtonClick.connect(slot(*this, &PG_TabBar::handleTabClick));
! my_tabList->AddWidget(b);
if(my_tabList->GetListWidth() > my_width) {
--- 40,44 ----
b->sigButtonClick.connect(slot(*this, &PG_TabBar::handleTabClick));
! my_tabList->AddChild(b);
if(my_tabList->GetListWidth() > my_width) {
Index: pgwidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidget.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** pgwidget.cpp 25 Jun 2002 20:38:42 -0000 1.14
--- pgwidget.cpp 26 Jun 2002 16:00:21 -0000 1.15
***************
*** 160,165 ****
my_xpos = my_parent->my_xpos + my_xpos;
my_ypos = my_parent->my_ypos + my_ypos;
my_parent->AddChild(this);
! }
my_internaldata->mouseInside = false;
--- 160,166 ----
my_xpos = my_parent->my_xpos + my_xpos;
my_ypos = my_parent->my_ypos + my_ypos;
+
my_parent->AddChild(this);
! }
my_internaldata->mouseInside = false;
***************
*** 330,337 ****
void PG_Widget::AddChild(PG_Widget * child) {
!
! if (!child)
return;
!
// remove our new child from previous lists
if(child->GetParent()) {
--- 331,338 ----
void PG_Widget::AddChild(PG_Widget * child) {
! if (!child) {
return;
! }
!
// remove our new child from previous lists
if(child->GetParent()) {
Index: pgwidgetlist.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetlist.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** pgwidgetlist.cpp 6 May 2002 10:40:50 -0000 1.11
--- pgwidgetlist.cpp 26 Jun 2002 16:00:21 -0000 1.12
***************
*** 37,40 ****
--- 37,42 ----
PG_WidgetList::PG_WidgetList(PG_Widget* parent, const PG_Rect& r, const char*
style) : PG_ThemeWidget(parent, r, style) {
+ bInConstructor = true;
+
my_widgetCount = 0;
my_listheight = my_listwidth = 0;
***************
*** 95,98 ****
--- 97,102 ----
LoadThemeStyle(style);
+
+ bInConstructor = false;
}
***************
*** 192,219 ****
}
! void PG_WidgetList::AddWidget(PG_Widget* w) {
if(w == NULL) {
return;
}
! w->SetVisible(false);
! AddChild(w);
if(my_widgetList.empty()) {
! my_listheight = w->Height() + w->my_ypos;
} else {
! my_listheight += (w->Height() + + w->my_ypos);
}
! if (((w->Width() + w->my_xpos) > 0) && (Uint32(w->Width() + w->my_xpos)
> my_listwidth)) {
! my_listwidth = w->Width() + w->my_xpos;
}
if(my_widgetCount == 0) {
! w->MoveWidget(w->my_xpos + my_bordersize, my_listheight -
w->my_height + my_bordersize);
}
else {
PG_Widget* last = my_widgetList[my_widgetCount - 1];
! w->MoveWidget(w->my_xpos + my_bordersize, (last->y - my_ypos) +
last->h + w->my_ypos);
}
--- 196,227 ----
}
! void PG_WidgetList::AddChild(PG_Widget* w) {
if(w == NULL) {
return;
}
! PG_Widget::AddChild(w);
+ if(bInConstructor) {
+ return;
+ }
+
+ w->SetVisible(false);
if(my_widgetList.empty()) {
! my_listheight = w->Height();
} else {
! my_listheight += w->Height();
}
! if ((w->Width() > 0) && (w->Width() > my_listwidth)) {
! my_listwidth = w->Width();
}
if(my_widgetCount == 0) {
! w->MoveWidget(my_bordersize, my_bordersize);
}
else {
PG_Widget* last = my_widgetList[my_widgetCount - 1];
! w->MoveWidget(my_bordersize, (last->y - my_ypos) + last->h);
}
Index: pgwidgetlistex.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidgetlistex.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** pgwidgetlistex.cpp 28 Apr 2002 16:35:30 -0000 1.4
--- pgwidgetlistex.cpp 26 Jun 2002 16:00:21 -0000 1.5
***************
*** 33,37 ****
/** */
! void PG_WidgetListEx::AddWidget(PG_Widget* w) {
if(w == NULL) {
return;
--- 33,37 ----
/** */
! void PG_WidgetListEx::AddChild(PG_Widget* w) {
if(w == NULL) {
return;
***************
*** 39,43 ****
w->SetVisible(false);
! AddChild(w);
if (((w->Width() + w->my_xpos) > 0) && (Uint32(w->Height() +
w->my_ypos) > my_listheight)) {
--- 39,43 ----
w->SetVisible(false);
! PG_Widget::AddChild(w);
if (((w->Width() + w->my_xpos) > 0) && (Uint32(w->Height() +
w->my_ypos) > my_listheight)) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/widgets pgcolumnitem.cpp,1.3,1.4 pgdropdown.cpp,1.8,1.9 pglayout.cpp,1.2,1.3 pglistbox.cpp,1.7,1.8 pglistboxbaseitem.cpp,1.5,1.6 pglistboxitem.cpp,1.6,1.7 pgpopupmenu.cpp,1.7,1.8 pgrichedit.cpp,1.4,1.5 pgtabbar.cpp,1.5,1.6 pgwidget.cpp,1.14,1.15 pgwidgetlist.cpp,1.11,1.12 pgwidgetlistex.cpp,1.4,1.5,
Alexander Pipelka <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui/test factory.cpp,1.3,1.4 list.cpp,1.2,1.3 paratest.cpp,1.11,1.12 tabbar.cpp,1.5,1.6
- Next by Date:
[paragui-cvs] CVS: paragui/include pggldraw.h,1.1.2.1,1.1.2.2
- Previous by thread:
[paragui-cvs] CVS: paragui/test factory.cpp,1.3,1.4 list.cpp,1.2,1.3 paratest.cpp,1.11,1.12 tabbar.cpp,1.5,1.6
- Next by thread:
[paragui-cvs] CVS: paragui/include pggldraw.h,1.1.2.1,1.1.2.2
- Index(es):