GNU Octave
4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
tab-bar.h
Go to the documentation of this file.
1
/*
2
3
Copyright (C) 2018 Torsten <mttl@mailbox.org>
4
5
This file is part of Octave.
6
7
Octave is free software: you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
11
12
Octave is distributed in the hope that it will be useful, but
13
WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Octave; see the file COPYING. If not, see
19
<https://www.gnu.org/licenses/>.
20
21
*/
22
23
// This file implements a tab bar derived from QTabBar with a contextmenu
24
// and possibility to close a tab via double-left and middle mouse click.
25
26
#if ! defined (octave_tab_bar_h)
27
#define octave_tab_bar_h 1
28
29
#include <QMenu>
30
#include <QTabBar>
31
#include <QMouseEvent>
32
33
namespace
octave
34
{
35
// Subclassed QTabBar for usable tab-bar and reimplemented mouse event
36
37
class
tab_bar
:
public
QTabBar
38
{
39
Q_OBJECT
40
41
public
:
42
43
tab_bar
(
QWidget
*
p
);
44
45
~tab_bar
(
void
);
46
47
QMenu
*
get_context_menu
(
void
) {
return
m_context_menu
; };
48
49
signals:
50
51
void
close_current_tab_signal
(
bool
);
52
53
public
slots:
54
55
void
switch_left_tab
(
void
);
56
void
switch_right_tab
(
void
);
57
void
move_tab_left
(
void
);
58
void
move_tab_right
(
void
);
59
60
protected
:
61
62
void
mousePressEvent
(QMouseEvent *event);
63
64
private
:
65
66
QMenu
*
m_context_menu
;
67
68
void
switch_tab
(
int
direction,
bool
movetab =
false
);
69
};
70
}
71
72
// FIXME: This is temporary and should be removed when all classes that
73
// use the tab_bar class are also inside the octave namespace.
74
using
octave::tab_bar
;
75
76
#endif
octave
Definition:
aepbalance.cc:44
octave::tab_bar::move_tab_left
void move_tab_left(void)
Definition:
tab-bar.cc:54
octave::tab_bar::switch_left_tab
void switch_left_tab(void)
Definition:
tab-bar.cc:44
octave::tab_bar::tab_bar
tab_bar(QWidget *p)
Definition:
tab-bar.cc:34
QWidget
QTabBar
octave::tab_bar::m_context_menu
QMenu * m_context_menu
Definition:
tab-bar.h:66
octave::tab_bar::close_current_tab_signal
void close_current_tab_signal(bool)
octave::tab_bar::move_tab_right
void move_tab_right(void)
Definition:
tab-bar.cc:61
octave::tab_bar
Definition:
tab-bar.h:37
octave::tab_bar::switch_right_tab
void switch_right_tab(void)
Definition:
tab-bar.cc:49
octave::tab_bar::get_context_menu
QMenu * get_context_menu(void)
Definition:
tab-bar.h:47
octave::tab_bar::switch_tab
void switch_tab(int direction, bool movetab=false)
Definition:
tab-bar.cc:68
QMenu
octave::tab_bar::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition:
tab-bar.cc:94
p
p
Definition:
lu.cc:138
octave::tab_bar::~tab_bar
~tab_bar(void)
Definition:
tab-bar.cc:38
libgui
src
tab-bar.h
Generated on Sat Sep 1 2018 14:01:38 for GNU Octave by
1.8.14