Change Controls on the Browser Display From Your PIC
If you think about it, every Windows program you have ever run has changed its appearance in subtle ways from one moment to the next, usually to guide your actions. These are called context sensitive displays, because their appearance changes according to the context of what the user is doing at any time.
• Controls like buttons or text boxes will sometimes appear grayed out (disabled) in order to show you that it is not meaningful for you to click them right now. Even if you do click on them when they are in the disabled state, nothing will happen.
• Similarly, sometimes menu items will appear or disappear at times, to restrict your choices and prevent you from choosing something that would cause harm.
• Some Windows programs will sometimes change the color of some screen controls or text, to indicate a good or bad condition.
You Can Do This In Your TCPmaker Device, With NO PC PROGRAMMING
The ability to change the appearance of controls on the screen is useful technique that Windows software developers use a lot. As a TCPmaker Pro developer, you can do those sorts of things as well. You can easily add a few lines to the code in your embedded web server device to tell the TCPmaker controls on your browser screen to change their text, color, transparency, rotation, and so on.
This is all driven from your PIC code, with simple function calls: there is NO PC PROGRAMMING AT ALL.
Here are just some of the things you can do with TCPmaker 's Control Messages:
- Change the variable that is being graphed on the oscilloscope control
- Make controls disappear at times when it would be inappropriate for the user to click or drag them
- Change the colors of buttons or gauges, to show warnings that are easy to see from across the room
- If your device senses a danger condition in the hardware it is controlling, make the browser go to an emergency page that you designed into your multi-page TCPmaker layout
The possibilities are endless - what will YOU think of next?
TCPmaker 's Control Message API Functions
mtSetTextColor() - Set the color of a Tx text display
mtSetTextRom() - Set the text of a control
mtSetTextSize() - Set the size of text on the Tx text display
Position and Appearance
mtSet_x() - Move a control in x direction only
mtSet_y() - Move a control in y direction only
mtSet_xy() - Move a control in both x and y directions
mtSet_rotation() - Rotate a control
mtSet_alpha() - Change transparency of a control
mtMoveControl() - Move a control and change its appearance at the same time
mtSetColorIndices() - Set both c and a color indices for a Pb or Ld control
mtSetColorIndex() - Set the cx (i.e., the one and only) color index for controls Hs, Bx, C1
mtGoToPage() - Go To A Page
mtSetButtonGoToPage() - Set the "GoTo" page (g property) of a Pb button control
mtOkToSend() – Is it OK to transmit a control message to the browser?
mtSetButtonMode() - Set the operating mode for a button
Variables and Associations
mtSetAssociationIv() - Associate an integer web variable with a control
mtSetAssociationNv() - Associate a float web variable with a control
mtSetAssociationSv() - Associate a string web variable with a control
mtSetFormat() - Set the format string and argument list of an Sv string variable
mtSetScale() - Set the scaling factors for a floating point Nv variable
mtSetScale_NoFloatLibs() - Set the scaling factors for a Numeric variable, specifying the PC side floating point parameters, pn and px, as strings
Read more: Using simple event handlers >>
Read more: mtServer events >>
Read more: Sending data to the PC browser >>
Next: Applications for TCPmaker >>