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;
}