API Documentation
EditBox.h
1 // EditBox.h
3 //
5 
6 namespace nkWinUi
7 {
11  class EditBox : public Component
12  {
13  public :
14 
22  EditBox (System* system) noexcept ;
26  virtual ~EditBox () ;
27 
28  // Getters
32  std::function<bool (EditBox*, const CharEventData&)> getCharCallback () const ;
33 
34  // Setters
40  virtual void setOnlyNumbers (bool value) ;
46  virtual void setPlaceHolder (nkMemory::StringView text) ;
52  virtual void setCaretPosition (unsigned int letterIndex) = 0 ;
58  void setCharCallback (std::function<bool (EditBox*, const CharEventData&)> value) ;
59 
60  // Import / Export
61  virtual void exportIntrospection (nkExport::Node* rootNode) override ;
62  virtual void importClassFromTree (nkExport::Node* rootNode) override ;
63 
64  public :
65 
66  // Statics
74  static nkMemory::UniquePtr<EditBox> create (System* system = nullptr) ;
75  } ;
76 }
nkWinUi::CharEventData
Data holder for a char event.
Definition: CharEventData.h:12
nkWinUi::EditBox::setOnlyNumbers
virtual void setOnlyNumbers(bool value)
nkWinUi::EditBox::~EditBox
virtual ~EditBox()
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::System
The main system of the component.
Definition: System.h:18
nkWinUi::EditBox::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkWinUi::EditBox::setPlaceHolder
virtual void setPlaceHolder(nkMemory::StringView text)
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkWinUi::EditBox::create
static nkMemory::UniquePtr< EditBox > create(System *system=nullptr)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkWinUi::EditBox::setCharCallback
void setCharCallback(std::function< bool(EditBox *, const CharEventData &)> value)
nkWinUi::EditBox
A graphical single line edit box.
Definition: EditBox.h:12
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Clipboard.h:7
nkWinUi::EditBox::getCharCallback
std::function< bool(EditBox *, const CharEventData &)> getCharCallback() const
nkWinUi::EditBox::EditBox
EditBox(System *system) noexcept
nkWinUi::EditBox::exportIntrospection
virtual void exportIntrospection(nkExport::Node *rootNode) override
nkWinUi::EditBox::setCaretPosition
virtual void setCaretPosition(unsigned int letterIndex)=0