-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdsign-check-form.pbf
59 lines (48 loc) · 2.76 KB
/
cdsign-check-form.pbf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
; Form Designer for Purebasic - 5.70
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Global Main_Window
Global File_CD, File_DS, Result_Bool, String_Contract, String_Signature, Check_DS, Result_Text, Key_Import, String_Key, Button_Help, Button_About, View_CD
Enumeration FormFont
#Font_Main_Window_0
EndEnumeration
LoadFont(#Font_Main_Window_0,"Courier New", 11)
Procedure OpenMain_Window(x = 0, y = 0, width = 640, height = 440)
Main_Window = OpenWindow(#PB_Any, x, y, width, height, "Check document digital signature", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
File_CD = ButtonGadget(#PB_Any, 10, 10, 240, 25, "Document (or contract) file...")
GadgetToolTip(File_CD, "Choose the signed document file to check")
File_DS = ButtonGadget(#PB_Any, 10, 40, 240, 25, "Signature file for this document...")
GadgetToolTip(File_DS, "Choose the digital signature file for this document")
Result_Bool = TextGadget(#PB_Any, 210, 100, 420, 25, "Here will be DS check result", #PB_Text_Center | #PB_Text_Border)
String_Contract = StringGadget(#PB_Any, 260, 10, 370, 25, "", #PB_String_ReadOnly)
String_Signature = StringGadget(#PB_Any, 260, 40, 370, 25, "", #PB_String_ReadOnly)
Check_DS = ButtonGadget(#PB_Any, 10, 100, 190, 25, "Check digital signature")
GadgetToolTip(Check_DS, "Run digital signature check")
Result_Text = EditorGadget(#PB_Any, 10, 160, 620, 270, #PB_Editor_ReadOnly | #PB_Editor_WordWrap)
SetGadgetColor(Result_Text, #PB_Gadget_FrontColor,RGB(228,228,228))
SetGadgetColor(Result_Text, #PB_Gadget_BackColor,RGB(0,0,0))
SetGadgetFont(Result_Text, FontID(#Font_Main_Window_0))
Key_Import = ButtonGadget(#PB_Any, 10, 70, 240, 25, "Import public key...")
GadgetToolTip(Key_Import, "Import public key from a key file during signature checking")
String_Key = StringGadget(#PB_Any, 260, 70, 370, 25, "", #PB_String_ReadOnly)
Button_Help = ButtonGadget(#PB_Any, 320, 130, 150, 25, "Help")
Button_About = ButtonGadget(#PB_Any, 480, 130, 150, 25, "About")
View_CD = ButtonGadget(#PB_Any, 10, 130, 300, 25, "Show signed document")
EndProcedure
Procedure Main_Window_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure