/* * Author: Andrew Mann * * Copyright (C) 2004 PlaneShift Team (info@planeshift.it, * http://www.planeshift.it) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation (version 2 of the License) * This program 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 General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #include #include "pawscollapsablewidget.h" #include "partview.h" #include "paws/pawsmanager.h" #include "paws/pawsbutton.h" #include "paws/pawsborder.h" pawsCollapsableWidget::pawsCollapsableWidget(PawsManager* manager ) :pawsWidget( manager ) { collapsed=false; collapsed_title="--EXPAND--"; expanded_title="--COLLAPSE--"; expand_collapse_button=NULL; organize_children=false; recalced_this_frame=true; } pawsCollapsableWidget::~pawsCollapsableWidget() { } bool pawsCollapsableWidget::Setup( iDocumentNode* node ) { csRef titlenode,subnode; titlenode = node->GetNode( "title" ); if ( titlenode ) { subnode=titlenode->GetNode("expanded"); if (subnode) SetExpandedTitle(subnode->GetAttributeValue("text")); subnode=titlenode->GetNode("collapsed"); if (subnode) SetCollapsedTitle(subnode->GetAttributeValue("text")); subnode=titlenode->GetNode("button"); if (subnode) { expand_collapse_button=(pawsButton *)windowManager->CreateWidget("pawsButton"); if (!expand_collapse_button->Load(subnode)) Error2("%s XML is defined incorrectly. Failed to parse