class interface STD_TEXTBOX

creation
   make (p: WINDOW)
      --  Create multiline edit control (text editor), no word wrap.

      require
         valid_parent: p /= Void

   make_wrapping (p: WINDOW)
      --  Create word wrapping multiline edit control.

      require
         valid: p /= Void

feature(s) from CONTROL
   --  Implementation

   self: CHILD_WINDOW
      --  Associated child window.


feature(s) from CONTROL
   --  Dialog box

   has_dialog_box: BOOLEAN
      --  Check if control has associated dialog box.


   dialog_box: DIALOG
      --  Associated dialog which holds the control.

      require
         has_dialog: has_dialog_box
      ensure
         valid: Result /= Void

feature(s) from CONTROL
   --  Control's font

   set_font (ft: FONT)
      --  Set control font.

      require
         valid_font: ft /= Void

feature(s) from CONTROL
   --  Position, independent

   indep_size: RECTANGLE
      --  Control size using dialog coordinates.

      ensure
         is_copy:  --  can be modified.

   indep_set_size (sz: RECTANGLE)
      --  Set control size using dialog coordinates.

      require
         valid: sz /= Void
      ensure
         done: sz.is_equal(indep_size)

feature(s) from STRINGBOX
   editstring: STRING
      --  Edited string.

      ensure
         plain: editstring /= Void

   set_editstring (s: STRING)
      --  Change editable string.

      require
         valid_string: s /= Void
      ensure
         contents_set: editstring.is_equal(s)

feature(s) from STRINGBOX
   set_command (gc: GUI_COMMAND)
      --  Set when_changed command.

      require
         nothing:  --  Void means no command
      ensure
         keep_reference: command = gc

feature(s) from CLIPBOARD_OBJECT
   has_selection: BOOLEAN
      --  Current clipboard selection.


   cut_selection
      --  Cut selection.

      require
         has_selection: has_selection

   copy_selection
      --  Copy current selection.

      require
         has_selection: has_selection

   paste_clipboard
      --  Paste clipboard to object.

      ensure
         has_selection: has_selection

   delete_selection
      --  Delete selection.

      require
         has_selection: has_selection

   select_all
      --  Select everything.


feature(s) from DIALOG_ELEMENT
   --  Device independent positioning

   indep_set_point (p: POINT)
      --  Set upper-left point of element using device independent units.

      require
         valid_point: p /= Void

   indep_set_width (wi: INTEGER)
      --  Set element's width using device independent units.

      require
         valid: wi >= 0

   indep_set_height (he: INTEGER)
      --  Set element's height using device independent units.

      require
         valid: he >= 0

feature(s) from DIALOG_ELEMENT
   --  Relative positioning

   place_right (other: DIALOG_ELEMENT)
      --  Place the current element to the right of other.

      require
         valid_other: other /= Void

   place_left (other: DIALOG_ELEMENT)
      --  Place the current element to the left of other.

      require
         valid_other: other /= Void

   place_above (other: DIALOG_ELEMENT)
      --  Place the current element above other.

      require
         valid_other: other /= Void

   place_under (other: DIALOG_ELEMENT)
      --  Place the current element under other.

      require
         valid_other: other /= Void

   place_just_under (other: DIALOG_ELEMENT)
      --  Place the current element exactly under 'other'.


   same_width (other: DIALOG_ELEMENT)
      --  Set the current element width to other's.

      require
         valid_other: other /= Void

   same_height (other: DIALOG_ELEMENT)
      --  Set the current element height to be the same as other's.

      require
         valid_other: other /= Void

   align_left (other: DIALOG_ELEMENT)
      --  Align left side of this element with the 
      --  left side of other.

      require
         ok: other /= Void

   align_right (other: DIALOG_ELEMENT)
      --  Align the right side of this element with the right 
      --  side of other.

      require
         ok: other /= Void

   align_top (other: DIALOG_ELEMENT)
      --  Align the top of this element with top of other.

      require
         ok: other /= Void

   align_bottom (other: DIALOG_ELEMENT)
      --  Align the bottom of this element with bottom of other.

      require
         ok: other /= Void

feature(s) from TEXTBOX
   --  Contents

   contents: DS_LIST[STRING]
      --  Text.

      ensure
         not_void: contents /= Void; --  copy of contents
         is_copy: 

   set_contents (c: DS_LIST[STRING])
      --  Change editable text.

      require
         valid_contents: c /= Void
      ensure
         coherent: c.is_equal(contents) --  logical copy only

feature(s) from STD_TEXTBOX
   --  Actions

   is_undo_possible: BOOLEAN
      --  Is there something that can be undone?


   undo
      --  Undo last user action.

      require
         undoable: is_undo_possible

   is_wrapped: BOOLEAN
      --  Is text being wrapped?


   modified: BOOLEAN
      --  Has the text been modified (since last call to set_contents
      --  or reset_modified).


   reset_modified
      --  Reset modified flag.

      ensure
         reset: modified = false


end of STD_TEXTBOX