diff options
author | Matt Ebb <matt@mke3.net> | 2004-01-07 15:26:40 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2004-01-07 15:26:40 +0300 |
commit | 349617b872278327951f99a9a61b1a98e01487af (patch) | |
tree | 222d8c56b1c994a16dbdc1bcefee540a299fcb0e | |
parent | ecd620a5aad00c21a67301c5a029785bf6667e3a (diff) |
* Added OOPS Schematic menus
-rw-r--r-- | source/blender/src/header_oops.c | 190 | ||||
-rw-r--r-- | source/blender/src/oops.c | 2 | ||||
-rw-r--r-- | source/blender/src/space.c | 16 |
3 files changed, 173 insertions, 35 deletions
diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c index cd0e1f272e1..6b4f6c64204 100644 --- a/source/blender/src/header_oops.c +++ b/source/blender/src/header_oops.c @@ -61,6 +61,8 @@ #include "BIF_interface.h" #include "BIF_resources.h" #include "BIF_screen.h" +#include "BIF_editoops.h" +#include "BIF_oops.h" #include "BKE_global.h" #include "BKE_main.h" #include "BSE_drawipo.h" @@ -97,15 +99,119 @@ void do_oops_buttons(short event) G.soops->lockpoin= 0; break; } +} + +static void do_oops_viewmenu(void *arg, int event) +{ + + switch(event) { + case 0: /* Shuffle Selected Blocks */ + shuffle_oops(); + break; + case 1: /* Shrink Selected Blocks */ + shrink_oops(); + break; + case 2: /* View All */ + do_oops_buttons(B_OOPSHOME); + break; + case 3: /* Maximize Window */ + /* using event B_FULL */ + break; + } +} + +static uiBlock *oops_viewmenu(void *arg_unused) +{ +/* static short tog=0; */ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "oops_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_oops_viewmenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shuffle Selected Blocks|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink Selected Blocks|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + + if(curarea->headertype==HEADERTOP) { + uiBlockSetDirection(block, UI_DOWN); + } + else { + uiBlockSetDirection(block, UI_TOP); + uiBlockFlipOrder(block); + } + + uiTextBoundsBlock(block, 50); + + return block; } -void oops_buttons(void) + +static void do_oops_selectmenu(void *arg, int event) +{ + + switch(event) + { + case 0: /* Border Select */ + borderselect_oops(); + break; + case 1: /* Select/Deselect All */ + swap_select_all_oops(); + break; + case 2: /* Linked to Selected */ + select_linked_oops(); + break; + case 3: /* Users of Selected */ + select_backlinked_oops(); + break; + } +} + +static uiBlock *oops_selectmenu(void *arg_unused) { + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "oops_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_oops_selectmenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked to Selected|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Users of Selected|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + + if(curarea->headertype==HEADERTOP) { + uiBlockSetDirection(block, UI_DOWN); + } + else { + uiBlockSetDirection(block, UI_TOP); + uiBlockFlipOrder(block); + } + + uiTextBoundsBlock(block, 50); + + return block; +} + + +void oops_buttons(void) +{ SpaceOops *soops; Oops *oops; uiBlock *block; - short xco; + short xco, xmax; char naam[256]; soops= curarea->spacedata.first; @@ -122,37 +228,66 @@ void oops_buttons(void) uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - xco+= XIC+22; + xco+= XIC+14; - /* FULL WINDOW */ - if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); - else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); + uiBlockSetEmboss(block, UI_EMBOSSN); + if(curarea->flag & HEADER_NO_PULLDOWN) { + uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, + xco,2,XIC,YIC-2, + &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus"); + } else { + uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, + xco,2,XIC,YIC-2, + &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus"); + } + uiBlockSetEmboss(block, UI_EMBOSS); + xco+=XIC; + + if((curarea->flag & HEADER_NO_PULLDOWN)==0) { + /* pull down menus */ + uiBlockSetEmboss(block, UI_EMBOSSP); - /* HOME */ - uiDefIconBut(block, BUT, B_OOPSHOME, ICON_HOME, (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms window to home view showing all items (HOMEKEY)"); - xco+= XIC; + xmax= GetButStringLength("View"); + uiDefBlockBut(block, oops_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); + xco+= xmax; + + xmax= GetButStringLength("Select"); + uiDefBlockBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); + xco+= xmax; + + } + + uiBlockSetEmboss(block, UI_EMBOSSX); + + xco+= 8; /* ZOOM and BORDER */ - xco+= XIC; - uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, (short)(xco+=XIC),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (CTRL+MiddleMouse)"); + uiBlockBeginAlign(block); + uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, (short)(xco),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (Ctrl MiddleMouse)"); uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area"); - + uiBlockEndAlign(block); + + xco+= 8; + /* VISIBLE */ - xco+= XIC; - uiDefButS(block, TOG|BIT|10,B_NEWOOPS, "lay", (short)(xco+=XIC),0,XIC+10,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Objects based on layer"); - uiDefIconButS(block, TOG|BIT|0, B_NEWOOPS, ICON_SCENE_HLT, (short)(xco+=XIC+10),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Scene data"); - uiDefIconButS(block, TOG|BIT|1, B_NEWOOPS, ICON_OBJECT_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Object data"); - uiDefIconButS(block, TOG|BIT|2, B_NEWOOPS, ICON_MESH_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Mesh data"); - uiDefIconButS(block, TOG|BIT|3, B_NEWOOPS, ICON_CURVE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Curve/Surface/Font data"); - uiDefIconButS(block, TOG|BIT|4, B_NEWOOPS, ICON_MBALL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Metaball data"); - uiDefIconButS(block, TOG|BIT|5, B_NEWOOPS, ICON_LATTICE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lattice data"); - uiDefIconButS(block, TOG|BIT|6, B_NEWOOPS, ICON_LAMP_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lamp data"); - uiDefIconButS(block, TOG|BIT|7, B_NEWOOPS, ICON_MATERIAL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Material data"); - uiDefIconButS(block, TOG|BIT|8, B_NEWOOPS, ICON_TEXTURE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Texture data"); - uiDefIconButS(block, TOG|BIT|9, B_NEWOOPS, ICON_IPO_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Ipo data"); - uiDefIconButS(block, TOG|BIT|12, B_NEWOOPS, ICON_IMAGE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image data"); - uiDefIconButS(block, TOG|BIT|11, B_NEWOOPS, ICON_LIBRARY_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library data"); + uiBlockBeginAlign(block); + uiDefButS(block, TOG|BIT|10,B_NEWOOPS, "Layer", (short)(xco+=XIC),0,XIC+20,YIC, &soops->visiflag, 0, 0, 0, 0, "Only show object datablocks on visible layers"); + xco+= 20; + uiDefIconButS(block, TOG|BIT|0, B_NEWOOPS, ICON_SCENE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Scene datablocks"); + uiDefIconButS(block, TOG|BIT|1, B_NEWOOPS, ICON_OBJECT_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Object datablocks"); + uiDefIconButS(block, TOG|BIT|2, B_NEWOOPS, ICON_MESH_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Mesh datablocks"); + uiDefIconButS(block, TOG|BIT|3, B_NEWOOPS, ICON_CURVE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Curve/Surface/Font datablocks"); + uiDefIconButS(block, TOG|BIT|4, B_NEWOOPS, ICON_MBALL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Metaball datablocks"); + uiDefIconButS(block, TOG|BIT|5, B_NEWOOPS, ICON_LATTICE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lattice datablocks"); + uiDefIconButS(block, TOG|BIT|6, B_NEWOOPS, ICON_LAMP_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lamp datablocks"); + uiDefIconButS(block, TOG|BIT|7, B_NEWOOPS, ICON_MATERIAL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Material datablocks"); + uiDefIconButS(block, TOG|BIT|8, B_NEWOOPS, ICON_TEXTURE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Texture datablocks"); + uiDefIconButS(block, TOG|BIT|9, B_NEWOOPS, ICON_IPO_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Ipo datablocks"); + uiDefIconButS(block, TOG|BIT|12, B_NEWOOPS, ICON_IMAGE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image datablocks"); + uiDefIconButS(block, TOG|BIT|11, B_NEWOOPS, ICON_LIBRARY_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library datablocks"); + uiBlockEndAlign(block); + /* name */ if(G.soops->lockpoin) { oops= G.soops->lockpoin; @@ -167,6 +302,7 @@ void oops_buttons(void) /* always do as last */ curarea->headbutlen= xco+2*XIC; - + uiDrawBlock(block); } + diff --git a/source/blender/src/oops.c b/source/blender/src/oops.c index fa6f1f3e992..25934fe98a4 100644 --- a/source/blender/src/oops.c +++ b/source/blender/src/oops.c @@ -323,8 +323,6 @@ void shuffle_oops() if(G.soops==0) return; - if(okee("Shuffle oops")==0) return; - waitcursor(1); /* to make it 100% OK and fast: temporal insert diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 3e8725e2fff..cfc87133c4f 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -3444,13 +3444,17 @@ void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt) select_linked_oops(); break; case SKEY: - - if(G.qual==LR_ALTKEY) - shrink_oops(); - else if((G.qual==LR_SHIFTKEY)) - shuffle_oops(); - else if((G.qual==0)) + if((G.qual==LR_ALTKEY)) { + if (okee("Shrink blocks")) { + shrink_oops(); + } + } else if((G.qual==LR_SHIFTKEY)) { + if (okee("Shuffle blocks")) { + shuffle_oops(); + } + } else if((G.qual==0)) { transform_oops('s'); + } break; case ONEKEY: |