My Project
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 #pragma once 00029 #include "Define.h" 00030 #include <string> 00031 #include "Config.h" 00032 #include "BaseObject.h" 00033 #include "ParameterBase.h" 00034 #include "ParameterInteger.h" 00035 #include "ParameterPoint.h" 00036 00037 namespace SallyAPI 00038 { 00039 namespace GUI 00040 { 00049 00050 class DLL_API_SALLY CGUIBaseObject 00051 : public SallyAPI::Core::CBaseObject 00052 { 00053 protected: 00054 CRITICAL_SECTION m_critSectLockRender; 00055 std::string m_strText; 00056 float m_fTimeDelta; 00057 00058 SallyAPI::GUI::CGUIBaseObject* m_pParent; 00059 00060 bool m_bUpdateRequested; 00061 int m_iX; 00062 int m_iY; 00063 int m_iXAbsolut; 00064 int m_iYAbsolut; 00065 int m_iWidth; 00066 int m_iHeight; 00067 int m_iAlphaBlending; 00068 float m_fAngleY; 00069 float m_fAngleX; 00070 float m_fAngleZ; 00071 00072 void DrawImage(int gui, int x, int y); 00073 void DrawImagePart(int gui, int x, int y, int srcX, int srcY, int srcW, int srcH); 00074 void DrawImage(int gui, int x, int y, int width, int height); 00075 void EnterRenderLock(); 00076 void LeaveRenderLock(); 00077 00078 virtual void RenderControl() = 0; 00079 virtual void UpdateControl() = 0; 00080 00081 SallyAPI::GUI::CPicture* GetPicture(int gui); 00082 RECT GetImageRect(int gui); 00083 public: 00084 CGUIBaseObject(CGUIBaseObject* parent); 00085 virtual ~CGUIBaseObject(); 00086 00087 int GetWidth(); 00088 int GetHeight(); 00089 int GetPositionX(); 00090 int GetPositionY(); 00091 SallyAPI::GUI::CGUIBaseObject* GetParent(); 00092 00093 virtual void SetAlphaBlending(int alphaBlending); 00094 virtual int GetAlphaBlending(); 00095 00096 virtual void SetRotationAngleY(float angle); 00097 virtual float GetRotationAngleY(); 00098 00099 virtual void SetRotationAngleX(float angle); 00100 virtual float GetRotationAngleX(); 00101 00102 virtual void SetRotationAngleZ(float angle); 00103 virtual float GetRotationAngleZ(); 00104 00105 virtual void SetText(const std::string& text); 00106 virtual std::string GetText(); 00107 00108 virtual void GetAbsolutPosition(int* x, int* y); 00109 00110 virtual void SendMessageToParent(SallyAPI::GUI::CGUIBaseObject* reporter, int iReporterID, int iMessageID, SallyAPI::GUI::SendMessage::CParameterBase* messageParameter = NULL) = 0; 00111 virtual void SendMessageToChilds(SallyAPI::GUI::CGUIBaseObject* reporter, int iReporterID, int iMessageID, SallyAPI::GUI::SendMessage::CParameterBase* messageParameter = NULL) = 0; 00112 virtual void Timer(float timeDelta); 00113 00114 virtual void Render(); 00115 virtual void Update(); 00116 }; 00117 } 00118 }