Skip to content

Commit 44ba3cf

Browse files
committed
Fix DescriptionTip hiding
Fix dna tip
1 parent 9b6e718 commit 44ba3cf

File tree

5 files changed

+23
-56
lines changed

5 files changed

+23
-56
lines changed

Source/ExcelDna.IntelliSense/IntelliSenseDisplay.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,12 @@ void FormulaEditTextChange(string formulaPrefix, Rect editWindowBounds, Rect exc
252252
}
253253
}
254254

255-
// All other paths, we just clear the box
255+
// All other paths, we hide the box
256256
if (_argumentsToolTip != null)
257257
{
258-
//_argumentsToolTip.Hide();
259-
_argumentsToolTip.Dispose();
260-
_argumentsToolTip = null;
258+
_argumentsToolTip.Hide();
259+
//_argumentsToolTip.Dispose();
260+
//_argumentsToolTip = null;
261261
}
262262
}
263263

Source/ExcelDna.IntelliSense/IntelliSenseServer.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -393,39 +393,6 @@ static RegistrationInfo GetHighestPublishedRegistration()
393393
}
394394
#endregion
395395

396-
//#region AppDomain helper
397-
//static AppDomain GetAppDomain(string friendlyName)
398-
//{
399-
// IntPtr enumHandle = IntPtr.Zero;
400-
// mscoree.ICorRuntimeHost host = new mscoree.CorRuntimeHost();
401-
402-
// try
403-
// {
404-
// host.EnumDomains(out enumHandle);
405-
406-
// while (true)
407-
// {
408-
// object domain;
409-
// host.NextDomain(enumHandle, out domain);
410-
411-
// if (domain == null)
412-
// break;
413-
414-
// AppDomain appDomain = (AppDomain)domain;
415-
// if (appDomain.FriendlyName.Equals(friendlyName))
416-
// return appDomain;
417-
// }
418-
// }
419-
// finally
420-
// {
421-
// host.CloseEnum(enumHandle);
422-
// System.Runtime.InteropServices.Marshal.ReleaseComObject(host); // Why??? Pure cargo-culting here...
423-
// }
424-
425-
// return null;
426-
//}
427-
//#endregion
428-
429396
#region IntelliSense control function registered with Excel
430397

431398
static void RegisterControlFunction()

Source/ExcelDna.IntelliSense/ToolTipForm.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class ToolTipForm : Form
1414
{
1515
FormattedText _text;
1616
Label label;
17-
Label label1;
18-
ToolTip toolTip1;
17+
Label labelDna;
18+
ToolTip tipDna;
1919
System.ComponentModel.IContainer components;
2020
Win32Window _owner;
2121

@@ -130,7 +130,7 @@ protected override CreateParams CreateParams
130130
//if (_createParams == null)
131131
{
132132
const int CS_DROPSHADOW = 0x00020000;
133-
const int WS_CHILD = 0x40000000;
133+
//const int WS_CHILD = 0x40000000;
134134
const int WS_EX_TOOLWINDOW = 0x00000080;
135135
const int WS_EX_NOACTIVATE = 0x08000000;
136136
// NOTE: I've seen exception with invalid handle in the base.CreateParams call here...
@@ -225,8 +225,8 @@ void InitializeComponent()
225225
{
226226
this.components = new System.ComponentModel.Container();
227227
this.label = new System.Windows.Forms.Label();
228-
this.label1 = new System.Windows.Forms.Label();
229-
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
228+
this.labelDna = new System.Windows.Forms.Label();
229+
this.tipDna = new System.Windows.Forms.ToolTip(this.components);
230230
this.SuspendLayout();
231231
//
232232
// label
@@ -239,22 +239,26 @@ void InitializeComponent()
239239
this.label.TabIndex = 0;
240240
this.label.Text = "Some long label text.";
241241
//
242-
// label1
242+
// labelDna
243243
//
244-
this.label1.BackColor = System.Drawing.Color.CornflowerBlue;
245-
this.label1.Location = new System.Drawing.Point(0, 0);
246-
this.label1.Name = "label1";
247-
this.label1.Size = new System.Drawing.Size(2, 2);
248-
this.label1.TabIndex = 0;
249-
this.toolTip1.SetToolTip(this.label1, "IntelliSense by Excel-DNA");
244+
this.labelDna.BackColor = System.Drawing.Color.CornflowerBlue;
245+
this.labelDna.Location = new System.Drawing.Point(0, 0);
246+
this.labelDna.Name = "labelDna";
247+
this.labelDna.Size = new System.Drawing.Size(2, 2);
248+
this.labelDna.TabIndex = 0;
249+
this.tipDna.SetToolTip(this.labelDna, "IntelliSense by Excel-DNA");
250+
//
251+
// tipDna
252+
//
253+
this.tipDna.ShowAlways = true;
250254
//
251255
// ToolTipForm
252256
//
253257
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
254258
this.BackColor = System.Drawing.Color.White;
255259
this.ClientSize = new System.Drawing.Size(114, 20);
256260
this.ControlBox = false;
257-
this.Controls.Add(this.label1);
261+
this.Controls.Add(this.labelDna);
258262
this.DoubleBuffered = true;
259263
this.ForeColor = System.Drawing.Color.DimGray;
260264
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;

Source/ExcelDna.IntelliSense/ToolTipForm.resx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +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>
123-
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
120+
<metadata name="tipDna.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124121
<value>17, 17</value>
125122
</metadata>
126123
</root>

Source/ExcelDna.IntelliSense/Watchers.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ class PopupListWatcher : IDisposable
490490
// AutomationElement _mainWindow;
491491
IntPtr _hwndPopupList;
492492
AutomationElement _popupList;
493-
AutomationElement _popupListList;
494493
AutomationElement _selectedItem;
495494

496495
// NOTE: Event will always be raised on our automation thread
@@ -656,7 +655,7 @@ void InstallEventHandlers()
656655
catch (Exception ex)
657656
{
658657
// Probably no longer visible
659-
Debug.Print("POPUPLISTWATCHER WINDOW SELECTION EVENT HANDLER ADD FAILED");
658+
Debug.Print($"POPUPLISTWATCHER WINDOW SELECTION EVENT HANDLER ADD FAILED: {ex.Message}");
660659
_popupList = null;
661660
}
662661
}

0 commit comments

Comments
 (0)