Planeshift

pawsconfigcamera.h

Go to the documentation of this file.
00001 /*
00002  * Author: Andrew Robberts
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 
00021 #ifndef PAWS_CONFIG_CAMERA_HEADER
00022 #define PAWS_CONFIG_CAMERA_HEADER
00023 
00024 // CS INCLUDES
00025 #include <csutil/array.h>
00026 
00027 // PAWS INCLUDES
00028 #include "paws/pawswidget.h"
00029 #include "paws/pawsbutton.h"
00030 #include "paws/pawstextbox.h"
00031 #include "pawsconfigwindow.h"
00032 
00033 class psCamera;
00034 
00036 //                        pawsConfigCamera
00038 
00039 
00040 class pawsConfigCamera : public pawsConfigSectionWindow
00041 {
00042 public:
00043     pawsConfigCamera();
00044     virtual ~pawsConfigCamera();
00045     
00046     // from pawsConfigSectionWindow:
00047     virtual bool Initialize();
00048     virtual bool LoadConfig();
00049     virtual bool SaveConfig();
00050     virtual void SetDefault();
00051 
00052      // from pawsWidget:
00053     virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
00054    
00055 protected:
00056 
00062     float GetCameraSetting(const csString& settingName, int mode) const;
00063 
00069     void SetCameraSetting(const csString& settingName, float value, int mode) const;
00070 
00074     void SaveConfigByTreeNodes(pawsTreeNode * subtreeRoot);
00075 
00079     bool CreateTree();
00080      
00081     // Adds widgets to all nodes in subtree with root 'subtreeRoot'
00082     //   -- command label, key combination label and button that opens FingeringWindow
00083     void CreateTreeWidgets(pawsTreeNode * subtreeRoot);
00084 
00085     // Sets all labels (in subtree with root 'subtreeRoot')
00086     void SetLabels(pawsTreeNode * subtreeRoot);
00087 
00091     void SetCameraValues(pawsTreeNode * subtreeRoot);
00092 
00093     float labelWidth;
00094     float inputWidth;
00095 
00096     pawsTree * tree;                    // the tree that makes whole window GUI
00097 };
00098 
00099 
00100 
00101 
00102 class pawsConfigCameraFactory : public pawsWidgetFactory
00103 {
00104 public:
00105     pawsConfigCameraFactory()
00106     {
00107         Register( "pawsConfigCamera" );
00108     }
00109     pawsWidget* Create()
00110     {
00111         return new pawsConfigCamera();
00112     }
00113 };
00114 
00115 
00116 
00117 #endif