Source code of Windows XP (NT5)
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.

325 lines
8.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. bltedit.hxx
  7. BLT text control class definitions
  8. FILE HISTORY:
  9. beng 17-Sep-1991 Separated from bltctrl.hxx
  10. beng 17-Oct-1991 Relocated SLT_PLUS to applib
  11. thomaspa 21-Jan-1992 Added validate to SLE
  12. thomaspa 13-Feb-1992 Moved validation from SLE to ICANON_SLE
  13. */
  14. #ifndef _BLT_HXX_
  15. #error "Don't include this file directly; instead, include it through blt.hxx"
  16. #endif // _BLT_HXX_
  17. #ifndef _BLTEDIT_HXX_
  18. #define _BLTEDIT_HXX_
  19. #include "bltctrl.hxx"
  20. /**********************************************************************
  21. NAME: TEXT_CONTROL
  22. SYNOPSIS: Text control class
  23. INTERFACE:
  24. TEXT_CONTROL() - constructor
  25. PARENT: CONTROL_WINDOW
  26. USES:
  27. CAVEATS:
  28. NOTES:
  29. HISTORY:
  30. rustanl 20-Nov-90 Creation
  31. **********************************************************************/
  32. DLL_CLASS TEXT_CONTROL : public CONTROL_WINDOW
  33. {
  34. public:
  35. TEXT_CONTROL( OWNER_WINDOW * powin, CID cid );
  36. TEXT_CONTROL( OWNER_WINDOW * powin, CID cid,
  37. XYPOINT xy, XYDIMENSION dxy,
  38. ULONG flStyle, const TCHAR * pszClassName );
  39. };
  40. /**********************************************************************
  41. NAME: STATIC_TEXT_CONTROL
  42. SYNOPSIS: Static text control class
  43. INTERFACE:
  44. STATIC_TEXT_CONTROL() - constructor.
  45. PARENT: TEXT_CONTROL
  46. HISTORY:
  47. rustanl 20-Nov-90 Creation
  48. **********************************************************************/
  49. DLL_CLASS STATIC_TEXT_CONTROL : public TEXT_CONTROL
  50. {
  51. public:
  52. STATIC_TEXT_CONTROL( OWNER_WINDOW * powin, CID cid );
  53. STATIC_TEXT_CONTROL( OWNER_WINDOW * powin, CID cid,
  54. XYPOINT xy, XYDIMENSION dxy,
  55. ULONG flStyle,
  56. const TCHAR * pszClassName = CW_CLASS_STATIC );
  57. };
  58. /**********************************************************************
  59. NAME: SLT
  60. SYNOPSIS: Single line text class
  61. INTERFACE:
  62. SLT() - constructor
  63. PARENT: STATIC_TEXT_CONTROL
  64. HISTORY:
  65. rustanl 20-Nov-90 Creation
  66. KeithMo 27-Aug-1992 Added CONTROL_VALUE methods.
  67. **********************************************************************/
  68. DLL_CLASS SLT : public STATIC_TEXT_CONTROL
  69. {
  70. private:
  71. BOOL _fSavedEnableState;
  72. protected:
  73. virtual VOID SaveValue( BOOL fInvisible = TRUE );
  74. virtual VOID RestoreValue( BOOL fInvisible = TRUE );
  75. public:
  76. SLT( OWNER_WINDOW * powin, CID cid );
  77. SLT( OWNER_WINDOW * powin, CID cid,
  78. XYPOINT xy, XYDIMENSION dxy,
  79. ULONG flStyle,
  80. const TCHAR * pszClassName = CW_CLASS_STATIC );
  81. };
  82. /**********************************************************************
  83. NAME: MLT
  84. SYNOPSIS: multi-line static text control class
  85. INTERFACE:
  86. MLT() - mlt constructor.
  87. PARENT: STATIC_TEXT_CONTROL
  88. HISTORY:
  89. rustanl 20-Nov-90 Creation
  90. beng 17-May-1991 Added app-window constructor
  91. **********************************************************************/
  92. DLL_CLASS MLT : public STATIC_TEXT_CONTROL
  93. {
  94. public:
  95. MLT( OWNER_WINDOW * powin, CID cid );
  96. MLT( OWNER_WINDOW * powin, CID cid,
  97. XYPOINT xy, XYDIMENSION dxy,
  98. ULONG flStyle, const TCHAR * pszClassName = CW_CLASS_EDIT );
  99. };
  100. /*********************************************************************
  101. NAME: EDIT_CONTROL
  102. SYNOPSIS: Edit control class
  103. INTERFACE:
  104. EDIT_CONTROL() - constructor
  105. SetMaxLength() - set the max input string length (in TCHAR)
  106. SelectString() - select the entire edit string
  107. PARENT: TEXT_CONTROL
  108. USES: NLS_STR
  109. HISTORY:
  110. rustanl 20-Nov-90 Creation
  111. beng 17-May-1991 Added app-window constructor
  112. beng 31-Jul-1991 Renamed QMessageInto to QEventEffects
  113. beng 04-Oct-1991 Win32 conversion
  114. **********************************************************************/
  115. DLL_CLASS EDIT_CONTROL : public TEXT_CONTROL
  116. {
  117. private:
  118. /* _nlsSaveValue saves the value contained in the edit control when
  119. * SaveValue is called. It is emptied when RestoreValue is called.
  120. */
  121. NLS_STR _nlsSaveValue;
  122. protected:
  123. virtual UINT QueryEventEffects( const CONTROL_EVENT & e );
  124. /* Redefine CONTROL_VALUE defaults.
  125. */
  126. virtual VOID SaveValue( BOOL fInvisible = TRUE ) ;
  127. virtual VOID RestoreValue( BOOL fInvisible = TRUE ) ;
  128. virtual VOID SetControlValueFocus();
  129. public:
  130. EDIT_CONTROL( OWNER_WINDOW * powin, CID cid, UINT cchMaxLen = 0 );
  131. EDIT_CONTROL( OWNER_WINDOW * powin, CID cid,
  132. XYPOINT xy, XYDIMENSION dxy,
  133. ULONG flStyle, const TCHAR * pszClassName = CW_CLASS_EDIT,
  134. UINT cchMaxLen = 0 );
  135. VOID SetMaxLength( UINT cchMax );
  136. VOID SelectString();
  137. APIERR SetSaveValue ( const TCHAR *pszSaveValue )
  138. { return _nlsSaveValue.CopyFrom( pszSaveValue ); }
  139. };
  140. /*********************************************************************
  141. NAME: SLE
  142. SYNOPSIS: single line edit class
  143. INTERFACE: SLE() - constructor.
  144. PARENT: EDIT_CONTROL
  145. HISTORY:
  146. rustanl 20-Nov-90 Creation
  147. beng 17-May-1991 Added app-window constructor
  148. beng 04-Oct-1991 Win32 conversion
  149. beng 01-Nov-1991 Added error-indication routine
  150. thomaspa 21-Jan-1992 Added validation
  151. thomaspa 13-Feb-1992 Moved validation from SLE to ICANON_SLE
  152. **********************************************************************/
  153. DLL_CLASS SLE : public EDIT_CONTROL
  154. {
  155. public:
  156. SLE( OWNER_WINDOW * powin,
  157. CID cid, UINT cchMaxLen = 0 );
  158. SLE( OWNER_WINDOW * powin, CID cid,
  159. XYPOINT xy, XYDIMENSION dxy,
  160. ULONG flStyle, const TCHAR * pszClassName = CW_CLASS_EDIT,
  161. UINT cchMaxLen = 0 );
  162. virtual VOID IndicateError( APIERR err );
  163. };
  164. /*********************************************************************
  165. NAME: MLE
  166. SYNOPSIS: Multi-line edit control
  167. INTERFACE: MLE() - constructor.
  168. PARENT: EDIT_CONTROL
  169. HISTORY:
  170. rustanl 20-Nov-90 Creation
  171. beng 17-May-1991 Added app-window constructor
  172. beng 04-Oct-1991 Win32 conversion
  173. **********************************************************************/
  174. DLL_CLASS MLE : public EDIT_CONTROL
  175. {
  176. public:
  177. MLE( OWNER_WINDOW * powin, CID cid, UINT cchMaxLen = 0 );
  178. MLE( OWNER_WINDOW * powin, CID cid,
  179. XYPOINT xy, XYDIMENSION dxy,
  180. ULONG flStyle, const TCHAR * pszClassName = CW_CLASS_EDIT,
  181. UINT cchMaxLen = 0 );
  182. VOID SetFmtLines( BOOL fFmtLines = TRUE )
  183. { Command( EM_FMTLINES, fFmtLines ); }
  184. };
  185. /*********************************************************************
  186. NAME: PASSWORD_CONTROL
  187. SYNOPSIS: password control class
  188. INTERFACE:
  189. PASSWORD_CONTROL() - constructor
  190. PARENT: EDIT_CONTROL
  191. HISTORY:
  192. rustanl 20-Nov-90 Creation
  193. beng 17-May-1991 Added app-window constructor
  194. beng 04-Oct-1991 Win32 conversion
  195. **********************************************************************/
  196. DLL_CLASS PASSWORD_CONTROL : public EDIT_CONTROL
  197. {
  198. public:
  199. PASSWORD_CONTROL( OWNER_WINDOW * powin, CID cid, UINT cchMaxLen = 0 );
  200. PASSWORD_CONTROL( OWNER_WINDOW * powin, CID cid,
  201. XYPOINT xy, XYDIMENSION dxy,
  202. ULONG flStyle, const TCHAR * pszClassName = CW_CLASS_EDIT,
  203. UINT cchMaxLen = 0 );
  204. };
  205. /**********************************************************************
  206. NAME: BLT_BACKGROUND_EDIT
  207. SYNOPSIS: Disabled edit control with COLOR_WINDOW background and a frame
  208. INTERFACE: BLT_BACKGROUND_EDIT() - constructor
  209. ~BLT_BACKGROUND_EDIT() - destructor
  210. PARENT: EDIT_CONTROL
  211. HISTORY:
  212. jonn 05-Sep-95 Created
  213. **********************************************************************/
  214. DLL_CLASS BLT_BACKGROUND_EDIT: public EDIT_CONTROL
  215. {
  216. public:
  217. BLT_BACKGROUND_EDIT( OWNER_WINDOW *powin, CID cid );
  218. ~BLT_BACKGROUND_EDIT();
  219. HBRUSH OnCtlColor( HDC hdc, HWND hwnd, UINT * pmsgid );
  220. };
  221. #endif // _BLTEDIT_HXX_ - end of file