diff options
author | Ton Roosendaal <ton@blender.org> | 2003-10-25 04:08:12 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-10-25 04:08:12 +0400 |
commit | 513ae61f2beda17faced737c0b9eae45a0548e18 (patch) | |
tree | c1a9fea194c88950c14fa9d16ccac7649fd5d89f /source/blender/include/BIF_interface.h | |
parent | 5f26e16c51819f6fb6cfed705fce8f667e1b667c (diff) |
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
Diffstat (limited to 'source/blender/include/BIF_interface.h')
-rw-r--r-- | source/blender/include/BIF_interface.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/include/BIF_interface.h b/source/blender/include/BIF_interface.h index 60c5fab0e06..cd1d75dd13a 100644 --- a/source/blender/include/BIF_interface.h +++ b/source/blender/include/BIF_interface.h @@ -46,10 +46,13 @@ struct ScrArea; #define UI_EMBOSSX 0 /* for a python file, which i can't change.... duh! */ /* uiBlock->direction */ -#define UI_TOP 0 -#define UI_DOWN 1 -#define UI_LEFT 2 -#define UI_RIGHT 3 +#define UI_TOP 1 +#define UI_DOWN 2 +#define UI_LEFT 4 +#define UI_RIGHT 8 +#define UI_DIRECTION 15 +#define UI_CENTRE 16 +#define UI_SHIFT_FLIPPED 32 /* uiBlock->autofill */ #define UI_BLOCK_COLLUMNS 1 @@ -85,11 +88,16 @@ struct ScrArea; #define UI_PNL_TO_MOUSE 128 #define UI_PNL_UNSTOW 256 -/* definitions for icons (and their alignment) in buttons */ /* warning the first 4 flags are internal */ +/* but->flag */ #define UI_TEXT_LEFT 16 #define UI_ICON_LEFT 32 #define UI_ICON_RIGHT 64 + /* control for button type block */ +#define UI_MAKE_TOP 128 +#define UI_MAKE_DOWN 256 +#define UI_MAKE_LEFT 512 +#define UI_MAKE_RIGHT 1024 /* Button types */ |