This class displays items on a list o strings, next to each other each item is clickable and triggers the TabPressed event that provides the clicked index
Inheritance: System.Windows.Forms.Button
コード例 #1
0
        public void Init()
        {
            // draw the go back button
            _goBackButton = new YamuiButtonChar()
            {
                UseWingdings = true,
                ButtonChar   = "ç",
                FakeDisabled = true,
                Size         = new Size(27, 27),
                TabStop      = false,
            };
            _goBackButton.ButtonPressed += GoBackButtonOnButtonPressed;
            Controls.Add(_goBackButton);
            _goBackButton.Location = new Point(0, 6);


            // draw the menus
            _mainButtons = new YamuiTabButtons(CurrentMainMenuList, 0)
            {
                Font             = FontManager.GetFont(FontFunction.MenuMain),
                Height           = 32,
                SpaceBetweenText = 15,
                Location         = new Point(XOffsetTabButton, 0),
                Width            = Width - XOffsetTabButton,
                Anchor           = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right,
                TabStop          = false
            };
            _mainButtons.TabPressed += MainButtonsOnTabPressed;
            Controls.Add(_mainButtons);
            _secondaryButtons = new YamuiTabButtons(CurrentSecondaryMenuList, 0)
            {
                Font             = FontManager.GetFont(FontFunction.MenuSecondary),
                Height           = 18,
                SpaceBetweenText = 13,
                Location         = new Point(XOffsetTabButton + 15, 32),
                Width            = Width - XOffsetTabButton - 15,
                Anchor           = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right,
                TabStop          = false
            };
            _secondaryButtons.TabPressed += SecondaryButtonsOnTabPressed;
            Controls.Add(_secondaryButtons);

            // display the page
            CurrentPage = new Point(0, 0);
        }
コード例 #2
0
ファイル: YamuiForm.cs プロジェクト: jcaillon/YamuiFramework
 /// <summary>
 /// Automatically generates top links
 /// </summary>
 public void CreateTopLinks(List<string> links, EventHandler<TabPressedEventArgs> onTabPressed, int xPosFromRight = 120, int yPosFromTop = 10)
 {
     _topLinks = new YamuiTabButtons(links, -1) {
         Font = FontManager.GetFont(FontFunction.TopLink),
         Height = 15,
         SpaceBetweenText = 14,
         DrawSeparator = true,
         WriteFromRight = true,
         UseLinksColors = true,
         Anchor = AnchorStyles.Top | AnchorStyles.Right,
         TabStop = false
     };
     _topLinks.TabPressed += onTabPressed;
     _topLinks.Width = _topLinks.GetWidth() + 10;
     _topLinks.Location = new Point(Width - xPosFromRight - _topLinks.Width, yPosFromTop);
     Controls.Add(_topLinks);
 }
コード例 #3
0
ファイル: YamuiTab.cs プロジェクト: jcaillon/3P
        public void Init()
        {
            // draw the go back button
            _goBackButton = new YamuiButtonChar() {
                UseWingdings = true,
                ButtonChar = "ç",
                FakeDisabled = true,
                Size = new Size(27, 27),
                TabStop = false,
            };
            _goBackButton.ButtonPressed += GoBackButtonOnButtonPressed;
            Controls.Add(_goBackButton);
            _goBackButton.Location = new Point(0, 6);

            // draw the menus
            _mainButtons = new YamuiTabButtons(CurrentMainMenuList, 0) {
                Font = FontManager.GetFont(FontFunction.MenuMain),
                Height = 32,
                SpaceBetweenText = 15,
                Location = new Point(XOffsetTabButton, 0),
                Width = Width - XOffsetTabButton,
                Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right,
                TabStop = false
            };
            _mainButtons.TabPressed += MainButtonsOnTabPressed;
            Controls.Add(_mainButtons);
            _secondaryButtons = new YamuiTabButtons(CurrentSecondaryMenuList, 0) {
                Font = FontManager.GetFont(FontFunction.MenuSecondary),
                Height = 18,
                SpaceBetweenText = 13,
                Location = new Point(XOffsetTabButton + 15, 32),
                Width = Width - XOffsetTabButton - 15,
                Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right,
                TabStop = false
            };
            _secondaryButtons.TabPressed += SecondaryButtonsOnTabPressed;
            Controls.Add(_secondaryButtons);

            // display the page
            CurrentPage = new Point(0, 0);
        }