From 0972d05b4b065213e95e79e9ad7ac4bf63e500e3 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 30 Jul 2010 15:44:26 +0000 Subject: Logic Editor: *Removed the old header menu code, replacing with Python menus. --- source/blender/editors/space_logic/logic_header.c | 120 ---------------------- source/blender/editors/space_logic/logic_intern.h | 3 - source/blender/editors/space_logic/space_logic.c | 12 +-- 3 files changed, 1 insertion(+), 134 deletions(-) delete mode 100644 source/blender/editors/space_logic/logic_header.c (limited to 'source') diff --git a/source/blender/editors/space_logic/logic_header.c b/source/blender/editors/space_logic/logic_header.c deleted file mode 100644 index 3e38eb815fb..00000000000 --- a/source/blender/editors/space_logic/logic_header.c +++ /dev/null @@ -1,120 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2009 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "BKE_context.h" -#include "BKE_screen.h" -#include "BKE_main.h" - -#include "ED_screen.h" -#include "ED_types.h" -#include "ED_util.h" - - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "logic_intern.h" - -/* ************************ header area region *********************** */ - - -static void do_logic_buttons(bContext *C, void *arg, int event) -{ -// SpaceLogic *slogic= CTX_wm_space_logic(C); -} - -static uiBlock *logic_addmenu(bContext *C, ARegion *ar, void *arg_unused) -{ -// SpaceLogic *slogic= CTX_wm_space_logic(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "logic_addmenu", UI_EMBOSSP); -// uiBlockSetButmFunc(block, do_logic_addmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiTextBoundsBlock(block, 50); - uiBlockSetDirection(block, UI_TOP); - uiEndBlock(C, block); - - return block; -} - -void logic_header_buttons(const bContext *C, ARegion *ar) -{ - ScrArea *sa= CTX_wm_area(C); -// SpaceLogic *slogic= CTX_wm_space_logic(C); - uiBlock *block; - short xco, yco= 3; - - block= uiBeginBlock(C, ar, "header logic", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_logic_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, logic_addmenu, NULL, - "View", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, logic_addmenu, NULL, - "Select", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, logic_addmenu, NULL, - "Add", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - UI_view2d_totRect_set(&ar->v2d, xco+XIC+100, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin)); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - - diff --git a/source/blender/editors/space_logic/logic_intern.h b/source/blender/editors/space_logic/logic_intern.h index 3b2b6497cdc..0c30aa711f1 100644 --- a/source/blender/editors/space_logic/logic_intern.h +++ b/source/blender/editors/space_logic/logic_intern.h @@ -42,9 +42,6 @@ struct Scene; /* space_logic.c */ struct ARegion *logic_has_buttons_region(struct ScrArea *sa); -/* logic_header.c */ -void logic_header_buttons(const struct bContext *C, struct ARegion *ar); - /* logic_ops.c */ /* logic_buttons.c */ diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index ed3d956ce01..3f11c3e6bae 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -296,17 +296,7 @@ static void logic_header_area_init(wmWindowManager *wm, ARegion *ar) static void logic_header_area_draw(const bContext *C, ARegion *ar) { - /* clear */ - UI_ThemeClearColor(ED_screen_area_active(C)?TH_HEADER:TH_HEADERDESEL); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - logic_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } /**************************** spacetype *****************************/ -- cgit v1.2.3