Laxkit
0.0.7.1
|
*** please note this class is currently seriously broken *** Multiline edit with optional word wrap. More...
Classes | |
struct | Linestat |
Holds information about the screen lines. More... |
Public Member Functions | |
MultiLineEdit (anXWindow *prnt, const char *nname, const char *ntitle, unsigned long nstyle, int xx, int yy, int ww, int hh, int brder, anXWindow *prev, unsigned long nowner=0, const char *nsend=NULL, unsigned int ntstyle=0, const char *newtext=NULL) | |
Constructor. | |
virtual | ~MultiLineEdit () |
Destructor, delete linestats. | |
virtual void | UseTheseScrollers (Scroller *xscroll, Scroller *yscroll) |
Use these external scrollers, rather than dynamically add and remove them. | |
virtual int | init () |
virtual int | Event (const EventData *e, const char *mes) |
virtual int | CharInput (unsigned int ch, const char *buffer, int len, unsigned int state, const LaxKeyboard *d) |
virtual int | LBDown (int x, int y, unsigned int state, int count, const LaxMouse *d) |
virtual int | LBDblClick (int x, int y, unsigned int state, const LaxMouse *d) |
Selects whole word. | |
virtual int | LBUp (int x, int y, unsigned int state, const LaxMouse *d) |
Button up, nothing special. | |
virtual int | RBDown (int x, int y, unsigned int state, int count, const LaxMouse *d) |
Button down, nothing special. | |
virtual int | RBUp (int x, int y, unsigned int state, const LaxMouse *d) |
Button up, nothing special. | |
virtual int | WheelDown (int x, int y, unsigned int state, int count, const LaxMouse *d) |
Roll screen. | |
virtual int | WheelUp (int x, int y, unsigned int state, int count, const LaxMouse *d) |
Roll screen. | |
virtual int | MouseMove (int x, int y, unsigned int state, const LaxMouse *d) |
virtual int | Idle (int tid=0) |
virtual int | Resize (int nw, int nh) |
virtual int | MoveResize (int nx, int ny, int nw, int nh) |
virtual int | Find (char *str, int fromcurs=1) |
Find occurence of str, starting from position curpos if fromcurs==1. | |
virtual int | Replace (const char *oldstr, const char *newstr, int all) |
virtual int | SetText (const char *newtext) |
Set the text, and remap the screen. | |
virtual long | SetCurPos (long newcurpos) |
Jump to this new position. | |
virtual int | SetSelection (long newss, long newse) |
Set the selection to these bounds. | |
virtual int | newyssize () |
virtual int | newxssize (int p=1) |
Make sure the scrollers are correct for current line widths. | |
virtual void | wwinspect (int fromline=0) |
Try to figure out if screen still laid out correctly based on word wrapping. | |
virtual int | inschar (int ch) |
Insert character ch at curpos. | |
virtual int | delchar (int bksp) |
Delete character at curpos. bksp==0 means curpos, else curpos-1. | |
virtual int | insstring (const char *blah, int after=0) |
Insert a string. If after!=0 then place curpos after the string. | |
virtual int | replacesel (int ch) |
Replace the selection with this character. | |
virtual int | delsel () |
Delete selection. | |
virtual int | getscreenline (long pos) |
Return the screen line corresponding to character pos. | |
virtual int | replacesel (const char *newt, int after=0) |
virtual long | findpos (int l, int pix, int updatecp=1, int conv=1) |
Returns position most appropriate for x=pix, y=screen line l. | |
virtual long | countout (int linenumber, int &pout) |
Find character position for screen line number linenumber and horizontal pixel pout. | |
virtual int | makeinwindow () |
Make sure curpos is in the window somewhere (shifts screen, does not change curpos. | |
virtual void | findcaret () |
virtual int | ShiftScreen (int x, long y) |
Shift the view by x pixels and y lines. | |
virtual int | isword (long pos) |
Return whether position pos is part of a word. Default is alphanumeric or a period. | |
virtual long | findline (long ls, int &ilsofar) |
virtual long | findlinestart (long pos=-1) |
Find what should be the start of the screen line that contains pos. | |
virtual int | makelinestart (int startline, long ulwc, int godown, int ifdelete) |
Remaps linestats, but does not findcaret. | |
virtual int | Getmostwide () |
Returns which line is the most pixels wide. | |
virtual long | WhichLine (long pos) |
Return which screen line pos is in. | |
virtual void | DrawText (int black=1) |
Draw the screen. | |
virtual int | SetupMetrics () |
Call TextXEditBaseUtf8::SetupMetrics(), set firsttime=0, and SetupScreen(). | |
virtual void | SetupScreen () |
virtual LaxFiles::Attribute * | dump_out_atts (LaxFiles::Attribute *att, int what, Laxkit::anObject *savecontext) |
virtual void | dump_in_atts (LaxFiles::Attribute *att, int flag, Laxkit::anObject *loadcontext) |
Public Member Functions inherited from Laxkit::TextXEditBaseUtf8 | |
TextXEditBaseUtf8 (anXWindow *parnt, const char *nname, const char *ntitle, unsigned long nstyle, int xx, int yy, int ww, int hh, int brder, anXWindow *prev, unsigned long nowner, const char *nsend, const char *newtext=NULL, unsigned long ntstyle=0, int ncntlchar=0) | |
virtual | ~TextXEditBaseUtf8 () |
virtual void | Refresh () |
virtual int | MBUp (int x, int y, unsigned int state, const LaxMouse *d) |
Initiate a middle button paste via selectionPaste(1,0). | |
virtual int | FocusOn (const FocusChangeData *e) |
Draws the caret on. | |
virtual int | FocusOff (const FocusChangeData *e) |
Draws the caret off. | |
virtual int | charwidth (int ch, int r=0) |
Returns real char width with r==1, else returns the custom hexified if r==0. | |
virtual int | Cut () |
Copy() then delsel(). | |
virtual int | Copy () |
Calls anXApp::CopytoBuffer() with the current selection. | |
virtual int | Paste () |
Utilizes anXApp::GetBuffer(). | |
virtual void | Colors (int hl) |
Set curtextcolor and curbkcolor according to whether highlighting is on or not. | |
virtual void | Black (int x, int y, int w, int h) |
Fill x,y,w,h with curbkcolor. | |
virtual int | DrawTabLine () |
Draw a marker at top of text area that shows where and what type of tabs exist for the line. | |
virtual void | DrawCaret (int flag=0, int on=1) |
Update the caret and if necessary the change in the selection. | |
virtual int | DrawLineOfText (int x, int y, long pos, long len, char &check, long eof=-1) |
Draw a single line of text. | |
virtual int | TextOut (int x, int y, char *str, long len, long eof) |
Print out len bytes of str, which is a pointer to somewhere inside thetext. | |
virtual int | ExtentAndStr (char *str, long len, char *&blah, long &p) |
Find a printable string, and its pixel extent. | |
virtual int | GetExtent (long pos, long end, int lsofar=0, long eof=-1) |
Find the extent of the string in range [pos,end). Must be no newlines within the range. | |
virtual long | GetPos (long pos, int pix, int lsofar=0, long eof=-1) |
Returns maximum pos less than or equal to an arbitrary window pixel position. | |
virtual int | UseThisFont (LaxFont *newfont) |
Public Member Functions inherited from Laxkit::anXWindow | |
anXWindow (anXWindow *parnt, const char *nname, const char *ntitle, unsigned long nstyle, int xx, int yy, int ww, int hh, int brder, anXWindow *prev, unsigned long nowner, const char *nsend) | |
Constructor. | |
virtual | ~anXWindow () |
anXWindow destructor. Its X window should have been XDestroy'd before here. | |
virtual const char * | whattype () |
virtual const char * | WindowTitle (int which=0) |
Return basically the name of the window. | |
virtual void | WindowTitle (const char *newtitle) |
Change the title of the window. This text would usually be displayed in the bar provided by a window manager. | |
virtual const char * | tooltip (int mouseid=0) |
By default, return win_tooltip. | |
virtual const char * | tooltip (const char *newtooltip) |
Replace the current tooltip, return the current tooltip (after replacing). | |
virtual anXWindow * | findChildWindowByTitle (const char *title) |
Find the first immediate child window that has win_title==title. | |
virtual anXWindow * | findChildWindowByName (const char *name) |
Find the first immediate child window that has win_name==name. | |
virtual int | Grayed () |
Return whether this window is grayed. | |
virtual int | Grayed (int g) |
Set the gray state of this window. Returns Grayed(void). | |
virtual int | preinit () |
virtual int | close () |
Called by anXApp from anXApp::destroywindow() when a window is to be destroyed. | |
virtual Displayer * | MakeCurrent () |
virtual int | Needtodraw () |
Default is to return needtodraw. | |
virtual void | Needtodraw (int nntd) |
If 0, then the window does not need refreshing. Otherwise it does. | |
virtual int | deletenow () |
Return whether the window is allowed to be deleted. | |
virtual int | setWinStyle (unsigned int stylebit, int newvalue) |
Control various window related basic styling of win_style. | |
virtual int | getWinStyle (unsigned int stylebit) |
Currently, simply return win_style&stylebit. | |
virtual void | installColors (WindowColors *newcolors) |
Dec_count old and inc_count new. | |
virtual ShortcutHandler * | GetShortcuts () |
Return a ShortcutHandler that contains stacks of bound shortcuts and possible window actions. | |
virtual int | PerformAction (int action_number) |
virtual int | ExposeChange (ScreenEventData *e) |
Default behavior on Expose events is to call Needtodraw(1). | |
virtual int | DeviceChange (const DeviceEventData *e) |
virtual int | KeyUp (unsigned int ch, unsigned int state, const LaxKeyboard *kb) |
Called when a key is released. | |
virtual int | ButtonDown (int button, int x, int y, unsigned int state, int count, const LaxMouse *m) |
virtual int | ButtonUp (int button, int x, int y, unsigned int state, const LaxMouse *m) |
virtual int | MBDown (int x, int y, unsigned int state, int count, const LaxMouse *d) |
Default is just to return 1. | |
virtual void | contentChanged () |
Windows may call this when their contents change. | |
virtual void | selectionChanged () |
Windows may call this when their selections change. | |
virtual anXWindow * | GetController () |
Return the window most relevant for tab control loops. | |
virtual int | SelectNextControl (const LaxDevice *d) |
Transfer focus to nextcontrol. | |
virtual int | SelectPrevControl (const LaxDevice *d) |
Transfer the focus to prevcontrol. | |
virtual void | ControlActivation (int on) |
Do special activation or not when controls are activated by tabbing. | |
virtual int | AddPrevControl (anXWindow *prev) |
virtual int | AddNextControl (anXWindow *next) |
virtual int | ConnectControl (anXWindow *towhat, int after=1) |
Connect towhat to this. Used for tab loops. | |
virtual int | CloseControlLoop () |
Close a tab loop. | |
virtual void | SetOwner (anXWindow *nowner, const char *mes=NULL, unsigned int send_mask=0) |
Set the new owner and control message. | |
virtual void | SetOwner (unsigned long nowner_id, const char *mes=NULL, unsigned int send_mask=0) |
virtual void | dump_out (FILE *f, int indent, int what, anObject *context) |
Simple dumping function. | |
Public Member Functions inherited from Laxkit::Tagged | |
virtual int | HasTag (const char *tag, int casematters) |
Return whether the tag exists. | |
virtual int | NumberOfTags () |
Return the number of tags, strangely enough. | |
virtual const char * | GetTag (int i) |
Return const pointer to the tag text for tag number i, where i==0 is the first tag. | |
virtual char * | GetAllTags () |
Return a new char[] with a space separated list of all the tags. | |
virtual int | InsertTags (const char *tags, int casematters) |
Insert tags from a string such as 'tag1 tag2 tag3 "tag with spaces" tag4'. | |
virtual int | InsertTag (const char *tag, int casematters) |
Insert tag if it doesn't exist already. | |
virtual int | RemoveTag (const char *tag) |
The tag must be an exact match. | |
virtual int | RemoveTag (int i) |
Remove tag number i. i must be in range [0..NumberOfTags()-1]. | |
virtual void | FlushTags () |
Public Member Functions inherited from LaxFiles::DumpUtility | |
virtual void | dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att) |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts. | |
virtual | ~DumpUtility () |
Empty virtual destructor. | |
Public Member Functions inherited from Laxkit::aDrawable | |
aDrawable (Drawable d=0) | |
virtual int | DrawableType () |
virtual int | ValidDrawable () |
Public Member Functions inherited from Laxkit::TextEditBaseUtf8 | |
TextEditBaseUtf8 (const char *newtext=NULL, unsigned long nstyle=0, unsigned int ncntlchar=0) | |
Constructor. | |
virtual | ~TextEditBaseUtf8 () |
delete[] thetext and cutbuffer. | |
virtual int | charwidth (unsigned int usc, int actual=0) |
virtual int | GetTabChar (int atpix) |
For CHAR_TABS, returns the character to center on, or 0 if no such tab there. | |
virtual int | GetNextTab (int atpix) |
Redefine for custom tabstops, default is even spacing with tabwidth pixels. | |
virtual int | GetNextTab (int atpix, int &tabtype) |
Redefine for custom tabstops, default is even spacing with tabwidth pixels. | |
virtual int | inschar (unsigned int ucs, char a=1) |
Insert character at curpos. Afterward, make curpos on it (a==0) or after (a==1) it. Ignores selection, always at curpos. | |
virtual int | replacesel (unsigned int ucs) |
Replace the selection with character ch. | |
virtual int | onlf (long pos=-1) |
Return whether pos is on a delimiter. 0==no, 1==first delimiter, 2==second delimeter. | |
virtual int | findword (long pos, long &start, long &end) |
Find the start and end of a word that includes position pos. | |
virtual int | readonly (long pos=-1) |
Returns if the text is readonly at the given position. | |
virtual const char * | GetCText () |
Return a const pointer to thetext. | |
virtual char * | GetText () |
Return a new char[] copy of thetext. | |
virtual char * | GetSelText () |
Return a new char[] copy of the selected text. | |
virtual char * | CutSelText () |
Cut out the selected text, and return a copy to a new char[] containing the text. | |
virtual long | GetSelection (long &sels, long &sele) |
Get information about the selection positions. | |
virtual long | Getnumlines () |
Return the number of newlines in the whole buffer. | |
virtual long | Getnlines (long s=-1, long e=-1) |
Return the number of newlines in range [s,e]. | |
virtual long | Getcharswide () |
Returns most characters wide in all of lines of thetext. | |
virtual int | Getpixwide (long linenum) |
Return pix wide of line from p to newline. | |
virtual int | Modified (int m=1) |
virtual int | Undo () |
virtual int | Redo () |
virtual long | GetCurLine () |
virtual long | SetCurLine (long nline) |
virtual long | GetCurpos () |
virtual long | SetCurpos (long ncurpos) |
Returns new curpos. | |
virtual int | SetDelimiter (char n1, char n2=0) |
Set the newline delimiter to "n1n2". n2==0 means use single character newline. | |
virtual int | Find (const char *str, int fromcurs=1) |
Find str in thetext, start search at fromcurs, wrap around. | |
virtual int | Replace (const char *newstr, int start, int end) |
Replace a range of text with a new string. |
Public Attributes | |
int | padx |
int | pady |
Protected Member Functions | |
virtual int | send () |
Protected Member Functions inherited from Laxkit::TextXEditBaseUtf8 | |
virtual void | docaret (int w=1) |
Inverts the caret area. DrawCaret is responsible for maintaining con. | |
virtual void | settextrect () |
This updates textrect based on new window dimensions. | |
virtual int | selectionDropped (unsigned char *data, unsigned long len, Atom actual_type, Atom which) |
virtual char * | getSelectionData (int *len, Atom property, Atom targettype, Atom selection) |
Return the selected text, or NULL if no selection. | |
Protected Member Functions inherited from Laxkit::anXWindow | |
virtual int | deletekid (anXWindow *w) |
Purges child anXWindows from window's child stack. | |
virtual void | SwapBuffers () |
Swap buffers. This should be called from Refresh() if VIEWPORT_BACK_BUFFER is set in win_style. | |
virtual void | SetupBackBuffer () |
Initialize the backbuffer. | |
Protected Member Functions inherited from Laxkit::TextEditBaseUtf8 | |
virtual int | extendtext () |
Extend the memory allocated for thetext. | |
virtual long | nextpos (long l) |
Return the next utf8 character position after l. | |
virtual long | prevpos (long l) |
Return the utf8 character position befor l. | |
virtual void | makevalidpos (long &l) |
Make l point only to 1st byte of a utf8 char or 2-char delimiter. | |
virtual int | Undo (UndoData *data) |
virtual int | Redo (UndoData *data) |
virtual int | AddUndo (int type, const char *str, long len, long start, long end) |
Protected Attributes | |
char * | blanktext |
ButtonDownInfo | buttondown |
int | cdir |
int | scrollwidth |
int | mostpixwide |
int | mostcharswide |
int | maxpixwide |
int | numlines |
int | lpers |
The number of lines per screen. | |
int | longestline |
int | mx |
int | my |
struct Laxkit::MultiLineEdit::Linestat * | linestats |
Holds the character start position, pixel length, and pixel indentation of a screen line. | |
Scroller * | xscroller |
Scroller * | yscroller |
int | xscrollislocal |
int | yscrollislocal |
Protected Attributes inherited from Laxkit::TextXEditBaseUtf8 | |
int | cx |
The x position of the current position, measured from the top left corner of the window. | |
int | cy |
The baseline y position of the current line, measured from the top left corner of the window. | |
int | oldx |
The old value of cx for a caret that might need to be blanked out. | |
int | oldy |
The old value of cy for a caret that might need to be blanked out. | |
int | curlineoffset |
The pixel horizontal offset the text is shifted. | |
char | firsttime |
char | con |
Nonzero if the caret is supposed to be on, and is drawn on, on the screen. | |
long | dpos |
The beginning position in thetext that needs to be redrawn. | |
long | nlines |
The number of lines starting from the line of dpos that must be redrawn. | |
long | oldsellen |
The previous selection length to help narrow down what on screen must be redrawn. | |
long | oldcp |
The previous curpos to help narrow down what on screen must be redrawn. | |
int | textascent |
int | textheight |
int | textdescent |
unsigned long | curtextcolor |
unsigned long | textbgcolor |
unsigned long | curbkcolor |
unsigned long | bkwrongcolor |
unsigned long | wscolor |
LaxFont * | thefont |
int | valid |
An extra modifier to control what colors are used. | |
DoubleRectangle | textrect |
The rectangle inside of which text can be drawn. | |
Protected Attributes inherited from Laxkit::anXWindow | |
char * | win_tooltip |
Convenience variable to hold the window's tooltip, if any. | |
int | needtodraw |
RefPtrStack< anXWindow > | _kids |
Stack of children of the window. | |
Protected Attributes inherited from Laxkit::Tagged | |
PtrStack< char > | list_of_tags |
Protected Attributes inherited from Laxkit::TextEditBaseUtf8 | |
long | curline |
long | curpos |
long | selstart |
long | sellen |
int | cntlmovedist |
int | tabwidth |
char * | thetext |
char * | cutbuffer |
long | textlen |
long | maxtextmem |
char | newline |
char | newline2 |
char | cntlchar |
char | modified |
long | maxtextlen |
long | mintextlen |
long | maxcharswide |
long | mincharswide |
long | maxlines |
long | minlines |
unsigned long | textstyle |
int | undomode |
UndoManager | undomanager |
*** please note this class is currently seriously broken *** Multiline edit with optional word wrap.
Optional scrollers, handles l/r/c/char tabs, simple l/r/c justification.
NOTES: *** means not yet implemented.. Usual char codes: ESC get out of any control modes, deselect selection *** ^l put in/out select line mode *** ^left,^right jump word left or right ^up,^down jump to first/last line on screen ^a select all ^c/C, ^ins copy ^x/X, +del cut ^v/V +ins paste ^w toggle word wrap ^+w toggle show whitespace ^. increase tab width ^, decrease tab width ^t ??? set l/r/c/n tab *** slide around a guide??? *** rm tab*** ^\ toggle show hex chars
lbdbl select word*** lbtrp select line*** rb-drag ShiftScreen*** wheel move y ^wheel move page y +wheel move x ^+wheel move page x
Delete character at curpos. bksp==0 means curpos, else curpos-1.
*** this is rather convoluted, rethink it
Reimplemented from Laxkit::TextEditBaseUtf8.
References Laxkit::TextEditBaseUtf8::delchar(), Laxkit::TextXEditBaseUtf8::dpos, findcaret(), Getmostwide(), linestats, lpers, makeinwindow(), makelinestart(), newxssize(), newyssize(), Laxkit::TextXEditBaseUtf8::nlines, Laxkit::TextEditBaseUtf8::onlf(), and wwinspect().
|
virtual |
Delete selection.
*** a little messy here
Reimplemented from Laxkit::TextEditBaseUtf8.
References Laxkit::TextEditBaseUtf8::delsel(), Laxkit::TextXEditBaseUtf8::dpos, findcaret(), getscreenline(), makeinwindow(), makelinestart(), newxssize(), newyssize(), and Laxkit::TextXEditBaseUtf8::nlines.
Responds to 'xscroller' and 'yscroller'.
Reimplemented from Laxkit::anXWindow.
References findlinestart(), Laxkit::Scroller::GetCurPos(), Laxkit::Scroller::GetCurPosEnd(), lpers, makelinestart(), newxssize(), newyssize(), and ShiftScreen().
|
virtual |
this assumes curlineoffset set correctly
References Laxkit::TextXEditBaseUtf8::curlineoffset, Laxkit::TextXEditBaseUtf8::cy, Laxkit::TextXEditBaseUtf8::GetExtent(), linestats, lpers, Laxkit::TextEditBaseUtf8::onlf(), and Laxkit::TextXEditBaseUtf8::textrect.
Referenced by delchar(), delsel(), Find(), findpos(), inschar(), insstring(), LBDblClick(), makeinwindow(), Replace(), SetCurPos(), SetSelection(), SetText(), SetupScreen(), ShiftScreen(), and wwinspect().
|
virtual |
Returns pos of start of next potential screen line after ls, assumes ilsofar set right updates ilsofar which basically becomes pixlen of line with ls.
References Laxkit::TextXEditBaseUtf8::GetExtent(), isword(), Laxkit::TextEditBaseUtf8::nextpos(), Laxkit::TextEditBaseUtf8::onlf(), and Laxkit::TextEditBaseUtf8::prevpos().
Referenced by findlinestart(), makelinestart(), and wwinspect().
Returns position most appropriate for x=pix, y=screen line l.
Sets curpos to pos near (x,y)=(pix,l)
If conv==1 then l is a pixel value.
References countout(), Laxkit::TextXEditBaseUtf8::curlineoffset, Laxkit::TextXEditBaseUtf8::cy, findcaret(), linestats, lpers, Laxkit::TextEditBaseUtf8::makevalidpos(), Laxkit::TextEditBaseUtf8::nextpos(), Laxkit::TextEditBaseUtf8::onlf(), Laxkit::TextEditBaseUtf8::prevpos(), and Laxkit::TextXEditBaseUtf8::textrect.
Referenced by LBDblClick(), LBDown(), and MouseMove().
|
virtual |
Returns which line is the most pixels wide.
Does not recompute linestats.pixlens
References linestats, lpers, Laxkit::Scroller::SetSize(), and Laxkit::TextXEditBaseUtf8::textrect.
Referenced by delchar(), inschar(), makeinwindow(), SetText(), and SetupScreen().
|
virtual |
Return the screen line corresponding to character pos.
If the position is before the screen, then -1 is returned. If the position is after the screen, then lpers+2 is returned.
*** see also WhichLine()..
References linestats, and lpers.
Referenced by delsel().
currently empty...
Reimplemented from Laxkit::anXWindow.
|
virtual |
If multilineedit uses outside supplied scrollers, the must be passed into this before init is called. Otherwise new scrollers are created here.
Init sets an initial textrect size, and sets curlineoffset to be at padx.
Reimplemented from Laxkit::TextXEditBaseUtf8.
References Laxkit::TextXEditBaseUtf8::curlineoffset, Laxkit::TextXEditBaseUtf8::settextrect(), and Laxkit::TextXEditBaseUtf8::textrect.
|
virtual |
Reimplemented from Laxkit::anXWindow.
References Laxkit::ButtonDownInfo::down(), findpos(), LBDblClick(), and makeinwindow().
|
virtual |
Make sure curpos is in the window somewhere (shifts screen, does not change curpos.
Assumes the caret's cx,cy already set accurately.
References Laxkit::TextXEditBaseUtf8::cy, findcaret(), Getmostwide(), lpers, makelinestart(), newxssize(), newyssize(), Laxkit::Scroller::SetCurPos(), and Laxkit::TextXEditBaseUtf8::textrect.
Referenced by delchar(), delsel(), Find(), inschar(), insstring(), LBDown(), Replace(), SetCurPos(), and SetSelection().
|
virtual |
Remaps linestats, but does not findcaret.
It does find and set mostpixwide,longestline, dpos,nlines
ulwc | Screen line to begin remapping from |
godown | Character to place at beginning of screen line startline |
ifdelete | If godown<=0, then remap backwards from startline, else forwards from startline 1 to reallocate linestats, else do not reallocate |
References Laxkit::TextXEditBaseUtf8::dpos, findline(), findlinestart(), linestats, lpers, Laxkit::TextXEditBaseUtf8::nlines, Laxkit::TextEditBaseUtf8::onlf(), and Laxkit::TextEditBaseUtf8::prevpos().
Referenced by delchar(), delsel(), Event(), insstring(), makeinwindow(), SetText(), SetupScreen(), ShiftScreen(), and wwinspect().
|
virtual |
Reimplemented from Laxkit::anXWindow.
References findpos(), Laxkit::ButtonDownInfo::isdown(), lpers, Laxkit::ButtonDownInfo::move(), and ShiftScreen().
*** probably should cache resize events, so don't have to constantly SetupScreen which drag-resizing a window.
Reimplemented from Laxkit::TextXEditBaseUtf8.
References Laxkit::TextXEditBaseUtf8::settextrect(), and SetupScreen().
|
virtual |
NOTE: the scrollers are always flush with right and bottom, and newyssize,newxssize modify textrect
Referenced by delchar(), delsel(), Event(), inschar(), insstring(), makeinwindow(), SetText(), SetupScreen(), ShiftScreen(), UseTheseScrollers(), and wwinspect().
Reimplemented from Laxkit::TextEditBaseUtf8.
References findcaret(), makeinwindow(), and Laxkit::TextEditBaseUtf8::Replace().
*** probably should cache resize events, so don't have to constantly SetupScreen which drag-resizing a window.
Reimplemented from Laxkit::TextXEditBaseUtf8.
References Laxkit::TextXEditBaseUtf8::settextrect(), and SetupScreen().
|
virtual |
Sets up lpers, does Getmostwide(), and moves scrollers (if any) to correct positions. Then findcaret().
*** if (xscroller && xscroller->win_on) xscroller->MoveResize(0,win_h-scrollwidth, win_w,scrollwidth);
*** if (yscroller && yscroller->win_on) yscroller->MoveResize(win_w-scrollwidth,0, scrollwidth,win_h);
References findcaret(), Getmostwide(), lpers, makelinestart(), Laxkit::Scroller::MoveResize(), newxssize(), newyssize(), and Laxkit::TextXEditBaseUtf8::textrect.
Referenced by MoveResize(), Resize(), SetupMetrics(), and UseTheseScrollers().
Shift the view by x pixels and y lines.
Returns 1 if there is a change, 0 if not
References Laxkit::TextXEditBaseUtf8::curlineoffset, findcaret(), Laxkit::Scroller::GetCurPos(), linestats, lpers, makelinestart(), newxssize(), newyssize(), and Laxkit::Scroller::SetCurPos().
Referenced by Event(), MouseMove(), WheelDown(), and WheelUp().
Use these external scrollers, rather than dynamically add and remove them.
References Laxkit::anXApp::destroywindow(), newxssize(), newyssize(), SetupScreen(), Laxkit::TextXEditBaseUtf8::textrect, and Laxkit::anXWindow::win_on.
|
virtual |
Return which screen line pos is in.
If the position is before the screen, then -1 is returned. If the position is after the screen, then lpers is returned (*** is that really oK??).
*** see getscreenline()... this is reimp from TextEditBaseUtf8, i think its really supposed to be the absolute line..
This function is used in TextXEditBaseUtf8::DrawCaret() to figure out what lines to either highlight or de-highlight.
Reimplemented from Laxkit::TextEditBaseUtf8.
|
virtual |
Try to figure out if screen still laid out correctly based on word wrapping.
Called anytime changes are made in thetext. It changes linestats, needtodraw, dpos, nlines.
This inspects lines starting at fromline to ensure that they are. correct given current wrapping setup. It was checking each line only until the next line is correct, but that doesn't catch all changes, for instance adding a character to one line may change the previous line (if it is a space in a wrapped word for instance) or it may only cause the line it was typed on wrap differently. So you must scan from fromline to eo-screen.
References Laxkit::TextXEditBaseUtf8::dpos, findcaret(), findline(), findlinestart(), linestats, lpers, makelinestart(), newxssize(), newyssize(), and Laxkit::TextXEditBaseUtf8::nlines.
|
protected |
The number of lines per screen.
Line 0 is the first line of the screen and line lpers-1 is the last full line on the screen. Typically lines do not fit exactly on the screen, but it is useful to have a couple extra. So line lpers is usually the half on screen line, and line lpers+1 is the next line after that. The linestats array will have lpers+2 elements.
This is set only in SetupScreen(), newxsize() and newysize().
Referenced by delchar(), DrawText(), Event(), findcaret(), findpos(), Getmostwide(), getscreenline(), inschar(), insstring(), makeinwindow(), makelinestart(), MouseMove(), SetupScreen(), ShiftScreen(), WheelDown(), WheelUp(), WhichLine(), and wwinspect().