diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-26 16:11:04 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-26 16:11:04 +0300 |
commit | 233509245615d06f0274d04940ad67d8e636d7f0 (patch) | |
tree | 4c29f431c3ee2680bb76ff1cc5420f75ad089dbb /source/blender/makesdna | |
parent | 7715e45a7adf2cc07856956aef27fc6359af94e1 (diff) |
UI: Panels
* API and usage is basically the same still.
* Panels were moved to region level. I first thought of keeping them at area
level, but having them at region level it's simpler to handle events and do
drawing, and also to integrate with view2d. They can still become area level
overlapping regions, if we make a floating (or docked) region that can
contain panels.
* Added back a few panels from the scene buttons for testing.
Issues still:
* The view2d handling and alignment refresh of panels is not correct yet in the
buttons window.
* I did not yet bring back the block handlers system. It was basically a system
that stored which panel was open and where the events for that panel would go.
Just a few functions, but not sure how it fits in 2.5.
* There was a case where dragging panels would not properly remove the window
level handler, but could not redo anymore even though I don't think I fixed
it.
* Some text in the panels goes past the end of the button, that is due to the
checkmark button drawing, not related to this commit.
Other UI code changes:
* Renamed interface.h to interface_intern.h for consistency.
* Fixed some issues with freeing of blocks when they changed due to context.
* uiDrawBlock now takes a context pointer (mostly for block drawextra).
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 10 |
2 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index af8597ba54d..9de835da9f1 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -36,6 +36,7 @@ struct SpaceType; struct SpaceLink; +struct ARegion; struct ARegionType; struct Scene; struct wmTimer; @@ -88,9 +89,9 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */ short flag, active; /* active= used currently by a uiBlock */ short control; short snap; - short old_ofsx, old_ofsy; /* for stow */ - int sortcounter; /* when sorting panels, it uses this to put new ones in right place */ + int sortcounter, pad; /* when sorting panels, it uses this to put new ones in right place */ struct Panel *paneltab; /* this panel is tabbed in *paneltab */ + void *activedata; /* runtime for panel manipulation */ } Panel; typedef struct ScrArea { @@ -112,9 +113,7 @@ typedef struct ScrArea { struct SpaceType *type; /* callbacks for this space type */ - ListBase spacedata; - ListBase uiblocks; /* uiBlock */ - ListBase panels; + ListBase spacedata; /* SpaceLink */ ListBase regionbase; /* ARegion */ ListBase handlers; /* wmEventHandler */ @@ -141,7 +140,8 @@ typedef struct ARegion { struct ARegionType *type; /* callbacks for this region type */ - ListBase uiblocks; + ListBase uiblocks; /* uiBlock */ + ListBase panels; /* Panel */ ListBase handlers; /* wmEventHandler */ char *headerstr; /* use this string to draw info */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 0bd99a9adfa..1aec7856da4 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -436,10 +436,9 @@ typedef struct SpaceImaSel { /* **************** SPACE DEFINES ********************* */ - /* button defines */ /* warning: the values of these defines are used in sbuts->tabs[7] */ -/* buts->mainb new */ +/* sbuts->mainb new */ #define CONTEXT_SCENE 0 #define CONTEXT_OBJECT 1 #define CONTEXT_TYPES 2 @@ -448,7 +447,7 @@ typedef struct SpaceImaSel { #define CONTEXT_SCRIPT 5 #define CONTEXT_LOGIC 6 -/* buts->tab new */ +/* sbuts->tab new */ #define TAB_SHADING_MAT 0 #define TAB_SHADING_TEX 1 #define TAB_SHADING_RAD 2 @@ -465,10 +464,13 @@ typedef struct SpaceImaSel { #define TAB_SCENE_SOUND 3 #define TAB_SCENE_SEQUENCER 4 - /* sbuts->flag */ #define SB_PRV_OSA 1 +/* sbuts->align */ +#define BUT_HORIZONTAL 1 +#define BUT_VERTICAL 2 + /* these values need to be hardcoded in structs, dna does not recognize defines */ /* also defined in BKE */ #define FILE_MAXDIR 160 |