Current Page:
NeXtMidas Training
Macros - Part 2 (Graphics)
Lab 11
Instructions
|
- Start Here
+ Background
+ Common Midas Concepts
+ Getting Started
+ Working with Files
+ Option Trees
+ Macros - Part 1 (Basics)
- Macros - Part 2 (Graphics)
+ Intro to Graphics
+ GControls
- Lab 11
- Instructions
- Solution
+ Plotting and Listing
+ Panel Setup
+ Lab 12
+ Conclusion
+ Lab 13
+ Primitives
+ Installing NeXtMidas
+ Applets & WebStart
- Mapping (NeXtEarth)
+ Remote Midas InterFace (RMIF)
+ Using NetBeans
+ X-Midas Interoperability
+ Remoting an X-Midas App.
|
- Lab 11 (Part A):
- Lab 11 (Part B):
- Now its time to fill in the
processMessage procedure.
- When the user clicks the "Stop" button the macro should stop. You can do this
by calling
PIPE STOP .
- When the user clicks on the graphical calendar, you need to update the
year, month, and day widgets to match the date the user selected.
- The date selected is in the data field of the message.
- You will need to use
SEDIT to parse the date (we
did something like this back in Lab 5).
- You can make the output of
SEDIT set the value of each of the
widgets.
- Hint: Remember adding the
/CONTROLS=GC back in
Part A? That was so that we can use GC.<name>.VALUE
to set the values of the widgets.
- When the user updates the year, month, or day fields you will need to update the
calendar to match.
- For this you will need to
INVOKE the
setDate(year,month,day) method in the calendar widget.
- You will need to use
SEDIT to parse the date (we
did something like this back in Lab 5).
- Hint: This time use
GC.<name>.VALUE
to get the values of the widgets.
- Hint: Since all three
LVAL widgets end up
calling the same code, you might want to write the code once and make use of
the OR in your IF .
- Prior to NeXtMidas 2.3.0 there was a bug in
setDate(..) that caused the month to be computed incorrectly.
- Finally, if you get a message that doesn't match any of the above, you should print
out a message saying you got an "Unhandled message".
Lab 11 (Part X):
- This is not actually part of the lab...
- If you finish the lab quickly, here are a few things you might want to consider
adding to your macro:
- If the user selects a date that is invalid (such as "April 31"), alert the
user using
POPUP .
- A procedure that computes leap years might be helpful (hint: Lab 5).
- Add a text field control. When the user changes the date update the control to
include the date.
|