Jump to content

Event Reference: Difference between revisions

From Flowcode Help
Admin (talk | contribs)
No edit summary
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<sidebar>Event Contents</sidebar>
Flowcode provides an ''event interface'' to help writing simulation and PC-side programs.
Flowcode provides an ''event interface'' to help writing simulation and PC-side programs.


Line 8: Line 5:
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.
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.


 
Events are grouped by ''class'' to provide context for their use. A reference to the classes and events are available here: [[Simulation_Functionality#Events|Simulation Library]].
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:
{| class="wikitable"
|-
! colspan="2" | [[Event class Compile|Compile]]
|-
| width="30%" | [[Event Compile.AddProperty|AddProperty]]
|Sent to a component to allow dynamic amendment of global property declarations
|-
| width="30%" | [[Event Compile.AddConst|AddConst]]
|Sent to a component to allow dynamic amendment of global variable declarations
|-
| width="30%" | [[Event Compile.AddVarSize|AddVarSize]]
|Sent to a component to allow dynamic amendment of global array-size declarations
|-
| width="30%" | [[Event Compile.AddVar|AddVar]]
|Sent to a component to allow dynamic amendment of global constant declarations
|-
| width="30%" | [[Event Compile.AddHeader|AddHeader]]
|Sent to a component to allow dynamic amendment of header code
|-
| width="30%" | [[Event Compile.AddInterrupts|AddInterrupts]]
|Sent to a component to allow dynamic amendment of the interrupts for a component
|-
| width="30%" | [[Event Compile.AddInterrupt|AddInterrupt]]
|Sent to a component to allow dynamic amendment of a single interrupts code
|-
| width="30%" | [[Event Compile.Start|Start]]
|Broadcast to all components that compilation is starting
|-
| width="30%" | [[Event Compile.Stop|Stop]]
|Broadcast to all components that compilation has stopped
|-
| width="30%" | [[Event Compile.GetVarSize|GetVarSize]]
|Sent to a component to amend the size of the expected array
|-
! colspan="2" | [[Event class Components|Components]]
|-
| width="30%" | [[Event Components.Property|Property]]
|Sent when a property has been changed by the User
|-
| width="30%" | [[Event Components.Added|Added]]
|Broadcast to all existing components once a new component has been added
|-
| width="30%" | [[Event Components.Adding|Adding]]
|Broadcast to all existing components when a new component is about to be added
|-
| width="30%" | [[Event Components.Resize|Resize]]
|Sent to the mouse target when the user has altered the position of a component child
|-
| width="30%" | [[Event Components.Removed|Removed]]
|Broadcast to all remaining components once an existing component has been removed
|-
| width="30%" | [[Event Components.Removing|Removing]]
|Broadcast to all existing components when an existing component is about to be removed
|-
| width="30%" | [[Event Components.Closedown|Closedown]]
|Closedown routine for the component
|-
| width="30%" | [[Event Components.Closing|Closing]]
|Pre-Closedown routine for the component, sent when the component is linked
|-
| width="30%" | [[Event Components.Initialise|Initialise]]
|Initialisation routine for the component once the component is linked to its parent
|-
| width="30%" | [[Event Components.Initialising|Initialising]]
|Initialisation routine before the component is linked to its parent
|-
! colspan="2" | [[Event class Console|Console]]
|-
| width="30%" | [[Event Console.AddLine|AddLine]]
|Post to the owning component when a line is inserted by the user
|-
| width="30%" | [[Event Console.TextChanged|TextChanged]]
|Post when the console text is changed by the user in some way
|-
| width="30%" | [[Event Console.MemChanged|MemChanged]]
|Post when the console memory is changed by the user in some way
|-
! colspan="2" | [[Event class Connection|Connection]]
|-
| width="30%" | [[Event Connection.PinPopulate|PinPopulate]]
|Sent when auto-populate of digital connections is requested
|-
| width="30%" | [[Event Connection.PinChange|PinChange]]
|Sent during simulation if a connected port pin changes
|-
| width="30%" | [[Event Connection.AnPopulate|AnPopulate]]
|Sent when auto-populate of analog connections is requested
|-
| width="30%" | [[Event Connection.AnChange|AnChange]]
|Sent during simulation if a connected ADC channel changes
|-
| width="30%" | [[Event Connection.ChipChange|ChipChange]]
|Sent when the target device has changed
|-
| width="30%" | [[Event Connection.Unconnected|Unconnected]]
|Sent when the component is compiled with unconnected pins
|-
! colspan="2" | [[Event class Scope|Scope]]
|-
| width="30%" | [[Event Scope.Overlay|Overlay]]
|Sent when the mouse hovers over a scope stream
|-
! colspan="2" | [[Event class Simulation|Simulation]]
|-
| width="30%" | [[Event Simulation.Pause|Pause]]
|Broadcast to all components that simulation has paused
|-
| width="30%" | [[Event Simulation.Resume|Resume]]
|Broadcast to all components that simulation has resumed
|-
| width="30%" | [[Event Simulation.Start|Start]]
|Broadcast to all components that simulation is starting
|-
| width="30%" | [[Event Simulation.Stop|Stop]]
|Broadcast to all components that simulation has stopped
|-
! colspan="2" | [[Event class System|System]]
|-
| width="30%" | [[Event System.CleanHandle|CleanHandle]]
|Called when a custom handle is deleted to allow cleanup of resources
|-
| width="30%" | [[Event System.Timer|Timer]]
|Called back on the panel command System.TimerStart
|-
| width="30%" | [[Event System.User|User]]
|Called back on the panel command System.Notify
|-
! colspan="2" | [[Event class Sound|Sound]]
|-
| width="30%" | [[Event Sound.Complete|Complete]]
|Sent when a sound queued by the component has finished playing
|-
! colspan="2" | [[Event class Tooltip|Tooltip]]
|-
| width="30%" | [[Event Tooltip.GraphicPoll|GraphicPoll]]
|Called when a tooltip graphic is updating with the draw image already pushed
|-
| width="30%" | [[Event Tooltip.GetText|GetText]]
|Called when a tooltip text string can be displayed
|-
| width="30%" | [[Event Tooltip.GetGraphic|GetGraphic]]
|Called when a tooltip graphic can be displayed with the draw image already pushed
|-
! colspan="2" | [[Event class File|File]]
|-
| width="30%" | [[Event File.Changed|Changed]]
|Sent when a file being watched has changed
|-
| width="30%" | [[Event File.Closed|Closed]]
|Sent when a file monitor is being closed
|-
! colspan="2" | [[Event class Graphics|Graphics]]
|-
| width="30%" | [[Event Graphics.Animated|Animated]]
|Notification than an animation has finished
|-
| width="30%" | [[Event Graphics.Redraw|Redraw]]
|Reconstructs and redraws the target component
|-
! colspan="2" | [[Event class Keyboard|Keyboard]]
|-
| width="30%" | [[Event Keyboard.KeyMapDown|KeyMapDown]]
|Sent when a mapped key is pressed for the component
|-
| width="30%" | [[Event Keyboard.KeyMapUp|KeyMapUp]]
|Sent when a mapped key is released for the component
|-
| width="30%" | [[Event Keyboard.MappingKeys|MappingKeys]]
|Sent to find out how many keys it is possible to map to the component during simulation
|-
! colspan="2" | [[Event class Mouse|Mouse]]
|-
| width="30%" | [[Event Mouse.Release|Release]]
|Sent when the mouse is released on a child of the component during simulation
|-
| width="30%" | [[Event Mouse.Click|Click]]
|Sent when the mouse is clicked on a child of the component during simulation
|-
| width="30%" | [[Event Mouse.Drag|Drag]]
|Sent when the mouse is dragged on a child of the component during simulation
|}

Latest revision as of 16:21, 23 July 2026

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.

Events are grouped by class to provide context for their use. A reference to the classes and events are available here: Simulation Library.