Numworks Epsilon  1.4.1
Graphing Calculator Operating System
TextField Class Reference

#include <text_field.h>

Inheritance diagram for TextField:
TextInput ScrollableView ScrollViewDataSource Responder ScrollView View Calculation::TextField

Classes

class  ContentView
 

Public Member Functions

 TextField (Responder *parentResponder, char *textBuffer, char *draftTextBuffer, size_t textBufferSize, TextFieldDelegate *delegate=nullptr, bool hasTwoBuffers=true, KDText::FontSize size=KDText::FontSize::Large, float horizontalAlignment=0.0f, float verticalAlignment=0.5f, KDColor textColor=KDColorBlack, KDColor=KDColorWhite)
 
void setDelegate (TextFieldDelegate *delegate)
 
void setDraftTextBuffer (char *draftTextBuffer)
 
bool isEditing () const
 
size_t draftTextLength () const
 
void setText (const char *text)
 
void setAlignment (float horizontalAlignment, float verticalAlignment)
 
virtual void setEditing (bool isEditing, bool reinitDraftBuffer=true)
 
KDSize minimalSizeForOptimalDisplay () const override
 
bool handleEventWithText (const char *text, bool indenting=false) override
 
bool handleEvent (Ion::Events::Event event) override
 
void scrollToCursor () override
 
bool textFieldShouldFinishEditing (Ion::Events::Event event)
 
- Public Member Functions inherited from TextInput
 TextInput (Responder *parentResponder, View *contentView)
 
Toolboxtoolbox () override
 
const char * text () const
 
void setBackgroundColor (KDColor backgroundColor)
 
KDColor backgroundColor () const
 
void setTextColor (KDColor textColor)
 
bool removeChar ()
 
size_t cursorLocation () const
 
bool setCursorLocation (int location)
 
- Public Member Functions inherited from ScrollableView
 ScrollableView (Responder *parentResponder, View *view, ScrollViewDataSource *dataSource)
 
void reloadScroll (bool forceRelayout=false)
 
- Public Member Functions inherited from Responder
 Responder (Responder *parentResponder)
 
virtual void didBecomeFirstResponder ()
 
virtual void willResignFirstResponder ()
 
virtual void didEnterResponderChain (Responder *previousFirstResponder)
 
virtual void willExitResponderChain (Responder *nextFirstResponder)
 
ResponderparentResponder () const
 
RespondercommonAncestorWith (Responder *responder)
 
void setParentResponder (Responder *responder)
 
Appapp ()
 
- Public Member Functions inherited from ScrollView
 ScrollView (View *contentView, ScrollViewDataSource *dataSource)
 
void drawRect (KDContext *ctx, KDRect rect) const override
 
void setTopMargin (KDCoordinate m)
 
KDCoordinate topMargin () const
 
void setRightMargin (KDCoordinate m)
 
KDCoordinate rightMargin () const
 
void setBottomMargin (KDCoordinate m)
 
KDCoordinate bottomMargin () const
 
void setLeftMargin (KDCoordinate m)
 
KDCoordinate leftMargin () const
 
void setMargins (KDCoordinate top, KDCoordinate right, KDCoordinate bottom, KDCoordinate left)
 
void setMargins (KDCoordinate m)
 
void setCommonMargins ()
 
void setShowsIndicators (bool s)
 
bool showsIndicators () const
 
void setColorsBackground (bool c)
 
bool colorsBackground () const
 
void setBackgroundColor (KDColor c)
 
KDColor backgroundColor () const
 
ScrollViewIndicatorverticalScrollIndicator ()
 
ScrollViewIndicatorhorizontalScrollIndicator ()
 
void setIndicatorThickness (KDCoordinate t)
 
KDCoordinate indicatorThickness () const
 
void setContentOffset (KDPoint offset, bool forceRelayout=false)
 
KDPoint contentOffset () const
 
void scrollToContentPoint (KDPoint p, bool allowOverscroll=false)
 
void scrollToContentRect (KDRect rect, bool allowOverscroll=false)
 
- Public Member Functions inherited from View
 View ()
 
virtual ~View ()
 
 View (const View &other)=delete
 
 View (View &&other)=delete
 
Viewoperator= (const View &other)=delete
 
Viewoperator= (View &&other)=delete
 
void resetSuperview ()
 
void setSize (KDSize size)
 
void setFrame (KDRect frame)
 
KDPoint pointFromPointInView (View *view, KDPoint point)
 
KDRect bounds () const
 
Viewsubview (int index)
 
- Public Member Functions inherited from ScrollViewDataSource
 ScrollViewDataSource ()
 
KDPoint offset () const
 
bool setOffset (KDPoint offset)
 

Static Public Member Functions

static constexpr int maxBufferSize ()
 

Protected Member Functions

const ContentViewnonEditableContentView () const override
 
- Protected Member Functions inherited from TextInput
bool insertTextAtLocation (const char *textBuffer, int location)
 
virtual bool removeEndOfLine ()
 
ContentViewcontentView ()
 
- Protected Member Functions inherited from ScrollableView
void layoutSubviews () override
 
- Protected Member Functions inherited from ScrollView
KDCoordinate maxContentWidthDisplayableWithoutScrolling ()
 
KDCoordinate maxContentHeightDisplayableWithoutScrolling ()
 
KDRect visibleContentRect ()
 
void updateScrollIndicator ()
 
KDSize contentSize ()
 
- Protected Member Functions inherited from View
void markRectAsDirty (KDRect rect)
 

Protected Attributes

ContentView m_contentView
 
- Protected Attributes inherited from ScrollableView
KDPoint m_manualScrollingOffset
 
- Protected Attributes inherited from ScrollView
Viewm_contentView
 
- Protected Attributes inherited from View
KDRect m_frame
 

Detailed Description

Definition at line 8 of file text_field.h.

Constructor & Destructor Documentation

◆ TextField()

TextField::TextField ( Responder parentResponder,
char *  textBuffer,
char *  draftTextBuffer,
size_t  textBufferSize,
TextFieldDelegate delegate = nullptr,
bool  hasTwoBuffers = true,
KDText::FontSize  size = KDText::FontSize::Large,
float  horizontalAlignment = 0.0f,
float  verticalAlignment = 0.5f,
KDColor  textColor = KDColorBlack,
KDColor  backgroundColor = KDColorWhite 
)

Definition at line 161 of file text_field.cpp.

Member Function Documentation

◆ draftTextLength()

size_t TextField::draftTextLength ( ) const

Definition at line 179 of file text_field.cpp.

◆ handleEvent()

bool TextField::handleEvent ( Ion::Events::Event  event)
overridevirtual

Reimplemented from ScrollableView.

Definition at line 277 of file text_field.cpp.

◆ handleEventWithText()

bool TextField::handleEventWithText ( const char *  text,
bool  indenting = false 
)
overridevirtual

Implements TextInput.

Definition at line 303 of file text_field.cpp.

◆ isEditing()

bool TextField::isEditing ( ) const

Definition at line 175 of file text_field.cpp.

◆ maxBufferSize()

static constexpr int TextField::maxBufferSize ( )
inlinestatic

Definition at line 23 of file text_field.h.

◆ minimalSizeForOptimalDisplay()

KDSize TextField::minimalSizeForOptimalDisplay ( ) const
overridevirtual

Reimplemented from View.

Definition at line 273 of file text_field.cpp.

◆ nonEditableContentView()

const ContentView* TextField::nonEditableContentView ( ) const
inlineoverrideprotectedvirtual

Implements TextInput.

Definition at line 68 of file text_field.h.

◆ scrollToCursor()

void TextField::scrollToCursor ( )
overridevirtual

Reimplemented from TextInput.

Definition at line 296 of file text_field.cpp.

◆ setAlignment()

void TextField::setAlignment ( float  horizontalAlignment,
float  verticalAlignment 
)

Definition at line 192 of file text_field.cpp.

◆ setDelegate()

void TextField::setDelegate ( TextFieldDelegate delegate)
inline

Definition at line 13 of file text_field.h.

◆ setDraftTextBuffer()

void TextField::setDraftTextBuffer ( char *  draftTextBuffer)

Definition at line 171 of file text_field.cpp.

◆ setEditing()

void TextField::setEditing ( bool  isEditing,
bool  reinitDraftBuffer = true 
)
virtual

Definition at line 196 of file text_field.cpp.

◆ setText()

void TextField::setText ( const char *  text)

Definition at line 184 of file text_field.cpp.

◆ textFieldShouldFinishEditing()

bool TextField::textFieldShouldFinishEditing ( Ion::Events::Event  event)
inline

Definition at line 27 of file text_field.h.

Member Data Documentation

◆ m_contentView

ContentView TextField::m_contentView
protected

Definition at line 69 of file text_field.h.


The documentation for this class was generated from the following files: