Пример #1
0
 protected override bool OnButtonPressEvent(Gdk.EventButton e)
 {
     if (e.Button == 3)
     {
         StatusBox.ShowNavigationBarContextMenu();
         return(true);
     }
     if (e.Type == Gdk.EventType.ButtonPress)
     {
         if (window != null)
         {
             DestroyWindow();
         }
         else
         {
             this.GrabFocus();
             if (DataProvider != null)
             {
                 DataProvider.Reset();
                 if (DataProvider.IconCount > 0)
                 {
                     window = new DropDownBoxListWindow(this);
                     PositionListWindow();
                     window.SelectItem(CurrentItem);
                 }
             }
         }
     }
     return(base.OnButtonPressEvent(e));
 }
Пример #2
0
        public NavigationBar(SourceEditorWidget editor) : base(false, 0)
        {
            PropertyService.AddPropertyHandler("HideCaretStatusBox", PropertyHandler);
            this.Editor               = editor;
            this.BorderWidth          = 0;
            this.Spacing              = 0;
            typeCombo.DataProvider    = new TypeDataProvider(this);
            typeCombo.ItemSet        += TypeChanged;
            typeCombo.DrawRightBorder = true;
            UpdateTypeComboTip(null);
            this.PackStart(typeCombo);

            membersCombo.DataProvider    = new MemberDataProvider(this);
            membersCombo.ItemSet        += MemberChanged;
            membersCombo.DrawRightBorder = true;
            UpdateMemberComboTip(null);
            this.PackStart(membersCombo);

            regionCombo.DataProvider    = new RegionDataProvider(this);
            regionCombo.ItemSet        += RegionChanged;
            regionCombo.DrawRightBorder = true;
            UpdateRegionComboTip(null);
            this.PackStart(regionCombo);

            statusBox = new StatusBox(editor);
            this.PackStart(statusBox, false, false, 0);

            int w, h;

            Gtk.Icon.SizeLookup(IconSize.Menu, out w, out h);
            typeCombo.DefaultIconHeight = membersCombo.DefaultIconHeight = regionCombo.DefaultIconHeight = Math.Max(h, 16);
            typeCombo.DefaultIconWidth  = membersCombo.DefaultIconWidth = regionCombo.DefaultIconWidth = Math.Max(w, 16);

            this.FocusChain = new Widget[] { typeCombo, membersCombo, regionCombo };
            this.ShowAll();
            regionCombo.DrawRightBorder = statusBox.Visible = !HideStatusBox;
        }