|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using ComponentFactory.Krypton.Docking;
|
|
|
|
|
|
using ComponentFactory.Krypton.Navigator;
|
|
|
|
|
|
using ComponentFactory.Krypton.Workspace;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigmaViewer
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class FormTestMDI : Form
|
|
|
|
|
|
{
|
|
|
|
|
|
int nViewCount = 0;
|
|
|
|
|
|
Viewer viewerCur;
|
|
|
|
|
|
public FormTestMDI()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void FormTestMDI_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonDockingWorkspace w = kryptonDockingManager.ManageWorkspace(kryptonDockableWorkspace);
|
|
|
|
|
|
kryptonDockingManager.ManageControl(kryptonPanel1, w);
|
|
|
|
|
|
kryptonDockingManager.ManageFloating(this);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
OpenFileDialog ofd = new OpenFileDialog();
|
|
|
|
|
|
if (ofd.ShowDialog()!=DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
OpenFile(ofd.FileName);
|
|
|
|
|
|
|
|
|
|
|
|
//OpenFile("c:\\temp\\钻探目标分布图.dfd");
|
|
|
|
|
|
}
|
|
|
|
|
|
private void OpenFile(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
Viewer viewer = new Viewer();
|
|
|
|
|
|
if (viewer.OpenFile(fileName)==false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
// Get access to current active cell or create new cell if none are present
|
|
|
|
|
|
KryptonWorkspaceCell cell = kryptonDockableWorkspace.ActiveCell;
|
|
|
|
|
|
if (cell==null)
|
|
|
|
|
|
{
|
|
|
|
|
|
cell=new KryptonWorkspaceCell();
|
|
|
|
|
|
kryptonDockableWorkspace.Root.Children.Add(cell);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//viewer.Load+=Viewer_Load;
|
|
|
|
|
|
KryptonPage pageView = new KryptonPage();
|
|
|
|
|
|
pageView.Text="图形 "+(nViewCount+1);
|
|
|
|
|
|
pageView.TextTitle=pageView.Text;
|
|
|
|
|
|
pageView.TextDescription=pageView.Text;
|
|
|
|
|
|
pageView.UniqueName=viewer.ID+"";
|
|
|
|
|
|
// Add the control for display inside the page
|
|
|
|
|
|
viewer.Dock=DockStyle.Fill;
|
|
|
|
|
|
pageView.Controls.Add(viewer);
|
|
|
|
|
|
nViewCount++;
|
|
|
|
|
|
//viewers.Add(viewerCur);
|
|
|
|
|
|
viewerCur=viewer;
|
|
|
|
|
|
// Add docking pages
|
|
|
|
|
|
//kryptonDockingManager.AddToWorkspace("Workspace", new KryptonPage[] { pageView });
|
|
|
|
|
|
cell.Pages.Add(pageView);
|
|
|
|
|
|
cell.SelectedPage=pageView;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//private void Viewer_Load(object sender, EventArgs e)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// viewerCur.Redraw();
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|