Skip to content

Commit 2bfc6cb

Browse files
committed
Add UNDO to EditBox and TextBox
2022-05-29 19:04 UTC-0300 Fernando Yurisich <[email protected]> * ide\fmgs\formedit.prg + Support for UNDO to EditBox and TextBox controls. #27
1 parent a6c0ac1 commit 2bfc6cb

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

prgs/formedit.prg

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@
401401
{ "aTrailFontClr", "NIL" }, ;
402402
{ "aTransparent", .F. }, ;
403403
{ "aTxtMrgn", "" }, ;
404+
{ "aUndo", .F. }, ;
404405
{ "aUpdate", .F. }, ;
405406
{ "aUpdateColors", .F. }, ;
406407
{ "aUpDown", .F. }, ;
@@ -8228,8 +8229,8 @@ METHOD pEditbox( i ) CLASS TFormEditor
82288229

82298230
LOCAL aBackColor, aFontColor, cCargo, cField, cFocusedPos, cFontName, cHelpID, cInsertType, cMaxLength, cObj, cOnChange
82308231
LOCAL cOnGotFocus, cOnHScroll, cOnLostFocus, cOnVScroll, cParent, cSubClass, cToolTip, cVal, cValue, lBold, lBreak, lEnabled
8231-
LOCAL lItalic, lNoBorder, lNoHScroll, lNoTabStop, lNoVScroll, lReadonly, lRTL, lStrikeout, lUnderline, lVisible, nCol, nFontSize
8232-
LOCAL nHeight, nRow, nWidth, oCtrl, uFontName, uFontSize
8232+
LOCAL lItalic, lNoBorder, lNoHScroll, lNoTabStop, lNoVScroll, lReadonly, lRTL, lStrikeout, lUnderline, lUndo, lVisible, nCol
8233+
LOCAL nFontSize, nHeight, nRow, nWidth, oCtrl, uFontName, uFontSize
82338234

82348235
/* Load properties */
82358236
nRow := Val( ::ReadCtrlRow( i ) )
@@ -8292,6 +8293,7 @@ METHOD pEditbox( i ) CLASS TFormEditor
82928293
cInsertType := ::ReadStringData( i, "INSERTTYPE", "" )
82938294
cSubClass := ::ReadStringData( i, "SUBCLASS", "" )
82948295
lBreak := ( ::ReadLogicalData( i, "BREAK", "F" ) == "T" )
8296+
lUndo := ( ::ReadLogicalData( i, "UNDO", "F" ) == "T" )
82958297
cParent := ::ReadStringData( i, "PARENT", "" )
82968298
cParent := ::ReadStringData( i, "OF", cParent )
82978299
cCargo := ::ReadCargo( i, "LASTFORM.LASTCONTROL.CARGO" )
@@ -8332,6 +8334,7 @@ METHOD pEditbox( i ) CLASS TFormEditor
83328334
::aSubClass[i] := cSubClass
83338335
::aBreak[i] := lBreak
83348336
::aParent[i] := cParent
8337+
::aUndo[i] := lUndo
83358338
::aCargo[i] := cCargo
83368339

83378340
/* Create control */
@@ -11269,8 +11272,8 @@ METHOD pTextBox( i ) CLASS TFormEditor
1126911272
LOCAL cFormat, cHelpID, cImage, cInputMask, cInsertType, cMaxLength, cObj, cOnChange, cOnEnter, cOnGotFocus, cOnLostFocus
1127011273
LOCAL cOnTextFill, cParent, cSubClass, cToolTip, cToolTipA1, cToolTipA2, cVal, cValid, cValue, cWhen, lAutoSkip, lBold
1127111274
LOCAL lCenterAlign, lCtrlsLeft, lDate, lEnabled, lItalic, lLowerCase, lNoBorder, lNoContext, lNoTabStop, lNumeric, lPassword
11272-
LOCAL lReadonly, lRightAlign, lRTL, lStrikeout, lUnderline, lUpperCase, lVisible, nCol, nFontSize, nHeight, nLinC, nLin1, nLin2
11273-
LOCAL nRow, nWidth, oCtrl, uFontName, uFontSize
11275+
LOCAL lReadonly, lRightAlign, lRTL, lStrikeout, lUnderline, lUndo, lUpperCase, lVisible, nCol, nFontSize, nHeight, nLinC, nLin1
11276+
LOCAL nLin2, nRow, nWidth, oCtrl, uFontName, uFontSize
1127411277

1127511278
/* Load properties */
1127611279
nRow := Val( ::ReadCtrlRow( i ) )
@@ -11341,6 +11344,7 @@ METHOD pTextBox( i ) CLASS TFormEditor
1134111344
lDate := ( ::ReadLogicalData( i, "DATE", "F" ) == "T" )
1134211345
cDefaultYear := ::ReadStringData( i, "DEFAULTYEAR", "" )
1134311346
lNumeric := ( ::ReadLogicalData( i, "NUMERIC", "F" ) == "T" )
11347+
lUndo := ( ::ReadLogicalData( i, "UNDO", "F" ) == "T" )
1134411348
cInputMask := ::ReadStringData( i, "INPUTMASK", "" )
1134511349
cInputMask := ::ReadStringData( i, "PICTURE", cInputMask )
1134611350
cFormat := ::ReadStringData( i, "FORMAT", "" )
@@ -11437,6 +11441,7 @@ METHOD pTextBox( i ) CLASS TFormEditor
1143711441
::aNoContext[i] := lNoContext
1143811442
::aCue[i] := cCue
1143911443
::aParent[i] := cParent
11444+
::aUndo[i] := lUndo
1144011445
::aCargo[i] := cCargo
1144111446

1144211447
/* Create control */
@@ -11782,7 +11787,7 @@ METHOD pXBrowse( i ) CLASS TFormEditor
1178211787
cObj := ::ReadStringData( i, "OBJECT", cObj )
1178311788
nWidth := Val( ::ReadStringData( i, "WIDTH", LTrim( Str( TXBrowse():nWidth ) ) ) )
1178411789
nHeight := Val( ::ReadStringData( i, "HEIGHT", LTrim( Str( TXBrowse():nHeight ) ) ) )
11785-
cHdrs := ::ReadStringData( i, "HEADERS", "{ '', '' } ")
11790+
cHdrs := ::ReadStringData( i, "HEADERS", "{ '', '' } ")
1178611791
cWidths := ::ReadStringData( i, "WIDTHS", "{ 100, 60 }")
1178711792
cWorkArea := ::ReadStringData( i, "WORKAREA", "ALIAS()" )
1178811793
cFields := ::ReadStringData( i, "FIELDS", "{ 'field1', 'field2' }" )
@@ -14291,6 +14296,9 @@ METHOD MakeControls( j, Output, nRow, nCol, nWidth, nHeight, nSpacing, nLevel )
1429114296
IF ::aDisabled[j]
1429214297
Output += " ;" + CRLF + Space( nSpacing * ( nLevel + 1 ) ) + "DISABLED"
1429314298
ENDIF
14299+
IF ::aUndo[j]
14300+
Output += " ;" + CRLF + Space( nSpacing * ( nLevel + 1 ) ) + "UNDO"
14301+
ENDIF
1429414302
IF NOTZERO( ::aInsertType[j] )
1429514303
Output += " ;" + CRLF + Space( nSpacing * ( nLevel + 1 ) ) + "INSERTTYPE " + AllTrim( ::aInsertType[j] )
1429614304
ENDIF
@@ -16790,6 +16798,9 @@ METHOD MakeControls( j, Output, nRow, nCol, nWidth, nHeight, nSpacing, nLevel )
1679016798
IF NOTEMPTY( ::aCue[j] )
1679116799
Output += " ;" + CRLF + Space( nSpacing * ( nLevel + 1 ) ) + "CUEBANNER " + AllTrim( ::aCue[j] )
1679216800
ENDIF
16801+
IF ::aUndo[j]
16802+
Output += " ;" + CRLF + Space( nSpacing * ( nLevel + 1 ) ) + "UNDO"
16803+
ENDIF
1679316804
IF NOTEMPTY( ::aCargo[j] )
1679416805
Output += CRLF + CRLF + Space( nSpacing * nLevel ) + "LastForm.LastControl.Cargo := " + AllTrim( ::aCargo[j] )
1679516806
ENDIF
@@ -18258,6 +18269,7 @@ METHOD PropertiesClick() CLASS TFormEditor
1825818269
{ "RTL", ::aRTL[j], .F. }, ;
1825918270
{ "SubClass", ::aSubClass[j], 1000 }, ;
1826018271
{ "ToolTip", ::aToolTip[j], 1000 }, ;
18272+
{ "Undo", ::aUndo[j], .F. }, ;
1826118273
{ "Value", ::aValue[j], 1000 } }
1826218274
aLabels := Array( Len( aData ) )
1826318275
aInitValues := Array( Len( aData ) )
@@ -18290,6 +18302,7 @@ METHOD PropertiesClick() CLASS TFormEditor
1829018302
::aRTL[j] := aResults[ ++k ]
1829118303
::aSubClass[j] := aResults[ ++k ]
1829218304
::aToolTip[j] := aResults[ ++k ]
18305+
::aUndo[j] := aResults[ ++k ]
1829318306
::aValue[j] := aResults[ ++k ]
1829418307
EXIT
1829518308

@@ -19592,6 +19605,7 @@ METHOD PropertiesClick() CLASS TFormEditor
1959219605
{ "RTL", ::aRTL[j], .F. }, ;
1959319606
{ "SubClass", ::aSubClass[j], 1000 }, ;
1959419607
{ "ToolTip", ::aToolTip[j], 1000 }, ;
19608+
{ "Undo", ::aUndo[j], .F. }, ;
1959519609
{ "UpperCase", ::aUpperCase[j], .F. }, ;
1959619610
{ "Valid", ::aValid[j], 1000 }, ;
1959719611
{ "Value", ::aValue[j], 1000 }, ;
@@ -19639,6 +19653,7 @@ METHOD PropertiesClick() CLASS TFormEditor
1963919653
::aRTL[j] := aResults[ ++k ]
1964019654
::aSubClass[j] := aResults[ ++k ]
1964119655
::aToolTip[j] := aResults[ ++k ]
19656+
::aUndo[j] := aResults[ ++k ]
1964219657
::aUpperCase[j] := aResults[ ++k ]
1964319658
::aValid[j] := aResults[ ++k ]
1964419659
::aValue[j] := aResults[ ++k ]

0 commit comments

Comments
 (0)