📄 frmmain.cs
字号:
using System;
using System.IO;
using System.Data;
using System.Drawing;
using System.Resources;
using System.Reflection;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
using Crownwood.Magic.Menus;
using Crownwood.Magic.Common;
using Crownwood.Magic.Controls;
using Crownwood.Magic.Docking;
using Crownwood.Magic.Win32;
using UtilityLibrary.Menus;
using UtilityLibrary.CommandBars;
using UtilityLibrary.WinControls;
using UtilityLibrary.General;
using UtilityLibrary.Win32;
using UtilityLibrary.Collections;
namespace MainSystem
{
/// <summary>
/// Summary description for Form1.
/// </summary>
///
public class frmMain : System.Windows.Forms.Form
{
enum TVType {TV_maps=1, TV_Layers, TV_Legend};
//常量
private const string NOFILTER = "(全部类型)";
private const string NOSUBFILTER = "(全部子类型)";
private const string FONTNAME = "楷体";
private const int FONTHEIGHT = 2500;
private const double MAX_SCALE = 4000;
private const double MIN_SCALE = 20000;
private bool _bTVChecked = true;
private MapTip _mapTip = null;
public int _nInitStatus;
//query
private string _query_szType= "";
//index
private string _index_szType= "";
private string _index_szSubType= "";
private bool _index_bTextBox = true;
private bool _bus_bTextBox = true;
//distance
private string _dist_szType= "";
private MapObjects2.MapLayer _netLayer = null;
private NetLayer _netLayer1 = null;
private ArrayList _path = null;
public AxMapObjects2.AxMap _mapEye = null;
//资源
// private ImageList _imagesToolbar = null;
private ImageList _imagesWorkspace = null;
private ImageList _imagesToolbar16 = null;
private ImageList _imagesToolbar16_2 = null;
private ImageList _imagesMaps = null;
private ImageList _imagesVisible = null;
//TreeView
private TreeView _tvMaps = null;
private TreeView _tvLayers = null;
private TreeView _tvLegend = null;
//Docking Windows for map,query and help
private DockingManager _manager = null;
WindowContent _wc = null;
//Content
Crownwood.Magic.Docking.Content _cInfoWnd = null;
Crownwood.Magic.Docking.Content _cEyeWnd = null;
Crownwood.Magic.Docking.Content _cIndexWnd = null; //index window
Crownwood.Magic.Docking.Content _cQueryWnd = null; //query window
Crownwood.Magic.Docking.Content _cHelpWnd = null; //help window
//Data
public string _strMapName;
public string _strFilter;
public CEnvironment _environment = null;
public frmInfo _frmInfo = null;
//Out
public OutlookBar _mapOutlookBar = null;
public OutlookBar _queryOutlookBar = null;
private System.Windows.Forms.ComboBox _comboBox;
private System.Windows.Forms.Panel _panelBus;
private System.Windows.Forms.Button _bus_button;
private System.Windows.Forms.ListBox _Bus_listBox;
private System.Windows.Forms.RadioButton _Bus_radioButton_Line;
private System.Windows.Forms.RadioButton _Bus_radioButton_Station;
private System.Windows.Forms.TextBox _Bus_textBox;
private System.Windows.Forms.Panel _panelDist;
private System.Windows.Forms.ComboBox _dist_comboBoxFilter2;
private System.Windows.Forms.ComboBox _dist_comboBoxFilter;
private System.Windows.Forms.Button _dist_button;
private System.Windows.Forms.RadioButton _dist_radioButton2;
private System.Windows.Forms.RadioButton _dist_radioButton1;
private System.Windows.Forms.ComboBox _dist_comboBoxPos;
private System.Windows.Forms.Label _dist_label1;
private System.Windows.Forms.TextBox _dist_txtName;
private System.Windows.Forms.Panel _panelIndex;
private System.Windows.Forms.ComboBox _index_comboBoxFilter2;
private System.Windows.Forms.ListBox _index_listBox;
private System.Windows.Forms.ComboBox _index_comboBoxFilter;
private System.Windows.Forms.TextBox _index_txtName;
private System.Windows.Forms.Label _index_label2;
private System.Windows.Forms.Label _index_label1;
private System.Windows.Forms.Panel _panelOutput;
private System.Windows.Forms.Button _output_button3;
private System.Windows.Forms.Button _output_button2;
private System.Windows.Forms.Button _output_button1;
public System.Windows.Forms.ListBox _output_listBox;
public System.Windows.Forms.Label _Output_label;
private System.Windows.Forms.Panel _panelQuery;
private System.Windows.Forms.ComboBox _query_comboBoxFilter2;
private System.Windows.Forms.Button _query_button;
private System.Windows.Forms.CheckBox _query_checkBox3;
private System.Windows.Forms.CheckBox _query_checkBox2;
private System.Windows.Forms.CheckBox _query_checkBox1;
private System.Windows.Forms.ComboBox _query_comboBoxFilter;
private System.Windows.Forms.TextBox _query_txtTel;
private System.Windows.Forms.TextBox _query_txtName;
private System.Windows.Forms.Label _query_label3;
private System.Windows.Forms.Label _query_label2;
private System.Windows.Forms.Label _query_label1;
private System.Windows.Forms.Label _dis_label_Note;
internal System.Windows.Forms.CheckBox _bus_checkBox7;
internal System.Windows.Forms.CheckBox _bus_checkBox6;
internal System.Windows.Forms.CheckBox _bus_checkBox5;
internal System.Windows.Forms.CheckBox _bus_checkBox4;
internal System.Windows.Forms.CheckBox _bus_checkBox3;
internal System.Windows.Forms.CheckBox _bus_checkBox2;
internal System.Windows.Forms.CheckBox _bus_checkBox1;
public System.Windows.Forms.Timer _timer;
private System.Windows.Forms.ToolBar _toolBar16;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;
private System.Windows.Forms.StatusBarPanel statusBarPanel4;
private System.Windows.Forms.StatusBar _statusBar;
private System.Windows.Forms.ToolBar _toolBar2;
public AxMapObjects2.AxMap _map;
public System.Windows.Forms.PictureBox _picToolTip;
public System.Windows.Forms.Label _lblToolTip;
private System.ComponentModel.IContainer components;
public frmMain()
{
InitializeComponent();
//初始化参数
_nInitStatus = 0;
//装载资源
LoadResources();
CreateToolBar16();
CreateToolBar2();
_manager = new DockingManager(this, Crownwood.Magic.Common.VisualStyle.IDE);
_manager.OuterControl = _statusBar;
Initialize();
//装载数据
LoadData();
CreateWorkspace();
_mapTip = new MapTip(this);
}
//功能:装载资源,例如:imagelist
//参数:无
//返回值:void
protected void LoadResources()
{
_imagesToolbar16 = ResourceHelper.LoadBitmapStrip(this.GetType(),
"MainSystem.Toolbar16.bmp",
new Size(16,16),
new Point(0,0));
_imagesToolbar16_2 = ResourceHelper.LoadBitmapStrip(this.GetType(),
"MainSystem.Toolbar2.bmp",
new Size(16,16),
new Point(0,0));
_imagesWorkspace = ResourceHelper.LoadBitmapStrip(this.GetType(),
"MainSystem.Workspace.bmp",
new Size(16,16),
new Point(0,0));
_imagesMaps = ResourceHelper.LoadBitmapStrip(this.GetType(),
"MainSystem.Maps.bmp",
new Size(16,16),
new Point(0,0));
_imagesVisible = ResourceHelper.LoadBitmapStrip(this.GetType(),
"MainSystem.Visible.bmp",
new Size(16,16),
new Point(0,0));
}
/// <summary>
/// 创建地名分布快捷方式工具条
/// </summary>
protected void CreateToolBar2()
{
this._toolBar2.ImageList = _imagesToolbar16_2;
ToolBarButton toolBarButton0 = new ToolBarButton();
toolBarButton0.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
ToolBarButton toolBarButton = new ToolBarButton();
toolBarButton.ImageIndex = 14;
toolBarButton.ToolTipText = "所有地名";
toolBarButton.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton.Pushed = true;
ToolBarButton toolBarButton1 = new ToolBarButton();
toolBarButton1.ImageIndex = 0;
toolBarButton1.ToolTipText = "购物分布";
toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton1.Pushed = true;
ToolBarButton toolBarButton2 = new ToolBarButton();
toolBarButton2.ImageIndex = 1;
toolBarButton2.ToolTipText = "旅游点分布";
toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton2.Pushed = true;
ToolBarButton toolBarButton3 = new ToolBarButton();
toolBarButton3.ImageIndex = 2;
toolBarButton3.ToolTipText = "学校分布";
toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton3.Pushed = true;
ToolBarButton toolBarButton4 = new ToolBarButton();
toolBarButton4.ImageIndex = 3;
toolBarButton4.ToolTipText = "医院分布";
toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton4.Pushed = true;
ToolBarButton toolBarButton5 = new ToolBarButton();
toolBarButton5.ImageIndex = 4;
toolBarButton5.ToolTipText = "宾馆分布";
toolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton5.Pushed = true;
ToolBarButton toolBarButton6 = new ToolBarButton();
toolBarButton6.ImageIndex = 5;
toolBarButton6.ToolTipText = "银行分布";
toolBarButton6.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton6.Pushed = true;
ToolBarButton toolBarButton7 = new ToolBarButton();
toolBarButton7.ImageIndex = 6;
toolBarButton7.ToolTipText = "加油站分布";
toolBarButton7.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton7.Pushed = true;
ToolBarButton toolBarButton8 = new ToolBarButton();
toolBarButton8.ImageIndex = 7;
toolBarButton8.ToolTipText = "电影音乐厅分布";
toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton8.Pushed = true;
ToolBarButton toolBarButton9 = new ToolBarButton();
toolBarButton9.ImageIndex = 8;
toolBarButton9.ToolTipText = "餐馆分布";
toolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton9.Pushed = true;
ToolBarButton toolBarButton10 = new ToolBarButton();
toolBarButton10.ImageIndex = 9;
toolBarButton10.ToolTipText = "WC分布";
toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton10.Pushed = true;
ToolBarButton toolBarButton11 = new ToolBarButton();
toolBarButton11.ImageIndex = 10;
toolBarButton11.ToolTipText = "邮局分布";
toolBarButton11.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton11.Pushed = true;
ToolBarButton toolBarButton12 = new ToolBarButton();
toolBarButton12.ImageIndex = 11;
toolBarButton12.ToolTipText = "图书馆分布";
toolBarButton12.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton12.Pushed = true;
ToolBarButton toolBarButton13 = new ToolBarButton();
toolBarButton13.ImageIndex = 12;
toolBarButton13.ToolTipText = "车站";
toolBarButton13.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
toolBarButton13.Pushed = true;
this._toolBar2.Buttons.Add(toolBarButton0);
this._toolBar2.Buttons.Add(toolBarButton0);
this._toolBar2.Buttons.Add(toolBarButton);
this._toolBar2.Buttons.Add(toolBarButton1);
this._toolBar2.Buttons.Add(toolBarButton2);
this._toolBar2.Buttons.Add(toolBarButton3);
this._toolBar2.Buttons.Add(toolBarButton4);
this._toolBar2.Buttons.Add(toolBarButton5);
this._toolBar2.Buttons.Add(toolBarButton6);
this._toolBar2.Buttons.Add(toolBarButton7);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -