git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1106 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -122,5 +122,47 @@ namespace ShpViewer
|
||||
}
|
||||
return new TileSet(TileMix, TileSuffix, pal);
|
||||
}
|
||||
|
||||
int ux,uy, vx, vy;
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseDown(e);
|
||||
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
ux = e.X;
|
||||
uy = e.Y;
|
||||
|
||||
vx = XScroll;
|
||||
vy = YScroll;
|
||||
|
||||
Cursor = Cursors.NoMove2D;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseMove(e);
|
||||
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
int dx = ux - e.X;
|
||||
int dy = uy - e.Y;
|
||||
|
||||
XScroll = vx + dx / 24;
|
||||
YScroll = vy + dy / 24;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseUp(e);
|
||||
|
||||
Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,44 +59,10 @@ namespace ShpViewer
|
||||
Map map = new Map( iniFile );
|
||||
|
||||
flowLayoutPanel1.Visible = false;
|
||||
flowLayoutPanel1.BackColor = Color.Blue;
|
||||
mapViewControl1.Visible = true;
|
||||
mapViewControl1.Map = map;
|
||||
mapViewControl1.Invalidate();
|
||||
|
||||
int ux = 0, uy = 0;
|
||||
int vx = 0, vy = 0;
|
||||
|
||||
mapViewControl1.MouseDown += delegate(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
ux = e.X;
|
||||
uy = e.Y;
|
||||
|
||||
vx = mapViewControl1.XScroll;
|
||||
vy = mapViewControl1.YScroll;
|
||||
|
||||
mapViewControl1.Cursor = Cursors.NoMove2D;
|
||||
}
|
||||
};
|
||||
|
||||
mapViewControl1.MouseMove += delegate(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
int dx = ux - e.X;
|
||||
int dy = uy - e.Y;
|
||||
|
||||
mapViewControl1.XScroll = vx + dx / 24;
|
||||
mapViewControl1.YScroll = vy + dy / 24;
|
||||
|
||||
mapViewControl1.Invalidate();
|
||||
}
|
||||
};
|
||||
|
||||
mapViewControl1.MouseUp += delegate { mapViewControl1.Cursor = Cursors.Default; };
|
||||
|
||||
mapViewControl1.MouseClick += delegate( object sender, MouseEventArgs e )
|
||||
{
|
||||
if( e.Button == MouseButtons.Left )
|
||||
|
||||
Reference in New Issue
Block a user