Cleanup in area/region management

- more intelligence in area management for adding handlers and setting
  data correct. Space/Region type callbacks only have to do own things.

- added option for adding default handlers to areas/regions. (flag in
  type definition)

- ensured that region-types store the minsizes for regions.

- added boundbox check for handlers; note that it accepts pointer to
  boundbox, because handlers don't get reset on area-resizing or
  view changes. Example: view2d handlers use mask rect.

- handlers get now added on correct context levels (example frame change
  also worked in header)

- removed ->refresh() callback. Context refreshing is Listener.
  
- the ->init() is being called on all WM level actions, also after a
  file read, moving areas, re-opening areas etc. 

- fixed bug: crash on exit was caused by cleaning up Screen too late.

- UI_view2d_size_update() removed from draw callback, is init()

- regions now store (winx, winy) subwindow size.
This commit is contained in:
2008-12-10 13:56:54 +00:00
parent 1fdb9da2a7
commit 54c4ed469a
16 changed files with 222 additions and 227 deletions

View File

@@ -350,6 +350,9 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
ar->winrct.xmax= x2;
ar->winrct.ymax= y2;
/* adds subwindow */
ED_region_init(C, ar);
/* notify change and redraw */
WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
@@ -663,6 +666,9 @@ uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut *
block->flag |= UI_BLOCK_LOOP|UI_BLOCK_MOVEMOUSE_QUIT;
/* adds subwindow */
ED_region_init(C, ar);
/* notify change and redraw */
WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);