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.

63 lines
1.6 KiB

  1. /*
  2. * Selector
  3. */
  4. #ifndef DUI_CONTROL_SELECTOR_H_INCLUDED
  5. #define DUI_CONTROL_SELECTOR_H_INCLUDED
  6. #pragma once
  7. namespace DirectUI
  8. {
  9. ////////////////////////////////////////////////////////
  10. // Selector
  11. // SelectionChange event
  12. struct SelectionChangeEvent : Event
  13. {
  14. Element* peOld;
  15. Element* peNew;
  16. };
  17. // Class definition
  18. class Selector : public Element
  19. {
  20. public:
  21. static HRESULT Create(OUT Element** ppElement);
  22. // Generic events
  23. virtual void OnEvent(Event* pEvent);
  24. // System events
  25. virtual void OnPropertyChanged(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  26. virtual void OnInput(InputEvent* pInput); // Routed and bubbled
  27. virtual void OnKeyFocusMoved(Element *peFrom, Element *peTo);
  28. // Hierarchy
  29. virtual Element* GetAdjacent(Element* peFrom, int iNavDir, NavReference const* pnr, bool bKeyable);
  30. // Event types
  31. static UID SelectionChange;
  32. // Property definitions
  33. static PropertyInfo* SelectionProp;
  34. // Quick property accessors
  35. Element* GetSelection() DUIQuickGetter(Element*, GetElement(), Selection, Specified)
  36. HRESULT SetSelection(Element* v) DUIQuickSetter(CreateElementRef(v), Selection)
  37. // ClassInfo accessors (static and virtual instance-based)
  38. static IClassInfo* Class;
  39. virtual IClassInfo* GetClassInfo() { return Class; }
  40. static HRESULT Register();
  41. Selector() { }
  42. HRESULT Initialize() { return Element::Initialize(0); }
  43. virtual ~Selector() { }
  44. };
  45. } // namespace DirectUI
  46. #endif // DUI_CONTROL_SELECTOR_H_INCLUDED