78
|
Is it possible to change the line's height
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "(1+6.25)/4*6/3"
oCalcEdit:InsertText("(2+6.25)/4*6/3\r\n",1)
oCalcEdit:InsertText("(3+6.25)/4*6/3\r\n",1)
oCalcEdit:InsertText("(4+6.25)/4*6/3\r\n",1)
oCalcEdit:InsertText("Total")
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:DrawGridLines := .T.
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
77
|
How do I put a picture on the control's background
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:Picture := oCalcEdit:ExecuteTemplate("loadpicture(`c:\exontrol\images\zipdisk.gif`)")
oCalcEdit:PictureDisplay := 0/*exUpperLeft*/
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "(1+6.25)/4*6/3"
oCalcEdit:InsertText("\r\n",1)
oCalcEdit:InsertText("\r\n",1)
oCalcEdit:InsertText("\r\n",1)
DevOut( "Expression: " )
DevOut( oCalcEdit:Text() )
DevOut( "Result: " )
DevOut( Transform(oCalcEdit:Result(),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
76
|
How do I get the numbers only, with no Total fields (method 2)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oCalcEdit:InsertText("Total")
DevOut( Transform(oCalcEdit:ExecuteTemplate("FormatABC(" + CHR(34) + "lower(A) replace `total` with ``" + CHR(34) + ", Text)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
75
|
How do I get the numbers only, with no Total fields (method 1)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oCalcEdit:InsertText("Total")
DevOut( Transform(oCalcEdit:FormatABC("lower(A) replace `total` with ``",oCalcEdit:Text()),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
74
|
How do I customize the format to display the result (right,local,2 decimals,less,font)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:FormatLocal := "( value < 10000 ? `<fgcolor=000000><b><font ;16>` : ``) + (value format `2`)"
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %l%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
73
|
How do I customize the format to display the result (right,local,2 decimals,greater,color)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatLocal := "( value > 10000 ? `<fgcolor=FF0000><b>` : ``) + (value format `2`)"
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %l%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
72
|
How do I customize the format to display the result (right,local,all decimals)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatLocal := "value"
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %l%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
71
|
How do I customize the format to display the result (right,local,2 decimals)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatLocal := "value format `2`"
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %l%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
70
|
How do I customize the format to display the result (right,local,curency)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %l%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
69
|
How do I customize the format to display the result (right,local)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %l%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
68
|
How do I customize the format to display the result (right)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:FormatResult := "<fgcolor=808080><r> = %%"
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
67
|
How do I customize the format to display the result (default)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertText("100 * 200")
oCalcEdit:InsertText("300 * 400 * 1.5")
oCalcEdit:InsertText("200 + ( 400 * 1.5 + 300 / 1.19)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
66
|
How can I force a line to be there all the time, so user can not delete it, for instance Total
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertLockedText("Total")
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
65
|
Is it possible to get the value of specified variable
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("TVA = Total * 0.19")
oCalcEdit:InsertText("Total")
DevOut( "The TVA is: " )
DevOut( Transform(oCalcEdit:Variable("TVA"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
64
|
How do I get the total
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
DevOut( "The total is: " )
DevOut( Transform(oCalcEdit:Variable("Total"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
63
|
How do I get the easter date
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:ClearWildFormats()
oCalcEdit:FormatResult := "<r><fgcolor=008000><b>(%%)"
oCalcEdit:AllowComments := "<fgcolor=008000>//"
oCalcEdit:AddWildFormat("*=*<fgcolor=008000>//*")
oCalcEdit:AddWildFormat("<fgcolor=808080>V*=*")
oCalcEdit:AddWildFormat("<b>EasterSundayDay*=*")
oCalcEdit:SetProperty("BackColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:SetProperty("ForeColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:Text := "Year = 2018 // change here the year, to get the Easter Sunday for giving year"
oCalcEdit:InsertLockedText("V1 = (((255 - 11 * (Year mod 19)) - 21) mod 30)")
oCalcEdit:InsertLockedText("V2 = ((V1 + 21) + (V1 > 48 ? -1 : 0) + 6 - ((Year + int(Year / 4)) + V1 + (V1 > 48 ? -1 : 0) + 1) mod 7)")
oCalcEdit:InsertLockedText("EasterSundayDay = date(dateS('3/1/' + Year) + V2)")
DevOut( "Easter Sunday Day is " )
DevOut( Transform(oCalcEdit:Variable("EasterSundayDay"),"") )
DevOut( " for year " )
DevOut( Transform(oCalcEdit:Variable("Year"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
62
|
I've got a red line while I type into the control. How can I disable that (sample 2)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:AllowFormatInvalidOnTyping := .F.
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 + 200(invalid)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
61
|
I've got a red line while I type into the control. How can I disable that (sample 1)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:FormatInvalid := ""
oCalcEdit:Text := "100 + 200(invalid)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
60
|
How do I specify the color to show the locked lines
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatResult := "<r>[=%l%]"
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatTotalResult := "<r><b> <fgcolor=FFFFFF>= %l%</b>"
oCalcEdit:SetProperty("BackColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. ))
oCalcEdit:SetProperty("ForeColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertLockedText("VAT = Total * 0.20")
oCalcEdit:InsertLockedText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
59
|
Can I remove the colors that indicates locked lines
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatResult := "<r><fgcolor=808080>[=%l%]"
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:SetProperty("BackColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:SetProperty("ForeColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertLockedText("VAT = Total * 0.20")
oCalcEdit:InsertLockedText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
58
|
Can I add lines to the control, so the user can not remove/delete them ( locked lines )
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatResult := "<r><fgcolor=808080>[=%l%]"
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:Text := "1000"
oCalcEdit:InsertText("2000")
oCalcEdit:InsertLockedText("Commission = Total * 0.05 + (Total ? 2.95 : 0)")
oCalcEdit:InsertLockedText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
57
|
Is it possible to highlight a specified line
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatResult := "<r><fgcolor=808080>[=%l%]"
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:AddWildFormat("<fgcolor=00FF00>*<b>Commission</b>*=*")
oCalcEdit:Text := "100.50 + 123"
oCalcEdit:InsertText("200 + 20/5")
oCalcEdit:InsertText("300 + 3 * 15")
oCalcEdit:InsertText("400 + 200 * (10 + 12/45)")
oCalcEdit:InsertText("50 * 45")
oCalcEdit:InsertText("VAT = Total * 0.19")
oCalcEdit:InsertText("NET = Total - VAT")
oCalcEdit:InsertText("Monthly = Total / 12")
oCalcEdit:InsertText("Commission = Total * 0.05 + 2.95")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
56
|
Is it possible to display the result as currency
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:Text := "100.50"
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("VAT = Total * 0.19")
oCalcEdit:InsertText("NET = Total - VAT")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
55
|
Is it possible to display the result with no decimals
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatLocal := "value format `0`"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:Text := "100.50"
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("VAT = Total * 0.19")
oCalcEdit:InsertText("NET = Total - VAT")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
54
|
Is it possible to display the result exactly how it is defined in the control panel
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatLocal := "value format ``"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:Text := "100.50"
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("VAT = Total * 0.19")
oCalcEdit:InsertText("NET = Total - VAT")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
53
|
How can I count the lines
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowCount := "count"
oCalcEdit:AllowSubCount := "subcount"
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("SubCount")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("500")
oCalcEdit:InsertText("SubCount")
oCalcEdit:InsertText("Count")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
52
|
How can I compute the average
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:Text := "Average = Total / Count"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("VAT = Total * 0.19")
oCalcEdit:InsertText("NET = Total - VAT")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
51
|
Variables or Computed Fields
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:Text := "100"
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("VAT = Total * 0.19")
oCalcEdit:InsertText("NET = Total - VAT")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
50
|
I have noticed that definition of the variable is shown in italics. Can I change that
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:ClearWildFormats()
oCalcEdit:AddWildFormat("<b>*=*")
oCalcEdit:Text := "A = 400"
oCalcEdit:InsertText("")
oCalcEdit:InsertText("B = A + 0.22")
oCalcEdit:InsertText("A + B")
oCalcEdit:InsertText("B = B * .19")
oCalcEdit:InsertText("A + B")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
49
|
I have noticed that definition of the variable is shown in italics. Can I remove that
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:ClearWildFormats()
oCalcEdit:Text := "A = 300"
oCalcEdit:InsertText("")
oCalcEdit:InsertText("B = A + 0.22")
oCalcEdit:InsertText("A + B")
oCalcEdit:InsertText("B = B * .19")
oCalcEdit:InsertText("A + B")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
48
|
Can I define variables (sample 2)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "is"
oCalcEdit:ClearWildFormats()
oCalcEdit:AddWildFormat("<b>*is*")
oCalcEdit:Text := "A is 200"
oCalcEdit:InsertText("")
oCalcEdit:InsertText("B is A + 0.22")
oCalcEdit:InsertText("A + B")
oCalcEdit:InsertText("B is B * .19")
oCalcEdit:InsertText("A + B")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
47
|
Can I define variables (sample 1)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowVariables := "="
oCalcEdit:Text := "A = 100.22"
oCalcEdit:InsertText("")
oCalcEdit:InsertText("B = A + 0.22")
oCalcEdit:InsertText("A + B")
oCalcEdit:InsertText("B = B * .19")
oCalcEdit:InsertText("A + B")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
46
|
Comments and Prefixes
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowPrefixes := "<fgcolor=808080>:</fgcolor>"
oCalcEdit:AllowComments := "<fgcolor=008080>'</fgcolor>"
oCalcEdit:Text := "Field A: 100 ' this is the field A"
oCalcEdit:InsertText("Field B: 200 ' this is the field B")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
45
|
Can I display something at the start of each line
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowPrefixes := "<b>:</b>"
oCalcEdit:Text := "Field A: 100"
oCalcEdit:InsertText("Field B: 200")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
44
|
I can not use TAB key. Is it possible
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:UseTabKey := .T.
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
43
|
Does your control support comments
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:AllowComments := "<fgcolor=008080>//</fgcolor>"
oCalcEdit:Text := "104 mod 51 // modulo function"
oCalcEdit:InsertText("int(104/51) // int function")
oCalcEdit:InsertText("51 * int(104/51) + (104 mod 51) // check")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
42
|
Can I use the modulo function ( rest )
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "104 mod 51"
oCalcEdit:InsertText("int(104/51)")
oCalcEdit:InsertText("51 * int(104/51) + (104 mod 51)")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
41
|
Can I use acos function
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "acos(cos(1))"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
40
|
Can I use asin function
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "asin(sin(1))"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
39
|
Can I use cos function
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "cos(1)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
38
|
Can I use sin function
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "sin(1)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
37
|
Can I use abs function (absolute part of the number)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "abs(-100.99)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
36
|
Can I use round function
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "round(100.99)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
35
|
Can I use int function (integer part of a number)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "int(100.99)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
34
|
Can I use sqrt function (square root of a number)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "sqrt(100)"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
33
|
How can I show invalid lines with a larger font
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:LineHeight := "value + 8 *dpi"
oCalcEdit:DrawGridLines := .T.
oCalcEdit:FormatInvalid := "<u><font ;12> </font></u>"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("k200")
oCalcEdit:InsertText("300")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
32
|
I've noticed that while I type the text is shown in red. How can I change that
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:FormatInvalid := ""
oCalcEdit:Text := "100 * 200"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
31
|
Can I enlarge the height of each line
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:DrawGridLines := .T.
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
30
|
How can I show grid lines
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:DrawGridLines := .T.
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
29
|
How can I display the result of the total with a larger font
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:FormatTotalResult := "<r><b><font ;14>%l%</font></b>"
oCalcEdit:AllowTotal := "<b><font ;14>Total</font></b>"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
28
|
Is it possible to show the Total / SubTotal with a different background color
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowTotal := "<bgcolor=A0A0A0><b>Total</b></bgcolor>"
oCalcEdit:AllowSubTotal := "<bgcolor=E0E0E0><b>SubTotal</b></bgcolor>"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("SubTotal")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400 * 1.5")
oCalcEdit:InsertText("SubTotal")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
27
|
Is it possible to show the Total / SubTotal with a different background color
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:SetProperty("BackColorSubTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("SubTotal")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400 * 1.5")
oCalcEdit:InsertText("SubTotal")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
26
|
How can I change the color to show the numbers
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:FormatNumbers := "<fgcolor=FF0000> </fgcolor>"
oCalcEdit:Text := "1 + 2 + 3 + 4"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
25
|
The numbers are shown in blue. How can I remove that
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:FormatNumbers := ""
oCalcEdit:Text := "1 + 2 + 3 + 4"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
24
|
How can I export the entire text, including the result
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 * 1.5"
oCalcEdit:InsertText("120 * 1.5")
oCalcEdit:InsertText("130 * 1.5")
oCalcEdit:InsertText("Total")
DevOut( oCalcEdit:Export() )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
23
|
Is it possible to display the result, using the current regional locale
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:DrawGridLines := .T.
oCalcEdit:FormatResult := " <fgcolor=808080>[=%l%]</fgcolor>"
oCalcEdit:FormatTotalResult := " <b>[=%l%]</b>"
oCalcEdit:InsertText("100 * 100")
oCalcEdit:InsertText("200 * 200")
oCalcEdit:InsertText("300 * 300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
22
|
How can I change the format to display the total result (right)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:DrawGridLines := .T.
oCalcEdit:FormatTotalResult := "<b><fgcolor=FF0000> = %l%</fgcolor></b>"
oCalcEdit:AllowTotal := "<b><fgcolor=00FF00>Total</fgcolor></b>"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
21
|
How can I change the format to display the total result (right)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 4 * dpi"
oCalcEdit:FormatTotalResult := "<r><b><font ;12>%l%</font></b>"
oCalcEdit:AllowTotal := "<b><font ;12>Total</font></b>"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
20
|
Is it possible to rename the SubTotal
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowSubTotal := "<fgcolor=FF0000>Current Amount"
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("Current Amount")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("Current Amount")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
19
|
How can I disable the sub-totals
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowSubTotal := ""
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("SubTotal")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("400")
oCalcEdit:InsertText("SubTotal")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
18
|
How can I add sub-totals
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:AllowComments := "<fgcolor=008000>'"
oCalcEdit:AddWildFormat("<i>*=*<fgcolor=008000>'*")
oCalcEdit:AllowVariables := "="
oCalcEdit:DrawGridLines := .T.
oCalcEdit:LineHeight := "value + 8 * dpi"
oCalcEdit:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oCalcEdit:FormatLocal := "currency(value)"
oCalcEdit:FormatTotalResult := "<r><b> = %l%</b>"
oCalcEdit:FormatSubTotalResult := "<r><fgcolor=808080>[<b> = %l%</b>]"
oCalcEdit:FormatResult := "<r><fgcolor=808080>(%l%)"
oCalcEdit:SetProperty("BackColorTotal",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oCalcEdit:SetProperty("BackColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:SetProperty("ForeColorLockedLine",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oCalcEdit:CalcType := -1/*exCalcIncludeAll*/
oCalcEdit:Text := "100 + 200"
oCalcEdit:InsertText("200 * 1.5")
oCalcEdit:InsertText("SubA = SubTotal ' first subtotal")
oCalcEdit:InsertText("300 + (200+300)/2")
oCalcEdit:InsertText("400 + 500")
oCalcEdit:InsertText("SubB = SubTotal ' second subtotal")
oCalcEdit:InsertLockedText("VAT = Total * 0.19")
oCalcEdit:InsertLockedText("Commision = Total * 0.05")
oCalcEdit:InsertLockedText("NET = (Total - VAT) - Commision")
oCalcEdit:InsertLockedText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
17
|
Is it possible to disable the Total
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:AllowTotal := ""
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
16
|
Is it possible to rename the Total to Sum
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:AllowTotal := "<fgcolor=FF0000><b>Sum</b></fgcolor>"
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Sum")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
15
|
Is it possible to add all lines
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:InsertText("100")
oCalcEdit:InsertText("200")
oCalcEdit:InsertText("300")
oCalcEdit:InsertText("Total")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
14
|
How do I insert / add a new line
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 * 1.5"
oCalcEdit:InsertText("120 * 2.5\r\n",1)
oCalcEdit:InsertText("200 * 1.5")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
13
|
How do I find out if a specified line is valid
PROCEDURE OnSelChange(oCalcEdit)
DevOut( "CurrentLine: " )
DevOut( Transform(oCalcEdit:CaretLine(),"") )
DevOut( "CurrentLine: " )
DevOut( oCalcEdit:TextLine(oCalcEdit:CaretLine()) )
DevOut( "IsValid: " )
DevOut( Transform(oCalcEdit:IsValid(oCalcEdit:CaretLine()),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:SelChange := {|| OnSelChange(oCalcEdit)} /*Occurs when the user selects text in the control.*/
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 * 1.5"
oCalcEdit:InsertText("invalid")
oCalcEdit:InsertText("120 * 1.5")
oCalcEdit:InsertText("130 * 1.5")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
12
|
How do I get the current line
PROCEDURE OnSelChange(oCalcEdit)
DevOut( "CurrentLine: " )
DevOut( Transform(oCalcEdit:CaretLine(),"") )
DevOut( "CurrentLine: " )
DevOut( oCalcEdit:TextLine(oCalcEdit:CaretLine()) )
DevOut( "CurrentResult: " )
DevOut( Transform(oCalcEdit:Result(oCalcEdit:CaretLine()),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:SelChange := {|| OnSelChange(oCalcEdit)} /*Occurs when the user selects text in the control.*/
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 * 1.5"
oCalcEdit:InsertText("120 * 1.5")
oCalcEdit:InsertText("130 * 1.5")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
11
|
How do I get the line one by one, including the result
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 * 1.5"
oCalcEdit:InsertText("120 * 1.5")
oCalcEdit:InsertText("130 * 1.5")
DevOut( "Lines:" )
DevOut( Transform(oCalcEdit:Count(),"") )
DevOut( "TextLine(1):" )
DevOut( oCalcEdit:TextLine(1) )
DevOut( "Result(1)" )
DevOut( Transform(oCalcEdit:Result(1),"") )
DevOut( "TextLine(2):" )
DevOut( oCalcEdit:TextLine(2) )
DevOut( "Result(2)" )
DevOut( Transform(oCalcEdit:Result(2),"") )
DevOut( "TextLine(3):" )
DevOut( oCalcEdit:TextLine(3) )
DevOut( "Result(3)" )
DevOut( Transform(oCalcEdit:Result(3),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
10
|
Does the control supports multiple lines
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:MultiLine := .T.
oCalcEdit:Text := "100 * 1.5"
oCalcEdit:InsertText("120 * 1.5")
oCalcEdit:InsertText("130 * 1.5")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
9
|
Is it possible to display the result without brakets
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:FormatResult := "<fgcolor=808080> = %%</fgcolor>"
oCalcEdit:Text := "12 + (12 / 100)/2"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
8
|
How can I display the result on the right side of the control
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:FormatResult := "<r> <fgcolor=808080>[=%%]</fgcolor>"
oCalcEdit:Text := "12 + (12 / 100)/2"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
7
|
Can you please advise how to change fontname and size (sample 2)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:Template := "Font.Size = 20; Font.Name = `Tahoma`; Refresh"
oCalcEdit:Text := "1/2"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
6
|
Can you please advise how to change fontname and size (sample 1)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:Font():Size := 20
oCalcEdit:Text := "1/2"
oCalcEdit:Refresh()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
5
|
How can I disable evaluating the selection
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:EvaluateSel := .F.
oCalcEdit:HideSelection := .F.
oCalcEdit:Text := "(1+6.25)/4*6/3"
oCalcEdit:SelStart := 1
oCalcEdit:SelLength := 6
oCalcEdit:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
4
|
Can I define a different decimal separator
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:AddDecimalSep := ","
oCalcEdit:Text := "(1+6,25)/4*6/3"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
3
|
How do I change the color of the entire control, if the expression is not valid
PROCEDURE OnChange(oCalcEdit)
DevOut( "Valid:" )
DevOut( Transform(oCalcEdit:IsValid(),"") )
oCalcEdit:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oCalcEdit:FormatNumbers := "<fgcolor FF0000>"
oCalcEdit:FormatResult := ""
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:Change := {|| OnChange(oCalcEdit)} /*Indicates that the control's text has changed.*/
oCalcEdit:FormatInvalid := ""
oCalcEdit:Text := "invalid(1+6.25)/4*6/3"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
2
|
Is there any function to know if the expression is valid
PROCEDURE OnChange(oCalcEdit)
DevOut( "Valid:" )
DevOut( Transform(oCalcEdit:IsValid(),"") )
DevOut( "Expression: " )
DevOut( oCalcEdit:Text() )
DevOut( "Result: " )
DevOut( Transform(oCalcEdit:Result(),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:Change := {|| OnChange(oCalcEdit)} /*Indicates that the control's text has changed.*/
oCalcEdit:Text := "(1+6.25)/4*6/3"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1
|
How do I programatically save / load the expression and the result
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oCalcEdit
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
oCalcEdit:CLSID := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
oCalcEdit:create(,, {10,60},{610,370} )
oCalcEdit:Text := "(1+6.25)/4*6/3"
DevOut( "Expression: " )
DevOut( oCalcEdit:Text() )
DevOut( "Result: " )
DevOut( Transform(oCalcEdit:Result(),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|