📄 tsimpleplotxy.cpp
字号:
/* 2008 (c) Dorival M. Pedroso */// STL#include <iostream>// FLTK#include <FL/Fl.H>#include <FL/Fl_Double_Window.H>// Local#include "array.h"#include "plotxy.h"#include "fatal.h"///////////////////////////////////////////////////////////////////// MainWindow /////// MainWindowclass MainWindow : public Fl_Double_Window{public: // Constructor MainWindow(int wid=420, int hei=320) : Fl_Double_Window (wid,hei,"Test PlotXY") { // Add widgets to window begin(); // Widgets _wp = new PlotXY (/*xmin*/10, /*ymin*/10, /*width*/400, /*height*/300, "Simple PlotXY", "The X", "The Y"); end(); // Calculate coordinates for (int i=0; i<=20; ++i) { _X.Push(i); _Y.Push(i*i); } // Add curve to plotXY _wp->AddCurve (&_X, &_Y, "XY"); _wp->SetCurve (0).Clr = FL_BLUE; // Set resizable and show window resizable (this); show (); }private: // Widgets PlotXY * _wp; // Variables Array<double> _X; Array<double> _Y;}; // class MainWindow/////////////////////////////////////////////////////////////////////////// main /////int main(int argc, char **argv) try{ MainWindow win; Fl::run(); return 0;}catch (Fatal * e){ e->Cout(); delete e; exit(1);}catch (char const * m){ std::cout << "Fatal: " << m << std::endl; exit (1);}catch (...){ std::cout << "Some exception (...) ocurred\n";}/* 2008 (c) Dorival M. Pedroso */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -