📄 placeform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WorldWindow;
namespace cfWorldWind
{
public partial class PlaceForm : Form
{
public PlaceForm()
{
InitializeComponent();
}
private Placename _placename;
private Camera _camera;
public void Init(Camera camera, Placename placename)
{
this._camera = camera;
this._placename = placename;
}
private void PlaceForm_Load(object sender, EventArgs e)
{
//TODO popup the SIP
}
private void btnSearch_Click(object sender, EventArgs e)
{
lbPlaces.Items.Clear();
lbPlaces.ValueMember = "Name";
string name = txtSearch.Text.Trim();
Placename.Place [] pa = _placename.FindPlace(name);
if (pa.Length > 0)
{
foreach (Placename.Place p in pa)
{
lbPlaces.Items.Add(p);
}
}
else
{
MessageBox.Show("place not found");
}
}
private void lbPlaces_SelectedIndexChanged(object sender, EventArgs e)
{
Placename.Place p = (Placename.Place) lbPlaces.SelectedItem;
numLat.Value = (decimal)(p.lat - 90f);
numLon.Value = (decimal)(p.lon - 180f);
btnGo_Click(null, null);
}
private void btnGo_Click(object sender, EventArgs e)
{
float lat = (float)numLat.Value;
float lon = (float)numLon.Value;
_camera.PointGoto(lat, lon);
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
//TODO close the SIP
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -