public doc(string txt) { this.elements = new List <doc_element>() { new doc_text(txt) }; this.for_scripting = for_scripting; }
protected static void show_tooltip(string html, int width, int height, base_interop for_scripting = null, int ss_hide = 0, bool light = false) { try { if (_tltp != null) { hide_tooltip(); } _tltp = new frm_tooltip(html, for_scripting, ss_hide); if (light) { _tltp.Opacity = .6; } else { _tltp.Opacity = .8; } Point p = Cursor.Position; _tltp.Width = width; _tltp.Height = height; _tltp.Top = p.Y - 5; if (_tltp.Bottom > Screen.PrimaryScreen.Bounds.Bottom) { _tltp.Top -= _tltp.Bottom - Screen.PrimaryScreen.Bounds.Bottom; } _tltp.Left = p.X - 5; if (_tltp.Right > Screen.PrimaryScreen.Bounds.Right) { _tltp.Left -= _tltp.Right - Screen.PrimaryScreen.Bounds.Right; } _tltp.TopMost = true; _tltp.Show(); } catch { } }
public static void show(doc d, base_interop for_scripting = null) { try { int w = 300, h = 22; StringBuilder html = new StringBuilder($@"<html xml:lang='en-us' xmlns='http://www.w3.org/1999/xhtml'><head> <meta charset='utf-8'> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <meta name='viewport' content='width=device-width, initial-scale=1'> <style> body {{ font-family:segoe ui semibold; color:white; font-size:11pt; background-color:darkblue; padding:7px; margin:0px; border:0px; }} div.voice {{ height:25px; padding:5px; }} div.voice:hover {{ background-color:darkslateblue; }} a.l-title {{ margin-right:3px; color:white; display:block; vertical-align:middle; }} a.l-title img {{ width:24px; height:24px; position:relative; top:7px; margin-right:10px; display:inline-block; }} a.l-title span {{ display:inline-block; }} </style> <script language=javascript> </script> </head> <body>"); foreach (doc_element e in d.elements) { if (e is doc_voice) { html.Append($@"<div class='voice'><a class='l-title' href=""javascript:{{ {((doc_voice)e).href}; window.external.hide(); }}""> <span>{((doc_voice)e).title}</span></a></div>"); h += 31; } } html.Append("</body></html>"); frm_tooltip.show_tooltip(html.ToString(), w, h, for_scripting); } catch { } }
public doc(base_interop for_scripting = null) { this.elements = new List <doc_element>(); this.for_scripting = for_scripting; }
public doc(List <doc_element> elements, base_interop for_scripting = null) { this.elements = elements; this.for_scripting = for_scripting; }
public frm_tooltip(string html, base_interop for_scripting, int ss_hide = 0) { InitializeComponent(); this.html = html; this.for_scripting = for_scripting; this.ss_hide = ss_hide; }