Mercurial > octave
annotate libgui/graphics/Menu.h @ 33625:d213a148b3f1 default tip @
ensure exp. terminal widget has focus at startup
* main-window.cc (main_window): call focus_command_window only if
event loop is idle by using a single shot timer
* main-window.h: make focus_command_window a public slot
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sun, 26 May 2024 02:29:44 +0200 |
parents | 7f18c537e101 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31808
diff
changeset
|
3 // Copyright (C) 2011-2024 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20003
diff
changeset
|
26 #if ! defined (octave_Menu_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20003
diff
changeset
|
27 #define octave_Menu_h 1 |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "MenuContainer.h" |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include "Object.h" |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 class QAction; |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 class QMenu; |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 class QWidget; |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
36 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
37 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
38 class interpreter; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
40 class Menu : public Object, public MenuContainer |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
41 { |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
42 Q_OBJECT |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
44 public: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
45 Menu (octave::interpreter& interp, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
46 const graphics_object& go, QAction *action, Object *parent); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
47 ~Menu (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
49 static Menu * |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
50 create (octave::interpreter& interp, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
51 const graphics_object& go); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
53 Container * innerContainer () { return nullptr; } |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
55 QWidget * menu (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
57 protected: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
58 void update (int pId); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
32632
diff
changeset
|
60 private Q_SLOTS: |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
61 void actionTriggered (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
62 void actionHovered (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
64 private: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
65 void updateSiblingPositions (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
67 private: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
68 QWidget *m_parent; |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
69 QAction *m_separator; |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
70 }; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
72 OCTAVE_END_NAMESPACE(octave) |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 #endif |