My Project
GUIIMEEditBox.h
1 #pragma once
2 #include "GUIEdit.h"
3 
4 #ifdef USE_DIRECTX_RENDERER
5 #include "GrowableArray.h"
6 #include "GUIIME.h"
7 
8 namespace ParaEngine
9 {
10  class CGUIBase;
11  struct TextureEntity;
12  struct AssetEntity;
13  struct GUIFontElement;
17  class CGUIIMEEditBox : public CGUIEditBox, public CGUIIME
18  {
19  public:
21  // implementation of IAttributeFields
22 
24  virtual int GetAttributeClassID(){return ATTRIBUTE_CLASSID_CGUIIMEEditBox;}
26  virtual const char* GetAttributeClassName(){static const char name[] = "CGUIIMEEditBox"; return name;}
28  virtual const char* GetAttributeClassDescription(){static const char desc[] = ""; return desc;}
30  virtual int InstallFields(CAttributeClass* pClass, bool bOverride);
31 
32  public:
33  CGUIIMEEditBox( );
34  virtual ~CGUIIMEEditBox();
35 
36  static void StaticInit();
37  virtual HRESULT Render(GUIState* pGUIState,float fElapsedTime );
38 
39  virtual bool MsgProc(MSG *event);
40  virtual void UpdateRects();
41  virtual bool OnFocusIn();
42  virtual bool OnFocusOut();
43  virtual void InitObject(const char * strObjectName, const char * alignment, int x, int y, int width, int height);
44 
45  virtual bool IsHideCaret();
46 
47  virtual void PostRender(GUIState *pGUIState, float fElapsedTime);
48  virtual void RenderCandidateReadingWindow( GUIState* pGUIState , bool bReading ,float fElapsedTime);
49  virtual void RenderComposition( GUIState* pGUIState ,float fElapsedTime );
50  virtual void RenderIndicator( GUIState* pGUIState ,float fElapsedTime );
51 
52  virtual IObject* Clone()const;
53  virtual void Clone(IObject *pobj)const;
54  virtual const IType* GetType()const{return m_type;}
55 
59  virtual bool FetchIMEString();
60 
61  void SendKey( BYTE nVirtKey );
62  protected:
63  static const IType* m_type;
64  // Color of various IME elements
65 // Color m_ReadingColor; // Reading string color
66  Color m_ReadingWinColor; // Reading window color
67 // Color m_ReadingSelColor; // Selected character in reading string
68  Color m_ReadingSelBkColor; // Background color for selected char in reading str
69 // Color m_CandidateColor; // Candidate string color
70  Color m_CandidateWinColor; // Candidate window color
71 // Color m_CandidateSelColor; // Selected candidate string color
72  Color m_CandidateSelBkColor; // Selected candidate background color
73 // Color m_CompColor; // Composition string color
74  Color m_CompWinColor; // Composition string window color
75  Color m_CompCaretColor; // Composition string caret color
76 // Color m_CompTargetColor; // Composition string target converted color
77  Color m_CompTargetBkColor; // Composition string target converted background
78 // Color m_CompTargetNonColor; // Composition string target non-converted color
79  Color m_CompTargetNonBkColor;// Composition string target non-converted background
80 // Color m_IndicatorImeColor; // Indicator text color for IME
81 // Color m_IndicatorEngColor; // Indicator text color for English
82  Color m_IndicatorBkColor; // Indicator text background color
83 
84  // Edit-control-specific data
85  int m_nIndicatorWidth; // Width of the indicator symbol
86  RECT m_rcIndicator; // Rectangle for drawing the indicator button
87  };
88 }
89 #else
90 namespace ParaEngine
91 {
92  class CGUIBase;
93  struct TextureEntity;
94  struct AssetEntity;
95  struct GUIFontElement;
99  class CGUIIMEEditBox : public CGUIEditBox
100  {
101  public:
103  // implementation of IAttributeFields
104 
106  virtual int GetAttributeClassID(){ return ATTRIBUTE_CLASSID_CGUIIMEEditBox; }
108  virtual const char* GetAttributeClassName(){ static const char name[] = "CGUIIMEEditBox"; return name; }
110  virtual const char* GetAttributeClassDescription(){ static const char desc[] = ""; return desc; }
111 
112  static void Initialize(){};
113  static void Uninitialize(){};
114  };
115 }
116 #endif
virtual const char * GetAttributeClassDescription()
a static string, describing the attribute class object
Definition: GUIIMEEditBox.h:110
static void StaticInit()
Initialize the event mapping for the default CGUIEdit class All its inheritances should have a Static...
Definition: GUIEdit.cpp:132
virtual bool MsgProc(MSG *event)
the procedure that handles all the events.
Definition: GUIEdit.cpp:896
virtual const char * GetAttributeClassName()
a static string, describing the attribute class object's name
Definition: GUIIMEEditBox.h:108
Definition: EventBinding.h:22
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ManagedDef.h:18
Definition: GUIEdit.h:17
virtual IObject * Clone() const
Clone the object's contains and return a pointer to the newly created object.
Definition: GUIEdit.cpp:125
virtual int GetAttributeClassID()
attribute class ID should be identical, unless one knows how overriding rules work.
Definition: GUIIMEEditBox.h:106
virtual bool IsHideCaret()
whether caret is hidden.
Definition: GUIEdit.h:131
virtual void UpdateRects()
Definition: GUIEdit.cpp:652
IME-enabled EditBox control.
Definition: GUIIMEEditBox.h:99
virtual int InstallFields(CAttributeClass *pClass, bool bOverride)
this class should be implemented if one wants to add new attribute.
Definition: GUIEdit.cpp:1925