Commit Graph

25 Commits

Author SHA1 Message Date
eb6ef538e9 - committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)

 While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.

Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE		0x00000004
#define CONSTRAINT_DISABLE_BIT	2

buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);

The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);

(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
d8f8605098 - Bug fix: at osx, default AA font couldnt be written in .b.blend
(unless you manually install font)
- Bug fix: string for AA font was only 64 chars... made 256.

- Changed API for buttons aligning... it now detects automatic what rows
  are, or collums, and aligns buttons. This makes call easier:
  uiBlockBeginAlign(block);
  ... defBut....
  uiBlockEndAlign(block);
  Only works when you provide buttons in row order!
- made sure only 'rounded' theme uses this align stuff
- still work in progress.. I commit now because I leave to denmark for 2 days!

http://www.blender.org/bf/rt.jpg  <- now also groups with rows+collums
2003-11-14 15:49:26 +00:00
a291ea6683 - Added button align code:
uiBlockBeginAlign(block, 'v');  'v'= vertical. 'h'=horizontal
  ..... (button def calls)
  uiBlockEndAlign(block);

  this will allow new themes to have buttons nicely drawn together.
- added new rounded draw theme, to test & illustrate the above.
- only did parts of button code with align... rest for later
- fixed 'minimal' theme to make it usable (with some decoration)
- put back 'oldskool' theme... but it just looks plain ugly! remove?

Lazy people: http://www.blender.org/bf/rt.jpg
check the top header, or Nkey menu, to see the meaning of 'align'.
2003-11-14 00:44:48 +00:00
4bec8ba7d5 Fixing loose ends:
- nkey menu for buttonswindow (hex values) couldnt be restored yet, is
  for next release
- replaced Nkey in IpoWindow with Panel, this now displays the buttons
  that were formerly in 'anim buttons' as well; to view the boundbox
  values of all visible curves, and adjust it.
- the new panel also has the 'set speed' option, fixed stuff in it and
  added better errorwarning... still not a very well coded tool!
2003-10-28 14:20:03 +00:00
513ae61f2b First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.

Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
  this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
  at information desing/structure level
- the code works like an engine, interpreting structs like this:

static TBitem addmenu_curve[]= {
{	0, "Bezier Curve", 	0, NULL},
{	0, "Bezier Circle", 1, NULL},
{	0, "NURBS Curve", 	2, NULL},
{	0, "NURBS Circle", 	3, NULL},
{	0, "Path", 			4, NULL},
{  -1, "", 			0, do_info_add_curvemenu}};

- first value is ICON code,
- then name
- return value
- pointer to optional child

last row has -1 to indicate its the last...
plus a callback to event function.

I also built an old toolbox style callback for this:

static TBitem tb_object_select[]= {
{	0, "Border Select|B", 	'b', NULL},
{	0, "(De)select All|A", 	'a', NULL},
{	0, "Linked...|Shift L", 	'L', NULL},
{	0, "Grouped...|Shift G", 	'G', NULL},
{  -1, "", 			0, tb_do_hotkey}};

here the return values are put back as hotkeys in mainqueue.

A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
7f5d06d638 Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
  AA fonts  as for default fonts. Now it's identical. Setting color for fonts
  can just be done with OpenGL, for both font types.
  Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color

- removed entirely the silly old color system (BIFColorID). All color
  calls can now be done with a BIF_ThemeColor() call, including fonts and
  buttons and opengl stuff

- all buttons in button header have headercolor by default

- recoded drawing icons, it was a really bad & old loop doing manually
  colorshading and blending... which was per pixel a load of code!
  Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
  but have a different alpha to blend in (when not active)


- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
  1. main drawing function for text and icons
  2. free definable callback for button itself
  3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
  callback system

- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
  UI_EMBOSS : the themable drawing style
  UI_EMBOSSP: the pulldown menu system (apart from color not themable)
  UI_EMBOSSN: draw nothing, only text and/or icon
  UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
  this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.

TODO: make UI API call for button alignment

(plus removed another series of warnings from code...)

Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
0321602b65 - The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
  (initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
  3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!

API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:

- void BIF_ThemeColor(ScrArea *sa, int colorid)
  sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)

- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
  sets a color with offset, no more weird COLORSHADE_LGREY stuff

- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
  like opengl, this gives you in *col the three rgb values

- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
  or the one to get 4 bytes

ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.

Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
77b37c9927 - fix for drawing buttons in fileselectors, it used an old exception
and special 'EMBOSSF' drawing function. Now complies to standard.
2003-10-16 12:03:03 +00:00
c7618783fb - further work on view3d panels:
- you can close them (x icon) or press ESC
- option to open panel at mouse location (try Nkey)
- using 'collapse' (triangle icon) stows header in bottom
- opening again restores at old location
- dragging panels or zooming clips nicely with window

evaluate: an 'auto close' when mouse goes outside panel

Warning: vertex selecting still broken! :) It's 2 am now, bedtime...
2003-10-16 00:17:24 +00:00
10333bd1d3 - removed all #include "interface.h" from files. this is a local/internal
include only (use BIF_interface.h instead)
- split up interface.c in two files: NEW: interface_panel.c
- removed the temporal text files

WARN: FIX AUTOMAKE AND MSVC!
2003-10-15 19:23:54 +00:00
6480956c58 - 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!
2003-10-15 12:26:26 +00:00
f729cbdf52 - added radiobuttons
- cleaned unused calls and defines
2003-10-12 19:46:17 +00:00
5f6d8e59c4 - Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
0ce9abf41d - converted full materialbuttons...
EEEK! It doesn't look well yet! Hopefully it inspires others to come
  with great solutions.
- the material buttons have 6 panels, three of them merged
- some drawing errors in preview render
- made settings for new Material that makes sense for Flares
2003-10-11 22:00:30 +00:00
7913a4a009 - added method to have a preview render in panel
- increased size of preview from 100 to 125 pix :)
- put back header buttons for databrowse, but they need to move to
  buttonswindow itself
2003-10-11 00:21:05 +00:00
0d03929b9b Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.

- editbuts, animbuts, gamebuts, displaybuts, paintbuts,  work now
- i quite completely reorganized it, it's now nicely telling you what
  context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
  (except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore

And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.

Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
39b1ceb669 - changed header from buttonwindow into new type
- changed meaning of F4-F10 keys (as compatible as possible, but we need
  something!) check UI design doc for proposal
- made new call for switching direction of buttons in Y, for when pulldown
  moves direction
- cleaned up all redundant manual switching code from headerbuttons.c
2003-10-07 12:49:39 +00:00
842bb449c5 huge commit, sorry!
this is part 1 of the UI makeover. It has:
- menu system from Matt integrated
- buttons drawing from Matt
- generic button panel system implemented
- converted displaybuttons (not the rest yet)
- cleaned up a lot in drawing spaces itself, to make it aligned and pixel exact.
- cleaned loads of little compiler warnings, protos...

still a lot of work needed, will all be in next week i hope!

(warn: 2 new c files! butspace.c and buttons_scene.c)
2003-10-04 20:35:50 +00:00
b4b10dfff8 * removed the global uiFrontbuf from interface.c (and python, it was used
there)
* replaced with nice local (uiBlock) storage of what goes on in drawing.
  it now only calls a glDrawBuffer() and glFinish() when it is actually
  needed

Result: interface drawing in general is speedy again, especially for gfx
cards that dont allow frontbuffer drawing, and copy stuff to the frontbuf
with a glFinish() call.

Needs to be tested on all platforms... report to me when you see problems
like menus not drawing correctly, tooltips not drawing or not disappearing,
etc.
2003-07-07 15:50:44 +00:00
f8803db66d added a labelbutton that displays the selected avi/quicktime codec. 2003-05-09 11:24:55 +00:00
d279fc6c45 pulldown menus now scale according to textwidths 2003-05-07 03:00:11 +00:00
f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00