General Object Information
Home ] Up ] [ General Object Information ] Label Object ] Button Object ] Text Object ] Banner Object ] Scrolling Text Object ] List Object ] Drop-Down Object ] Check Box Object ] Plotting Object ] Slider Object ] Bar Object ] Meter and Gauge Objects ] Image Object ] Image Button Object ] Back, Timers and Reset Objects ]

 

Objects can be placed onto the StampPlot background for indication and control.  The types of objects available include: Text boxes, list box, drop-down box, image boxes, image-buttons, gauges and more.  Objects can be configured to be updated with values automatically and code can be written when the object is 'activated' or an event takes place.

General procedures in using objects (Pro license required):

bulletUse the Object Editor, Config Tab to reduce the plot percent coverage (!PPER x%,y%).
bulletUse the Object Editor, Objects Tab to drag a control onto an available place on the background.
bulletSet attributes of the object, such as top position, left position, height, width, text, etc.
bulletThe background is a 100 x 100 grid from bottom-left to top-right
bulletSet an Update Value for the object to change its attribute when a !POBJ Update instruction is issued.
bulletWrite Event Code for the object, such as when it is clicked.
bulletAdd a text tip to give the user a hint of the control's use.
bulletOnce you have what you want, use the Macro Builder/Editor to construct a macro of the configuration.

Object Coding: (to test, copy and paste maroon-bold text into the Immediate text window)

Graphically you can use the Object Editor to add and modify objects.    The Macro Builder/Editor constructs a text file from your configuration. This is by-far the simplest method. Once constructed, the code may be in a macro to configure StampPlot, or it may be sent serially form your controller.

Of course, it's important to understand what is going on and what the code means.

With Release 1.5, !POBJ may be abbreviated with !O.
!O Update

bulletCreating
The general format for creating an object in code is (parameters in [ ] are optional):
!POBJ objType.objName=L,T,[W,H,data,data...]
L=Left. T=Top, W=Width, H=Height
For example:
'Clear all objects
!POBJ Clear
'Reduce plot to 20% by 20%
!PPER 20,20

'Creates a button object named ButHi at 50,50 width of 15 (and default height) captioned Hello
!POBJ oButton.butHi=50,50,15,,Hello


bulletSetting
Once created the object may be set using
!POBJ objName.Set=data...
or
!POBJ objName=data...
'Sets lblHi to read Bye
!POBJ butHi=Bye

bulletAutomatic Updating
An update value may be set to update the object each time a !POBJ Update instruction is issued (set up a timer to issue this at set intervals for example).  The data is the same as the Set data since Update simply sets the object on update.
!POBJ objName.Update=data...
or
!POBJ objName.U=data

'Sets ButHi to be updated when !POBJ Update is issued.
!POBJ butHi.U=(RTIME)


bulletEvent Code
Most of the objects have a means of triggering the event code.  For example, a button is clicked.  When the objects event is activated, the event code will be processed.
!POBJ objName.Code=code
OR
!POBJ objName.C=code

!POBJ butHi.C=!STAT (DATE) (RTIME)(ER)!BELL
Sets the event code to place the real time in the status box and ring a bell. Click the button to test. (ER) is a event carriage return for allowing multiple instructions.  When using the Editor, Instructions may be place on separate lines.  When the macro is built, these carriage returns will be replaced with (;) to indicate to StampPlot the code extends to the next line.

bulletText Tips
Text Tips can be added to give tips to the user on the control when they place their mouse over it.
!POBJ objName.Tip=tip message
!POBJ butHi.Tip=Click Me to see the time!

bulletFont
Objects with text can have the font set.  If ONLY the font size is changed, this is reflected in the data for the object creation.  If the Font is changed, a Font instruction is generated by the Macro Builder.
!POBJ butHi.Font=font_name,size,bold (0/1), Italic (0/1)
OR
!POBJ butHi.F=font_name,size,bold (0/1), Italic (0/1)
!POBJ butHi.Font=Times New Roman,12,1,1

bulletMoving
All objects can be moved in code.  This can be used for special effects of moving objects using code.
!POBJ objName.Move=[L,T,W,H]
OR
!POBJ objName.M=[L,T,W,H]
!POBJ butHi.M=80,,,10

Moves object to Left of 80, Height of 10.

bulletVisibility
Objects can be set visible or not visible.
!POBJ objName.Visible = 0 or 1
OR
!POBJ objName.V=0 or 1

bulletSetting Focus
Code can be used to set the current cursor focus to an object
!POBJ objName.SF

bulletRunning Event Code in other ways
bulletEvent code can be ran for a particular object by using:
!POBJ objName.Run
bulletObjects with names beginning with DA_ (such as DA_butHi) will have their event code automatically processed whenever analog data arrives.
bulletObjects with names beginning with DB_ (such as DB_butHi) will have their event code automatically processed whenever binary data arrives.
bulletObjects with names beginning with DM_ (such as DM_txtMsg) will have their event code automatically processed whenever message data arrives.

bulletObject Values
bulletObjects can return values to be used in processing or read by the controller.  As with all StampPlot Values, they need to be enclosed in parenthesis.   For example
!STAT (butHi)
Places the text value of the button  in the user status box.

bulletAll control objects can return their positions and other values 
!STAT (butHi.T) (butHi.L) (butHi.W) (butHi.H)

bulletME is a special value to be used only in Event Code (or when using !DEFS, but that's another use).
(ME) returns the name of the current object
((ME)) returns the value of the current object.
Test this out:
!POBJ butHi.C=!POBJ (ME).Move=[((ME).L),-,5],[((ME).T),-,5]
Now click the button.
[ ] indicate a math operation.

bulletTo read a value of an object on the Plot, have the controller send a !READ (objName).  The value will be returned as an ASCII string (if micro echoes data is enabled, a |Q| will be appended for filtering by StampPlot.  StampPlot of course can send data with out a request, in the code use !SEND (objName).  See the Interactive discussions or refer to examples.
bulletDeleting an Object
A control object may be deleted through code using:
!POBJ objName.DEL
To Delete all Objects, use !POBJ Clear

bulletObject WildCard
Mutliple objects may be updated at once using wildcard.

!POBJ txt*.V=0
Makes all objects named starting with txt invisible.
!Pobj but*.Tip = Click me!
Sets all objects named starting with but to have a text tip of 'Click Me!'

Please see specific control objects for their unique instructions, values, and use.