Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Custom Macro Message Position
Macros: MsgPos, MsgPosFix
You can set the position of a custom macro message. MsgPos="p100,200" sets the upper left corner of the message box 100 pixels from the left border of the main Daqarta window, and 200 pixels below the menu bar. You may use negative values to set the position outside of the Daqarta window.
The "p" before the X position specifies that both coordinates are in pixels. But you may prefer to use "dialog units" so that the message will appear in the same relative position even if you change the font preference to make the Daqarta window and all its controls larger or smaller.
Dialog unit coordinates use the same reference position, so MsgPos="0,0" will place the box right on the Averager button in the toolbar. Each toolbar button is 40 units wide and 12 units tall, so MsgPos="240,12" will place the box just under the Trigger button.
You may want to position a message near a Label or Field when prompting for entry of a subject ID. Label1 is at 29,288 and each Label or Field is 57 units wide and 13 units tall. Note that MsgPos only sets the upper left corner of the message, however, so if you want the box to be above a Label but not obscure it, you will have to set the vertical position by trial and error depending on how many lines of text are shown in the message.
You can use alternative formats to set message position. Msg="<P(x,y)" sets the position in pixels, and Msg="<D(x,y)" uses dialog units. Instead of the explicit values required by the MsgPos formats, here you can use macro expressions for x and y. Also, these alternative formats can be used by Output Display commands in MIDI Changes scripts.
TIP: You can use Posn? read-only macro values to determine coordinates of desired locations. This is especially useful for developing macros that will use dialog units. Create a test macro like this:
Msg=Posn?x + "," + Posn?y
Assign it a macro ID and save it, then close the Macro Dialog. Position the mouse cursor over any desired location, and hit F8 followed by the ID character. A message box will show the dialog coordinates of that spot.
MsgPos applies to messages that have title bars and can thus be repositioned by dragging the title bar. (Left-click anywhere in the title bar, and move the mouse while holding the left button down.) Dragging changes the default message position just like MsgPos, so the next titled message will be shown at the new location unless another MsgPos is given first.
MsgPosFix is used just like MsgPos, but it only applies to messages without title bars, which can't be dragged. The MsgPosFix position is maintained separately from the MsgPos position, and can only be changed by another MsgPosFix command.
Untitled messages are typically used to show prompts near controls that must be changed, whereas titled messages are typically used as general prompts or status reports and can be dragged to any convenient location. The titled message position is thus saved across Daqarta sessions, but the untitled position is not.
So, if a macro uses MsgPos, it may overwrite the preferred position that the user set in a prior session. If you nevertheless want to set a specific default position, you can do it with a macro variable and an IF test. See Example - Initial Msg Position under Macro Variables for details.
As with MsgPos, there are alternatives to MsgPosFix. Msg="<p(x,y)" sets the untitled message position in pixels, and Msg="<d(x,y)" sets it in dialog units. Again, these allow macro expressions for x and y, and are compatible with the Output Display commands in MIDI Changes scripts.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2021 by Interstellar Research
All rights reserved