Commit 640ce965 authored by Olivier Lagrasse's avatar Olivier Lagrasse
Browse files

avancement interface graphique

parent b35799c3
......@@ -4,14 +4,17 @@ DEBUG=-g -O0
FINAL=-03
all:
cd ./src && qmake-qt4 -project && qmake-qt4 -makefile -o Makefile "CONFIG+=uitools opengl" "DESTDIR = ../bin" src.pro && make all
cd ./src && qmake-qt4 -project "DESTDIR=../bin" "CONFIG+=uitools opengl" && qmake-qt4 -makefile -o Makefile src.pro && make all
debug:
cd ./src && qmake-qt4 -project && qmake-qt4 -makefile -o Makefile "CONFIG+=uitools opengl debug" "DESTDIR = ../debug" src.pro && make all
tests: all
cd ./test && make
clean:
cd ./src && rm *~ *.o
\ No newline at end of file
cd ./src && rm *~ *.o *pro Makefile
\ No newline at end of file
......@@ -22,14 +22,14 @@ class Interface{
\arg string : the string to be displayed.
\brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialof box for the Interface_graphic. Then, it killed the application.
*/
bool error(string);
virtual bool error(string) =0;
/*!
\arg string : the string to be displayed.
\brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialof box for the Interface_graphic. Then the program go on.
*/
bool warning(string);
virtual bool warning(string) =0;
};
......
/*!
*\file interface_console.cpp
*\brief This is the console interface C source code.
*/
#include "interface_console.h"
Interface_console::Interface_console(){
}
Interface_console::~Interface_console(){
}
bool Interface_console::error(string s){
return true;
}
bool Interface_console::warning(string s){
return true;
}
......@@ -7,6 +7,10 @@
#define INTERFACE_CONSOLE_H
#include "interface.h"
/*!
*\brief This class is an terminal interface, it inherited from the Interface interface.
*/
......@@ -14,6 +18,17 @@ class Interface_console : public Interface{
public:
/*!
* \brief The default constructor
*/
Interface_console();
/*!
* \brief The destructor
*/
~Interface_console();
/*!
\arg string : the string to be displayed.
\brief The function takes a string then displayed it into the terminal, then killed the application.
......
......@@ -25,3 +25,13 @@ Interface_graphic::Interface_graphic(){
Interface_graphic::~Interface_graphic(){
delete _main_window;
}
bool Interface_graphic::error(string s){
return true;
}
bool Interface_graphic::warning(string s){
return true;
}
......@@ -11,7 +11,6 @@
#include "interface.h"
#define UI_MAIN_WINDOW_NAME "main_window.ui"/* name of the main window ui file. This file must be included in the same folder than the compiled program. */
......
/*!
*\file main.cpp
*\brief The launcher.
*/
#include "interface_console.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Interface_console console;
return app.exec();
}
<ui version="4.0" >
<class>main_window</class>
<widget class="QMainWindow" name="main_window" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>745</width>
<height>514</height>
</rect>
</property>
<property name="windowTitle" >
<string>ViTE v 0.1</string>
</property>
<widget class="QWidget" name="centralwidget" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QWidget" native="1" name="render_area" />
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>745</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile" >
<property name="title" >
<string>File</string>
</property>
<addaction name="actionOpen" />
<addaction name="actionClose" />
<addaction name="separator" />
<addaction name="actionQuit" />
</widget>
<addaction name="menuFile" />
</widget>
<widget class="QStatusBar" name="statusbar" />
<action name="actionOpen" >
<property name="text" >
<string>Open</string>
</property>
</action>
<action name="actionClose" >
<property name="text" >
<string>Close</string>
</property>
</action>
<action name="actionQuit" >
<property name="text" >
<string>Quit</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>
......@@ -8,11 +8,17 @@
#ifndef RESOURCE_H
#define RESOURCE_H
#include <QApplication>
#include <QtGui>/* for all of the Qt's Widgets */
#include <QtUiTools>/* for the run-time loading .ui file */
#include <iostream>/* to use the C standard library input output functions */
#include <string>
using namespace std;
#define UI_MAIN_WINDOW_NAME "main_window.ui"/* name of the main window ui file. This file must be included in the same folder than the compiled program. */
#endif
all:
$(CC) -c tests_window/test_window_creation.cpp -o tests_window/test_window_creation.o
\ No newline at end of file
$(CC) -c test_window_creation.cpp -o test_window_creation.o ../bin/interface_graphic.o
\ No newline at end of file
/*!
*\file resource_test.h
*\brief This file gives some common header files for the interface tests.
*/
#ifndef RESOURCE_TEST_H
#define RESOURCE_TEST_H
#include "../src/interface_graphic.h"
#endif
......@@ -3,11 +3,7 @@
*\brief This test simply launch a window directly (without use the terminal interface). User have to close it manually.
*/
#include <stdlib.h>
#include <iostream>
using namespace std;
#include "resource_test.h"
......@@ -16,6 +12,8 @@ using namespace std;
*/
int main(int argc, char ** argv){
cout << "Time to display the window (expected result : immediatly)" << endl;
cout << "Position of the window inside the screen (expected result : center on X and Y)" << endl;
cout << "Size of the window (expected result : all the width, and just 600px (around) on the height)" << endl;
......@@ -23,7 +21,11 @@ int main(int argc, char ** argv){
cout << "Title of the window (expected result : 'ViTE')" << endl;
cout << "The application size in the computer memory (expected result : ********)";
//Interface_window window1;
QApplication app(argc, argv);
Interface_graphic window;
window.show();
return EXIT_SUCCESS;
return app.exec();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment