public ExplorerSkinWindow(TopLevelWindow window, ExplorerSkin skin) : base(window, skin, true) { LockUpdate = true; SetExplorerWindow(window); TitleControl.Visible = false; TitleBackgroundControl1.Visible = false; AddressBar = new LayeredBreadcrumbs(TopBorder1); TopBorder1.Controls.Remove(AddressBar); TopBorder1.Controls.Insert(0, AddressBar); SearchButton = new LayeredTextbox(TopBorder1); SearchButton.SizeType = LayeredButton.SizingType.SizeToDefault; NavigateBackButton = new LayeredImageButton(TopBorder1); NavigateBackButton.Enabled = false; NavigateForwardButton = new LayeredImageButton(TopBorder1); NavigateForwardButton.Enabled = false; HistoryButton = new LayeredImageButton(TopBorder1); HistoryButton.Enabled = false; RefreshButton = new LayeredImageButton(TopBorder1); DownArrowButton = new LayeredImageButton(TopBorder1); HistoryList = new List<string>(); ExplorerSkin = skin; LockUpdate = false; _explorerSettingsUpdateHandler = new ExplorerSettingsUpdateHandler(this); }
public WindowEventHandler(SkinableWindowBorder skinWindow, TopLevelWindow parent) { _skinWindow = skinWindow; _parent = parent; CreateMaximizeTimer(); }
public void AddWindow (TopLevelWindow window) { base.Add (window); Title = window.Title ?? string.Empty; window.PropertyChanged += OnWindowPropChange; Destroyed += delegate { window.PropertyChanged -= OnWindowPropChange; }; }
public void AddWindow(TopLevelWindow window) { base.Add(window); Title = window.Title ?? string.Empty; window.PropertyChanged += OnWindowPropChange; Destroyed += delegate { window.PropertyChanged -= OnWindowPropChange; }; }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { if (Settings.Settings.ExplorerSkinning && ExplorerSkinWindow.IsExplorerWindow(window)) { manager.AddSkinWindow(new ExplorerSkinWindow(window, Settings.Settings.ExplorerSkin)); return true; } return false; }
public static Metacity.Preview Create (TopLevelWindow window) { Metacity.Preview metacityPreview; try { Metacity.Preview.Init (); metacityPreview = new Metacity.Preview (); } catch { return null; } switch (window.TypeHint) { case Gdk.WindowTypeHint.Normal: metacityPreview.FrameType = Metacity.FrameType.Normal; break; case Gdk.WindowTypeHint.Dialog: metacityPreview.FrameType = window.Modal ? Metacity.FrameType.ModalDialog : Metacity.FrameType.Dialog; break; case Gdk.WindowTypeHint.Menu: metacityPreview.FrameType = Metacity.FrameType.Menu; break; case Gdk.WindowTypeHint.Splashscreen: metacityPreview.FrameType = Metacity.FrameType.Border; break; case Gdk.WindowTypeHint.Utility: metacityPreview.FrameType = Metacity.FrameType.Utility; break; default: metacityPreview.FrameType = Metacity.FrameType.Normal; break; } Metacity.FrameFlags flags = Metacity.FrameFlags.AllowsDelete | Metacity.FrameFlags.AllowsVerticalResize | Metacity.FrameFlags.AllowsHorizontalResize | Metacity.FrameFlags.AllowsMove | Metacity.FrameFlags.AllowsShade | Metacity.FrameFlags.HasFocus; if (window.Resizable) flags = flags | Metacity.FrameFlags.AllowsMaximize; metacityPreview.FrameFlags = flags; metacityPreview.ShowAll (); metacityPreview.AddWindow (window); metacityPreview.Theme = GetTheme (); return metacityPreview; }
public static Preview Create (TopLevelWindow window) { if (System.IO.Path.DirectorySeparatorChar != '\\') return null; try { Preview p = new Preview (); p.Add (window); return p; } catch { return null; } }
// Determine if this MDI client currently has the focus because the // top-level window that contains it has the primary focus. private bool HasFocus() { TopLevelWindow topLevel = TopLevel; if (topLevel != null) { return(topLevel.hasPrimaryFocus); } else { return(false); } }
private void WindowsList_SelectedIndexChanged(object sender, EventArgs e) { if (WindowsList.SelectedItems.Count > 0) { TopLevelWindow w = new TopLevelWindow(WindowsList.SelectedItems[0].Text); if (w.Exists) { ProgramTxt.Text = w.Title; ProcessTxt.Text = w.ProcessName; ClassesTxt.Text = w.ClassName; } } }
private void ForceParentCommand(SystemCommands HitTest) { TopLevelWindow.ReleaseCapture(); _skinWindow.Parent.Activate(); //Parent.SendMessageTimeOut(WindowMessages.SysCommand, _ // New IntPtr(HitTest), _ // IntPtr.Zero, _ // SendMessageTimeOutFlags.Normal Or SendMessageTimeOutFlags.AbortIfHang, _ // 0, IntPtr.Zero) _skinWindow.Parent.PostMessage(WindowMessages.SysCommand, new IntPtr((int)HitTest), IntPtr.Zero); //using SendMessageTimeOut make hang when trying to close a window // and hangs the window on vista when moving so much because it causes the thread to hold until it return }
public static void ToggleMaximize(TopLevelWindow window) { if (window.MaximizeBox) { if (window.Maximized) { window.Restore(); } else { window.Maximize(); } } }
public static void RestoreBorder(TopLevelWindow window) { window.Region = IntPtr.Zero; if (window.Maximized | window.Minimized) { unchecked { window.Styles = (window.Styles & ~(unchecked((int)(WindowStyles.Popup)))) | (int)(WindowStyles.Caption | WindowStyles.Border | WindowStyles.Sizebox); } window.ExStyles = (window.ExStyles & ~(int)WindowExtendedStyles.StaticEdge) | (int)WindowExtendedStyles.WindowEdge; window.Bounds = window.Screen.WorkingArea; } window.PostMessage(WindowMessages.Themechanged); window.FrameChanged(); }
private void HandleNewWindow(TopLevelWindow window) { if (IsSkinned(window)) { return; } foreach (var handler in _newWindowHandlers) { if (handler.HandleNewWindow(window, this)) { return; } } }
public static void RestoreBorder(TopLevelWindow window) { window.Region = IntPtr.Zero; if (window.Maximized | window.Minimized) { unchecked { window.Styles = (window.Styles & ~(unchecked ((int)(WindowStyles.Popup)))) | (int)(WindowStyles.Caption | WindowStyles.Border | WindowStyles.Sizebox); } window.ExStyles = (window.ExStyles & ~(int)WindowExtendedStyles.StaticEdge) | (int)WindowExtendedStyles.WindowEdge; window.Bounds = window.Screen.WorkingArea; } window.PostMessage(WindowMessages.Themechanged); window.FrameChanged(); }
public static Preview Create(TopLevelWindow window) { if (System.IO.Path.DirectorySeparatorChar != '\\') { return(null); } try { Preview p = new Preview(); p.Add(window); return(p); } catch { return(null); } }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { ExcludedWindow exludeInfo = ExcludeList[window]; if (exludeInfo != null) { if (exludeInfo.HasSkin) { manager.AddSkinWindow(new SkinableWindowBorder(window, exludeInfo.Skin, true)); } return(true); } return(false); }
public override void Wrap(object obj, bool initialized) { TopLevelWindow window = (TopLevelWindow)obj; base.Wrap(obj, initialized); if (!initialized) { if (window.Child is Placeholder) { window.Child.SetSizeRequest(200, 200); } } window.DeleteEvent += DeleteEvent; }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { ExcludedWindow exludeInfo = ExcludeList[window]; if (exludeInfo != null) { if (exludeInfo.HasSkin) { manager.AddSkinWindow(new SkinableWindowBorder(window, exludeInfo.Skin, true)); } return true; } return false; }
protected virtual void Dispose(bool disposing) { if (!_disposed) { OnDisposed(this); WindowEventHandler.Dispose(); _processExitHandler.Dispose(); _skinWindowButtonsHandler.Dispose(); _settingsUpdater.Dispose(); TopBorder.Dispose(); LeftBorder.Dispose(); RightBorder.Dispose(); BottomBorder.Dispose(); TopBorder = null; LeftBorder = null; RightBorder = null; BottomBorder = null; MinimizeButton = null; MaximizeButton = null; CloseButton = null; HelpButton = null; TitleControl = null; TitleBackgroundControl = null; IconControl = null; _skin = null; _parent = null; _processExitHandler = null; _settingsUpdater = null; _skinWindowButtonsHandler = null; _windowEventHandler = null; _controlsChangeHandler = null; _disposed = true; } }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { if (IncludeList.HasWindows) { ExcludedWindow included = IncludeList[window]; if (included == null) return true; if (included.Skin != null) { manager.AddSkinWindow(new SkinableWindowBorder(window, included.Skin, false)); return true; } } return false; }
public override void Wrap(object obj, bool initialized) { TopLevelWindow window = (TopLevelWindow)obj; RootWrapperName = window.Name; //during Wrap RootWrapperName will be set in the children widgets base.Wrap(obj, initialized); if (!initialized) { if (window.Child is Placeholder) { window.Child.SetSizeRequest(200, 200); } } window.DeleteEvent += DeleteEvent; }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { if (IncludeList.HasWindows) { ExcludedWindow included = IncludeList[window]; if (included == null) { return(true); } if (included.Skin != null) { manager.AddSkinWindow(new SkinableWindowBorder(window, included.Skin, false)); return(true); } } return(false); }
private void IconClick(object sender, MouseEventArgs e) { try { Debug.WriteLine("Icon Clicked"); TopLevelWindow.ReleaseCapture(); _skinWindow.Parent.Activate(); if (_skinWindow.IconControl1.VerticalAlignment == VerticalAlignment.left) { _skinWindow.Parent.PostMessage(WindowMessages.Getsysmenu, IntPtr.Zero, MakeDWord(_skinWindow.LeftBorder1.Left + _skinWindow.LeftBorder1.Width, _skinWindow.TopBorder1.Top + _skinWindow.TopBorder1.Height)); } else { _skinWindow.Parent.PostMessage(WindowMessages.Getsysmenu, IntPtr.Zero, MakeDWord(_skinWindow.TopBorder1.Left + (_skinWindow.TopBorder1.Width - _skinWindow.RightBorder1.Width), _skinWindow.TopBorder1.Top + _skinWindow.TopBorder1.Height)); } } catch (Exception) { } }
/// <summary> /// <para>Construct a new clipboard, associated with a particular /// screen and selection name.</para> /// </summary> /// /// <param name="screen"> /// <para>The screen to attach the clipboard to, or <see langword="null"/> /// to use the default screen.</para> /// </param> /// /// <param name="name"> /// <para>The name of the selection to use for clipboard access. /// This is usually <c>PRIMARY</c> for the X selection or /// <c>CLIPBOARD</c> for the explicit copy/cut/paste clipboard.</para> /// </param> /// /// <exception cref="T:System.ArgumentNullException"> /// <para>The <paramref name="name"/> parameter is /// <see langword="null"/>.</para> /// </exception> public Clipboard(Screen screen, String name) : base(TopLevelWindow.GetRoot(screen), -1, -1, 1, 1) { if (name == null) { throw new ArgumentNullException("name"); } try { IntPtr display = dpy.Lock(); this.name = Xlib.XInternAtom (display, name, XBool.False); this.targets = Xlib.XInternAtom (display, "TARGETS", XBool.False); } finally { dpy.Unlock(); } }
public SkinableWindowBorder(TopLevelWindow Window, WindowBorderSkin skin, bool IsExecluded) { _parent = Window; TopBorder = new SkinBorder(this); LeftBorder = new SkinBorder(this); RightBorder = new SkinBorder(this); BottomBorder = new SkinBorder(this); TitleBackgroundControl = new LayeredControl(TopBorder); TitleControl = new LayeredLabel(TopBorder); IconControl = new LayeredIcon(TopBorder); IconControl.Size = new Size(16, 16); MinimizeButton = new MinimizeButton(TopBorder); MaximizeButton = new MaximizeButton(TopBorder); CloseButton = new CloseButton(TopBorder); HelpButton = new HelpButton(TopBorder); if (Window.SizeBox) { TopBorder.LeftCornerCursor = Cursors.SizeNWSE; TopBorder.RightCornerCursor = Cursors.SizeNESW; TopBorder.TopCursor = Cursors.SizeNS; LeftBorder.NormalCursor = Cursors.SizeWE; RightBorder.NormalCursor = Cursors.SizeWE; BottomBorder.NormalCursor = Cursors.SizeNS; BottomBorder.LeftCornerCursor = Cursors.SizeNESW; BottomBorder.RightCornerCursor = Cursors.SizeNWSE; } _windowEventHandler = new WindowEventHandler(this, Parent); _settingsUpdater = new SettingsUpdater(IsExecluded, this); _processExitHandler = new ProcessExitHandler(this, Parent.Process); _skinWindowButtonsHandler = new SkinWindowButtonsHandler(this); _controlsChangeHandler = new SkinWindowControlsChangeHandler(this); Skin = skin; }
protected virtual void Dispose(bool disposing) { if(!_disposed){ OnDisposed(this); WindowEventHandler.Dispose(); _processExitHandler.Dispose(); _skinWindowButtonsHandler.Dispose(); _settingsUpdater.Dispose(); TopBorder.Dispose(); LeftBorder.Dispose(); RightBorder.Dispose(); BottomBorder.Dispose(); TopBorder = null; LeftBorder = null; RightBorder = null; BottomBorder = null; MinimizeButton = null; MaximizeButton = null; CloseButton = null; HelpButton = null; TitleControl = null; TitleBackgroundControl = null; IconControl = null; _skin = null; _parent = null; _processExitHandler = null; _settingsUpdater = null; _skinWindowButtonsHandler = null; _windowEventHandler = null; _controlsChangeHandler = null; _disposed = true; } }
public static bool IsExplorerWindow(TopLevelWindow Window) { if (Window.ProcessName == "explorer" && "CabinetWClass,ExploreWClass".Contains(Window.ClassName)) { return true; } return false; }
public void SetExplorerWindow(TopLevelWindow Window) { Thread SearchThread = new Thread(SearchExplorerWindows); SearchThread.Start(Window.Handle); }
public static Metacity.Preview Create(TopLevelWindow window) { Metacity.Preview metacityPreview; try { Metacity.Preview.Init(); metacityPreview = new Metacity.Preview(); } catch { return(null); } switch (window.TypeHint) { case Gdk.WindowTypeHint.Normal: metacityPreview.FrameType = Metacity.FrameType.Normal; break; case Gdk.WindowTypeHint.Dialog: metacityPreview.FrameType = window.Modal ? Metacity.FrameType.ModalDialog : Metacity.FrameType.Dialog; break; case Gdk.WindowTypeHint.Menu: metacityPreview.FrameType = Metacity.FrameType.Menu; break; case Gdk.WindowTypeHint.Splashscreen: metacityPreview.FrameType = Metacity.FrameType.Border; break; case Gdk.WindowTypeHint.Utility: metacityPreview.FrameType = Metacity.FrameType.Utility; break; default: metacityPreview.FrameType = Metacity.FrameType.Normal; break; } Metacity.FrameFlags flags = Metacity.FrameFlags.AllowsDelete | Metacity.FrameFlags.AllowsVerticalResize | Metacity.FrameFlags.AllowsHorizontalResize | Metacity.FrameFlags.AllowsMove | Metacity.FrameFlags.AllowsShade | Metacity.FrameFlags.HasFocus; if (window.Resizable) { flags = flags | Metacity.FrameFlags.AllowsMaximize; } metacityPreview.FrameFlags = flags; metacityPreview.ShowAll(); metacityPreview.AddWindow(window); metacityPreview.Theme = GetTheme(); return(metacityPreview); }
public bool CheckWindow(TopLevelWindow window) { return(ProcessName.Equals(window.ProcessName, StringComparison.OrdinalIgnoreCase) && ClassContains(window.ClassName)); }
public void Close() { TopLevelWindow.Close(); }
public static TopLevelWindow CreateInstance( ) { TopLevelWindow t = new TopLevelWindow(); return(t); }
private bool IsSkinned(TopLevelWindow window) { return _skinnedWindows.ContainsKey(window.Handle); }
private bool IsSkinned(TopLevelWindow window) { return(_skinnedWindows.ContainsKey(window.Handle)); }
private void HandleNewWindow(TopLevelWindow window) { if (IsSkinned(window)) return; foreach (var handler in _newWindowHandlers) { if(handler.HandleNewWindow(window, this)) { return; } } }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { // TODO: find another way to exclude Shut Down Windows or get the title name from the registry to support loclized names return(window.Title == "Shut Down Windows"); }
public static void ForceParentCommand(TopLevelWindow window, SystemCommands HitTest) { TopLevelWindow.ReleaseCapture(); window.Activate(); window.PostMessage(WindowMessages.SysCommand, new IntPtr((int)HitTest), IntPtr.Zero); }
public static TopLevelWindow CreateInstance ( ) { TopLevelWindow t = new TopLevelWindow (); return t; }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { manager.AddSkinWindow(new SkinableWindowBorder(window, Settings.Settings.Skin, false)); return(true); }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { // TODO: find another way to exclude Shut Down Windows or get the title name from the registry to support loclized names return window.Title == "Shut Down Windows"; }
/// <summary> /// <para>Method that is called when a child becomes inactive within /// the MDI client.</para> /// </summary> /// /// <param name="child"> /// <para>The child that was deactivated.</para> /// </param> protected virtual void OnDeactivateChild(TopLevelWindow child) { // Nothing to do here. }
protected override void OnActivateChild(TopLevelWindow child) { sink.ToolkitMdiActivate((IToolkitWindow)child); }
public bool HandleNewWindow(TopLevelWindow window, BorderSkinningManager manager) { manager.AddSkinWindow(new SkinableWindowBorder(window, Settings.Settings.Skin, false)); return true; }
public bool CheckWindow(TopLevelWindow window) { return ProcessName.Equals(window.ProcessName, StringComparison.OrdinalIgnoreCase) && ClassContains(window.ClassName); }
public void Add(string programName, TopLevelWindow window) { Add(new ExcludedWindow(programName, window.ProcessName, window.ClassName, string.Empty, string.Empty, false)); SaveChanges(); }
protected TopLevelImpl() { CoreWindow = new TopLevelWindow(this); }
/// <summary> /// <para>Constructs a new <see cref="T:Xsharp.PopupWindow"/> /// instance.</para> /// </summary> /// /// <param name="screen"> /// <para>The screen to display the window on, or <see langword="null"/> /// to use the default screen of the primary display.</para> /// </param> /// /// <param name="x"> /// <para>The X position of the new window.</para> /// </param> /// /// <param name="y"> /// <para>The Y position of the new window.</para> /// </param> /// /// <param name="width"> /// <para>The width of the new window.</para> /// </param> /// /// <param name="height"> /// <para>The height of the new window.</para> /// </param> /// /// <exception cref="T:Xsharp.XException"> /// <para>Raised if any of the parameters are out of range.</para> /// </exception> public PopupWindow(Screen screen, int x, int y, int width, int height) : base(TopLevelWindow.GetRoot(screen), x, y, width, height) { // Nothing to do here. }