Example #1
0
        public SingleSelectorEditorForm(SelectorTypes selectorType)
        {
            InitializeComponent();
            _repWkr = RepositoryWorker.Instance();
            ItemSelector item;

            flp_items.Controls.Clear();
            switch (selectorType)
            {
            case SelectorTypes.Actions:
                for (int i = 0; i < _repWkr.Actions.Count; i++)
                {
                    item        = new ItemSelector(_repWkr.Actions[i].Id, _repWkr.Actions[i].Icon, _repWkr.Actions[i].Name);
                    item.Click += Item_Click;
                    flp_items.Controls.Add(item);
                }
                break;

            case SelectorTypes.Effects:
                for (int i = 0; i < _repWkr.Effects.Count; i++)
                {
                    item        = new ItemSelector(_repWkr.Effects[i].Id, _repWkr.Effects[i].Icon, _repWkr.Effects[i].Name);
                    item.Click += Item_Click;
                    flp_items.Controls.Add(item);
                }
                break;

            default:
                break;
            }
            item = null;
        }
Example #2
0
        public SingleSelectorEditorForm(SelectorTypes selectorType, int[] ids)
        {
            InitializeComponent();
            if (ids == null || ids.Length == 0)
            {
                return;
            }
            _repWkr = RepositoryWorker.Instance();
            ItemSelector item;

            flp_items.Controls.Clear();
            switch (selectorType)
            {
            case SelectorTypes.ActionsCustom:
                for (int i = 0; i < ids.Length; i++)
                {
                    var act = _repWkr.GetAction(ids[i]);
                    item        = new ItemSelector(act.Id, act.Icon, act.Name);
                    item.Click += Item_Click;
                    flp_items.Controls.Add(item);
                }
                break;

            default:
                break;
            }
            item = null;
        }
Example #3
0
        void Selector(out SelectorTypes selectorType,
                      out ModifierTypes modifierType)
        {
            SelectorTypes type; ModifierTypes modifierResult;

            Expect(2);
            selectorType = SelectorTypes.Unknown;
            Modifier(out modifierResult);
            modifierType = modifierResult;
        }
Example #4
0
        public MultiSelectorEditorForm(SelectorTypes selectorType, object value)
        {
            InitializeComponent();
            _repWkr = RepositoryWorker.Instance();

            if (value != null)
            {
                var obj = (int[])value;
                for (int i = 0; i < obj.Length; i++)
                {
                    Ids.Add(obj[i]);
                }
            }

            flp_items.Controls.Clear();
            ItemMultiSelector item;

            switch (selectorType)
            {
            case SelectorTypes.Actions:
                for (int i = 0; i < _repWkr.Actions.Count; i++)
                {
                    item = new ItemMultiSelector(
                        _repWkr.Actions[i].Id,
                        _repWkr.Actions[i].Icon,
                        _repWkr.Actions[i].Name,
                        Ids.Any(x => x == _repWkr.Actions[i].Id)
                        );
                    item.ItemMultiSelectorCBChanged += Item_ItemMultiSelectorCBChanged;
                    flp_items.Controls.Add(item);
                }
                break;

            case SelectorTypes.Effects:
                for (int i = 0; i < _repWkr.Effects.Count; i++)
                {
                    item = new ItemMultiSelector(
                        _repWkr.Effects[i].Id,
                        _repWkr.Effects[i].Icon,
                        _repWkr.Effects[i].Name + " | " + _repWkr.Effects[i].Chance + " | " + _repWkr.Effects[i].Turns + " | " + _repWkr.Effects[i].Mod,
                        Ids.Any(x => x == _repWkr.Effects[i].Id)
                        );
                    item.ItemMultiSelectorCBChanged += Item_ItemMultiSelectorCBChanged;
                    flp_items.Controls.Add(item);
                }
                break;

            default:
                break;
            }


            item = null;
        }
Example #5
0
        /// <summary>Draws the selector.</summary>
        /// <param name="graphics">The specified graphics to draw on.</param>
        /// <param name="selectorType">The selector Type.</param>
        private void DrawSelector(Graphics graphics, SelectorTypes selectorType)
        {
            if (_selectorVisible)
            {
                try
                {
                    for (var tabIndex = 0; tabIndex <= TabCount - 1; tabIndex++)
                    {
                        VisualTabPage _tabPage = (VisualTabPage)TabPages[tabIndex];
                        _tabPage.Rectangle = GetStyledTabRectangle(tabIndex);

                        if (tabIndex == SelectedIndex)
                        {
                            switch (selectorType)
                            {
                            case SelectorTypes.Arrow:
                            {
                                DrawSelectorArrow(graphics, _tabPage.Rectangle);
                                break;
                            }

                            case SelectorTypes.Line:
                            {
                                DrawSelectorLine(graphics, _tabPage.Rectangle);
                                break;
                            }

                            default:
                            {
                                throw new ArgumentOutOfRangeException(nameof(selectorType), selectorType, null);
                            }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Logger.WriteDebug(e);
                }
            }
        }
        /// <summary>Initializes a new instance of the <see cref="VisualTabControl" /> class.</summary>
        public VisualTabControl()
        {
            SetStyle(
                ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
                ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.SupportsTransparentBackColor,
                true);

            UpdateStyles();

            _styleManager = new StyleManager(Settings.DefaultValue.DefaultStyle);

            _border = new Border
            {
                Type = ShapeType.Rectangle
            };

            _alignment         = TabAlignment.Top;
            _selectorVisible   = true;
            _selectorSpacing   = 10;
            _selectorThickness = 5;
            _selectorAlignment = TabAlignment.Bottom;

            _itemSize         = new Size(100, 25);
            _tabMenu          = Color.FromArgb(55, 61, 73);
            _tabSelector      = _styleManager.Theme.BackgroundSettings.Type4;
            _textRendererHint = Settings.DefaultValue.TextRenderingHint;

            _separatorSpacing   = 2;
            _separatorThickness = 2F;
            _separator          = _styleManager.Theme.OtherSettings.Line;
            _selectorTypes      = SelectorTypes.Arrow;

            Size     = new Size(320, 160);
            DrawMode = TabDrawMode.OwnerDrawFixed;
            ItemSize = _itemSize;
        }
Example #7
0
 public SelectorExpression(SelectorTypes field, ModifierTypes modifier, ExpressionTreeBase left) : this()
 {
     NodeType = field;
     Modifier = modifier;
     SetLeft(left);
 }
Example #8
0
 public SelectorExpression(SelectorTypes field, ModifierTypes modifier) : this()
 {
     NodeType = field;
     Modifier = modifier;
 }
Example #9
0
 internal void SetNodeType(SelectorTypes nodeType)
 {
     NodeType = nodeType;
 }
Example #10
0
 public SelectorExpression(SelectorTypes field, ModifierTypes modifier, ExpressionTreeBase left) : this()
 {
     NodeType = field;
     Modifier = modifier;
     SetLeft( left );
 }
Example #11
0
 public SelectorExpression(SelectorTypes field, ModifierTypes modifier) : this()
 {
     NodeType = field;
     Modifier = modifier;
 }
Example #12
0
 public static bool ModifiersAllowed(SelectorTypes type)
 {
     return(_allowedModifiers.ContainsKey(type) ? _allowedModifiers[type] : false);
 }
Example #13
0
 public SelectorGroup(IEnumerable<LogicalItem> children, SelectorTypes? selector)
 {
     Children = children.ToArray();
     Selector = selector;
 }
Example #14
0
 public SelectorExpression(SelectorTypes field, ModifierTypes modifier)
 {
     Field = field;
     Modifier = modifier;
 }
Example #15
0
	void Selector(out SelectorTypes selectorType, 
out ModifierTypes modifierType) {
		SelectorTypes type; ModifierTypes modifierResult; 
		Expect(2);
		selectorType = SelectorTypes.Unknown; 
		Modifier(out modifierResult);
		modifierType = modifierResult; 
	}
Example #16
0
 internal void SetNodeType(SelectorTypes nodeType)
 {
     NodeType = nodeType;
 }
Example #17
0
 public static bool ModifiersAllowed(SelectorTypes type)
 {
     return _allowedModifiers.ContainsKey(type) ? _allowedModifiers[type] : false;
 }
Example #18
0
 public SelectorExpression(SelectorTypes field, ModifierTypes modifier)
 {
     Field    = field;
     Modifier = modifier;
 }