Difference between revisions of "Event Reference"
Line 9: | Line 9: | ||
− | For example, say there is a colour property that controls the colour of a certain part of a component. That component | + | For example, say there is a colour property that controls the colour of a certain part of a component. That component needs to be able to recognise that the colour property has been updated and that therefore the colour of the object on the panel needs to change. In this case the property event would be called upon as one of the component's properties has been changed by the user. In the macro assigned to the property change event we can redraw the object on the panel in the colour specified and this allows for the functionality we require. As these events are simulation only you can process all of the properties at once rather then trying to figure out which specific property has been changed and only reacting to that. |
Revision as of 14:28, 31 October 2013
<sidebar>Event Contents</sidebar>
Flowcode provides an event interface to help writing simulation and PC-side programs.
This event list allows Flowcode to communicate with the components through macros.
An event may be thought of as a simulation-side interrupt. Each event associated with a Flowcode program will call a macro when that event occurs.
For example, say there is a colour property that controls the colour of a certain part of a component. That component needs to be able to recognise that the colour property has been updated and that therefore the colour of the object on the panel needs to change. In this case the property event would be called upon as one of the component's properties has been changed by the user. In the macro assigned to the property change event we can redraw the object on the panel in the colour specified and this allows for the functionality we require. As these events are simulation only you can process all of the properties at once rather then trying to figure out which specific property has been changed and only reacting to that.
Events are grouped by class to provide context for their use. Below is a reference to the classes and events available:
Compile | |
---|---|
AddProperty | Sent to a component to allow dynamic amendment of global property declarations |
AddConst | Sent to a component to allow dynamic amendment of global variable declarations |
AddVarSize | Sent to a component to allow dynamic amendment of global array-size declarations |
AddVar | Sent to a component to allow dynamic amendment of global constant declarations |
AddHeader | Sent to a component to allow dynamic amendment of header code |
AddInterrupts | Sent to a component to allow dynamic amendment of the interrupts for a component |
AddInterrupt | Sent to a component to allow dynamic amendment of a single interrupts code |
Start | Broadcast to all components that compilation is starting |
Stop | Broadcast to all components that compilation has stopped |
GetVarSize | Sent to a component to amend the size of the expected array |
Components | |
Property | Sent when a property has been changed by the User |
Added | Broadcast to all existing components once a new component has been added |
Adding | Broadcast to all existing components when a new component is about to be added |
Resize | Sent to the mouse target when the user has altered the position of a component child |
Removed | Broadcast to all remaining components once an existing component has been removed |
Removing | Broadcast to all existing components when an existing component is about to be removed |
Closedown | Closedown routine for the component |
Closing | Pre-Closedown routine for the component, sent when the component is linked |
Initialise | Initialisation routine for the component once the component is linked to its parent |
Initialising | Initialisation routine before the component is linked to its parent |
Console | |
AddLine | Post to the owning component when a line is inserted by the user |
TextChanged | Post when the console text is changed by the user in some way |
MemChanged | Post when the console memory is changed by the user in some way |
Connection | |
PinPopulate | Sent when auto-populate of digital connections is requested |
PinChange | Sent during simulation if a connected port pin changes |
AnPopulate | Sent when auto-populate of analog connections is requested |
AnChange | Sent during simulation if a connected ADC channel changes |
ChipChange | Sent when the target device has changed |
Unconnected | Sent when the component is compiled with unconnected pins |
Scope | |
Overlay | Sent when the mouse hovers over a scope stream |
Simulation | |
Pause | Broadcast to all components that simulation has paused |
Resume | Broadcast to all components that simulation has resumed |
Start | Broadcast to all components that simulation is starting |
Stop | Broadcast to all components that simulation has stopped |
System | |
CleanHandle | Called when a custom handle is deleted to allow cleanup of resources |
Timer | Called back on the panel command System.TimerStart |
User | Called back on the panel command System.Notify |
Sound | |
Complete | Sent when a sound queued by the component has finished playing |
Tooltip | |
GraphicPoll | Called when a tooltip graphic is updating with the draw image already pushed |
GetText | Called when a tooltip text string can be displayed |
GetGraphic | Called when a tooltip graphic can be displayed with the draw image already pushed |
File | |
Changed | Sent when a file being watched has changed |
Closed | Sent when a file monitor is being closed |
Graphics | |
Animated | Notification than an animation has finished |
Redraw | Reconstructs and redraws the target component |
Keyboard | |
KeyMapDown | Sent when a mapped key is pressed for the component |
KeyMapUp | Sent when a mapped key is released for the component |
MappingKeys | Sent to find out how many keys it is possible to map to the component during simulation |
Mouse | |
Release | Sent when the mouse is released on a child of the component during simulation |
Click | Sent when the mouse is clicked on a child of the component during simulation |
Drag | Sent when the mouse is dragged on a child of the component during simulation |