From: <jam...@us...> - 2006-10-28 15:45:43
|
Revision: 6 http://svn.sourceforge.net/nplot/?rev=6&view=rev Author: jamcquay Date: 2006-10-28 08:45:20 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Ported the NPlot Demo application to C++.Net Added Paths: ----------- trunk/demo/cpp/ trunk/demo/cpp/AssemblyInfo.cpp trunk/demo/cpp/AxisTestsForm.cpp trunk/demo/cpp/AxisTestsForm.h trunk/demo/cpp/AxisTestsForm.resx trunk/demo/cpp/FinancialDemo.cpp trunk/demo/cpp/FinancialDemo.h trunk/demo/cpp/FinancialDemo.resx trunk/demo/cpp/MenuForm.cpp trunk/demo/cpp/MenuForm.h trunk/demo/cpp/MenuForm.resx trunk/demo/cpp/NPlotDemo.sln trunk/demo/cpp/PlotSurface2DDemo.cpp trunk/demo/cpp/PlotSurface2DDemo.h trunk/demo/cpp/PlotSurface2DDemo.resx trunk/demo/cpp/ReadMe.txt trunk/demo/cpp/app.ico trunk/demo/cpp/app.rc trunk/demo/cpp/asx_jbh.xml trunk/demo/cpp/cpp.vcproj trunk/demo/cpp/light.wav trunk/demo/cpp/pattern01.jpg trunk/demo/cpp/resource.h trunk/demo/cpp/stdafx.cpp trunk/demo/cpp/stdafx.h Added: trunk/demo/cpp/AssemblyInfo.cpp =================================================================== --- trunk/demo/cpp/AssemblyInfo.cpp (rev 0) +++ trunk/demo/cpp/AssemblyInfo.cpp 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,71 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "stdafx.h" + +using namespace System; +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; +using namespace System::Runtime::InteropServices; +using namespace System::Security::Permissions; + +// +// 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:AssemblyTitleAttribute("cpp")]; +[assembly:AssemblyDescriptionAttribute("")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("")]; +[assembly:AssemblyProductAttribute("cpp")]; +[assembly:AssemblyCopyrightAttribute("Copyright (c) 2006")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the value or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly:AssemblyVersionAttribute("1.0.*")]; + +[assembly:ComVisible(false)]; + +[assembly:CLSCompliantAttribute(true)]; + +[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; Property changes on: trunk/demo/cpp/AssemblyInfo.cpp ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/AxisTestsForm.cpp =================================================================== --- trunk/demo/cpp/AxisTestsForm.cpp (rev 0) +++ trunk/demo/cpp/AxisTestsForm.cpp 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,83 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "StdAfx.h" +#include "AxisTestsForm.h" + +namespace NPlotDemo { + + CAxisTestsForm::CAxisTestsForm(void) + { + InitializeComponent(); + + this->Paint += gcnew PaintEventHandler(this,&NPlotDemo::CAxisTestsForm::Tests_Paint); + } + + System::Void CAxisTestsForm::Tests_Paint(System::Object^ sender, PaintEventArgs^ e) + { + System::Drawing::Rectangle boundingBox; + + NPlot::LinearAxis^ a = gcnew NPlot::LinearAxis(0, 10); + a->Draw( e->Graphics, (Point)gcnew Point(10,10), (Point)gcnew Point(10, 200), boundingBox ); + + a->Reversed = true; + a->Draw( e->Graphics, (Point)gcnew Point(40,10), (Point)gcnew Point(40, 200), boundingBox ); + + a->SmallTickSize = 0; + a->Draw( e->Graphics, (Point)gcnew Point(70,10), (Point)gcnew Point(70, 200), boundingBox ); + + a->LargeTickStep = 2.5; + a->Draw( e->Graphics, (Point)gcnew Point(100,10), (Point)gcnew Point(100,200), boundingBox ); + + a->NumberOfSmallTicks = 5; + a->SmallTickSize = 2; + a->Draw( e->Graphics, (Point)gcnew Point(130,10), (Point)gcnew Point(130,200), boundingBox ); + + a->AxisColor = Color::Cyan; + a->Draw( e->Graphics, (Point)gcnew Point(160,10), (Point)gcnew Point(160,200), boundingBox ); + + a->TickTextColor= Color::Cyan; + a->Draw( e->Graphics, (Point)gcnew Point(190,10), (Point)gcnew Point(190,200), boundingBox ); + + a->TickTextBrush = Brushes::Black; + a->AxisPen = Pens::Black; + a->Draw( e->Graphics, (Point)gcnew Point(220,10), (Point)gcnew Point(280,200), boundingBox ); + + a->WorldMax = 100000; + a->WorldMin = -3; + a->LargeTickStep = System::Double::NaN; + a->Draw( e->Graphics, (Point)gcnew Point(310,10), (Point)gcnew Point(310,200), boundingBox ); + + a->NumberFormat = "{0:0.0E+0}"; + a->Draw( e->Graphics, (Point)gcnew Point(360,10), (Point)gcnew Point(360,200), boundingBox ); + } +} + Property changes on: trunk/demo/cpp/AxisTestsForm.cpp ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/AxisTestsForm.h =================================================================== --- trunk/demo/cpp/AxisTestsForm.h (rev 0) +++ trunk/demo/cpp/AxisTestsForm.h 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,98 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +using namespace System; +using namespace System::ComponentModel; +using namespace System::Collections; +using namespace System::Windows::Forms; +using namespace System::Data; +using namespace System::Drawing; + + +namespace NPlotDemo { + + /// <summary> + /// Summary for CAxisTestsForm + /// + /// WARNING: If you change the name of this class, you will need to change the + /// 'Resource File Name' property for the managed resource compiler tool + /// associated with all .resx files this class depends on. Otherwise, + /// the designers will not be able to interact properly with localized + /// resources associated with this form. + /// </summary> + public ref class CAxisTestsForm : public System::Windows::Forms::Form + { + public: + CAxisTestsForm(void); + + protected: + /// <summary> + /// Clean up any resources being used. + /// </summary> + ~CAxisTestsForm() + { + if (components) + { + delete components; + } + } + + private: + /// <summary> + /// Required designer variable. + /// </summary> + System::ComponentModel::Container ^components; + System::Void CAxisTestsForm::Tests_Paint(System::Object^ sender, PaintEventArgs^ e); + +#pragma region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + void InitializeComponent(void) + { + this->SuspendLayout(); + // + // CAxisTestsForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(460, 352); + this->Name = L"CAxisTestsForm"; + this->Text = L"Axis Test"; + this->ResumeLayout(false); + + } +#pragma endregion + }; +} Property changes on: trunk/demo/cpp/AxisTestsForm.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/AxisTestsForm.resx =================================================================== --- trunk/demo/cpp/AxisTestsForm.resx (rev 0) +++ trunk/demo/cpp/AxisTestsForm.resx 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Property changes on: trunk/demo/cpp/AxisTestsForm.resx ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/FinancialDemo.cpp =================================================================== --- trunk/demo/cpp/FinancialDemo.cpp (rev 0) +++ trunk/demo/cpp/FinancialDemo.cpp 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,158 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "StdAfx.h" +#include "FinancialDemo.h" + +namespace NPlotDemo { + + CFinancialDemo::CFinancialDemo(void) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + costPS->Clear(); + costPS->DateTimeToolTip = true; + + // obtain stock information from xml file + DataSet^ ds = gcnew DataSet(); + System::IO::Stream^ file = (System::IO::Stream^) + System::Reflection::Assembly::GetExecutingAssembly()->GetManifestResourceStream("asx_jbh.xml"); + ds->ReadXml(file, System::Data::XmlReadMode::ReadSchema); + DataTable^ dt = ds->Tables[0]; + DataView^ dv = gcnew DataView(dt); + + // create CandlePlot. + CandlePlot^ cp = gcnew CandlePlot(); + cp->DataSource = dt; + cp->AbscissaData = "Date"; + cp->OpenData = "Open"; + cp->LowData = "Low"; + cp->HighData = "High"; + cp->CloseData = "Close"; + cp->BearishColor = Color::Red; + cp->BullishColor = Color::Green; + cp->Style = CandlePlot::Styles::Filled; + costPS->SmoothingMode = System::Drawing::Drawing2D::SmoothingMode::AntiAlias; + costPS->Add(gcnew Grid()); + costPS->Add(cp); + costPS->Title = "AU:JBH"; + costPS->YAxis1->Label = "Price [$]"; + costPS->YAxis1->LabelOffset = 40; + costPS->YAxis1->LabelOffsetAbsolute = true; + costPS->XAxis1->HideTickText = true; + costPS->Padding = 5; + costPS->AddInteraction(gcnew NPlot::Windows::PlotSurface2D::Interactions::HorizontalDrag()); + costPS->AddInteraction(gcnew NPlot::Windows::PlotSurface2D::Interactions::VerticalDrag()); + costPS->AddInteraction(gcnew NPlot::Windows::PlotSurface2D::Interactions::AxisDrag(false)); + costPS->InteractionOccured += gcnew NPlot::Windows::PlotSurface2D::InteractionHandler(this,&NPlotDemo::CFinancialDemo::costPS_InteractionOccured); + costPS->AddAxesConstraint(gcnew AxesConstraint::AxisPosition(PlotSurface2D::YAxisPosition::Left, 60)); + + PointPlot^ pp = gcnew PointPlot(); + pp->Marker = gcnew Marker(Marker::MarkerType::Square, 0); + pp->Marker->Pen = gcnew Pen(Color::Red, 5.0f); + pp->Marker->DropLine = true; + pp->DataSource = dt; + pp->AbscissaData = "Date"; + pp->OrdinateData = "Volume"; + volumePS->Add(pp); + volumePS->YAxis1->Label = "Volume"; + volumePS->YAxis1->LabelOffsetAbsolute = true; + volumePS->YAxis1->LabelOffset = 40; + volumePS->Padding = 5; + volumePS->AddAxesConstraint(gcnew AxesConstraint::AxisPosition(PlotSurface2D::YAxisPosition::Left, 60)); + volumePS->AddInteraction(gcnew NPlot::Windows::PlotSurface2D::Interactions::AxisDrag(false)); + volumePS->AddInteraction(gcnew NPlot::Windows::PlotSurface2D::Interactions::HorizontalDrag()); + volumePS->InteractionOccured += gcnew NPlot::Windows::PlotSurface2D::InteractionHandler(this,&NPlotDemo::CFinancialDemo::volumePS_InteractionOccured); + volumePS->PreRefresh += gcnew NPlot::Windows::PlotSurface2D::PreRefreshHandler(this,&NPlotDemo::CFinancialDemo::volumePS_PreRefresh); + + costPS->RightMenu = gcnew ReducedContextMenu(); + } + + /// <summary> + /// Callback for close button. + /// </summary> + System::Void CFinancialDemo::closeButton_Click(System::Object^ sender, System::EventArgs^ e) + { + Close(); + } + + /// <summary> + /// When the costPS chart has changed, this is called which updates the volumePS chart. + /// </summary> + /// <param name="sender"></param> + System::Void CFinancialDemo::costPS_InteractionOccured(System::Object^ sender) + { + DateTimeAxis^ axis = gcnew DateTimeAxis(costPS->XAxis1); + axis->Label = "Date / Time"; + axis->HideTickText = false; + volumePS->XAxis1 = axis; + volumePS->Refresh(); + } + + + /// <summary> + /// When the volumePS chart has changed, this is called which updates hte costPS chart. + /// </summary> + System::Void CFinancialDemo::volumePS_InteractionOccured(System::Object^ sender) + { + DateTimeAxis^ axis = gcnew DateTimeAxis(volumePS->XAxis1); + axis->Label = ""; + axis->HideTickText = true; + costPS->XAxis1 = axis; + costPS->Refresh(); + } + + /// <summary> + /// This is called prior to volumePS refresh to enforce the WorldMin is 0. + /// This may have been changed by the axisdrag interaction. + /// </summary> + /// <param name="sender"></param> + System::Void CFinancialDemo::volumePS_PreRefresh(System::Object^ sender) + { + volumePS->YAxis1->WorldMin = 0.0; + } + + System::Void CFinancialDemo::CFinancialDemo_Resize(System::Object^ sender, System::EventArgs^ e) + { + costPS->Height = (int)(0.5 * (this->Height)); + costPS->Width = (int)(this->Width - 35); + + volumePS->Top = costPS->Height + 12; + volumePS->Height = this->Height - (costPS->Height + 25) - 80; + volumePS->Width = (int)(this->Width - 35); + + //OnResize(e); + } +} + Property changes on: trunk/demo/cpp/FinancialDemo.cpp ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/FinancialDemo.h =================================================================== --- trunk/demo/cpp/FinancialDemo.h (rev 0) +++ trunk/demo/cpp/FinancialDemo.h 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,199 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +using namespace System; +using namespace System::ComponentModel; +using namespace System::Collections; +using namespace System::Windows::Forms; +using namespace System::Data; +using namespace System::Drawing; + +using namespace NPlot; + +namespace NPlotDemo { + + /// <summary> + /// Summary for FinancialDemo + /// + /// WARNING: If you change the name of this class, you will need to change the + /// 'Resource File Name' property for the managed resource compiler tool + /// associated with all .resx files this class depends on. Otherwise, + /// the designers will not be able to interact properly with localized + /// resources associated with this form. + /// </summary> + public ref class CFinancialDemo : public System::Windows::Forms::Form + { + public: + CFinancialDemo(void); + + protected: + /// <summary> + /// Clean up any resources being used. + /// </summary> + ~CFinancialDemo() + { + if (components) + { + delete components; + } + } + + private: + System::Void costPS_InteractionOccured(System::Object^ sender); + System::Void volumePS_InteractionOccured(System::Object^ sender); + System::Void volumePS_PreRefresh(System::Object^ sender); + + + private: System::Windows::Forms::Button^ closeButton; + private: NPlot::Windows::PlotSurface2D^ costPS; + private: NPlot::Windows::PlotSurface2D^ volumePS; + protected: + + private: + /// <summary> + /// Required designer variable. + /// </summary> + System::ComponentModel::Container ^components; + +#pragma region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + void InitializeComponent(void) + { + this->closeButton = (gcnew System::Windows::Forms::Button()); + this->costPS = (gcnew NPlot::Windows::PlotSurface2D()); + this->volumePS = (gcnew NPlot::Windows::PlotSurface2D()); + this->SuspendLayout(); + // + // closeButton + // + this->closeButton->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left)); + this->closeButton->Location = System::Drawing::Point(13, 421); + this->closeButton->Name = L"closeButton"; + this->closeButton->Size = System::Drawing::Size(75, 23); + this->closeButton->TabIndex = 0; + this->closeButton->Text = L"Close"; + this->closeButton->UseVisualStyleBackColor = true; + this->closeButton->Click += gcnew System::EventHandler(this, &CFinancialDemo::closeButton_Click); + // + // costPS + // + this->costPS->AutoScaleAutoGeneratedAxes = false; + this->costPS->AutoScaleTitle = false; + this->costPS->BackColor = System::Drawing::SystemColors::ControlLightLight; + this->costPS->DateTimeToolTip = false; + this->costPS->Legend = nullptr; + this->costPS->LegendZOrder = 1; + this->costPS->Location = System::Drawing::Point(13, 13); + this->costPS->Name = L"costPS"; + this->costPS->RightMenu = nullptr; + this->costPS->ShowCoordinates = true; + this->costPS->Size = System::Drawing::Size(606, 285); + this->costPS->SmoothingMode = System::Drawing::Drawing2D::SmoothingMode::None; + this->costPS->TabIndex = 1; + this->costPS->Text = L"plotSurface2D1"; + this->costPS->Title = L""; + this->costPS->TitleFont = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Pixel)); + this->costPS->XAxis1 = nullptr; + this->costPS->XAxis2 = nullptr; + this->costPS->YAxis1 = nullptr; + this->costPS->YAxis2 = nullptr; + // + // volumePS + // + this->volumePS->AutoScaleAutoGeneratedAxes = false; + this->volumePS->AutoScaleTitle = false; + this->volumePS->BackColor = System::Drawing::SystemColors::ControlLightLight; + this->volumePS->DateTimeToolTip = false; + this->volumePS->Legend = nullptr; + this->volumePS->LegendZOrder = 1; + this->volumePS->Location = System::Drawing::Point(13, 305); + this->volumePS->Name = L"volumePS"; + this->volumePS->RightMenu = nullptr; + this->volumePS->ShowCoordinates = true; + this->volumePS->Size = System::Drawing::Size(606, 109); + this->volumePS->SmoothingMode = System::Drawing::Drawing2D::SmoothingMode::None; + this->volumePS->TabIndex = 2; + this->volumePS->Text = L"plotSurface2D1"; + this->volumePS->Title = L""; + this->volumePS->TitleFont = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Pixel)); + this->volumePS->XAxis1 = nullptr; + this->volumePS->XAxis2 = nullptr; + this->volumePS->YAxis1 = nullptr; + this->volumePS->YAxis2 = nullptr; + // + // CFinancialDemo + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(631, 450); + this->Controls->Add(this->volumePS); + this->Controls->Add(this->costPS); + this->Controls->Add(this->closeButton); + this->Name = L"CFinancialDemo"; + this->Text = L"FinancialDemo"; + this->Resize += gcnew System::EventHandler(this, &CFinancialDemo::CFinancialDemo_Resize); + this->ResumeLayout(false); + + } +#pragma endregion + private: System::Void closeButton_Click(System::Object^ sender, System::EventArgs^ e); + private: System::Void CFinancialDemo_Resize(System::Object^ sender, System::EventArgs^ e); +}; + + /// <summary> + /// Right context menu with non-default functionality. Just take out some functionality. Could also have added some. + /// </summary> + public ref class ReducedContextMenu : NPlot::Windows::PlotSurface2D::PlotContextMenu + { + + /// <summary> + /// Constructor + /// </summary> + public: + ReducedContextMenu() + { + ArrayList^ menuItems = MenuItems; + + // remove show coordinates, and print functionality + menuItems->RemoveAt(4); + menuItems->RemoveAt(3); + menuItems->RemoveAt(1); + + SetMenuItems(menuItems); + } + + }; +} Property changes on: trunk/demo/cpp/FinancialDemo.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/FinancialDemo.resx =================================================================== --- trunk/demo/cpp/FinancialDemo.resx (rev 0) +++ trunk/demo/cpp/FinancialDemo.resx 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Property changes on: trunk/demo/cpp/FinancialDemo.resx ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/MenuForm.cpp =================================================================== --- trunk/demo/cpp/MenuForm.cpp (rev 0) +++ trunk/demo/cpp/MenuForm.cpp 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,73 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "stdafx.h" +#include "MenuForm.h" +#include "PlotSurface2DDemo.h" +#include "FinancialDemo.h" +#include "AxisTestsForm.h" + +using namespace NPlotDemo; + +[STAThreadAttribute] +int main(array<System::String ^> ^args) +{ + // Enabling Windows XP visual effects before any controls are created + Application::EnableVisualStyles(); + Application::SetCompatibleTextRenderingDefault(false); + + // Create the main window and run it + Application::Run(gcnew CMenuForm()); + return 0; +} + +CMenuForm::CMenuForm(void) +{ + InitializeComponent(); +} + +System::Void CMenuForm::plotSurface2DDemoButton_Click(System::Object^ sender, System::EventArgs^ e) +{ + displayForm_ = gcnew CPlotSurface2DDemo(); + displayForm_->ShowDialog(); +} + +System::Void CMenuForm::multiPlotDemoButton_Click(System::Object^ sender, System::EventArgs^ e) +{ + displayForm_ = gcnew CFinancialDemo(); + displayForm_->ShowDialog(); +} + +System::Void CMenuForm::testAxis_Click(System::Object^ sender, System::EventArgs^ e) +{ + displayForm_ = gcnew CAxisTestsForm(); + displayForm_->ShowDialog(); +} \ No newline at end of file Property changes on: trunk/demo/cpp/MenuForm.cpp ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/MenuForm.h =================================================================== --- trunk/demo/cpp/MenuForm.h (rev 0) +++ trunk/demo/cpp/MenuForm.h 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,165 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + + +namespace NPlotDemo { + + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + + /// <summary> + /// Summary for Form1 + /// + /// WARNING: If you change the name of this class, you will need to change the + /// 'Resource File Name' property for the managed resource compiler tool + /// associated with all .resx files this class depends on. Otherwise, + /// the designers will not be able to interact properly with localized + /// resources associated with this form. + /// </summary> + public ref class CMenuForm : public System::Windows::Forms::Form + { + public: + CMenuForm(void); + + protected: + /// <summary> + /// Clean up any resources being used. + /// </summary> + ~CMenuForm() + { + if (components) + { + delete components; + } + } + private: System::Windows::Forms::Button^ quitButton; + private: System::Windows::Forms::Button^ plotSurface2DDemoButton; + private: System::Windows::Forms::Button^ multiPlotDemoButton; + + private: ArrayList^ testItems; + private: System::Windows::Forms::Button^ testAxis; + protected: + + private: + /// <summary> + /// Required designer variable. + /// </summary> + System::ComponentModel::Container ^components; + +#pragma region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + void InitializeComponent(void) + { + this->quitButton = (gcnew System::Windows::Forms::Button()); + this->plotSurface2DDemoButton = (gcnew System::Windows::Forms::Button()); + this->multiPlotDemoButton = (gcnew System::Windows::Forms::Button()); + this->testAxis = (gcnew System::Windows::Forms::Button()); + this->SuspendLayout(); + // + // quitButton + // + this->quitButton->Location = System::Drawing::Point(50, 163); + this->quitButton->Name = L"quitButton"; + this->quitButton->Size = System::Drawing::Size(75, 23); + this->quitButton->TabIndex = 0; + this->quitButton->Text = L"Quit"; + this->quitButton->UseVisualStyleBackColor = true; + this->quitButton->Click += gcnew System::EventHandler(this, &CMenuForm::quitButton_Click); + // + // plotSurface2DDemoButton + // + this->plotSurface2DDemoButton->Location = System::Drawing::Point(22, 12); + this->plotSurface2DDemoButton->Name = L"plotSurface2DDemoButton"; + this->plotSurface2DDemoButton->Size = System::Drawing::Size(130, 23); + this->plotSurface2DDemoButton->TabIndex = 1; + this->plotSurface2DDemoButton->Text = L"PlotSurface2D Demo"; + this->plotSurface2DDemoButton->UseVisualStyleBackColor = true; + this->plotSurface2DDemoButton->Click += gcnew System::EventHandler(this, &CMenuForm::plotSurface2DDemoButton_Click); + // + // multiPlotDemoButton + // + this->multiPlotDemoButton->Location = System::Drawing::Point(22, 40); + this->multiPlotDemoButton->Name = L"multiPlotDemoButton"; + this->multiPlotDemoButton->Size = System::Drawing::Size(130, 23); + this->multiPlotDemoButton->TabIndex = 2; + this->multiPlotDemoButton->Text = L"Multi Plot Demo"; + this->multiPlotDemoButton->UseVisualStyleBackColor = true; + this->multiPlotDemoButton->Click += gcnew System::EventHandler(this, &CMenuForm::multiPlotDemoButton_Click); + // + // testAxis + // + this->testAxis->Location = System::Drawing::Point(22, 68); + this->testAxis->Name = L"testAxis"; + this->testAxis->Size = System::Drawing::Size(130, 23); + this->testAxis->TabIndex = 3; + this->testAxis->Text = L"Axis Test"; + this->testAxis->UseVisualStyleBackColor = true; + this->testAxis->Click += gcnew System::EventHandler(this, &CMenuForm::testAxis_Click); + // + // CMenuForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(175, 198); + this->Controls->Add(this->testAxis); + this->Controls->Add(this->multiPlotDemoButton); + this->Controls->Add(this->plotSurface2DDemoButton); + this->Controls->Add(this->quitButton); + this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle; + this->Name = L"CMenuForm"; + this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen; + this->Text = L"NPlot Demo"; + this->ResumeLayout(false); + + } +#pragma endregion + private: System::Void quitButton_Click(System::Object^ sender, System::EventArgs^ e) { + Application::Exit(); + } + + private: System::Void plotSurface2DDemoButton_Click(System::Object^ sender, System::EventArgs^ e); + + private: System::Windows::Forms::Form^ displayForm_; + private: System::Void multiPlotDemoButton_Click(System::Object^ sender, System::EventArgs^ e); + private: System::Void testAxis_Click(System::Object^ sender, System::EventArgs^ e); +}; +} + + Property changes on: trunk/demo/cpp/MenuForm.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/MenuForm.resx =================================================================== --- trunk/demo/cpp/MenuForm.resx (rev 0) +++ trunk/demo/cpp/MenuForm.resx 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Property changes on: trunk/demo/cpp/MenuForm.resx ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/NPlotDemo.sln =================================================================== --- trunk/demo/cpp/NPlotDemo.sln (rev 0) +++ trunk/demo/cpp/NPlotDemo.sln 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp", "cpp.vcproj", "{BE128E3B-BAEE-45B6-B341-83D13415E2EA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BE128E3B-BAEE-45B6-B341-83D13415E2EA}.Debug|Win32.ActiveCfg = Debug|Win32 + {BE128E3B-BAEE-45B6-B341-83D13415E2EA}.Debug|Win32.Build.0 = Debug|Win32 + {BE128E3B-BAEE-45B6-B341-83D13415E2EA}.Release|Win32.ActiveCfg = Release|Win32 + {BE128E3B-BAEE-45B6-B341-83D13415E2EA}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: trunk/demo/cpp/NPlotDemo.sln ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/demo/cpp/PlotSurface2DDemo.cpp =================================================================== --- trunk/demo/cpp/PlotSurface2DDemo.cpp (rev 0) +++ trunk/demo/cpp/PlotSurface2DDemo.cpp 2006-10-28 15:45:20 UTC (rev 6) @@ -0,0 +1,1625 @@ +/* + * NPlot - A charting library for .NET + * + * PlotSurface2DDemo.cs + * Copyright (C) 2003-2006 Matt Howlett, Jamie McQuay. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of NPlot nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "StdAfx.h" +#include "PlotSurface2DDemo.h" + +namespace NPlotDemo { + + CPlotSurface2DDemo::CPlotSurface2DDemo(void) + { + InitializeComponent(); + + plotSurface->Anchor = + System::Windows::Forms::AnchorStyles::Left | + System::Windows::Forms::AnchorSt... [truncated message content] |