コード例 #1
0
ファイル: WorldWind.cs プロジェクト: jpespartero/WorldWind
		/// <summary>
		/// Handles key up events.
		/// </summary>
		/// <param name="e"></param>
		/// <returns>Returns true if the key is handled.</returns>
		protected bool HandleKeyUp(KeyEventArgs e)
		{
			// keep keypresses inside browser url bar
			if(e.Handled)
				return true;

			if (e.Alt)
			{
				// Alt key down
				switch(e.KeyCode)
				{
					case Keys.A:
						menuItemAlwaysOnTop_Click(this,e);
						return true;
					case Keys.Q:
						using( PropertyBrowserForm worldWindSettings = new PropertyBrowserForm( Settings, "World Wind Settings" ) )
						{
							worldWindSettings.Icon = this.Icon;
							worldWindSettings.ShowDialog();
						}
						return true;
					case Keys.W:
						menuItemOptions_Click(this, EventArgs.Empty);
						return true;
					case Keys.Enter:
						this.FullScreen = !this.FullScreen;
						return true;
					case Keys.F4:
						Close();
						return true;
				}
			}
			else if (e.Control)
			{
				// Control key down
				switch(e.KeyCode)
				{
					case Keys.C:
					case Keys.Insert:
						menuItemCoordsToClipboard_Click(this, e);
						return true;
					case Keys.F:
						return true;
					case Keys.H:
						if (progressMonitor != null)
						{
							bool wasVisible = progressMonitor.Visible;
							progressMonitor.Close();
							progressMonitor.Dispose();
							progressMonitor = null;
							if (wasVisible)
								return true;
						}

						progressMonitor = new ProgressMonitor();
						progressMonitor.Icon = this.Icon;
						progressMonitor.Show();
						return true;
					case Keys.I:
						menuItemConfigWizard_Click(this,e);
						return true;
					case Keys.N:
						menuItemOptions_Click(this,e);
						return true;
					case Keys.T:
						menuItemShowToolbar_Click(this,e);
						return true;
					case Keys.V:
						menuItemEditPaste_Click(this,e);
						return true;
					case Keys.S:
						menuItemSaveScreenShot_Click(this, e);
						return true;
				}
			}
			else if (e.Shift)
			{
				// Shift key down
				switch(e.KeyCode)
				{
					case Keys.Insert:
						menuItemEditPaste_Click(this,e);
						return true;
					case Keys.S:
						menuItemSunShading_Click(this, e);
						return true;
					case Keys.A:
						menuItemAtmosphericScattering_Click(this, e);
						return true;
				}
			}
			else
			{
				// Other or no modifier key
				switch(e.KeyCode)
				{
					//case Keys.B:
					//	menuItemWMS_Click(this, e);
					//	return true;
					case Keys.G:
						return true;
					case Keys.L:
						menuItemLayerManager_Click(this, e);
						return true;
					case Keys.P:
						if(this.pathMaker == null)
						{
							this.pathMaker = new PathMaker(this.worldWindow);
							this.pathMaker.Icon = this.Icon;
						}
						this.pathMaker.Visible = !this.pathMaker.Visible;
						return true;
					case Keys.V:
						if(this.placeBuilderDialog == null)
						{
							this.placeBuilderDialog = new PlaceBuilder( this.worldWindow );
							this.placeBuilderDialog.Icon = this.Icon;
						}

						this.placeBuilderDialog.Visible = !this.placeBuilderDialog.Visible;
						return true;
					case Keys.Escape:
						if (this.FullScreen)
						{
							this.FullScreen = false;
							return true;
						}
						break;
					case Keys.D1:
					case Keys.NumPad1:
						this.VerticalExaggeration = 1.0f;
						return true;
					case Keys.D2:
					case Keys.NumPad2:
						this.VerticalExaggeration = 2.0f;
						return true;
					case Keys.D3:
					case Keys.NumPad3:
						this.VerticalExaggeration = 3.0f;
						return true;
					case Keys.D4:
					case Keys.NumPad4:
						this.VerticalExaggeration = 4.0f;
						return true;
					case Keys.D5:
					case Keys.NumPad5:
						this.VerticalExaggeration = 5.0f;
						return true;
					case Keys.D6:
					case Keys.NumPad6:
						this.VerticalExaggeration = 6.0f;
						return true;
					case Keys.D7:
					case Keys.NumPad7:
						this.VerticalExaggeration = 7.0f;
						return true;
					case Keys.D8:
					case Keys.NumPad8:
						this.VerticalExaggeration = 8.0f;
						return true;
					case Keys.D9:
					case Keys.NumPad9:
						this.VerticalExaggeration = 9.0f;
						return true;
					case Keys.D0:
					case Keys.NumPad0:
						this.VerticalExaggeration = 0.0f;
						return true;
					case Keys.F1:
						this.menuItemAnimatedEarth_Click(this,e);
						return true;
					case Keys.F2:
						this.menuItemModisHotSpots_Click(this,e);
						return true;
					case Keys.F5:
						this.menuItemRefreshCurrentView_Click(this,e);
						return true;
					case Keys.F6:
						return true;
					case Keys.F7:
						this.menuItemShowLatLonLines_Click(this,e);
						return true;
					case Keys.F8:
						this.menuItemPlanetAxis_Click(this,e);
						return true;
					case Keys.F9:
						this.menuItemShowCrosshairs_Click(this,e);
						return true;
					case Keys.F10:
						this.menuItemShowPosition_Click(this,e);
						return true;
					case Keys.F11:
						this.menuItemConstantMotion_Click(this,e);
						return true;
					case Keys.F12:
						this.menuItemPointGoTo_Click(this,e);
						return true;
				}
			}
			return false;
		}
コード例 #2
0
ファイル: WorldWind.cs プロジェクト: jpespartero/WorldWind
		/// <summary>
		/// Display Options dialog
		/// </summary>
		private void menuItemOptions_Click(object sender, System.EventArgs e)
		{
			using( PropertyBrowserForm worldSettings = new PropertyBrowserForm( World.Settings, "World Settings" ) )
			{
				worldSettings.Icon = this.Icon;
				worldSettings.ShowDialog();
			}
		}