2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciControls
12 public partial class DaeHost : UserControl
31 Seci.Standard.Dae.ShowDae();
32 Seci.Standard.Dae.SetTitleBarVisibility(
false);
35 System.Threading.Thread.Sleep(2000);
37 _filename = Seci.Definitions.Status.LabViewDir + Seci.Definitions.Status.DaeFile;
39 WinApi.SetParent(
_viHandle, this.panel1.Handle);
42 int[] bounds = Seci.Managers.LabViewMgr.GetPanelBounds(
_filename);
43 MaximumSize =
new Size(bounds[2] - bounds[0], bounds[3] - bounds[1]);
49 Seci.Standard.Dae.ShowDae();
54 panel1.HorizontalScroll.Value = 0;
55 panel1.VerticalScroll.Value = 0;
56 if (!Seci.Managers.LabViewMgr.IsVIHidden(
_filename))
65 string viTitle = Seci.Managers.LabViewMgr.GetFrontPanelTitle(viName);
66 IntPtr viHandle = IntPtr.Zero;
67 StringBuilder title =
new StringBuilder(50);
69 for (
int i = 0; i < WinApi.EnumReport.Handles.Count; i++)
71 title =
new StringBuilder(50);
72 WinApi.GetWindowText(WinApi.EnumReport.Handles[i], title, 50);
73 if (title.ToString().StartsWith(viTitle))
75 string answer = title.ToString();
76 viHandle =
new IntPtr(
WinApi.EnumReport.Handles[i]);
92 Seci.Managers.LabViewMgr.MinimiseVI(filename);
93 Seci.Managers.LabViewMgr.RestoreVI(filename);
98 Seci.Managers.LabViewMgr.RestoreVI(filename);
99 Seci.Managers.LabViewMgr.SetFrontPanelBounds(filename,
new int[] { x, y });
108 if (Seci.Managers.LabViewMgr.DoesVIExist(
_filename) && !Seci.Managers.LabViewMgr.IsVIHidden(
_filename))
110 int[] limits = Seci.Managers.LabViewMgr.GetPanelBounds(
_filename);
111 if (limits[2] > Xmax)
115 if (limits[3] > Ymax)
143 if (Seci.Managers.LabViewMgr.DoesVIExist(
_filename))
145 StringBuilder title =
new StringBuilder(50);
146 WinApi.GetWindowText(_viHandle.ToInt32(), title, 50);
147 if (title.ToString().Trim() !=
_winTitle)
150 WinApi.SetParent(
_viHandle, this.panel1.Handle);
153 int[] bounds = Seci.Managers.LabViewMgr.GetPanelBounds(
_filename);
154 MaximumSize =
new Size(bounds[2] - bounds[0], bounds[3] - bounds[1]);
155 base.Size = MaximumSize;
void repaintVi(string filename)
void bringViToFront(string filename)
void repositionVi(string filename, int x, int y)
void findViHandle(string viName)
void timer1_Tick(object sender, EventArgs e)
void InitializeComponent()
Required method for Designer support - do not modify the contents of this method with the code editor...