IDMNotes2 Interface

Version: 2.0
Dispatch interface for DMNotes Object

GUID: {673A9FE6-9A0B-11D4-B2A4-FD6847C75367}

This interface provides access to the DM2003 Notes window. Use its members to load and save text files and manipulate data in the Notes editor.

It should be specially mentioned that DMNotes object is also a collection of editor's lines.

Members:
Kind Name ID Description
LineCount 1 Return Lines.Count
Lines 2 Change Lines[I]
AddLine 3 Add new line at the end of Lines[]
InsertLine 4 Insert new line
DeleteLine 5 Delete selected line
Clear 6 Clear all lines
Load 7 Load lines from text file
Save 8 Save lines to text file
Text 9 Change Lines.Text
CanPaste 101 True if clipboard has text
SelectionStart 102 Change selection start position
SelectionLength 103 Change selection length
Select 104 Set selection
CopyToClipboard 105 Copy selection to the clipboard
PasteFromClipboard 106 Paste selection from the clipboard
Delete 107 Delete selection
Cut 108 Cut selection and place it on the clipboard
Undo 109 Undo last operation
CanUndo 110 True if undo is possible
SelectAll 111 Select all text
Modified 112 Change Modified flag
FileName 113 Return FileName
_NewEnum -4 Return Notes lines enumerator object

Syntax:
r/o property LineCount: Long

Applies to:
DMNotes

Returns number of lines in Notes editor.

Syntax:
property Lines[Index]: BSTR

Applies to:
DMNotes

Use this array property to change selected line in the Notes editor. Index ranges from 0 to LineCount-1. You also can iterate Notes lines in the "for..each" cycle as shown in the example:

Example:

Ss=""
for each S in Server.Notes
  Ss=Ss & S & vbCr
next
MsgBox Ss

Syntax:
function AddLine(Line): VOID

Applies to:
DMNotes

Adds line to the end of editor's text.

Syntax:
function InsertLine(Position, Line): VOID

Applies to:
DMNotes

Inserts line at specified position (0..LineCount-1).

Syntax:
function DeleteLine(Position): VOID

Applies to:
DMNotes

Deletes selected line.

Syntax:
function Clear: VOID

Applies to:
B740X, DMContainer, DMDigitizer, DMDigitizerContainer, DMLabels, DMListItems, DMNotes, DMStrings, E712X, HP4191X

For DMContainer and DMDigitizerContainer objects, Clear method empties the container and set Modified property to True.

For DMDigitizer, this method clears digitizer picture.

For DMListItems, DMNotes and DMStrings Clear also empties the contents of the appropriate Items (or Lines) arrays.

For HP4191X, B740X and E712X this method initialize appropriate device into some predefined state.

For DMLabels, this method deletes all plot labels.

Syntax:
function Load(FileName): VOID

Applies to:
DMContainer, DMDigitizer, DMDigitizerContainer, DMLabel, DMNotes

Load method allows you to load data from the disk file into the object. For DMContainer, text-type (ASCII) file must contain values separated by commas, tabstops or spaces. For DMDigitizerContainer, however, this method not supported. As of build #415, compressed data format (binary) was added.

DMDigitizer.Load should be used to load picture into the digitizer. DMNotes.Load just loads text into the Notes editor. DMLabel uses Load() member to copy images in various formats (ico, bmp, jpg, gif, png) into the metafile.

For DMContainer, DMLabel and DMNotes objects, this method also can handle HTTP and FTP URLs, so that you can download files located on the Internet/Intranet.

Syntax:
function Save(FileName): VOID

Applies to:
DMContainer, DMDigitizerContainer, DMNotes, DMPlot

Saves object's data to the selected disk file.

For DMContainer, values are separated by spaces, each item take a separate line. Modified property automatically cleared. In the DMDigitizerContainer object this method not implemented. As of build #415, compressed data format (binary) may be used - it depends on CompressDataFiles application option.

DMNotes object just writes editor's text to the disk. DMPlot object saves itself as a metafile picture.

Syntax:
property Text: BSTR

Applies to:
B740X, DMComboBox, DMExpressionComboBox, DMFloatEdit, DMLabel, DMListBox, DMListItems, DMNotes, DMSerie, DMSpinEdit, DMStrings, E712X, HP4191X

For DMForms ActiveX controls (DMComboBox, DMExpressionComboBox, DMListBox, DMFloatEdit, DMSpinEdit) this property changes the text in the appropriate control.

For collection objects (DMListItems, DMStrings), this property represents the contents of the collection as a single block of text. Lines are separated by standard CRLF characters.

For DMNotes, this property also operates with the editor's data as a whole.

For DMSerie and DMLabel objects, Text is just a label.

For device driver ActiveX controls (HP4191X, B740X and E712X) this property should be used to read and write data from/to the device.

Syntax:
function CanPaste: Boolean

Applies to:
DMApplication, DMDigitizer, DMInternalApplication, DMLabel, DMNotes, DMPlot, DMSerie, DMWorksheet

CanPaste method returns True if clipboard has valid data for PasteFromClipboard method. Use it to monitor controls associated with "Paste" command. Notice: for IDMApplication3 interface, this method has a parameter whose value allows to test whether desirable clipboard format is available.

Syntax:
property SelectionStart: Long

Applies to:
DMNotes

Syntax:
property SelectionLength: Long

Applies to:
DMNotes

Syntax:
function Select(SelStart, SelEnd): VOID

Applies to:
DMLabel, DMNotes, DMPlot, DMSerie, DMWorksheet

For DMNotes object, this method should be used to select text in the editor. SelStart and SelEnd parameters are first and last character positions.

For DMPlot object, Select() changes numeric (double precision) coordinates of the plot selection area. This area may be visualized using SelectionVisible property and affects on some plot editing commands.

For DMWorksheet, this method defines integer coordinates of the worksheet selection. Left and Right ranges are (1..26), Top and Bottom are (0..Container.ItemCount-1).

For DMSerie, Select() has almost the same meaning as for DMWorksheet. Columns are ranged from 1 to 26, lines - from 0 to Container.ItemCount-1. However, XCol and YCol must represent valid data, that is, all items in the selected data range must have appropriate number of columns.

For DMLabel, this method allows you programmatically select label object. Notice that Select() has no effect until IDMPlot2.MouseMode<>pmmLabelEdit.

Syntax:
function CopyToClipboard: VOID

Applies to:
DMLabel, DMNotes, DMPlot, DMSerie, DMWorksheet

For DMNotes, this method copies selected text on the clipboard as in any text editor.

For DMPlot, CopyToClipboard has a parameters. Mode parameter determine what data will be copied; possible values listed in the PlotCopyModes enumeration. UseTabs parameter defines what character will be used as separator between values: some programs can correctly paste values only if they are separated by tabstop character. Keep in mind that CopyToClipboard acts only on the data in the current plot serie, and only points whose coordinates are within the selection area are copied. If plot selection is not visible, all points or data elements are copied.

For both DMSerie and DMLabel, properties of the object are copied in the special binary format.

For DMWorksheet, it copies selected worksheet cells to the clipboard as a simple text block. UseTabs parameter also defines what character will be used as separator between values. It also puts selection data range as a serie object.

You can use system Clipboard Viewer utility to investigate what data formats are used at every case.

Syntax:
function PasteFromClipboard: VOID

Applies to:
DMDigitizer, DMLabel, DMNotes, DMPlot, DMSerie, DMWorksheet

For DMDigitizer, this method inserts into the digitizer control the picture from the clipboard.

For DMNotes, PasteFromClipboard operates like in any text editor.

For DMSerie, PasteFromClipboard has a parameter. If DataOnly=True, visual attributes like colors, point size etc. are not assigned. Keep in mind that this method can correctly paste only series copied from the same instance of DM, because it performs search to assign Container.

For DMLabel, this method is just a pair for CopyToClipboard. In addition, Rectangle - type label can paste (and display) metafiles (and bitmaps).

For DMPlot, PasteFromClipboard has Mode parameter that determines what data will be pasted; possible values defined in the PlotCopyModes enumeration. Certainly, only series and labels (or both) may be pasted; new objects are created and initialized by data from the clipboard.

For DMWorksheet, this method also has a parameters. Text in the clipboard must contain lines of values separated by spaces, commas or tabstops. Data is pasted from topleft selected cell. If InsertLines is true, new lines will be added, else existing lines will be modified according to second parameter. If Overwrite mode specified, cell contents are replaced else data from clipboard will be inserted at selected position.

For all objects, this method does nothing if there's no suitable data on the clipboard. Use CanPaste method to determine whether clipboard has appropriate data formats.

Syntax:
function Delete: VOID

Applies to:
DMIniFile, DMLabel, DMNotes, DMPlot, DMRegistry, DMSerie, DMWorksheet

For DMRegistry and DMINIFile, Delete method deletes selected Value (or INI file section). Name parameter is either name or index in the Items collection. If object was opened in the Read-Only mode, Delete call will have no effect.

For DMNotes, DMPlot and DMWorksheet objects Delete method has no parameters and should be used to delete selected data range in the appropriate objects: selected text, worksheet cells or "selected" points (points whose coordinates belong to selected plot area) in the current plot serie. Note that for DMPlot, if selection is not visible, all points from the current plot serie will be deleted.

For DMSerie and DMLabel, this method just deletes the object. It acts as the appropriate method of owner collection (DMPlot or DMLabels).

Syntax:
function Cut: VOID

Applies to:
DMNotes

Syntax:
function Undo: VOID

Applies to:
DMDocument, DMNotes

Performs Undo operation for the given object, that is, restore data to the previous state.

For DMDocument object, you should explicitly copy undo information using the SaveUndo() method before you start to change data in the container. Keep in mind that this method restores only data, so that, series ranges may change if you, for example, delete some lines.

Syntax:
function CanUndo: Boolean

Applies to:
DMDocument, DMNotes

This method returns True if Undo operation for given object is possible. Use it to monitor controls associated with the "Undo" command.

Syntax:
function SelectAll: VOID

Applies to:
DMNotes, DMWorksheet

This method selects all data range in the appropriate object.

Syntax:
property Modified: Boolean

Applies to:
DMContainer, DMDigitizerContainer, DMNotes

This property used to track data modifications.

For DMContainer, when data implicitly modified by some method or you directly set this property, object fires internal event which will correctly update all worksheets and plots referenced this container. It takes a lot of calculations and painting job so don't change this property too frequently.

Notice: when you set Modified=true, and appropriate document window is in "recording" state, plot is not forced to refresh. This feature allows you to refresh worksheet (actually you must set Modified in order to update number of lines in the worksheet!) without repainting whole plot.

You can additionally reduce painting if you set Modified=false while Document.IsRecordind=true. In this case, only worksheet size will be updated. This mode can significantly increase the rate of data streaming.

For DMNotes, this property indicates whether editor text is modified or not. For DMDigitizerContainer this property is not implemented.

Syntax:
r/o property FileName: BSTR

Applies to:
DMContainer, DMDigitizerContainer, DMNotes

Returns full name of loaded file. Note that Load() and Save() methods implicitly modify this property. If file still not loaded, this property returns empty string.

Example:

MsgBox Server.Notes.FileName
MsgBox Server.ActiveDocument.Container.FileName

Syntax:
r/o property _NewEnum: Unknown

Applies to:
DMApplication, DMContainer, DMInternalApplication, DMLabels, DMListItems, DMNotes, DMPlot, DMStrings

This property returns so-called Enumerator Object. Do not use it explicitly. It is used internally in the "for each [item] in [object]" cycles. Every object that has this property may be enumerated in such a cycles. This is for your convenience.

Examples:

function EnumDocuments
dim S
  S=""
  for each Doc in Server
    S=S & Doc.WindowCaption & vbCrLf
  next
  EnumDocuments=S  
end function

function EnumNotes
dim S
  S=""
  for each Ss in Server.Notes
    S=S & Ss & vbCrLf
  next
  EnumNotes=S  
end function

function EnumSeries
dim S
  S=""
  for each Ser in Server.ActiveDocument.Plot
    S=S & Ser.Text & vbCrLf
  next
  EnumSeries=S  
end function

function EnumItems
dim S
  S=""
  for each D in Server.ActiveDocument.Container
    S=S & D(0) & vbCrLf
  next
  EnumItems=S  
end function