Classes | |
class | TitleHandleTuple |
Public Member Functions | |
void | AddVI (String filename, int x, int y) |
This method captures the VI and inserts it into the MDI using the WinAPI. More... | |
void | CascadeVis () |
void | RemoveAllVIs () |
void | RemoveVI (String filename) |
void | SetVisible (Boolean visible) |
void | StartTimer (int interval) |
ViHost () | |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Clean up any resources being used. More... | |
Properties | |
List< string > | ViNames [get] |
Private Member Functions | |
void | _worker_DoWork (object sender, DoWorkEventArgs e) |
void | _worker_RunWorkerCompleted (object sender, RunWorkerCompletedEventArgs e) |
void | bringViToFront (String filename) |
void | cascadeVIsToolStripMenuItem_Click (object sender, EventArgs e) |
void | getVIPosition (string vi, out WinApi.Rect viRect, out int x, out int y) |
void | InitializeComponent () |
Required method for Designer support - do not modify the contents of this method with the code editor. More... | |
void | moveVisToConfigPositions () |
When the configuration is loaded it is necessary to move the VIs to the positions saved in the configuration. This is only called the first time the tab is selected. More... | |
void | positionVi (String filename, int x, int y) |
void | repaintVi (String filename) |
void | timer1_Tick (object sender, EventArgs e) |
This method is called when the timer object "ticks." More... | |
delegate void | UpdateGuiDelegate () |
void | updateHandles () |
Unfortunately when a VI is started or stopped its window handle changes, so we have to update the stored handle when this happens and recapture the window. This is called every time the timer ticks. More... | |
void | work () |
Static Private Member Functions | |
static TitleHandleTuple | findViHandle (String viName) |
static TitleHandleTuple | getHandle (String windowTitle) |
Get the window handle of the VI based on the window's title. More... | |
Private Attributes | |
Dictionary< string, string > | _formNames = new Dictionary<string, string>() |
Boolean | _isFirstTime = true |
Dictionary< string, TitleHandleTuple > | _viNames = new Dictionary<string, TitleHandleTuple>() |
Boolean | _visible = false |
BackgroundWorker | _worker = new BackgroundWorker() |
System.Windows.Forms.ToolStripMenuItem | cascadeVIsToolStripMenuItem |
System.ComponentModel.IContainer | components = null |
Required designer variable. More... | |
System.Windows.Forms.ContextMenuStrip | contextMenuStrip1 |
System.Windows.Forms.Panel | panel1 |
System.Windows.Forms.Panel | sizeMarker |
System.Windows.Forms.Timer | timer1 |
This control host LabVIEW VIs, Because the VIs are added via the winapi they are effectively ignored by the panel when it calculates whether it needs to show the scrollbars. As a result, there is a small invisible panel that is aligned with the maximum x and y positions of the VIs. This means that if the position of the bottom right-hand corner of a VI exceed the size of the control then scrollbars are added correctly. The member _sensiblePt is used to calculate the correct position of the invisible panel. VIs have different handles when they are running compared to when they are not running; as a result, it is necessary to update the handles every time the timer ticks.
|
inline |
Definition at line 34 of file ViHost.cs.
References SeciControls.ViHost._worker_DoWork(), SeciControls.ViHost._worker_RunWorkerCompleted(), and SeciControls.ViHost.InitializeComponent().
|
inlineprivate |
Definition at line 291 of file ViHost.cs.
References SeciControls.ViHost.UpdateGuiDelegate(), and SeciControls.ViHost.work().
Referenced by SeciControls.ViHost.ViHost().
|
inlineprivate |
Definition at line 301 of file ViHost.cs.
Referenced by SeciControls.ViHost.ViHost().
|
inline |
This method captures the VI and inserts it into the MDI using the WinAPI.
filename | The full filepath for the VI |
x | The x co-ordinate of the top-left corner of the VI |
y | The y co-ordinate of the top-left corner of the VI |
Definition at line 47 of file ViHost.cs.
References SeciControls.ViHost._viNames, SeciControls.ViHost.findViHandle(), SeciControls.ViHost.positionVi(), and SeciControls.ViHost.repaintVi().
|
inlineprivate |
Definition at line 156 of file ViHost.cs.
Referenced by SeciControls.ViHost.CascadeVis().
|
inline |
Definition at line 161 of file ViHost.cs.
References SeciControls.ViHost.bringViToFront(), SeciControls.ViHost.positionVi(), and SeciControls.ViHost.ViNames.
Referenced by SeciControls.ViHost.cascadeVIsToolStripMenuItem_Click().
|
inlineprivate |
Definition at line 180 of file ViHost.cs.
References SeciControls.ViHost.CascadeVis().
|
inlineprotected |
Clean up any resources being used.
disposing | true if managed resources should be disposed; otherwise, false. |
Definition at line 14 of file ViHost.designer.cs.
References SeciControls.ViHost.components.
|
inlinestaticprivate |
Definition at line 107 of file ViHost.cs.
References SeciControls.ViHost.getHandle().
Referenced by SeciControls.ViHost.AddVI(), and SeciControls.ViHost.updateHandles().
|
inlinestaticprivate |
Get the window handle of the VI based on the window's title.
windowTitle | The title of the required window |
Definition at line 119 of file ViHost.cs.
Referenced by SeciControls.ViHost.findViHandle().
|
inlineprivate |
Definition at line 364 of file ViHost.cs.
References SeciControls.ViHost._viNames.
Referenced by SeciControls.ViHost.moveVisToConfigPositions(), and SeciControls.ViHost.work().
|
inlineprivate |
Required method for Designer support - do not modify the contents of this method with the code editor.
Definition at line 29 of file ViHost.designer.cs.
Referenced by SeciControls.ViHost.ViHost().
|
inlineprivate |
When the configuration is loaded it is necessary to move the VIs to the positions saved in the configuration. This is only called the first time the tab is selected.
Definition at line 189 of file ViHost.cs.
References SeciControls.ViHost.getVIPosition(), SeciControls.ViHost.positionVi(), and SeciControls.ViHost.ViNames.
Referenced by SeciControls.ViHost.SetVisible().
|
inlineprivate |
Definition at line 150 of file ViHost.cs.
Referenced by SeciControls.ViHost.AddVI(), SeciControls.ViHost.CascadeVis(), SeciControls.ViHost.moveVisToConfigPositions(), and SeciControls.ViHost.updateHandles().
|
inline |
Definition at line 99 of file ViHost.cs.
References SeciControls.ViHost.RemoveVI(), and SeciControls.ViHost.ViNames.
|
inline |
Definition at line 80 of file ViHost.cs.
References SeciControls.ViHost._viNames.
Referenced by SeciControls.ViHost.RemoveAllVIs().
|
inlineprivate |
Definition at line 144 of file ViHost.cs.
Referenced by SeciControls.ViHost.AddVI().
|
inline |
Definition at line 394 of file ViHost.cs.
References SeciControls.ViHost._isFirstTime, SeciControls.ViHost._visible, SeciControls.ViHost.moveVisToConfigPositions(), and SeciControls.ViHost.ViNames.
|
inline |
|
inlineprivate |
This method is called when the timer object "ticks."
sender | The sender |
e | The event arguments |
Definition at line 274 of file ViHost.cs.
References SeciControls.ViHost._worker.
|
private |
Referenced by SeciControls.ViHost._worker_DoWork().
|
inlineprivate |
Unfortunately when a VI is started or stopped its window handle changes, so we have to update the stored handle when this happens and recapture the window. This is called every time the timer ticks.
Definition at line 223 of file ViHost.cs.
References SeciControls.ViHost._viNames, SeciControls.ViHost.findViHandle(), SeciControls.ViHost.positionVi(), and SeciControls.ViHost.ViNames.
Referenced by SeciControls.ViHost.work().
|
inlineprivate |
Definition at line 306 of file ViHost.cs.
References SeciControls.ViHost._visible, SeciControls.ViHost.getVIPosition(), SeciControls.ViHost.updateHandles(), and SeciControls.ViHost.ViNames.
Referenced by SeciControls.ViHost._worker_DoWork().
|
private |
|
private |
Definition at line 30 of file ViHost.cs.
Referenced by SeciControls.ViHost.SetVisible().
|
private |
Definition at line 25 of file ViHost.cs.
Referenced by SeciControls.ViHost.AddVI(), SeciControls.ViHost.getVIPosition(), SeciControls.ViHost.RemoveVI(), and SeciControls.ViHost.updateHandles().
|
private |
Definition at line 29 of file ViHost.cs.
Referenced by SeciControls.ViHost.SetVisible(), and SeciControls.ViHost.work().
|
private |
Definition at line 31 of file ViHost.cs.
Referenced by SeciControls.ViHost.timer1_Tick().
|
private |
Definition at line 98 of file ViHost.designer.cs.
|
private |
Required designer variable.
Definition at line 8 of file ViHost.designer.cs.
Referenced by SeciControls.ViHost.Dispose().
|
private |
Definition at line 97 of file ViHost.designer.cs.
|
private |
Definition at line 96 of file ViHost.designer.cs.
|
private |
Definition at line 100 of file ViHost.designer.cs.
|
private |
Definition at line 99 of file ViHost.designer.cs.
|
get |
Definition at line 27 of file ViHost.cs.
Referenced by SeciControls.ViHost.CascadeVis(), SeciControls.ViHost.moveVisToConfigPositions(), SeciControls.ViHost.RemoveAllVIs(), SeciControls.ViHost.SetVisible(), SeciControls.ViHost.updateHandles(), and SeciControls.ViHost.work().