Esempio n. 1
0
        public void ButtonsStateChanged(int Command, bool Enabled)
        {
            switch ((CommandStateChangeConstants)Command)
            {
            case CommandStateChangeConstants.CSC_NAVIGATEFORWARD:
                // 2
                if (NavigateForwardButton.Enabled != Enabled)
                {
                    NavigateForwardButton.Enabled = Enabled;
                    _buttonsRequireUpdate         = true;
                }
                break;

            case CommandStateChangeConstants.CSC_NAVIGATEBACK:
                // 1
                if (NavigateBackButton.Enabled != Enabled)
                {
                    NavigateBackButton.Enabled = Enabled;
                    _buttonsRequireUpdate      = true;
                }
                break;
            }
            _buttonEventCalls += 1;
            if (_buttonEventCalls == 3)
            {
                if (_buttonsRequireUpdate && !Maximized)
                {
                    TopBorder1.Update();
                }
                _buttonEventCalls     = 0;
                _buttonsRequireUpdate = false;
            }
        }
Esempio n. 2
0
 public void NavigateComplete(object pDisp, ref object URL)
 {
     TopBorder1.SuspendUpdate();
     AddressBar.Path       = URL.ToString();
     SearchButton.Text     = DefaultSearchName;
     _buttonsRequireUpdate = true;
     TopBorder1.ResumeUpdate();
 }
Esempio n. 3
0
        public void OnRecentClose(object sender, EventArgs e)
        {
            HistoryButton.ForceState = ButtonState.None;
            HistoryButton.HoverState = ButtonState.Hover;
            TopBorder1.Update();

            ExplorerSkin.Box.ItemClicked     -= Navigate;
            ExplorerSkin.Box.PopupMenuClosed -= OnRecentClose;
        }
Esempio n. 4
0
        public void SearchExplorerWindows(object obj)
        {
            IntPtr windowHandle = (IntPtr)obj;

            while (ExplorerWindow == null)
            {
                ExplorerWindow = ExplorerWindows.GetExplorerWindow(windowHandle);
            }

            AddressBar.Path   = ExplorerPath;
            SearchButton.Text = DefaultSearchName;
            AddHandlers();

            TopBorder1.Update();
        }
Esempio n. 5
0
        public void OnRecentVisit(object sender, MouseEventArgs e)
        {
            if (HistoryList.Count > 0)
            {
                ExplorerSkin.Box.Top    = TopBorder1.Top + TopBorder1.Height;
                ExplorerSkin.Box.Width  = 200;
                ExplorerSkin.Box.Height = 400;
                if (HistoryButton.VerticalAlignment == VerticalAlignment.left)
                {
                    if (Maximized)
                    {
                        ExplorerSkin.Box.Left = TopBorder1.Left;
                    }
                    else
                    {
                        ExplorerSkin.Box.Left = LeftBorder.Left + LeftBorder.Width;
                    }
                }
                else
                {
                    ExplorerSkin.Box.Left = RightBorder1.Left - ExplorerSkin.Box.Width;
                }
                HistoryButton.ForceState = ButtonState.Pressed;
                HistoryButton.HoverState = ButtonState.Pressed;
                TopBorder1.Update();

                ExplorerSkin.Box.Items.Clear();
                for (int i = 0; i < HistoryList.Count; i++)
                {
                    var path = HistoryList[i];
                    var item = new LayeredPopupMenuItem(Path.GetFileName(path), path, null);
                    if (i == CurrentIndex)
                    {
                        item.Checked = true;
                        item.Bold    = true;
                        Bitmap image = Image.FromHbitmap(ExplorerSkin.RecentIcons.Frames[0].HBitmap);
                        image.MakeTransparent(Color.Black);

                        item.Image = image;
                    }
                    else if (i < CurrentIndex)
                    {
                        Bitmap image = Image.FromHbitmap(ExplorerSkin.RecentIcons.Frames[1].HBitmap);
                        image.MakeTransparent(Color.Black);
                        item.HoveredImage = image;
                    }
                    else if (i > CurrentIndex)
                    {
                        Bitmap image = Image.FromHbitmap(ExplorerSkin.RecentIcons.Frames[2].HBitmap);
                        image.MakeTransparent(Color.Black);
                        item.HoveredImage = image;
                    }
                    ExplorerSkin.Box.Items.Add(item);
                }

                ExplorerSkin.Box.Show();

                ExplorerSkin.Box.ItemClicked     += Navigate;
                ExplorerSkin.Box.PopupMenuClosed += OnRecentClose;
            }
        }