ALTAEvents Class: Difference between revisions
Jump to navigation
Jump to search
Chris Kahn (talk | contribs) No edit summary |
Chris Kahn (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
*[[ALTAEvents.ShowCalculationProgress|ShowCalculationProgress( ALTADataSet )]]{{APIComment|{{Template:WeibullEvents.ShowCalculationProgress.Cmt}}}} | *[[ALTAEvents.ShowCalculationProgress|ShowCalculationProgress( ALTADataSet )]]{{APIComment|{{Template:WeibullEvents.ShowCalculationProgress.Cmt}}}} | ||
*[[ALTAEvents.HideCalculationProgress|HideCalculationProgress( ALTADataSet )]]{{APIComment|{{Template:WeibullEvents.HideCalculationProgress.Cmt}}}} | *[[ALTAEvents.HideCalculationProgress|HideCalculationProgress( ALTADataSet )]]{{APIComment|{{Template:WeibullEvents.HideCalculationProgress.Cmt}}}} | ||
== Usage Example == | |||
{{APIComment|'Overrides requested. Create a new class and inherit ALTAEvents. Then set the dataset's Events.}} | |||
Private Class myEvents | |||
Inherits ALTAEvents | |||
Public Overrides Sub Question(sender As ALTADataSet, sMsg As String, Buttons As MsgBoxStyle, ByRef Answer As MsgBoxResult) | |||
MyBase.Question(sender, sMsg, Buttons, Answer) | |||
{{APIComment|'<Add additional code here.>}} | |||
End SubEnd Class | |||
{{APIComment|'Set the new events class.}} | |||
ADS.Events = New myEvents | |||
{{APIComment|'Initialize the MsgBoxStyle and MsgBoxResult variables.}} | |||
Dim MsgBoxStyle1 As MsgBoxStyle = MsgBoxStyle.YesNoCancel | |||
Dim Answer As MsgBoxResult | |||
{{APIComment|'Ask a question. Result will be updated in Answer.}} | |||
ADS.Events.Question(ADS, "Continue?", MsgBoxStyle1, Answer) |
Revision as of 18:43, 1 April 2014
Contains all the event handlers that can be called by ALTADataSet. To use events, you must inherit the class, override its methods and assign its instance to the Events property of an ALTADataSet. ALTAEvents inheritance is not available in VB6/VBA.
Methods
- Message( ALTADataSet, String, String, Boolean ) Called when a message should be displayed. Displays a message.
- Question( ALTADataSet, String, MsgBoxStyle, MsgBoxResult ) Called when an answer to a question is required. Displays a prompt and returns the result.
- UpdateCalculationProgress( ALTADataSet, String, String, Double, Boolean, Long, Boolean ) Called when the calculation progress should be updated. Provides ability to customize the calculation progress display.
- ShowCalculationProgress( ALTADataSet ) Called when calculation progress should be shown. Shows the current calculation progress if the calculation process is running.
- HideCalculationProgress( ALTADataSet ) Called when calculation progress should be hidden. Hides the calculation progress display.
Usage Example
'Overrides requested. Create a new class and inherit ALTAEvents. Then set the dataset's Events. Private Class myEvents Inherits ALTAEvents Public Overrides Sub Question(sender As ALTADataSet, sMsg As String, Buttons As MsgBoxStyle, ByRef Answer As MsgBoxResult) MyBase.Question(sender, sMsg, Buttons, Answer) '<Add additional code here.> End SubEnd Class 'Set the new events class. ADS.Events = New myEvents 'Initialize the MsgBoxStyle and MsgBoxResult variables. Dim MsgBoxStyle1 As MsgBoxStyle = MsgBoxStyle.YesNoCancel Dim Answer As MsgBoxResult 'Ask a question. Result will be updated in Answer. ADS.Events.Question(ADS, "Continue?", MsgBoxStyle1, Answer)