~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/gui/EditableWidget.hxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2013-06-28 09:53:13 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130628095313-j8jkkgxpvx1t18ym
Tags: 3.9-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: EditableWidget.hxx 2579 2013-01-04 19:49:01Z stephena $
 
17
// $Id: EditableWidget.hxx 2744 2013-05-29 16:45:18Z stephena $
18
18
//
19
19
//   Based on code from ScummVM - Scumm Interpreter
20
20
//   Copyright (C) 2002-2004 The ScummVM project
26
26
#include "Widget.hxx"
27
27
#include "Rect.hxx"
28
28
 
29
 
enum {
30
 
  kEditAcceptCmd  = 'EDac',
31
 
  kEditCancelCmd  = 'EDcl',
32
 
  kEditChangedCmd = 'EDch'
33
 
};
34
 
 
35
29
/**
36
30
 * Base class for widgets which need to edit text, like ListWidget and
37
31
 * EditTextWidget.
39
33
class EditableWidget : public Widget, public CommandSender
40
34
{
41
35
  public:
 
36
    enum {
 
37
      kAcceptCmd  = 'EDac',
 
38
      kCancelCmd  = 'EDcl',
 
39
      kChangedCmd = 'EDch'
 
40
    };
 
41
 
 
42
  public:
42
43
    EditableWidget(GuiObject *boss, const GUI::Font& font,
43
 
                   int x, int y, int w, int h);
 
44
                   int x, int y, int w, int h, const string& str = "");
44
45
    virtual ~EditableWidget();
45
46
 
46
 
    virtual void setEditString(const string& str, bool changed = false);
47
 
    virtual const string& getEditString() const { return _editString; }
 
47
    virtual void setText(const string& str, bool changed = false);
 
48
    virtual const string& getText() const { return _editString; }
48
49
 
49
50
    bool isEditable() const      { return _editable; }
50
51
    void setEditable(bool editable);