private void browser_Navigating(object sender, WebBrowserNavigatingEventArgs e) { //e.Cancel = true; string urlString = e.Url.ToString(); int i = urlString.IndexOf("#link"); if (i >= 0) { string link = urlString.Substring(i); Console.WriteLine(link); e.Cancel = true; RuleValue rv = links[link]; DPModifyControl modifyControl = rv.DataProvider.GetModifyUserInterface(); var form = DPControlContainerModifyForm.CreateForm(modifyControl); WinForms.SetFormRelativePosition(form, this, FormRelativePosition.LEFT); DialogResult dialogResult = form.ShowDialog(this); if (dialogResult == DialogResult.OK) { rv.DataProvider.UpdateProviderFromPropertyValues(); DisplayTradeDescription(); } } }
private void btnCharts_Click(object sender, EventArgs e) { WinForms.SetFormRelativePosition(chartLaunchForm, this); chartLaunchForm.WindowState = FormWindowState.Normal; chartLaunchForm.BringToFront(); chartLaunchForm.Show(); //WinForms.SetWindowState("MonkeyChart.vshost", Win32.WindowState.SW_NORMAL); }
public LightningLoaderForm() { InitializeComponent(); /*IDataProvider dp = new DataProviderTest(); * * XmlSaveDataProvider save = dp.SaveData; * * string filename = @"G:\DATA\PROJECTS\MonkeyLightning\EZTrader\bin\Debug\test"; * * bool success; * success = Xml.Serialize(save, typeof(XmlSaveDataProvider), filename + ".xml"); * success = Binary.Serialize(save, filename + ".bin"); * success = DataContract.Serialize(save, typeof(XmlSaveDataProvider), filename + ".dat"); * * XmlSaveDataProvider restore; * restore = (XmlSaveDataProvider)Xml.Deserialize(typeof(XmlSaveDataProvider), filename + ".xml"); * restore = (XmlSaveDataProvider)Binary.Deserialize(filename + ".bin"); * restore = (XmlSaveDataProvider)DataContract.Deserialize(typeof(XmlSaveDataProvider), filename + ".dat"); * * return;*/ dashboardForm = new DashboardForm(); dashboardForm.DashboardClosing += dashboardForm_DashboardClosing; dashboardForm.Show(); WinForms.SetFormRelativePosition(this, dashboardForm); splashForm = new SplashForm(); splashForm.Show(); WinForms.SetFormRelativePosition(splashForm, dashboardForm); dashboardForm.UseWaitCursor = true; splashForm.UseWaitCursor = true; Application.DoEvents(); // Finally register Form events. this.Load += new System.EventHandler(this.frmMain_Load); this.Closed += new System.EventHandler(this.frmMain_Closed); }
private void comboValue2_SelectedIndexChanged(object sender, EventArgs e) { if (settingComboValue == true) { return; } ShowTrueFalseBox(false); string dataProviderName = comboValue2.Text; dataProvider2 = (IDataProvider)Activator.CreateInstance(dataProviders[dataProviderName]); txtDescription.Text = dataProvider2.Name + ": " + dataProvider2.Description; DialogResult dialogResult = System.Windows.Forms.DialogResult.Cancel; // See if we need to display a UI for this data provider. if (dataProvider2.GetModifyUserInterface() != null) { DPModifyControl modifyControl = dataProvider2.GetModifyUserInterface(); Size controlSize = modifyControl.Size; var dpModifyForm = new DPControlContainerModifyForm(); dpModifyForm.Width = controlSize.Width + 16; dpModifyForm.Height = controlSize.Height + 112; Panel panel = dpModifyForm.Controls["panelControl"] as Panel; panel.Controls.Add(modifyControl); modifyControl.Dock = DockStyle.Fill; WinForms.SetFormRelativePosition(dpModifyForm, this, FormRelativePosition.RIGHT); dialogResult = dpModifyForm.ShowDialog(this); if (dialogResult == DialogResult.OK) { dataProvider2.UpdateProviderFromPropertyValues(); } else { ResetComboValue2(); } } if (dataProvider2.GetModifyUserInterface() == null || dialogResult == System.Windows.Forms.DialogResult.OK) { previousComboValue2 = comboValue2.SelectedIndex; ruleValue2 = new RuleValue(dataProvider2); ruleValue2.ValueUpdated += ruleValue_ValueUpdated; DPDisplayControl displayControl = ruleValue2.DataProvider.GetDisplayUserInterface(); panelValue2UI.Controls.Clear(); panelValue2UI.Controls.Add(displayControl); displayControl.Dock = DockStyle.Fill; dataProvider2.UpdateProviderFromPropertyValues(); if (dataProvider2.GetModifyUserInterface() == null) { displayControl.Cursor = Cursors.Default; } else { displayControl.Cursor = Cursors.Hand; displayControl.Click += displayControl2_Click; } CheckConditionEnableTest(); } }
private void chart1_MouseDown(object sender, MouseEventArgs e) { HitTestResult result = chart1.HitTest(e.X, e.Y); // Check to see if the user has CLICKED ON A CANDLESTICK BAR. if (result.ChartElementType == ChartElementType.DataPoint) { DataPoint dp = result.Object as DataPoint; // Only going to check this out if the user has specifically enabled bar select (may not want it on a "normal" chart) if (BarSelectEnabled == true) { // Try to find the index of this data point in the main chart series. int barIndex = chart1.Series[0].Points.IndexOf(dp); // If the user has clicked on a valid data point, display the form to select a series. if (chooseBarDataForm != null && barIndex >= 0) { HighlightDataPoint(dp); WinForms.SetFormRelativePosition(chooseBarDataForm, this); chooseBarDataForm.BarIndex = barIndex; chooseBarDataForm.ShowDialog(this); if (chooseBarDataForm.UserSelection == DialogResult.OK && chooseBarDataForm.SelectedSeries != null) { BarIndex = chooseBarDataForm.BarIndex; ReverseBarIndex = chooseBarDataForm.ReverseBarIndex; SelectedSeries = chooseBarDataForm.SelectedSeries; UpdateCurrentValue(); } } } } // Check to see if the user has CLICKED ON AN AXIS. else if (result.ChartElementType == ChartElementType.AxisLabels) { CustomLabel label = result.Object as CustomLabel; Axis yAxisMain = chart1.ChartAreas["ChartAreaMain"].AxisY; Axis yAxisBottom = chart1.ChartAreas["ChartAreaBottom"].AxisY; // This code deals only with the Y-AXIS of the MAIN chart area. if (label.Axis == yAxisMain || label.Axis == yAxisBottom) { mouseX = e.X; mouseY = e.Y; activeAxis = label.Axis; // Check for either left or right mouse button. if (e.Button == MouseButtons.Left) { leftButtonDown = true; } else if (e.Button == MouseButtons.Right) { rightButtonDown = true; } this.Cursor = Cursors.HSplit; } } }