00001 #include "stdafx.h" 00002 #include "GUIElementSettings.h" 00003 00004 GUIElementSettings::GUIElementSettings() 00005 { 00006 m_strElementType = "Element"; 00007 m_bVisible = true; 00008 m_bRestrictMoveX = m_bRestrictMoveY = m_bRestrictSizeX = m_bRestrictSizeY = false; 00009 00010 #ifndef GUI_USE_ACTIVE_INACTIVE 00011 m_MaterialAmbient = RGB(255, 255, 255); 00012 m_MaterialDiffuse = m_MaterialAmbient; 00013 m_MaterialSpecular = m_MaterialAmbient; 00014 m_MaterialEmissive = m_MaterialAmbient; 00015 m_iMaterialShininess = 255; 00016 m_iMaterialIndex = 0; 00017 #elif 00018 m_ActiveColor = RGB(190, 190, 178); 00019 m_InactiveColor = RGB(150, 150, 168); 00020 #endif 00021 00022 } 00023 00024 GUIElementSettings::~GUIElementSettings() 00025 { 00026 00027 } 00028 00029 void GUIElementSettings::GetProperties( EPropList& PropList ) 00030 { 00031 PropList.AddTab("Properties"); 00032 PropList.AddPropSeparator(this, "Element"); 00033 PropList.AddPropString(this, "Name", &m_strName, true)->SetComment("Element' name"); 00034 PropList.AddPropInt(this, "ID", &m_iID, "Default", false)->SetComment("Auto assigned Unique ID"); 00035 PropList.AddPropString(this, "Type", &m_strElementType, false)->SetComment("Element Type"); 00036 PropList.AddPropInt(this, "Children", &m_iChildren, "0", false)->SetComment("Children count"); 00037 PropList.AddPropString(this, "Rectangle", &m_strRectangle, true)->SetComment("Element' Rectangle - Left, Right, Top, Bottom"); 00038 PropList.AddPropCheck(this, "Visible", &m_bVisible); 00039 00040 PropList.AddPropSeparator(this, "Flags"); 00041 PropList.AddPropCheck(this, "RMX", &m_bRestrictMoveX)->SetComment("Can the element be moved horizontally"); 00042 PropList.AddPropCheck(this, "RMY", &m_bRestrictMoveY)->SetComment("Can the element be moved vertically"); 00043 PropList.AddPropCheck(this, "RSX", &m_bRestrictSizeX)->SetComment("Can the element' width be changed"); 00044 PropList.AddPropCheck(this, "RSY", &m_bRestrictSizeY)->SetComment("Can the element' height be changed"); 00045 00046 #ifndef GUI_USE_ACTIVE_INACTIVE 00047 PropList.AddPropSeparator(this, "Material"); 00048 00049 EPropertyCombo *pMaterialCombo = PropList.AddPropCombo(this, "New Material", &m_iMaterialIndex); 00050 for (int i=0; i<CMaterialManager::GetSingleton().size(); i++) 00051 { 00052 CMaterial *pMaterial = (CMaterial *)CMaterialManager::GetSingleton().at(i); 00053 pMaterialCombo->AddString(pMaterial->GetName().c_str(), i + 1); 00054 } 00055 bool bExistingMaterial = false; 00056 if(m_iMaterialIndex > 0) 00057 bExistingMaterial = true; 00058 00059 PropList.AddPropColor(this, "Ambient", &m_MaterialAmbient, bExistingMaterial)->SetComment("Material' Ambient component"); 00060 PropList.AddPropColor(this, "Diffuse", &m_MaterialDiffuse, bExistingMaterial)->SetComment("Material' Diffuse component"); 00061 PropList.AddPropColor(this, "Specular", &m_MaterialSpecular, bExistingMaterial)->SetComment("Material' Specular component"); 00062 PropList.AddPropColor(this, "Emissive", &m_MaterialEmissive, bExistingMaterial)->SetComment("Material' Emissive component"); 00063 PropList.AddPropInt(this, "Shininess", &m_iMaterialShininess, "255", bExistingMaterial)->SetComment("Material' Shininess component"); 00064 #elif 00065 PropList.AddPropColor(this, "Active Color", m_ActiveColor)->SetComment("Element' Active Color"); 00066 PropList.AddPropColor(this, "Inactive Color", m_InactiveColor)->SetComment("Element' Inactive Color"); 00067 #endif 00068 00069 PropList.AddPropSeparator(this, "Texture"); 00070 PropList.AddPropString(this, "Name", &m_strTextureName, true); 00071 PropList.AddPropString(this, "Filename", &m_strTextureFilename); 00072 00073 PropList.StepIndentOut(); 00074 } 00075 00076 void GUIElementSettings::UpdateRect(CRect NewRect) 00077 { 00078 PropertyChanging(&m_strRectangle, &NewRect); 00079 } 00080 00081 bool GUIElementSettings::PropertyChanging( const void* pProperty , void* pNewValue ) 00082 { 00083 bool bChangeOK = true; 00084 00085 return bChangeOK; 00086 }