00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "CATGuiFactory.h"
00017 #include "CATResultCore.h"
00018
00019
00020 #include "CATSkin.h"
00021
00022
00023 #include "CATWindow.h"
00024
00025
00026 #include "CATControl.h"
00027 #include "CATButton.h"
00028 #include "CATAppButton.h"
00029 #include "CATSwitch.h"
00030 #include "CATSlider.h"
00031 #include "CATKnob.h"
00032 #include "CATLabel.h"
00033 #include "CATPicture.h"
00034 #include "CATEditBox.h"
00035 #include "CATListBox.h"
00036 #include "CATTreeCtrl.h"
00037 #include "CATProgress.h"
00038 #include "CATMenu.h"
00039 #include "CATLayer.h"
00040 #include "CATTab.h"
00041 #include "CATRadioButton.h"
00042 #include "CATComboBox.h"
00043 #include "CATSwitchMulti.h"
00044 #include "CATPictureMulti.h"
00045
00046
00047 CATGuiFactory::CATGuiFactory(const CATString& skinRoot, const CATString& skinPath)
00048 : CATXMLFactory()
00049 {
00050 fSkinRoot = skinRoot;
00051 fSkinPath = skinPath;
00052 }
00053
00054
00055 CATGuiFactory::~CATGuiFactory()
00056 {
00057 }
00058
00059
00060 CATXMLObject* CATGuiFactory::CreateObject( const CATWChar* objType)
00061 {
00062 CATXMLObject* newObject = 0;
00063
00064 if (wcscmp(objType, L"Skin" ) == 0 ) newObject = new CATSkin ( objType, fSkinRoot, fSkinPath);
00065 else if (wcscmp(objType, L"Window" ) == 0 ) newObject = new CATWindow ( objType, fSkinRoot);
00066 else if (wcscmp(objType, L"Button" ) == 0 ) newObject = new CATButton ( objType, fSkinRoot);
00067 else if (wcscmp(objType, L"Switch" ) == 0 ) newObject = new CATSwitch ( objType, fSkinRoot);
00068 else if (wcscmp(objType, L"SwitchMulti") == 0 ) newObject = new CATSwitchMulti ( objType, fSkinRoot);
00069 else if (wcscmp(objType, L"RadioButton") == 0 )newObject = new CATRadioButton ( objType, fSkinRoot);
00070 else if (wcscmp(objType, L"Slider" ) == 0 ) newObject = new CATSlider ( objType, fSkinRoot);
00071 else if (wcscmp(objType, L"Knob" ) == 0 ) newObject = new CATKnob ( objType, fSkinRoot);
00072 else if (wcscmp(objType, L"Label" ) == 0 ) newObject = new CATLabel ( objType, fSkinRoot);
00073 else if (wcscmp(objType, L"Picture" ) == 0 ) newObject = new CATPicture ( objType, fSkinRoot);
00074 else if (wcscmp(objType, L"PictureMulti" ) == 0 ) newObject = new CATPictureMulti ( objType, fSkinRoot);
00075 else if (wcscmp(objType, L"EditBox" ) == 0 ) newObject = new CATEditBox ( objType, fSkinRoot);
00076 else if (wcscmp(objType, L"ListBox" ) == 0 ) newObject = new CATListBox ( objType, fSkinRoot);
00077 else if (wcscmp(objType, L"Tree" ) == 0 ) newObject = new CATTreeCtrl( objType, fSkinRoot);
00078 else if (wcscmp(objType, L"Progress" ) == 0 ) newObject = new CATProgress( objType, fSkinRoot);
00079 else if (wcscmp(objType, L"Menu" ) == 0 ) newObject = new CATMenu ( objType, fSkinRoot);
00080 else if (wcscmp(objType, L"Layer" ) == 0 ) newObject = new CATLayer ( objType, fSkinRoot);
00081 else if (wcscmp(objType, L"Tab" ) == 0 ) newObject = new CATTab ( objType, fSkinRoot);
00082 else if (wcscmp(objType, L"ComboBox" ) == 0 ) newObject = new CATComboBox( objType, fSkinRoot);
00083 else if (wcscmp(objType, L"AppButton") == 0 ) newObject = new CATAppButton( objType, fSkinRoot);
00084 else
00085 {
00086 CATASSERT(false,"Unknown GUI type! Check the element name.");
00087 return new CATControl(objType, fSkinRoot);
00088 }
00089
00090 return newObject;
00091 }
00092