Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2004-06-11 06:39:22 +0400
committerMatt Ebb <matt@mke3.net>2004-06-11 06:39:22 +0400
commit79c00d658ef4f24844143f86e07a5f460ad1ebb7 (patch)
tree63c17d8362015e26d88fb3f544981268bd33831f /source/blender/src/header_info.c
parentd34f89b755e17a7080d18d620b1900d01fb7482e (diff)
* Added a spot for scripts to register themselves in the Help menu
* Gave the spiffy new 'System Information' script a new home there
Diffstat (limited to 'source/blender/src/header_info.c')
-rw-r--r--source/blender/src/header_info.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c
index 2191f9ec933..49b87cf7f66 100644
--- a/source/blender/src/header_info.c
+++ b/source/blender/src/header_info.c
@@ -1590,11 +1590,24 @@ static uiBlock *info_help_websitesmenu(void *arg_unused)
static void do_info_helpmenu(void *arg, int event)
{
- switch(event) {
-
- case 0:
+
+ extern int BPY_menu_do_python(short menutype, int event); // BPY_interface.c
+ ScrArea *sa;
+
+ if(curarea->spacetype==SPACE_INFO) {
+ sa= find_biggest_area_of_type(SPACE_SCRIPT);
+ if (!sa) sa= closest_bigger_area();
+ areawinset(sa->win);
+ }
+
+ /* events >=2 are registered bpython scripts */
+ if (event >= 2) BPY_menu_do_python(PYMENU_HELP, event - 2);
+
+ else switch(event) {
+
+ case 0: /* About Blender */
break;
- case 1:
+ case 1: /* Benchmark */
/* dodgy hack turning on CTRL ALT SHIFT key to do a benchmark
* rather than copying lines and lines of code from toets.c :(
*/
@@ -1612,6 +1625,7 @@ static void do_info_helpmenu(void *arg, int event)
}
break;
}
+
allqueue(REDRAWINFO, 0);
}
@@ -1621,6 +1635,8 @@ static uiBlock *info_helpmenu(void *arg_unused)
uiBlock *block;
short yco= 0;
short menuwidth=120;
+ BPyMenu *pym;
+ int i = 0;
block= uiNewBlock(&curarea->uiblocks, "info_helpmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetButmFunc(block, do_info_helpmenu, NULL);
@@ -1649,6 +1665,13 @@ static uiBlock *info_helpmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Release Notes *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
*/
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ for (pym = BPyMenuTable[PYMENU_HELP]; pym; pym = pym->next, i++) {
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+2, pym->tooltip?pym->tooltip:pym->filename);
+ }
+
uiBlockSetDirection(block, UI_DOWN);
uiTextBoundsBlock(block, 80);