public RoomEditor()
{
TileWidth = 16;
TileHeight = 16;
this.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args)
{
if (client == null)
{
return;
}
int x, y;
Gdk.ModifierType state;
args.Event.Window.GetPointer(out x, out y, out state);
UpdateMouse(x, y);
if (IsInBounds(x, y))
{
if (state.HasFlag(Gdk.ModifierType.Button1Mask))
{
OnClicked(x, y);
}
else if (state.HasFlag(Gdk.ModifierType.Button3Mask))
{
client.SelectedIndex = room.GetTile(x / TileWidth, y / TileWidth);
}
}
};
this.ButtonReleaseEvent += delegate(object o, ButtonReleaseEventArgs args) {
int x, y;
Gdk.ModifierType state;
args.Event.Window.GetPointer(out x, out y, out state);
if (!state.HasFlag(Gdk.ModifierType.Button1Mask))
{
draggingObject = false;
}
};
this.MotionNotifyEvent += delegate(object o, MotionNotifyEventArgs args) {
if (client == null)
{
return;
}
int x, y;
Gdk.ModifierType state;
args.Event.Window.GetPointer(out x, out y, out state);
UpdateMouse(x, y);
if (IsInBounds(x, y))
{
if (state.HasFlag(Gdk.ModifierType.Button1Mask))
{
OnDragged(x, y);
}
}
};
}