4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2008 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
32 #include "DNA_space_types.h"
33 #include "DNA_scene_types.h"
34 #include "DNA_screen_types.h"
35 #include "DNA_windowmanager_types.h"
37 #include "MEM_guardedalloc.h"
39 #include "BLI_blenlib.h"
41 #include "BKE_global.h"
42 #include "BKE_screen.h"
44 #include "ED_screen.h"
51 #include "BIF_glutil.h"
53 #include "UI_interface.h"
54 #include "UI_resources.h"
55 #include "UI_view2d.h"
57 #include "text_intern.h"
60 /* ************************ header area region *********************** */
62 static void do_viewmenu(bContext *C, void *arg, int event)
67 static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
69 ScrArea *curarea= C->area;
71 short yco= 0, menuwidth=120;
73 block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
74 uiBlockSetButmFunc(block, do_viewmenu, NULL);
76 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
77 menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
79 if(curarea->headertype==HEADERTOP) {
80 uiBlockSetDirection(block, UI_DOWN);
83 uiBlockSetDirection(block, UI_TOP);
84 uiBlockFlipOrder(block);
87 uiTextBoundsBlock(block, 50);
93 static void do_text_buttons(bContext *C, void *arg, int event)
100 void text_header_buttons(const bContext *C, ARegion *ar)
102 ScrArea *sa= C->area;
106 block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
107 uiBlockSetHandleFunc(block, do_text_buttons, NULL);
109 xco= ED_area_header_standardbuttons(C, block, yco);
111 if((sa->flag & HEADER_NO_PULLDOWN)==0) {
114 /* pull down menus */
115 uiBlockSetEmboss(block, UI_EMBOSSP);
117 xmax= GetButStringLength("View");
118 uiDefPulldownBut(block, dummy_viewmenu, C->area,
119 "View", xco, yco-2, xmax-3, 24, "");
123 uiBlockSetEmboss(block, UI_EMBOSS);
126 UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
128 uiEndBlock(C, block);