Planeshift
|
00001 /* 00002 * pawstabwindow.h - Author: Andrew Dai 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 #ifndef PAWS_TAB_WINDOW 00020 #define PAWS_TAB_WINDOW 00021 00022 #include "pawswidget.h" 00023 #include "pawsbutton.h" 00024 00033 class pawsTabWindow : public pawsWidget 00034 { 00035 public: 00036 pawsTabWindow() 00037 { 00038 factory = "pawsTabWindow"; 00039 } 00040 pawsTabWindow(const pawsTabWindow &origin); 00041 virtual bool PostSetup(); 00042 00043 virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget); 00044 00045 void SetTab(int id); 00046 void SetTab(const csString &name); 00047 00048 pawsWidget* GetActiveTab() 00049 { 00050 return activeTab; 00051 } 00052 00053 bool FlashButtonFor(pawsWidget* widget) 00054 { 00055 if(!widget->IsVisible()) 00056 { 00057 pawsButton* button = dynamic_cast<pawsButton*>(FindWidget(widget->GetID() - 100)); 00058 if(!button) 00059 return false; 00060 button->Flash(true, FLASH_HIGHLIGHT); 00061 return true; 00062 } 00063 return false; 00064 } 00065 00066 protected: 00067 pawsWidget* activeTab; 00068 pawsButton* lastButton; 00069 00070 }; 00071 00072 CREATE_PAWS_FACTORY(pawsTabWindow); 00073 00076 #endif