2008-10-13 11:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* source/rtl/teditor.prg
    + Added :LineCount(), :ExitState() methods.
    * Changed to use hb_MemoWrit() to write text content to 
      disk, to avoid Chr(26) to be appended.
    ! Fixed :InsertState() to also modify physical cursor state.
    ! Fixed :BrowseText() to not go into an infinite loop in 
      view mode.

  * source/rtl/memofile.c
    ! Minor formatting.

  * ChangeLog
    ! Fixed yesterday's entry dates.
This commit is contained in:
Viktor Szakats
2008-10-13 09:23:59 +00:00
parent 5537bc24d0
commit d7551ec7b3
3 changed files with 34 additions and 4 deletions

View File

@@ -8,7 +8,22 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-10-11 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
2008-10-13 11:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/teditor.prg
+ Added :LineCount(), :ExitState() methods.
* Changed to use hb_MemoWrit() to write text content to
disk, to avoid Chr(26) to be appended.
! Fixed :InsertState() to also modify physical cursor state.
! Fixed :BrowseText() to not go into an infinite loop in
view mode.
* source/rtl/memofile.c
! Minor formatting.
* ChangeLog
! Fixed yesterday's entry dates.
2008-10-12 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapierr.h
! Fixed previous casting fix.
@@ -32,7 +47,7 @@
* harbour/source/vm/thread.c
* do not destroy critical sections on exit
2008-10-11 16:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
2008-10-12 16:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* make_b32.mak
* make_vc.mak
* make_gcc.mak

View File

@@ -150,7 +150,7 @@ HB_FUNC( HB_MEMOWRIT )
HB_FUNC( MEMOWRIT )
{
#ifdef HB_EXTENSION
hb_retl( hb_memowrit( hb_parinfo(0) == 3 && ISLOG( 3 ) ? hb_parl( 3 ) : TRUE ) );
hb_retl( hb_memowrit( hb_parinfo( 0 ) == 3 && ISLOG( 3 ) ? hb_parl( 3 ) : TRUE ) );
#else
hb_retl( hb_memowrit( TRUE ) );
#endif

View File

@@ -75,6 +75,7 @@ CREATE CLASS HBEditor
METHOD LineLen( nRow ) // Return text length of line n
METHOD SplitLine( nRow ) // If a line of text is longer than nWordWrapCol divides it into multiple lines
METHOD GotoLine( nRow ) // Put line nRow at cursor position
METHOD LineCount() // Returns number of lines in text.
METHOD GetText() // Returns aText as a string (for MemoEdit())
@@ -86,6 +87,7 @@ CREATE CLASS HBEditor
METHOD MoveCursor( nKey ) // Move cursor inside text / window (needs a movement key)
METHOD InsertState( lInsState ) // Changes lInsert value and insertion / overstrike mode of editor
METHOD Edit( nPassedKey ) // Handles input (can receive a key in which case handles only this key and then exits)
METHOD ExitState() // Returns ::lEditExit
METHOD KeyboardHook( nKey ) // Gets called every time there is a key not handled directly by HBEditor
METHOD IdleHook() // Gets called every time there are no more keys to hanlde just before HBEditor blocks itself waiting for a char
@@ -232,7 +234,7 @@ METHOD SaveFile() CLASS HBEditor
IF !Empty( ::cFile )
::lDirty := !MemoWrit( ::cFile, ::GetText() )
::lDirty := !hb_MemoWrit( ::cFile, ::GetText() )
RETURN !::lDirty
ENDIF
@@ -325,6 +327,9 @@ METHOD GotoLine( nRow ) CLASS HBEditor
RETURN Self
METHOD LineCount() CLASS HBEditor
RETURN ::naTextLen
// If a line of text is longer than nWordWrapCol divides it into multiple lines,
// Used during text editing to reflow a paragraph
METHOD SplitLine( nRow ) CLASS HBEditor
@@ -628,6 +633,9 @@ METHOD InsertState( lInsState ) CLASS HBEditor
IF ISLOGICAL( lInsState )
::lInsert := lInsState
Set( _SET_INSERT, lInsState )
IF ::lEditAllow
SetCursor( iif( lInsState, SC_INSERT, SC_NORMAL ) )
ENDIF
ENDIF
RETURN Self
@@ -792,6 +800,9 @@ METHOD Edit( nPassedKey ) CLASS HBEditor
RETURN Self
METHOD ExitState() CLASS HBEditor
RETURN ::lEditExit
// This in an empty method which can be used by classes subclassing HBEditor to be able
// to handle particular keys.
METHOD KeyboardHook( nKey ) CLASS HBEditor
@@ -942,6 +953,10 @@ METHOD BrowseText( nPassedKey )
ENDIF
ENDIF
IF nPassedKey != NIL
EXIT
ENDIF
ENDDO
RETURN Self