Planeshift

pawstitle.h

Go to the documentation of this file.
00001 /*
00002 * pawstitle.h
00003 *
00004 * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005 *
00006 *
00007 * This program is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU General Public License
00009 * as published by the Free Software Foundation (version 2 of the License)
00010 * This program is distributed in the hope that it will be useful,
00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 * GNU General Public License for more details.
00014 * You should have received a copy of the GNU General Public License
00015 * along with this program; if not, write to the Free Software
00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 *
00018 */
00019 
00020 #ifndef PAWS_TITLE_HEADER
00021 #define PAWS_TITLE_HEADER
00022 
00023 #include "pawsbutton.h"
00024 
00029 class pawsTitle : public pawsWidget
00030 {
00031 private:
00032     enum PAWS_TITLE_ALIGN
00033     {
00034         PTA_LEFT = 0,
00035         PTA_CENTER,
00036         PTA_RIGHT,
00037 
00038         PTA_COUNT
00039     };
00040 
00041     struct pawsTitleButton
00042     {
00043         char             widgetName[64];
00044         pawsWidget*      buttonWidget;
00045         PAWS_TITLE_ALIGN align;
00046         int              offsetx;
00047         int              offsety;
00048     };
00049     csArray<pawsTitleButton> titleButtons;
00050 
00051     PAWS_TITLE_ALIGN titleAlign;
00052     bool             scaleWidth;
00053     float            width;
00054     int              height;
00055     csString         text;
00056     int              textOffsetx;
00057     int              textOffsety;
00058     PAWS_TITLE_ALIGN textAlign;
00059 
00060     PAWS_TITLE_ALIGN GetAlign(const char* alignText);
00061 
00062 public:
00063     pawsTitle(pawsWidget* parent, iDocumentNode* node);
00064 
00065     pawsTitle(const pawsTitle &origin);
00066 
00067     virtual ~pawsTitle();
00068 
00069     bool Setup(iDocumentNode* node);
00070     bool PostSetup();
00071     void SetWindowRect(const csRect &windowRect);
00072     void Draw();
00073 
00074     void Resize() {}
00075     void MoveDelta(int /*dx*/, int /*dy*/) {}
00076     void MoveTo(int /*x*/, int /*y*/) {}
00077 };
00078 
00081 #endif // PAWS_TITLE_HEADER