home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dho.zip / DHO / SRC / MLEDTEXT.CC < prev    next >
C/C++ Source or Header  |  1995-08-27  |  3KB  |  110 lines

  1. /****************************************/
  2. /*    Developer Helper Object Set       */
  3. /*  (C) 1994-95 Thomas E. Bednarz, Jr.  */
  4. /*     All rights reserved              */
  5. /***************************************/
  6.  
  7. /* $Id: mledtext.cc 1.3 1995/08/13 03:21:12 teb Exp $ */
  8.  
  9.  
  10. #include <mledtext.h>
  11.  
  12. //--------------------------------------------------------------
  13. //  TMultiLineEditText
  14. TMultiLineEditText::TMultiLineEditText(TWinBase *parent, ULONG resource):
  15.    TControl(parent, resource)
  16.  
  17. {
  18.    
  19. }
  20.  
  21.  
  22. //--------------------------------------------------------------
  23. //  TMultiLineEditText
  24. TMultiLineEditText::TMultiLineEditText(TWinBase *parent, LONG x, LONG y, 
  25.                          LONG cx, LONG cy, MultiLineEditTxtAttr fMLEattr):
  26.    TControl(parent)
  27. {
  28.    ULONG style = WS_VISIBLE;
  29.  
  30.    if (fMLEattr.Border)
  31.       style |= MLS_BORDER;
  32.    if (fMLEattr.horizScroll)
  33.       style |= MLS_HSCROLL;
  34.    if (fMLEattr.vertScroll)
  35.       style |= MLS_VSCROLL;
  36.    if (fMLEattr.ignoreTab)
  37.       style |= MLS_IGNORETAB;
  38.    if (fMLEattr.wordWrap)
  39.       style |= MLS_WORDWRAP;
  40.    if (fMLEattr.readOnly)
  41.       style |= MLS_READONLY;
  42.  
  43.    hwndControl = WinCreateWindow(
  44.              parent->getHWND(),
  45.              WC_MLE,
  46.              (PSZ)NULL,
  47.              style,
  48.              x,y, cx, cy,
  49.              parent->getHWND(), 
  50.              HWND_TOP, 
  51.              0,             
  52.              NULL, NULL);
  53. }
  54.  
  55.  
  56.  
  57. //--------------------------------------------------------------
  58. //  ~TMultiLineEditText
  59. TMultiLineEditText::~TMultiLineEditText()
  60. {
  61.  
  62. }
  63.  
  64.  
  65.  
  66. //--------------------------------------------------------------
  67. //   getClassName
  68. const char *TMultiLineEditText::getClassName()
  69. {
  70.    return "TMultiLineEditText";
  71. }
  72.  
  73.  
  74.  
  75. //--------------------------------------------------------------
  76. //  getControlText
  77. void TMultiLineEditText::getControlText(PCH buff, ULONG buf_len)
  78. {
  79.    IPT offset = 0;
  80.    WinSendMsg(hwndControl, MLM_EXPORT,
  81.               MPFROMP(&offset), MPFROMP(buf_len));
  82. }
  83.  
  84.  
  85. //--------------------------------------------------------------
  86. // setControlText
  87. void TMultiLineEditText::setControlText(PCH text, ULONG bytes)
  88. {
  89.    IPT offset = 0;
  90.     WinSendMsg(hwndControl, MLM_IMPORT, 
  91.                MPFROMP(&offset), MPFROMP(&bytes));
  92. }
  93.  
  94.  
  95. //--------------------------------------------------------------
  96. //  getTextLength
  97. LONG TMultiLineEditText::getTextLength()
  98. {
  99.    return (LONG)WinSendMsg(hwndControl, MLM_QUERYFORMATTEXTLENGTH,
  100.               MPFROMLONG(0), MPFROMLONG((-1)));
  101. }
  102.  
  103.  
  104. //--------------------------------------------------------------
  105. //   showControl
  106. void TMultiLineEditText::showControl()
  107. {
  108.    WinShowWindow(hwndControl, TRUE);
  109. }
  110.