/* Filename: rmSigImage.cc ( Contained in rmSigBox.cc ) Version: 1.00 Date: 2005/02/01 For: dBASE PLUS / dB2K / Visual dBase 7.** Windows 95/98/ME/XP/NT/2000 Author: Ronnie MacGregor Contact: SigImageFeedback@dBASEDeveloper.com Description: A Custom Control for the display of a signature created with an rmSigBox control. The control has the built in ability to inject the signature into a Word document. Revisions: None Methods: . function SetDatalink(oDLink) This method must be called in order to establish a datalink for the control. A reference to the field object concerned must be passed. Best done from the onOpen of the control instantiation code as follows : this.SIGIMAGE1 = new RMSIGIMAGE(this) with (this.SIGIMAGE1) onOpen = {; this.SetDatalink(form.q.rowset.fields["Signature"])} left = 10 top = 308 endwith This method also creates an object reference to itself in a custom array of the datalinked rowset in preparation for notification of rowset events to the control. . function onAbandon() . function onAppend() . function onDelete() . function onEdit() . function onNavigate() . function onSave() All of these methods must be fired by the appropriate rowset events. This is easy to achieve from form code because each instance of a rmCustomControl which is datalinked will add itself to a custom rowset array of object references. These references can then be used as follows. Sample form rowset_onNavigate code : function rowset_onNavigate() oRowset = this this.parent.parent.RowsetEvent(oRowset, "onNavigate") return Sample single rowset event function to handle all rowset events : function RowsetEvent(oRowset, cEvent) // Fire the rowset events for any rmCCs try for nCount = 1 to oRowset.rmCCArray.size do case case cEvent == "onAbandon" oRowset.rmCCArray[nCount].onAbandon() case cEvent == "onEdit" oRowset.rmCCArray[nCount].onEdit() case cEvent == "onNavigate" oRowset.rmCCArray[nCount].onNavigate() case cEvent == "onSave" oRowset.rmCCArray[nCount].onSave() case cEvent == "onDelete" oRowset.rmCCArray[nCount].onDelete() case cEvent == "onAppend" oRowset.rmCCArray[nCount].onAppend() endcase endfor catch(exception e) // array doesn't exist endtry return . function SigToWord(oWord) This function can be called from anywhere in an OleAutoClient code session to inject a signature into the document. An object reference to the Word OleAutoClient must be passed, as in this sample line of code : form.SigImage1.SigToWord(oWord) . function onClose() This function should be called from the onCLose of your form in order to ensure that the control's clean up code is run. Unfortunately there is a dBASE bug which prevents this being automated. The onClose event of a PaintBox does not fire if the PaintBox is in a container. Properties: None. Dependancies: None. Acknowledgements: None. */