#include <GTextView3.h>
Public Member Functions | |
const char * | GetClass () |
char * | Name () |
Returns the utf-8 text associated with this view. | |
bool | Name (const char *s) |
Sets the utf-8 text associated with this view. | |
char16 * | NameW () |
Returns the wide char text associated with this view. | |
bool | NameW (const char16 *s) |
Sets the wide char text associated with this view. | |
int64 | Value () |
Gets the integer representation of the view's contents. | |
void | Value (int64 i) |
Sets the integer representation of the view's contents. | |
GFont * | GetFont () |
Gets the font this control should draw with. | |
void | SetFont (GFont *f, bool OwnIt=false) |
Sets the font for this control. | |
void | SetWrapType (uint8 i) |
Sets the wrapping on the control, use TEXTED_WRAP_NONE or TEXTED_WRAP_REFLOW. | |
void | SetCursor (int i, bool Select, bool ForceFullUpdate=false) |
int | IndexAt (int x, int y) |
Returns the character index at the x,y location. | |
bool | IsDirty () |
True if the document has changed. | |
bool | HasSelection () |
True if there is a selection. | |
void | UnSelectAll () |
Unselect all the text. | |
void | SelectWord (int From) |
Select the word from index 'From'. | |
void | SelectAll () |
Select all the text in the control. | |
int | GetCursor (bool Cursor=true) |
void | PositionAt (int &x, int &y, int Index=-1) |
Index=-1 returns the x,y of the cursor, Index >=0 returns the specified x,y. | |
int | GetLines () |
Gets the number of lines of text. | |
void | GetTextExtent (int &x, int &y) |
Gets the pixels required to display all the text. | |
char * | GetSelection () |
Get the selection as a dynamicially allocated utf-8 string. | |
bool | Open (const char *Name, const char *Cs=0) |
Open a file handler. | |
bool | Save (const char *Name, const char *Cs=0) |
Save a file handler. | |
bool | Cut () |
Cuts the selection from the document and puts it on the clipboard. | |
bool | Copy () |
Copies the selection from the document to the clipboard. | |
bool | Paste () |
Pastes the current contents of the clipboard into the document. | |
virtual bool | DoFind () |
Find window handler. | |
virtual bool | DoReplace () |
Replace window handler. | |
void | OnPosChange () |
Called when the view position changes. | |
void | OnCreate () |
The view is attached. | |
void | OnEscape (GKey &K) |
Called when the user hits the escape key. | |
void | OnMouseWheel (double Lines) |
The mouse wheel was scrolled. | |
void | OnFocus (bool f) |
The view gains or loses the keyboard focus. | |
void | OnMouseClick (GMouse &m) |
The mouse was clicked over this view. | |
void | OnMouseMove (GMouse &m) |
The mouse moves over the control. | |
bool | OnKey (GKey &k) |
A key was pressed while this view has focus. | |
void | OnPaint (GSurface *pDC) |
Called to paint the onscreen representation of the view. | |
int | OnEvent (GMessage *Msg) |
Handles the incoming events. | |
int | OnNotify (GViewI *Ctrl, int Flags) |
Called when a child view or view with it's SetNotify() set to this window changes. | |
void | OnPulse () |
Called every so often by the timer system. | |
int | OnHitTest (int x, int y) |
bool | OnLayout (GViewLayoutInfo &Inf) |
Called to get layout information for the control. | |
int | WillAccept (List< char > &Formats, GdcPt2 Pt, int KeyState) |
int | OnDrop (char *Format, GVariant *Data, GdcPt2 Pt, int KeyState) |
virtual void | OnEnter (GKey &k) |
Called when the user hits the enter key. | |
virtual void | OnUrl (char *Url) |
Called when the user clicks a URL. |
const char* GTextView3::GetClass | ( | ) | [inline] |
The class' name. Should be overriden in child classes to return the right class name. Mostly used for debugging, but in the win32 port it is also the default WIN32 class name passed to RegisterClass() in GView::CreateClass().
Reimplemented from GDocView.
Reimplemented in GEdit.
bool GTextView3::Name | ( | const char * | n | ) |
Sets the utf-8 text associated with this view.
Name and NameW are interchangable. Using them in any order will convert the text between utf-8 and wide to satify any requirement. Generally once the opposing version of the string is required both the utf-8 and wide copies of the string remain cached in RAM until the Name is changed.
Reimplemented from GView.
References GView::Invalidate().
char16 * GTextView3::NameW | ( | ) | [virtual] |
GFont * GTextView3::GetFont | ( | ) | [virtual] |
void GTextView3::SetFont | ( | GFont * | Fnt, | |
bool | OwnIt = false | |||
) | [virtual] |
Sets the font for this control.
The lifetime of the font passed in is the responsibility of the caller. The GView object assumes the pointer will be valid at all times.
Reimplemented from GView.
References GTypeFace::Fore(), and GTypeFace::Underline().
void GTextView3::SetCursor | ( | int | i, | |
bool | Select, | |||
bool | ForceFullUpdate = false | |||
) | [virtual] |
Set the cursor position, to select an area, move the cursor with Select=false then set the other end of the region with Select=true.
Reimplemented from GDocView.
References GLayout::GetClient(), GTVN_CURSOR_CHANGED, GView::Invalidate(), GRect::Offset(), GView::SendNotify(), GRect::Set(), GRect::Union(), GScrollBar::Value(), Value(), GLayout::VScroll, GView::X(), GRect::X(), GRect::x1, GRect::x2, and GRect::Y().
Referenced by OnEnter(), OnKey(), OnMouseClick(), OnMouseMove(), Open(), Paste(), GEdit::Select(), and GEdit::SetCaret().
int GTextView3::GetCursor | ( | bool | Cursor = true |
) | [virtual] |
Cursor=false means the other end of the selection if any. The cursor is alwasy at one end of the selection.
Reimplemented from GDocView.
Referenced by GEdit::GetCaret(), and GEdit::GetSelection().
int GTextView3::OnNotify | ( | GViewI * | Ctrl, | |
int | Flags | |||
) |
Called when a child view or view with it's SetNotify() set to this window changes.
The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.
Reimplemented from GLayout.
References IDC_VSCROLL, GView::Invalidate(), and GLayout::VScroll.
void GTextView3::OnPulse | ( | ) |
Called every so often by the timer system.
Reimplemented from GView.
References GView::Invalidate(), and GRect::Offset().
int GTextView3::OnHitTest | ( | int | x, | |
int | y | |||
) |
Return the type of cursor that should be visible when the mouse is at x,y e.g. LCUR_Normal
Reimplemented from GView.
References GLayout::GetClient(), and GView::OnHitTest().
'WillAccept' is called to see whether this target can cope with any of the data types being passed to it. Once you have decided what format you want the data in clear all the other formats from the list. The first format left in the list will be passed to the 'OnDrop' function.
Reimplemented from GDragDropTarget.
References List< Type >::Current(), List< Type >::Delete(), List< Type >::First(), DLinkList::Length(), and List< Type >::Next().
'OnDrop' is called when the user releases the data over your window. The data is going to be a binary GVariant in the format you accepted earlier.
Reimplemented from GDragDropTarget.
References GVariant::Binary, GView::Invalidate(), GVariant::IsBinary(), and GVariant::Value.