forked from macoslib/macoslib
/
LabelExtensionExampleWindow.rbfrm
261 lines (250 loc) · 10.9 KB
/
LabelExtensionExampleWindow.rbfrm
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#tag Window
Begin Window LabelExtensionExampleWindow
BackColor = &hFFFFFF
Backdrop = ""
CloseButton = True
Composite = False
Frame = 0
FullScreen = False
HasBackColor = False
Height = 3.15e+2
ImplicitInstance= True
LiveResize = True
MacProcID = 0
MaxHeight = 32000
MaximizeButton = False
MaxWidth = 32000
MenuBar = ""
MenuBarVisible = True
MinHeight = 64
MinimizeButton = True
MinWidth = 64
Placement = 0
Resizeable = True
Title = "Label extensions"
Visible = True
Width = 7.54e+2
Begin TabPanel TabPanel1
AutoDeactivate = True
Bold = ""
Enabled = True
Height = 219
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 15
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Panels = ""
Scope = 0
SmallTabs = ""
TabDefinition = "Normal text\rStyled text"
TabIndex = 7
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 7
Underline = ""
Value = 1
Visible = True
Width = 726
Begin Label Label1
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 158
HelpTag = ""
Index = -2147483648
InitialParent = "TabPanel1"
Italic = ""
Left = 21
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Multiline = True
Scope = 0
Selectable = True
TabIndex = 0
TabPanelIndex = 1
Text = "In Cocoa, a Label object is just a TextField without background or editing capabilities.\rAs TextFields support AttributedString (i.e. a more advanced equivalent of the RB's StyledText), so can Labels, e.g:\r\r1. Styled text, including subscript and superscript\r2. Different underlining styles and colors (also strike-through)\r3. Multiple help tags for different parts of the text\r4. Automatic handling of hypertext links\r\r... and many more features"
TextAlign = 0
TextColor = &h000000
TextFont = "System"
TextSize = 12
TextUnit = 0
Top = 41
Transparent = False
Underline = ""
Visible = True
Width = 720
End
Begin Label RichLBL
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 167
HelpTag = ""
Index = -2147483648
InitialParent = "TabPanel1"
Italic = ""
Left = 21
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Multiline = True
Scope = 0
Selectable = True
TabIndex = 0
TabPanelIndex = 2
Text = ""
TextAlign = 0
TextColor = &h000000
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 41
Transparent = False
Underline = ""
Visible = True
Width = 707
End
End
Begin Label Label2
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 16
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Multiline = ""
Scope = 0
Selectable = False
TabIndex = 8
TabPanelIndex = 0
Text = "You can also select how a string will be truncated if it is too long for the Label"
TextAlign = 0
TextColor = &h000000
TextFont = "System"
TextSize = 12
TextUnit = 0
Top = 243
Transparent = False
Underline = ""
Visible = True
Width = 583
End
Begin Label Label3
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 35
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Multiline = True
Scope = 0
Selectable = True
TabIndex = 9
TabPanelIndex = 0
Text = "You can also select how a string will be truncated if it is too long for the Label"
TextAlign = 0
TextColor = &h00800040
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 275
Transparent = False
Underline = ""
Visible = True
Width = 342
End
Begin PopupMenu LineBreakPOP
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
InitialValue = "Word wrapping\rChar wrapping\rClipping\rTruncating head\rTruncating tail\rTruncating middle"
Italic = ""
Left = 405
ListIndex = 2
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Scope = 0
TabIndex = 10
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 273
Underline = ""
Visible = True
Width = 297
End
End
#tag EndWindow
#tag WindowCode
#tag Constant, Name = HTMLString, Type = String, Dynamic = False, Default = \"<html><body><span style\x3D\"font:13px \'Lucida Grande\'; line-height:100%;\"><u>Hello</u> <b>world</b> !! <a href\x3D\"http://apple.com\">Apple</a></span></body></html>", Scope = Public
#tag EndConstant
#tag Constant, Name = HTMLStringIntroStyled, Type = String, Dynamic = False, Default = \"<html><body><span style\x3D\"font:13px \'Lucida Grande\'; line-height:100%;\">In Cocoa\x2C a Label object is just a TextField without background or editing capabilities.\r<p>As TextFields support AttributedString (i.e. a more advanced equivalent of the RB\'s StyledText)\x2C so can Labels\x2C e.g:\r\r1. Styled text\x2C including subscript and superscript\r2. Different <span style\x3D\"border-bottom: 1px blue dotted;\">underlining styles</span> and colors (also strike-through)\r3. Multiple help tags for different parts of the text\r4. Automatic handling of hypertext links\r\r... and many more features</span></body></html>", Scope = Public
#tag EndConstant
#tag Constant, Name = RTFStringIntroStyled, Type = String, Dynamic = False, Default = \"{\\rtf1\\ansi\\ansicpg1252\\cocoartf1138\\cocoasubrtf320\r{\\fonttbl\\f0\\fnil\\fcharset204 LucidaGrande;}\r{\\colortbl;\\red255\\green255\\blue255;\\red128\\green64\\blue0;\\red255\\green0\\blue0;\\red0\\green128\\blue64;\r\\red27\\green0\\blue255;}\r{\\*\\listtable{\\list\\listtemplateid1\\listhybrid{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{decimal\\}.}{\\leveltext\\leveltemplateid1\\\'02\\\'00.;}{\\levelnumbers\\\'01;}\\fi-360\\li720\\lin720 }{\\listname ;}\\listid1}}\r{\\*\\listoverridetable{\\listoverride\\listid1\\listoverridecount0\\ls1}}\r\\paperw11900\\paperh16840\\margl1440\\margr1440\\vieww11360\\viewh9220\\viewkind0\r\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\pardirnatural\r\r\\f0\\fs24 \\cf0 In \\cf2 Cocoa\\cf0 \x2C a Label object is just a TextField without background or editing capabilities.\\\rAs TextFields support AttributedString (i.e. a more advanced equivalent of the RB\'s StyledText)\x2C so can Labels\x2C e.g:\\\r\\\r\\pard\\tx220\\tx720\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\li720\\fi-720\\pardirnatural\r\\ls1\\ilvl0\\cf0 {\\listtext\t1.\t}\r\\b Styled\r\\b0 text\x2C including \r\\fs18 \\sub subscript\r\\fs24 \\nosupersub and \r\\fs18 \\super superscript\r\\fs24 \\nosupersub \\\r{\\listtext\t2.\t}Different \\ul \\ulc0 underlining styles\\ulnone and \\ul \\ulc3 colors\\ulnone (also \\strike \\strikec4 strike-through\\strike0\\striked0 )\\\r{\\listtext\t3.\t}Multiple help tags for different parts of the text\\\r{\\listtext\t4.\t}Automatic handling of hypertext links (try {\\field{\\*\\fldinst{HYPERLINK \"http://code.google.com/p/macoslib/\"}}{\\fldrslt \\ul \\ulc5 macoslib}})\\\r\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\pardirnatural\r\\cf0 \\\r... and many more features}", Scope = Public
#tag EndConstant
#tag EndWindowCode
#tag Events RichLBL
#tag Event
Sub Open()
dim RTFdata as NSData = new NSData( RTFStringIntroStyled )
dim nsas as NSAttributedString = NSAttributedString.CreateFromRTF( RTFdata )
me.SetAttributedString new AttributedString( nsas )
End Sub
#tag EndEvent
#tag EndEvents
#tag Events LineBreakPOP
#tag Event
Sub Change()
Label3.LineBreak = me.ListIndex
End Sub
#tag EndEvent
#tag EndEvents