Module SigCJLabelControlDemo.vw
1Use Windows.pkg
2Use DFClient.pkg
3Use cSigCjLabel.pkg
4
5Deferred_View Activate_oSIGCJLabelControlDemo_View for ;
6Object oSIGCJLabelControlDemo_View is a dbView
7
8 Set Border_Style to Border_Thick
9 Set Size to 200 300
10 Set Location to 2 2
11 Set Maximize_Icon to True
12 Set Label to "Codejock Demo - Label Control {xaml}"
13 Set Icon to "SIG.ico"
14
15 Function Read_xaml String sFileName Returns String
16 String sRetval sLine
17 Boolean bExists
18 Integer iChannel
19
20 File_Exist sFileName bExists
21 If (not(bExists)) Begin
22 Function_Return "Error:- File not found"
23 End
24
25 Get Seq_New_Channel to iChannel
26
27 Direct_Input channel iChannel sFileName
28 If (SeqEof) Begin
29 Close_Input channel iChannel
30 Send Seq_Release_Channel iChannel
31 Function_Return "Error:- File has no data"
32 End
33
34 While (not(SeqEof))
35 Readln channel iChannel sLine
36 Move (Append(sRetval,sLine)) to sRetval
37 Loop
38 If (SeqEof) Begin
39 Close_Input channel iChannel
40 End
41
42 Send Seq_Release_Channel iChannel
43 Function_Return sRetval
44 End_Function
45
46 Object oFileName_Form is a Form
47 Set Label to "xaml File"
48 Set Size to 13 207
49 Set Location to 9 35
50 Set Prompt_Button_Mode to pb_PromptOn
51 Set Label_Col_Offset to 2
52 Set Label_Justification_Mode to JMode_Right
53 // Set peAnchors to anTopBottomLeft
54
55 Procedure Prompt
56 Handle hoOpenDialog hoWorkspace
57 Boolean bSave
58 String sHomePath
59
60 Get phoWorkspace of oApplication to hoWorkspace
61 Get psHome of hoWorkspace to sHomePath
62
63 Get Create U_OpenDialog to hoOpenDialog
64 If (hoOpenDialog) Begin
65 Set Initial_Folder of hoOpenDialog to (sHomePath + 'Markup')
66 Set Filter_String of hoOpenDialog to "xaml (*.xaml)|*.xaml"
67
68 Get Show_Dialog of hoOpenDialog to bSave
69 If (bSave) Begin
70 Set Value to (File_Name(hoOpenDialog))
71 End
72 Send Destroy of hoOpenDialog
73 End
74 End_Procedure // Prompt
75
76 End_Object // oFileName_Form
77
78 Object oButton1 is a Button
79 Set Size to 14 35
80 Set Location to 8 253
81 Set Label to "Load"
82
83 Procedure OnClick
84 String sFileName sValue
85
86 Get Value of oFileName_Form to sFileName
87 Get Read_xaml sFileName to sValue
88 Set ComCaption of oSigCJLabel1 to sValue
89 End_Procedure
90
91 End_Object
92
93 Object oSigCJLabel1 is a cSigCJLabel // cComMarkupContext
94 Set Size to 250 400
95 Set Location to 32 6
96 Set peAnchors to anAll
97
98 Set pbEnableMarkup to True
99
100 Procedure OnCreate
101 Forward Send OnCreate
102 Handle hoMarkUpContext
103 Variant vMarkUpContext vMe
104
105 Forward Send OnCreate
106
107 Get ComMarkupContext to vMarkUpContext
108 Get Create U_cSigCjComMarkupContext to hoMarkUpContext
109 Set pvComObject of hoMarkUpContext to vMarkUpContext
110
111 Get pvComObject to vMe
112
113 Send ComSetMethod of hoMarkUpContext vMe "MakeShapeRed"
114 Send ComSetMethod of hoMarkUpContext vMe "MakeShapeGreen"
115 Send ComSetMethod of hoMarkUpContext vMe "ToggleNextControl"
116 Send ComSetMethod of hoMarkUpContext vMe "MakeTextBold"
117 Send ComSetMethod of hoMarkUpContext vMe "MakeTextNormal"
118 Send ComSetMethod of hoMarkUpContext vMe "MakeTextYellow"
119 Send ComSetMethod of hoMarkUpContext vMe "MakeTextGreen"
120 Send ComSetMethod of hoMarkUpContext vMe "MoveColumn3"
121 Send ComSetMethod of hoMarkUpContext vMe "SetText1"
122 Send ComSetMethod of hoMarkUpContext vMe "SetText2"
123 Send ComSetMethod of hoMarkUpContext vMe "AboutBox"
124 Send Destroy of hoMarkUpContext
125
126 Set ComCaption of oSigCJLabel1 to "Click thisLink"
127 //Set ComCaption of oSigCJLabel1 to "<TextBlock>Click <Hyperlink Click='http://www.donorflex.com'>this</Hyperlink>Link</TextBlock>"
128 End_Procedure
129
130 Procedure MakeShapeRed
131 Send Info_Box "Hello MakeShapeRed"
132 End_Procedure
133
134 Procedure MakeShapeGreen
135 Send Info_Box "Hello MakeShapeGreen"
136 End_Procedure
137
138 End_Object
139
140Cd_End_Object
141