Removing plot sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#
|
||||
# File: Makefile.in
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for plot example (UNIX).
|
||||
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../..
|
||||
program_dir = samples/plot
|
||||
|
||||
PROGRAM=plot
|
||||
|
||||
OBJECTS=$(PROGRAM).o
|
||||
|
||||
include ../../src/makeprog.env
|
||||
|
@@ -1,175 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="PlotVC" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=PlotVC - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "PlotVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "PlotVC.mak" CFG="PlotVC - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PlotVC - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlotVC - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlotVC - Win32 Debug DLL" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "PlotVC - Win32 Release DLL" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "PlotVC - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/plot.exe" /libpath:"../../lib" /libpath:"../../contrib/lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlotVC - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib xpmd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/plot.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlotVC - Win32 Debug DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "DebugDLL"
|
||||
# PROP BASE Intermediate_Dir "DebugDLL"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "DebugDLL"
|
||||
# PROP Intermediate_Dir "DebugDLL"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /Yu"wx/wxprec.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxdlld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"DebugDLL/plot.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlotVC - Win32 Release DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseDLL"
|
||||
# PROP BASE Intermediate_Dir "ReleaseDLL"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseDLL"
|
||||
# PROP Intermediate_Dir "ReleaseDLL"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxdll.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"ReleaseDLL/plot.exe" /libpath:"../../lib" /libpath:"../../contrib/lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "PlotVC - Win32 Release"
|
||||
# Name "PlotVC - Win32 Debug"
|
||||
# Name "PlotVC - Win32 Debug DLL"
|
||||
# Name "PlotVC - Win32 Release DLL"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\plot.cpp
|
||||
|
||||
!IF "$(CFG)" == "PlotVC - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlotVC - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlotVC - Win32 Debug DLL"
|
||||
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "PlotVC - Win32 Release DLL"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\plot.rc
|
||||
# ADD BASE RSC /l 0x809
|
||||
# ADD RSC /l 0x809 /i "../../include" /i "../../contrib/include"
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
@@ -1,29 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "PlotVC"=.\PlotVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# File: makefile.b32
|
||||
# Author: Julian Smart
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright:
|
||||
#
|
||||
# Makefile : Builds sample for 32-bit BC++
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
TARGET=plot
|
||||
OBJECTS = $(TARGET).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.b32
|
||||
|
@@ -1,19 +0,0 @@
|
||||
#
|
||||
# File: makefile.bcc
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
#
|
||||
# Builds a BC++ 16-bit sample
|
||||
|
||||
!if "$(WXWIN)" == ""
|
||||
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||
!endif
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
TARGET=plot
|
||||
OBJECTS=$(TARGET).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.bcc
|
||||
|
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# File: makefile.dos
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
#
|
||||
# Makefile : Builds 16-bit sample, VC++ 1.5
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
TARGET=plot
|
||||
OBJECTS=$(TARGET).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.msc
|
||||
|
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# File: makefile.g95
|
||||
# Author: Julian Smart
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) Julian Smart, 1999
|
||||
#
|
||||
# Makefile for wxWindows sample (Cygwin/Mingw32).
|
||||
|
||||
WXDIR = ../..
|
||||
|
||||
TARGET=plot
|
||||
OBJECTS = $(TARGET).o
|
||||
|
||||
include $(WXDIR)/src/makeprog.g95
|
||||
|
@@ -1,27 +0,0 @@
|
||||
#
|
||||
# File: Makefile for samples
|
||||
# Author: Robert Roebling
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Robert Roebling
|
||||
#
|
||||
# This makefile requires a Unix version of wxWindows
|
||||
# to be installed on your system. This is most often
|
||||
# done typing "make install" when using the complete
|
||||
# sources of wxWindows or by installing the two
|
||||
# RPM packages wxGTK.XXX.rpm and wxGTK-devel.XXX.rpm
|
||||
# under Linux.
|
||||
#
|
||||
|
||||
CC = gcc
|
||||
|
||||
PROGRAM = plot
|
||||
|
||||
$(PROGRAM): $(PROGRAM).o
|
||||
$(CC) -o $(PROGRAM) $(PROGRAM).o `wx-config --libs`
|
||||
|
||||
$(PROGRAM).o: $(PROGRAM).cpp
|
||||
$(CC) `wx-config --cflags` -c $(PROGRAM).cpp
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# File: makefile.vc
|
||||
# Author: Julian Smart
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) Julian Smart
|
||||
#
|
||||
# Makefile : Builds sample (VC++, WIN32)
|
||||
# Use FINAL=1 argument to nmake to build final version with no debug info.
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
PROGRAM=plot
|
||||
OBJECTS = $(PROGRAM).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.vc
|
||||
|
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# Makefile for WATCOM
|
||||
#
|
||||
# Created by Julian Smart, January 1999
|
||||
#
|
||||
#
|
||||
|
||||
WXDIR = $(%WXWIN)
|
||||
|
||||
PROGRAM = plot
|
||||
OBJECTS = $(PROGRAM).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.wat
|
||||
|
||||
|
@@ -1,185 +0,0 @@
|
||||
/*
|
||||
* Program: wxPlotWindow
|
||||
*
|
||||
* Author: Robert Roebling
|
||||
*
|
||||
* Copyright: (C) 1999, Robert Roebling
|
||||
*
|
||||
*/
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/plot.h"
|
||||
|
||||
#include "wx/image.h"
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// derived classes
|
||||
|
||||
class MyPlotCurve;
|
||||
class MyFrame;
|
||||
class MyApp;
|
||||
|
||||
// MyPlotCurve
|
||||
|
||||
class MyPlotCurve: public wxPlotCurve
|
||||
{
|
||||
public:
|
||||
MyPlotCurve( int offsetY, double startY, double endY ) :
|
||||
wxPlotCurve( offsetY, startY, endY ) {}
|
||||
|
||||
virtual wxInt32 GetStartX()
|
||||
{ return 0; }
|
||||
virtual wxInt32 GetEndX()
|
||||
{ return 7000; }
|
||||
|
||||
virtual double GetY( wxInt32 x )
|
||||
{
|
||||
double dx = x;
|
||||
dx /= 100;
|
||||
return sin( dx );
|
||||
}
|
||||
};
|
||||
|
||||
// MyFrame
|
||||
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
MyFrame();
|
||||
|
||||
void OnAbout( wxCommandEvent &event );
|
||||
void OnQuit( wxCommandEvent &event );
|
||||
|
||||
void OnPlotClick( wxPlotEvent &event );
|
||||
void OnPlotDClick( wxPlotEvent &event );
|
||||
|
||||
wxPlotWindow *m_plot;
|
||||
wxTextCtrl *m_log;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(MyFrame)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// MyApp
|
||||
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
};
|
||||
|
||||
// main program
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
// MyFrame
|
||||
|
||||
const int ID_QUIT = 108;
|
||||
const int ID_ABOUT = 109;
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
|
||||
EVT_MENU (ID_ABOUT, MyFrame::OnAbout)
|
||||
EVT_MENU (ID_QUIT, MyFrame::OnQuit)
|
||||
EVT_PLOT_CLICKED ( -1, MyFrame::OnPlotClick)
|
||||
EVT_PLOT_DOUBLECLICKED ( -1, MyFrame::OnPlotDClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MyFrame::MyFrame()
|
||||
: wxFrame( (wxFrame *)NULL, -1, "wxPlotWindow sample",
|
||||
wxPoint(20,20), wxSize(470,500) )
|
||||
{
|
||||
wxMenu *file_menu = new wxMenu();
|
||||
file_menu->Append( ID_ABOUT, "&About..");
|
||||
file_menu->Append( ID_QUIT, "E&xit\tAlt-X");
|
||||
|
||||
wxMenuBar *menu_bar = new wxMenuBar();
|
||||
menu_bar->Append(file_menu, "&File");
|
||||
|
||||
SetMenuBar( menu_bar );
|
||||
|
||||
CreateStatusBar(2);
|
||||
int widths[] = { -1, 100 };
|
||||
SetStatusWidths( 2, widths );
|
||||
|
||||
m_plot = new wxPlotWindow( this, -1, wxPoint(0,0), wxSize(100,100), wxSUNKEN_BORDER | wxPLOT_DEFAULT );
|
||||
m_plot->SetUnitsPerValue( 0.01 );
|
||||
m_plot->SetScrollOnThumbRelease( TRUE );
|
||||
|
||||
m_plot->Add( new MyPlotCurve( 0, -1.5, 1.5 ) );
|
||||
m_plot->Add( new MyPlotCurve( 50, -1.5, 1.5 ) );
|
||||
wxPlotOnOffCurve *oo = new wxPlotOnOffCurve( 10 );
|
||||
oo->Add( 10, 20 );
|
||||
oo->Add( 25, 30 );
|
||||
oo->Add( 100, 400 );
|
||||
oo->Add( 1000, 2000 );
|
||||
m_plot->Add( oo );
|
||||
|
||||
m_log = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,0), wxSize(100,100), wxTE_MULTILINE );
|
||||
wxLog *old_log = wxLog::SetActiveTarget( new wxLogTextCtrl( m_log ) );
|
||||
delete old_log;
|
||||
|
||||
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
topsizer->Add( m_plot, 1, wxEXPAND );
|
||||
topsizer->Add( m_log, 0, wxEXPAND );
|
||||
|
||||
SetAutoLayout( TRUE );
|
||||
SetSizer( topsizer );
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
|
||||
{
|
||||
Close( TRUE );
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
|
||||
{
|
||||
(void)wxMessageBox( "wxPlotWindow Demo\n"
|
||||
"Robert Roebling (c) 1999,2000",
|
||||
"About wxPlotWindow Demo", wxICON_INFORMATION | wxOK );
|
||||
}
|
||||
|
||||
void MyFrame::OnPlotClick( wxPlotEvent &event )
|
||||
{
|
||||
double x = event.GetPosition() * m_plot->GetUnitsPerValue();
|
||||
double y = event.GetCurve()->GetY( event.GetPosition() );
|
||||
wxLogMessage( "Clicked on curve at x coordinate: %f, value: %f", x, y );
|
||||
}
|
||||
|
||||
void MyFrame::OnPlotDClick( wxPlotEvent &event )
|
||||
{
|
||||
double x = event.GetPosition() * m_plot->GetUnitsPerValue();
|
||||
double y = event.GetCurve()->GetY( event.GetPosition() );
|
||||
wxLogMessage( "Double clicked on curve at x coordinate: %f, value: %f", x, y );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// MyApp
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
wxFrame *frame = new MyFrame();
|
||||
frame->Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -1,7 +0,0 @@
|
||||
NAME Plot
|
||||
DESCRIPTION 'wxWindows Plot sample'
|
||||
EXETYPE WINDOWS
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
HEAPSIZE 4048
|
||||
STACKSIZE 16000
|
@@ -1,2 +0,0 @@
|
||||
#include "wx/msw/wx.rc"
|
||||
|
Reference in New Issue
Block a user