Commit 64cab618 authored by Johnny Jazeix's avatar Johnny Jazeix

Ajout de la barre d'outil.

parent a373d1fe
......@@ -87,6 +87,8 @@ void Interface_graphic::load_windows(){
CKFP(_ui_render_area_layout = qFindChild<QVBoxLayout*>(this, "render_area_layout"), "Cannot find the render_area layout in the .ui file");
CKFP(_ui_fullscreen_menu = qFindChild<QAction*>(this, "fullscreen"), "Cannot find the fullscreen menu in the .ui file");
CKFP(_ui_info_trace_text = qFindChild<QTextEdit*>(this, "info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
CKFP(_ui_toolbar_check = qFindChild<QAction*>(this, "toolbar_menu"), "Cannot find the tool bar checker in the .ui file");
CKFP(_ui_toolbar = qFindChild<QToolBar*>(this, "toolBar"), "Cannot find the tool bar in the .ui file");
/* Create the render area and bind it to a layout (_ui_render_area_layout) */
_ui_render_area = new Render_area(this);
......@@ -310,11 +312,15 @@ void Interface_graphic::on_fullscreen_triggered(){
}
void Interface_graphic::on_toolbar_menu_triggered(){
if (_ui_toolbar_check->isChecked())
_ui_toolbar->show();
else
_ui_toolbar->hide();
}
void Interface_graphic::on_show_info_triggered(){
_ui_info_window->show();
}
......
......@@ -61,6 +61,12 @@ class Interface_graphic : public QWidget, public Interface{
*/
QAction* _ui_fullscreen_menu;
/*!
* \brief This variable contains the action to show/hide the toolbar.
*/
QAction* _ui_toolbar_check;
QToolBar* _ui_toolbar;
/*!
* \brief This variable contains the OpenGL render area.
*/
......@@ -227,6 +233,11 @@ protected slots:
*/
void on_fullscreen_triggered();
/*!
*\brief A slot which called when 'Show tool bar' in the menu is clicked.
*/
void on_toolbar_menu_triggered();
/*!
*\brief A slot which called when 'show infos' in the menu is clicked.
*/
......
......@@ -26,6 +26,14 @@
<normaloff>:/icon/icon/vite.png</normaloff>:/icon/icon/vite.png</iconset>
</property>
<widget class="QWidget" name="centralwidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>64</y>
<width>888</width>
<height>541</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<layout class="QVBoxLayout" name="render_area_layout" />
......@@ -171,6 +179,10 @@
<string>&amp;View</string>
</property>
<addaction name="show_info" />
<addaction name="toolbar_menu" />
<addaction name="separator" />
<addaction name="actionZoomin" />
<addaction name="actionZoomout" />
<addaction name="separator" />
<addaction name="fullscreen" />
</widget>
......@@ -178,6 +190,36 @@
<addaction name="menuView" />
<addaction name="menuHelp" />
</widget>
<widget class="QToolBar" name="toolBar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>26</y>
<width>888</width>
<height>38</height>
</rect>
</property>
<property name="windowTitle" >
<string>toolBar</string>
</property>
<property name="movable" >
<bool>true</bool>
</property>
<property name="floatable" >
<bool>true</bool>
</property>
<attribute name="toolBarArea" >
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak" >
<bool>false</bool>
</attribute>
<addaction name="open" />
<addaction name="export" />
<addaction name="separator" />
<addaction name="actionZoomin" />
<addaction name="actionZoomout" />
</widget>
<action name="open" >
<property name="icon" >
<iconset resource="vite.qrc" >
......@@ -191,6 +233,10 @@
</property>
</action>
<action name="close" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/fileclose.png</normaloff>:/icon/icon/fileclose.png</iconset>
</property>
<property name="text" >
<string>&amp;Close</string>
</property>
......@@ -229,6 +275,10 @@
<property name="checkable" >
<bool>false</bool>
</property>
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/about.png</normaloff>:/icon/icon/about.png</iconset>
</property>
<property name="text" >
<string>&amp;About ViTE</string>
</property>
......@@ -271,6 +321,41 @@
<string>Ctrl+E</string>
</property>
</action>
<action name="actionZoomin" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/zoom_in.png</normaloff>:/icon/icon/zoom_in.png</iconset>
</property>
<property name="text" >
<string>Zoom_in</string>
</property>
<property name="shortcut" >
<string>+</string>
</property>
</action>
<action name="actionZoomout" >
<property name="icon" >
<iconset resource="vite.qrc" >
<normaloff>:/icon/icon/zoom_out.png</normaloff>:/icon/icon/zoom_out.png</iconset>
</property>
<property name="text" >
<string>Zoom_out</string>
</property>
<property name="shortcut" >
<string>-</string>
</property>
</action>
<action name="toolbar_menu" >
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>true</bool>
</property>
<property name="text" >
<string>Show toolbar</string>
</property>
</action>
</widget>
<resources>
<include location="vite.qrc" />
......
<RCC>
<qresource prefix="icon" >
<file>icon/zoom_out.png</file>
<file>icon/zoom_in.png</file>
<file>icon/about.png</file>
<file>icon/fileclose.png</file>
<file>icon/vite.png</file>
<file>icon/export_svg.png</file>
<file>icon/fullscreen_mode.png</file>
......
......@@ -46,7 +46,9 @@ void TokenSource::open(const char *filename){
_filesize = buf.st_size;
if(_filesize == 0){
perror("empty file");
}
if ((_buffer = (char *)mmap(0, _filesize, PROT_READ, MAP_PRIVATE, _fd, 0)) == MAP_FAILED){
perror("error mmap");
......
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