forked from cyotek/HTML-Renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path14.HtmlContainer.htm
More file actions
195 lines (195 loc) · 9.56 KB
/
Copy path14.HtmlContainer.htm
File metadata and controls
195 lines (195 loc) · 9.56 KB
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
<html>
<head>
<title>HtmlContainer</title>
<link rel="Stylesheet" href="StyleSheet" />
</head>
<body>
<h1>
HtmlContainer Class
</h1>
<code>HtmlRenderer.HtmlContainer</code>
<blockquote>
<p>
Low level handling of Html Renderer logic, this class is used by <span style="color: blue">
HtmlPanel</span>, <span style="color: blue">HtmlLabel</span>, <span style="color: blue">
HtmlToolTip</span> and <span style="color: blue">HtmlRender</span>.<br />
The class allows html layout and rendering without association to actual winforms
control, thouse allowing to handle html rendering on any graphics object.<br />
Using this class will require the client to handle all propogation of mouse\keyboard
events, layout/paint calls, scrolling offset and location/size/rectangle handling
and UI refresh requests.
<h2>
Properties
</h2>
<ul>
<li>
<img src="PropertyIcon" />
<b>CssData</b> - <span class="comment2">the parsed stylesheet data used for handling
the html.</span> </li>
<li>
<img src="PropertyIcon" />
<b>AvoidGeometryAntialias</b> - <span class="comment2">Gets or sets a value indicating
if antialiasing should be avoided for geometry like backgrounds and borders (default
- false).</span> </li>
<li>
<img src="PropertyIcon" />
<b>IsSelectionEnabled</b> - <span class="comment2">Is content selection is enabled for
the rendered html (default - true).</span> </li>
<li>
<img src="PropertyIcon" />
<b>IsContextMenuEnabled</b> - <span class="comment2">Is the build-in context menu enabled
and will be shown on mouse right click (default - true).</span> </li>
<li>
<img src="PropertyIcon" />
<b>ScrollOffset</b> - <span class="comment2">The scroll offset of the html.</span>
</li>
<li>
<img src="PropertyIcon" />
<b>Location</b> - <span class="comment2">the top-left most location of the rendered
html.</span> </li>
<li>
<img src="PropertyIcon" />
<b>MaxSize</b> - <span class="comment2">the max width and height of the rendered html,
effects layout, actual size cannot exceed this values. Set zero for unlimited.</span>
</li>
<li>
<img src="PropertyIcon" />
<b>ActualSize</b> - <span class="comment2">The actual size of the rendered html (after
layout).</span> </li>
</ul>
<h2>
Methods
</h2>
<ul>
<li>
<img src="MethodIcon" />
<b>GetHtml(HtmlGenerationStyle styleGen = HtmlGenerationStyle.Inline)</b> - <span
class="comment2">Get html from the current DOM tree with style if requested.</span>
</li>
<li>
<img src="MethodIcon" />
<b>PerformLayout(Graphics)</b> - <span class="comment2">Measures the bounds of box and
children, recursively.</span> </li>
<li>
<img src="MethodIcon" />
<b>PerformPaint(Graphics)</b> - <span class="comment2">Render the html using the given
device.</span> </li>
<li>
<img src="MethodIcon" />
<b>HandleMouseDown(Control, MouseEventArgs)</b> - <span class="comment2">Handle mouse
down to handle selection.</span> </li>
<li>
<img src="MethodIcon" />
<b>HandleMouseUp(Control, MouseEventArgs)</b> - <span class="comment2">Handle mouse
up to handle selection and link click.</span> </li>
<li>
<img src="MethodIcon" />
<b>HandleMouseDoubleClick(Control, MouseEventArgs)</b> - <span class="comment2">Handle
mouse double click to select word under the mouse.</span> </li>
<li>
<img src="MethodIcon" />
<b>HandleMouseMove(Control, MouseEventArgs)</b> - <span class="comment2">Handle mouse
move to handle hover cursor and text selection.</span> </li>
<li>
<img src="MethodIcon" />
<b>HandleMouseLeave(Control, MouseEventArgs)</b> - <span class="comment2">Handle mouse
move to handle hover cursor.</span> </li>
<li>
<img src="MethodIcon" />
<b>HandleKeyDown(parent, KeyEventArgs)</b> - <span class="comment2">Handle key down
event for selection and copy.</span> </li>
</ul>
<h2>
Events
</h2>
<ul>
<li>
<img src="EventIcon" />
<b>LinkClicked</b> - <span class="comment2">Raised when the user clicks on a link in
the html, Allows canceling the execution of the link.</span> </li>
<li>
<img src="EventIcon" />
<b>Refresh</b> - <span class="comment2">Raised when html renderer requires refresh of
the control hosting (invalidation and re-layout).</span> </li>
<li>
<img src="EventIcon" />
<b>RenderError</b> - <span class="comment2">Raised when an error occured during html
rendering.</span> </li>
<li>
<img src="EventIcon" />
<b>StylesheetLoad</b> - <span class="comment2">Raised when aa stylesheet is about to
be loaded by file path or URI by link element. This event allows to provide the
stylesheet manually or provide new source (file or uri) to load from.</span>
</li>
<li>
<img src="EventIcon" />
<b>ImageLoad</b> - <span class="comment2">Raised when an image is about to be loaded
by file path or URI. This event allows to provide the image manually, if not handled
the image will be loaded from file or download from URI.</span> </li>
</ul>
<h1>
Remarks
</h1>
<p>
<h3>
MaxSize and ActualSize
</h3>
The max width and height of the rendered html.<br />
The max width will effect the html layout wrapping lines, resize images and tables
where possible.<br />
The max height does NOT effect layout, but will not render outside it (clip).<br />
<span style="color: blue">ActualSize</span> can be exceed the max size by layout
restrictions (unwrappable line, set image size, etc.).<br />
Set zero for unlimited (width\height separately).<br />
</p>
<p>
<h3>
ScrollOffset
</h3>
This will adjust the rendered html by the given offset so the content will be "scrolled".<br />
Element that is rendered at location (50,100) with offset of (0,200) will not be
rendered as it will be at -100 therefore outside the client rectangle of the control.
</p>
<p>
<h3>
LinkClicked event
</h3>
Raised when the user clicks on a link in the html.<br />
Allows canceling the execution of the link.
</p>
<p>
<h3>
StylesheetLoad event
</h3>
Raised when aa stylesheet is about to be loaded by file path or URI by link element.<br />
This event allows to provide the stylesheet manually or provide new source (file
or uri) to load from.<br />
If no alternative data is provided the original source will be used.<br />
</p>
<p>
<h3>
ImageLoad event
</h3>
Raised when an image is about to be loaded by file path or URI.<br />
This event allows to provide the image manually, if not handled the image will be
loaded from file or download from URI.
</p>
<p>
<h3>
Refresh event
</h3>
Raised when html renderer requires refresh of the control hosting (invalidation
and re-layout).<br />
There is no garantie that the event will be raised on the main thread, it can be
raised on threadpool thread.
</p>
<p>
<h3>
RenderError event
</h3>
Raised when an error occured during html rendering.<br />
</p>
</p>
</blockquote>
</body>
</html>