[ create a new paste ] login | about

Link: http://codepad.org/GnZHzOVr    [ raw code | output | fork ]

C++, pasted on Jan 4:
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
#include "../../../std_lib_facilities.h"
#include "../../../Point.h"
#include "../../../Graph.h"
#include "../../../GUI.h"
#include "../../../Simple_window.h"
#include "../../../Window.h"
#include <conio.h>

using namespace Graph_lib;




struct Coulomb_window :Window{
	Coulomb_window(Point xy, int w, int h, const string& title );

private:
	Circle circle;
	Button start_button;
	static void cb_start(Address,Address);
	void start();
};




Coulomb_window::Coulomb_window(Point xy, int w, int h, const string& title )
	:Window(xy,w,h,title),
	circle(Point(100,100),50),
	start_button(Point(x_max()-150,5),40,20,"start",cb_start)
	
{
	circle.set_fill_color(Color::red);
	circle.set_color(Color::invisible);
	attach(circle);
	attach(start_button);
};



void Coulomb_window::cb_start(Address,Address pw)
{
	reference_to<Coulomb_window>(pw).start();
};


//円を動かす
void Coulomb_window::start()
{
	while(1){               
		if(_kbhit() && (_getch() == 'q')) {    //qキーを押すと、ループから抜ける
			break;
		}else if(_kbhit() && (_getch() == 'a')){  //aキーを押すと、右へ10移動
			circle.move(10,0);
			redraw();
		}
	}
}



int main()
try{
	Coulomb_window win(Point(100,100),600,400,"Coulomb's_law");
	return gui_main();
}

catch(exception& e) {
	cerr << "exception: " << e.what() << '\n';
	return 1;
}
catch (...) {
	cerr << "some exception\n";
	return 2;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
Line 18: error: FL/Fl.H: No such file or directory
Line 22: error: FL/Fl_Box.H: No such file or directory
Line 25: error: FL/Fl_Window.H: No such file or directory
Line 40: error: ../../../std_lib_facilities.h: No such file or directory
Line 27: error: ../../../Point.h: No such file or directory
Line 27: error: ../../../Graph.h: No such file or directory
Line 25: error: ../../../GUI.h: No such file or directory
Line 35: error: ../../../Simple_window.h: No such file or directory
Line 28: error: ../../../Window.h: No such file or directory
Line 18: error: conio.h: No such file or directory
Line 12: error: 'Graph_lib' is not a namespace-name
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: