[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/widgets pglistboxbaseitem.cpp,1.3.6.3,1.
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/widgets pglistboxbaseitem.cpp,1.3.6.3,1.3.6.4 |
Date: |
Fri, 21 Mar 2003 15:05:00 -0500 |
Update of /cvsroot/paragui/paragui/src/widgets
In directory subversions:/tmp/cvs-serv22043/src/widgets
Modified Files:
Tag: devel-1-0
pglistboxbaseitem.cpp
Log Message:
DevC++ compilation fixes, new workspaces
Index: pglistboxbaseitem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglistboxbaseitem.cpp,v
retrieving revision 1.3.6.3
retrieving revision 1.3.6.4
diff -C2 -r1.3.6.3 -r1.3.6.4
*** pglistboxbaseitem.cpp 20 Jun 2002 14:35:33 -0000 1.3.6.3
--- pglistboxbaseitem.cpp 21 Mar 2003 20:04:58 -0000 1.3.6.4
***************
*** 1,115 ****
! /*
! ParaGUI - crossplatform widgetset
! Copyright (C) 2000,2001,2002 Alexander Pipelka
!
! This library is free software; you can redistribute it and/or
! modify it under the terms of the GNU Library General Public
! License as published by the Free Software Foundation; either
! version 2 of the License, or (at your option) any later version.
!
! This library is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! Library General Public License for more details.
!
! You should have received a copy of the GNU Library General Public
! License along with this library; if not, write to the Free
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
!
! Alexander Pipelka
! address@hidden
!
! Last Update: $Author$
! Update Date: $Date$
! Source File: $Source$
! CVS/RCS Revision: $Revision$
! Status: $State$
! */
!
! #include "pglistboxbaseitem.h"
! #include "pglistbox.h"
! #include "pglog.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;
! my_hover = false;
! my_itemheight = height;
!
! SetAlignment(PG_TA_LEFT);
! }
!
! PG_ListBoxBaseItem::~PG_ListBoxBaseItem() {
! if(GetParent()->GetSelectedItem() == this) {
! GetParent()->SelectItem(NULL);
! GetParent()->RemoveWidget(this, true, true);
! }
! }
!
! void PG_ListBoxBaseItem::SetUserData(void* userdata) {
! my_userdata = userdata;
! }
!
! void* PG_ListBoxBaseItem::GetUserData() {
! return my_userdata;
! }
!
! bool PG_ListBoxBaseItem::IsSelected() {
! return my_selected;
! }
!
! void PG_ListBoxBaseItem::Select(bool select) {
! my_selected = select;
!
! if(GetParent() != NULL) {
! if(select) {
! GetParent()->SelectItem(this);
! }
! }
! }
!
! int PG_ListBoxBaseItem::Height() {
! return my_itemheight;
! }
!
! void PG_ListBoxBaseItem::eventSizeWidget(Uint16 w, Uint16 h) {
! my_itemheight = h;
! }
!
! void PG_ListBoxBaseItem::eventMouseEnter() {
! my_hover = true;
! Update();
! }
!
! void PG_ListBoxBaseItem::eventMouseLeave() {
! my_hover = false;
! PG_Label::eventMouseLeave();
! Update();
! }
!
! void PG_ListBoxBaseItem::eventHide() {
! my_hover = false;
! }
!
! bool PG_ListBoxBaseItem::eventMouseButtonUp (const SDL_MouseButtonEvent*
button) {
!
! if(button->button != 1) {
! return false;
! }
!
! if(GetParent() == NULL) {
! return true;
! }
!
! if(GetParent()->GetMultiSelect()) {
! Select(!IsSelected());
! } else {
! Select(true);
! }
!
! return true;
! }
!
! PG_ListBox* PG_ListBoxBaseItem::GetParent() {
! return (PG_ListBox*)(PG_Label::GetParent());
! }
--- 1,115 ----
! /*
! ParaGUI - crossplatform widgetset
! Copyright (C) 2000,2001,2002 Alexander Pipelka
!
! This library is free software; you can redistribute it and/or
! modify it under the terms of the GNU Library General Public
! License as published by the Free Software Foundation; either
! version 2 of the License, or (at your option) any later version.
!
! This library is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! Library General Public License for more details.
!
! You should have received a copy of the GNU Library General Public
! License along with this library; if not, write to the Free
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
!
! Alexander Pipelka
! address@hidden
!
! Last Update: $Author$
! Update Date: $Date$
! Source File: $Source$
! CVS/RCS Revision: $Revision$
! Status: $State$
! */
!
! #include "pglistboxbaseitem.h"
! #include "pglistbox.h"
! #include "pglog.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;
! my_hover = false;
! my_itemheight = height;
!
! SetAlignment(PG_TA_LEFT);
! }
!
! PG_ListBoxBaseItem::~PG_ListBoxBaseItem() {
! if(GetParent()->GetSelectedItem() == this) {
! GetParent()->SelectItem(NULL);
! GetParent()->RemoveWidget(this, true, true);
! }
! }
!
! void PG_ListBoxBaseItem::SetUserData(void* userdata) {
! my_userdata = userdata;
! }
!
! void* PG_ListBoxBaseItem::GetUserData() {
! return my_userdata;
! }
!
! bool PG_ListBoxBaseItem::IsSelected() {
! return my_selected;
! }
!
! void PG_ListBoxBaseItem::Select(bool select) {
! my_selected = select;
!
! if(GetParent() != NULL) {
! if(select) {
! GetParent()->SelectItem(this);
! }
! }
! }
!
! int PG_ListBoxBaseItem::Height() {
! return my_itemheight;
! }
!
! void PG_ListBoxBaseItem::eventSizeWidget(Uint16 w, Uint16 h) {
! my_itemheight = h;
! }
!
! void PG_ListBoxBaseItem::eventMouseEnter() {
! my_hover = true;
! Update();
! }
!
! void PG_ListBoxBaseItem::eventMouseLeave() {
! my_hover = false;
! PG_Label::eventMouseLeave();
! Update();
! }
!
! void PG_ListBoxBaseItem::eventHide() {
! my_hover = false;
! }
!
! bool PG_ListBoxBaseItem::eventMouseButtonUp(const SDL_MouseButtonEvent*
button) {
!
! if(button->button != 1) {
! return false;
! }
!
! if(GetParent() == NULL) {
! return true;
! }
!
! if(GetParent()->GetMultiSelect()) {
! Select(!IsSelected());
! } else {
! Select(true);
! }
!
! return true;
! }
!
! PG_ListBox* PG_ListBoxBaseItem::GetParent() {
! return (PG_ListBox*)(PG_Label::GetParent());
! }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/widgets pglistboxbaseitem.cpp,1.3.6.3,1.3.6.4,
Alexander Pipelka <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui/include paraconfig.h,1.3.6.12,1.3.6.13 paraconfig_win32.h,1.1.1.1.6.6,1.1.1.1.6.7
- Next by Date:
[paragui-cvs] CVS: paragui/test paratest.dev,1.1.2.1,1.1.2.2
- Previous by thread:
[paragui-cvs] CVS: paragui/include paraconfig.h,1.3.6.12,1.3.6.13 paraconfig_win32.h,1.1.1.1.6.6,1.1.1.1.6.7
- Next by thread:
[paragui-cvs] CVS: paragui/test paratest.dev,1.1.2.1,1.1.2.2
- Index(es):