~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to library/forms/winforms/wf_textentry.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; version 2 of the
 
7
 * License.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
17
 * 02110-1301  USA
 
18
 */
 
19
 
 
20
#ifndef _WF_TEXTENTRY_H_
 
21
#define _WF_TEXTENTRY_H_
 
22
 
 
23
#include "wf_view.h"
 
24
 
 
25
/**
 
26
 * Declaration of the Windows wrapper for the mforms TextEntry class.
 
27
 */
 
28
using namespace System;
 
29
using namespace Windows::Forms;
 
30
 
 
31
namespace MySQL {
 
32
  namespace Forms {
 
33
 
 
34
    public ref class TextEntryImpl : public ViewImpl
 
35
    {
 
36
      static bool create(::mforms::TextEntry *self, ::mforms::TextEntryType type);
 
37
      static void set_text(::mforms::TextEntry *self, const std::string &text);
 
38
      static std::string get_text(::mforms::TextEntry *self);
 
39
      static void set_max_length(::mforms::TextEntry *self, int length);
 
40
      static void set_read_only(::mforms::TextEntry *self, bool flag);
 
41
 
 
42
      static void change(Object^ sender, EventArgs^ args);
 
43
      static void key_pressed(Object^ sender, KeyEventArgs^ args);
 
44
    public:
 
45
      TextEntryImpl(::mforms::TextEntry *text);
 
46
 
 
47
      static void init(Manager ^mgr)
 
48
      {
 
49
        ::mforms::ControlFactory *f= ::mforms::ControlFactory::get_instance();
 
50
 
 
51
        DEF_CALLBACK2(bool, ::mforms::TextEntry*, ::mforms::TextEntryType, mgr, f->_textentry_impl, TextEntryImpl, create);
 
52
        DEF_CALLBACK2(void, ::mforms::TextEntry*, const std::string&, mgr, f->_textentry_impl, TextEntryImpl, set_text);
 
53
        DEF_CALLBACK1(std::string, ::mforms::TextEntry*, mgr, f->_textentry_impl, TextEntryImpl, get_text);
 
54
        DEF_CALLBACK2(void, ::mforms::TextEntry*, int, mgr, f->_textentry_impl, TextEntryImpl, set_max_length);
 
55
        DEF_CALLBACK2(void, ::mforms::TextEntry*, bool, mgr, f->_textentry_impl, TextEntryImpl, set_read_only);
 
56
      }
 
57
    };
 
58
 
 
59
  };
 
60
};
 
61
 
 
62
#endif