OWLNext 6.32
Classes | Typedefs | Functions | Variables
Controls

Classes

class  owl::TButton
class  owl::TCheckBox
class  owl::TComboBox
class  owl::TComboBoxData
 An interface object that represents a transfer buffer for a TComboBox. More...
class  owl::TControl
class  owl::TEdit
struct  owl::TEdit::TRange
class  owl::TEditFile
class  owl::TEditSearch
class  owl::TGauge
class  owl::TBtnBitmap
class  owl::TGlyphButton
class  owl::TGroupBox
class  owl::TListBox
class  owl::TListBoxData
 Used to transfer the contents of a list box. More...
class  owl::TNoteTabItem
class  owl::TNoteTab
class  owl::TPickListPopup
class  owl::TPickListDialog
class  owl::TPictureWindow
class  owl::TProgressBar
class  owl::TRadioButton
class  owl::TCharFormat
class  owl::TCharRange
class  owl::TParaFormat
class  owl::TFormatRange
class  owl::TEditStream
class  owl::TTextRange
class  owl::TFindText
class  owl::TRichEditModule
class  owl::TRichEdit
class  TRichEditDll

Typedefs

typedef TDllLoader
< TRichEditModule > 
owl::TRichEditDll

Functions

 owl::TEdit::TEdit (TWindow *parent, int id, const tstring &text, int x, int y, int w, int h, uint textLimit=0, bool multiline=false, TModule *=0)
 owl::TEdit::TEdit (TWindow *parent, int resourceId, uint textLimit=0, TModule *=0)
 owl::TEdit::TEdit (THandle hWnd, TModule *=0)
 owl::TEdit::~TEdit ()
int owl::TEdit::TRange::GetSize () const
virtual void owl::TEdit::GetSubText (TCHAR *textBuf, int startPos, int endPos) const
bool owl::TEdit::IsModified () const
void owl::TEdit::ClearModify ()
virtual int owl::TEdit::GetLineFromPos (int charPos) const
int owl::TEdit::GetLineIndex (int lineNumber) const
uint owl::TEdit::Transfer (void *buffer, TTransferDirection direction)
void owl::TEdit::Insert (LPCTSTR str)
void owl::TEdit::Insert (const tstring &str)
virtual int owl::TEdit::Search (int startPos, LPCTSTR text, bool caseSensitive=false, bool wholeWord=false, bool up=false)
virtual int owl::TEdit::Search (int startPos, const tstring &text, bool caseSensitive=false, bool wholeWord=false, bool up=false)
void owl::TEdit::GetRect (TRect &frmtRect) const
void owl::TEdit::SetRect (const TRect &frmtRect)
void owl::TEdit::SetRectNP (const TRect &frmtRect)
bool owl::TEdit::FormatLines (bool addEOL)
void owl::TEdit::SetTabStops (int numTabs, const int *tabs)
virtual void owl::TEdit::LimitText (int)
virtual int owl::TEdit::GetLimitText () const
HLOCAL owl::TEdit::GetMemHandle () const
void owl::TEdit::SetMemHandle (HLOCAL localMem)
void owl::TEdit::SetPasswordChar (uint ch)
int owl::TEdit::GetFirstVisibleLine () const
void owl::TEdit::SetReadOnly (bool readOnly)
uint owl::TEdit::GetPasswordChar () const
EDITWORDBREAKPROC owl::TEdit::GetWordBreakProc () const
void owl::TEdit::SetWordBreakProc (EDITWORDBREAKPROC proc)
void owl::TEdit::Clear ()
void owl::TEdit::EvChildInvalid (HWND)
int owl::TEdit::ScrollText (int how)
 owl::TEditSearch::TEditSearch (TWindow *parent, int id, const tstring &text, int x=0, int y=0, int w=0, int h=0, TModule *=0)
 owl::TEditSearch::TEditSearch (TWindow *parent, int resourceId, TModule &module)
void owl::TEditSearch::SetupWindow ()
void owl::TEditSearch::DoSearch ()
TFindReplaceDialog::TData & owl::TEditSearch::GetSearchData ()
void owl::TEditSearch::SetSearchData (const TFindReplaceDialog::TData &searchdata)
TFindReplaceDialog * owl::TEditSearch::GetSearchDialog ()
void owl::TEditSearch::SetSearchDialog (TFindReplaceDialog *searchdialog)
uint owl::TEditSearch::GetSearchCmd ()
void owl::TEditSearch::SetSearchCmd (uint searchcmd)
void owl::TEditSearch::CmEditFind ()
void owl::TEditSearch::CmEditReplace ()
void owl::TEditSearch::CeEditFindReplace (TCommandEnabler &ce)
void owl::TEditSearch::CmEditFindNext ()
void owl::TEditSearch::CeEditFindNext (TCommandEnabler &ce)
TResult owl::TEditSearch::EvFindMsg (TParam1, TParam2)

Variables

int owl::TEdit::TRange::cpMin
int owl::TEdit::TRange::cpMax

Accessors

int owl::TEdit::GetNumLines () const
int owl::TEdit::GetLineLength (int lineNumber) const
bool owl::TEdit::GetLine (TCHAR *str, int strSize, int lineNumber) const
tstring owl::TEdit::GetLine (int lineNumber) const
virtual void owl::TEdit::GetSelection (int &startPos, int &endPos) const
virtual TRange owl::TEdit::GetSelection () const
virtual int owl::TEdit::GetCurrentPosition () const
virtual tstring owl::TEdit::GetTextRange (const TRange &) const
TCHAR * owl::TEdit::LockBuffer (uint newSize=0)
void owl::TEdit::UnlockBuffer (LPCTSTR buffer, bool updateHandle=false)

Operations

bool owl::TEdit::DeleteSubText (int startPos, int endPos)
bool owl::TEdit::DeleteSubText (const TRange &r)
bool owl::TEdit::DeleteLine (int lineNumber)
bool owl::TEdit::DeleteSelection ()
virtual bool owl::TEdit::SetSelection (int startPos, int endPos)
virtual bool owl::TEdit::SetSelection (const TRange &r)
bool owl::TEdit::ClearSelection ()

Scrolling text

void owl::TEdit::Scroll (int horizontalUnit, int verticalUnit)
void owl::TEdit::ScrollCaret ()
int owl::TEdit::LineDown ()
int owl::TEdit::LineUp ()
int owl::TEdit::PageDown ()
int owl::TEdit::PageUp ()

Clipboard operations

bool owl::TEdit::CanUndo () const
void owl::TEdit::EmptyUndoBuffer ()
void owl::TEdit::Undo ()
virtual void owl::TEdit::Paste ()
void owl::TEdit::Copy ()
void owl::TEdit::Cut ()

Validator functions

bool owl::TEdit::IsValid (bool reportErr=false)
TValidator * owl::TEdit::GetValidator ()
void owl::TEdit::SetValidator (TValidator *validator)
void owl::TEdit::ValidatorError ()
bool owl::TEdit::IsRefocusing () const

Margin functions

void owl::TEdit::SetLeftMargin (uint16 margin)
void owl::TEdit::SetRightMargin (uint16 margin)
void owl::TEdit::SetMarginUseFontInfo ()
uint32 owl::TEdit::GetMargins () const

Position and character functions

virtual uint32 owl::TEdit::CharFromPos (int16 x, int16 y)
virtual uint32 owl::TEdit::PosFromChar (uint charIndex)

Command response functions for edit menu items

void owl::TEdit::CmEditCut ()
void owl::TEdit::CmEditCopy ()
void owl::TEdit::CmEditPaste ()
void owl::TEdit::CmEditDelete ()
void owl::TEdit::CmEditClear ()
void owl::TEdit::CmEditUndo ()

Command enabler functions for edit menu items

void owl::TEdit::CmSelectEnable (TCommandEnabler &commandHandler)
void owl::TEdit::CmPasteEnable (TCommandEnabler &commandHandler)
void owl::TEdit::CmCharsEnable (TCommandEnabler &commandHandler)
void owl::TEdit::CmModEnable (TCommandEnabler &commandHandler)

Child id notification handled at the child

void owl::TEdit::ENErrSpace ()

Override TWindow virtual member functions

virtual TGetClassNameReturnType owl::TEdit::GetClassName ()
void owl::TEdit::SetupWindow ()
void owl::TEdit::EvChar (uint key, uint repeatCount, uint flags)
void owl::TEdit::EvKeyDown (uint key, uint repeatCount, uint flags)
uint owl::TEdit::EvGetDlgCode (MSG *)
void owl::TEdit::EvSetFocus (HWND hWndLostFocus)
void owl::TEdit::EvKillFocus (HWND hWndGetFocus)
bool owl::TEdit::EvUpDown (TNmUpDown &)
bool owl::TEdit::CanClose ()

Detailed Description

The control classes support standard Windows controls such as list boxes, combo boxes, group boxes, check boxes, scroll bars, buttons, radio buttons, edit controls, and static controls.

Although most windows come with scroll bars already installed, you can use TScrollBar to create a standalone vertical or horizontal scroll bar; for example, as a dialog box control.

Unlike standard Windows controls, ObjectWindows supports widgets, specialized controls written entirely in C++. The widget classes ObjectWindows provides include support for sliders, controls that are used for providing nonscrolling position information, and gauges, controls that provide duration or analog information about a particular process.


Typedef Documentation

typedef TDllLoader<TRichEditModule> owl::TRichEditDll

TRichEditDll is a simple object which takes advantages of OWL's TDllLoader to ensure that only one copy of an object [theoretically representing a DLL] is created. TRichEditDll provides the 'IsAvailable' method which returns true if the DLL is available and loaded. TRichEditDll is used internally by OWL's TRichEdit class to ensure that the DLL is available and loaded. You may consider using TRichEditDll if your application creates rich edit controls without instantiating a TRichEdit object. (For example, if the control is part of a dialog resource). The following snippet illustrates:

    if (!TRichEditDll::IsAvailable()) {
      Error("Unable to load Rich Edit DLL");
    }

Function Documentation

owl::TEdit::TEdit ( TWindow parent,
int  id,
const tstring &  text,
int  x,
int  y,
int  w,
int  h,
uint  textLimit = 0,
bool  multiline = false,
TModule module = 0 
)

String-aware overload.

References owl::TWindow::ModifyExStyle(), and owl::TWindow::ModifyStyle().

owl::TEdit::TEdit ( TWindow parent,
int  resourceId,
uint  textLen = 0,
TModule module = 0 
)

Constructor for TEdit associated with a MS-Windows interface element created by MS-Windows from a resource definition.

Constructs a TEdit object to be associated with an edit control of a TDialog. Invokes the TStatic constructor with identical parameters. The resourceID parameter must correspond to an edit resource that you define. Enables the data transfer mechanism by calling EnableTransfer.

References owl::TWindow::EnableTransfer().

owl::TEdit::TEdit ( THandle  hWnd,
TModule module = 0 
)

Constructs a TEdit object to encapsulate (alias) an existing control.

References owl::TWindow::EnableTransfer().

owl::TEditSearch::TEditSearch ( TWindow parent,
int  id,
const tstring &  text,
int  x = 0,
int  y = 0,
int  w = 0,
int  h = 0,
TModule module = 0 
)

String-aware overload.

owl::TEditSearch::TEditSearch ( TWindow parent,
int  resourceId,
TModule module 
) [inline]

This constructor, which aliases an Edit control created from a dialog resource is 'unconventional' in that it expects a TModule reference instead of the traditional 'TModule* = 0'. This is, however, to avoid ambiguities between the two forms of constructor. Since it is traditionally created as a child of a TDialog-derived class, you can simply use the module of the parent object. For example,

 TMyDialog::TMyDialog(....)
 { 
   edit = new TEditSearch(this, ID_EDIT1, *GetModule());
 }
owl::TEdit::~TEdit ( )

Destructor for a TEdit control.

References owl::TEdit::SetValidator().

bool owl::TEdit::CanClose ( ) [protected, virtual]

Checks to see if all child windows can be closed before closing the current window. If any child window returns false, CanClose returns false and terminates the process. If all child windows can be closed, CanClose returns true.

Reimplemented from owl::TWindow.

Reimplemented in owl::TEditFile, owl::TEditView, and owl::TRichEditView.

References owl::TEdit::IsValid(), owl::TWindow::IsWindowEnabled(), and owl::TWindow::SetFocus().

bool owl::TEdit::CanUndo ( ) const [inline]

Returns true if it is possible to undo the last edit.

References owl::TWindow::GetHandle().

void owl::TEditSearch::CeEditFindNext ( TCommandEnabler ce) [protected]

Enables FindNext (only if there's data to search for).

References owl::TCommandEnabler::Enable(), and owl::TFindReplaceDialog::TData::FindWhat.

void owl::TEditSearch::CeEditFindReplace ( TCommandEnabler ce) [protected]

Enables the find or replace option (only if no dialog is up).

References owl::TCommandEnabler::Enable().

void owl::TEdit::Clear ( ) [virtual]

Override TStatic virtual member functions.

Overrides TStatic's virtual member function and clears all text.

Reimplemented from owl::TStatic.

References owl::TEdit::DeleteSubText().

void owl::TEdit::ClearModify ( ) [inline]

Resets the change flag of the edit control causing IsModified to return false. The flag is set when text is modified.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::CmCharsEnable ( TCommandEnabler commandHandler) [protected]

This function is called for the Clear menu item to determine whether or not the item is enabled.

References owl::TCommandEnabler::Enable(), owl::TEdit::GetLineLength(), and owl::TEdit::GetNumLines().

void owl::TEdit::CmEditClear ( ) [inline, protected]

CM_EDITCLEAR.

Automatically responds to a menu selection with a menu ID of CM_EDITCLEAR by calling Clear().

Reimplemented in owl::TRichEdit.

References owl::TEdit::Clear().

void owl::TEdit::CmEditCopy ( ) [inline, protected]

CM_EDITCOPY.

Automatically responds to a menu selection with a menu ID of CM_EDITCOPY by calling Copy().

Reimplemented in owl::TRichEdit.

References owl::TEdit::Copy().

void owl::TEdit::CmEditCut ( ) [inline, protected]

CM_EDITCUT.

Automatically responds to a menu selection with a menu ID of CM_EDITCUT by calling Cut().

Reimplemented in owl::TRichEdit.

References owl::TEdit::Cut().

void owl::TEdit::CmEditDelete ( ) [inline, protected]

CM_EDITDELETE.

Automatically responds to a menu selection with a menu ID of CM_EDITDELETE by calling DeleteSelection().

Reimplemented in owl::TRichEdit.

References owl::TEdit::DeleteSelection().

void owl::TEditSearch::CmEditFind ( ) [protected]

CM_EDITFIND.

Opens a modeless TFindDialog in response to an incoming Find command with a CM_EDITFIND command.

References owl::TDialog::Create().

void owl::TEditSearch::CmEditFindNext ( ) [protected]

CM_EDITFINDNEXT.

Responds to an incoming FindNext command with a CM_EDITFINDNEXT command identifier by calling DoSearch to repeat the search operation.

References owl::TEditSearch::DoSearch(), owl::TFindReplaceDialog::TData::Flags, and owl::TFindReplaceDialog::UpdateData().

void owl::TEdit::CmEditPaste ( ) [inline, protected]

CM_EDITPASTE.

Automatically responds to a menu selection with a menu ID of CM_EDITPASTE by calling Paste().

Reimplemented in owl::TRichEdit.

References owl::TEdit::Paste().

void owl::TEditSearch::CmEditReplace ( ) [protected]

CM_EDITREPLACE.

Opens a TReplaceDialog in response to an incoming Replace command with a CM_EDITREPLACE command.

References owl::TDialog::Create().

void owl::TEdit::CmEditUndo ( ) [inline, protected]

Automatically responds to a menu selection with a menu ID of CM_EDITUNDO by calling Undo().

CM_EDITUNDO

Reimplemented in owl::TRichEdit.

References owl::TEdit::Undo().

void owl::TEdit::CmModEnable ( TCommandEnabler commandHandler) [protected]

This function is called for the Undo menu item to determine whether or not the item is enabled.

References owl::TCommandEnabler::Enable(), and owl::TEdit::IsModified().

void owl::TEdit::CmPasteEnable ( TCommandEnabler commandHandler) [protected]

This function is called for the Paste menu item to determine whether or not the item is enabled.

References owl::TCommandEnabler::Enable(), and owl::TClipboard::IsClipboardFormatAvailable().

void owl::TEdit::CmSelectEnable ( TCommandEnabler commandHandler) [protected]

This function is called for Cut/Copy/Delete menu items to determine whether or not the item is enabled.

References owl::TCommandEnabler::Enable(), and owl::TEdit::GetSelection().

void owl::TEdit::Copy ( ) [inline]

Copies the currently selected text into the Clipboard.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::Cut ( ) [inline]

Deletes the currently selected text and copies it into the Clipboard.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

bool owl::TEdit::DeleteLine ( int  lineNumber)

Deletes the text in the line specified by lineNumber in a multiline edit control. If -1 passed, deletes the current line. DeleteLine does not delete the line break and affects no other lines. Returns true if successful. Returns false if lineNumber is not -1 and is out of range or if an error occurs.

References owl::TEdit::DeleteSubText(), owl::TEdit::GetLineFromPos(), owl::TEdit::GetLineIndex(), owl::TEdit::GetLineLength(), and owl::TStatic::SetText().

bool owl::TEdit::DeleteSelection ( )

Deletes the currently selected text, and returns false if no text is selected.

References owl::TEdit::GetSelection(), and owl::TWindow::SendMessage().

bool owl::TEdit::DeleteSubText ( int  startPos,
int  endPos 
)

Deletes the text between the starting and ending positions specified by startPos and endPos, respectively. DeleteSubText returns true if successful.

References owl::TEdit::DeleteSelection(), and owl::TEdit::SetSelection().

void owl::TEditSearch::DoSearch ( )
void owl::TEdit::EmptyUndoBuffer ( ) [inline]

If an operation inside the edit control can be undone, the edit control undo flag is set. EmptyUndoBuffer resets or clears this flag.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::ENErrSpace ( ) [protected]

EN_ERRSPACE.

Beeps when edit control runs out of space.

Sounds a beep in response to an error notification message that is sent when the edit control unsuccessfully attempts to allocate more memory.

Reimplemented in owl::TRichEdit.

References owl::TWindow::DefaultProcessing().

void owl::TEdit::EvChar ( uint  key,
uint  repeatCount,
uint  flags 
) [protected]

Validates Self whenever a character is entered. Allows the character entry to be processed normally, then validates the result and restores Self's text to its original state if there is an incorrect entry. By default, the SupressFill parameter of the IsValidInput method call to the Validator is set to False, so that it is free to modify the string, if it is so configured.

Reimplemented from owl::TWindow.

Reimplemented in owl::TRichEdit.

References owl::TValidator::Error(), owl::TEdit::GetSelection(), owl::TStatic::GetText(), owl::TStatic::GetTextLen(), owl::TValidator::HasOption(), owl::TEdit::IsModified(), owl::TValidator::IsValidInput(), owl::TEdit::LockBuffer(), owl::TWindow::SendMessage(), owl::TEdit::SetSelection(), owl::TEdit::UnlockBuffer(), and owl::voOnAppend.

void owl::TEdit::EvChildInvalid ( HWND  ) [protected]

Handler for input validation message sent by parent.

Handle input validation message sent by parent.

Reimplemented from owl::TWindow.

Reimplemented in owl::TRichEdit.

References owl::TEdit::ValidatorError().

TResult owl::TEditSearch::EvFindMsg ( TParam1  ,
TParam2  param2 
) [protected]

Registered commdlg message.

Responds to a message sent by the modeless find or replace dialog box. Calls DoSearch to continue searching if text is not found or the end of the document has not been reached.

References owl::TEditSearch::DoSearch(), owl::TFindReplaceDialog::TData::Flags, and owl::TFindReplaceDialog::UpdateData().

uint owl::TEdit::EvGetDlgCode ( MSG *  msg) [protected]

Responds to WM_GETDLGCODE messages that are sent to a dialog box associated with a control. EvGetDlgCode allows the dialog manager to intercept a message that would normally go to a control and then ask the control if it wants to process this message. If not, the dialog manager processes the message. The msg parameter indicates the kind of message, for example a control, command, or edit message, sent to the dialog box manager. If the edit control contains valid input, then Tabs are allowed for changing focus and a DLGC_WANTTABS code is returned. Otherwise, requests that TABs be sent to Self, where we will generate the Invalid message (See EvKeyDown()).

Reimplemented from owl::TWindow.

Reimplemented in owl::TRichEdit.

References owl::TWindow::EvGetDlgCode(), and owl::TEdit::IsValid().

void owl::TEdit::EvKeyDown ( uint  key,
uint  repeatCount,
uint  flags 
) [protected]

EvKeyDown translates the virtual key code into a movement. key indicates the virtual key code of the pressed key, repeatCount holds the number of times the same key is pressed, flags contains one of the messages that translates to a virtual key (VK) code for the mode indicators. If the Tab key is sent to the edit control, EvKeyDown checks the validity before allowing the focus to change. The control will only get a TAB if EvGetDlgCode(above) allows it, which is done when the control contains invalid input (we re-validate here just for completeness, in case descendants redefine any of this behavior). We need to validate on TAB focus-changes because there is a case not handled by EvKillFocus: when focus is lost to an OK or Cancel button by tabbing. Otherwise, for validators with the OnAppend option, perform an input validation if the selection moves to the end. i.e. it becomes appending.

Reimplemented from owl::TWindow.

Reimplemented in owl::TRichEdit.

References owl::TWindow::DefaultProcessing(), owl::TValidator::Error(), owl::TEdit::GetSelection(), owl::TStatic::GetTextLen(), owl::TValidator::HasOption(), owl::TEdit::IsValid(), owl::TValidator::IsValidInput(), owl::TEdit::LockBuffer(), owl::TEdit::UnlockBuffer(), owl::TEdit::ValidatorError(), and owl::voOnAppend.

void owl::TEdit::EvKillFocus ( HWND  hWndGetFocus) [protected]

Validates this whenever the focus is about to be lost.

In response to a WM_KILLFOCUS message sent to a window that is losing the keyboard, EvKillFocus hides and then destroys the caret. EvKillFocus validates text whenever the focus is about to be lost and holds onto the focus if the text is not valid. Doesn't kill the focus if another application, a Cancel button, or an OK button (in which case CanClose is called to validate text) has the focus.

Note:
Holds onto the focus if this is not valid. Checks first to make sure that the focus is not being taken by either (a) another app, or (b) a Cancel button, or (c) an OK button (in which case CanClose will validate); in each case, we don't want to validate.

Reimplemented from owl::TWindow.

Reimplemented in owl::TRichEdit.

References owl::TWindow::GetDlgCtrlID(), owl::TWindow::GetHandle(), owl::TWindow::GetParent(), owl::TWindow::GetParentO(), owl::TWindow::GetWindowPtr(), owl::TEdit::IsValid(), and owl::TWindow::PostMessage().

void owl::TEdit::EvSetFocus ( HWND  hWndLostFocus) [protected]

Handle the set focus message and make sure the anti-oscillation flag is cleared.

Reimplemented from owl::TWindow.

Reimplemented in owl::TRichEdit.

bool owl::TEdit::EvUpDown ( TNmUpDown ) [protected]

Handles up-down messages from an up-down control and adjusts contents if there is a validator to help.

References owl::TValidator::Adjust(), owl::TEdit::GetSelection(), owl::TEdit::LockBuffer(), owl::TEdit::SetSelection(), and owl::TEdit::UnlockBuffer().

bool owl::TEdit::FormatLines ( bool  addEOL) [inline]

Indicates if the end-of-line characters (carriage return, linefeed) are to be added or removed from text lines that are wordwrapped in a multiline edit control. Returns true if these characters are placed at the end of wordwrapped lines or false if they are removed.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

TWindow::TGetClassNameReturnType owl::TEdit::GetClassName ( ) [protected, virtual]

Return name of predefined Windows edit class.

Reimplemented from owl::TStatic.

Reimplemented in owl::TRichEdit.

int owl::TEdit::GetCurrentPosition ( ) const [inline, virtual]

Return the current caret position.

References owl::TWindow::GetHandle(), and owl::TEdit::GetSelection().

int owl::TEdit::GetFirstVisibleLine ( ) const [inline]

Indicates the topmost visible line in an edit control. For single-line edit controls, the return value is 0. For multiline edit controls, the return value is the index of the topmost visible line.

References owl::TWindow::GetHandle().

bool owl::TEdit::GetLine ( TCHAR *  textString,
int  strSize,
int  lineNumber 
) const

Return the text of line number "lineNumber" (0-terminated)

Retrieves a line of text (whose line number is supplied) from the edit control and returns it in str (NULL-terminated). strSize indicates how many characters to retrieve. GetLine returns false if it is unable to retrieve the text or if the supplied buffer is too small.

Note:
Requires a buffer of at least 2 bytes, even when the line length is 1

References owl::TEdit::GetLineLength(), and owl::TWindow::SendMessage().

tstring owl::TEdit::GetLine ( int  lineNumber) const

String-aware overload If the length of the returned string differs from GetLineLength an error occured.

References owl::TEdit::GetLineLength().

int owl::TEdit::GetLineFromPos ( int  charPos) const [inline, virtual]

Return the line number associated with character index "CharPos".

From a multiline edit control, returns the line number on which the character position specified by charPos occurs. If charPos is greater than the position of the last character, the number of the last line is returned. If charPos is-1, the number of the line that contains the first selected character is returned. If there is no selection, the line containing the caret is returned.

Reimplemented in owl::TRichEdit.

References owl::TWindow::GetHandle().

int owl::TEdit::GetLineIndex ( int  lineNumber) const [inline]

In a multiline edit control, GetLineIndex returns the number of characters that appear before the line number specified by lineNumber. If lineNumber is -1, GetLineIndex returns the number of the line that contains the caret is returned.

References owl::TWindow::GetHandle().

int owl::TEdit::GetLineLength ( int  lineNumber) const

Return the length of line number "lineNumber".

From a multiline edit control, GetLineLength returns the number of characters in the line specified by lineNumber. If it is -1, the following applies:

  • if no text is selected, GetLineLength returns the length of the line where the caret is positioned;
  • if text is selected on the line, GetLineLength returns the line length minus the number of selected characters;
  • if selected text spans more than one line, GetLineLength returns the length of the lines minus the number of selected characters.

References owl::TEdit::GetLineIndex().

HLOCAL owl::TEdit::GetMemHandle ( ) const [inline]

Return the memory handle for the edit control's buffer.

References owl::TWindow::GetHandle().

int owl::TEdit::GetNumLines ( ) const [inline]

Return the number of lines in the associated edit control.

Note:
return 1 when the edit control has no text (i.e. it has one line with no text in it). Return zero if an error occurs

References owl::TWindow::GetHandle().

uint owl::TEdit::GetPasswordChar ( ) const [inline]

Returns the character to be displayed in place of a user-typed character. When the edit control is created with the ES_PASSWORD style specified, the default display character is an asterisk (*).

References owl::TWindow::GetHandle().

void owl::TEdit::GetRect ( TRect frmtRect) const [inline]

Gets the formatting rectangle of a multiline edit control.

References owl::TWindow::GetHandle().

uint owl::TEditSearch::GetSearchCmd ( ) [inline]

Returns the user selected command that brought up the search dialog.

TFindReplaceDialog::TData & owl::TEditSearch::GetSearchData ( ) [inline]

Returns the search data used for the common dialog.

TFindReplaceDialog * owl::TEditSearch::GetSearchDialog ( ) [inline]

Returns the common dialog pointer.

TEdit::TRange owl::TEdit::GetSelection ( ) const [virtual]

Functional style overload.

Reimplemented in owl::TRichEdit.

void owl::TEdit::GetSelection ( int &  startPos,
int &  endPos 
) const [inline, virtual]

Return the starting and ending positions of the selected text.

Returns the starting (startPos) and ending (endPos) positions of the currently selected text. By using GetSelection in conjunction with GetSubText, you can get the currently selected text.

Reimplemented in owl::TRichEdit.

References owl::TWindow::GetHandle().

void owl::TEdit::GetSubText ( TCHAR *  textBuf,
int  startPos,
int  endPos 
) const [virtual]

Deprecated. Use GetTextRange instead.

Retrieve the text of the associated edit control between the given positions. Note that the buffer must be large enough to hold the text, otherwise buffer overrun will occur. The destination is always null-terminated.

NB! This function is deprecated. Use GetTextRange instead.

Reimplemented in owl::TRichEdit.

References owl::TEdit::GetTextRange().

tstring owl::TEdit::GetTextRange ( const TRange r) const [virtual]

Retrieves a specified range of text from the edit control. The range is half-open; i.e. range [0,2) for "abc" returns "ab". An empty string is returned if either

  • the control is empty (no text), or
  • the range is invalid (empty or inverted), or
  • whole range is beyond the extents of the actual text.

If the end of the range is beyond the valid range then it is limited to the valid range. A special case is the range [0, -1). It will return the full text.

Todo:
Must be tested

Reimplemented in owl::TRichEdit.

References owl::TEdit::GetLine(), owl::TEdit::GetLineFromPos(), owl::TEdit::GetLineIndex(), owl::TStatic::GetText(), and owl::TStatic::GetTextLen().

TValidator * owl::TEdit::GetValidator ( ) [inline]

Return the validator associated with this edit control.

EDITWORDBREAKPROC owl::TEdit::GetWordBreakProc ( ) const [inline]

Get word-breaking procedure.

References owl::TWindow::GetHandle().

void owl::TEdit::Insert ( LPCTSTR  str) [inline]

Inserts the text supplied in str into the edit control at the current text insertion point (cursor position), and replaces any currently selected text. Insert is similar to Paste(), but does not affect the Clipboard.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

bool owl::TEdit::IsModified ( ) const [inline]

Returns true if the user has changed the text in the edit control.

References owl::TWindow::GetHandle().

bool owl::TEdit::IsRefocusing ( ) const [inline]

Return true when this edit control is attempting to regain focus after an EvKillFocus() with invalid contents

bool owl::TEdit::IsValid ( bool  reportError = false)

Always returns true if the TEdit object does not have an associated TValidator object (i.e. if TEdit.Validator == 0). If the edit control has a validator, and the reportErr parameter is set to true, then IsValid calls the validator's Valid method. If the reportErr parameter is false, IsValid calls the validator's IsValid method.

References owl::TValidator::IsValid(), owl::TEdit::LockBuffer(), owl::TEdit::UnlockBuffer(), and owl::TValidator::Valid().

void owl::TEdit::LimitText ( int  txtLen) [inline, virtual]

Limit the amount of new text that can be entered in the edit control.

Reimplemented in owl::TRichEdit.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

int owl::TEdit::LineDown ( ) [inline]

EM_SCROLL, SB_LINEDOWN Scrolls down one line.

int owl::TEdit::LineUp ( ) [inline]

EM_SCROLL, SB_LINEUP Scrolls up one line.

TCHAR * owl::TEdit::LockBuffer ( uint  newSize = 0)

Lock and unlock this edit control's buffer. Allows direct access to the text in the edit control.

Lock the edit control's buffer, optionally resizing it first, and return a pointer to the beginning of it, or 0 if failure. Must call UnlockBuffer when finished with buffer.

JGD EM_GETHANDLE is only supported on NT.

References owl::TEdit::GetMemHandle(), owl::TStatic::GetText(), owl::TStatic::GetTextLen(), and owl::TWindow::GetWindowLong().

int owl::TEdit::PageDown ( ) [inline]

EM_SCROLL, SB_PAGEDOWN Scrolls down one page.

int owl::TEdit::PageUp ( ) [inline]

EM_SCROLL, SB_PAGEUP Scrolls up one page.

void owl::TEdit::Paste ( ) [inline, virtual]

Inserts text from the Clipboard into the edit control at the current text insertion point (cursor position).

Reimplemented in owl::TRichEdit.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::Scroll ( int  horizUnit,
int  vertUnit 
) [inline]

Scroll the text by the specified horizontal and vertical amounts.

Scrolls a multiline edit control horizontally and vertically using the numbers of characters specified in horizontalUnit and verticalUnit. Positive values result in scrolling to the right or down in the edit control, and negative values result in scrolling to the left or up.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::ScrollCaret ( ) [inline]

EM_SCROLLCARET.

Sroll the caret into view in an edit control.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

int owl::TEdit::Search ( int  startPos,
LPCTSTR  text,
bool  caseSensitive = false,
bool  wholeWord = false,
bool  up = false 
) [virtual]

searches for and selects the given text and returns the offset of the text or -1 if the text is not found

Performs either a case-sensitive or case-insensitive search for the supplied text. If the text is found, the matching text is selected, and Search returns the position of the beginning of the matched text. If the text is not found in the edit control's text, Search returns -1. If -1 is passed as startPos, then the search starts from either the end or the beginning of the currently selected text, depending on the search direction.

Reimplemented in owl::TRichEdit.

References owl::TEdit::GetSelection(), owl::TEdit::LockBuffer(), owl::TWindow::SendMessage(), owl::TEdit::SetSelection(), and owl::TEdit::UnlockBuffer().

void owl::TEdit::SetMemHandle ( HLOCAL  localMem) [inline]

Sets the memory handle for the edit control's buffer.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::SetPasswordChar ( uint  ch) [inline]

SetPasswordChar sets the character to be displayed in place of a user-typed character. When the ES_PASSWORD style is specified, the default display character is an asterisk (*).

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::SetReadOnly ( bool  readOnly) [inline]

Sets the edit control to be read-only or read-write.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::SetRect ( const TRect frmtRect) [inline]

Sets the formatting rectangle for a multiline edit control.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::SetRectNP ( const TRect frmtRect) [inline]

Sets the formatting rectangle for a multiline edit control. Unlike SetRect(), SetRectNP does not repaint the edit control.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEditSearch::SetSearchCmd ( uint  searchcmd) [inline]

Remembers the command the user selected to bring up the search dialog.

void owl::TEditSearch::SetSearchData ( const TFindReplaceDialog::TData searchdata) [inline]

Uses new search data.

void owl::TEditSearch::SetSearchDialog ( TFindReplaceDialog searchdialog) [inline]

Uses new common dialog pointer.

bool owl::TEdit::SetSelection ( int  startPos,
int  endPos 
) [inline, virtual]

Select the characters in the range "startPos .. endPos".

Forces the selection of the text between the positions specified by startPos and endPos, but not including the character at endPos.

Reimplemented in owl::TRichEdit.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::SetTabStops ( int  numTabs,
const int *  tabs 
) [inline]

Sets the tab stop positions in a multiline edit control.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::SetupWindow ( ) [protected, virtual]
Note:
If the textLimit data member is nonzero, SetupWindow limits the number of characters that can be entered into the edit control to textLimit -1.

Reimplemented from owl::TWindow.

Reimplemented in owl::TEditFile, owl::TEditSearch, owl::TFlatEdit, owl::TRichEdit, and owl::TRichEditView.

References owl::TEdit::LimitText().

void owl::TEditSearch::SetupWindow ( ) [virtual]
Note:
If the textLimit data member is nonzero, SetupWindow limits the number of characters that can be entered into the edit control to textLimit -1.

Reimplemented from owl::TEdit.

Reimplemented in owl::TEditFile, owl::TRichEdit, and owl::TRichEditView.

References owl::TWindow::PostMessage().

void owl::TEdit::SetValidator ( TValidator validator)

Sets a new validator for this control, can be 0. Cleans up the old validator.

void owl::TEdit::SetWordBreakProc ( EDITWORDBREAKPROC  proc) [inline]

In a multiline edit control, SetWordBreakProc indicates that an application-supplied word-break function has replaced the default word-break function. The application-supplied word-break function might break the words in the text buffer at a character other than the default blank character.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

uint owl::TEdit::Transfer ( void *  buffer,
TTransferDirection  direction 
) [virtual]

Transfers state information for TEdit controls.

Transfers information for TEdit controls and sends information to the Validator if one exists, and if it has the transfer option set. Transfer can perform type conversion when validators are in place, for example, when TRangeValidator transfers integers. The return value is the size (in bytes) of the transfer data. Delegates to the Validator if there is one & it has the transfer option set, allowing the Validator to convert the text to/from the appropriate type. Else passes to base, TStatic. The return value is the size (in bytes) of the transfer data

Reimplemented from owl::TStatic.

Reimplemented in owl::TRichEdit.

References owl::TEdit::GetNumLines(), owl::TStatic::GetText(), owl::TWindow::GetWindowTextLength(), owl::TValidator::HasOption(), owl::TStatic::SetText(), owl::tdSetData, owl::TValidator::Transfer(), and owl::voTransfer.

void owl::TEdit::Undo ( ) [inline]

Undoes the last edit.

References owl::TWindow::GetHandle(), and owl::TWindow::SendMessage().

void owl::TEdit::UnlockBuffer ( LPCTSTR  buffer,
bool  updateHandle = false 
)

Unlock the edit control's buffer locked by LockBuffer.

If the contents were changed (buffer is resized or written to), updateHandle should be true. Ignores call if buffer is 0

References owl::TWindow::GetWindowLong(), owl::TEdit::SetMemHandle(), and owl::TStatic::SetText().

void owl::TEdit::ValidatorError ( )

Handles validation errors that occur as a result of validating the edit control.

References owl::TValidator::Error(), and owl::TWindow::SetFocus().