public int Add(ToolBarEx toolBar)
        {
            // Remove place Holder ToolBar
              // -- This toolbar makes sure Rebar has
              // some minimum height while on designig time
              if ( parentRebar.PlaceHolderAdded )
            parentRebar.RemovePlaceHolder();

              if (Contains(toolBar)) return -1;
              int index = InnerList.Add(toolBar);

              // Set ToolBar parent rebar
              toolBar.m_parent = parentRebar;
              RaiseChanged();
              return index;
        }
Пример #2
0
    public void Remove(ToolBarEx toolBar)
    {
      // Remove band from the native rebar controls first
      parentRebar.RemoveBand(IndexOf(toolBar));
      // Remove it from the collection
      InnerList.Remove(toolBar);
      toolBar.m_parent = null;

      // Inform listeners to update
      RaiseChanged();   

      // If we don't have any bands left, add
      // flag that we need to add the "place holder toolbar
      // --it will be added later when the sizing "sticks"
      if ( InnerList.Count == 0 && parentRebar.PlaceHolderAdded == false )
        parentRebar.AddPlaceHolderToolBar = true;
    }
 public ToolBarItemCollection( ToolBarEx parent )
 {
     parentToolBar = parent;
 }
 public int IndexOf(ToolBarEx toolBar)
 {
     return InnerList.IndexOf(toolBar);
 }
 public bool Contains(ToolBarEx toolBar)
 {
     return InnerList.Contains(toolBar);
 }
Пример #6
0
        internal void AddPlaceHolder()
        {
            placeHolderAdded = true;

              // Add place holder toolBar for designer support
              if ( placeHolderToolBar == null )
              {
            placeHolderToolBar = new ToolBarEx();
            placeHolderToolBar.m_parent = this;
              }

              REBARBANDINFO bandInfo = GetBandInfo(0, placeHolderToolBar);
              int result = WindowsAPI.SendMessage(Handle, (int)RebarMessages.RB_INSERTBANDW, 0, ref bandInfo);
        }