| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 
 | /*
--NOTICE--
 pour compiler :
 g++ main.cpp -o irregular `xml2-config --cflags --libs` `fltk2-config --cxxflags --ldflags`
 
*/
#include <iostream>
#include <list>
#include <string>
//fltk libraries hedears
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/run.h>
#include <fltk/ask.h>
#include <fltk/Input.h>
#include <fltk/ReturnButton.h>
//xml parser libs for irregular verbs list file
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/debugXML.h>
using namespace fltk;
using namespace std;
//#include "alea.cpp"
//#include "xml.cpp"
//this is the class for a declination of a verb
class Forms
{
	private:
	Window *main_window;
	public:
	Forms (xmlDocPtr, long);
	void draw();
	void check();
	//~Forms ();
};
	Forms::Forms (xmlDocPtr doc, long id)
	{
		list<Input*> fields;
    		xmlNodePtr noeud;
		noeud = xmlDocGetRootElement(doc)->children->children;
		long x= 20;
		for (xmlNodePtr n = noeud; n != NULL; n = n->next)
			{
				if ((n->type == XML_ELEMENT_NODE) && (n->children != NULL)) 
					{
					Input *o = new Input(x, 15, 150, 25, (char *)n->name );
					o->align(ALIGN_TOP);
					x = x + 160;
					fields.push_back(o);
		   			}
			}
	}
	
	void Forms::draw()
	{
	}
void verify(Widget*)
{
	
}
int main(int argc, char **argv) 
{
	Window *main_window = new Window(650, 90);
	main_window->begin();
		ReturnButton* returnb = new ReturnButton(570, 55, 70, 25, "verify");
		returnb->shortcut(0xff0d);
		returnb->align(ALIGN_INSIDE);
		returnb->callback(verify);
		
			string filename("verbs.xml");
	xmlKeepBlanksDefault(0); 
	xmlDocPtr doc;
	doc = xmlParseFile(filename.c_str());
	Forms anais(doc,1);
		
		
	main_window->end();
	main_window->show(argc, argv);
	
	
	
	/*
	main_window->begin();
		main_window->redraw();
	main_window->end();
	*/
	return run();
} | 
Partager