Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
8323a365
Commit
8323a365
authored
Nov 14, 2013
by
joreg
Browse files
added OnChange
parent
7fb9941a
Changes
1
Show whitespace changes
Inline
Side-by-side
Source/SvgElement.cs
View file @
8323a365
...
...
@@ -679,6 +679,8 @@ namespace Svg
newObj
.
MouseScroll
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"Click"
)
newObj
.
Click
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"Change"
)
newObj
.
Change
+=
delegate
{
};
}
}
...
...
@@ -739,6 +741,7 @@ namespace Svg
caller
.
RegisterAction
<
float
>(
rpcID
+
"onmousescroll"
,
OnMouseScroll
);
caller
.
RegisterAction
(
rpcID
+
"onmouseover"
,
OnMouseOver
);
caller
.
RegisterAction
(
rpcID
+
"onmouseout"
,
OnMouseOut
);
caller
.
RegisterAction
<
string
>(
rpcID
+
"onchange"
,
OnChange
);
}
}
...
...
@@ -759,6 +762,7 @@ namespace Svg
caller
.
UnregisterAction
(
rpcID
+
"onmousescroll"
);
caller
.
UnregisterAction
(
rpcID
+
"onmouseover"
);
caller
.
UnregisterAction
(
rpcID
+
"onmouseout"
);
caller
.
UnregisterAction
(
rpcID
+
"onchange"
);
}
}
...
...
@@ -783,6 +787,9 @@ namespace Svg
[
SvgAttribute
(
"onmouseout"
)]
public
event
EventHandler
MouseOut
;
[
SvgAttribute
(
"onchange"
)]
public
event
EventHandler
<
StringArg
>
Change
;
//click
protected
void
OnClick
(
float
x
,
float
y
,
int
button
,
int
clickCount
)
{
...
...
@@ -888,6 +895,21 @@ namespace Svg
}
}
//change
protected
void
OnChange
(
string
newString
)
{
RaiseChange
(
this
,
new
StringArg
{
s
=
newString
});
}
protected
void
RaiseChange
(
object
sender
,
StringArg
s
)
{
var
handler
=
Change
;
if
(
handler
!=
null
)
{
handler
(
sender
,
s
);
}
}
#
endregion
graphical
EVENTS
}
...
...
@@ -937,6 +959,14 @@ namespace Svg
public
float
y
;
}
/// <summary>
/// Represents a string argument
/// </summary>
public
class
StringArg
:
EventArgs
{
public
string
s
;
}
internal
interface
ISvgElement
{
SvgElement
Parent
{
get
;}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment