home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / textedit.h < prev    next >
C/C++ Source or Header  |  1995-04-08  |  3KB  |  108 lines

  1.  
  2.  
  3.  
  4.  
  5. #ifndef _textedit_h_ /* Wed Sep 28 08:01:23 1994 */
  6. #define _textedit_h_
  7.  
  8.  
  9.  
  10.  
  11. /*
  12.  *
  13.  *          Copyright (C) 1994, M. A. Sridhar
  14.  *  
  15.  *
  16.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  17.  *     to copy, modify or distribute this software  as you see fit,
  18.  *     and to use  it  for  any  purpose, provided   this copyright
  19.  *     notice and the following   disclaimer are included  with all
  20.  *     copies.
  21.  *
  22.  *                        DISCLAIMER
  23.  *
  24.  *     The author makes no warranties, either expressed or implied,
  25.  *     with respect  to  this  software, its  quality, performance,
  26.  *     merchantability, or fitness for any particular purpose. This
  27.  *     software is distributed  AS IS.  The  user of this  software
  28.  *     assumes all risks  as to its quality  and performance. In no
  29.  *     event shall the author be liable for any direct, indirect or
  30.  *     consequential damages, even if the  author has been  advised
  31.  *     as to the possibility of such damages.
  32.  *
  33.  */
  34.  
  35.  
  36.  
  37.  
  38.  
  39. // This SimpleVObject  is designed to support  the  editing of a multi-line
  40. // block  of   text  contained  in   its  model,  which   is  a  {\small\tt
  41. // CL_String}. The  selection  on the model  is  a {\small\tt CL_Interval},
  42. // i.e.,   the  positions of  the   left and  right  ends  of the substring
  43. // currently selected.
  44.  
  45.  
  46. #if defined(__GNUC__)
  47. #pragma interface
  48. #endif
  49.  
  50.  
  51. #include "ui/stred.h"
  52.  
  53.  
  54. class CL_EXPORT UI_TextEditor: public UI_StringEditor {
  55.  
  56. public:
  57.  
  58.     //
  59.     // Construction:
  60.     //
  61.  
  62.     UI_TextEditor (UI_CompositeVObject* parent, const UI_Rectangle& shape,
  63.                    UI_ViewID id = -1);
  64.  
  65. #if defined(__MS_WINDOWS__)
  66.     UI_TextEditor (UI_CompositeVObject* parent, UI_ViewID id,
  67.                    UI_ViewHandle h); 
  68.     // Resource-based construction: only under MS-Windows
  69.  
  70. #endif
  71.  
  72.     CL_Interval& Selection ();
  73.     // Return a {\tt CL_Interval} containing the range of positions
  74.     // selected. Modifying the return value causes a corresponding setting
  75.     // of selection in the displayed string.
  76.  
  77.     bool SetLengthLimit (long n);
  78.     // Make the TextEditor enforce a  limit user type-in to $n$
  79.     // characters.
  80.  
  81.     const char* ClassName() const {return "UI_TextEditor";};
  82.  
  83.     UI_WindowClass WindowClass () const;
  84.     
  85. #if defined(__OS2__)
  86.  
  87. private:
  88.  
  89.     virtual bool _SelectionChanged (CL_Object&, long);
  90.     // Called when the application modifies the return value of the
  91.     // Selection() method.
  92.  
  93. #elif defined (__X_MOTIF__)
  94.  
  95. protected:
  96.     void _SetupStyle (void* arg, short& argn);
  97.     // [X-Motif-specific. Internal use only]
  98.  
  99. #endif
  100.     
  101. };
  102.  
  103.  
  104.  
  105.  
  106.  
  107. #endif /* _textedit_h_ */
  108.