2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2011-09-22 19:50:41 +00:00
|
|
|
from bpy.types import Header, Menu
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'INFO'
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2019-08-10 01:45:58 +10:00
|
|
|
def draw(self, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2018-04-21 10:28:27 +02:00
|
|
|
layout.template_header()
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2019-08-10 01:45:58 +10:00
|
|
|
INFO_MT_editor_menus.draw_collapsible(context, layout)
|
|
|
|
|
|
|
|
|
|
|
|
class INFO_MT_editor_menus(Menu):
|
|
|
|
bl_idname = "INFO_MT_editor_menus"
|
|
|
|
bl_label = ""
|
|
|
|
|
2019-09-15 05:26:15 +10:00
|
|
|
def draw(self, _context):
|
2019-08-10 01:45:58 +10:00
|
|
|
layout = self.layout
|
|
|
|
layout.menu("INFO_MT_view")
|
|
|
|
layout.menu("INFO_MT_info")
|
|
|
|
|
|
|
|
|
|
|
|
class INFO_MT_view(Menu):
|
|
|
|
bl_label = "View"
|
|
|
|
|
2019-09-15 05:26:15 +10:00
|
|
|
def draw(self, _context):
|
2019-08-10 01:45:58 +10:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.menu("INFO_MT_area")
|
|
|
|
|
|
|
|
|
|
|
|
class INFO_MT_info(Menu):
|
|
|
|
bl_label = "Info"
|
|
|
|
|
2019-09-15 05:26:15 +10:00
|
|
|
def draw(self, _context):
|
2019-08-10 01:45:58 +10:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("info.select_all", text="Select All").action = 'SELECT'
|
|
|
|
layout.operator("info.select_all", text="Deselect All").action = 'DESELECT'
|
|
|
|
layout.operator("info.select_all", text="Invert Selection").action = 'INVERT'
|
|
|
|
layout.operator("info.select_all", text="Toggle Selection").action = 'TOGGLE'
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("info.select_box")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
# Disabled because users will likely try this and find
|
|
|
|
# it doesn't work all that well in practice.
|
|
|
|
# Mainly because operators needs to run in the right context.
|
|
|
|
|
|
|
|
# layout.operator("info.report_replay")
|
|
|
|
# layout.separator()
|
|
|
|
|
|
|
|
layout.operator("info.report_delete", text="Delete")
|
|
|
|
layout.operator("info.report_copy", text="Copy")
|
2017-03-18 20:03:24 +11:00
|
|
|
|
2018-05-24 18:35:19 +02:00
|
|
|
|
|
|
|
class INFO_MT_area(Menu):
|
|
|
|
bl_label = "Area"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
if context.space_data.type == 'VIEW_3D':
|
|
|
|
layout.operator("screen.region_quadview")
|
2018-11-06 22:05:05 +01:00
|
|
|
layout.separator()
|
|
|
|
|
2018-11-21 01:33:33 +01:00
|
|
|
layout.operator("screen.area_split", text="Horizontal Split").direction = 'HORIZONTAL'
|
|
|
|
layout.operator("screen.area_split", text="Vertical Split").direction = 'VERTICAL'
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2020-01-22 13:48:25 -08:00
|
|
|
layout.operator("screen.area_dupli", icon='WINDOW')
|
2018-11-21 01:33:33 +01:00
|
|
|
|
2018-11-06 22:05:05 +01:00
|
|
|
layout.separator()
|
2018-11-21 01:33:33 +01:00
|
|
|
|
2018-05-24 18:35:19 +02:00
|
|
|
layout.operator("screen.screen_full_area")
|
2019-05-22 00:27:01 +10:00
|
|
|
layout.operator(
|
|
|
|
"screen.screen_full_area",
|
|
|
|
text="Toggle Fullscreen Area",
|
|
|
|
icon='FULLSCREEN_ENTER',
|
|
|
|
).use_hide_panels = True
|
2018-05-24 18:35:19 +02:00
|
|
|
|
|
|
|
|
2019-08-10 11:35:16 +02:00
|
|
|
class INFO_MT_context_menu(Menu):
|
|
|
|
bl_label = "Info Context Menu"
|
|
|
|
|
2019-09-15 05:26:15 +10:00
|
|
|
def draw(self, _context):
|
2019-08-10 11:35:16 +02:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("info.report_copy", text="Copy")
|
|
|
|
layout.operator("info.report_delete", text="Delete")
|
|
|
|
|
2019-09-10 06:11:52 +10:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
|
|
|
INFO_HT_header,
|
2019-08-10 01:45:58 +10:00
|
|
|
INFO_MT_editor_menus,
|
2018-05-24 18:35:19 +02:00
|
|
|
INFO_MT_area,
|
2019-08-10 01:45:58 +10:00
|
|
|
INFO_MT_view,
|
|
|
|
INFO_MT_info,
|
2019-08-10 11:35:16 +02:00
|
|
|
INFO_MT_context_menu,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|