Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.1 KiB

  1. // edit.h
  2. //
  3. #ifndef DUI_CONTROL_EDIT_H_INCLUDED
  4. #define DUI_CONTROL_EDIT_H_INCLUDED
  5. #include "duihwndhost.h"
  6. namespace DirectUI
  7. {
  8. ////////////////////////////////////////////////////////
  9. // Edit
  10. // EditEnter event
  11. struct EditEnterEvent : Event
  12. {
  13. };
  14. // Class definition
  15. class Edit : public HWNDHost
  16. {
  17. public:
  18. static HRESULT Create(OUT Element** ppElement) { return Create(AE_MouseAndKeyboard, ppElement); }
  19. static HRESULT Create(UINT nActive, OUT Element** ppElement);
  20. // System events
  21. virtual void OnPropertyChanged(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  22. virtual void OnInput(InputEvent* pie);
  23. // Control notifications
  24. virtual bool OnNotify(UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT* plRet);
  25. virtual UINT MessageCallback(GMSG* pGMsg);
  26. // Rendering
  27. SIZE GetContentSize(int dConstW, int dConstH, Surface* psrf);
  28. // Event types
  29. static UID Enter;
  30. // Property definitions
  31. static PropertyInfo* MultilineProp;
  32. static PropertyInfo* PasswordCharacterProp;
  33. static PropertyInfo* DirtyProp;
  34. // Quick property accessors
  35. int GetPasswordCharacter() DUIQuickGetter(int, GetInt(), PasswordCharacter, Specified)
  36. bool GetMultiline() DUIQuickGetter(bool, GetBool(), Multiline, Specified)
  37. bool GetDirty() DUIQuickGetter(bool, GetBool(), Dirty, Specified)
  38. HRESULT SetPasswordCharacter(int v) DUIQuickSetter(CreateInt(v), PasswordCharacter)
  39. HRESULT SetMultiline(bool v) DUIQuickSetter(CreateBool(v), Multiline)
  40. HRESULT SetDirty(bool v);
  41. // ClassInfo accessors (static and virtual instance-based)
  42. static IClassInfo* Class;
  43. virtual IClassInfo* GetClassInfo() { return Class; }
  44. static HRESULT Register();
  45. Edit() { }
  46. virtual ~Edit() { }
  47. HRESULT Initialize(UINT nActive) { return HWNDHost::Initialize(HHC_CacheFont | HHC_SyncText | HHC_SyncPaint, nActive); }
  48. protected:
  49. virtual HWND CreateHWND(HWND hwndParent);
  50. };
  51. } // namespace DirectUI
  52. #endif // DUI_CONTROL_EDIT_H_INCLUDED