Planeshift

pawsmeterpromptwindow.h

Go to the documentation of this file.
00001 /*
00002  * pawsmeterpromptwindow.h, Author: Andrea Rizzi <[email protected]>
00003  *
00004  * Copyright (C) 2001-2011 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_MUSIC_METER_PROMPT_H
00021 #define PAWS_MUSIC_METER_PROMPT_H
00022 
00023 
00024 //====================================================================================
00025 // Local Includes
00026 //====================================================================================
00027 #include "pawspromptwindow.h"
00028 
00029 //------------------------------------------------------------------------------------
00030 // Forward Declarations
00031 //------------------------------------------------------------------------------------
00032 class pawsTextBox;
00033 class pawsComboBox;
00034 class pawsEditTextBox;
00035 
00043 class iOnMeterEnteredListener
00044 {
00045 public:
00052     virtual void OnMeterEntered(const char* name, csString beats, csString beatType) = 0;
00053 };
00054 
00055 //---------------------------------------------------------------------------------------------
00056 
00060 class pawsMeterInput: public pawsWidget
00061 {
00062 public:
00066     pawsMeterInput();
00067 
00072     pawsMeterInput(const pawsMeterInput &origin);
00073 
00080     void Initialize(const char* initialBeats, const char* initialBeatType, size_t beatsMaxLength);
00081 
00086     const char* GetBeats();
00087 
00092     csString GetBeatType();
00093 
00094 private:
00095     pawsTextBox* beatsLabel;        
00096     pawsTextBox* beatTypeLabel;     
00097     pawsEditTextBox* beatsInput;    
00098     pawsComboBox* beatTypeInput;    
00099 };
00100 
00101 CREATE_PAWS_FACTORY(pawsMeterInput);
00102 
00103 //---------------------------------------------------------------------------------------------
00104 
00108 class pawsMeterPromptWindow: public pawsPromptWindow
00109 {
00110 public:
00114     pawsMeterPromptWindow();
00115 
00120     pawsMeterPromptWindow(const pawsMeterPromptWindow &origin);
00121 
00131     void Initialize(const char* actionName, const char* title, const char* initialBeats,
00132                     const char* initialBeatType, size_t beatsMaxLength, iOnMeterEnteredListener* listener);
00133 
00134     // From pawsWidget
00135     //-----------------
00136     virtual bool PostSetup();
00137     virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
00138 
00148     static pawsMeterPromptWindow* Create(const char* actionName, const char* initialBeats,
00149                                          const char* initialBeatType, size_t beatsMaxLength, iOnMeterEnteredListener* listener);
00150 
00151 private:
00152     csString actionName;                        
00153     iOnMeterEnteredListener* meterListener;     
00154 };
00155 
00156 CREATE_PAWS_FACTORY(pawsMeterPromptWindow);
00157 
00160 #endif // PAWS_MUSIC_METER_PROMPT_H