コード例 #1
0
 private void CreateButton(QCompositeGroup group, string title, Image image, QCompositeEventHandler onClickAction, bool isChecked)
 {
     var item = QControlUtils.CreateCompositeItem(title, image);
     item.ItemActivated += onClickAction;
     item.Checked = isChecked;
     group.Items.Add(item);
 }
コード例 #2
0
        private void CreateButton(QCompositeGroup group, string title, Image image, QCompositeEventHandler onClickAction, bool isChecked)
        {
            var item = QControlUtils.CreateCompositeItem(title, image);

            item.ItemActivated += onClickAction;
            item.Checked        = isChecked;
            group.Items.Add(item);
        }
コード例 #3
0
        internal static void CreatePanel(out QRibbonPanel panel, out QCompositeGroup composite, string title)
        {
            var currentStyle = QColorScheme.Global.CurrentTheme;

            panel = new QRibbonPanel {
                Title = title
            };
            panel.ColorScheme.RibbonPanelActiveBackground1.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelActiveBackground2.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelActiveBorder.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelBackground1.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelBackground2.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelBorder.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelCaptionArea1.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelCaptionArea2.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelCaptionShowDialog.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelCaptionShowDialogDisabled.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelCaptionShowDialogHot.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelHotBackground1.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelHotBackground2.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelHotBorder.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelHotCaptionArea1.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelHotCaptionArea2.SetColor(currentStyle, Color.Empty, false);
            panel.ColorScheme.RibbonPanelText.SetColor(currentStyle, Color.Black, false);
            panel.ColorScheme.RibbonPanelTextActive.SetColor(currentStyle, Color.Black, false);
            panel.ColorScheme.RibbonPanelTextHot.SetColor(currentStyle, Color.Black, false);
            panel.Configuration.CaptionConfiguration.ShowDialogConfiguration.Visible = QTristateBool.False;

            composite = new QCompositeGroup();
            composite.ColorScheme.ButtonPressedBackground1.SetColor(currentStyle, Color.Empty, false);
            composite.ColorScheme.ButtonPressedBackground2.SetColor(currentStyle, Color.Empty, false);
            composite.ColorScheme.CompositeItemBackground1.SetColor(currentStyle, Color.White, false);
            composite.ColorScheme.CompositeItemBackground2.SetColor(currentStyle, Color.White, false);
            composite.ColorScheme.CompositeItemHotBackground1.SetColor(currentStyle, Color.Transparent, false);
            composite.ColorScheme.CompositeItemHotBackground2.SetColor(currentStyle, Color.Transparent, false);
            composite.ColorScheme.CompositeItemHotBorder.SetColor(currentStyle, Color.Transparent, false);
            composite.ColorScheme.CompositeItemPressedBackground1.SetColor(currentStyle, Color.White, false);
            composite.ColorScheme.CompositeItemPressedBackground2.SetColor(currentStyle, Color.White, false);
            composite.ColorScheme.Scope = QColorSchemeScope.All;
            composite.Configuration.ShrinkHorizontal  = true;
            composite.Configuration.ShrinkVertical    = true;
            composite.Configuration.StretchHorizontal = true;
            composite.Configuration.StretchVertical   = true;

            panel.Items.Add(composite);
        }
コード例 #4
0
        private static QCompositeGroup GetSolidColorCompositeGroup(QPartDirection direction, Color?color, int borderWidth, bool stretchHorizontal = true, bool stretchVertical = true)
        {
            var group = new QCompositeGroup {
                Configuration = { Direction = direction }
            };

            group.Configuration.Appearance.Shape = new QShape(QBaseShapeType.SquareButton);
            if (color != null)
            {
                group.ColorScheme.CompositeItemHotBackground1.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemHotBackground2.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemExpandedBackground1.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemExpandedBackground2.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemPressedBackground1.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemPressedBackground2.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemBackground1.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemBackground2.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemDisabledBackground1.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemDisabledBackground2.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeItemPressedBorder.SetColor(QColorScheme.Global.CurrentTheme, Color.Empty);
                group.ColorScheme.CompositeItemHotBorder.SetColor(QColorScheme.Global.CurrentTheme, Color.Empty);
                group.ColorScheme.CompositeGroupBackground1.SetColor(QColorScheme.Global.CurrentTheme, color.Value);
                group.ColorScheme.CompositeGroupBackground2.SetColor(QColorScheme.Global.CurrentTheme, color.Value);

                group.Configuration.Appearance.BorderWidth = borderWidth;
            }
            if (stretchHorizontal)
            {
                group.Configuration.StretchHorizontal = true;
            }
            if (stretchVertical)
            {
                group.Configuration.StretchVertical = true;
            }
            return(group);
        }