2000-11-21 17:42 GMT+1 Maurilio Longo <maurilio.longo@libero.it>
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2000-11-21 17:42 GMT+1 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* source/rtl/teditor.prg
|
||||
+ added ::LoadText() method
|
||||
* source/rtl/memoedit.prg
|
||||
! fixed small bug with KEYBOARD statement
|
||||
* contrib/mysql/tsqlbrw.prg
|
||||
* little changes.
|
||||
|
||||
2000-11-20 23:11 GMT+1 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* source/rtl/tbrowse.prg
|
||||
! ::PageDown() fixed bug introduced with previous change
|
||||
|
||||
@@ -247,14 +247,19 @@ METHOD EditField() CLASS TBrowseSQL
|
||||
//@ 10,((76 - Len(::oCurRow:FieldName(oCol:nFieldNum)) / 2) SAY " " + (::oCurRow:FieldName(oCol:nFieldNum)) + " "
|
||||
|
||||
/* edit the memo field */
|
||||
cMemo := MemoEdit(::oCurRow:FieldGet(oCol:nFieldNum), 11, 11, 21, 68, .T., "xmemo")
|
||||
cMemo := MemoEdit(::oCurRow:FieldGet(oCol:nFieldNum), 11, 11, 21, 68, .T.)
|
||||
|
||||
if Lastkey() == K_ALT_W
|
||||
::oCurRow:FieldPut(oCol:nFieldNum, cMemo)
|
||||
if Lastkey() == K_CTRL_END
|
||||
::oCurRow:FieldPut(oCol:nFieldNum, cMemo)
|
||||
|
||||
/* NOTE: To do in a better way */
|
||||
if !::oQuery:Update(::oCurRow)
|
||||
Alert(Left(::oQuery:Error(), 60))
|
||||
endif
|
||||
endif
|
||||
|
||||
RestScreen(10, 10, 22, 69, cMemoBuff)
|
||||
|
||||
RestScreen(10, 10, 22, 69, cMemoBuff)
|
||||
|
||||
else
|
||||
// Create a corresponding GET
|
||||
// NOTE: I need to use ::oCurRow:FieldPut(...) when changing values since message redirection doesn't work at present
|
||||
@@ -269,20 +274,19 @@ METHOD EditField() CLASS TBrowseSQL
|
||||
//setcursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) )
|
||||
ReadModal(aGetList)
|
||||
//setcursor( SC_NONE )
|
||||
endif
|
||||
|
||||
/* NOTE: To do in a better way */
|
||||
if !::oQuery:Update(::oCurRow)
|
||||
Alert(Left(::oQuery:Error(), 60))
|
||||
endif
|
||||
|
||||
/* NOTE: To do in a better way */
|
||||
if !::oQuery:Update(::oCurRow)
|
||||
Alert(Left(::oQuery:Error(), 60))
|
||||
endif
|
||||
|
||||
if !::oQuery:Refresh()
|
||||
Alert(::oQuery:Error())
|
||||
endif
|
||||
|
||||
::inValidate()
|
||||
::refreshAll():forceStable()
|
||||
::RefreshAll()
|
||||
|
||||
// Check exit key from get
|
||||
nKey := LastKey()
|
||||
@@ -381,6 +385,7 @@ METHOD BrowseTable(lCanEdit, aExitKeys) CLASS TBrowseSQL
|
||||
|
||||
otherwise
|
||||
::KeyboardHook(nKey)
|
||||
|
||||
endcase
|
||||
enddo
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ FUNCTION MemoEdit(cString,;
|
||||
if oEd:lSaved
|
||||
cString := oEd:GetText()
|
||||
// dbu tests for LastKey() == K_CTRL_END, so I try to make it happy
|
||||
KEYBOARD K_CTRL_END
|
||||
KEYBOARD Chr(K_CTRL_END)
|
||||
Inkey()
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -83,6 +83,7 @@ CLASS TEditor
|
||||
nTabSize)
|
||||
|
||||
METHOD LoadFile(cFileName) // Load cFileName into active editor
|
||||
METHOD LoadText(cString) // Load cString into active editor
|
||||
METHOD SaveFile() // Save active file (not for MemoEdit() emulation)
|
||||
|
||||
METHOD AddLine(cLine, lSoftCR) // Add a new Line of text at end of current text
|
||||
@@ -340,6 +341,21 @@ METHOD LoadFile(cFileName) CLASS TEditor
|
||||
return Self
|
||||
|
||||
|
||||
METHOD LoadText(cString) CLASS TEditor
|
||||
|
||||
::aText := Text2Array(cString, iif(::lWordWrap, ::nNumCols, nil))
|
||||
::naTextLen := Len(::aText)
|
||||
|
||||
if ::naTextLen == 0
|
||||
AAdd(::aText, TTextLine():New())
|
||||
::naTextLen++
|
||||
endif
|
||||
|
||||
::MoveCursor(K_CTRL_PGUP)
|
||||
|
||||
return Self
|
||||
|
||||
|
||||
// Saves file being edited, if there is no file name does nothing, returns .T. if OK
|
||||
METHOD SaveFile() CLASS TEditor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user