From 90f21502c21e0cff38ee961b1bc7c4d96edba461 Mon Sep 17 00:00:00 2001 From: Dioksin Date: Fri, 28 Oct 2016 10:26:18 +0300 Subject: Chart was added to Quotes plugin --- plugins/Quotes/Forex.vcxproj | 17 + plugins/Quotes/Forex.vcxproj.filters | 2838 ++++++++++++++++++++ plugins/Quotes/QuotesChart/Form1.Designer.cs | 123 + plugins/Quotes/QuotesChart/Form1.cs | 155 ++ plugins/Quotes/QuotesChart/Form1.resx | 216 ++ plugins/Quotes/QuotesChart/Program.cs | 21 + .../Quotes/QuotesChart/Properties/AssemblyInfo.cs | 36 + .../QuotesChart/Properties/Resources.Designer.cs | 63 + .../Quotes/QuotesChart/Properties/Resources.resx | 117 + .../QuotesChart/Properties/Settings.Designer.cs | 26 + .../QuotesChart/Properties/Settings.settings | 7 + plugins/Quotes/QuotesChart/QuotesChart.csproj | 124 + plugins/Quotes/QuotesChart/app.config | 3 + plugins/Quotes/QuotesChart/main.ico | Bin 0 -> 5430 bytes plugins/Quotes/res/Forex.rc | 26 - plugins/Quotes/src/Forex.cpp | 1 - plugins/Quotes/src/QuoteChart.cpp | 395 +-- plugins/Quotes/src/QuoteChart.h | 4 +- plugins/Quotes/src/resource.h | 9 +- plugins/Quotes/src/stdafx.h | 1 + plugins/Quotes/src/version.h | 2 +- 21 files changed, 3818 insertions(+), 366 deletions(-) create mode 100644 plugins/Quotes/QuotesChart/Form1.Designer.cs create mode 100644 plugins/Quotes/QuotesChart/Form1.cs create mode 100644 plugins/Quotes/QuotesChart/Form1.resx create mode 100644 plugins/Quotes/QuotesChart/Program.cs create mode 100644 plugins/Quotes/QuotesChart/Properties/AssemblyInfo.cs create mode 100644 plugins/Quotes/QuotesChart/Properties/Resources.Designer.cs create mode 100644 plugins/Quotes/QuotesChart/Properties/Resources.resx create mode 100644 plugins/Quotes/QuotesChart/Properties/Settings.Designer.cs create mode 100644 plugins/Quotes/QuotesChart/Properties/Settings.settings create mode 100644 plugins/Quotes/QuotesChart/QuotesChart.csproj create mode 100644 plugins/Quotes/QuotesChart/app.config create mode 100644 plugins/Quotes/QuotesChart/main.ico (limited to 'plugins') diff --git a/plugins/Quotes/Forex.vcxproj b/plugins/Quotes/Forex.vcxproj index 1472ee370b..e59bd71b4f 100644 --- a/plugins/Quotes/Forex.vcxproj +++ b/plugins/Quotes/Forex.vcxproj @@ -18,6 +18,20 @@ x64 + + + + + + + + + + + + + + {C619A811-8023-4441-B3D7-785388A09DF0} Quotes @@ -25,6 +39,9 @@ + + $(WindowsSdkDir)include;$(VCInstallDir)include;$(IncludePath) + Sync diff --git a/plugins/Quotes/Forex.vcxproj.filters b/plugins/Quotes/Forex.vcxproj.filters index de5ad9f66c..3e569cdb25 100644 --- a/plugins/Quotes/Forex.vcxproj.filters +++ b/plugins/Quotes/Forex.vcxproj.filters @@ -1,4 +1,2842 @@  + + + Source Files + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Header Files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resource Files + + + + Resource Files + + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + \ No newline at end of file diff --git a/plugins/Quotes/QuotesChart/Form1.Designer.cs b/plugins/Quotes/QuotesChart/Form1.Designer.cs new file mode 100644 index 0000000000..39c45d2e6d --- /dev/null +++ b/plugins/Quotes/QuotesChart/Form1.Designer.cs @@ -0,0 +1,123 @@ +namespace QuotesChart +{ + partial class FormMirandaQuotesChart + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMirandaQuotesChart)); + this.chartQuotes = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.label1 = new System.Windows.Forms.Label(); + this.dateFrom = new System.Windows.Forms.DateTimePicker(); + this.dateTo = new System.Windows.Forms.DateTimePicker(); + this.label2 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.chartQuotes)).BeginInit(); + this.SuspendLayout(); + // + // chartQuotes + // + this.chartQuotes.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + chartArea1.Name = "ChartArea1"; + this.chartQuotes.ChartAreas.Add(chartArea1); + legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Bottom; + legend1.Name = "Legend1"; + this.chartQuotes.Legends.Add(legend1); + this.chartQuotes.Location = new System.Drawing.Point(2, 45); + this.chartQuotes.Name = "chartQuotes"; + this.chartQuotes.Size = new System.Drawing.Size(423, 433); + this.chartQuotes.TabIndex = 0; + this.chartQuotes.Text = "chart1"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(-1, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 13); + this.label1.TabIndex = 1; + this.label1.Text = "From"; + // + // dateFrom + // + this.dateFrom.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.dateFrom.Location = new System.Drawing.Point(35, 9); + this.dateFrom.Name = "dateFrom"; + this.dateFrom.Size = new System.Drawing.Size(98, 20); + this.dateFrom.TabIndex = 2; + this.dateFrom.ValueChanged += new System.EventHandler(this.dateFrom_ValueChanged); + // + // dateTo + // + this.dateTo.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.dateTo.Location = new System.Drawing.Point(177, 10); + this.dateTo.Name = "dateTo"; + this.dateTo.Size = new System.Drawing.Size(98, 20); + this.dateTo.TabIndex = 4; + this.dateTo.ValueChanged += new System.EventHandler(this.dateTo_ValueChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(151, 16); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(20, 13); + this.label2.TabIndex = 3; + this.label2.Text = "To"; + // + // FormMirandaQuotesChart + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(425, 477); + this.Controls.Add(this.dateTo); + this.Controls.Add(this.label2); + this.Controls.Add(this.dateFrom); + this.Controls.Add(this.label1); + this.Controls.Add(this.chartQuotes); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "FormMirandaQuotesChart"; + this.Text = "Miranda Quotes Chart"; + this.Load += new System.EventHandler(this.Form1_Load); + ((System.ComponentModel.ISupportInitialize)(this.chartQuotes)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataVisualization.Charting.Chart chartQuotes; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.DateTimePicker dateFrom; + private System.Windows.Forms.DateTimePicker dateTo; + private System.Windows.Forms.Label label2; + } +} + diff --git a/plugins/Quotes/QuotesChart/Form1.cs b/plugins/Quotes/QuotesChart/Form1.cs new file mode 100644 index 0000000000..b6295d4b56 --- /dev/null +++ b/plugins/Quotes/QuotesChart/Form1.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Microsoft.VisualBasic.FileIO; +using System.Runtime.InteropServices; + +namespace QuotesChart +{ + public partial class FormMirandaQuotesChart : Form + { + public FormMirandaQuotesChart() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + string[] cmd_line_args = Environment.GetCommandLineArgs(); + + for (int i = 1; i < cmd_line_args.Length; ++i) + { + string data_file = cmd_line_args[i]; + AddDataFromFile(data_file); + } + } + + private void dateFrom_ValueChanged(object sender, EventArgs e) + { + if (dateFrom.Value < dateTo.Value) + { + chartQuotes.ChartAreas[0].AxisX.Minimum = dateFrom.Value.ToOADate(); + chartQuotes.Invalidate(); + } + } + + private void dateTo_ValueChanged(object sender, EventArgs e) + { + if (dateTo.Value > dateFrom.Value) + { + chartQuotes.ChartAreas[0].AxisX.Maximum = dateTo.Value.ToOADate(); + chartQuotes.Invalidate(); + } + } + + int WM_COPYDATA = 0x4A; + + public struct COPYDATASTRUCT + { + public IntPtr dwData; + public int cbData; + [MarshalAs(UnmanagedType.LPWStr)] + public String lpData; + } + + protected override void WndProc(ref Message msg) + { + if (msg.Msg == WM_COPYDATA) + { + COPYDATASTRUCT cp = (COPYDATASTRUCT)Marshal.PtrToStructure(msg.LParam, typeof(COPYDATASTRUCT)); + + if (/**(cp.dwData) == 0x1945 && */cp.lpData != null) + { + AddDataFromFile(cp.lpData); + } + + } + base.WndProc(ref msg); + } + + private void AddDataFromFile(string data_file) + { + using (TextFieldParser parser = new Microsoft.VisualBasic.FileIO.TextFieldParser(data_file)) + { + parser.TrimWhiteSpace = true; + parser.TextFieldType = FieldType.Delimited; + parser.SetDelimiters("\t"); + + System.Windows.Forms.DataVisualization.Charting.Series series = null; + while (true) + { + string[] parts = parser.ReadFields(); + if (parts == null) + { + break; + } + + if (parts.Length >= 3) + { + string name = parts[0]; + string date = parts[1]; + string value = parts[2]; + + if (series == null) + { + if (chartQuotes.Series.FindByName(name) == null) + { + chartQuotes.Series.Add(name); + series = chartQuotes.Series[name]; + series.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + } + else + { + break; + } + } + + DateTime dt; + double d; + if (Double.TryParse(value, out d) && DateTime.TryParse(date, out dt)) + { + series.Points.AddXY(dt, d); + + if (!dateMin.HasValue) + { + dateMin = new DateTime(); + dateMin = dt; + } + else if (dt < dateMin) + { + dateMin = dt; + } + + if (!dateMax.HasValue) + { + dateMax = new DateTime(); + dateMax = dt; + } + else if (dt > dateMax) + { + dateMax = dt; + } + } + } + } + } + + if (dateMin.HasValue && dateMax.HasValue) + { + chartQuotes.ChartAreas[0].AxisX.Minimum = dateMin.Value.ToOADate(); + chartQuotes.ChartAreas[0].AxisX.Maximum = dateMax.Value.ToOADate(); + + dateFrom.Value = dateMin.Value; + dateTo.Value = dateMax.Value; + } + } + + private DateTime? dateMin = null; + private DateTime? dateMax = null; + } +} diff --git a/plugins/Quotes/QuotesChart/Form1.resx b/plugins/Quotes/QuotesChart/Form1.resx new file mode 100644 index 0000000000..3d63dcc355 --- /dev/null +++ b/plugins/Quotes/QuotesChart/Form1.resx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAIAQ + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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hVoAAAAAAAA + AAAAAAAANo/J7SxixP8MIbf/CRrI/wkby/8KG8b/Cxu8/6KSYP/0xwn/67kO/+OsFP/ZpCP/dlouTgAA + AAAAAAAAAAAAABYjqJMZKcv/BxrU/wYZ3P8GGd7/BxnY/wkazP8bJ63/3bw3/+m2D//irRr/wZMr70I0 + LAwAAAAAAAAAAAAAAAAKF50eJDTN8Q4g4v8DGOz/Axju/wQY5v8HGdj/ChvG/1NTi//quiP/364v/5p3 + MnQAAAAAAAAAAAAAAAAAAAAAAAAAABopu044SOb5HjH3/wIZ+f8DGO7/Bhne/woby/8eLLz/saF//7GM + PacAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSi+OjxK38tPXfL/TFvx/0xa5v9RXdb/RlC94zY8 + k2QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABxauLgUVtlAGFa9SChefOA0Z + lQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA+A8AAPAHAADgAwAAwAEAAMABAADAAQAAwAEAAMAB + AADAAQAAwAEAAMADAADgBwAA8A8AAPwfAAD//wAA + + + \ No newline at end of file diff --git a/plugins/Quotes/QuotesChart/Program.cs b/plugins/Quotes/QuotesChart/Program.cs new file mode 100644 index 0000000000..d2c79f5966 --- /dev/null +++ b/plugins/Quotes/QuotesChart/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace QuotesChart +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMirandaQuotesChart()); + } + } +} diff --git a/plugins/Quotes/QuotesChart/Properties/AssemblyInfo.cs b/plugins/Quotes/QuotesChart/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c90728eff3 --- /dev/null +++ b/plugins/Quotes/QuotesChart/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("QuotesChart")] +[assembly: AssemblyDescription("Chart Application for Miranda Quotes plugin")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Dioksin")] +[assembly: AssemblyProduct("Miranda")] +[assembly: AssemblyCopyright("Don't worry!")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9b8250c7-ffbe-4f8a-985e-2e562e253dc4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.1.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/plugins/Quotes/QuotesChart/Properties/Resources.Designer.cs b/plugins/Quotes/QuotesChart/Properties/Resources.Designer.cs new file mode 100644 index 0000000000..0bef6c885c --- /dev/null +++ b/plugins/Quotes/QuotesChart/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace QuotesChart.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("QuotesChart.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/plugins/Quotes/QuotesChart/Properties/Resources.resx b/plugins/Quotes/QuotesChart/Properties/Resources.resx new file mode 100644 index 0000000000..af7dbebbac --- /dev/null +++ b/plugins/Quotes/QuotesChart/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/plugins/Quotes/QuotesChart/Properties/Settings.Designer.cs b/plugins/Quotes/QuotesChart/Properties/Settings.Designer.cs new file mode 100644 index 0000000000..02c737069d --- /dev/null +++ b/plugins/Quotes/QuotesChart/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace QuotesChart.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/plugins/Quotes/QuotesChart/Properties/Settings.settings b/plugins/Quotes/QuotesChart/Properties/Settings.settings new file mode 100644 index 0000000000..39645652af --- /dev/null +++ b/plugins/Quotes/QuotesChart/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/plugins/Quotes/QuotesChart/QuotesChart.csproj b/plugins/Quotes/QuotesChart/QuotesChart.csproj new file mode 100644 index 0000000000..a502da630a --- /dev/null +++ b/plugins/Quotes/QuotesChart/QuotesChart.csproj @@ -0,0 +1,124 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {C255CA56-D05E-4389-A32E-CA3EBE412684} + WinExe + Properties + QuotesChart + QuotesChart + v4.0 + 512 + + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + bin\Debug\QuotesChart.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + bin\Release\QuotesChart.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + + + main.ico + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff --git a/plugins/Quotes/QuotesChart/app.config b/plugins/Quotes/QuotesChart/app.config new file mode 100644 index 0000000000..e365603337 --- /dev/null +++ b/plugins/Quotes/QuotesChart/app.config @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Quotes/QuotesChart/main.ico b/plugins/Quotes/QuotesChart/main.ico new file mode 100644 index 0000000000..da85d1f7c6 Binary files /dev/null and b/plugins/Quotes/QuotesChart/main.ico differ diff --git a/plugins/Quotes/res/Forex.rc b/plugins/Quotes/res/Forex.rc index 7f4df25bd8..ed52889477 100644 --- a/plugins/Quotes/res/Forex.rc +++ b/plugins/Quotes/res/Forex.rc @@ -135,24 +135,6 @@ BEGIN PUSHBUTTON "Close",IDCANCEL,148,80,50,14 END -IDD_CHART DIALOGEX 0, 0, 394, 279 -STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT -CAPTION "Chart" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "Info provided by Dukascopy Swiss Forex Group",IDC_SYSLINK_PROVIDER, - "SysLink",WS_TABSTOP,7,261,176,11 - PUSHBUTTON "Close",IDCANCEL,337,258,50,14 - CONTROL "",IDC_STATIC_IMAGE,"Static",SS_ETCHEDFRAME | NOT WS_VISIBLE,7,24,380,230,WS_EX_TRANSPARENT - LTEXT "Get data from:",IDC_STATIC,7,9,69,8 - COMBOBOX IDC_COMBO_DATA_SOURCE,79,7,85,54,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Filter:",IDC_STATIC,170,9,29,8 - COMBOBOX IDC_COMBO_FILTER,204,7,69,47,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT_FROM,277,7,53,12,ES_AUTOHSCROLL | NOT WS_VISIBLE - EDITTEXT IDC_EDIT_TO,334,7,53,12,ES_AUTOHSCROLL | NOT WS_VISIBLE -END - IDD_PROVIDER_ADV_SETTINGS DIALOGEX 0, 0, 303, 260 STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTROLPARENT @@ -350,14 +332,6 @@ BEGIN BOTTOMMARGIN, 94 END - IDD_CHART, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 387 - TOPMARGIN, 7 - BOTTOMMARGIN, 272 - END - IDD_PROVIDER_ADV_SETTINGS, DIALOG BEGIN LEFTMARGIN, 7 diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 6e353f15e6..bedd6e2e14 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -146,7 +146,6 @@ void InitMenu() #ifdef CHART_IMPLEMENT SET_UID(mi, 0x65da7256, 0x43a2, 0x4857, 0xac, 0x52, 0x1c, 0xb7, 0xff, 0xd7, 0x96, 0xfa); mi.name.w = LPGENW("Chart..."); - mi.popupPosition = 2; mi.hIcolibItem = NULL; mi.pszService = "Quotes/Chart"; g_hMenuChart = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME); diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp index 7075b0c5b6..16c6bfc1da 100644 --- a/plugins/Quotes/src/QuoteChart.cpp +++ b/plugins/Quotes/src/QuoteChart.cpp @@ -2,360 +2,99 @@ #ifdef CHART_IMPLEMENT -#define WINDOW_PREFIX "Quotes Chart_" -#define CHART_CTRL_CLASS L"DioksinChart" - -struct CTimeConvert +namespace { - static double Convert(const boost::posix_time::time_duration& v) - { - return boost::numeric_cast(v.ticks()); - } - - static tstring ToString(const boost::posix_time::ptime& v) + class CMyJob : private boost::noncopyable { - tostringstream k; - k.imbue(std::locale(GetSystemLocale(), new ttime_facet(L"%d/%m/%y %H:%M:%S"))); - k << v; - return k.str(); - } -}; - -typedef CChart TChart; - -inline TChart* get_chart_ptr(HWND hWnd) -{ - TChart* pChart = reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); - return pChart; -} - -bool read_log_file(MCONTACT hContact, TChart& rChart) -{ - tstring sLogFileName = GetContactLogFileName(hContact); - if (false == sLogFileName.empty()) { - std::locale loc(GetSystemLocale(), new ttime_input_facet(L"%d.%m.%y %H:%M:%S")); - boost::posix_time::ptime oDateTime; - double dRate; - - tifstream file(sLogFileName.c_str()); - file.imbue(loc); - while ((false == file.fail()) && (false == file.eof())) { - tstring sLine; - std::getline(file, sLine); - - tistringstream line(sLine); - line.imbue(loc); - - tstring sName; - std::getline(line, sName, '\t'); - line >> oDateTime >> dRate; - if ((false == line.fail()) && (true == line.eof())) { - rChart.AddValue(oDateTime, dRate); - } - } - - return true; - } - return false; -} - - -enum -{ - ID_CHART = 0x1969, - - srcLogFile = 0, - srcHistory = 1, - - filterAll = 0, - filterLastDay = 1, - filterLastWeek = 2, - filterLastMonth = 3, - filterLastYear = 4, - filterUserDefined = 5, - - CHART_SET_SOURCE = WM_USER + 1, - CHART_SET_FILTER = WM_USER + 2, -}; - -LRESULT CALLBACK ChartWndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) -{ - switch (msg) { - case WM_CREATE: + private: + CMyJob(LPCTSTR pszName = nullptr): m_hJob(::CreateJobObject(nullptr,pszName)) { - CREATESTRUCT* pCS = reinterpret_cast(lp); - MCONTACT hContact = reinterpret_cast(pCS->lpCreateParams); - - TChart* pChart = new TChart; - read_log_file(hContact, *pChart); + if(m_hJob) + { + JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli = { 0 }; + jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; + if(0 == ::SetInformationJobObject(m_hJob,JobObjectExtendedLimitInformation,&jeli,sizeof(jeli))) + { +#ifdef OUTPUT_TO_DEBUG_VIEWER + ::OutputDebugString(_T("Error occurred during the job initialization\n")); +#endif + } + } - ::SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast(pChart)); } - return 0; - - case CHART_SET_SOURCE: - break; - - case CHART_SET_FILTER: - break; - - case WM_SIZE: + ~CMyJob() { - TChart* pChart = get_chart_ptr(hWnd); - pChart->SetRect(0, 0, LOWORD(lp), HIWORD(lp)); - } - return 0; - - case WM_PAINT: - if (TRUE == ::GetUpdateRect(hWnd, NULL, FALSE)) { - PAINTSTRUCT ps; - HDC hdc = ::BeginPaint(hWnd, &ps); - if (NULL != hdc) { - TChart* pChart = get_chart_ptr(hWnd); - pChart->Draw(hdc); - ::EndPaint(hWnd, &ps); + if(m_hJob) + { + ::CloseHandle(m_hJob); } } - return 0; - case WM_DESTROY: + public: + static CMyJob& GetInstance() { - TChart* pChart = get_chart_ptr(hWnd); - ::SetWindowLongPtr(hWnd, GWLP_USERDATA, 0); - delete pChart; + static CMyJob g_job(_T("MirandaJob_E12D5E9C_00E7_4FFA_9831_F35E45C6EBDA")); + return g_job; } - break; - } - - return ::DefWindowProc(hWnd, msg, wp, lp); -} - -void register_chart_control() -{ - static bool g_bRegister = false; - if (g_bRegister) { - return; - } - - WNDCLASS wc; - - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = ChartWndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = CModuleInfo::GetInstance().GetModuleHandle(); - wc.hIcon = NULL; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = static_cast(::GetStockObject(WHITE_BRUSH)); - wc.lpszMenuName = NULL; - wc.lpszClassName = CHART_CTRL_CLASS; - - if (RegisterClass(&wc)) { - g_bRegister = true; - } -} - - -bool screen_2_client(HWND hWnd, LPRECT pRect) -{ - POINT pt; - pt.x = pRect->left; - pt.y = pRect->top; - bool bResult = TRUE == ::ScreenToClient(hWnd, &pt); - pRect->left = pt.x; - pRect->top = pt.y; - pt.x = pRect->right; - pt.y = pRect->bottom; - bResult |= TRUE == ::ScreenToClient(hWnd, &pt); - pRect->right = pt.x; - pRect->bottom = pt.y; - return bResult; -} -inline HANDLE get_contact(HWND hWnd) -{ - MCONTACT hContact = reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); - return hContact; -} - -void update_filter_controls(HWND hDlg) -{ - int nSel = ::SendDlgItemMessage(hDlg, IDC_COMBO_FILTER, CB_GETCURSEL, 0, 0); - - ::ShowWindow(::GetDlgItem(hDlg, IDC_EDIT_FROM), (filterUserDefined == nSel) ? SW_SHOW : SW_HIDE); - ::ShowWindow(::GetDlgItem(hDlg, IDC_EDIT_TO), (filterUserDefined == nSel) ? SW_SHOW : SW_HIDE); -} - -INT_PTR CALLBACK ChartDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hDlg); - { - MCONTACT hContact = reinterpret_cast(lp); - - tstring sName = get_window_text(hDlg); - sName += L" - "; - sName += GetContactName(hContact); - ::SetWindowText(hDlg, sName.c_str()); - - HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, false); - assert(hWL); - WindowList_Add(hWL, hDlg, hContact); - - ::SetWindowLongPtr(hDlg, GWLP_USERDATA, reinterpret_cast(hContact)); - - static LPCTSTR szSources[] = { LPGENW("Log File"), LPGENW("Miranda's History") }; - static LPCTSTR szFilters[] = { LPGENW("All"), LPGENW("Last Day"), LPGENW("Last Week"), LPGENW("Last Month"), LPGENW("Last Year"), LPGENW("User-Defined") }; - - for (int i = 0; i < sizeof(szSources) / sizeof(szSources[0]); ++i) { - LPCTSTR p = TranslateW(szSources[i]); - ::SendDlgItemMessage(hDlg, IDC_COMBO_DATA_SOURCE, CB_INSERTSTRING, -1, reinterpret_cast(p)); - } - - int nSel = db_get_b(hContact, QUOTES_PROTOCOL_NAME, "Chart_Source", srcLogFile); - ::SendDlgItemMessage(hDlg, IDC_COMBO_DATA_SOURCE, CB_SETCURSEL, nSel, 0); - - for (int i = 0; i < sizeof(szFilters) / sizeof(szFilters[0]); ++i) { - LPCTSTR p = TranslateW(szSources[i]); - ::SendDlgItemMessage(hDlg, IDC_COMBO_FILTER, CB_INSERTSTRING, -1, reinterpret_cast(szFilters[i])); - } - - nSel = db_get_b(hContact, QUOTES_PROTOCOL_NAME, "Chart_Filter", filterAll); - ::SendDlgItemMessage(hDlg, IDC_COMBO_FILTER, CB_SETCURSEL, nSel, 0); - - update_filter_controls(hDlg); - - register_chart_control(); - HWND hwndImage = ::GetDlgItem(hDlg, IDC_STATIC_IMAGE); - RECT rcImage; - ::GetWindowRect(hwndImage, &rcImage); - screen_2_client(hDlg, &rcImage); - //BOOL bResult = ShowWindow(hwndImage,SW_HIDE); - //assert(bResult); - - HWND hChart = ::CreateWindowEx(0L, CHART_CTRL_CLASS, NULL, WS_CHILDWINDOW | WS_VISIBLE, - rcImage.left, rcImage.top, rcImage.right - rcImage.left, rcImage.bottom - rcImage.top, - hDlg, reinterpret_cast(ID_CHART), CModuleInfo::GetInstance().GetModuleHandle(), hContact); - assert(NULL != hChart); - - Utils_RestoreWindowPosition(hDlg, hContact, QUOTES_MODULE_NAME, WINDOW_PREFIX); - BOOL bResult = ::ShowWindow(hDlg, SW_SHOW); - assert(bResult); - } - return (TRUE); - case WM_CLOSE: + bool AssignProcess(HANDLE hProcess) { - MCONTACT hContact = get_contact(hDlg); - SetWindowLongPtr(hDlg, GWLP_USERDATA, 0); - - // save_options(hDlg,hContact); - - HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, false); - assert(hWL); - WindowList_Remove(hWL, hDlg); - Utils_SaveWindowPosition(hDlg, hContact, QUOTES_MODULE_NAME, WINDOW_PREFIX); - - HWND hwndChart = ::GetDlgItem(hDlg, ID_CHART); - BOOL bResult = ::DestroyWindow(hwndChart); - assert(bResult); - - ::EndDialog(hDlg, 0); - } - return (TRUE); - - case WM_COMMAND: - switch (LOWORD(wp)) { - case IDCANCEL: - SendMessage(hDlg, WM_CLOSE, 0, 0); - return (TRUE); - - case IDC_COMBO_FILTER: - if (CBN_SELCHANGE == HIWORD(wp)) { - ::SendDlgItemMessage(hDlg, ID_CHART, CHART_SET_FILTER, ::SendDlgItemMessage(hDlg, IDC_COMBO_FILTER, CB_GETCURSEL, 0, 0), 0); - update_filter_controls(hDlg); + if(m_hJob && hProcess) + { + auto b = (TRUE == ::AssignProcessToJobObject(m_hJob,hProcess)); + return b; } - break; - case IDC_COMBO_DATA_SOURCE: - if (CBN_SELCHANGE == HIWORD(wp)) - ::SendDlgItemMessage(hDlg, ID_CHART, CHART_SET_SOURCE, ::SendDlgItemMessage(hDlg, IDC_COMBO_DATA_SOURCE, CB_GETCURSEL, 0, 0), 0); - break; - } - return (FALSE); - case WM_NOTIFY: - { - LPNMHDR pNMHDR = reinterpret_cast(lp); - switch (pNMHDR->code) { - case NM_CLICK: - if (IDC_SYSLINK_PROVIDER == wp) { - PNMLINK pNMLink = reinterpret_cast(pNMHDR); - ::ShellExecute(hDlg, L"open", pNMLink->item.szUrl, NULL, NULL, SW_SHOWNORMAL); - } - break; - } + return false; } - break; - - case WM_SIZE: - { - enum { INDENT = 7 }; - - int nWidth = LOWORD(lp); - int nHeight = HIWORD(lp); - - HWND hwndChart = GetDlgItem(hDlg, ID_CHART); - HWND hwndLink = GetDlgItem(hDlg, IDC_SYSLINK_PROVIDER); - HWND hwndClose = GetDlgItem(hDlg, IDCANCEL); - RECT rcDlg; - GetClientRect(hDlg, &rcDlg); + private: + HANDLE m_hJob; + }; - RECT rcChart; - GetWindowRect(hwndChart, &rcChart); - screen_2_client(hDlg, &rcChart); - - RECT rcLink; - GetWindowRect(hwndLink, &rcLink); - screen_2_client(hDlg, &rcLink); - SetWindowPos(hwndLink, NULL, rcDlg.left + INDENT, - rcDlg.bottom - INDENT - (rcLink.bottom - rcLink.top), - 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); - - RECT rcClose; - GetWindowRect(hwndClose, &rcClose); - screen_2_client(hDlg, &rcClose); - SetWindowPos(hwndClose, NULL, rcDlg.right - INDENT - (rcClose.right - rcClose.left), - rcDlg.bottom - INDENT - (rcClose.bottom - rcClose.top), - 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); - - SetWindowPos(hwndChart, NULL, rcDlg.left + INDENT, - rcChart.top, - (nWidth - INDENT * 2), - nHeight - (rcClose.bottom - rcClose.top) - INDENT * 2 - rcChart.top, - SWP_NOZORDER | SWP_NOACTIVATE); - - } - break; - } - return (FALSE); } -INT_PTR QuotesMenu_Chart(WPARAM wp, LPARAM lp) +INT_PTR QuotesMenu_Chart(WPARAM wp, LPARAM /*lp*/) { - MCONTACT hContact = reinterpret_cast(wp); +#ifdef _UNICODE + MCONTACT hContact = static_cast(wp); if (NULL == hContact) return 0; - HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, true); - assert(hWL); - HWND hWnd = WindowList_Find(hWL, hContact); - if (NULL != hWnd) { - SetForegroundWindow(hWnd); - SetFocus(hWnd); + auto sLogFileName = GetContactLogFileName(hContact); + + if(auto hWnd = ::FindWindow(nullptr,_T("Miranda Quotes Chart"))) + { + COPYDATASTRUCT copydata_struct; + copydata_struct.cbData = static_cast(sLogFileName.size()*sizeof(TCHAR)); + copydata_struct.lpData = const_cast(static_cast(sLogFileName.c_str())); + copydata_struct.dwData = 0x1945; + + SendMessage(hWnd,WM_COPYDATA,0,reinterpret_cast(©data_struct)); } - else CreateDialogParam(CModuleInfo::GetModuleHandle(), MAKEINTRESOURCE(IDD_DUKASCOPY_CHART), NULL, ChartDlgProc, reinterpret_cast(hContact)); + else + { + STARTUPINFO si; + PROCESS_INFORMATION pi; + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + si.dwFlags = STARTF_USESHOWWINDOW; + si.wShowWindow = SW_SHOWNORMAL; + ZeroMemory(&pi, sizeof(pi)); + + auto sCmdLine = CreateFilePath(_T("QuotesChart.exe")); + sCmdLine += _T(" \""); + sCmdLine += sLogFileName; + sCmdLine += _T("\""); + if(::CreateProcess(nullptr,const_cast(sCmdLine.c_str()),nullptr,nullptr,FALSE,0,nullptr,nullptr,&si,&pi)) + { + CMyJob::GetInstance().AssignProcess(pi.hProcess); + ::CloseHandle(pi.hThread); + ::CloseHandle(pi.hProcess); + } + } +#endif return 0; } diff --git a/plugins/Quotes/src/QuoteChart.h b/plugins/Quotes/src/QuoteChart.h index bbbc473b7b..baaf6826b8 100644 --- a/plugins/Quotes/src/QuoteChart.h +++ b/plugins/Quotes/src/QuoteChart.h @@ -1,10 +1,10 @@ #ifndef __39BE8775_A837_494f_925C_0ABF7910F238_QuoteChart_h__ #define __39BE8775_A837_494f_925C_0ABF7910F238_QuoteChart_h__ -#ifdef CHART_IMPLEMENT - #pragma once +#ifdef CHART_IMPLEMENT + INT_PTR QuotesMenu_Chart(WPARAM wp, LPARAM lp); #endif diff --git a/plugins/Quotes/src/resource.h b/plugins/Quotes/src/resource.h index 883d45b747..d1c78c3a60 100644 --- a/plugins/Quotes/src/resource.h +++ b/plugins/Quotes/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by C:\Code\My code\Miranda NG\plugins\Quotes\res\Forex.rc +// Used by C:\Code\My code\MirandaNG\plugins\Quotes\res\Forex.rc // #define IDD_DIALOG_ECONOMIC_RATES 101 #define IDI_ICON_MAIN 102 @@ -14,8 +14,6 @@ #define IDI_ICON_NOTCHANGED 116 #define IDD_CURRENCY_CONVERTER 116 #define IDI_ICON_CURRENCY_CONVERTER 117 -#define IDD_DUKASCOPY_CHART 117 -#define IDD_CHART 117 #define IDD_DIALOG_QUOTE_INFO_1 118 #define IDI_ICON_REFRESH 118 #define IDD_DIALOG_OPT_FINANCE 119 @@ -71,7 +69,6 @@ #define IDC_BUTTON_LOG_FILE_DESCRIPTION2 1037 #define IDC_BUTTON_POPUP_FORMAT_DESCRIPTION 1037 #define IDC_EDIT_RESULT 1039 -#define IDC_STATIC_IMAGE 1056 #define IDC_EDIT_QUOTE 1059 #define IDC_BUTTON_SWAP 1060 #define IDC_BUTTON_ADVANCED_SETTINGS 1061 @@ -83,11 +80,7 @@ #define IDC_MFCCOLORBUTTON1 1066 #define IDC_CHECK1 1067 #define IDC_CHECK_DONT_USE_POPUPHISTORY 1067 -#define IDC_COMBO_DATA_SOURCE 1068 -#define IDC_COMBO_FILTER 1069 -#define IDC_EDIT_FROM 1070 #define IDC_EDIT_FROM2 1071 -#define IDC_EDIT_TO 1071 #define IDC_STATIC_PROVIDER_NAME 1071 #define IDC_DELAY 1072 #define IDC_EDIT1 1072 diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index fe0bde6b88..838c01b6e9 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -105,6 +105,7 @@ inline tstring quotes_a2t(const char* s) #include "QuotesProviderVisitorFormater.h" #include "QuotesProviderVisitorTendency.h" #include "QuotesProviderVisitorFormatSpecificator.h" +#define CHART_IMPLEMENT #ifdef CHART_IMPLEMENT #include "QuoteChart.h" #include "Chart.h" diff --git a/plugins/Quotes/src/version.h b/plugins/Quotes/src/version.h index d70663520b..d4a5f05be4 100644 --- a/plugins/Quotes/src/version.h +++ b/plugins/Quotes/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 1 #define __RELEASE_NUM 0 -#define __BUILD_NUM 1 +#define __BUILD_NUM 101 #include -- cgit v1.2.3