...
ButtonEvent | LParam |
---|---|
CMD_BUTTON_SCRIPT_FINISHED | Last dialog event. |
SimpleDialog | Holds Pen pressed Cordinates X and Y |
All other values | User-defined parameter, can be set by SetDriverLong, key=37. |
Sample
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
// Event for Device Button Press SigDev.OnDeviceButtonEx += new AxStepOverSignatureDevice1.IStepOverSignatureDeviceEvents_OnDeviceButtonExEventHandler(SigDev_OnDeviceButtonEx); private void SigDev_OnDeviceButtonEx(object sender, AxStepOverSignatureDevice1.IStepOverSignatureDeviceEvents_OnDeviceButtonExEvent e) { // forward Event to SignAPI so it can react in DocView axSignAPIv4.OnDeviceLCDButtonHandler(e.buttonEvent); int ID = Convert.ToInt32(e.buttonEvent >> 16); int Mode = Convert.ToInt32(e.buttonEvent & 0xFFFF); // Check for ID switch (ID) { case 206: // OK Button break; case 207: // Repeat Button break; case 208: // Abort Button break; } } |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const WM_PADBUTTON_PRESS = WM_USER + $0012; type TMainForm = class(TForm) ... StepOverSignatureDevice1: TStepOverSignatureDevice; ... procedure StepOverSignatureDevice1DeviceButtonEx(Sender: TObject; ButtonEvent, LParam: Integer); private: procedure OnPadButtonPress(var Msg: TMessage); message WM_PADBUTTON_PRESS; ... end; procedure TEsoMainForm.StepOverSignatureDevice1DeviceButtonEx(Sender: TObject; ButtonEvent, LParam: Integer); begin // do not block this message !, we send ourself a new message PostMessage(Handle, WM_PADBUTTON_PRESS, ButtonEvent, LParam); end; procedure TEsoMainForm.OnPadButtonPress(var Msg: TMessage); var padmode : Integer; buttoncode : Integer; ButtonEvent : Cardinal; begin ButtonEvent := Msg.WParam; buttoncode := (Cardinal(ButtonEvent) shr 16) and $0000FFFF; padmode := Cardinal(ButtonEvent) and $0000FFFF; // Check for ID case ID of 206: begin // OK Button end; 207: begin // Repeat Button end; 208: begin // Abort Button end; end; end; |
Code Block | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
AddHandler SignatureDevice.OnDeviceButtonEx, AddressOf OnDeviceButtonExEventHandler Private Sub OnDeviceButtonExEventHandler(sender As Object, e As IStepOverSignatureAPIv4Events) 'Forward Event to SignAPI so it can response in DocView Mode SignatureAPIv41.OnDeviceLCDButtonHandler(e.buttonEvent) Dim ID As Integer = Convert.ToInt32(e.buttonEvent >> 16) Dim Mode As Integer = Convert.ToInt32(e.buttonEvent << 16) 'Check buttonID Select Case ID Case 204 'Repeat Button Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {False}) Case 206 'OK Button, you can confirm Signature If (SignatureAPIv41.GetLoadedDocName() = "" Or SignatureAPIv41.GetLoadedDocName() = Nothing) Then Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {False}) Else Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {True}) End If Case 207 ' OK Repeat, you can restart signing Dim BtnCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BtnCtrlDelegate, New Object() {True}) Case 208 ' Abort, you can abort signing Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {False}) End Select End Sub |
...