Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use csfWebRichTextEditor.pkg Use cWebCombo.pkg Use cWebButton.pkg Use cCustomerDataDictionary.dd Use cWebDragDropFileHelper.pkg Object odbRichTextEditorDemo is a cWebView Object oCustomer_DD is a cCustomerDataDictionary End_Object Set Main_DD to oCustomer_DD Set Server to oCustomer_DD //Set piWidth to 700 Set psCaption to "dbRich Text Editor Demo" // Your DDO structure will go here Object oWebMainPanel is a cWebPanel Set piColumnCount to 12 Object oCustomer_Customer_Number is a cWebForm Entry_Item Customer.Customer_Number Set piColumnSpan to 3 Set psLabel to "Customer Number" Set peLabelPosition to lpTop End_Object Object oCustomer_Name is a cWebForm Entry_Item Customer.Name Set piColumnSpan to 8 Set psLabel to "Customer Name" Set peLabelPosition to lpTop Set piColumnIndex to 3 End_Object Object oRichTextEditor is a csfWebRichTextEditor Set piHeight to 400 Set piColumnSpan to 12 Set pbServerOnChange to True Entry_Item Customer.Comments Procedure OnChange Boolean bIsInteracted Integer iCount WebGet piCharCount to iCount Send none //Set Field_Changed_State of oCustomer_DD Field Customer.Comments to true End_Procedure End_Object Object oSetDataButton is a cWebButton Set piColumnSpan to 2 Set psCaption to "Set Content" Procedure OnClick String sValue Move '
This is a small example of what can be done with this Rich Text Editor
' to sValue #IF (!@ > 191) Append sValue @'' #ENDIF Append sValue "
It doesn't show much yet.
" WebSet psValue of oRichTextEditor to sValue Send none End_Procedure End_Object Object oWebDragDropFileHelper is a cWebDragDropFileHelper // Register drop targets Send RegisterDropTarget oRichTextEditor C_WebDropOnControl // Called for each file dropped, should return the local path to write the file Function OnFileDrop String sFileName Integer iBytes String sMime Handle hoDropTarget WebDropPosition eDropPosition Returns String String sPath tWebTreeViewDropData tDropData Boolean bExists #IFDEF Is$WebApp Get UploadFolder of ghoWebApp True to sPath #ELSE // not supported by FlexTron it seems Get UploadFolder of ghoWebResourceManager True to sPath #ENDIF If (sPath<>"") Begin Move (sPath + "\" + sFileName) to sPath // Check if we are not overwriting an existing file File_Exist sPath bExists If (bExists) Begin Send UserError "File already exists!" Function_Return "" End End Function_Return sPath End_Function Procedure OnFileFinished String sFileName String sLocalPath End_Procedure End_Object Object oGetDataButton is a cWebButton Set piColumnSpan to 2 Set psCaption to "Get Content" Set piColumnIndex to 2 Procedure OnClick String sValue WebGet psValue of oRichTextEditor to sValue Send none End_Procedure End_Object Object oInsertTextButton is a cWebButton Set piColumnSpan to 2 Set psCaption to "Insert Text" Set piColumnIndex to 4 Procedure OnClick Send InsertText of oRichTextEditor "Rich Text Editor" End_Procedure End_Object Object oInsertHtmlButton is a cWebButton Set piColumnSpan to 2 Set psCaption to "Insert Html" Set piColumnIndex to 6 Procedure OnClick Send InsertHtml of oRichTextEditor 'vdf-guidance SyncFusion wiki' End_Procedure End_Object Object oWebForm1 is a cWebForm Set piColumnSpan to 3 Set pbShowLabel to False Set piColumnIndex to 9 End_Object // place controls here End_Object End_Object