- upgraded the ribbon...
17c0effb
Dimitar Tsenev
committed
13 changed files
NoFlickerWindowsFormsHost.cs
/BEHelper/NoFlickerWindowsFormsHost.cs-2+32
/BEHelper/NoFlickerWindowsFormsHost.cs
Add comment 6 using System.Threading.Tasks;
Add comment 7 using System.Windows;
Add comment 8 using System.Windows.Forms.Integration;
Add comment 9 Plus  using System.Windows.Interop;
Add comment 9 10
Add comment 10 11 namespace BEHelper {
Add comment 11 Minus   public class NoFlickerWindowsFormsHost : WindowsFormsHost {
Add comment 12 Plus   public class NoFlickerWindowsFormsHost :
Add comment 13 Plus   //HwndHost {
Add comment 14 Plus   // [DllImport( "user32.dll", SetLastError = true )]
Add comment 15 Plus   // static extern IntPtr CreateWindowEx( IntPtr exStyle, string lpClassName,string lpWindowName,int dwStyle,int x,int y,int nWidth,int nHeight,IntPtr hWndParent,IntPtr hMenu,IntPtr hInstance,IntPtr lpParam );
Add comment 16 Plus  
Add comment 17 Plus   // protected override HandleRef BuildWindowCore( HandleRef hWndParent ) {
Add comment 18 Plus   // return new HandleRef(this, CreateWindowEx(IntPtr.Zero, "static", "", (int)(0x40000000L | 0x10000000L | 0x02000000L), 0, 0, (int)this.ActualWidth, (int)this.ActualHeight, hWndParent.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero));
Add comment 19 Plus   // }
Add comment 20 Plus   // protected override void DestroyWindowCore( HandleRef hwnd ) { }
Add comment 21 Plus   // }
Add comment 22 Plus   WindowsFormsHost {
Add comment 12 23 const uint SWP_NOZORDER = 0x0004;
Add comment 13 24 const uint SWP_NOACTIVATE = 0x0010;
Add comment 14 25 const uint SWP_ASYNCWINDOWPOS = 0x4000;
Add comment 26 Plus   public static readonly Int32 GWL_STYLE = -16;
Add comment 27 Plus   public static readonly UInt32 WS_CHILD = 0x40000000;
Add comment 28 Plus  
Add comment 29 Plus   [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
Add comment 30 Plus   internal static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent);
Add comment 31 Plus   [DllImport("user32.dll")]
Add comment 32 Plus   internal static extern int GetWindowLong(IntPtr hWnd, Int32 nIndex);
Add comment 33 Plus   [DllImport("user32.dll")]
Add comment 34 Plus   internal static extern UInt32 SetWindowLong(IntPtr hWnd, Int32 nIndex, UInt32 dwNewLong);
Add comment 35 Plus  
Add comment 36 Plus   internal int GetWindowStyle(IntPtr hWnd) {
Add comment 37 Plus   return (int)GetWindowLong(hWnd, GWL_STYLE);
Add comment 38 Plus   }
Add comment 15 39
Add comment 40 Plus   internal void SetWindowStyle(IntPtr hWnd, int windowStyle) {
Add comment 41 Plus   SetWindowLong(hWnd, GWL_STYLE, (UInt32)windowStyle);
Add comment 42 Plus   }
Add comment 16 43 [DllImport("user32.dll")]
Add comment 17 44 extern static bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
Add comment 18 45
Add comment 19 Minus  
Add comment 46 Plus   protected override HandleRef BuildWindowCore(HandleRef hwndParent) {
Add comment 47 Plus   SetWindowStyle(hwndParent.Handle, 0x02000000 | GetWindowStyle(hwndParent.Handle));
Add comment 48 Plus   return base.BuildWindowCore(hwndParent);
Add comment 49 Plus   }
Add comment 20 50 protected override void OnWindowPositionChanged(Rect rcBoundingBox) {
Add comment 21 51 if (Handle != IntPtr.Zero) {
Add comment 22 52 SetWindowPos(Handle,
CustomizeQAT.xaml.cs
/BExplorer/BetterExplorer/Customize/CustomizeQAT.xaml.cs-3+3
/BExplorer/BetterExplorer/Customize/CustomizeQAT.xaml.cs
Add comment 46
Add comment 47 #region DO NOT DELETE (yet) [From: Aaron Campf]
Add comment 48 var AllMenuItems = MainForm.TheRibbon.QuickAccessItems.Select(x => x.Target).ToList();
Add comment 49 Minus   var Controls = (from control in MainForm.TheRibbon.QuickAccessToolbarItems
Add comment 50 Minus   select control.Key as Control into newControl
Add comment 49 Plus   var Controls = (from control in MainForm.TheRibbon.QuickAccessItems
Add comment 50 Plus   select control as Control into newControl
Add comment 51 where !AllMenuItems.Any(x => x.Name == newControl.Name)
Add comment 52 select newControl).ToList();
Add comment 53 #endregion
Add comment 55 AllMenuItems.AddRange(Controls);
Add comment 56 //Here add visible elements since we want to show in that dialog only visible elements into the QAT.
Add comment 57 //Maybe have to find a way to show all elements even not visible and do some handling to display them properly
Add comment 58 Minus   foreach (var item in MainForm.TheRibbon.QuickAccessToolbarItems.Select(s => s.Key as Control).ToList()) {
Add comment 58 Plus   foreach (var item in MainForm.TheRibbon.QuickAccessItems.Select(s => s as Control).ToList()) {
Add comment 59 QATControls.Items.Add(GetRibbonItemListDisplay(item as IRibbonControl));
Add comment 60 }
Add comment 61 }
App.xaml.cs
/BExplorer/BetterExplorer/App.xaml.cs+27
/BExplorer/BetterExplorer/App.xaml.cs
Add comment 132 string Locale = ""; bool dmi = true;
Add comment 133 Application.Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(Current_DispatcherUnhandledException);
Add comment 134 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Add comment 135 Plus   //RegistryKey rk = Registry.CurrentUser;
Add comment 136 Plus   //RegistryKey rks = rk.OpenSubKey(@"Software\BExplorer", true);
Add comment 135 137
Add comment 138 Plus   //// loads current Ribbon color theme
Add comment 139 Plus   //try {
Add comment 140 Plus   // var Color = Convert.ToString(rks.GetValue("CurrentTheme", "Blue"));
Add comment 141 Plus   // switch (Color) {
Add comment 142 Plus   // case "Blue":
Add comment 143 Plus   // case "Silver":
Add comment 144 Plus   // case "Black":
Add comment 145 Plus   // case "Green":
Add comment 146 Plus   // Application.Current.Resources.MergedDictionaries.RemoveAt(0);
Add comment 147 Plus   // Application.Current.Resources.MergedDictionaries.Insert(0, new ResourceDictionary() { Source = new Uri("pack://application:,,,/Fluent;component/Themes/Generic.xaml") });
Add comment 148 Plus   // break;
Add comment 149 Plus   // case "Metro":
Add comment 150 Plus   // Application.Current.Resources.MergedDictionaries.RemoveAt(0);
Add comment 151 Plus   // Application.Current.Resources.MergedDictionaries.Insert(0, new ResourceDictionary() { Source = new Uri("pack://application:,,,/Fluent;component/Themes/Office2013/Generic.xaml") });
Add comment 152 Plus   // break;
Add comment 153 Plus   // default:
Add comment 154 Plus   // Application.Current.Resources.MergedDictionaries.RemoveAt(0);
Add comment 155 Plus   // Application.Current.Resources.MergedDictionaries.Insert(0, new ResourceDictionary() { Source = new Uri("pack://application:,,,/Fluent;component/Themes/Generic.xaml") });
Add comment 156 Plus   // break;
Add comment 157 Plus   // }
Add comment 158 Plus   //} catch (Exception ex) {
Add comment 159 Plus   // MessageBox.Show(String.Format("An error occurred while trying to load the theme data from the Registry. \n\r \n\r{0}\n\r \n\rPlease let us know of this issue at http://bugtracker.better-explorer.com/", ex.Message), "RibbonTheme Error - " + ex.ToString());
Add comment 160 Plus   //}
Add comment 161 Plus   //rks.Close();
Add comment 162 Plus   //rk.Close();
Add comment 136 163 if (e.Args != null && e.Args.Any()) {
Add comment 137 164 dmi = e.Args.Contains("/nw") || e.Args[0] == "t";
Add comment 138 165 isStartWithStartupTab = e.Args.Contains("/norestore");
BetterExplorer.csproj
/BExplorer/BetterExplorer/BetterExplorer.csproj
/BExplorer/BetterExplorer/BetterExplorer.csproj
Fluent.dll
/BExplorer/BetterExplorer/Fluent.dll
/BExplorer/BetterExplorer/Fluent.dll
MainWindow.xaml
/BExplorer/BetterExplorer/MainWindow.xaml
/BExplorer/BetterExplorer/MainWindow.xaml
MainWindow.xaml.cs
/BExplorer/BetterExplorer/MainWindow.xaml.cs
/BExplorer/BetterExplorer/MainWindow.xaml.cs
ConsoleControl.csproj
/ConsoleControl/ConsoleControl.csproj
/ConsoleControl/ConsoleControl.csproj
MessageHandler.cs
/Shell/MessageHandler.cs
/Shell/MessageHandler.cs
ShellViewEx.cs
/Shell/ShellViewEx.cs
/Shell/ShellViewEx.cs
BetterExplorerControls.csproj
/WpfControlLibrary1/BetterExplorerControls.csproj
/WpfControlLibrary1/BetterExplorerControls.csproj
SearchBox.xaml
/WpfControlLibrary1/SearchBox.xaml
/WpfControlLibrary1/SearchBox.xaml
BExplorer.sln
/BExplorer.sln
/BExplorer.sln