/* * 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. * */ #ifndef PAWS_COLLAPSABLE_WIDGET #define PAWS_COLLAPSABLE_WIDGET #include "paws/pawswidget.h" class pawsButton; class pawsCollapsableWidget : public pawsWidget { public: pawsCollapsableWidget(PawsManager* manager); virtual ~pawsCollapsableWidget(); // implemented virtual functions from pawsWidgets virtual bool PostSetup(); virtual bool OnButtonPressed( int button, int keyModifier, pawsWidget* widget ); virtual bool Setup( iDocumentNode* node ); virtual csRect ScreenFrame(); virtual void OrganizeChildren(); virtual void BringToTop( pawsWidget* widget ); virtual void Collapse(); virtual void Expand(); virtual void SetCollapsedTitle(const char *c_title); virtual void SetExpandedTitle(const char *c_title); virtual void DrawChildren(); protected: pawsButton *expand_collapse_button; bool collapsed; int uncollapsed_height; csString collapsed_title,expanded_title; bool organize_children; bool recalced_this_frame; }; CREATE_PAWS_FACTORY( pawsCollapsableWidget ); #endif // #ifndef COLLAPSABLE_WIDGET