Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
35f30086
Commit
35f30086
authored
May 06, 2020
by
nobuyuki_nyuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PopupMenu.get_current_index() bound to ClassDB
parent
804ee245
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
popup_menu.cpp
scene/gui/popup_menu.cpp
+6
-0
popup_menu.h
scene/gui/popup_menu.h
+1
-0
No files found.
scene/gui/popup_menu.cpp
View file @
35f30086
...
...
@@ -1079,6 +1079,11 @@ bool PopupMenu::is_item_shortcut_disabled(int p_idx) const {
return
items
[
p_idx
].
shortcut_is_disabled
;
}
int
PopupMenu
::
get_current_index
()
const
{
return
mouse_over
;
}
int
PopupMenu
::
get_item_count
()
const
{
return
items
.
size
();
...
...
@@ -1457,6 +1462,7 @@ void PopupMenu::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"get_item_tooltip"
,
"idx"
),
&
PopupMenu
::
get_item_tooltip
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_item_shortcut"
,
"idx"
),
&
PopupMenu
::
get_item_shortcut
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_current_index"
),
&
PopupMenu
::
get_current_index
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_item_count"
),
&
PopupMenu
::
get_item_count
);
ClassDB
::
bind_method
(
D_METHOD
(
"remove_item"
,
"idx"
),
&
PopupMenu
::
remove_item
);
...
...
scene/gui/popup_menu.h
View file @
35f30086
...
...
@@ -178,6 +178,7 @@ public:
Ref
<
ShortCut
>
get_item_shortcut
(
int
p_idx
)
const
;
int
get_item_state
(
int
p_idx
)
const
;
int
get_current_index
()
const
;
int
get_item_count
()
const
;
bool
activate_item_by_event
(
const
Ref
<
InputEvent
>
&
p_event
,
bool
p_for_global_only
=
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment