Beispiel #1
0
        /// <summary>
        /// Initialise a new instance of the KryptonWorkspaceCell class.
        /// </summary>
        /// <param name="starSize">Initial star sizing value.</param>
        public KryptonWorkspaceCell(string starSize)
        {
            // Change Navigator defaults to workspace requirements
            AllowPageDrag = true;
            AllowTabFocus = false;

            // Initialize internal fields
            _disposeOnRemove = true;
            _setVisible      = true;
            _starSize        = new StarSize(starSize);
            _allowResizing   = true;
            _uniqueName      = CommonHelper.UniqueString;

            // We need to know when the set of pages has changed
            Pages.Cleared  += new EventHandler(OnPagesChanged);
            Pages.Removed  += new TypedHandler <KryptonPage>(OnPagesChanged);
            Pages.Inserted += new TypedHandler <KryptonPage>(OnPagesChanged);
            _events         = true;

            // Add a button spec used to handle maximize/restore functionality
            _maxamizeRestoreButton        = new ButtonSpecNavigator();
            _maxamizeRestoreButton.Type   = PaletteButtonSpecStyle.WorkspaceMaximize;
            _maxamizeRestoreButton.Click += new EventHandler(OnMaximizeRestoreButtonClicked);
            Button.ButtonSpecs.Add(_maxamizeRestoreButton);
        }
        /// <summary>
        /// Initialise a new instance of the KryptonWorkspaceSequence class.
        /// </summary>
        /// <param name="orientation">Initial orientation of the children.</param>
        public KryptonWorkspaceSequence(Orientation orientation)
        {
            _orientation = orientation;

            // Create the child collection for holding items
            _children = new KryptonWorkspaceCollection(this);
            _children.PropertyChanged        += new PropertyChangedEventHandler(OnChildrenPropertyChanged);
            _children.MaximizeRestoreClicked += new EventHandler(OnChildrenMaximizeRestoreClicked);

            // Default properties
            _setVisible = true;
            _starSize   = new StarSize();
            _actualSize = Size.Empty;
            _uniqueName = CommonHelper.UniqueString;
        }