public ButtonCollection(ButtonBlock buttonBlock)
            {
                if (buttonBlock == null)
                {
                    throw new ArgumentNullException("buttonBlock");
                }

                _buttonBlock = buttonBlock;
                _list        = new List <NuGenNavigationButton>();
            }
Exemple #2
0
        public TutorialRootBlock4()
            : base()
        {
            HContainerBlock con = new HContainerBlock();

            this.Add(con);

            button = new ButtonBlock("Hide the text");
            text   = new TextBoxBlock();
            con.Add(button);
            con.Add(text);

            button.Pushed += button_Pushed;
        }
Exemple #3
0
        public TutorialRootBlock6()
            : base()
        {
            n1 = new TutorialUniversalBlock();
            c1 = new TutorialUniversalBlock();
            c2 = new TutorialUniversalBlock();
            TutorialUniversalBlock c3 = new TutorialUniversalBlock();

            n1.VMembers.Children.Add(c1, c2, c3);
            this.Add(n1);

            ButtonBlock moveButton = new ButtonBlock("Move!!!");

            moveButton.Pushed += moveButton_Pushed;
            this.Add(moveButton);
        }
        private void InitTextLine()
        {
            UniversalBlock TextLineTest = new UniversalBlock();

            this.Children.Add(TextLineTest);

            TextLineTest.HMembers.Children.Add("labels, texts, buttons");
            HContainerBlock line = new HContainerBlock();

            TextLineTest.VMembers.Children.Add(line);

            line.Children.Add(new TextBoxBlock());

            ButtonBlock b = new ButtonBlock("focusable");

            b.MyControl.Focusable = true;
            line.Children.Add(b);

            line.Children.Add("bla");
            line.Children.Add(new TestSelectionLabelBlock("Monday"));

            TextSelectionBlock fromArray = new TextSelectionBlock(
                new string[] {
                "Montag",
                "Dienstag",
                "Mittwoch",
                "Donnerstag",
                "Freitag",
                "Samstag",
                "Sonntag"
            });

            line.Children.Add(fromArray);

            TextSelectionBlock fromEnum = new TextSelectionBlock(
                System.Windows.Forms.Keys.A);

            line.Children.Add(fromEnum);

            line.Children.Add(new TextBoxBlock());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NuGenNavigationBar"/> class.
        /// </summary>
        /// <param name="serviceProvider">
        /// <para>Requires:</para>
        /// <para><see cref="INuGenControlStateTracker"/></para>
        /// <para><see cref="INuGenNavigationBarRenderer"/></para>
        /// <para><see cref="INuGenNavigationBarLayoutManager"/></para>
        /// <para><see cref="INuGenTitleRenderer"/></para>
        /// <para><see cref="INuGenToolStripRenderer"/></para>
        /// <para><see cref="INuGenToolTipLayoutManager"/></para>
        /// <para><see cref="INuGenToolTipRenderer"/></para>
        /// <para><see cref="INuGenControlImageManager"/></para>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para>
        /// </exception>
        public NuGenNavigationBar(INuGenServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            _buttonPaneDictionary = new Dictionary <NuGenNavigationButton, NuGenNavigationPane>();
            _paneButtonDictionary = new Dictionary <NuGenNavigationPane, NuGenNavigationButton>();

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SuspendLayout();

            _buttonBlock        = new ButtonBlock(serviceProvider);
            _buttonBlock.Dock   = DockStyle.Bottom;
            _buttonBlock.Parent = this;
            _buttonBlock.SelectedButtonChanged += _buttonBlock_SelectedButtonChanged;

            _title        = new Title(serviceProvider);
            _title.Dock   = DockStyle.Top;
            _title.Parent = this;

            this.ResumeLayout(false);
        }
        private void InitAlignment()
        {
            AlignmentTestBlock = new UniversalBlock();
            AlignmentTestBlock.HMembers.Children.Add("Layout test");

            // configuration buttons
            Alignment                          = new ButtonBlock("Alignment: LeftOrTopEdge");
            OrientationButton                  = new ButtonBlock("Orientation: Vertical");
            Alignment.MyButton.Pushed         += Alignment_Pushed;
            OrientationButton.MyButton.Pushed += Orientation_Pushed;

            // ===============================================
            // init layout and set preferred properties
            // ===============================================

            layoutTest = new LayoutTestBlock();
            layout     = layoutTest.LinearLayoutStrategy;

            layout.Orientation = OrientationType.Vertical;
            layout.Alignment   = AlignmentType.LeftOrTopEdge;
            layout.XSpacing    = 24;
            layout.YSpacing    = 24;
            layout.WrapMaxSize = 950;
            layoutTest.MyControl.Box.Padding.SetLeftAndRight(16);
            layoutTest.MyControl.Box.Padding.SetTopAndBottom(32);

            layoutTest.MyControl.Layout();

            // ===============================================

            AlignmentTestBlock.VMembers.Children.Add(Alignment);
            AlignmentTestBlock.VMembers.Children.Add(OrientationButton);
            AlignmentTestBlock.VMembers.Children.Add(layoutTest);

            this.Children.Add(AlignmentTestBlock);
        }
        private void InitButtons()
        {
            UniversalBlock  ButtonsTest = new UniversalBlock();
            HContainerBlock h           = new HContainerBlock();

            ButtonsTest.HMembers.Add("Buttons");
            ButtonsTest.VMembers.Add(h);

            h.Add("Buttons: 1. text: ");
            h.Add(new ButtonBlock("caption"));
            h.Add(" 2. picture: ");
            h.Add(new ButtonBlock(PictureLibrary.Instance.Collapsed));
            h.Add(" 3. picture and text: ");
            h.Add(new ButtonBlock(PictureLibrary.Instance.Delete, "imagebutton"));
            h.Add(" 4. text and picture: ");
            h.Add(new ButtonBlock("imagebutton", PictureLibrary.Instance.Plus));

            ButtonBlock b2 = new ButtonBlock(PictureLibrary.Instance.Delete2, "under pic");

            b2.MyButton.LayoutStrategy = LayoutFactory.VerticalIndented;
            ButtonsTest.VMembers.Children.Add(b2);

            this.Children.Add(ButtonsTest);
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenNavigationBar"/> class.
		/// </summary>
		/// <param name="serviceProvider">
		/// <para>Requires:</para>
		/// <para><see cref="INuGenControlStateTracker"/></para>
		/// <para><see cref="INuGenNavigationBarRenderer"/></para>
		/// <para><see cref="INuGenNavigationBarLayoutManager"/></para>
		/// <para><see cref="INuGenTitleRenderer"/></para>
		/// <para><see cref="INuGenToolStripRenderer"/></para>
		/// <para><see cref="INuGenToolTipLayoutManager"/></para>
		/// <para><see cref="INuGenToolTipRenderer"/></para>
		/// <para><see cref="INuGenControlImageManager"/></para>
		/// </param>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenNavigationBar(INuGenServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			_buttonPaneDictionary = new Dictionary<NuGenNavigationButton, NuGenNavigationPane>();
			_paneButtonDictionary = new Dictionary<NuGenNavigationPane, NuGenNavigationButton>();

			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.Opaque, true);
			this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.SuspendLayout();

			_buttonBlock = new ButtonBlock(serviceProvider);
			_buttonBlock.Dock = DockStyle.Bottom;
			_buttonBlock.Parent = this;
			_buttonBlock.SelectedButtonChanged += _buttonBlock_SelectedButtonChanged;

			_title = new Title(serviceProvider);
			_title.Dock = DockStyle.Top;
			_title.Parent = this;

			this.ResumeLayout(false);
		}