GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ContextMenu.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_ContextMenu_h)
27 #define octave_ContextMenu_h 1
28 
29 #include <QPoint>
30 
31 #include "MenuContainer.h"
32 #include "Object.h"
33 
34 class QMenu;
35 
37 
38 class base_qobject;
39 class interpreter;
40 
41 class ContextMenu : public Object, public MenuContainer
42 {
43  Q_OBJECT
44 
45 public:
46  ContextMenu (octave::base_qobject& oct_qobj, octave::interpreter& interp,
47  const graphics_object& go, QMenu *menu);
48  ~ContextMenu (void);
49 
50  static ContextMenu *
51  create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
52  const graphics_object& go);
53 
54  static void executeAt (octave::interpreter& interp,
55  const base_properties& props, const QPoint& pt);
56 
57  Container * innerContainer (void) { return nullptr; }
58 
59  QWidget * menu (void);
60 
61 protected:
62  void update (int pId);
63 
64 private slots:
65  void aboutToShow (void);
66  void aboutToHide (void);
67 };
68 
70 
71 #endif
OCTAVE_END_NAMESPACE(octave)
~ContextMenu(void)
Definition: ContextMenu.cc:69
void aboutToHide(void)
Definition: ContextMenu.cc:110
QWidget * menu(void)
Definition: ContextMenu.cc:116
Container * innerContainer(void)
Definition: ContextMenu.h:57
static void executeAt(octave::interpreter &interp, const base_properties &props, const QPoint &pt)
Definition: ContextMenu.cc:122
ContextMenu(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QMenu *menu)
Definition: ContextMenu.cc:58
void aboutToShow(void)
Definition: ContextMenu.cc:103
void update(int pId)
Definition: ContextMenu.cc:73
static ContextMenu * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: ContextMenu.cc:43
Definition: Object.h:47
Base class for Octave interfaces that use Qt.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn