/// <summary> /// Make a form /// </summary> public Strategy_Publish() { pnlBBCodeBase = new Fancy_Panel(); pnlInfoBase = new Fancy_Panel(); txboxBBCode = new TextBox(); lblInformation = new Label(); btnClose = new Button(); btnConnect = new Button(); // BBCode_viewer AcceptButton = btnClose; BackColor = LayoutColors.ColorFormBack; Icon = Data.Icon; Controls.Add(btnConnect); Controls.Add(btnClose); Controls.Add(pnlBBCodeBase); Controls.Add(pnlInfoBase); MinimumSize = new System.Drawing.Size(400, 400); Text = Language.T("Publish a Strategy"); pnlBBCodeBase.Padding = new Padding(4, 4, 2, 2); pnlInfoBase.Padding = new Padding(4, 4, 2, 2); // txboxBBCode txboxBBCode.Parent = pnlBBCodeBase; txboxBBCode.BorderStyle = BorderStyle.None; txboxBBCode.Dock = DockStyle.Fill; txboxBBCode.BackColor = LayoutColors.ColorControlBack; txboxBBCode.ForeColor = LayoutColors.ColorControlText; txboxBBCode.Multiline = true; txboxBBCode.AcceptsReturn = true; txboxBBCode.AcceptsTab = true; txboxBBCode.ScrollBars = ScrollBars.Vertical; txboxBBCode.KeyDown += new KeyEventHandler(TxboxBBCode_KeyDown); txboxBBCode.Text = Data.Strategy.GenerateBBCode(); // lblInformation lblInformation.Parent = pnlInfoBase; lblInformation.Dock = DockStyle.Fill; lblInformation.BackColor = Color.Transparent; lblInformation.ForeColor = LayoutColors.ColorControlText; string strInfo = Language.T("Publishing a strategy in the program's forum:") + Environment.NewLine + "1) " + Language.T("Open a new topic in the forum") + " \"Trading Strategies\";" + Environment.NewLine + "2) " + Language.T("Copy / Paste the following code;") + Environment.NewLine + "3) " + Language.T("Describe the strategy."); lblInformation.Text = strInfo; // btnClose btnClose.Text = Language.T("Close"); btnClose.Click += new System.EventHandler(btnClose_Click); btnClose.UseVisualStyleBackColor = true; // btnConnect btnConnect.Text = Language.T("Connect to") + " http://forexsb.com/forum"; btnConnect.Click += new System.EventHandler(btnConnect_Click); btnConnect.UseVisualStyleBackColor = true; }
/// <summary> /// Public Constructor /// </summary> public Fancy_Message_Box(string text, string title) { pnlBase = new Fancy_Panel(); pnlControl = new Panel(); browser = new WebBrowser(); btnClose = new Button(); Text = title; Icon = Data.Icon; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; TopMost = true; AcceptButton = btnClose; pnlBase.Parent = this; browser.Parent = pnlBase; browser.AllowNavigation = false; browser.AllowWebBrowserDrop = false; browser.DocumentText = GetText(text, title); browser.Dock = DockStyle.Fill; browser.TabStop = false; browser.IsWebBrowserContextMenuEnabled = false; browser.WebBrowserShortcutsEnabled = true; pnlControl.Parent = this; pnlControl.Dock = DockStyle.Bottom; pnlControl.BackColor = Color.Transparent; btnClose.Parent = pnlControl; btnClose.Text = Language.T("Close"); btnClose.Name = "Close"; btnClose.Click += new EventHandler(BtnClose_Click); btnClose.UseVisualStyleBackColor = true; }
/// <summary> /// Constructor /// </summary> public Strategy_Properties() { pnlAveraging = new Fancy_Panel(Language.T("Handling of Additional Entry Signals"), LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText); pnlAmounts = new Fancy_Panel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText); pnlProtection = new Fancy_Panel(Language.T("Permanent Protection"), LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText); lblPercent1 = new Label(); lblPercent2 = new Label(); lblPercent3 = new Label(); lblAveragingSameDir = new Label(); lblAveragingOppDir = new Label(); cbxSameDirAction = new ComboBox(); cbxOppDirAction = new ComboBox(); nudMaxOpenLots = new NumericUpDown(); rbConstantUnits = new RadioButton(); rbVariableUnits = new RadioButton(); nudEntryLots = new NumericUpDown(); nudAddingLots = new NumericUpDown(); nudReducingLots = new NumericUpDown(); lblMaxOpenLots = new Label(); lblEntryLots = new Label(); lblAddingLots = new Label(); lblReducingLots = new Label(); chbPermaSL = new CheckBox(); cbxPermaSLType = new ComboBox(); nudPermaSL = new NumericUpDown(); chbPermaTP = new CheckBox(); cbxPermaTPType = new ComboBox(); nudPermaTP = new NumericUpDown(); chbBreakEven = new CheckBox(); nudBreakEven = new NumericUpDown(); btnDefault = new Button(); btnCancel = new Button(); btnAccept = new Button(); font = this.Font; colorText = LayoutColors.ColorControlText; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; Icon = Data.Icon; BackColor = LayoutColors.ColorFormBack; FormBorderStyle = FormBorderStyle.FixedDialog; AcceptButton = btnAccept; Text = Language.T("Strategy Properties"); // pnlAveraging pnlAveraging.Parent = this; // pnlAmounts pnlAmounts.Parent = this; // pnlProtection pnlProtection.Parent = this; // Label Same dir action lblAveragingSameDir.Parent = pnlAveraging; lblAveragingSameDir.ForeColor = colorText; lblAveragingSameDir.BackColor = Color.Transparent; lblAveragingSameDir.AutoSize = true; lblAveragingSameDir.Text = Language.T("Next same direction signal behaviour"); // Label Opposite dir action lblAveragingOppDir.Parent = pnlAveraging; lblAveragingOppDir.ForeColor = colorText; lblAveragingOppDir.BackColor = Color.Transparent; lblAveragingOppDir.AutoSize = true; lblAveragingOppDir.Text = Language.T("Next opposite direction signal behaviour"); // ComboBox SameDirAction cbxSameDirAction.Parent = pnlAveraging; cbxSameDirAction.Name = "cbxSameDirAction"; cbxSameDirAction.DropDownStyle = ComboBoxStyle.DropDownList; cbxSameDirAction.Items.AddRange(new string[] { Language.T("Nothing"), Language.T("Winner"), Language.T("Add") }); cbxSameDirAction.SelectedIndex = 0; toolTip.SetToolTip(cbxSameDirAction, Language.T("Nothing - cancels the additional orders.") + Environment.NewLine + Language.T("Winner - adds to a winning position.") + Environment.NewLine + Language.T("Add - adds to all positions.")); // ComboBox OppDirAction cbxOppDirAction.Parent = pnlAveraging; cbxOppDirAction.Name = "cbxOppDirAction"; cbxOppDirAction.DropDownStyle = ComboBoxStyle.DropDownList; cbxOppDirAction.Items.AddRange(new string[] { Language.T("Nothing"), Language.T("Reduce"), Language.T("Close"), Language.T("Reverse") }); cbxOppDirAction.SelectedIndex = 0; toolTip.SetToolTip(cbxOppDirAction, Language.T("Nothing - cancels the additional orders.") + Environment.NewLine + Language.T("Reduce - reduces or closes a position.") + Environment.NewLine + Language.T("Close - closes the position.") + Environment.NewLine + Language.T("Reverse - reverses the position.")); // Label MaxOpen Lots lblMaxOpenLots.Parent = pnlAmounts; lblMaxOpenLots.ForeColor = colorText; lblMaxOpenLots.BackColor = Color.Transparent; lblMaxOpenLots.AutoSize = true; lblMaxOpenLots.Text = Language.T("Maximum number of open lots"); // NumericUpDown MaxOpen Lots nudMaxOpenLots.Parent = pnlAmounts; nudMaxOpenLots.Name = "nudMaxOpenLots"; nudMaxOpenLots.BeginInit(); nudMaxOpenLots.Minimum = 0.01M; nudMaxOpenLots.Maximum = 100; nudMaxOpenLots.Increment = 0.01M; nudMaxOpenLots.Value = (decimal)dMaxOpenLots; nudMaxOpenLots.DecimalPlaces = 2; nudMaxOpenLots.TextAlign = HorizontalAlignment.Center; nudMaxOpenLots.EndInit(); // Radio Button Constant Units rbConstantUnits.Parent = pnlAmounts; rbConstantUnits.ForeColor = colorText; rbConstantUnits.BackColor = Color.Transparent; rbConstantUnits.Checked = !UseAccountPercentEntry; rbConstantUnits.AutoSize = true; rbConstantUnits.Name = "rbConstantUnits"; rbConstantUnits.Text = Language.T("Trade a constant number of lots"); // Radio Button Variable Units rbVariableUnits.Parent = pnlAmounts; rbVariableUnits.ForeColor = colorText; rbVariableUnits.BackColor = Color.Transparent; rbVariableUnits.Checked = UseAccountPercentEntry; rbVariableUnits.AutoSize = false; rbVariableUnits.Name = "rbVariableUnits"; rbVariableUnits.Text = Language.T("Trade a variable number of lots depending on your current account equity. The percentage values show the part of the account equity used to cover the required margin."); // Label Entry Lots lblEntryLots.Parent = pnlAmounts; lblEntryLots.ForeColor = colorText; lblEntryLots.BackColor = Color.Transparent; lblEntryLots.AutoSize = true; lblEntryLots.Text = Language.T("Number of entry lots for a new position"); // NumericUpDown Entry Lots nudEntryLots.Parent = pnlAmounts; nudEntryLots.Name = "nudEntryLots"; nudEntryLots.BeginInit(); nudEntryLots.Minimum = 0.01M; nudEntryLots.Maximum = 100; nudEntryLots.Increment = 0.01M; nudEntryLots.Value = (decimal)dEntryLots; nudEntryLots.DecimalPlaces = 2; nudEntryLots.TextAlign = HorizontalAlignment.Center; nudEntryLots.EndInit(); // Label Entry Lots % lblPercent1.Parent = pnlAmounts; lblPercent1.ForeColor = colorText; lblPercent1.BackColor = Color.Transparent; lblPercent1.AutoSize = true; lblPercent1.Text = "%"; // Label Adding Lots lblAddingLots.Parent = pnlAmounts; lblAddingLots.ForeColor = colorText; lblAddingLots.BackColor = Color.Transparent; lblAddingLots.AutoSize = true; lblAddingLots.Text = Language.T("In case of addition - number of lots to add"); // NumericUpDown Adding Lots nudAddingLots.Parent = pnlAmounts; nudAddingLots.Name = "nudAddingLots"; nudAddingLots.BeginInit(); nudAddingLots.Minimum = 0.01M; nudAddingLots.Maximum = 100; nudAddingLots.Increment = 0.01M; nudAddingLots.Value = (decimal)dAddingLots; nudAddingLots.DecimalPlaces = 2; nudAddingLots.TextAlign = HorizontalAlignment.Center; nudAddingLots.EndInit(); // Label Adding Lots % lblPercent2.Parent = pnlAmounts; lblPercent2.ForeColor = colorText; lblPercent2.BackColor = Color.Transparent; lblPercent2.AutoSize = true; lblPercent2.Text = "%"; // Label Reducing Lots lblReducingLots.Parent = pnlAmounts; lblReducingLots.ForeColor = colorText; lblReducingLots.BackColor = Color.Transparent; lblReducingLots.AutoSize = true; lblReducingLots.Text = Language.T("In case of reduction - number of lots to close"); // NumericUpDown Reducing Lots nudReducingLots.Parent = pnlAmounts; nudReducingLots.Name = "nudReducingLots"; nudReducingLots.BeginInit(); nudReducingLots.Minimum = 0.01M; nudReducingLots.Maximum = 100; nudReducingLots.Increment = 0.01M; nudReducingLots.Value = (decimal)dReducingLots; nudReducingLots.DecimalPlaces = 2; nudReducingLots.TextAlign = HorizontalAlignment.Center; nudReducingLots.EndInit(); // Label Reducing Lots % lblPercent3.Parent = pnlAmounts; lblPercent3.ForeColor = colorText; lblPercent3.BackColor = Color.Transparent; lblPercent3.AutoSize = true; lblPercent3.Text = "%"; // CheckBox Permanent Stop Loss chbPermaSL.Parent = pnlProtection; chbPermaSL.ForeColor = colorText; chbPermaSL.BackColor = Color.Transparent; chbPermaSL.AutoCheck = true; chbPermaSL.AutoSize = true; chbPermaSL.Name = "chbPermaSL"; chbPermaSL.Text = Language.T("Permanent Stop Loss"); // ComboBox cbxPermaSLType cbxPermaSLType.Parent = pnlProtection; cbxPermaSLType.Name = "cbxPermaSLType"; cbxPermaSLType.Visible = false; cbxPermaSLType.DropDownStyle = ComboBoxStyle.DropDownList; cbxPermaSLType.Items.AddRange(new string[] { Language.T("Relative"), Language.T("Absolute") }); cbxPermaSLType.SelectedIndex = 0; // NumericUpDown Permanent S/L nudPermaSL.Parent = pnlProtection; nudPermaSL.Name = "nudPermaSL"; nudPermaSL.BeginInit(); nudPermaSL.Minimum = 5; nudPermaSL.Maximum = 5000; nudPermaSL.Increment = 1; nudPermaSL.Value = iPermSL; nudPermaSL.TextAlign = HorizontalAlignment.Center; nudPermaSL.EndInit(); // CheckBox Permanent Take Profit chbPermaTP.Parent = pnlProtection; chbPermaTP.ForeColor = colorText; chbPermaTP.BackColor = Color.Transparent; chbPermaTP.AutoCheck = true; chbPermaTP.AutoSize = true; chbPermaTP.Name = "chbPermaTP"; chbPermaTP.Text = Language.T("Permanent Take Profit"); // ComboBox cbxPermaTPType cbxPermaTPType.Parent = pnlProtection; cbxPermaTPType.Name = "cbxPermaTPType"; cbxPermaTPType.Visible = false; cbxPermaTPType.DropDownStyle = ComboBoxStyle.DropDownList; cbxPermaTPType.Items.AddRange(new string[] { Language.T("Relative"), Language.T("Absolute") }); cbxPermaTPType.SelectedIndex = 0; // NumericUpDown Permanent Take Profit nudPermaTP.Parent = pnlProtection; nudPermaTP.Name = "nudPermaTP"; nudPermaTP.BeginInit(); nudPermaTP.Minimum = 5; nudPermaTP.Maximum = 5000; nudPermaTP.Increment = 1; nudPermaTP.Value = iPermTP; nudPermaTP.TextAlign = HorizontalAlignment.Center; nudPermaTP.EndInit(); // CheckBox Break Even chbBreakEven.Parent = pnlProtection; chbBreakEven.ForeColor = colorText; chbBreakEven.BackColor = Color.Transparent; chbBreakEven.AutoCheck = true; chbBreakEven.AutoSize = true; chbBreakEven.Name = "chbBreakEven"; chbBreakEven.Text = Language.T("Break Even") + " [" + Language.T("pips") + "]"; // NumericUpDown Break Even nudBreakEven.Parent = pnlProtection; nudBreakEven.Name = "nudBreakEven"; nudBreakEven.BeginInit(); nudBreakEven.Minimum = 5; nudBreakEven.Maximum = 5000; nudBreakEven.Increment = 1; nudBreakEven.Value = iBreakEven; nudBreakEven.TextAlign = HorizontalAlignment.Center; nudBreakEven.EndInit(); //Button Default btnDefault.Parent = this; btnDefault.Name = "Default"; btnDefault.Text = Language.T("Default"); btnDefault.Click += new EventHandler(BtnDefault_Click); btnDefault.UseVisualStyleBackColor = true; //Button Cancel btnCancel.Parent = this; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.UseVisualStyleBackColor = true; //Button Accept btnAccept.Parent = this; btnAccept.Name = "Accept"; btnAccept.Text = Language.T("Accept"); btnAccept.DialogResult = DialogResult.OK; btnAccept.UseVisualStyleBackColor = true; return; }
/// <summary> /// Sets the controls in tabPageStatus /// </summary> void Initialize_PageStatus() { // tabPageStatus tabPageStatus.Name = "tabPageStatus"; tabPageStatus.Text = Language.T("Status"); tabPageStatus.ImageIndex = 0; tabPageStatus.Resize += new EventHandler(TabPageStatus_Resize); // Panel Connection pnlConnection = new Fancy_Panel(Language.T("Connection Status")); pnlConnection.Parent = tabPageStatus; // lblConnection lblConnection = new Label(); lblConnection.Name = "lblConnection"; lblConnection.Parent = pnlConnection; lblConnection.Text = Language.T("Not Connected. You have to connect to a MetaTrader terminal."); lblConnection.TextAlign = ContentAlignment.MiddleLeft; // Panel Data Info pnlDataInfoBase = new Fancy_Panel(Language.T("Data Info")); pnlDataInfoBase.Parent = tabPageStatus; pnlDataInfoBase.Padding = new Padding(2, (int)pnlDataInfoBase.CaptionHeight, 2, 2); tbxDataInfo = new TextBox(); tbxDataInfo.Parent = pnlDataInfoBase; tbxDataInfo.BorderStyle = BorderStyle.None; tbxDataInfo.Dock = DockStyle.Fill; tbxDataInfo.TabStop = false; tbxDataInfo.Multiline = true; tbxDataInfo.AcceptsReturn = true; tbxDataInfo.AcceptsTab = true; tbxDataInfo.WordWrap = false; tbxDataInfo.ScrollBars = ScrollBars.Vertical; tbxDataInfo.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204))); pnlDataInfoButtons = new Panel(); pnlDataInfoButtons.Parent = pnlDataInfoBase; pnlDataInfoButtons.Dock = DockStyle.Top; pnlDataInfoButtons.Paint += new PaintEventHandler(PnlDataInfoButtons_Paint); btnShowMarketInfo = new Button(); btnShowMarketInfo.Parent = pnlDataInfoButtons; btnShowMarketInfo.Text = Language.T("Market Info"); btnShowMarketInfo.Click += new EventHandler(BtnShowMarketInfo_Click); btnShowMarketInfo.UseVisualStyleBackColor = true; btnShowAccountInfo = new Button(); btnShowAccountInfo.Parent = pnlDataInfoButtons; btnShowAccountInfo.Text = Language.T("Account Info"); btnShowAccountInfo.Click += new EventHandler(BtnShowAccountInfo_Click); btnShowAccountInfo.UseVisualStyleBackColor = true; btnShowBars = new Button(); btnShowBars.Parent = pnlDataInfoButtons; btnShowBars.Text = Language.T("Loaded Bars"); btnShowBars.Click += new EventHandler(BtnShowBars_Click); btnShowBars.UseVisualStyleBackColor = true; // Panel Market Info pnlMarketInfo = new Info_Panel(Language.T("Market Information")); pnlMarketInfo.Parent = tabPageStatus; // Panel Useful Links pnlUsefulLinks = new LinkPanel(Language.T("Useful Links")); pnlUsefulLinks.Parent = tabPageStatus; // Panel Forex Brokers pnlForexBrokers = new LinkPanel(Language.T("Forex Brokers")); pnlForexBrokers.Parent = tabPageStatus; SetStatusColors(); return; }
/// <summary> /// Constructor /// </summary> public Edit_Translation() { // The form MaximizeBox = false; MinimizeBox = false; Icon = Data.Icon; BackColor = LayoutColors.ColorFormBack; FormBorderStyle = FormBorderStyle.FixedDialog; Text = Language.T("Edit Translation"); FormClosing += new FormClosingEventHandler(Actions_FormClosing); // Controls pnlCommon = new Fancy_Panel(Language.T("Common Parameters")); pnlPhrases = new Fancy_Panel(Language.T("English Phrase - Translated Phrase")); alblInputNames = new Label[5]; atbxInputValues = new TextBox[5]; atbxMain = new TextBox[TEXTBOXES]; atbxAlt = new TextBox[TEXTBOXES]; scrollBar = new VScrollBar(); tbxSearch = new TextBox(); btnSearch = new Button(); btnUntranslated = new Button(); btnAccept = new Button(); btnCancel = new Button(); // Common pnlCommon.Parent = this; // Phrases pnlPhrases.Parent = this; // Input Names string[] asInputNames = new string[] { Language.T("Language"), Language.T("File name"), Language.T("Author"), Language.T("Website"), Language.T("Contacts"), }; // Input Values string[] asInputValues = new string[] { Configs.Language, Language.LanguageFileName, Language.Author, Language.AuthorsWebsite, Language.AuthorsEmail, }; // Common parameters for (int i = 0; i < asInputNames.Length; i++) { alblInputNames[i] = new Label(); alblInputNames[i].Parent = pnlCommon; alblInputNames[i].ForeColor = LayoutColors.ColorControlText; alblInputNames[i].BackColor = Color.Transparent; alblInputNames[i].AutoSize = true; alblInputNames[i].Text = asInputNames[i]; atbxInputValues[i] = new TextBox(); atbxInputValues[i].Parent = pnlCommon; atbxInputValues[i].Text = asInputValues[i]; } // Phrases for (int i = 0; i < TEXTBOXES; i++) { atbxMain[i] = new TextBox(); atbxMain[i].Parent = pnlPhrases; atbxMain[i].Multiline = true; atbxMain[i].ReadOnly = true; atbxMain[i].ForeColor = Color.DarkGray; atbxAlt[i] = new TextBox(); atbxAlt[i].Parent = pnlPhrases; atbxAlt[i].Multiline = true; atbxAlt[i].Tag = i; atbxAlt[i].TextChanged += new EventHandler(Edit_Translation_TextChanged); } // Vertical ScrollBar scrollBar.Parent = pnlPhrases; scrollBar.Visible = true; scrollBar.Enabled = true; scrollBar.ValueChanged += new EventHandler(ScrollBar_ValueChanged); scrollBar.TabStop = true; // TextBox Search tbxSearch.Parent = this; tbxSearch.TextChanged += new EventHandler(TbxSearch_TextChanged); // Button Search btnSearch.Parent = this; btnSearch.Name = "Search"; btnSearch.Text = Language.T("Search"); btnSearch.Click += new EventHandler(Btn_Click); btnSearch.UseVisualStyleBackColor = true; // Button Untranslated btnUntranslated.Parent = this; btnUntranslated.Name = "Untranslated"; btnUntranslated.Text = Language.T("Not Translated"); btnUntranslated.Click += new EventHandler(Btn_Click); btnUntranslated.UseVisualStyleBackColor = true; // Button Cancel btnCancel.Parent = this; btnCancel.Name = "Cancel"; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.Click += new EventHandler(Btn_Click); btnCancel.UseVisualStyleBackColor = true; // Button Accept btnAccept.Parent = this; btnAccept.Name = "Accept"; btnAccept.Text = Language.T("Accept"); btnAccept.DialogResult = DialogResult.OK; btnAccept.Click += new EventHandler(Btn_Click); btnAccept.Enabled = false; btnAccept.UseVisualStyleBackColor = true; }
/// <summary> /// Sets the controls in tabPageStrategy /// </summary> void Initialize_PageStrategy() { // tabPageStrategy tabPageStrategy.Name = "tabPageStrategy"; tabPageStrategy.Text = Language.T("Strategy"); tabPageStrategy.ImageIndex = 1; tabPageStrategy.Resize += new EventHandler(TabPageStrategy_Resize); pnlOverviewBase = new Panel(); pnlOverviewBase.Parent = tabPageStrategy; pnlOverviewBase.Dock = DockStyle.Fill; pnlStrategyBase = new Panel(); pnlStrategyBase.Parent = tabPageStrategy; pnlStrategyBase.Dock = DockStyle.Left; // Panel Browser Base pnlBrawserBase = new Fancy_Panel(Language.T("Strategy Overview")); pnlBrawserBase.Padding = new Padding(2, (int)pnlBrawserBase.CaptionHeight, 2, 2); pnlBrawserBase.Parent = pnlOverviewBase; pnlBrawserBase.Dock = DockStyle.Fill; // BrowserOverview browserOverview = new WebBrowser(); browserOverview.Parent = pnlBrawserBase; browserOverview.Dock = DockStyle.Fill; //browserOverview.AllowNavigation = false; browserOverview.WebBrowserShortcutsEnabled = false; browserOverview.AllowWebBrowserDrop = false; // StrategyLayout strategyLayout = new Strategy_Layout(Data.Strategy.Clone()); strategyLayout.Parent = pnlStrategyBase; strategyLayout.btnAddOpenFilter.Click += new EventHandler(BtnAddOpenFilter_Click); strategyLayout.btnAddCloseFilter.Click += new EventHandler(BtnAddCloseFilter_Click); // ToolStrip Strategy tsStrategy = new ToolStrip(); tsStrategy.Parent = pnlStrategyBase; tsStrategy.Dock = DockStyle.None; tsStrategy.AutoSize = false; // Button tsbtStrategyNew ToolStripButton tsbtStrategyNew = new ToolStripButton(); tsbtStrategyNew.Name = "New"; tsbtStrategyNew.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyNew.Image = Properties.Resources.strategy_new; tsbtStrategyNew.Click += new EventHandler(BtnStrategyIO_Click); tsbtStrategyNew.ToolTipText = Language.T("Open the default strategy \"New.xml\"."); tsStrategy.Items.Add(tsbtStrategyNew); // Button tsbtStrategyOpen ToolStripButton tsbtStrategyOpen = new ToolStripButton(); tsbtStrategyOpen.Name = "Open"; tsbtStrategyOpen.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyOpen.Image = Properties.Resources.strategy_open; tsbtStrategyOpen.Click += new EventHandler(BtnStrategyIO_Click); tsbtStrategyOpen.ToolTipText = Language.T("Open a strategy."); tsStrategy.Items.Add(tsbtStrategyOpen); // Button tsbtStrategySave ToolStripButton tsbtStrategySave = new ToolStripButton(); tsbtStrategySave.Name = "Save"; tsbtStrategySave.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategySave.Image = Properties.Resources.strategy_save; tsbtStrategySave.Click += new EventHandler(BtnStrategyIO_Click); tsbtStrategySave.ToolTipText = Language.T("Save the strategy."); tsStrategy.Items.Add(tsbtStrategySave); // Button tsbtStrategySaveAs ToolStripButton tsbtStrategySaveAs = new ToolStripButton(); tsbtStrategySaveAs.Name = "SaveAs"; tsbtStrategySaveAs.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategySaveAs.Image = Properties.Resources.strategy_save_as; tsbtStrategySaveAs.Click += new EventHandler(BtnStrategyIO_Click); tsbtStrategySaveAs.ToolTipText = Language.T("Save a copy of the strategy."); tsStrategy.Items.Add(tsbtStrategySaveAs); tsStrategy.Items.Add(new ToolStripSeparator()); // Button tsbtStrategyUndo ToolStripButton tsbtStrategyUndo = new ToolStripButton(); tsbtStrategyUndo.Name = "Undo"; tsbtStrategyUndo.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyUndo.Image = Properties.Resources.strategy_undo; tsbtStrategyUndo.Click += new EventHandler(MenuStrategyUndo_OnClick); tsbtStrategyUndo.ToolTipText = Language.T("Undo the last change in the strategy."); tsStrategy.Items.Add(tsbtStrategyUndo); // Button tsbtStrategyCopy ToolStripButton tsbtStrategyCopy = new ToolStripButton(); tsbtStrategyCopy.Name = "Copy"; tsbtStrategyCopy.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyCopy.Image = Properties.Resources.copy; tsbtStrategyCopy.Click += new EventHandler(MenuStrategyCopy_OnClick); tsbtStrategyCopy.ToolTipText = Language.T("Copy the entire strategy to the clipboard."); tsStrategy.Items.Add(tsbtStrategyCopy); // Button tsbtStrategyPaste ToolStripButton tsbtStrategyPaste = new ToolStripButton(); tsbtStrategyPaste.Name = "Paste"; tsbtStrategyPaste.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyPaste.Image = Properties.Resources.paste; tsbtStrategyPaste.Click += new EventHandler(MenuStrategyPaste_OnClick); tsbtStrategyPaste.ToolTipText = Language.T("Load a strategy from the clipboard."); tsStrategy.Items.Add(tsbtStrategyPaste); tsStrategy.Items.Add(new ToolStripSeparator()); // Button tsbtStrategyZoomIn ToolStripButton tsbtStrategyZoomIn = new ToolStripButton(); tsbtStrategyZoomIn.Name = "ZoomIn"; tsbtStrategyZoomIn.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyZoomIn.Image = Properties.Resources.strategy_zoom_in; tsbtStrategyZoomIn.Click += new EventHandler(BtnStrategyZoom_Click); tsbtStrategyZoomIn.ToolTipText = Language.T("Expand the information in the strategy slots."); tsStrategy.Items.Add(tsbtStrategyZoomIn); // Button tsbtStrategyZoomOut ToolStripButton tsbtStrategyZoomOut = new ToolStripButton(); tsbtStrategyZoomOut.Name = "ZoomOut"; tsbtStrategyZoomOut.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyZoomOut.Image = Properties.Resources.strategy_zoom_out; tsbtStrategyZoomOut.Click += new EventHandler(BtnStrategyZoom_Click); tsbtStrategyZoomOut.ToolTipText = Language.T("Reduce the information in the strategy slots."); tsStrategy.Items.Add(tsbtStrategyZoomOut); tsStrategy.Items.Add(new ToolStripSeparator()); // Button tsbtStrategyDescription ToolStripButton tsbtStrategyDescription = new ToolStripButton(); tsbtStrategyDescription.Name = "Description"; tsbtStrategyDescription.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyDescription.Image = Properties.Resources.strategy_description; tsbtStrategyDescription.Click += new EventHandler(BtnStrategyDescription_Click); tsbtStrategyDescription.ToolTipText = Language.T("Edit the strategy description."); tsStrategy.Items.Add(tsbtStrategyDescription); // Button tsbtStrategyPublish ToolStripButton tsbtStrategyPublish = new ToolStripButton(); tsbtStrategyPublish.Name = "Publish"; tsbtStrategyPublish.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategyPublish.Image = Properties.Resources.strategy_publish; tsbtStrategyPublish.Click += new EventHandler(MenuStrategyBBcode_OnClick); tsbtStrategyPublish.ToolTipText = Language.T("Publish the strategy in the program's forum."); tsStrategy.Items.Add(tsbtStrategyPublish); tsStrategy.Items.Add(new ToolStripSeparator()); // Button tsbtStrategySettings ToolStripButton tsbtStrategySettings = new ToolStripButton(); tsbtStrategySettings.Name = "Settings"; tsbtStrategySettings.DisplayStyle = ToolStripItemDisplayStyle.Image; tsbtStrategySettings.Image = Properties.Resources.strategy_settings; tsbtStrategySettings.Click += new EventHandler(BtnStrategySettings_Click); tsbtStrategySettings.ToolTipText = Language.T("Trade settings."); tsStrategy.Items.Add(tsbtStrategySettings); SetStrategyColors(); RebuildStrategyLayout(); SetSrategyOverview(); return; }
public AboutScreen() { pnlBase = new Fancy_Panel(); lblProgramName = new Label(); lblProgramVersion = new Label(); lblLibraryVersion = new Label(); lblExpertVersion = new Label(); lblCopyright = new Label(); lblWebsite = new Label(); lblSupportForum = new Label(); lblContacts = new Label(); pictureLogo = new PictureBox(); linkWebsite = new LinkLabel(); linkForum = new LinkLabel(); linkEmail = new LinkLabel(); btnOk = new Button(); // Panel Base pnlBase.Parent = this; pictureLogo.TabStop = false; pictureLogo.BackColor = Color.Transparent; pictureLogo.Image = Properties.Resources.Logo; lblProgramName.AutoSize = true; lblProgramName.Font = new Font("Microsoft Sans Serif", 16F, FontStyle.Bold); lblProgramName.ForeColor = LayoutColors.ColorControlText; lblProgramName.BackColor = Color.Transparent; lblProgramName.Text = Data.ProgramName; lblProgramVersion.AutoSize = true; lblProgramVersion.Font = new Font("Microsoft Sans Serif", 12F); lblProgramVersion.ForeColor = LayoutColors.ColorControlText; lblProgramVersion.BackColor = Color.Transparent; lblProgramVersion.Text = Language.T("Program version") + ": " + Data.ProgramVersion + (Data.IsProgramBeta ? " " + Language.T("Beta") : ""); lblLibraryVersion.AutoSize = true; lblLibraryVersion.Font = new Font("Microsoft Sans Serif", 10F); lblLibraryVersion.ForeColor = LayoutColors.ColorControlText; lblLibraryVersion.BackColor = Color.Transparent; lblLibraryVersion.Text = Language.T("Library version") + ": " + Data.LibraryVersion; // label4 lblExpertVersion.AutoSize = true; lblExpertVersion.Font = new Font("Microsoft Sans Serif", 10F); lblExpertVersion.ForeColor = LayoutColors.ColorControlText; lblExpertVersion.BackColor = Color.Transparent; lblExpertVersion.Text = Language.T("Expert version") + ": " + Data.ExpertVersion; // label5 lblCopyright.AutoSize = true; lblCopyright.Font = new Font("Microsoft Sans Serif", 10F); lblCopyright.ForeColor = LayoutColors.ColorControlText; lblCopyright.BackColor = Color.Transparent; lblCopyright.Text = "Copyright (c) 2011 Miroslav Popov" + Environment.NewLine + Language.T("Distributor") + " - Forex Software Ltd." + Environment.NewLine + Environment.NewLine + Language.T("This is a freeware program!"); // label6 lblWebsite.AutoSize = true; lblWebsite.ForeColor = LayoutColors.ColorControlText; lblWebsite.BackColor = Color.Transparent; lblWebsite.Text = Language.T("Website") + ":"; // label7 lblSupportForum.AutoSize = true; lblSupportForum.ForeColor = LayoutColors.ColorControlText; lblSupportForum.BackColor = Color.Transparent; lblSupportForum.Text = Language.T("Support forum") + ":"; // label8 lblContacts.AutoSize = true; lblContacts.ForeColor = LayoutColors.ColorControlText; lblContacts.BackColor = Color.Transparent; lblContacts.Text = Language.T("Contacts") + ":"; // llWebsite linkWebsite.AutoSize = true; linkWebsite.TabStop = true; linkWebsite.BackColor = Color.Transparent; linkWebsite.Text = "http://forexsb.com"; linkWebsite.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkWebsite_LinkClicked); // llForum linkForum.AutoSize = true; linkForum.TabStop = true; linkForum.BackColor = Color.Transparent; linkForum.Text = "http://forexsb.com/forum"; linkForum.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkForum_LinkClicked); // llEmail linkEmail.AutoSize = true; linkEmail.TabStop = true; linkEmail.BackColor = Color.Transparent; linkEmail.Text = "*****@*****.**"; linkEmail.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkEmail_LinkClicked); // Button Base btnOk.Parent = this; btnOk.Text = Language.T("Ok"); btnOk.UseVisualStyleBackColor = true; btnOk.Click += new EventHandler(BtnOk_Click); // AboutScreen pnlBase.Controls.Add(lblProgramName); pnlBase.Controls.Add(lblProgramVersion); pnlBase.Controls.Add(lblLibraryVersion); pnlBase.Controls.Add(lblExpertVersion); pnlBase.Controls.Add(lblCopyright); pnlBase.Controls.Add(lblWebsite); pnlBase.Controls.Add(lblSupportForum); pnlBase.Controls.Add(lblContacts); pnlBase.Controls.Add(linkWebsite); pnlBase.Controls.Add(linkForum); pnlBase.Controls.Add(linkEmail); pnlBase.Controls.Add(pictureLogo); StartPosition = FormStartPosition.CenterScreen; Text = Language.T("About") + " " + Data.ProgramName; FormBorderStyle = FormBorderStyle.FixedDialog; BackColor = LayoutColors.ColorFormBack; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; ClientSize = new Size(360, 320); }
/// <summary> /// Public Constructor /// </summary> public Starting_Tips() { pnlBase = new Fancy_Panel(); pnlControl = new Panel(); browser = new WebBrowser(); chboxShow = new CheckBox(); btnPrevTip = new Button(); btnNextTip = new Button(); btnClose = new Button(); xmlTips = new XmlDocument(); rnd = new Random(); Text = Language.T("Tip of the Day"); FormBorderStyle = FormBorderStyle.FixedDialog; Icon = Data.Icon; MaximizeBox = false; MinimizeBox = false; TopMost = true; pnlBase.Parent = this; browser.Parent = pnlBase; browser.AllowNavigation = true; browser.AllowWebBrowserDrop = false; browser.DocumentText = Language.T("Loading..."); browser.Dock = DockStyle.Fill; browser.TabStop = false; browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted); browser.IsWebBrowserContextMenuEnabled = false; browser.WebBrowserShortcutsEnabled = false; pnlControl.Parent = this; pnlControl.Dock = DockStyle.Bottom; pnlControl.BackColor = Color.Transparent; chboxShow.Parent = pnlControl; chboxShow.Text = Language.T("Show a tip"); chboxShow.Checked = Configs.ShowStartingTip; chboxShow.TextAlign = ContentAlignment.MiddleLeft; chboxShow.AutoSize = true; chboxShow.ForeColor = LayoutColors.ColorControlText; chboxShow.CheckStateChanged += new EventHandler(ChboxShow_CheckStateChanged); btnPrevTip.Parent = pnlControl; btnPrevTip.Text = Language.T("Previous Tip"); btnPrevTip.Name = "Previous"; btnPrevTip.Click += new EventHandler(Navigate); btnPrevTip.UseVisualStyleBackColor = true; btnNextTip.Parent = pnlControl; btnNextTip.Text = Language.T("Next Tip"); btnNextTip.Name = "Next"; btnNextTip.Click += new EventHandler(Navigate); btnNextTip.UseVisualStyleBackColor = true; btnClose.Parent = pnlControl; btnClose.Text = Language.T("Close"); btnClose.Name = "Close"; btnClose.Click += new EventHandler(Navigate); btnClose.UseVisualStyleBackColor = true; LoadStartingTips(); return; }
/// <summary> /// Make a form /// </summary> public Strategy_Description() { pnlBase = new Panel(); pnlWarnBase = new Fancy_Panel(); lblWarning = new Label(); pnlTbxBase = new Fancy_Panel(Language.T("Strategy Description")); txboxInfo = new TextBox(); btnClose = new Button(); btnAccept = new Button(); btnClear = new Button(); // BBCode_viewer AcceptButton = btnClose; BackColor = LayoutColors.ColorFormBack; Icon = Data.Icon; MinimumSize = new System.Drawing.Size(400, 400); Text = Language.T("Strategy Description"); FormClosing += new FormClosingEventHandler(Actions_FormClosing); Controls.Add(pnlBase); Controls.Add(btnAccept); Controls.Add(btnClose); Controls.Add(btnClear); // pnlWarnBase pnlWarnBase.Parent = this; pnlWarnBase.Padding = new Padding(2, 4, 2, 2); // lblWarning lblWarning.Parent = pnlWarnBase; lblWarning.TextAlign = ContentAlignment.MiddleCenter; lblWarning.BackColor = Color.Transparent; ; lblWarning.ForeColor = LayoutColors.ColorControlText; lblWarning.AutoSize = false; lblWarning.Dock = DockStyle.Fill; if (Data.Strategy.Description != "") { if (!Data.IsStrDescriptionRelevant()) { lblWarning.Font = new Font(Font, FontStyle.Bold); lblWarning.Text = Language.T("This description might be outdated!"); } else lblWarning.Text = System.IO.Path.GetFileNameWithoutExtension(Data.StrategyName); } else lblWarning.Text = Language.T("You can write a description to the strategy!"); pnlTbxBase.Parent = pnlBase; pnlTbxBase.Padding = new Padding(4, (int)pnlTbxBase.CaptionHeight + 1, 2, 3); pnlTbxBase.Dock = DockStyle.Fill; // txboxInfo txboxInfo.Parent = pnlTbxBase; txboxInfo.Dock = DockStyle.Fill; txboxInfo.BackColor = LayoutColors.ColorControlBack; txboxInfo.ForeColor = LayoutColors.ColorControlText; txboxInfo.BorderStyle = BorderStyle.None; txboxInfo.Multiline = true; txboxInfo.AcceptsReturn = true; txboxInfo.AcceptsTab = true; txboxInfo.ScrollBars = ScrollBars.Vertical; txboxInfo.KeyDown += new KeyEventHandler(TxboxInfo_KeyDown); txboxInfo.Text = Data.Strategy.Description; txboxInfo.Select(0, 0); oldInfo = Data.Strategy.Description; // btnClose btnClose.Text = Language.T("Close"); btnClose.Click += new System.EventHandler(BtnClose_Click); btnClose.UseVisualStyleBackColor = true; // btnAccept btnAccept.Text = Language.T("Accept"); btnAccept.Click += new System.EventHandler(BtnAccept_Click); btnAccept.UseVisualStyleBackColor = true; // btnClear btnClear.Text = Language.T("Clear"); btnClear.Click += new System.EventHandler(BtnClear_Click); btnClear.UseVisualStyleBackColor = true; }
/// <summary> /// Constructor /// </summary> public New_Translation() { // The form MaximizeBox = false; MinimizeBox = false; Icon = Data.Icon; BackColor = LayoutColors.ColorFormBack; FormBorderStyle = FormBorderStyle.FixedDialog; Text = Language.T("New Translation"); // Controls pnlInput = new Fancy_Panel(Language.T("Common Parameters")); alblInputNames = new Label[5]; atbxInputValues = new TextBox[5]; btnAccept = new Button(); btnCancel = new Button(); // Input pnlInput.Parent = this; // Input Names string[] asInputNames = new string[] { Language.T("Language"), Language.T("File name"), Language.T("Author"), Language.T("Website"), Language.T("Contacts"), }; // Input Values string[] asInputValues = new string[] { "Language", "Language", "Your Name", @"http:\\forexsb.com", @"*****@*****.**", }; // Input parameters for (int i = 0; i < asInputNames.Length; i++) { alblInputNames[i] = new Label(); alblInputNames[i].Parent = pnlInput; alblInputNames[i].ForeColor = LayoutColors.ColorControlText; alblInputNames[i].BackColor = Color.Transparent; alblInputNames[i].AutoSize = true; alblInputNames[i].Text = asInputNames[i]; atbxInputValues[i] = new TextBox(); atbxInputValues[i].Parent = pnlInput; atbxInputValues[i].Text = asInputValues[i]; } //Button Cancel btnCancel.Parent = this; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.Click += new EventHandler(Btn_Click); btnCancel.UseVisualStyleBackColor = true; //Button Accept btnAccept.Parent = this; btnAccept.Name = "Accept"; btnAccept.Text = Language.T("Accept"); btnAccept.DialogResult = DialogResult.OK; btnAccept.Click += new EventHandler(Btn_Click); btnAccept.UseVisualStyleBackColor = true; return; }
// --------------------------------------------------------------------------- /// <summary> /// Constructor /// </summary> public Indicator_Dialog(int slotNumb, SlotTypes slotType, bool isSlotDefined) { this.slot = slotNumb; this.slotType = slotType; this.isSlotDefined = isSlotDefined; if (slotType == SlotTypes.Open) { slotTitle = Language.T("Opening Point of the Position"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackOpen, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpen, LayoutColors.ColorSlotCaptionText); } else if (slotType == SlotTypes.OpenFilter) { slotTitle = Language.T("Opening Logic Condition"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackOpenFilter, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpenFilter, LayoutColors.ColorSlotCaptionText); } else if (slotType == SlotTypes.Close) { slotTitle = Language.T("Closing Point of the Position"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackClose, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackClose, LayoutColors.ColorSlotCaptionText); } else { slotTitle = Language.T("Closing Logic Condition"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackCloseFilter, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackCloseFilter, LayoutColors.ColorSlotCaptionText); } trvIndicators = new TreeView(); btnAccept = new Button(); btnHelp = new Button(); btnDefault = new Button(); btnCancel = new Button(); lblIndicatorInfo = new Label(); lblIndicatorWarning = new Label(); lblIndicator = new Label(); lblGroup = new Label(); cbxGroup = new ComboBox(); aLblList = new Label[5]; aCbxList = new ComboBox[5]; aLblNumeric = new Label[6]; aNudNumeric = new NUD[6]; aChbCheck = new CheckBox[2]; BackColor = LayoutColors.ColorFormBack; FormBorderStyle = FormBorderStyle.FixedDialog; Icon = Data.Icon; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; AcceptButton = btnAccept; CancelButton = btnCancel; Text = Language.T("Logic and Parameters of the Indicators"); // Panel TreeViewBase pnlTreeViewBase.Parent = this; pnlTreeViewBase.Padding = new Padding(border, (int)pnlTreeViewBase.CaptionHeight, border, border); // TreeView trvIndicators trvIndicators.Parent = pnlTreeViewBase; trvIndicators.Dock = DockStyle.Fill; trvIndicators.BackColor = LayoutColors.ColorControlBack; trvIndicators.ForeColor = LayoutColors.ColorControlText; trvIndicators.BorderStyle = BorderStyle.None; trvIndicators.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(TrvIndicators_NodeMouseDoubleClick); trvIndicators.KeyPress += new KeyPressEventHandler(TrvIndicators_KeyPress); pnlParameters.Parent = this; // lblIndicatorInfo lblIndicatorInfo.Parent = pnlParameters; lblIndicatorInfo.Size = new Size(16, 16); lblIndicatorInfo.BackColor = Color.Transparent; lblIndicatorInfo.BackgroundImage = Properties.Resources.information; lblIndicatorInfo.Click += new EventHandler(LblIndicatorInfo_Click); lblIndicatorInfo.MouseEnter += new EventHandler(Label_MouseEnter); lblIndicatorInfo.MouseLeave += new EventHandler(Label_MouseLeave); // LAbel Indicator Warning lblIndicatorWarning.Parent = pnlParameters; lblIndicatorWarning.Size = new Size(16, 16); lblIndicatorWarning.BackColor = Color.Transparent; lblIndicatorWarning.BackgroundImage = Properties.Resources.warning; lblIndicatorWarning.Visible = false; lblIndicatorWarning.Click += new EventHandler(LblIndicatorWarning_Click); lblIndicatorWarning.MouseEnter += new EventHandler(Label_MouseEnter); lblIndicatorWarning.MouseLeave += new EventHandler(Label_MouseLeave); // Label Indicator lblIndicator.Parent = pnlParameters; lblIndicator.TextAlign = ContentAlignment.MiddleCenter; lblIndicator.Font = new Font(Font.FontFamily, 14, FontStyle.Bold); lblIndicator.ForeColor = LayoutColors.ColorSlotIndicatorText; lblIndicator.BackColor = Color.Transparent; // Label aLblList[0] aLblList[0] = new Label(); aLblList[0].Parent = pnlParameters; aLblList[0].TextAlign = ContentAlignment.BottomCenter; aLblList[0].ForeColor = LayoutColors.ColorControlText; aLblList[0].BackColor = Color.Transparent; // ComboBox aCbxList[0] aCbxList[0] = new ComboBox(); aCbxList[0].Parent = pnlParameters; aCbxList[0].DropDownStyle = ComboBoxStyle.DropDownList; aCbxList[0].SelectedIndexChanged += new EventHandler(Param_Changed); // Logical Group lblGroup = new Label(); lblGroup.Parent = pnlParameters; lblGroup.TextAlign = ContentAlignment.BottomCenter; lblGroup.ForeColor = LayoutColors.ColorControlText; lblGroup.BackColor = Color.Transparent; lblGroup.Text = Language.T("Group"); cbxGroup = new ComboBox(); cbxGroup.Parent = pnlParameters; if(slotType == SlotTypes.OpenFilter) cbxGroup.Items.AddRange(new string[] {"A", "B", "C", "D", "E", "F", "G", "H", "All"}); if(slotType == SlotTypes.CloseFilter) cbxGroup.Items.AddRange(new string[] {"a", "b", "c", "d", "e", "f", "g", "h", "all"}); cbxGroup.SelectedIndexChanged += new EventHandler(Group_Changed); cbxGroup.DropDownStyle = ComboBoxStyle.DropDownList; toolTip.SetToolTip(cbxGroup, Language.T("The logical group of the slot.")); // ListParams for (int i = 1; i < 5; i++) { aLblList[i] = new Label(); aLblList[i].Parent = pnlParameters; aLblList[i].TextAlign = ContentAlignment.BottomCenter; aLblList[i].ForeColor = LayoutColors.ColorControlText; aLblList[i].BackColor = Color.Transparent; aCbxList[i] = new ComboBox(); aCbxList[i].Parent = pnlParameters; aCbxList[i].Enabled = false; aCbxList[i].SelectedIndexChanged += new EventHandler(Param_Changed); aCbxList[i].DropDownStyle = ComboBoxStyle.DropDownList; } // NumParams for (int i = 0; i < 6; i++) { aLblNumeric[i] = new Label(); aLblNumeric[i].Parent = pnlParameters; aLblNumeric[i].TextAlign = ContentAlignment.MiddleRight; aLblNumeric[i].ForeColor = LayoutColors.ColorControlText; aLblNumeric[i].BackColor = Color.Transparent; aNudNumeric[i] = new NUD(); aNudNumeric[i].Parent = pnlParameters; aNudNumeric[i].TextAlign = HorizontalAlignment.Center; aNudNumeric[i].Enabled = false; aNudNumeric[i].ValueChanged += new EventHandler(Param_Changed); } // CheckParams for (int i = 0; i < 2; i++) { aChbCheck[i] = new CheckBox(); aChbCheck[i].Parent = pnlParameters; aChbCheck[i].CheckAlign = ContentAlignment.MiddleLeft; aChbCheck[i].TextAlign = ContentAlignment.MiddleLeft; aChbCheck[i].CheckedChanged += new EventHandler(Param_Changed); aChbCheck[i].ForeColor = LayoutColors.ColorControlText; aChbCheck[i].BackColor = Color.Transparent; aChbCheck[i].Enabled = false; } // Button Accept btnAccept.Parent = this; btnAccept.Text = Language.T("Accept"); btnAccept.DialogResult = DialogResult.OK; btnAccept.Click += new EventHandler(BtnOk_Click); btnAccept.UseVisualStyleBackColor = true; // Button Default btnDefault.Parent = this; btnDefault.Text = Language.T("Default"); btnDefault.Click += new EventHandler(BtnDefault_Click); btnDefault.UseVisualStyleBackColor = true; // Button Help btnHelp.Parent = this; btnHelp.Text = Language.T("Help"); btnHelp.Click += new EventHandler(BtnHelp_Click); btnHelp.UseVisualStyleBackColor = true; // Button Cancel btnCancel.Parent = this; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.UseVisualStyleBackColor = true; SetTreeViewIndicators(); // ComboBoxindicator index selection. if (isSlotDefined) { TreeNode [] atrn = trvIndicators.Nodes.Find(Data.Strategy.Slot[slot].IndParam.IndicatorName, true); trvIndicators.SelectedNode = atrn[0]; UpdateFromIndicatorParam(Data.Strategy.Slot[slot].IndParam); SetLogicalGroup(); CalculateIndicator(); } else { string sDefaultIndicator; if (slotType == SlotTypes.Open) sDefaultIndicator = "Bar Opening"; else if (slotType == SlotTypes.OpenFilter) sDefaultIndicator = "Accelerator Oscillator"; else if (slotType == SlotTypes.Close) sDefaultIndicator = "Bar Closing"; else sDefaultIndicator = "Accelerator Oscillator"; TreeNode[] atrn = trvIndicators.Nodes.Find(sDefaultIndicator, true); trvIndicators.SelectedNode = atrn[0]; TrvIndicatorsLoadIndicator(atrn[0]); } oppSignalBehaviour = Data.Strategy.OppSignalAction; if (slotType == SlotTypes.Close && Data.Strategy.CloseFilters > 0) for (int iSlot = Data.Strategy.CloseSlot + 1; iSlot < Data.Strategy.Slots; iSlot++) closingConditions.Add(Data.Strategy.Slot[iSlot].Clone()); return; }
/// <summary> /// Initializes Operation tab page. /// </summary> public void Initialize_PageOperation() { tabPageOperation.Name = "tabPageOperation"; tabPageOperation.Text = Language.T("Operation"); tabPageOperation.ImageIndex = 5; tabPageOperation.BackColor = LayoutColors.ColorFormBack; pnlManualTrade = new Fancy_Panel(Language.T("Manual Operation Execution")); pnlManualTrade.Parent = tabPageOperation; pnlManualTrade.Dock = DockStyle.Fill; pnlManualTrade.Resize += new EventHandler(PnlManualTrade_Resize); pnlHolder = new Panel(); pnlHolder.Parent = pnlManualTrade; pnlHolder.BackColor = Color.Transparent; pnlHolder.Size = new Size(750, 350); lblBidAsk = new Label(); lblBidAsk.Parent = pnlHolder; lblBidAsk.Text = "Bid / Ask"; lblBidAsk.BackColor = Color.Transparent; lblBidAsk.ForeColor = LayoutColors.ColorControlText; lblBidAsk.Font = new Font(Font.FontFamily, 18, FontStyle.Bold); lblBidAsk.Width = 295; lblBidAsk.TextAlign = ContentAlignment.MiddleCenter; lblBidAsk.Location = new Point(190, 35); lblSymbol = new Label(); lblSymbol.Parent = pnlHolder; lblSymbol.Text = "Symbol"; lblSymbol.BackColor = Color.Transparent; lblSymbol.ForeColor = LayoutColors.ColorControlText; lblSymbol.Font = new Font(Font.FontFamily, 18, FontStyle.Bold); lblSymbol.Height = lblSymbol.Font.Height; lblSymbol.Width = 180; lblSymbol.TextAlign = ContentAlignment.MiddleRight; lblSymbol.Location = new Point(5, 35); lblLots = new Label(); lblLots.Parent = pnlHolder; lblLots.Text = Language.T("Lots"); lblLots.Font = new Font(Font.FontFamily, 11); lblLots.BackColor = Color.Transparent; lblLots.ForeColor = LayoutColors.ColorControlText; lblLots.Width = 90; lblLots.Height = lblLots.Font.Height; lblLots.TextAlign = ContentAlignment.MiddleRight; lblLots.Location = new Point(5, 81); lblStopLoss = new Label(); lblStopLoss.Parent = pnlHolder; lblStopLoss.Text = Language.T("Stop Loss"); lblStopLoss.Font = new Font(Font.FontFamily, 11); lblStopLoss.BackColor = Color.Transparent; lblStopLoss.ForeColor = LayoutColors.ColorControlText; lblStopLoss.Location = new Point(5, 121); lblStopLoss.Width = 90; lblStopLoss.TextAlign = ContentAlignment.MiddleRight; lblTakeProfit = new Label(); lblTakeProfit.Parent = pnlHolder; lblTakeProfit.Font = new Font(Font.FontFamily, 11); lblTakeProfit.Text = Language.T("Take Profit"); lblTakeProfit.BackColor = Color.Transparent; lblTakeProfit.ForeColor = LayoutColors.ColorControlText; lblTakeProfit.Location = new Point(5, 151); lblTakeProfit.Width = 90; lblTakeProfit.TextAlign = ContentAlignment.MiddleRight; lblBreakEven = new Label(); lblBreakEven.Parent = pnlHolder; lblBreakEven.Font = new Font(Font.FontFamily, 11); lblBreakEven.Text = Language.T("Break Even"); lblBreakEven.BackColor = Color.Transparent; lblBreakEven.ForeColor = LayoutColors.ColorControlText; lblBreakEven.Location = new Point(5, 191); lblBreakEven.Width = 90; lblBreakEven.TextAlign = ContentAlignment.MiddleRight; lblTrailingStop = new Label(); lblTrailingStop.Parent = pnlHolder; lblTrailingStop.Font = new Font(Font.FontFamily, 11); lblTrailingStop.Text = Language.T("Trailing Stop"); lblTrailingStop.BackColor = Color.Transparent; lblTrailingStop.ForeColor = LayoutColors.ColorControlText; lblTrailingStop.Location = new Point(5, 221); lblTrailingStop.Width = 90; lblTrailingStop.TextAlign = ContentAlignment.MiddleRight; nudLots = new NumericUpDown(); nudLots.Parent = pnlHolder; nudLots.Font = new Font(Font.FontFamily, 11); nudLots.TextAlign = HorizontalAlignment.Center; nudLots.BeginInit(); nudLots.Minimum = 0.1M; nudLots.Maximum = 100; nudLots.Increment = 0.1M; nudLots.Value = 1; nudLots.DecimalPlaces = 1; nudLots.EndInit(); nudLots.Width = 80; nudLots.Location = new Point(100, 81); nudStopLoss = new NumericUpDown(); nudStopLoss.Parent = pnlHolder; nudStopLoss.Font = new Font(Font.FontFamily, 11); nudStopLoss.TextAlign = HorizontalAlignment.Center; nudStopLoss.BeginInit(); nudStopLoss.Minimum = 0; nudStopLoss.Maximum = 5000; nudStopLoss.Increment = 1; nudStopLoss.Value = 0; nudStopLoss.DecimalPlaces = 0; nudStopLoss.EndInit(); nudStopLoss.ValueChanged += new EventHandler(Parameter_ValueChanged); nudStopLoss.Width = 80; nudStopLoss.Location = new Point(100, 121); colorParameter = nudStopLoss.ForeColor; nudTakeProfit = new NumericUpDown(); nudTakeProfit.Parent = pnlHolder; nudTakeProfit.Font = new Font(Font.FontFamily, 11); nudTakeProfit.TextAlign = HorizontalAlignment.Center; nudTakeProfit.BeginInit(); nudTakeProfit.Minimum = 0; nudTakeProfit.Maximum = 5000; nudTakeProfit.Increment = 1; nudTakeProfit.Value = 0; nudTakeProfit.DecimalPlaces = 0; nudTakeProfit.EndInit(); nudTakeProfit.ValueChanged += new EventHandler(Parameter_ValueChanged); nudTakeProfit.Width = 80; nudTakeProfit.Location = new Point(100, 151); nudBreakEven = new NumericUpDown(); nudBreakEven.Parent = pnlHolder; nudBreakEven.Font = new Font(Font.FontFamily, 11); nudBreakEven.TextAlign = HorizontalAlignment.Center; nudBreakEven.BeginInit(); nudBreakEven.Minimum = 0; nudBreakEven.Maximum = 5000; nudBreakEven.Increment = 1; nudBreakEven.Value = 0; nudBreakEven.DecimalPlaces = 0; nudBreakEven.EndInit(); nudBreakEven.ValueChanged += new EventHandler(Parameter_ValueChanged); nudBreakEven.Width = 80; nudBreakEven.Location = new Point(100, 191); nudTrailingStop = new NumericUpDown(); nudTrailingStop.Parent = pnlHolder; nudTrailingStop.Font = new Font(Font.FontFamily, 11); nudTrailingStop.TextAlign = HorizontalAlignment.Center; nudTrailingStop.BeginInit(); nudTrailingStop.Minimum = 0; nudTrailingStop.Maximum = 5000; nudTrailingStop.Increment = 1; nudTrailingStop.Value = 0; nudTrailingStop.DecimalPlaces = 0; nudTrailingStop.EndInit(); nudTrailingStop.ValueChanged += new EventHandler(Parameter_ValueChanged); nudTrailingStop.Width = 80; nudTrailingStop.Location = new Point(100, 221); btnSell = new Button(); btnSell.Name = "btnSell"; btnSell.Parent = pnlHolder; btnSell.Image = Properties.Resources.btn_operation_sell; btnSell.ImageAlign = ContentAlignment.MiddleLeft; btnSell.Text = Language.T("Sell"); btnSell.Click += new EventHandler(BtnOperation_Click); btnSell.Width = 145; btnSell.Height = 40; btnSell.Font = new Font(Font.FontFamily, 16); btnSell.ForeColor = Color.Crimson; btnSell.Location = new Point(190, 80); btnSell.UseVisualStyleBackColor = true; btnBuy = new Button(); btnBuy.Name = "btnBuy"; btnBuy.Parent = pnlHolder; btnBuy.Image = Properties.Resources.btn_operation_buy; btnBuy.ImageAlign = ContentAlignment.MiddleLeft; btnBuy.Text = Language.T("Buy"); btnBuy.Click += new EventHandler(BtnOperation_Click); btnBuy.Width = 145; btnBuy.Height = 40; btnBuy.Font = new Font(Font.FontFamily, 16); btnBuy.ForeColor = Color.Green; btnBuy.Location = new Point(340, 80); btnBuy.UseVisualStyleBackColor = true; btnClose = new Button(); btnClose.Name = "btnClose"; btnClose.Parent = pnlHolder; btnClose.Image = Properties.Resources.btn_operation_close; btnClose.ImageAlign = ContentAlignment.MiddleLeft; btnClose.Text = Language.T("Close"); btnClose.Click += new EventHandler(BtnOperation_Click); btnClose.Width = 295; btnClose.Height = 40; btnClose.Font = new Font(Font.FontFamily, 16, FontStyle.Bold); btnClose.ForeColor = Color.DarkOrange; btnClose.Location = new Point(190, 126); btnClose.UseVisualStyleBackColor = true; btnModify = new Button(); btnModify.Name = "btnModify"; btnModify.Parent = pnlHolder; btnModify.Image = Properties.Resources.recalculate; btnModify.ImageAlign = ContentAlignment.MiddleLeft; btnModify.Text = Language.T("Modify Stop Loss and Take Profit"); btnModify.Click += new EventHandler(BtnOperation_Click); btnModify.ForeColor = Color.Navy; btnModify.Width = 295; btnModify.Location = new Point(190, 172); btnModify.UseVisualStyleBackColor = true; tickChart = new Tick_Chart(Language.T("Tick Chart")); tickChart.Parent = pnlHolder; tickChart.Size = new Size(250, 200); tickChart.Location = new Point(495, 81); return; }
/// <summary> /// Constructor /// </summary> public Trade_Settings() { pnlSettings = new Fancy_Panel(); lblCloseAdvance = new Label(); lblSlippageEntry = new Label(); cbxLongLogicPrice = new ComboBox(); chbAutoSlippage = new CheckBox(); nudCloseAdvance = new NumericUpDown(); nudSlippageEntry = new NumericUpDown(); nudSlippageExit = new NumericUpDown(); lblSlippageExit = new Label(); lblLongLogicPrice = new Label(); lblMinChartBars = new Label(); nudMinChartBars = new NumericUpDown(); btnDefault = new Button(); btnCancel = new Button(); btnAccept = new Button(); font = this.Font; colorText = LayoutColors.ColorControlText; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; Icon = Data.Icon; BackColor = LayoutColors.ColorFormBack; FormBorderStyle = FormBorderStyle.FixedDialog; AcceptButton = btnAccept; Text = Language.T("Trade Settings"); // pnlAveraging pnlSettings.Parent = this; // ComboBox Long Logic Price cbxLongLogicPrice.Parent = pnlSettings; cbxLongLogicPrice.DropDownStyle = ComboBoxStyle.DropDownList; cbxLongLogicPrice.Items.AddRange(new string[] { Language.T("Bid"), Language.T("Ask") }); cbxLongLogicPrice.SelectedIndex = (Configs.LongTradeLogicPrice == "Bid" ? 0 : 1); // Label close advance lblCloseAdvance.Parent = pnlSettings; lblCloseAdvance.ForeColor = colorText; lblCloseAdvance.BackColor = Color.Transparent; lblCloseAdvance.AutoSize = true; lblCloseAdvance.Text = Language.T("'Bar Closing' time advance in seconds"); // Check Box Auto Slippage chbAutoSlippage.Parent = pnlSettings; chbAutoSlippage.ForeColor = colorText; chbAutoSlippage.BackColor = Color.Transparent; chbAutoSlippage.AutoSize = true; chbAutoSlippage.Checked = Configs.AutoSlippage; chbAutoSlippage.Text = Language.T("Auto slippage depending on the spread."); chbAutoSlippage.CheckedChanged += new EventHandler(chbAutoSlippage_CheckedChanged); // Label Entry slippage lblSlippageEntry.Parent = pnlSettings; lblSlippageEntry.ForeColor = colorText; lblSlippageEntry.BackColor = Color.Transparent; lblSlippageEntry.AutoSize = true; lblSlippageEntry.Text = Language.T("Slippage for entry orders"); // Label Entry slippage lblSlippageExit.Parent = pnlSettings; lblSlippageExit.ForeColor = colorText; lblSlippageExit.BackColor = Color.Transparent; lblSlippageExit.AutoSize = true; lblSlippageExit.Text = Language.T("Slippage for exit orders"); // NumericUpDown Entry Lots nudCloseAdvance.Parent = pnlSettings; nudCloseAdvance.BeginInit(); nudCloseAdvance.Minimum = 1; nudCloseAdvance.Maximum = 15; nudCloseAdvance.Increment = 1; nudCloseAdvance.Value = Configs.BarCloseAdvance; nudCloseAdvance.DecimalPlaces = 0; nudCloseAdvance.TextAlign = HorizontalAlignment.Center; nudCloseAdvance.EndInit(); // Label lblLongLogicPrice lblLongLogicPrice.Parent = pnlSettings; lblLongLogicPrice.ForeColor = colorText; lblLongLogicPrice.BackColor = Color.Transparent; lblLongLogicPrice.AutoSize = true; lblLongLogicPrice.Text = Language.T("Long logic rules base price"); // NUD Entry slippage nudSlippageEntry.Parent = pnlSettings; nudSlippageEntry.BeginInit(); nudSlippageEntry.Minimum = 0; nudSlippageEntry.Maximum = 1000; nudSlippageEntry.Increment = 1; nudSlippageEntry.Value = Configs.SlippageEntry; nudSlippageEntry.DecimalPlaces = 0; nudSlippageEntry.TextAlign = HorizontalAlignment.Center; nudSlippageEntry.Enabled = !Configs.AutoSlippage; nudSlippageEntry.EndInit(); // NUD Exit slippage nudSlippageExit.Parent = pnlSettings; nudSlippageExit.BeginInit(); nudSlippageExit.Minimum = 0; nudSlippageExit.Maximum = 1000; nudSlippageExit.Increment = 1; nudSlippageExit.Value = Configs.SlippageExit; nudSlippageExit.DecimalPlaces = 0; nudSlippageExit.TextAlign = HorizontalAlignment.Center; nudSlippageExit.Enabled = !Configs.AutoSlippage; nudSlippageExit.EndInit(); // Label lblMinChartBars lblMinChartBars.Parent = pnlSettings; lblMinChartBars.ForeColor = colorText; lblMinChartBars.BackColor = Color.Transparent; lblMinChartBars.AutoSize = true; lblMinChartBars.Text = Language.T("Minimum number of bars in the chart"); // NUD Exit slippage nudMinChartBars.Parent = pnlSettings; nudMinChartBars.BeginInit(); nudMinChartBars.Minimum = 300; nudMinChartBars.Maximum = 5000; nudMinChartBars.Increment = 1; nudMinChartBars.Value = Configs.MinChartBars; nudMinChartBars.DecimalPlaces = 0; nudMinChartBars.TextAlign = HorizontalAlignment.Center; nudMinChartBars.EndInit(); //Button Default btnDefault.Parent = this; btnDefault.Name = "Default"; btnDefault.Text = Language.T("Default"); btnDefault.Click += new EventHandler(BtnDefault_Click); btnDefault.UseVisualStyleBackColor = true; //Button Cancel btnCancel.Parent = this; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.UseVisualStyleBackColor = true; //Button Accept btnAccept.Parent = this; btnAccept.Name = "Accept"; btnAccept.Text = Language.T("Accept"); btnAccept.Click += new EventHandler(BtnAccept_Click); btnAccept.DialogResult = DialogResult.OK; btnAccept.UseVisualStyleBackColor = true; return; }
// --------------------------------------------------------------------------- /// <summary> /// Constructor /// </summary> public Indicator_Dialog(int slotNumb, SlotTypes slotType, bool isSlotDefined) { this.slot = slotNumb; this.slotType = slotType; this.isSlotDefined = isSlotDefined; if (slotType == SlotTypes.Open) { slotTitle = Language.T("Opening Point of the Position"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackOpen, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpen, LayoutColors.ColorSlotCaptionText); } else if (slotType == SlotTypes.OpenFilter) { slotTitle = Language.T("Opening Logic Condition"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackOpenFilter, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpenFilter, LayoutColors.ColorSlotCaptionText); } else if (slotType == SlotTypes.Close) { slotTitle = Language.T("Closing Point of the Position"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackClose, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackClose, LayoutColors.ColorSlotCaptionText); } else { slotTitle = Language.T("Closing Logic Condition"); pnlParameters = new Fancy_Panel(slotTitle, LayoutColors.ColorSlotCaptionBackCloseFilter, LayoutColors.ColorSlotCaptionText); pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackCloseFilter, LayoutColors.ColorSlotCaptionText); } trvIndicators = new TreeView(); btnAccept = new Button(); btnHelp = new Button(); btnDefault = new Button(); btnCancel = new Button(); lblIndicatorInfo = new Label(); lblIndicatorWarning = new Label(); lblIndicator = new Label(); lblGroup = new Label(); cbxGroup = new ComboBox(); aLblList = new Label[5]; aCbxList = new ComboBox[5]; aLblNumeric = new Label[6]; aNudNumeric = new NUD[6]; aChbCheck = new CheckBox[2]; BackColor = LayoutColors.ColorFormBack; FormBorderStyle = FormBorderStyle.FixedDialog; Icon = Data.Icon; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; AcceptButton = btnAccept; CancelButton = btnCancel; Text = Language.T("Logic and Parameters of the Indicators"); // Panel TreeViewBase pnlTreeViewBase.Parent = this; pnlTreeViewBase.Padding = new Padding(border, (int)pnlTreeViewBase.CaptionHeight, border, border); // TreeView trvIndicators trvIndicators.Parent = pnlTreeViewBase; trvIndicators.Dock = DockStyle.Fill; trvIndicators.BackColor = LayoutColors.ColorControlBack; trvIndicators.ForeColor = LayoutColors.ColorControlText; trvIndicators.BorderStyle = BorderStyle.None; trvIndicators.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(TrvIndicators_NodeMouseDoubleClick); trvIndicators.KeyPress += new KeyPressEventHandler(TrvIndicators_KeyPress); pnlParameters.Parent = this; // lblIndicatorInfo lblIndicatorInfo.Parent = pnlParameters; lblIndicatorInfo.Size = new Size(16, 16); lblIndicatorInfo.BackColor = Color.Transparent; lblIndicatorInfo.BackgroundImage = Properties.Resources.information; lblIndicatorInfo.Click += new EventHandler(LblIndicatorInfo_Click); lblIndicatorInfo.MouseEnter += new EventHandler(Label_MouseEnter); lblIndicatorInfo.MouseLeave += new EventHandler(Label_MouseLeave); // LAbel Indicator Warning lblIndicatorWarning.Parent = pnlParameters; lblIndicatorWarning.Size = new Size(16, 16); lblIndicatorWarning.BackColor = Color.Transparent; lblIndicatorWarning.BackgroundImage = Properties.Resources.warning; lblIndicatorWarning.Visible = false; lblIndicatorWarning.Click += new EventHandler(LblIndicatorWarning_Click); lblIndicatorWarning.MouseEnter += new EventHandler(Label_MouseEnter); lblIndicatorWarning.MouseLeave += new EventHandler(Label_MouseLeave); // Label Indicator lblIndicator.Parent = pnlParameters; lblIndicator.TextAlign = ContentAlignment.MiddleCenter; lblIndicator.Font = new Font(Font.FontFamily, 14, FontStyle.Bold); lblIndicator.ForeColor = LayoutColors.ColorSlotIndicatorText; lblIndicator.BackColor = Color.Transparent; // Label aLblList[0] aLblList[0] = new Label(); aLblList[0].Parent = pnlParameters; aLblList[0].TextAlign = ContentAlignment.BottomCenter; aLblList[0].ForeColor = LayoutColors.ColorControlText; aLblList[0].BackColor = Color.Transparent; // ComboBox aCbxList[0] aCbxList[0] = new ComboBox(); aCbxList[0].Parent = pnlParameters; aCbxList[0].DropDownStyle = ComboBoxStyle.DropDownList; aCbxList[0].SelectedIndexChanged += new EventHandler(Param_Changed); // Logical Group lblGroup = new Label(); lblGroup.Parent = pnlParameters; lblGroup.TextAlign = ContentAlignment.BottomCenter; lblGroup.ForeColor = LayoutColors.ColorControlText; lblGroup.BackColor = Color.Transparent; lblGroup.Text = Language.T("Group"); cbxGroup = new ComboBox(); cbxGroup.Parent = pnlParameters; if (slotType == SlotTypes.OpenFilter) { cbxGroup.Items.AddRange(new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "All" }); } if (slotType == SlotTypes.CloseFilter) { cbxGroup.Items.AddRange(new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "all" }); } cbxGroup.SelectedIndexChanged += new EventHandler(Group_Changed); cbxGroup.DropDownStyle = ComboBoxStyle.DropDownList; toolTip.SetToolTip(cbxGroup, Language.T("The logical group of the slot.")); // ListParams for (int i = 1; i < 5; i++) { aLblList[i] = new Label(); aLblList[i].Parent = pnlParameters; aLblList[i].TextAlign = ContentAlignment.BottomCenter; aLblList[i].ForeColor = LayoutColors.ColorControlText; aLblList[i].BackColor = Color.Transparent; aCbxList[i] = new ComboBox(); aCbxList[i].Parent = pnlParameters; aCbxList[i].Enabled = false; aCbxList[i].SelectedIndexChanged += new EventHandler(Param_Changed); aCbxList[i].DropDownStyle = ComboBoxStyle.DropDownList; } // NumParams for (int i = 0; i < 6; i++) { aLblNumeric[i] = new Label(); aLblNumeric[i].Parent = pnlParameters; aLblNumeric[i].TextAlign = ContentAlignment.MiddleRight; aLblNumeric[i].ForeColor = LayoutColors.ColorControlText; aLblNumeric[i].BackColor = Color.Transparent; aNudNumeric[i] = new NUD(); aNudNumeric[i].Parent = pnlParameters; aNudNumeric[i].TextAlign = HorizontalAlignment.Center; aNudNumeric[i].Enabled = false; aNudNumeric[i].ValueChanged += new EventHandler(Param_Changed); } // CheckParams for (int i = 0; i < 2; i++) { aChbCheck[i] = new CheckBox(); aChbCheck[i].Parent = pnlParameters; aChbCheck[i].CheckAlign = ContentAlignment.MiddleLeft; aChbCheck[i].TextAlign = ContentAlignment.MiddleLeft; aChbCheck[i].CheckedChanged += new EventHandler(Param_Changed); aChbCheck[i].ForeColor = LayoutColors.ColorControlText; aChbCheck[i].BackColor = Color.Transparent; aChbCheck[i].Enabled = false; } // Button Accept btnAccept.Parent = this; btnAccept.Text = Language.T("Accept"); btnAccept.DialogResult = DialogResult.OK; btnAccept.Click += new EventHandler(BtnOk_Click); btnAccept.UseVisualStyleBackColor = true; // Button Default btnDefault.Parent = this; btnDefault.Text = Language.T("Default"); btnDefault.Click += new EventHandler(BtnDefault_Click); btnDefault.UseVisualStyleBackColor = true; // Button Help btnHelp.Parent = this; btnHelp.Text = Language.T("Help"); btnHelp.Click += new EventHandler(BtnHelp_Click); btnHelp.UseVisualStyleBackColor = true; // Button Cancel btnCancel.Parent = this; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.UseVisualStyleBackColor = true; SetTreeViewIndicators(); // ComboBoxindicator index selection. if (isSlotDefined) { TreeNode [] atrn = trvIndicators.Nodes.Find(Data.Strategy.Slot[slot].IndParam.IndicatorName, true); trvIndicators.SelectedNode = atrn[0]; UpdateFromIndicatorParam(Data.Strategy.Slot[slot].IndParam); SetLogicalGroup(); CalculateIndicator(); } else { string sDefaultIndicator; if (slotType == SlotTypes.Open) { sDefaultIndicator = "Bar Opening"; } else if (slotType == SlotTypes.OpenFilter) { sDefaultIndicator = "Accelerator Oscillator"; } else if (slotType == SlotTypes.Close) { sDefaultIndicator = "Bar Closing"; } else { sDefaultIndicator = "Accelerator Oscillator"; } TreeNode[] atrn = trvIndicators.Nodes.Find(sDefaultIndicator, true); trvIndicators.SelectedNode = atrn[0]; TrvIndicatorsLoadIndicator(atrn[0]); } oppSignalBehaviour = Data.Strategy.OppSignalAction; if (slotType == SlotTypes.Close && Data.Strategy.CloseFilters > 0) { for (int iSlot = Data.Strategy.CloseSlot + 1; iSlot < Data.Strategy.Slots; iSlot++) { closingConditions.Add(Data.Strategy.Slot[iSlot].Clone()); } } return; }
public AboutScreen() { pnlBase = new Fancy_Panel(); lblProgramName = new Label(); lblProgramVersion = new Label(); lblLibraryVersion = new Label(); lblExpertVersion = new Label(); lblCopyright = new Label(); lblWebsite = new Label(); lblSupportForum = new Label(); lblContacts = new Label(); pictureLogo = new PictureBox(); linkWebsite = new LinkLabel(); linkForum = new LinkLabel(); linkEmail = new LinkLabel(); btnOk = new Button(); // Panel Base pnlBase.Parent = this; pictureLogo.TabStop = false; pictureLogo.BackColor = Color.Transparent; pictureLogo.Image = Properties.Resources.Logo; lblProgramName.AutoSize = true; lblProgramName.Font = new Font("Microsoft Sans Serif", 16F, FontStyle.Bold); lblProgramName.ForeColor = LayoutColors.ColorControlText; lblProgramName.BackColor = Color.Transparent; lblProgramName.Text = Data.ProgramName; lblProgramVersion.AutoSize = true; lblProgramVersion.Font = new Font("Microsoft Sans Serif", 12F); lblProgramVersion.ForeColor = LayoutColors.ColorControlText; lblProgramVersion.BackColor = Color.Transparent; lblProgramVersion.Text = Language.T("Program version") + ": " + Data.ProgramVersion + (Data.IsProgramBeta ? " " + Language.T("Beta") : ""); lblLibraryVersion.AutoSize = true; lblLibraryVersion.Font = new Font("Microsoft Sans Serif", 10F); lblLibraryVersion.ForeColor = LayoutColors.ColorControlText; lblLibraryVersion.BackColor = Color.Transparent; lblLibraryVersion.Text = Language.T("Library version") + ": " + Data.LibraryVersion; // label4 lblExpertVersion.AutoSize = true; lblExpertVersion.Font = new Font("Microsoft Sans Serif", 10F); lblExpertVersion.ForeColor = LayoutColors.ColorControlText; lblExpertVersion.BackColor = Color.Transparent; lblExpertVersion.Text = Language.T("Expert version") + ": " + Data.ExpertVersion; // label5 lblCopyright.AutoSize = true; lblCopyright.Font = new Font("Microsoft Sans Serif", 10F); lblCopyright.ForeColor = LayoutColors.ColorControlText; lblCopyright.BackColor = Color.Transparent; lblCopyright.Text = "Copyright (c) 2012 Miroslav Popov" + Environment.NewLine + Language.T("Distributor") + " - Forex Software Ltd." + Environment.NewLine + Environment.NewLine + Language.T("This is a freeware program!"); // label6 lblWebsite.AutoSize = true; lblWebsite.ForeColor = LayoutColors.ColorControlText; lblWebsite.BackColor = Color.Transparent; lblWebsite.Text = Language.T("Website") + ":"; // label7 lblSupportForum.AutoSize = true; lblSupportForum.ForeColor = LayoutColors.ColorControlText; lblSupportForum.BackColor = Color.Transparent; lblSupportForum.Text = Language.T("Support forum") + ":"; // label8 lblContacts.AutoSize = true; lblContacts.ForeColor = LayoutColors.ColorControlText; lblContacts.BackColor = Color.Transparent; lblContacts.Text = Language.T("Contacts") + ":"; // llWebsite linkWebsite.AutoSize = true; linkWebsite.TabStop = true; linkWebsite.BackColor = Color.Transparent; linkWebsite.Text = "http://forexsb.com"; linkWebsite.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkWebsite_LinkClicked); // llForum linkForum.AutoSize = true; linkForum.TabStop = true; linkForum.BackColor = Color.Transparent; linkForum.Text = "http://forexsb.com/forum"; linkForum.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkForum_LinkClicked); // llEmail linkEmail.AutoSize = true; linkEmail.TabStop = true; linkEmail.BackColor = Color.Transparent; linkEmail.Text = "*****@*****.**"; linkEmail.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkEmail_LinkClicked); // Button Base btnOk.Parent = this; btnOk.Text = Language.T("Ok"); btnOk.UseVisualStyleBackColor = true; btnOk.Click += new EventHandler(BtnOk_Click); // AboutScreen pnlBase.Controls.Add(lblProgramName); pnlBase.Controls.Add(lblProgramVersion); pnlBase.Controls.Add(lblLibraryVersion); pnlBase.Controls.Add(lblExpertVersion); pnlBase.Controls.Add(lblCopyright); pnlBase.Controls.Add(lblWebsite); pnlBase.Controls.Add(lblSupportForum); pnlBase.Controls.Add(lblContacts); pnlBase.Controls.Add(linkWebsite); pnlBase.Controls.Add(linkForum); pnlBase.Controls.Add(linkEmail); pnlBase.Controls.Add(pictureLogo); StartPosition = FormStartPosition.CenterScreen; Text = Language.T("About") + " " + Data.ProgramName; FormBorderStyle = FormBorderStyle.FixedDialog; BackColor = LayoutColors.ColorFormBack; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; ClientSize = new Size(360, 320); }
/// <summary> /// Make a form /// </summary> public Strategy_Description() { pnlBase = new Panel(); pnlWarnBase = new Fancy_Panel(); lblWarning = new Label(); pnlTbxBase = new Fancy_Panel(Language.T("Strategy Description")); txboxInfo = new TextBox(); btnClose = new Button(); btnAccept = new Button(); btnClear = new Button(); // BBCode_viewer AcceptButton = btnClose; BackColor = LayoutColors.ColorFormBack; Icon = Data.Icon; MinimumSize = new System.Drawing.Size(400, 400); Text = Language.T("Strategy Description"); FormClosing += new FormClosingEventHandler(Actions_FormClosing); Controls.Add(pnlBase); Controls.Add(btnAccept); Controls.Add(btnClose); Controls.Add(btnClear); // pnlWarnBase pnlWarnBase.Parent = this; pnlWarnBase.Padding = new Padding(2, 4, 2, 2); // lblWarning lblWarning.Parent = pnlWarnBase; lblWarning.TextAlign = ContentAlignment.MiddleCenter; lblWarning.BackColor = Color.Transparent;; lblWarning.ForeColor = LayoutColors.ColorControlText; lblWarning.AutoSize = false; lblWarning.Dock = DockStyle.Fill; if (Data.Strategy.Description != "") { if (!Data.IsStrDescriptionRelevant()) { lblWarning.Font = new Font(Font, FontStyle.Bold); lblWarning.Text = Language.T("This description might be outdated!"); } else { lblWarning.Text = System.IO.Path.GetFileNameWithoutExtension(Data.StrategyName); } } else { lblWarning.Text = Language.T("You can write a description to the strategy!"); } pnlTbxBase.Parent = pnlBase; pnlTbxBase.Padding = new Padding(4, (int)pnlTbxBase.CaptionHeight + 1, 2, 3); pnlTbxBase.Dock = DockStyle.Fill; // txboxInfo txboxInfo.Parent = pnlTbxBase; txboxInfo.Dock = DockStyle.Fill; txboxInfo.BackColor = LayoutColors.ColorControlBack; txboxInfo.ForeColor = LayoutColors.ColorControlText; txboxInfo.BorderStyle = BorderStyle.None; txboxInfo.Multiline = true; txboxInfo.AcceptsReturn = true; txboxInfo.AcceptsTab = true; txboxInfo.ScrollBars = ScrollBars.Vertical; txboxInfo.KeyDown += new KeyEventHandler(TxboxInfo_KeyDown); txboxInfo.Text = Data.Strategy.Description; txboxInfo.Select(0, 0); oldInfo = Data.Strategy.Description; // btnClose btnClose.Text = Language.T("Close"); btnClose.Click += new System.EventHandler(BtnClose_Click); btnClose.UseVisualStyleBackColor = true; // btnAccept btnAccept.Text = Language.T("Accept"); btnAccept.Click += new System.EventHandler(BtnAccept_Click); btnAccept.UseVisualStyleBackColor = true; // btnClear btnClear.Text = Language.T("Clear"); btnClear.Click += new System.EventHandler(BtnClear_Click); btnClear.UseVisualStyleBackColor = true; }