リビジョン | ef6c93571e30d33920b2127b6b1972f73f3eabce (tree) |
---|---|
日時 | 2019-08-26 21:18:11 |
作者 | yyagi <yyagi.dtxmania@gmai...> |
コミッター | yyagi |
#39511 ウインドウの中をドラッグしてもウインドウを移動できるようにした。
@@ -638,6 +638,7 @@ namespace DTXMania | ||
638 | 638 | base.Window.Icon = Properties.Resources.dtx; |
639 | 639 | base.Window.KeyDown += new KeyEventHandler(this.Window_KeyDown); |
640 | 640 | base.Window.MouseUp += new MouseEventHandler(this.Window_MouseUp); |
641 | + base.Window.MouseDown += new MouseEventHandler(this.Window_MouseDown); | |
641 | 642 | // #23510 2010.11.13 yyagi: to go fullscreen mode |
642 | 643 | base.Window.MouseDoubleClick += new MouseEventHandler(this.Window_MouseDoubleClick); |
643 | 644 | // #23510 2010.11.20 yyagi: to set resized window size in Config.ini |
@@ -3058,6 +3059,11 @@ namespace DTXMania | ||
3058 | 3059 | { |
3059 | 3060 | mb = e.Button; |
3060 | 3061 | } |
3062 | + private void Window_MouseDown(object sender, MouseEventArgs e) | |
3063 | + { | |
3064 | + currentMousePosition.X = Control.MousePosition.X; | |
3065 | + currentMousePosition.Y = Control.MousePosition.Y; | |
3066 | + } | |
3061 | 3067 | |
3062 | 3068 | private void Window_MouseDoubleClick(object sender, MouseEventArgs e) // #23510 2010.11.13 yyagi: to go full screen mode |
3063 | 3069 | { |
@@ -3067,11 +3073,23 @@ namespace DTXMania | ||
3067 | 3073 | this.t全画面_ウィンドウモード切り替え(); |
3068 | 3074 | } |
3069 | 3075 | } |
3076 | + private Point currentMousePosition = new Point(-1,-1); | |
3070 | 3077 | private void Window_MouseMove(object sender, MouseEventArgs e) |
3071 | 3078 | { |
3072 | 3079 | if (cMouseHideControl != null) cMouseHideControl.tResetCursorState(ConfigIni.bウィンドウモード, this.bApplicationActive); |
3073 | - } | |
3080 | + if (Control.MouseButtons.HasFlag(MouseButtons.Left)) | |
3081 | + { | |
3082 | + int X = base.Window.Location.X; | |
3083 | + X += (Control.MousePosition.X - currentMousePosition.X); | |
3084 | + int Y = base.Window.Location.Y; | |
3085 | + Y += (Control.MousePosition.Y - currentMousePosition.Y); | |
3074 | 3086 | |
3087 | + base.Window.Location = new Point(X, Y); | |
3088 | + | |
3089 | + currentMousePosition.X = Control.MousePosition.X; | |
3090 | + currentMousePosition.Y = Control.MousePosition.Y; | |
3091 | + } | |
3092 | + } | |
3075 | 3093 | private void Window_ResizeEnd(object sender, EventArgs e) // #23510 2010.11.20 yyagi: to get resized window size |
3076 | 3094 | { |
3077 | 3095 | if (ConfigIni.bウィンドウモード) |