HiEdit is a multitabbed, ultra fast, large file edit control consuming very little memory. It can display non-printable characters in a readable format and can be used for any general purpose editing of text and birary files.
| HiEdit | HiEdit is a multitabbed, ultra fast, large file edit control consuming very little memory. |
| Add | Add control to the GUI. |
| AutoIndent | Sets the autoindent state |
| CloseFile | Close file or all files |
| ConvertCase | Convert case of selected text |
| EmptyUndoBuffer | Resets the undo flag in the HiEdit control for the current file. |
| FindText | Find desired text in the control |
| GetColors | Get the control colors |
| GetCurrentFile | Get the index of the current file |
| GetFileCount | Returns count of open files. |
| GetFileName | Get the file path. |
| GetFirstVisibleLine | Returns the zero-based index of the uppermost visible line. |
| GetLine | Get the text of the desired line from the control |
| GetLineCount | Returns an integer specifying the number of lines in the HiEdit control. |
| GetModify | Gets the state of the modification flag for the HiEdit control. |
| GetRedoData | Returns redo type and/or data for desired redo level. |
| GetSel | Get letfmost and/or rightmost character positions of the selection |
| GetSelText | Returns selected text |
| GetTextLength | Returns the length of text, in characters. |
| GetTextRange | Get range of characters from the control |
| GetUndoData | Returns undo type and/or data for desired undo level. |
| LineFromChar | Returns line number of the line containing specific character index. |
| LineIndex | Returns the character index of the line. |
| LineLength | Returns the lenght of the line. |
| LineNumbersBar | Sets the line numbers bar state and looks. |
| LineScroll | Scrolls the text in the HiEdit control for the current file. |
| NewFile | Opens new tab. |
| OpenFile | Open file in new tab |
| Redo | Do redo operation |
| ReloadFile | Reload file |
| ReplaceSel | Replace selection with desired text |
| SaveFile | Save file to disk |
| Scroll | Scrolls the text vertically in the HiEdit control for the current file. |
| ScrollCaret | Scroll content of control until caret is visible. |
| SetColors | Set the control colors |
| SetCurrentFile | Set the the current file |
| SetEvents | Set notification events |
| SetFont | Sets the control font |
| SetKeywordFile | Set syntax highlighting. |
| SetModify | Sets or clears the modification flag for the current file. |
| SetSel | Set the selection |
| SetTabWidth | Sets the tab width |
| SetTabsImageList | Sets the image list of the tab navigation toolbar |
| ShowFileList | Show popup menu containg list of open files. |
| Undo | Do undo operation |
| Syntax Coloring | The file .hes is structured in sections, each of which specify the keywords for a one (or more) file extension. |
| Example | |
| About |
HE_Add( hwnd, x, y, w, h, style = "HSCROLL VSCROLL", dllPath = "HiEdit.dll" )
Add control to the GUI.
| x,y,w,h | Position of the control |
| style | Space separated list of control styles, by default both scroll bars are visible. You can use numbers or style strings. |
| dllPath | Path of the control dll, by default control is searched in the current folder. |
HSCROLL, VSCROLL, TABBED, HILIGHT, TABBEDBTOP, TABBEDHRZSB, TABBEDBOTTOM
HE_FindText( hEdit, sText, cpMin = 0, cpMax = -1, flags = "" )
Find desired text in the control
| sText | Text to be searched for. |
| cpMin | Start searching at this character position. By default 0. |
| cpMax | End searching at this character position. By default -1. |
| flags | Space separated combination of search flags: “WHOLEWORD” “MATCHCASE” |
The zero-based character position of the next match, or -1 if there are no more matches.
HE_GetLine( hEdit, idx = -1 )
Get the text of the desired line from the control
| idx | Zero-based index of the line. -1 means current line. |
The return value is the text. The return value is empty string if the line number specified by the line parameter is greater than the number of lines in the HiEdit control
HE_GetModify( hEdit, idx = -1 )
Gets the state of the modification flag for the HiEdit control. The flag indicates whether the contents of the control have been modified.
| idx | Index of the file. -1 for the current file (default) |
TRUE if the content of HiEdit control has been modified, FALSE otherwise.
HE_GetRedoData( hEdit, level )
Returns redo type and/or data for desired redo level. The same rules as in GetUndoData
HE_GetUndoData( hEdit, level )
Returns undo type and/or data for desired undo level.
| level | Undo level |
| UNKNOWN | The type of undo action is unknown. |
| TYPING | Typing operation. |
| DELETE | Delete operation. |
| DRAGDROP | Drag-and-drop operation. |
| CUT | Cut operation. |
| PASTE | Paste operation. |
| SETTEXT | WM_SETTEXT message was used to set the control text |
| REPLACESEL | EM_REPLACESEL message was used to insert text |
| CLEAR | Delete selected text |
| BACKSPACE | Back Space Operation |
| INDENT | Increase Indent |
| OUTDENT | Decrease Indent |
| CODEPAGE | Convert codepage |
| CASE | Convert case |
HE_LineFromChar( hEdit, ich )
Returns line number of the line containing specific character index.
| ich | The character index of the character contained in the line whose number is to be retrieved. If the ich parameter is -1, either the line number of the current line (the line containing the caret) is retrieved or, if there is a selection, the line number of the line containing the beginning of the selection is retrieved. |
The zero-based line number of the line containing the character index specified by ich.
HE_LineIndex( hedit, idx = -1 )
Returns the character index of the line.
| idx | Line number for which to retreive character index. -1 (default) means current line. |
The character index of the line specified in the idx parameter, or -1 if the specified line number is greater than the number of lines.
HE_LineScroll( hEdit, xScroll = 0, yScroll = 0 )
Scrolls the text in the HiEdit control for the current file.
| xScroll | The number of characters to scroll horizontally. Use a negative number to scroll to the left and a positive number to scroll to the right. |
| yScroll | The number of lines to scroll vertically. Use a negative number to scroll up and a positive number to scroll down. |
This message does not move the caret.
The HiEdit control does not scroll vertically past the last line of text in the control. If the current line plus the number of lines specified by the yScroll parameter exceeds the total number of lines in the HiEdit control, the value is adjusted so that the last line of the HiEdit control is scrolled to the top of the HiEdit control window.
This function can be used to scroll horizontally past the last character of any line.
HE_Scroll( hEdit, Pages = 0, Lines = 0 )
Scrolls the text vertically in the HiEdit control for the current file.
| Pages | The number of pages to scroll. Use a negative number to scroll up and a positive number to scroll down. |
| Lines | The number of lines to scroll. Use a negative number to scroll up and a positive number to scroll down. |
The number of lines that the command scrolls. The number returned may not be the same as the actual number of lines scrolled if the scrolling moves to the beginning or the end of the text.
This message does not move the caret. 0x7FFFFFFF = 2147483647 = largest possible 32-bit signed integer value
Despite the documentation, the return value for the message always reflects the request, not necessarily the actual number of lines that were scrolled. Example: If a request to scroll down 25 lines is made, 25 is returned even if the control is already scrolled down to the bottom of the document. [Bug?]
HE_SetColors( hEdit, colors, fRedraw = true )
Set the control colors
| colors | Any subset of available color options in INI format (array of NAME=COLOR lines). Skiped colors will be set to 0. |
| fRdraw | Set to TRUE to redraw control |
| Text | Normal Text Color |
| Back | Editor Back Color |
| SelText | Selected Text Color |
| ActSelBack | Active Selection Back Color |
| InSelBack | Inactive Selection Back Color |
| LineNumber | Line Numbers Color |
| SelBarBack | Selection Bar Back Color |
| NonPrintableBack | 0 - 31 special non printable chars |
| Number | Number Color |
HE_SetEvents( hEdit, func, e = "selchange" )
Set notification events
| func | Subroutine that will be called on events. |
| e | White space separated list of events to monitor (by default “selchange”). |
| HE_EVENT | Specifies event that occurred. Event must be registered to be able to monitor them. Events “tabmclick” and “filechange” are registered automatically. |
| HE_INFO | String specifying event info. |
| SelChange | S<start_char_idx> E<end_char_idx> L<line_num> [t|*] (t if tab changed, * if text changed) |
| Key | key pressed |
| Mouse | x<mouse_x> y<mouse_y> v<virtual_key_code> |
| Scroll | ”” |
| ContextMenu | ”” |
| FileChange | <file_index> (file is changed outside of the application) |
| Tabmclick | ”” (middle button click over tab) |
”OK” if succesiful, error string otherwise
The file .hes is structured in sections, each of which specify the keywords for a one (or more) file extension. Thus, a single .hes file can be used to specify the syntax highlight of several different file types.
Each section starts with a list of file extensions, separated by a comma, enclosed in square brackets, for instance
[asm,inc]
starts a section for the keywords that will be applied to .asm and .inc files.
The lines following the section start will specify a color and the keywords to which it is applied in this form :
0x00bbggrr = keyword1 keyword2 keyword3 ...
A line starting with ; is a comment and ignored by the syntax highlight parser.
This is an simplified example of a .hes syntax highlight file.
[asm,inc] ;Registers 0x00408080=~AH ~AL ~AX ~BH ~BL ~BH ;User instructions 0x008000ff=~AAA ~AAD ~AAM ~AAS ~ADC ~ADD [rc] ;General statements 0x10000080=#define #include ACCELERATORS ALT AUTOCHECKBOX ;Object states 0x104080ff=^BS_3STATE ^BS_AUTO3STATE ^BS_AUTOCHECKBOX
| [[,]ext1,ext2,...,extN] | Each keyword definiton block starts with list of extensions in angular brackets. If started with comma, this section will be used for coloring of new files. |
| 0xSSRRGGBB=word1 .. wordN | Color keywords on this line with RRGGBB color. SS is 00 by default. |
| delimiters | High byte in the color (0x01xxxxxx) refers to delimiters. Delimiters are added from ALL sections for a file extension. |
| & | A & at the end of keyword specifies a string char. For ex. “& means that everything enclosed in two “ is a string |
| + | A + at the end of keyword specifies a comment char/keyword. For ex. //+ means that everything that follows is a comment. Multiline comments are not supported yet. |
| ! | A ! at the end of any delimiter indicates that any word starting with this delimiter will be colored. For example $! marks php variables. |
| - | A - at the end of keyword specifies that ALL text up to the end of line will be painted using the color specified UNLESS a comment indicator is found. |
| ~ | A ~ in front of keyword forces the specified case (display only). |
| ^ | A ^ in front of keyword means that the keyword is case sensitive. |
| ; | Line comment in hes file. |
Add control to the GUI.
HE_Add( hwnd, x, y, w, h, style = "HSCROLL VSCROLL", dllPath = "HiEdit.dll" )
Sets the autoindent state
HE_AutoIndent( hEdit, pState )
Close file or all files
HE_CloseFile( hEdit, idx = -1 )
Convert case of selected text
HE_ConvertCase( hEdit, case = "toggle" )
Resets the undo flag in the HiEdit control for the current file.
HE_EmptyUndoBuffer( hEdit )
Find desired text in the control
HE_FindText( hEdit, sText, cpMin = 0, cpMax = -1, flags = "" )
Get the control colors
HE_GetColors( hEdit )
Get the index of the current file
HE_GetCurrentFile( hEdit )
Returns count of open files.
HE_GetFileCount( hEdit )
Get the file path.
HE_GetFileName( hEdit, idx = -1 )
Returns the zero-based index of the uppermost visible line.
HE_GetFirstVisibleLine( hEdit )
Get the text of the desired line from the control
HE_GetLine( hEdit, idx = -1 )
Returns an integer specifying the number of lines in the HiEdit control.
HE_GetLineCount( hEdit )
Gets the state of the modification flag for the HiEdit control.
HE_GetModify( hEdit, idx = -1 )
Returns redo type and/or data for desired redo level.
HE_GetRedoData( hEdit, level )
Get letfmost and/or rightmost character positions of the selection
HE_GetSel( hEdit, ByRef start_pos = "@", ByRef end_pos = "@" )
Returns selected text
HE_GetSelText( hEdit )
Returns the length of text, in characters.
HE_GetTextLength( hEdit )
Get range of characters from the control
HE_GetTextRange( hEdit, min = 0, max = -1 )
Returns undo type and/or data for desired undo level.
HE_GetUndoData( hEdit, level )
Returns line number of the line containing specific character index.
HE_LineFromChar( hEdit, ich )
Returns the character index of the line.
HE_LineIndex( hedit, idx = -1 )
Returns the lenght of the line.
HE_LineLength( hEdit, idx = -1 )
Sets the line numbers bar state and looks.
HE_LineNumbersBar( hEdit, state = "show", linw = 40, selw = 10 )
Scrolls the text in the HiEdit control for the current file.
HE_LineScroll( hEdit, xScroll = 0, yScroll = 0 )
Opens new tab.
HE_NewFile( hEdit )
Open file in new tab
HE_OpenFile( hEdit, pFileName, flag = )
Do redo operation
HE_Redo( hEdit )
Reload file
HE_ReloadFile( hEdit, idx = -1 )
Replace selection with desired text
HE_ReplaceSel( hEdit, text = "" )
Save file to disk
HE_SaveFile( hEdit, pFileName, idx = -1 )
Scrolls the text vertically in the HiEdit control for the current file.
HE_Scroll( hEdit, Pages = 0, Lines = 0 )
Scroll content of control until caret is visible.
HE_ScrollCaret( hEdit )
Set the control colors
HE_SetColors( hEdit, colors, fRedraw = true )
Set the the current file
HE_SetCurrentFile( hEdit, idx )
Set notification events
HE_SetEvents( hEdit, func, e = "selchange" )
Sets the control font
HE_SetFont( hEdit, pFont = "" )
Set syntax highlighting.
HE_SetKeywordFile( pFile )
Sets or clears the modification flag for the current file.
HE_SetModify( hEdit, Flag )
Set the selection
HE_SetSel( hEdit, nStart = 0, nEnd = -1 )
Sets the tab width
HE_SetTabWidth( hEdit, pWidth, pRedraw = true )
Sets the image list of the tab navigation toolbar
HE_SetTabsImageList( hEdit, pImg = "" )
Show popup menu containg list of open files.
HE_ShowFileList( hEdit, x = 0, y = 0 )
Do undo operation
HE_Undo( hEdit )