- expanded internal windowmanager that it allows button panels in any
window (type) - each SpaceData struct (not the window!) can get 'block handlers' assigned, basically event codes that invoke drawing button panels. - this is saved in files, and Panels behave in any window like it does now in buttonswindow - it also means that a 'space window' should leave with a matrix set for buttons level - try it in view3d header menu, 'view'->'backdrop'. this opens the old viewbuttons - it all works non blocking! instant updates of viewbuttons visible in 3d window now. Not done yet: - checking and fixing frontbuffer drawing (select a wireframe draws over) - temporally vertices cannot be selected, is my next project - closing or hiding Panels... - styling stuff... i committed for others to review as well. Have fun. this is certainly a huge improvement over the old viewbuttons!
This commit is contained in:
@@ -158,6 +158,43 @@ void space_mipmap_button_function(int event);
|
||||
unsigned short convert_for_nonumpad(unsigned short event);
|
||||
void free_soundspace(SpaceSound *ssound);
|
||||
|
||||
/* *************************************** */
|
||||
|
||||
/* don't know yet how the handlers will evolve, for simplicity
|
||||
i choose for an array with eventcodes, this saves in a file!
|
||||
*/
|
||||
void add_blockhandler(ScrArea *sa, short eventcode)
|
||||
{
|
||||
SpaceLink *sl= sa->spacedata.first;
|
||||
short a;
|
||||
|
||||
// find empty spot
|
||||
for(a=0; a<SPACE_MAXHANDLER; a++) {
|
||||
if( sl->blockhandler[a]==eventcode );
|
||||
else if( sl->blockhandler[a]==0) {
|
||||
sl->blockhandler[a]= eventcode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(a==SPACE_MAXHANDLER) printf("error; max blockhandlers reached!\n");
|
||||
}
|
||||
|
||||
void rem_blockhandler(ScrArea *sa, short eventcode)
|
||||
{
|
||||
SpaceLink *sl= sa->spacedata.first;
|
||||
short a;
|
||||
|
||||
for(a=0; a<SPACE_MAXHANDLER; a++) {
|
||||
if( sl->blockhandler[a]==eventcode) {
|
||||
sl->blockhandler[a]= 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ************* SPACE: VIEW3D ************* */
|
||||
|
||||
/* extern void drawview3dspace(ScrArea *sa, void *spacedata); BSE_drawview.h */
|
||||
@@ -510,12 +547,16 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
int doredraw= 0, pupval;
|
||||
|
||||
if(curarea->win==0) return; /* when it comes from sa->headqread() */
|
||||
if(event==MOUSEY) return;
|
||||
|
||||
|
||||
if(val) {
|
||||
|
||||
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
||||
if(event==MOUSEY) return;
|
||||
|
||||
if(event==UI_BUT_EVENT) do_butspace(val); // temporal, view3d deserves own queue?
|
||||
|
||||
|
||||
/* TEXTEDITING?? */
|
||||
if(G.obedit && G.obedit->type==OB_FONT) {
|
||||
switch(event) {
|
||||
|
||||
Reference in New Issue
Block a user