Skip to content

Commit 5f90238

Browse files
committed
UIMonitor added, update processing - IntelliSenseDisplay not hooked up yet
1 parent 7a273d0 commit 5f90238

File tree

11 files changed

+772
-265
lines changed

11 files changed

+772
-265
lines changed

Source/ExcelDna.IntelliSense.Host/AddIn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class AddIn : IExcelAddIn
1414
public void AutoOpen()
1515
{
1616
IntelliSenseServer.Register();
17-
ExcelDna.Logging.LogDisplay.Show();
17+
// ExcelDna.Logging.LogDisplay.Show();
1818
}
1919

2020
public void AutoClose()

Source/ExcelDna.IntelliSense/ExcelDna.IntelliSense.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@
6868
<Compile Include="ToolTipForm.cs">
6969
<SubType>Form</SubType>
7070
</Compile>
71+
<Compile Include="UIMonitor.cs" />
7172
<Compile Include="Watchers.cs" />
7273
<Compile Include="Win32Helper.cs" />
74+
<Compile Include="WindowResizer.cs" />
7375
<Compile Include="WinEvents.cs" />
7476
<Compile Include="XlCall.cs" />
7577
</ItemGroup>

Source/ExcelDna.IntelliSense/IntelliSenseDisplay.cs

Lines changed: 118 additions & 187 deletions
Large diffs are not rendered by default.

Source/ExcelDna.IntelliSense/IntellisenseHelper.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Threading;
3+
using System.Windows.Forms;
24
using ExcelDna.Integration;
35

46
namespace ExcelDna.IntelliSense
@@ -15,7 +17,10 @@ public class IntelliSenseHelper : IDisposable
1517

1618
public IntelliSenseHelper()
1719
{
18-
_id = new IntelliSenseDisplay();
20+
SynchronizationContext syncContextMain = new WindowsFormsSynchronizationContext();
21+
var uiMonitor = new UIMonitor(syncContextMain);
22+
23+
_id = new IntelliSenseDisplay(syncContextMain, uiMonitor);
1924
RegisterIntellisense();
2025
}
2126

Source/ExcelDna.IntelliSense/Logging.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ namespace ExcelDna.IntelliSense
5555
enum IntelliSenseTraceEventId
5656
{
5757
Initialization = 1,
58-
Provider = 2,
58+
Monitor = 2,
5959
WinEvents = 3,
6060
WindowWatcher = 4,
61-
Display = 5
61+
Provider = 5,
62+
Display = 6,
6263
}
6364

6465
// TraceLogger manages the IntelliSenseTraceSource that we use for logging.
@@ -214,5 +215,6 @@ public void Error(Exception ex, string message, params object[] args)
214215
static internal Logger WinEvents { get; } = new Logger(IntelliSenseTraceEventId.WinEvents);
215216
static internal Logger WindowWatcher { get; } = new Logger(IntelliSenseTraceEventId.WindowWatcher);
216217
static internal Logger Display { get; } = new Logger(IntelliSenseTraceEventId.Display);
218+
static internal Logger Monitor { get; } = new Logger(IntelliSenseTraceEventId.Monitor);
217219
}
218220
}

Source/ExcelDna.IntelliSense/ToolTipForm.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class ToolTipForm : Form
1212
{
1313
FormattedText _text;
1414
private Label label;
15+
private Label label1;
16+
private ToolTip toolTip1;
17+
private System.ComponentModel.IContainer components;
1518
Win32Window _owner;
1619

1720
public ToolTipForm(IntPtr hwndOwner)
@@ -171,25 +174,38 @@ private void DrawString(Graphics g, Brush brush, ref Rectangle rect, out Size us
171174

172175
private void InitializeComponent()
173176
{
177+
this.components = new System.ComponentModel.Container();
174178
this.label = new System.Windows.Forms.Label();
179+
this.label1 = new System.Windows.Forms.Label();
180+
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
175181
this.SuspendLayout();
176182
//
177183
// label
178184
//
179185
this.label.AutoSize = true;
180-
this.label.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64);
186+
this.label.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
181187
this.label.Location = new System.Drawing.Point(3, 3);
182188
this.label.Name = "label";
183189
this.label.Size = new System.Drawing.Size(105, 13);
184190
this.label.TabIndex = 0;
185191
this.label.Text = "Some long label text.";
186192
//
193+
// label1
194+
//
195+
this.label1.BackColor = System.Drawing.Color.CornflowerBlue;
196+
this.label1.Location = new System.Drawing.Point(0, 0);
197+
this.label1.Name = "label1";
198+
this.label1.Size = new System.Drawing.Size(2, 2);
199+
this.label1.TabIndex = 0;
200+
this.toolTip1.SetToolTip(this.label1, "IntelliSense by Excel-DNA");
201+
//
187202
// ToolTipForm
188203
//
189204
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
190205
this.BackColor = System.Drawing.Color.White;
191206
this.ClientSize = new System.Drawing.Size(114, 20);
192207
this.ControlBox = false;
208+
this.Controls.Add(this.label1);
193209
this.DoubleBuffered = true;
194210
this.ForeColor = System.Drawing.Color.DimGray;
195211
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;

Source/ExcelDna.IntelliSense/ToolTipForm.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,7 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121+
<value>17, 17</value>
122+
</metadata>
120123
</root>

0 commit comments

Comments
 (0)