Commit Graph

94 Commits

Author SHA1 Message Date
89fa8449a6 * Further general tweaking to UI controls drawing
* Improved TOG3 buttons to communicate functionality better
2003-12-08 10:48:28 +00:00
7ab1c64c7a Default buttons drawing update
* Big code cleanup and re-organisation, cleaner drawing
* Button alignment now enabled for default theme
* Sliders tweaked and improved
* Tooltip shadow cleaned up

Todo: Alignment looks pretty, but at this stage, what it *means* is not clear or consistent. Need to work out some UI guidelines for when to and when not to use the alignment code.
2003-12-07 06:05:08 +00:00
5691b4d1db - fix for layer buttons, now button rows type TOGR accept input based at
actual bit value, and not order of creation.
  it is the only location in Blender where this is used... so!
2003-11-30 19:18:08 +00:00
de77f47ac7 - added to Constraint panel the 'Active Bone' or 'Active Object', like
previously was drawn in constraint buttons header.
- cleaned up buttons in panels for manual... just nicer aligning.
2003-11-23 12:22:59 +00:00
dfc72b3f90 - Fix: the MKEY 'movetolayer' option doesnt close anymore on numeric
input. Somewhere in end  NaN period this was changed... weird.

  Now you can set layers with numeric buttons, including using ALT for
  numbers larger than 10, and using SHIFT for extend-select buttons.

  for the UI diehards who like to know; when you create a menu block, you
  can provide two flags to control behaviour on keyboard input:
  UI_BLOCK_RET_1  == return on any keypress (not mouse)
  UI_BLOCK_ENTER_OK  == return on Enter key

  this was not correct in the doc/interface_API.txt , which will be fixed.
2003-11-21 13:14:50 +00:00
4a5ae4a55f Fix for undo... it didn't do the UV coords (tface) nor the vertexpaint
colors. This because of the pretty weird (ab)use of load & make editmesh...

For each added undo step, the load_editmesh was fed with an empty mesh
to assign data to, without knowledge of what was in the original mesh.
That way UV and color data got lost.

Solved it in 2 steps:

1. removing the ->tface pointer from EditVlak, and make TFace a builtin
  struct inside EditVlak. This didnt cost much extra mem, since it already
  stored UV and color. This enabled some pretty cleanup in editmesh.c as
  well, storing tface pointers was cumbersome.
2. for each undo step, it then generates always a tface and mcol block to
  link to the undo Mesh.
  Even when it wasn't in the actual Mesh, at exit editmode the original
  Mesh is used as reference anyway, and undo-meshes are freed correctly.

The enormous commit is because I had to change the BLI_editVert.h file, and
found it was included in about every file unnecessary. I removed it there.
ALso found out that subsurf has code ready (unfinished) to make UV coords for
the displaylist in EditMode as well, nice to know for later...
2003-11-19 22:00:14 +00:00
ab9e6f69a0 - fixed bug caused by changing order of drawing buttons in material panel 2
the 'OB' and 'ME' buttons were not visible in all situations anymore...
2003-11-19 12:43:21 +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
c51180b860 fixed two errors in events for knife tool:
- ESC for pupmenu was not handled
- pressing ENTER at pupmenu caused mousetrail call to exit
2003-11-12 22:20:27 +00:00
3e972a57e9 - added themecolor text for textwindow
- fixed bug introduced by rwenzlaff commit in interface.c
  why replace the defButI call with defButS ? you should have seen the
  compile warning... :)
2003-11-12 21:34:12 +00:00
fcc8aefd48 - fixed safety area for 'floating' popup menus, such as move-to-layer
but also works for toolbox, quit menu, etc.
2003-11-12 21:23:37 +00:00
aeb8a0f1ae Modified pupmenu_col() to allow separators. 2003-11-05 23:54:22 +00:00
d4a4f0e493 - increased tooltip back-grab safety one pixel
- fixed good merging of constraint and effect panel in odd situations
2003-10-29 19:23:51 +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
5ca0051419 - fixed very very old but in TOG button (it didnt check the values
correctly for deciding whether its pressed or not
- added 'add new' buttons to material & texture menus
  is done by std_lib buttons in headerbuttons.c, now only for this.
  doing it for ipowindow, sound, etc. has some weird consequences, save
  that for later
- verified usage of 'setting2' color for databuttons only
2003-10-27 16:13:45 +00:00
6da544eeeb - new menu type; with icon support!
(the one you make with uIDefBut(..., MENU, ...)
  add a %i<nr> to the string, and the item gets <nr> as icon.
- added this to the 'mode' selectors in 3dwin and ipowin
- cleaned up code for modeselector pup... that was a bad ass one! :)
2003-10-25 23:57:58 +00:00
bbd9018ec5 - fixed colors of ipokeys in 3d window
- fixed constraint popup menu (used icons)
- moved 'full' and 'View3d props' and 'background' items in menu to bottom
  Hope Matt wont kill me for it, but these were about the only useful
  ones there... :)
- little fix in interface.c for menus...
2003-10-25 22:29:24 +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
904c039e3c - added ifdef INTERNATIONAL for changes in interface.c
- changed switching to smaller/larger fonts, it now does only 1 pnt size.
  with standard font (11), medium is 10, small 9
2003-10-23 22:28:49 +00:00
734637215b there was a function prototype missing from interface.c that caused an error with MSVC. 2003-10-23 22:20:19 +00:00
9efe4b7f9a - AntiAlias fonts (FTF) now are used in three sizes, like the normal
fonts, and switched based at the window zoom.

  Might be something to tweak when to switch exactly, but it works
  cool!
2003-10-23 18:25:08 +00:00
389b06c91e More fixes in object drawing:
- transparent faces in editmode don't write in zbuffer anymore (prevents
  drawing errors) but still read (so behind the subsurf faces for example)
- improved drawing 'handles' for subsurf editing
- going in editmode to Solid view, will draw extra wire always, including
  transparent faces when set
- works in all combos... http://www.blender.org/docs/ton/subsurf.html

- fixed error; padplus/padminus didnt work in buttonswindow anymore
- improved buttonswin: when dragging window edge, the buttons dont
  rescale, but stay same size
2003-10-22 09:06:30 +00:00
e3f3491ac3 Made pupmenu() separators consistent with pulldowns
TODO: same for popup menu buttons
2003-10-21 07:28:44 +00:00
4405113308 - Lots of tweaks to interface colours, shading, etc.
- Fixed alignment/width of menus

Still needs more work.
2003-10-21 07:02:04 +00:00
824c9e92da - fixed correct themecolor for popup menus 2003-10-20 18:15:06 +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
628b002583 - Added nicer, smoother tooltip drawing 2003-10-20 04:05:31 +00:00
58a0811ad9 - fixed bug in windows with extreme small height... it didnt accept
input
- was needed for usage of this windowtype (headerless) as 'timeline'
  dragger, which was supposed to be...
- as extra I fixed 'home', it sets start/end frame for sound window
- at mouselocation the current frame or time is printed
- rightmouse menu switches seconds/frames (should be in header as option...)
- displaybutton 'frs/sec/' updates soundwindow too

So, its not perfect... but try opening a tiny high headerless audio
window on top of buttonswin or somewhere full width. not bad...
2003-10-17 19:03:53 +00:00
8ce5ece950 - fixed reopen last file (in file pulldown menu)
- fixed delay in drawing active item in pop menus...
2003-10-17 16:24:10 +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
478f61563a - fixed drawing errors in constraint panel
- join 3d window could crash... unchecked pointer in interface.c
- setting align in buttonswin caused stripes to draw in view3d-panels
- fixed events for new 'background and view settings menu'
2003-10-15 17:41:40 +00:00
44344b3501 - More code for handling Panels in other windows.
Added the 'Nkey' object menu as Panel now. Live updates, whoohoo!

closing them, minimizing, etc will follow. first bring back vertex
selection :)
2003-10-15 16:01:08 +00:00
669a570a73 - Various cosmetic fixes to menu buts in headers, alignment etc.
- Make text fields' text black when deselected, white when selected (editing)
2003-10-15 15:23:58 +00:00
c2c7bb6648 - Modified drawing of ICONROW controls to be clearer,
more consistent and logical. (ICONROWs haven't
scrolled left/right in years!

More detailed tweaking of headerbuttons positions can come when
more menus are finished

- added text labels to the drawtype menu in 3d view header
2003-10-15 13:47:15 +00:00
3bf09a5447 - fixed warnings in drawmesh.c
- with mouse in Panel, padplus/minus defines scaling of Panel... dunno if
  this is the correct key. thats for later to worry!

Forgot to mention in previous commit:

- Panels now have a uiSetPanelStyle() API call. Is under construction...
  now for test purposes mostly.
2003-10-15 12:51:01 +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
0c1bad34c7 - another improvement in button panels align: after 'home' it puts the panels
always in the left/top corner. it did a centre first...
- fixed color print error with AA fonts in textbuttons
2003-10-14 21:01:01 +00:00
5466b63463 Modifications to buttons drawing code:
- colour tweaks to buttons and menus
- improved method of drawing triangles on menus and numbuts
2003-10-14 16:38:48 +00:00
4629da0ffa - fixed threshold for merging closed Panels (was not sufficient narrow)
- in 'Horizontal Align' mode, Panels now close as a vertical bar
- switching align modes, also switches how closed Panels are drawn
- opengl nor ftgl support vertical string drawing... so for now it only
  draws the capitals of the Panel title in a horizontal collapsed header
2003-10-14 10:45:35 +00:00
ceb26d2a4e - experiment: changed drawing style of Panels to minimal and fully
transparant.
- converted the Texture buttons, they're nice too!
2003-10-13 14:57:43 +00:00
12236bcdfa - restored scriptlink buttons
i tried to find place for it in the other menus, like material, object,
  camera, etc. But thats hard... now it's just one nice Panel, without
  the idiot headerbuttons icons!
- changed drawing of 'tabbed' Panels. The old method takes too much space.
  hint from xype! Dragging tabbed Panels can be done with the right hand
  circle. designers are welcom to tweak this.
  main reason: dragging is not meant to be happening a lot... pressing tabs
  is more important.
2003-10-12 22:26:09 +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
a9c694d6c5 - rewrote the panel align heuristics.
leftmost/top panel now always at same location, so switching button
  'main contextes' works consistantly
- fixed some more events to make sure Panels update when editing
- preview render panel now is 320 wide, just for getting the space filled!
- error in preview render matrix, which caused unpredictable drawing errors

Bedtime!

-Ton-
2003-10-12 00:42:09 +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
95ce9b93be - fixes in material buttons (still tentative design!)
- cutoff of text in menus and buttons now even better!
- size of pull-up menu buttons is corrected
- pressing at 'menu button' had a delay, fixed

General: the 'outo open' wont become default, it will be removed or
become a user option. I am experimenting with it to get it all OK.
The 'auto open' for secondary levels in pulldowns will remain there

Check the latest state of pull-up menu buttons. for example the mode
selector: you can use such buttons in three ways,

- click on it, it opens and you can select
- click-and-hold-mouse, move, release at item you want to select
- move mouse over button, wait, it opens

The 'auto open' and its time threshold both can be user settings.
2003-10-11 18:15:07 +00:00