How to attach a datablock to DCACTIVEXCONTROL
Posted: Thu Nov 08, 2012 10:31 am
Hello,
I am experimenting with a active X Html editor from nBit (http://nbit.net.au/).
I want this to use this for memo-edit.
A regular field edit of my database looks like
The memo field is linked to the DCMULTILINE . (oDb:memo)
When skipping thru the database, it looks like:
How can i get a link to a database field in a DCACTIVEXCONTROL ?
There is a property oHtml:DocumentHTML that contains the HTML form.
I tryed the folowing code, but that obviously does not compile.
I also tryed to subclass, and created GetData-and SetData methods. But i need pushbuttons to activate them.
Suggestions are welcome.
Regards,
Jack Duijf
I am experimenting with a active X Html editor from nBit (http://nbit.net.au/).
I want this to use this for memo-edit.
A regular field edit of my database looks like
Code: Select all
@ 1 ,1 DCMULTILINE oDb:memo SIZE 94,7
When skipping thru the database, it looks like:
Code: Select all
oDb:DbSkip()
Dc_GetRefresh(GetList)
There is a property oHtml:DocumentHTML that contains the HTML form.
Code: Select all
@ nLine , 1 DCACTIVEXCONTROL oHtml SIZE 120,15 CLSID "rmpHTML.HTMLed"
Code: Select all
@ nLine , 1 DCACTIVEXCONTROL oHtml SIZE 120,15 CLSID "rmpHTML.HTMLed" DATA oDb:Memo DATABLOCK {|c|iif(ValType(c) = "C",oHtml:DocumentHTML := c,nil),oHtml:DocumentHTML}
Code: Select all
@ nLine , 1 DCACTIVEXCONTROL oHtml SIZE 120,15 CLSID "rmpHTML.HTMLed" SUBCLASS "MyDCHtmlEdit"
CLASS MyDCHtmlEdit FROM Dc_XbpActiveXControl
EXPORTED:
METHOD Create
METHOD Destroy
METHOD GetData
METHOD SetData
ENDCLASS
Method MyDCHtmlEdit:create(oParent,oOwner,aPos,aSize,aPresParam,lVisible)
::Dc_XbpActiveXControl:Create(oParent,oOwner,aPos,aSize,aPresParam,lVisible)
::AlwaysConvertUnicodeCharacters := TRUE
::ActiveXObject:EditorEnabled := TRUE
::ActiveXObject:hiddenButtons := "Spell Check;Image;RemoteImage;Print;Toggle;Table"
Return Self
Method MyDCHtmlEdit:Destroy()
::Dc_XbpActiveXControl:Destroy()
Return SELF
Method MyDCHtmlEdit:GetData(oDb)
::DocumentHTML := oDb:Memo
Return
Method MyDCHtmlEdit:SetData(oDb)
oDb:Memo := ::DocumentHTML
Return
Regards,
Jack Duijf