<ClassName> | MEDIT |
<Tobj> | Array, an array of TEXTEDIT objects |
<TobjInfo> | Array, an array of window information for every element <Tobj> |
<Curwin> | Numeric, the cureent window number. |
<Clipboard> | Array, an clipboard array. |
<Find> | FIND object, contain search information and options |
<Opt> | Map, the MEDIT configuration |
OCREATEBAK - Logical, if TRUE create .bak files, specified TE_CREATE_BAK | |
OTABSIZE - Numeric, the tabulation size, specified TE_TABSIZE | |
OAUTOSAVE - Logical, if TRUE save TEXEDIT objects automatical every OTIMEAUTOSAVE time, specified TE_AUTO_SAVE | |
OTIMEAUTOSAVE - Numeric, the time autosave in minute, specified TE_TIME_AUTO_SAVE | |
OSAVESTATUS - Logical, if TRUE autosave this options into file, specified TE_SAVE_STATUS | |
OHYPHEN - Logical, if TRUE hyphen, specified TE_HYPHEN. | |
OAUTOMARGIN - Logical, if TRUE auto margin boundary, specified TE_AUTO_MARGIN. | |
OMARGINLEFT - Numeric, the left margin, specified TE_MARGIN_LEFT. | |
OMARGINRIGHT - Numeric, the right margin, specified TE_MARGIN_RIGHT. | |
OAUTOINDENT - Logical, if TRUE auto set new column position by position first letter of previouse line, specified TE_AUTO_IDENT. | |
<Templ> | Map, the key is template, data - substring to replace. |
<Tempmacro> | Map, the key is template, data - macro values. |
<UserFunc> | String, the name user function. |
<nTop> | a MEDIT viewport coordinates (default - 0) |
<nLeft> | a MEDIT viewport coordinates (default - 0) |
<nBot> | a MEDIT viewport coordinates (default - maxrow()) |
<nRight> | a MEDIT viewport coordinates (default - maxcol()) |
<Param> | Array, array of file names to edit. |
<Tab_size> | Numeric, the tabulation size. |
<bLine> | Numeric, the line number by loading (default 1). |
<bPos> | Numeric, the column number by loading (default 1). |
<wLine> | Numeric, the line number in viewport by loading (default 1). |
<wPos> | Numeric, the column number in viewport by loading (default 1). |
<Single_mode> | Logical, if TRUE - the draw mode is SINGLE (default FALSE) |
<Double_mode> | Logical, if TRUE - the draw mode is DOUBLE (default FALSE). |
<stLine> | String, the status line text (default [ESC - menu]). |
<oMenu> | MENU object. |
<AutoIndent> | Logical, if TRUE auto identification new column position into new line by previose line (default TRUE) |
APPLYHASH | Evaluate the code block. |
BACKSPACE | Delete symbol. |
CALLMENU | Call and run menu. |
CANCELBLOCK | Unmark block. |
CENTERLINE | Centered line. |
CHANGECHARSET | Change charset. |
CHOOSECODEPAGE | Choose and set new codepage. |
CLOSEWINDOW | Close window. |
COPYBLOCK | Copy or move block to new position line and column. |
COPYTOCLIPBOARD | Copy block to clipboard. |
CREATENEWWINDOW | Create new TEXTEDIT object into new window. |
DELETE | Delete symbol. |
DELETEBLOCK | Remove block. |
DELETEEND | Delete string from current column to th end of string. |
DELETEHOME | Delete string from cuurent column to the start of string. |
DELETELINE | Delete line. |
DRAWHEAD | Draw border header. |
EDITKEYS | Edit MEDIT options. |
EDITOPT | Edit MEDIT options. |
ENABLEBLOCKMENU | Enable block menu items. |
ENABLEMENU | Enable menu items. |
FINDNEXT | Search continue to forward. |
FINDPREV | Search continue to backward. |
FINDREPLACE | Find and replace string or regular expression within current one or all windows. |
FINDSTRING | Find string or regular expression within current one or all windows. |
FORMAT | Format line or part of text. |
GETREADONLY | Get mode Read Only. |
GOTO | Run dialog "Go to line". |
HELPEDIT | Make help. |
INITUSERMACRO | Initiation users macros. |
INSMACRO | Insert text string(s) by after do macro expression. |
INSTEMPLATE | Insert text string(s) by template. |
LISTFILES | Show listing opened files. |
LOADBLOCK | Load block from file. |
MARKBLOCK | Start/stop to mark block. |
MATCHSTRUCTURE | Match structure within window. |
MATCHSYMBOL | Match symbol within window. |
MEDIT | MEDIT constructor. |
MENU | Create common menu for MEDIT object. |
NEWLINE | Goto new line of window. |
NEXTWINDOW | Change current window to next. |
OPENFILE | Open file into new window. |
PASTEFROMCLIPBOARD | Paste block from clipboard. |
PREVWINDOW | Change current window to previous. |
Print file or marked block. | |
RELOADFILE | Reload file. |
REMOVEWINDOW | Remove window |
RUNME | Key code handler() |
SAVEBLOCK | Save block to file. |
SAVEFILE | Save file. |
SAVEOPTIONS | Save MEDIT options. |
SAVEPOS | Save current line position. |
SAVEWINS | Save all windows that contained TEXEDIT objects. |
SETDRAW | Start/Stop lines drow mode. |
SETHASH | Set a code block associated with commands hash code value. |
SETINSERTMODE | Set insert mode. |
SETOPTIONS | Set editor options. |
SHOWFILES | Show listing of opened files. |
UNDO | Make "undo" operation. |
WRITESTATUS | Save MEDIT status. |
ApplyHash(<nHashCode>) --> nResult
ApplyHash() evaluates the code block associeated with hash code <nHashCode> that is contained whithin SetHash() dictionary and returns <nResult>.
<nHashCode> | - Numeric, hash code of command |
Returns : | Returns one of numeric value what definited in edit.ch. ME_EXIT -1 User request for the MEDIT to lose input focus ME_CONTINUE 0 Code block associated with <nHashCode> was evaluated ME_EXCEPTION 1 Unable to locate <nHashCode> in the dictionary, hash code was not processed |
Backspace([<nWin>]) --> .T.
Backspace() is called method Backspace() for TEXTEDIT object <::Tobj[nWin]>.
CallMenu(<nChoice>) --> .T.
CallMenu() is called and ran menu object <::oMenu> that was created within method Menu().
CancelBlock([<nWin>]) --> .T.
CancelBlock() is called method CancelBlock() for TEXTEDIT object <::Tobj[nWin]> .
CenterLine([<nWin>]) --> .T.
CenterLine() is called method CenterLine() for TEXTEDIT object <::Tobj[nWin]>.
ChangeCharset(<nWin>, <sCharset>) --> .T. || .F.
ChangeCharset() is called corresponding method SetCharset() for <::Tobj[nWin]>
ChooseCodePage() --> NIL
ChooseCodePage() is ran dialog "Choose code page" and converted editor buffer <::Tobj[::Curwin]> to choosed code page.
All existing code page reading from directory CLIPROOT()+"/charsets"
CloseWindow([<nWin>]) --> .T.
CloseWindow() is saved file, closed window <nWin> and removed it from are <::Tobj> listing.
CopyBlock([<nWin>][,<lCopy>]) --> .T.
CopyBlock() is called method CopyBlock() or MoveBlock() for TEXTEDIT object <::Tobj[nWin]>.
CopyToClipboard([<nWin>]) --> .T.
CopyToClipboard() is called method CopyToClipboard() for TEXTEDIT object <::Tobj[nWin]>.
CreateNewWindow() --> .T.
CreateNewWindow() is created new TEXTEDIT object into new window.
New window will be created with coordinates <::nTop>, <::nLeft>, <::nBot>, <::nRight> and will be add to listing TEXEDIT objects <::Tobj>. This window will be current and take focus.
Delete([<nWin>]) --> .T.
Delete() is called method DelRight() for TEXTEDIT object <::Tobj[nWin]>.
DeleteBlock([<nWin>]) --> .T.
DeleteBlock() is called method DeleteBlock() for TEXTEDIT object <::Tobj[nWin]>.
DeleteEnd([<nWin>]) --> .T.
DeleteEnd() is called method DelEnd() for TEXTEDIT object <::Tobj[nWin]>.
DeleteHome([<nWin>]) --> .T.
DeleteHome() is called method DelHome() for TEXTEDIT object <::Tobj[nWin]>.
DeleteLine([<nWin>]) --> .T.
DeleteLine() is called method DeleteLine() for TEXTEDIT object <::Tobj[nWin]>.
DrawHead() --> .T.
DrawHead() is drow title for each TEXTEDIT object. Title include next information: file name, read only mode, share mode, SET_INSERT mode, window number.
EnableBlockMenu() --> .T.
EnableBlockMenu() called method MenuItem:EnableStatus() to every items of MENU object that be called block methods.
The status enable specify TRUE if block will be makked.
EnableMenu() --> .T.
EnableMenu() called method MenuItem:EnableStatus() to every items of MENU object that be created winthin method Medit:Menu().
The status enable specify TRUE if will be opened or created even though file.
FindNext([<nWin>]) --> .T.
FindNext() is called method FindNext() for TEXTEDIT object <::Tobj[nWin]> with find options <::Find>.
FindPrev([<nWin>]) --> .T.
FindPrev() is called method FindPrev() for TEXTEDIT object <::Tobj[nWin]> with find options <::Find>.
FindReplace([<nWin>]) --> .T.
FindReplace() is called method Replace() for TEXTEDIT object <::Tobj[nWin]> with find options <::Find>.
FindString([<nWin>]) --> .T.
FindString() is called method Find() for TEXTEDIT object <::Tobj[nWin]> with find options <::Find>.
Format([<nWin>][,<lMode>]) --> .T.
Format() is called method FormatLine() or FormatPart() for TEXTEDIT object <::Tobj[nWin]> with parameters that specified <::Opt>.
GetReadOnly(<nWin>) --> lMode
GetReadOnly() is get read only mode for TEXTEDIT objects <::Tobj[nWin]>.
If <nWin> is NIL, then SetReadOnly() returns FALSE.
Goto() --> nNewLine
Goto() read new line number and if it number between 1 and <::Lines> called method TextEdit:GotoLine() for current TEXTEDIT object.
HelpEdit() --> NIL
HelpEdit() read help for text editor from file CLIPROOT()+"/doc/edit.html"
InitUserMacro(<sIniFileName>) --> .T. || .F.
IniUserMacro() is read file <sIniFileName> and try loaded it. The format .ini file is:
[Label] UFUNC = <UserFuncName> The name user function UFILE = <UserFuncFileName> The full name file .po that contained user function <UserFuncName> [UALLWINS= <lAll>] If .T. user function take object MEDIT, other its take current TEXTEDIT object. (Default is .F.) [UHOTKEY = <HotKeyCode>] The name hot key code into <inkey.ch> [UCOMMAND= <CommandName>] The command name.(Default <UserFuncName>) [UMENUSTR= <MenuString>] The menu items string. (Default <UserFuncName>) [UMENUMSG= <MenuMsg>] The message menu item.
The all users macro will be added to <::oMenu> object into item "Macro".
The function <UserFuncName> take one parameters MEDIT or TEXTEDIT object and can be returns logical value. If users function returns TRUE, then key code processed. If users function return FALSE, then key code can be processed of standart handler RunMe().
InsMacro([<nWin>]) --> .T.
InsMacro() is called method InsMacro() for TEXTEDIT object <::Tobj[nWin]> with templates array <::TemplMacro>.
InsTemplate([<nWin>]) --> .T.
InsTemplate() is called method InsTempl() for TEXTEDIT object <::Tobj[nWin]> with templates array <::Templ>.
ListFiles() --> nCurWindow
ListFiles() is made dialog to choose opened files. It is are listing TEXTEDIT objects.
If window not choosed, ListFiles() returns the number cuurent window.
LoadBlock([<nWin>]) --> .T.
LoadBlock() is choosed file and called method LoadBlock() for TEXTEDIT object <::Tobj[nWin]>.
MarkBlock([<nWin>][,<lMode>]) --> .T.
MarkBlock() is called methods BeginBlock or EndBlock() for TEXTEDIT object <::Tobj[nWin]> .
MatchStructure([<nWin>][,<ldirect>]) --> .T.
MatchStructure() is called method MatchStruct() for TEXTEDIT object <::Tobj[nWin]>.
MatchSymbol([<nWin>][,<lDirect>]) --> .T.
MatchSymbol() is called method Identity() for TEXTEDIT object <::Tobj[nWin]>.
mEdit([<aParam>],[<nTop>],[<nLeft>],[<nBot>],[<nRight>],[<sUserFunc>],[<nTabSize>],[<nBline>],[<nBpos>],[<nWline>],[<nWpos>]) --> MEDIT object mEdit_New([<aParam>],[<nTop>],[<nLeft>],[<nBot>],[<nRight>],[<sUserFunc>],[<nTabSize>],[<nBline>],[<nBpos>],[<nWline>],[<nWpos>]) --> MEDIT object
Medit_new() is constructs and returns new MEDIT object. That class can be used to create, for example, multiwindow text editors.
Medit() is equal to Medit_new(), but it activate method Runme() at once.
<aParam> | Array, the file names to edit. |
<nTop> | Numeric, the viewport coordinates (default 0) |
<nLeft> | Numeric, the viewport coordinates (default 0) |
<nBot> | Numeric, the viewport coordinates (default maxrow()) |
<nRight> | Numeric, the viewport coordinates (default maxcol()) |
<sUserFunc> | String, the user function name |
<nTabSize> | Numeric, the tabulation size (default TE_TABSIZE) |
<nBline> | Numeric, the begin line position into editor buffer for each TEXTEDIT object (default 1) |
<nBpos> | Numeric, the begin column position into editor buffer (default 1) |
<nWline> | Numeric, the begin line position into viewport (default 1) |
<nWpos> | Numeric, the begin column position into viewport (default 1) |
Returns : | New MEDIT object |
Menu() --> oMenu
Menu() created new MENU object to control MEDIT object.
Menu() is calls automaticaly from one of constructors.
NewLine([<nWin>]) --> .T.
NewLine() is called method InsertLine() if Set(_SET_INSERT) is TRUE and method NewLine()for TEXTEDIT object <::Tobj[nWin]>.
NextWindow() --> .T.
NextWindow() is changed current window to next. <::Curwin> increased by one.
OpenFile() --> .T. || .F.
OpenFile() is ran file dialog and loaded to new TEXTEDIT object selected file within new window..
New window will be created with coordinates <::nTop>, <::nLeft>, <::nBot>, <::nRight> and will be add to listing TEXEDIT objects <::Tobj>. This window will be current and take focus.
PasteFromClipboard([<nWin>]) --> .T.
PasteFromClipboard() is called method PasteFromClipboard() for TEXTEDIT object <::Tobj[nWin]>.
PrevWindow() --> .T.
PrevWindow() is changed current window to previous. <::Curwin> decreased by one.
Print([<nWin>][, <lBlock>]) --> .T.
Print() is printed file or if <lBlock> is TRUE marked block.
ReloadFile([<nWin>]) --> .T.
ReloadFile() is called method LoadFile() for TEXTEDIT object <::Tobj[nWin]> with find options <::Find>.
RemoveWindow([<@nWin>]) --> NIL
RemoveWindow() is removed TEXTEDIT object with number <nWin> from listing <::Tobj> and decreased <nWin> by one.
RunMe() --> NIL
RunMe() is started key code handler of MEDIT object. It processed key code and made corresponding of this key MEDIT command.
SaveBlock([<nWin>]) --> .T.
SaveBlock() is choosed file name and called method SaveBlock() for TEXTEDIT object <::Tobj[nWin]>.
SaveFile([<sFileName>]) --> .T. || .F.
SaveFile() is saved current TEXTEDIT editor buffer (<::Tobj[::Curwin]>) into file <sFileName>. If <sFileName> not specified, then text saved into file with old name specified into TEXTEDIT object attribute <::Path>+<::FileName>.
If option <::Opt:OCREATEBAK> is TRUE, then before saving would be create .bak file.
Save_options() --> .T.
Save_options() is saved MEDIT options <::Opt> to file getenv("HOME")+"/.clip/.edit". Every user can have own file options.
SavePos([<nWin>]) --> .T.
SavePos() is saved current line position of TEXTEDIT object <::Tobj[nWin]> .
SaveWins() --> .T. || .F.
SaveWins() is tryed to save to files all TEXEDIT objects from <::Tobj>.
If all objects was be saved, SaveWins return TRUE, in other FALSE.
SetDraw([<nWin>][,<lDrawMode>]) --> .T.
SetDraw() is set/unset single/double line draw mode.
SetHash(<nHashCode>[, <bData>]) --> bPreviouse
SetHash() is sets a new code block associated with code <nHashCode>. When replacing an existing code block definition, it returns previous code block, in other returns current one. Its associated hash code will be evaluated ApplyHash() methods.
If <bData> is NIL, SetHash() returns old block code and remove hashcommand/code block definition.
A default hash code is cursor moves(K_UP, K_DOWN, K_LEFT, K_RIGHT, K_PGUP, K_PGDN, K_HOME, K_END ....) associates with corresponded methods Left(), Right(), Up(), Down() and more.
SetInsertMode([<lMode>]) --> .T.
SetInsertMode() is sets new insert mode.
Set_options() --> .T.
Set_options() is setted options <::Opt> by default or read its from saved file.
Options file have name: getenv("HOME")+"/.clip/.edit" If this file exist, options reading from it.
For more information about saved options see description of Save_options().
ShowFiles() --> .T.
ShowFiles() is showed opened files and choose some one to edit.
Undo([<nWin>]) --> .T.
Undo() is called method Undo() for TEXTEDIT object <::Tobj[nWin]> .
WriteStatus() --> .T. || .F.
WriteStatus() is saved MEDIT status to file "edit."+getenv("USER"). Every user can have own file options into many directories.
To status file wrote next information:
- the number current window;
- the history opened files;
- the history for FIND and REPLACE operations;
- the information about editing files: full file name, current position line and column into editor buffer, current position line and column into viewport and more.