6 InputViewController::TextFieldController::ContentView::ContentView(
Responder * parentResponder,
TextFieldDelegate * textFieldDelegate) :
9 m_textField(this, m_textBody, m_textBody,
TextField::maxBufferSize(), textFieldDelegate,
false)
14 void InputViewController::TextFieldController::ContentView::didBecomeFirstResponder() {
15 app()->setFirstResponder(&m_textField);
18 TextField * InputViewController::TextFieldController::ContentView::textField() {
22 void InputViewController::TextFieldController::ContentView::drawRect(
KDContext * ctx,
KDRect rect)
const {
24 ctx->
fillRect(
KDRect(0, k_separatorThickness, k_textMargin, bounds().height()-k_separatorThickness), m_textField.backgroundColor());
27 KDSize InputViewController::TextFieldController::ContentView::minimalSizeForOptimalDisplay()
const {
28 return KDSize(0, k_inputHeight);
31 int InputViewController::TextFieldController::ContentView::numberOfSubviews()
const {
35 View * InputViewController::TextFieldController::ContentView::subviewAtIndex(
int index) {
39 void InputViewController::TextFieldController::ContentView::layoutSubviews() {
40 m_textField.
setFrame(
KDRect(k_textMargin, k_separatorThickness, bounds().width()-k_textMargin, bounds().height()));
43 InputViewController::TextFieldController::TextFieldController(
Responder * parentResponder,
TextFieldDelegate * textFieldDelegate) :
45 m_view(this, textFieldDelegate)
49 View * InputViewController::TextFieldController::view() {
53 void InputViewController::TextFieldController::didBecomeFirstResponder() {
54 app()->setFirstResponder(&m_view);
57 TextField * InputViewController::TextFieldController::textField() {
58 return m_view.textField();
63 m_textFieldController(this, this),
66 m_textFieldDelegate(textFieldDelegate)
71 return m_textFieldController.textField()->text();
75 m_successAction =
Invocation(successAction, context);
76 m_failureAction =
Invocation(failureAction, context);
78 m_textFieldController.textField()->handleEvent(event);
79 if (initialText !=
nullptr) {
80 m_textFieldController.textField()->handleEventWithText(initialText);
85 m_textFieldController.textField()->setEditing(
false);
void perform(void *sender)
void(* Action)(void *context, void *sender)
void setFrame(KDRect frame)
virtual bool textFieldDidReceiveEvent(TextField *textField, Ion::Events::Event event)=0
void dismissModalViewController()
static constexpr KDColor GreyMiddle
void fillRect(KDRect rect, KDColor color)
void displayModalViewController(ViewController *vc, float verticalAlignment, float horizontalAlignment, KDCoordinate topMargin=0, KDCoordinate leftMargin=0, KDCoordinate bottomMargin=0, KDCoordinate rightMargin=0)
virtual Toolbox * toolboxForTextInput(TextInput *textInput)=0