• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

TextInput.hpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 #ifndef GOSU_TEXTINPUT_HPP
00005 #define GOSU_TEXTINPUT_HPP
00006 
00007 #include <Gosu/Fwd.hpp>
00008 #include <Gosu/Platform.hpp>
00009 #include <boost/scoped_ptr.hpp>
00010 #include <string>
00011 
00012 namespace Gosu
00013 {
00023     class TextInput
00024     {
00025         struct Impl;
00026         boost::scoped_ptr<Impl> pimpl;
00027         
00028     public:
00029         TextInput();
00030         virtual ~TextInput();
00031 
00032         std::wstring text() const;
00033 
00036         void setText(const std::wstring& text);
00037 
00039         unsigned caretPos() const;
00042         void setCaretPos(unsigned pos);
00043 
00047         unsigned selectionStart() const;
00049         void setSelectionStart(unsigned pos);
00050         
00051         // Platform-specific communication with Gosu::Input.
00052         #if defined(GOSU_IS_MAC)
00053         bool feedNSEvent(void* event);
00054         #elif defined(GOSU_IS_WIN)
00055         bool feedMessage(unsigned long message, unsigned long wparam, unsigned long lparam);
00056         #elif defined(GOSU_IS_X)
00057         bool feedXEvent(void* display, void* event);
00058         #endif
00059 
00063         virtual std::wstring filter(const std::wstring& textIn) const
00064         {
00065             return textIn;
00066         }
00067     };
00068 }
00069 
00070 #endif

Documentation not clear enough? Please go to one of the places listed on http://www.libgosu.org/ and leave feedback. Thanks!