-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdsign-esign-form.pbf
69 lines (56 loc) · 3.01 KB
/
cdsign-esign-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
60
61
62
63
64
65
66
67
68
69
; 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, Make_DS, Result_Bool, String_Contract, Sign_CD, Result_Text, Key_Export, Result_Bool_Sign, Button_Help, Button_About, View_CD
Enumeration FormFont
#Font_Main_Window_0
EndEnumeration
LoadFont(#Font_Main_Window_0,"Courier New", 11)
Declare ResizeGadgetsMain_Window()
Procedure OpenMain_Window(x = 0, y = 0, width = 640, height = 440)
Main_Window = OpenWindow(#PB_Any, x, y, width, height, "Digitally sign a document", #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 document file to sign")
Make_DS = ButtonGadget(#PB_Any, 10, 70, 240, 25, "Create DS keys...")
GadgetToolTip(Make_DS, "Create digital signature keys")
Result_Bool = TextGadget(#PB_Any, 260, 70, 370, 55, "Here will be DS keys creation or export result", #PB_Text_Center | #PB_Text_Border)
String_Contract = StringGadget(#PB_Any, 260, 10, 370, 25, "", #PB_String_ReadOnly)
Sign_CD = ButtonGadget(#PB_Any, 10, 40, 240, 25, "Sign the file")
GadgetToolTip(Sign_CD, "Sign with digital signature")
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_Export = ButtonGadget(#PB_Any, 10, 100, 240, 25, "Export public key...")
GadgetToolTip(Key_Export, "Export your public key to a file")
Result_Bool_Sign = TextGadget(#PB_Any, 260, 40, 370, 25, "Here will be signing with DS result", #PB_Text_Center | #PB_Text_Border)
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 the file to sign")
EndProcedure
Procedure ResizeGadgetsMain_Window()
Protected FormWindowWidth, FormWindowHeight
FormWindowWidth = WindowWidth(Main_Window)
FormWindowHeight = WindowHeight(Main_Window)
ResizeGadget(Result_Text, 10, FormWindowHeight - 280, FormWindowWidth - 20, 270)
EndProcedure
Procedure Main_Window_Events(event)
Select event
Case #PB_Event_SizeWindow
ResizeGadgetsMain_Window()
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure