Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Custom Macro Messages (No Buttons)
Macros: Msg, MsgTitle, MsgStyle
Msg="Test Message" shows a simple custom macro message, replacing any prior message. Msg=" removes any prior message.
Macro commands can be used to control features of the message such as title, size, position, and colors. There are two general approaches for this: Explicit named commands such as MsgTitle, and extensions of the Msg macro that use the general format of Msg="<parameters". The latter is the same format used by Custom Meters. It is a bit more cryptic, but generally more powerful because it can use macro expressions instead of simple explicit values for the parameters. It is also the only way MIDI Changes scripts can control macro messages via the Output Display commands.
By default, Msg text is centered in the box, and has a title bar that just says "Macro Message" above the message text. MsgTitle="New Title" or Msg="<<New Title" changes it to "New Title". Titles may be up to 32 characters long, and will be used with subsequent Msg macros until specifically changed.
The message box is automatically sized to the message text. If the message is short, the title may be truncated. You can use MsgTitle= or Msg="<<" to specify an empty title bar.
MsgStyle=TC or Msg="<sTC" is the default message style, where T specifies Title and C specifies Centered. Other options besides Centered are R for Right-justified and L for Left. So, for example MsgStyle=L or Msg="<sL" will show Left-justified text but no Title.
A message without a Title bar has no "handle" to allow the user to drag it to another position. This makes it a good choice to place near a specifc Label, Field, or control as an operator prompt. There are separate position macros for messages with and without titles.
Msg text can span multiple lines by using a single pair of quotes to surround the entire message:
MsgStyle=TC ;Title, Center MsgTitle="Test Steps" Msg="1) Select Frequency. 2) Set SPL. 3) Hit StartTest." ;End of 3-line Msg
Note the comments on the first and last lines of the above macro. Comments can't be used within the message quotes, or they will be shown as part of the message.
Msg="1) Set Frequency to ." +F +n +_ ;Start of Msg +"2) Set SPL." +n +_ ;2nd line of Msg +"3) Hit StartTest." ;End of 3-line Msg
String expressions can also use Msg on the right side to append the current message to a string, as in Notes=Notes + Msg. You can also append a string or value to the end of an existing message as in Msg=Msg + UX. (Here the value of UX would be appended without an intervening space... you may prefer Msg=Msg + " " + UX.)
Note that when Msg is used to request that the operator change some Daqarta control or enter data, the WaitChange command can suspend macro processing until that action has taken place.
In the Macro Examples and Mini-Apps included with Daqarta you may notice that each macro definition begins with a comment like like ;<Help=H4900. That sets the Help topic that will be opened by clicking the Help button in the main macro dialog, or in the Edit dialog, for that specific macro.
In addition, that same Help topic will be opened by right-clicking anywhere in any Msg box that the macro may display. However, there may be rare occasions when you want a message box to be linked to a different Help topic. One example might be a message that suggests closing the running macro and running another instead. In that case, just before the message is shown you would use a command like Msg="<H490D", which in this case would open the Help topic for the File Navigator mini-app.
Otherwise, in macros that you write yourself, you probably won't have the initial Help comment line. Likewise, you probably won't need to open Help topics for other mini-apps so you won't be using the above command. Right-clicking the message box will instead open this Custom Macro Messages topic.
To copy a displayed message to the Windows Clipboard, left-click anywhere in the central region of the message window. This pops up a prompt allowing you to save the message to the Clipboard. CTRL+left-click saves it directly, without the prompt.
The first format uses explicit commands like MsgColr and requires explicit parameter values. The second format uses an extension of the Msg command, plus a code character like C and parameters which may be expressions (except for Style).
Follow the links for detailed information on each command:
Title: MsgTitle="New Title" Msg="<<New Title" Message Style (T, C, L, R): MsgStyle=TC Msg="<sTC" Text Color: MsgColr="r,g,b" Msg="<C(r,g,b)" Background Color: MsgBkColr="r,g,b" Msg="<B(r,g,b)" Position re: Average button, in pixels: MsgPos="px,y" Msg="<P(x,y)" Position re: Average button, in dialog units: MsgPos="x,y" Msg="<D(x,y)" Untitled Fixed Position, in pixels: MsgPosFix="px,y" Msg="<p(x,y)" Untitled Fixed Position, in dialog units: MsgPosFix="x,y" Msg="<d(x,y)" Font Height, pixels (0-1000): MsgFont=n Msg="<F(n)" Font Weight (Boldness) (0-1000): MsgWeight=n Msg="<W(n)" Italic Mode (0 or 1): MsgItalic=n Msg="<i(n)" Font Family (0-3): MsgFamily=n Msg="<f(n)" Vertical White Space (0-100): Msg="<v(n)" Horizontal White Space (0-100): Msg="<h(n)"
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 30 Years of Innovative Instrumentation
© Copyright 2007 - 2017 by Interstellar Research
All rights reserved