Home |
Class PegEditBox HMI (Human-Machine Interface) Classes |
Class PegEditBoxPegEditBox is a multi-line text display control that allows full user editing via mouse and keyboard. PegEditBox is derived from PegTextBox and therefore supports all of the functionality of this base class. PegEditBox is more complex and therefore requires a larger code size than PegTextBox. If you do not need user-editing capability you should use PegTextBox to display multi-line text rather than PegEditBox. class PegEditBox : public PegTextBox { public: PegEditBox(const PegRect &Rect, PEGUINT wId = 0, PEGUINT wStyle = FF_RECESSED | EF_EDIT | EF_WRAP, PEGCHAR * Text = NULL, PEGUINT wMaxChars = 1000, PEGUINT wMaxLines = 100); virtual void Draw(void); virtual PEGINT Message(const PegMessage &Mesg); virtual void DataSet(const PEGCHAR * pText); virtual void Append(const PEGCHAR * pText, BOOL bDraw = TRUE); void DeleteMarkedText(void); void CopyToScratchPad(void); void PasteFromScratchPad(void); void HomeCursor(void); void SetCursorRowCol(PEGUINT wIndex); }; Demo program PegDemo uses this class. Style FlagsFF_NONE, FF_THIN, FF_RAISED, FF_RECESSED, FF_THICK, EF_EDIT, EF_WRAP, TT_COPY. SignalsConstructorParameter wMaxChars is the maximum number of characters that the text box will be required to support. Parameter wMaxLines specifies the maximum number of lines the control will be able to display. The memory requirement of the edit box grows with 4*wMaxLines bytes. Method AppendAppends the indicated text to the current text box string value. The edit cursor is automatically positioned at the end of the appended text. Method CopyToScratchPadCopies the currently selected text to the scratch pad. Method DataSetPegEditBox overrides the DataSet function to reset any in-progress string mark or edit operations. Method DeleteMarkedTextDeletes the currently selected text. Method DrawPegEditBox overrides the Draw() function to display the textbox border and text. Method HomeCursorMoves the edit cursor to the column 0 position on the current line. Method PasteFromScratchPadPastes the scratch pad text at the current cursor position. Method SetCursorRowColPositions the edit cursor at the character indicated by wIndex, which is the desired character offset from the start of the overall text string. The desired character offset can be determined by using the member functions of PegTextBox. The textbox automatically scrolls such that the indicated cursor position is visible within the EditBox window client area. ExamplesThe following are each different styles of PegEditBox:
|