ltguicyclectrl.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // LTGUICycleCtrl.h: interface for the CLTGUICycleCtrl class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_LTGUICYCLECTRL_H__7CA44FC0_12B5_11D3_B2DB_006097097C7B__INCLUDED_)
  5. #define AFX_LTGUICYCLECTRL_H__7CA44FC0_12B5_11D3_B2DB_006097097C7B__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "ltguitextitemctrl.h"
  10. class CLTGUICycleCtrl : public CLTGUITextItemCtrl
  11. {
  12. public:
  13. CLTGUICycleCtrl();
  14. virtual ~CLTGUICycleCtrl();
  15. // Create the control
  16. // pClientDE - Pointer to the client interface.
  17. // hText - The header text that is displayed for this control. Pass in LTNULL if you do not want header text.
  18. // pFont - The font to use for this control.
  19. // nHeaderWidth - The width to use for the header string
  20. // nSpacerWidth - The width to use for the space between the header and text
  21. // pnValue - Pointer to the value which receives the selection index when UpdateData is called.
  22. // alignment - Justification to use when rendering
  23. LTBOOL Create ( ILTClient *pClientDE, HSTRING hText, CLTGUIFont *pFont,
  24. int nHeaderWidth, int nSpacerWidth = 25, int *pnValue=LTNULL, int alignment = LTF_JUSTIFY_CENTER);
  25. //this function sets up a notification when the control's value changes
  26. virtual void NotifyOnChange(uint32 dwCommandID,CLTGUICommandHandler *pCommandHandler, uint32 dwParam1 = 0, uint32 dwParam2 = 0);
  27. //these overridden functions are needed to manage the notification
  28. virtual void SetSelIndex(int nIndex);
  29. virtual void UpdateData(LTBOOL bSaveAndValidate);
  30. // Render the control
  31. virtual void Render ( HSURFACE hDestSurf );
  32. virtual void CalculateSize();
  33. // Since cycle controls do not have command ID's or command handlers,
  34. // Enter should cycle through the strings, just like the arrow keys.
  35. virtual LTBOOL OnEnter ( ) { return OnRight(); }
  36. virtual LTBOOL OnLButtonUp(int x, int y) {return OnRight();}
  37. virtual LTBOOL OnRButtonUp(int x, int y) {return OnLeft();}
  38. protected:
  39. HSTRING m_hHeaderText;
  40. int m_nHeaderWidth;
  41. int m_nSpacerWidth;
  42. int m_nAlign;
  43. LTBOOL m_bInUpdate;
  44. };
  45. #endif // !defined(AFX_LTGUICYCLECTRL_H__7CA44FC0_12B5_11D3_B2DB_006097097C7B__INCLUDED_)