XTRA for work with formatted text documents
  Description | Functions | Examples | Download | ►Order | All products |
Novelties: XML Socket Server, XTRA dmmXLS

List of methods

Registration   Registration of dmmRVF.x32
LoadFromFile     Reading of rvf or rtf documents
LoadFromHttp   Loading of the rvf and rtf files from the http
LoadFromZIP   Reading of rvf and rtf documents saved in a zip archive
LoadFromXML   Reading of rvf documents saved in the format XML
SaveToRVF   Saving of the document in the format RVF
SaveToRTF   Saving of the document in the format RTF
SaveToXML   Saving of the document in the format XML
AddRVF   Addition of a contents of RVF document to the actual document
Print   Print of the document
PrintPreview   Printing preview of the document
FindText   Text finding
HighLightText   Text finding and marking
ShowEditor   Internal editor running

List of properties

VScrollMax
  Defining of vertical length of a document
VScrollPos     Setting of Vertical position in a document
VScrollVisible   Vertical scrollbar hiding
HScrollMax   Defining of horizontal length of a document
HScrollPos   Setting of horizontal position in a document
HScrollVisible   Horizontal scrollbar hiding
Rtf   Contents of the document in the RTF format
Xml   Contents of the document in the XML format
TextUTF8   Contents of the document in the UTF-8 format

List of events
HotSpotclick   Click to a hypertext link
DataHttp   The event monitores the downloading of the rvf file from the http


Description of methods
-----------------------------------------------------------------------------------------------------------------------------------------------------------


void=registration( name: string, code:string)

This method has to be called before the first use of the dmmRVF immediately after its initialisation. Unless the right registration name and number are inserted, an announcement "this is a demo version" will appear.

Parametres
Type of name is string, for the demo version name = "dmm".
Type of code is string, for the demo version code= "demo". The chain for commercial version is unique.
To register the user will receive parameters code and name.

Very important
For safety reasons incorrect parameters can be only inserterted 3 times in the method registration. If you insert incorrect parameters name and code more times the registration is blocked and the XTRA will not work. You will be informed about it by a dialogue window. In this case you´ve got to restart Director or Authorware.

Note:
Parameters name="dmm" and code="demo" are not considered as incorrect.
The demo version of the XTRA dmmRVF can only be run in the "Author" mode. In the "Projector" mode the demo version is not functional.

Example - Director
sprite(1).registration("dmm", "demo")

Example - Authorware
CallSprite(@"documentRVF"; #registration ; "dmm"; "demo")

-----------------------------------------------------------------------------------------------------------------------------------------------------------


boolean=loadFromFile(file:string)

The function opens rvf or rtf documents. The work with rtf documents is only additional. An rft document does not allow such a good work with text as an rvf document. Rvf document loading also takes less time than the one of rtf.
In the case the file has been successfully loaded the function gives true, otherwise it gives false.

Parametres
The only parameter of the function is name of rvf or rtf document.

Example - Director
sprite(1).loadRVF(the pathName & "studio.rvf")
or
sprite(1).loadRVF(the pathName & "xtra.rtf")

Example - Authorware
CallSprite(@"documentRVF"; #loadRVF ; "studio.rvf")
or
CallSprite(@"documentRVF"; #loadRVF ; "xtra.rtf")

-----------------------------------------------------------------------------------------------------------------------------------------------------------


boolean=loadFromHttp(url:string)

This function enables to download RVF and RTF files from the internet using the method get and protocol http. In the case the file has been successfully downloaded the function gives true, otherwise in gives false. To have this function activated in the XTRA you need to have the additive library dmmHttp in the directory where dmmRVF is placed.

Parametres
The function has one parameter being url, whose type is string and it represents URL of the downloaded document.

Note
To be able to download RVF or RVF files from a web server you need to allow the format RVF or RTF among MIME types.

Example - Director
sprite(1).loadFromHttp(http://xtra.web-cd.net/data.rvf)

Example - Authorware
CallSprite(@"documentRVF"; #loadFromHttp ; "http://xtra.web-cd.net/data.rvf")

-----------------------------------------------------------------------------------------------------------------------------------------------------------


boolean=loadFromZip(zipFile, zipPassword, docFile:string)
This function loads rvf or rtf documents saved in a zip archive. The work procedure is easy. We prepare rvf or rtf files and compress them to a zip. We can protect this zip with a password. The function loadFromZip enables to read separate files of the archive and to show them in Director or Authorware using XTRA dmmRVF. To have this function activated in the XTRA you need to have the additive library dmmZip in the directory where dmmRVF is placed. In the case the file has been successfully loaded the function gives true, otherwise it gives false.

Parametres
There are 3 parametres in this function. ZipFile is a zip archive, in which we keep the documents. ZipPassword is a password for the zip archive. If there is no password, we insert an empty chain. DocFile is a name rtf or rvf file in a zip document. We have to insert the name including the extension.

Example - Director
sprite(1).loadFromZip(the pathName & "rvf-pack.zip", "abc", "xtras.rvf" )
or
sprite(1).loadFromZip(the pathName & "rvf-pack.zip", "", "xtras.rtf" )

Example - Authorware
CallSprite(@"documentRVF"; #loadFromZip ; FileLocation ^ "rvf-pack.zip"; "abc"; "xtras.rvf")
or
CallSprite(@"documentRVF"; #loadFromZip ; FileLocation ^ "rvf-pack.zip"; ""; "xtras.rtf")

-----------------------------------------------------------------------------------------------------------------------------------------------------------

void=loadFromXML(file:string)

The function opens rvf documents saved in the format XML.

Parametres
The only parameter of the function is name of XML document.

Example - Director
sprite(1).loadFromXML(the pathName & "studio.xml")

Example - Authorware
CallSprite(@"documentRVF"; #loadFromXML ; "studio.xml")

-----------------------------------------------------------------------------------------------------------------------------------------------------------

void=saveToRVF(file:string)

The function saves the actual document in the format RVF.

Parametres
The only parameter of the function is name of RVF document.

Example - Director
sprite(1).saveToRVF(the pathName & "studio.rvf")

Example - Authorware
CallSprite(@"documentRVF"; #saveToRVF ; "studio.rvf")

-----------------------------------------------------------------------------------------------------------------------------------------------------------

void=saveToRTF(file:string)

The function saves the actual document in the format RTF.

Parametres
The only parameter of the function is name of RTF document.

Example - Director
sprite(1).saveToRTF(the pathName & "studio.rtf")

Example - Authorware
CallSprite(@"documentRVF"; #saveToRTF ; "studio.rtf")

-----------------------------------------------------------------------------------------------------------------------------------------------------------

void=saveToXML(file:string)

The function saves the actual document in the format XML.

Parametres
The only parameter of the function is name of XML document.

Example - Director
sprite(1).saveToXML(the pathName & "studio.xml")

Example - Authorware
CallSprite(@"documentRVF"; #saveToXML ; "studio.xml")

-----------------------------------------------------------------------------------------------------------------------------------------------------------

void=addRVF(file:string)

The function adds a contents of RVF document at the end of the actual document.

Parametres
The only parameter of the function is name of RVF document.

Example - Director
sprite(1).addRVF(the pathName & "studio.rvf")

Example - Authorware
CallSprite(@"documentRVF"; #addRVF ; "studio.rvf")

-----------------------------------------------------------------------------------------------------------------------------------------------------------

void=print(copies:integer)
The function prints the displayed document.

Parametres
The only parameter is number of copies we want to print.

Example - Director
sprite(1).print(1)

Example - Authorware
CallSprite(@"documentRVF"; #print ; 1)

-----------------------------------------------------------------------------------------------------------------------------------------------------------


void=printPreview()
The function shows a preview of the document before printing.

Parametres
There are no parametres in this function.

Example - Director
sprite(1).printPreview()

Example - Authorware
CallSprite(@"documentRVF"; #printPreview)

-----------------------------------------------------------------------------------------------------------------------------------------------------------


void=findText(sText: string)
The function explores an RVF document and gradually marks the searched text. The document is explored from the beginning and with every other findText calling it is found more and more searched words. After finding the last occurence of the given word, the document is explored once again. Capital letter make no difference.

Parametres

The only parameter is sText, whose type is string and we insert the desired text.

Note
If you want to cancel the marking, it is enough to give the function findText such a parameter, that thereis no chance such a term exists, e.g. findText("xxxxxxxxxxx").

Example - Director
sprite(1).findText("XTRA")

Example - Authorware
CallSprite(@"documentRVF"; #findText; "XTRA")

-----------------------------------------------------------------------------------------------------------------------------------------------------------


integer=highLightText(words: list, color: string)
The function finds words and marks them in an RVF document. Capital letters make no difference. This is a perfect way to mark words in a document, for example after fulltext searching. The functions gives number of words found in the text. The function gives number of words found in the text.

Parametres
There are 2 parametres. Type of words is list and we insert the words we want to mark in a document. Parameter words is inserted in the Abstract Data Type format, in the shape[word1, word2, word3, .. ]. Type of the color parameter is string and we insert the colour we want to mark the chosen words with. Colour is inserted in the hex
shape #XXYYZZ.

Note
If you want to cancel the marking,the best way is to load the document again with some of the load functions.

Example - Director
number=sprite(1).highLightText(["xtra", "del", "director"], "#33FF00")

Example - Authorware
number:=CallSprite(@"documentRVF"; #highLightText; ["xtra"; "del"; "director"]; "#33FF00")
-----------------------------------------------------------------------------------------------------------------------------------------------------------


void=showEditor()
The function runs the editor. To run the internal editor, the file dmmRVFEdit.dll. must be placed in the same directory as the XTRA dmmRVF.x32

Parametres
There are no parametres in this function.

Example - Director
sprite(1).showEditor()

Example - Authorware
CallSprite(@"documentRVF"; #showEditor)

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Description of properties
-----------------------------------------------------------------------------------------------------------------------------------------------------------


vScrollMax

Thanks to vScrollMax we can define, in what vertical dimensions we can move the document!

Example - Director
vmax=sprite(1).vScrollMax

Example - Authorware
vmax:=GetSpriteProperty(@"documentRVF"; #vScrollMax)

-----------------------------------------------------------------------------------------------------------------------------------------------------------


vScrollPos

Thanks to vScrollPos we set vertical position in the document! VScrollPos moves within the document between positions 0 and vScrollMax..

Example - Director
sprite(1).vScrollPos=sprite(1).vScrollPos+10

Example - Authorware
p:=GetSpriteProperty(@"documentRVF"; #vScrollPos)+10
SetSpriteProperty(@"documentRVF"; #vScrollPos; p)

----------------------------------------------------------------------------------------------------------------------------------------------------------


vScrollVisible

Thanks to vScrollVisible we can hide or show vertical scrollbar.

Example - Director
sprite(1).vScrollVisible=false

Example - Authorware
SetSpriteProperty(@"documentRVF"; #vScrollVisible; FALSE)

-----------------------------------------------------------------------------------------------------------------------------------------------------------


hScrollMax

Thanks to hScrollMax we can define, in what horizontal dimensions we can move the document!

Example - Director
hmax=sprite(1).hScrollMax

Example - Authorware
hmax:=GetSpriteProperty(@"documentRVF"; #hScrollMax)

-----------------------------------------------------------------------------------------------------------------------------------------------------------


hScrollPos

Thanks to hScrollPos we set horizontal position in the document! HScrollPos moves within the document between positions 0 and hScrollMax.

Example - Director
sprite(1).hScrollPos=sprite(1).hScrollPos+1

Example - Director
p:=GetSpriteProperty(@"documentRVF"; #hScrollPos)+1
SetSpriteProperty(@"documentRVF"; #hScrollPos; p)

----------------------------------------------------------------------------------------------------------------------------------------------------------


hScrollVisible
Thanks to hScrollVisible we can hide or show horizontal scrollbar.

Example - Director
sprite(1).hScrollVisible=false

Example - Authorware
SetSpriteProperty(@"documentRVF"; #hScrollVisible; FALSE)

----------------------------------------------------------------------------------------------------------------------------------------------------------

rtf
Using the feature rtf we can save contents of the RVF document directly to cast member, or on the contrary save the contents of the cast member to RVF document. We can also save RVF format to memo fields in databasis and by return read it from them.

Example - Director
member("abc").rtf=sprite(1).rtf
nebo
sprite(1).rtf=member("abc").rtf

Example - Authorware
SetSpriteProperty(@"documentRVF"; #rtf; rtfText)

----------------------------------------------------------------------------------------------------------------------------------------------------------

xml
Using the feature xml we can save contents of the RVF document directly to cast member, or on the contrary save the contents of the cast member to RVF document. We can also save RVF format to memo fields in databasis and by return read it from them.

Example - Director
member("abc").text=sprite(1).xml
nebo
sprite(1).xml=member("abc").text

Example - Authorware
SetSpriteProperty(@"documentRVF"; #xml; xmlText)

----------------------------------------------------------------------------------------------------------------------------------------------------------

textUTF8
Using the feature textUTF8 we can work with with an UNICODE text, which is coded in UTF-8.This function can work directly with contents of items, for example of Excel supposing the use of XTRA dmmXLS or we can also read contents of items in databasis, which are saved as UNICODE, supposing the use of XTRA dmmMDB.

Example - Director
sprite(1).textUTF8=fieldUTF8

Example - Authorware
SetSpriteProperty(@"documentRVF"; #textUTF8; fieldUTF8)

----------------------------------------------------------------------------------------------------------------------------------------------------------


Description of events
-----------------------------------------------------------------------------------------------------------------------------------------------------------


hotSpotclick Event

Analyse of click to a hypertext link

Example - Director
On hotSpotclick me, s
     put s
end

Example - Authorware
Example of use is marked directly in the demo version.

-----------------------------------------------------------------------------------------------------------------------------------------------------------

dataHttp progress

This event (callback function) is invoked at the moment when the user starts to download the rvf file from the http. It monitores the downloading of the rvf file. The parameter progress represents how many percents have already been downloaded. The values ranges from 0 to 100.

Example - Director
on dataHttp me, progress
     put progress
end



 
 
  © Studio dmm 1992-2008, all rights reserved, other information regarding our components: software@dmm.cz