VScrollBar VScrollBarStrategy; // Vertical scrollbar

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes the strategy field
        /// </summary>
        public Strategy_Layout(Strategy strategy)
        {
            this.strategy      = strategy;
            slots              = strategy.Slots;
            slotMinMidMax      = SlotSizeMinMidMax.mid;
            toolTip            = new ToolTip();
            flowLayoutStrategy = new FlowLayoutPanel();
            VScrollBarStrategy = new VScrollBar();
            apnlSlot           = new Panel[slots];
            pnlProperties      = new Panel();

            for (int iSlot = 0; iSlot < slots; iSlot++)
                apnlSlot[iSlot] = new Panel();

            if (bShowRemoveSlotButtons)
            {
                abtnRemoveSlot = new Button[slots];
                for (int iSlot = 0; iSlot < slots; iSlot++)
                    abtnRemoveSlot[iSlot] = new Button();
            }

            // FlowLayoutStrategy
            flowLayoutStrategy.Parent     = this;
            flowLayoutStrategy.AutoScroll = false;

            //VScrollBarStrategy
            VScrollBarStrategy.Parent  = this;
            VScrollBarStrategy.TabStop = true;
            VScrollBarStrategy.Scroll += new ScrollEventHandler(VScrollBarStrategy_Scroll);

            if (bShowAddSlotButtons)
            {
                // btnAddOpenFilter
                btnAddOpenFilter = new Button();
                btnAddOpenFilter.Tag       = strategy.OpenSlot;
                btnAddOpenFilter.Text      = Language.T("Add an Opening Logic Condition");
                btnAddOpenFilter.Margin    = new Padding(30, 0, 0, space);
                btnAddOpenFilter.UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy."));

                // btnAddCloseFilter
                btnAddCloseFilter = new Button();
                btnAddCloseFilter.Tag       = strategy.CloseSlot;
                btnAddCloseFilter.Text      = Language.T("Add a Closing Logic Condition");
                btnAddCloseFilter.Margin    = new Padding(30, 0, 0, space);
                btnAddCloseFilter.UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy."));

                // btnClosingFilterHelp
                btnClosingFilterHelp = new Button();
                btnClosingFilterHelp.Image   = Properties.Resources.info;
                btnClosingFilterHelp.Margin  = new Padding(2, 2, 0, space);
                btnClosingFilterHelp.TabStop = false;
                btnClosingFilterHelp.Click  += new EventHandler(BtnClosingFilterHelp_Click);
                btnClosingFilterHelp.UseVisualStyleBackColor = true;
            }

            return;
        }
        /// <summary>
        /// Initializes the strategy field
        /// </summary>
        public StrategyLayout(Strategy strategy)
        {
            _strategy = strategy;
            _slots = strategy.Slots;
            _slotMinMidMax = SlotSizeMinMidMax.Mid;
            _toolTip = new ToolTip();
            _flowLayoutStrategy = new FlowLayoutPanel();
            _vScrollBarStrategy = new VScrollBar();
            ApnlSlot = new Panel[_slots];
            PnlProperties = new Panel();

            for (int iSlot = 0; iSlot < _slots; iSlot++)
                ApnlSlot[iSlot] = new Panel();

            AbtnRemoveSlot = new Button[_slots];
            for (int iSlot = 0; iSlot < _slots; iSlot++)
                AbtnRemoveSlot[iSlot] = new Button();

            // FlowLayoutStrategy
            _flowLayoutStrategy.Parent = this;
            _flowLayoutStrategy.AutoScroll = false;

            //VScrollBarStrategy
            _vScrollBarStrategy.Parent = this;
            _vScrollBarStrategy.TabStop = true;
            _vScrollBarStrategy.Scroll += VScrollBarStrategyScroll;

            // btnAddOpenFilter
            BtnAddOpenFilter = new Button
                                   {
                                       Tag = strategy.OpenSlot,
                                       Text = Language.T("Add an Opening Logic Condition"),
                                       Margin = new Padding(30, 0, 0, Space),
                                       UseVisualStyleBackColor = true
                                   };
            _toolTip.SetToolTip(BtnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy."));

            // btnAddCloseFilter
            BtnAddCloseFilter = new Button
                                    {
                                        Tag = strategy.CloseSlot,
                                        Text = Language.T("Add a Closing Logic Condition"),
                                        Margin = new Padding(30, 0, 0, Space),
                                        UseVisualStyleBackColor = true
                                    };
            _toolTip.SetToolTip(BtnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy."));

            // btnClosingFilterHelp
            _btnClosingFilterHelp = new Button
                                        {
                                            Image = Resources.info,
                                            Margin = new Padding(2, 2, 0, Space),
                                            TabStop = false
                                        };
            _btnClosingFilterHelp.Click += BtnClosingFilterHelp_Click;
            _btnClosingFilterHelp.UseVisualStyleBackColor = true;
        }
示例#3
0
        /// <summary>
        ///     Initializes the strategy field
        /// </summary>
        public StrategyLayout(Strategy strategy)
        {
            this.strategy      = strategy;
            slots              = strategy.Slots;
            slotMinMidMax      = SlotSizeMinMidMax.Mid;
            toolTip            = new ToolTip();
            flowLayoutStrategy = new FlowLayoutPanel();
            vScrollBarStrategy = new VScrollBar();
            ApnlSlot           = new Panel[slots];
            PnlProperties      = new Panel();

            for (int iSlot = 0; iSlot < slots; iSlot++)
            {
                ApnlSlot[iSlot] = new Panel();
            }

            AbtnRemoveSlot = new Button[slots];
            for (int iSlot = 0; iSlot < slots; iSlot++)
            {
                AbtnRemoveSlot[iSlot] = new Button();
            }

            // FlowLayoutStrategy
            flowLayoutStrategy.Parent     = this;
            flowLayoutStrategy.AutoScroll = false;

            //VScrollBarStrategy
            vScrollBarStrategy.Parent  = this;
            vScrollBarStrategy.TabStop = true;
            vScrollBarStrategy.Scroll += VScrollBarStrategyScroll;

            // btnAddOpenFilter
            BtnAddOpenFilter = new Button
            {
                Tag    = strategy.OpenSlot,
                Text   = Language.T("Add an Opening Logic Condition"),
                Margin = new Padding(30, 0, 0, Space),
                UseVisualStyleBackColor = true
            };
            toolTip.SetToolTip(BtnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy."));

            // btnAddCloseFilter
            BtnAddCloseFilter = new Button
            {
                Tag    = strategy.CloseSlot,
                Text   = Language.T("Add a Closing Logic Condition"),
                Margin = new Padding(30, 0, 0, Space),
                UseVisualStyleBackColor = true
            };
            toolTip.SetToolTip(BtnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy."));

            // btnClosingFilterHelp
            btnClosingFilterHelp = new Button
            {
                Image   = Resources.info,
                Margin  = new Padding(2, 2, 0, Space),
                TabStop = false
            };
            btnClosingFilterHelp.Click += BtnClosingFilterHelp_Click;
            btnClosingFilterHelp.UseVisualStyleBackColor = true;
        }
        /// <summary>
        /// Initializes the strategy field
        /// </summary>
        public Strategy_Layout(Strategy strategy)
        {
            this.strategy      = strategy;
            slots              = strategy.Slots;
            slotMinMidMax      = SlotSizeMinMidMax.mid;
            toolTip            = new ToolTip();
            flowLayoutStrategy = new FlowLayoutPanel();
            VScrollBarStrategy = new VScrollBar();
            apnlSlot           = new Panel[slots];
            pnlProperties      = new Panel();

            for (int slot = 0; slot < slots; slot++)
            {
                apnlSlot[slot] = new Panel();
            }

            if (showRemoveSlotButtons)
            {
                abtnRemoveSlot = new Button[slots];
                for (int iSlot = 0; iSlot < slots; iSlot++)
                {
                    abtnRemoveSlot[iSlot] = new Button();
                }
            }

            // FlowLayoutStrategy
            flowLayoutStrategy.Parent     = this;
            flowLayoutStrategy.AutoScroll = false;

            //VScrollBarStrategy
            VScrollBarStrategy.Parent  = this;
            VScrollBarStrategy.TabStop = true;
            VScrollBarStrategy.Scroll += new ScrollEventHandler(VScrollBarStrategy_Scroll);

            if (showAddSlotButtons)
            {
                // btnAddOpenFilter
                btnAddOpenFilter        = new Button();
                btnAddOpenFilter.Tag    = strategy.OpenSlot;
                btnAddOpenFilter.Text   = Language.T("Add an Opening Logic Condition");
                btnAddOpenFilter.Margin = new Padding(30, 0, 0, space);
                btnAddOpenFilter.UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy."));

                // btnAddCloseFilter
                btnAddCloseFilter        = new Button();
                btnAddCloseFilter.Tag    = strategy.CloseSlot;
                btnAddCloseFilter.Text   = Language.T("Add a Closing Logic Condition");
                btnAddCloseFilter.Margin = new Padding(30, 0, 0, space);
                btnAddCloseFilter.UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy."));

                // btnClosingFilterHelp
                btnClosingFilterHelp         = new Button();
                btnClosingFilterHelp.Image   = Properties.Resources.info;
                btnClosingFilterHelp.Margin  = new Padding(2, 2, 0, space);
                btnClosingFilterHelp.TabStop = false;
                btnClosingFilterHelp.Click  += new EventHandler(BtnClosingFilterHelp_Click);
                btnClosingFilterHelp.UseVisualStyleBackColor = true;
            }

            return;
        }