Commit Graph

53 Commits

Author SHA1 Message Date
40ae17d2f6 UI
* Fix buttons jumping around when resizing and zoom. Part of this was
  adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the
  rounding is unpredictable (used to be 0.375f, but that was disabled).
* Fix various issues with zooming, panning panels.  V2D_LOCKOFS_X/Y is
  now taken into account in more places in the view2d code, to avoid
  zooming into the center or panning out of the view.
* Remove "Free" align mode in buttons window (it's not really useful).

* View3D/Graph/Image editors now use the same PanelType system as the
  buttons window, means some deprecated panel code could be removed.
* Some small visual tweaks for panels.
* View 2D Reset operator (Home key), to reset zoom and panning for panels.

* Added argument to set number buttons as sliders (slider=True for itemR).
* Ignore labels for button alignment (doesn't look right).
* Fix some use of context.main in py scripts, should get data from active
  object instead.
* Fix autotexspace -> auto_texspace in py script.
2009-05-19 17:13:33 +00:00
b4d46e5ded UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
  This means the layout engine now works at button level, and makes it
  easier to write templates. Otherwise you had to store all info and
  create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
  These can contain regular buttons, and can be put in a Free layout,
  which means you can specify manual coordinates, but still get nested
  correct inside other layouts.

* API was changed to allow better nesting. Previously items were added
  in the last added layout specifier, i.e. one level up in the layout
  hierarchy. This doesn't work well in always, so now when creating things
  like rows or columns it always returns a layout which you have to add
  the items in. All py scripts were updated to follow this.

* Computing the layout now goes in two passes, first estimating the
  required width/height of all nested layouts, and then in the second
  pass using the results of that to decide on the actual locations.

* Enum and array buttons now follow the direction of the layout, i.e.
  they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
  RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
  opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
  row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
  buttons).

* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
d576ee99ed 2.5
Cleanup of conventions for icon placement in menus.

Old code only allowed 1 icon per menu, forcing to pass on the sublevel
menu icon with exception handling.

Now sublevel icons are drawn automatically, allowing to add an icon
before name too. (Check shift+a menu)
2009-04-30 17:27:30 +00:00
58cdd37f52 UI:
* Made separator item work horizontal & vertical.
* Add colon (:) automatic for int/float/enum/string.
* Added space variables to uiStyle and use them in the
  layout engine.

* Added initial World buttons by Thomas Dinges, thanks!
* Added some code for modifiers in the Object Data context.
  This will become a template though.
* Use a common poll() callback in the scripts to reduce code.
2009-04-27 18:05:58 +00:00
9b82d1474f 2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
  can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
  reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
  shows the last operator, if appropriate.
  Nkey properties moved to the other side.

A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;

- Buttons now all have a complete set of colors, based on button classifications
  (See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types. 
  Currently colors are defined for Window, Header, List/Channels and
  for Button/Tool views. 
  The screen manager handles this btw, so a TH_BACK will always pick the
  right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
  the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
  Only Panel font, widget font and widget-label work now. The 'group label'
  will be for templates mostly.
  Style settings will be expanded with spacing defaults, label conventions, 
  etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
  Same goes for Panel title color.

Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
af02a0aa4e UI
* Headers and menus can now be created in python.
* Replaced the uiMenuItem functions to create menus with equivalent
  uiItem functions using a layout, removing duplicated code.
* More uiItem functions are now exposed to python.
* The text editor header, panels and one of its menus are now created
  in space_text.py.
* Buttons window data context icon new changes depending on active
  object.

Issues
* Icons are not wrapped yet, hardcoded ints at the moment.
* The ID browse template is unfinished.
2009-04-22 18:39:44 +00:00
38b6f8f167 UI:
* For new buttons spaces, automatically set horizontal/vertical
  align depending on size, instead of free.

* Cleaned up the UI panel API. There's now a new uiBeginPanel
  function which takes a panel type, and a uiEndPanel which takes
  the final size. uiNewPanel* functions will be phased out.
* Animate the re-alignment when a panel size changes, e.g. when
  enabling dupliframes.

* Load ui scripts from the release/ folder first if it is
  available. This makes it easier to edit ui scripts, since it
  will directly use the original files which avoids having to
  run the build system.
* Improve editing of panel types while blender is open. That
  means fixing some issues with lacking updates, overlaps, strange
  ordering. It even does an animation now when the panel resizes.
2009-04-16 21:39:45 +00:00
26a8c63eae UI:
* Don't call generic layout hints templates anymore, i.e.
  TemplateRow becomes Row, etc.
* Added more general layout nesting, using uiLayoutSplit()
  and uiLayoutBox() functions, for which the sublayouts
  can then be accessed using uiLayoutSub(), to put items
  in those sublayouts.
* Some steps to make the layout decisions, like which items
  to put in which columns, independent of the width of the
  window or the text in the buttons. We want the layout to
  be stable under resizes and translations.
* Added an "expand" parameter to uiItemR, used now to expand
  enums into a row instead of using a menu.
2009-04-16 12:17:58 +00:00
874c9e8c58 UI:
* Added simple row template to layout buttons
  in a horizontal row, so you don't need to use
  columns for it.
2009-04-15 15:09:36 +00:00
5b3d7bfdf6 2.5
More cleanup!

- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
  Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
  (was only in use for radiosity buttons)

And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:

- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
  to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
  a several calls using different args.

Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
5cb480cef4 2.5
Various ui fixes:

- panel drawing now correctly follows scaled view
- made imagewindow buttons using TH_PANEL color back (was too dark)
- click on open/close panel was wrong
- menu items disabling now draws correct
- curve/hsv widgets didn't draw on right locations
- numsliders have nicer interior slider decoration
- new type TOGBUT to enforce old style toggle button (not new type
  'option button' with checkmark
- (temp) disabled live updating while using Curve widget, was 
  too slow to be fun. Needs general solution :)
2009-04-12 13:40:29 +00:00
3ed5e21537 UI:
* Template slots are no longer specified per item, but are
  a state now, set with uiTemplateSlot.
* Some renaming of Layout functions for consistency.
* Fix for roundbox in stack template, now is always behind
  the other buttons.
* Improved python API for layout:
  http://www.pasteall.org/5008/python
2009-04-11 01:52:27 +00:00
4e81404d7e 2.5
Grand cleanup: 
- removal of FTF and ftfont dir
- removal of text.c which wrapped it
- wrapped old text drawing code temporarily, need to decide how 'style'
  will behave per editor when you draw strings outside interface code.... 
  wouldn't be very useful to set fonts locally all over?
2009-04-10 16:30:28 +00:00
d2cc19dcc6 2.5
More font style work;

- hooked up almost all ui buttons code to new font
  system, including text clipping
- panel headers scale now too to smaller fonts
- added further style hints, for shadow/emboss. Is all going to
  be in UI designer control!
- for fun; changed layout engine to spread vertical buttons in
  window width

Next: removal of all usage of old font system, using 'styles'.
Will also move font blurring to blenfont module.
2009-04-10 14:06:24 +00:00
6593bbaca2 2.5 - Groundwork for Adding/Removing Drivers
Drivers can now be Added/Removed from buttons using the D/Alt-D hotkeys, and also through the menu. Driver settings (i.e. the target) are not set by default. To set those, go to the Graph Editor (see notes).

Notes:
* Buildsystem maintainers - I've added a new file "editors/animation/drivers.c"
* Widget colours for the driven-setting indications are needed 
* To see the new drivers, go into Graph Editor -> "Drivers" mode. Currently, there's a little bug there which prevents editing of the new drivers.
2009-04-10 13:08:12 +00:00
79c30a0752 2.5
WIP commit for UI drawing.

- Hooked up Diego's new Font API
- Added Style definitions for fonts, currently it uses
  a different font for panel titles to show it.
- Styles are in Userdef now too, still not finished 
- Userdef "DPI" will offer global control over font size,
  to match monitor size/resolution. It's meant to scale
  widgets and headers too btw, later.
- Lots of code removed for old fonts, but that's unfinished.

On todo: too much to mention, will continue happily tomorrow!
2009-04-09 18:11:18 +00:00
654a30aa2d 2.5
- Widgets now draw projected themselves, putting window/region matrix
  on 1:1 pixelspace. This allows zoomable buttons, but crispy.
- Note: text in smaller buttons dont get clipped correct now, WIP
- Fixed error with button types in some  menus.
- removed temp UI_2_50 define hack.
2009-04-07 17:08:26 +00:00
767db1b716 RNA: Commit of the API patch by vekoon. This adds Functions to RNA,
which can be defined to call C functions with defined parameters.

* Parameters are RNA properties, with the same types.
* Parameters are stored in a ParameterList, which is like a small
  stack with the values. This is then used to call the C function.
* Includes Python integration.

* Only one test function is part of this commit, ID.rename.
* Integration with the editors/ module is not included in this
  commit, there's some issues to be worked out for that still.
2009-04-07 00:49:39 +00:00
3906a62cc1 2.5: Added basic insert/remove keyframes from UI buttons.
- I key over a button inserts a keyframe.
- Alt+I removes a keyframe.
- With right mouse button a menu with these options pops up.
- Buttons are colored green if the property is animated, yellow
  if it is on a keyframe. I followed the colors from the UI
  mockups, but the flicker on keyframes seems too distracting in
  practice?

- This only works for properties on the ID itself at the moment,
  path callbacks need to be filled in for all structs but mesh
  still.
- It doesn't work when you're over a related label, that needs to
  be made to work.
- I made it insert keyframes outside of any keyingset. Not sure
  how this is supposed to integrate?
2009-04-03 23:30:32 +00:00
f408689e72 2.5
Some more work on UI drawing code, added a generic structure
for how widgets will be defined. It's still a wrapper on top
of old buttons. Docs follow still.

Some visual improvements;

- more button types supported (check render buttons)
- pressed state is shown
- better 'panel' triangle AA, and new divider style

Still a lot of work here. I expect the next days/weeks to
be much more coding too, had to catch up with a lot of other
Blender stuff. There's more (excitement) going on than code. :)
2009-04-02 15:01:11 +00:00
4bb41c3dcd UI: various panels fixes.
* Fix sometimes non-working close/open button.
* Fix panels being a bit out of the view on startup.
* Fix too large totrct region for view2d.
* Fix wrong panel order when changing vertical <-> horizontal.
* Fix wrong panel positions after switching contexts.
* Fix an access of freed memory when collapsing panels.

* Free align mode works again.
* Animations work again.
2009-04-02 01:39:33 +00:00
6705b6f96e UI:
* Added a PanelType and HeaderType for registering panels
  and headers in regions. When the region draws, it will
  then automatically draw the ones that were registerd with
  poll and draw callbacks.

  Used for text header, properties and object buttons now.
2009-03-29 19:44:39 +00:00
d93fd9ffc1 UI:
* Screen level regions created for menus are now a separate
  CTX_wm_menu in the context, so they don't interfere with
  existing regions.
* Fix context in popup menus to always come from the area
  and region the popup was opened from.
* Removed some unused context stuff: tasks and reports.
  The places that were using context reports were using it
  wrong anyway.
* Fix F6 closing immediately after editing a button, by
  making uiBlockSetFlag not clear existing flags anymore.
* Don't use ":" in boolean X/Y/Z buttons.
2009-03-25 20:49:15 +00:00
2e48c4059a 2.5
WIP commit for new system to draw widgets and use themes or styles.

Not really interesting stuff to see in code now, the current 
structure will change quite a lot, this to make it hook up well
to the existing system.

What works quite well is a new full opengl vector method to draw 
scalable and pixel-aligned anti-aliased buttons.

http://download.blender.org/institute/rt3.jpg
http://download.blender.org/institute/rt4.jpg
2009-03-25 16:58:42 +00:00
8b3c2c0762 UI:
* Fix for F6 redo and similar popups closing when moving
  mouse outside of the popup while interacting with buttons.
* Simplify F6 redo popup code by using generated layout.
2009-03-25 14:34:17 +00:00
4c3d64116e 2.5: UI Layout Engine, initial code.
* As a test, used by:
  * Object buttons, tried to make it match the mockup.
  * Text window header.
  * Text window properties panel.
* Panel interaction with view2d is still problematic, need to make
  this work properly still.
* Templates are very basic, the ones there are simple but already
  can follow the object buttons mockup quite closely.
* It's based on a three level system: panels, templates and items.
  To get an idea of what that means in practice, see:

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/UI_LayoutEngine#Panels.2C_Templates_and_Items
2009-03-13 13:38:41 +00:00
f73d7c697c * Updated slider design
Still a bit of a work in progress, will look a little weird on non-rounded themes, but will fix that when back home in .au!

The slider now fills the entire button, dragging on it changes the value, clicking edits it. You can also ctrl-click on either side of the slider 'edge' to increment or decrement in small amounts. There's one temporarily in the render buttons for testing.
2009-03-08 17:12:59 +00:00
6cc89b9d4e 2.5: Text Editor back.
There was very little structure in this code, using many globals
and duplicated code. Now it should be better structured. Most
things should work, the main parts that are not back yet are the
python plugins and markers. Notes:

* Blenfont is used for drawing the text, nicely anti-aliased.
* A monospace truetype font was added, since that is needed for
  the text editor. It's Bitstream Vera Sans Mono. This is the
  default gnome terminal font, but it doesn't fit entirely well
  with the other font I think, can be changed easily of course.

* Clipboard copy/cut/paste now always uses the system clipboard,
  the code for the own cut buffer was removed.
* The interface buttons should support copy/cut/paste again now
  as well.
* WM_clipboard_text_get/WM_clipboard_text_set were added to the
  windowmanager code.

* Find panel is now a kind of second header, instead of a panel.
  This needs especially a way to start editing the text field
  immediately on open still.

* Operators are independent of the actual space when possible,
  was a bit of puzzling but got it solved nice with notifiers,
  and some lazy init for syntax highlight in the drawing code.
* RNA was created for the text editor space and used for buttons.

* Operators:
    * New, Open, Reload, Save, Save As, Make Internal
    * Run Script, Refresh Pyconstraints
    * Copy, Cut, Paste
    * Convert Whitespace, Uncomment, Comment, Indent, Unindent
    * Line Break, Insert
    * Next Marker, Previous Marker, Clear All Markers, Mark All
    * Select Line, Select All
    * Jump, Move, Move Select, Delete, Toggle Overwrite
	* Scroll, Scroll Bar, Set Cursor, Line Number
    * Find and Replace, Find, Replace, Find Set Selected,
	  Replace Set Selected
    * To 3D Object
    * Resolve Conflict
2009-02-28 23:33:35 +00:00
66c2f1c2a3 added defAutoButR() and blockSetFlag() and some flags for the experimental python UI, which just wraps C the functions. 2009-02-27 10:22:40 +00:00
38410b63a6 2.5: Text edit mode operators back. Took me a while getting
them nicely repeatable, and splitting up the big edit_text
operator into individual operator so it's all nicely scriptable,
documented, configurable, etc..

* Insert Text, Line Break, Insert Lorem
* Toggle Case, Set Case, Toggle Style, Set Style, Set Material
* Copy Text, Cut Text, Paste Text, Paste File, Paste Buffer
* Move, Move Select, Delete
* Change Spacing, Change Character

Notes

* Text (datablock) to Object doesn't work yet, will need to
  implement text editor context for that.
* Some shortcut keys don't work because screen/wm overrides them,
  ctrl+x, ctrl+left/right. That override goes top down which works
  well for some cases, but here we need to override in the other
  direction.
* There's no unicode support in RNA, or the user interface code
  for that matter, but text strings can contain these characters.
  At the moment it stores a UTF-8 string in char arrays, which is
  supposed to be nicely compatible with ascii. Seems reasonable to
  add support for UTF-8 in the interface code, python bindings, ..
  eventually?
2009-02-17 19:55:20 +00:00
2e79e4e975 2.5
Smaller jobs, all in one commit!

- Moved object_do_update out of view3d drawing, into
  the event system (currently after notifiers).
  Depsgraph calls for setting update flags will have to
  keep track of each Screen's needs, so a UI showing only
  a Sequencer doesn't do objects.

- Added button in "Properties region" in 3D window to set
  or disable 4-split, including the 3 options it has.
  (lock, box, clip)

- Restored legacy code for UI, to make things work like
  bone rename, autocomplete. 

- Node editor now shows Curves widgets again

- Bugfix: composite job increased Viewer user id count

- Bugfix: Node editor, not "Enable nodes" still called
  a Job, which didn't do anything

- Various code cleaning, unused vars and prototypes.
2009-02-11 16:54:55 +00:00
b77da4893d 2.5: Image window operators, quite a few of these still have
missing parts and are work in progress.

Set 3D Cursor
Set Tile
Sample Color
New
Open
Replace
Reload
Save (As)
Save Sequence
Pack
Unpack
Record Composite

The file select operators have context issues still. They need
to get the image space in the context on exec() but it's not
there currently, not sure how to solve that yet.

Also added name parameter to uiMenuItemEnumO, and fixed "mute"
argument in ED_update_for_newframe calls in fluidsim bake.
2009-02-10 23:17:58 +00:00
85231e5fd4 * Some more 2.5 theme updates 2009-02-09 02:54:40 +00:00
eb929804d2 2.5
Added CTRL+W save Blender file.

It's the first user of the uiPupMenuSaveOver() function,
which I've recoded to accept an operator pointer.
This is required because the operator property 'filename'
has to be set to work. Other 'save over' users will
require running operators too I guess.
2009-02-08 19:15:59 +00:00
591ab657d6 2.5: UV Editor, more operators.
Border Select
Circle Select
Pin
Select Pinned
Unwrap
Minimize Stretch
Pack Islands
Average Islands Scale
Snap Cursor
Snap Selection
2009-02-07 01:27:46 +00:00
84e2de8ca7 2.5: ID datablock button back, previously known as std_libbuttons. The
way this worked in 2.4x wasn't really clean, with events going all over
the place and using dubious variables such as G.but->lockpoin or
G.sima->menunr. It works as follows now, for example:

xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID**)&sima->image, ID_IM, &sima->pin, xco, yco,
	sima_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_DELETE|UI_ID_ALONE|UI_ID_PIN);

The last two parameters are a callback function, and a list of events
or functionalities that are supported. The callback function will then
get the ID pointer + event to handle.
2009-02-06 16:40:14 +00:00
df7e766032 UI
* Changed uiPupMenuOperator usage to uiPupMenuBegin/End (simpler,
  no need to build a string). Also made transform orientation and
  subdiv type enums instead of ints for this.
* Added an icon argument to many of the uiMenu calls, and added a
  uiMenuItemIntO.
* Move auto rna button creation out of outliner code, now is
  uiDefAutoButR for individual buttons and uiDefAutoButsRNA for a
  whole block.
* Implemented uiPupBlock(O). Pressing F6 gives a menu with the
  properties of the last operator to test. I tried to make a redo
  last operator out of this but couldn't get the context correct
  for the operator to repeat in. Further the popup block also has
  some issues getting closed while editing buttons.
* Fix uiAfterFunc memory leak on Ctrl+Q quit.
* Fix handling of RNA number button dragging and sliding for RNA
  buttons with range -inf/inf.
2009-02-04 11:52:16 +00:00
8036342ea8 2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
  organize things a bit and indicate what should be used when.

* uiMenu* functions can now be used to create menus for headers
  too, this is done with a uiDefMenuBut, which takes a pointer
  to a uiMenuCreateFunc, that will then call uiMenu* functions.

* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
  specific to making popup menus. Will convert the other
  conformation popup menu functions to use this too so we can
  remove some code.

* Extended uiMenu functions, now there is is also:
  BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.

* Converted image window headers to use uiMenu functions, simplifies
  menu code further here. Did not remove the uiDefMenu functions as
  they are used in sequencer/view3d in some places now (will fix).

* Also tried to simplify and fix bounds computation a bit better
  for popup menus. It tried to find out in advance what the size
  of the menu was but this is difficult with keymap strings in
  there, now uiPopupBoundsBlock can figure this out afterwards and
  ensure the popup is within the window bounds. Will convert some
  other functions to use this too.
2009-01-30 12:18:08 +00:00
3c088f3434 2.5
Simple toolbox-style menu system. Brecht will review it
though, and/or check on way to use it for menus.
I tried to avoid uiBlock and rna stuff all over. :)

Quick image test:
http://www.blender.org/bf/rt.jpg

Examples you can read in:
- editors/screen/screen_ops.c:testing123() (press F5)
- editors/object/object_edit.c:object_add_primitive_invoke()
  (press SHIFT+A)

Concept is simple:

uiMenuBegin(): returns a handle.
uiMenuEnd(): puts it all to work.

In between you can add items like:

uiMenuItemVal(): a name, icon, retval (use uiMenuFunc()) 
uiMenuItemO(): an operator + icon
uiMenuItemEnumO(): an operator, property name, value

Sublevels go easy too:

uiMenuLevel(): creates item for sublevel, with function pointer.
     Inside that function you can use all menu calls again.
     Levels can go as deep you want.

uiMenuLevelEnumO(): creates operator sublevel for an enum
2009-01-25 20:22:05 +00:00
f08032e8f9 UI: various changes
* View2D to region now returns ints instead of shorts.
* Use "Numpad" instead of "Pad" in automatic keymap menu info.
* Menus can now use buttons other than BUTM and SEPR, in
  particular TOG and ROW are now supported instead of flipping
  bits manually.
* Added a simpler uiDefMenu* api for making menus now, and it
  only supports Operator and RNA buttons at the moment, will be
  used in next commit. Not sure how this will evolve .. makes
  menu code look cleaner anyways.
* Ensure that interface code doesn't crash when getting unknown
  Operators and RNA properties, and display their buttons grayed
  out in that case.
2009-01-15 04:13:38 +00:00
475a64fc91 * Added support for displaying disabled RNA buttons
The functionality already existed via the RNA system, this
commit makes disabled buttons draw greyed out, and not respond to clicks
(previously, they would drag/edit/etc but then reset to the previous value)
2009-01-04 02:09:41 +00:00
3817b1f018 Some tweaks to menu drawing 2009-01-04 00:05:40 +00:00
0a8a00cd10 2.5: Error reporting
* Added a report list to operator, to which they can report errors and
  warnings. When the operator ends, it will display them with a popup. For
  python these should become exceptions when calling operators.
* Added a function to make a popup menu from a report list.
* Also added a utility function to prepend a string before the reports to
  indicate what they relates to. Also made the report functions used
  BLI_dynstr to simplify the code.
* Made file reading and writing report errors to the user again using this
  system, also replacing the left over uncommented bad level error() calls.
2008-12-29 13:38:08 +00:00
2335092456 UI: Panels
* API and usage is basically the same still.
* Panels were moved to region level. I first thought of keeping them at area
  level, but having them at region level it's simpler to handle events and do
  drawing, and also to integrate with view2d. They can still become area level
  overlapping regions, if we make a floating (or docked) region that can
  contain panels.
* Added back a few panels from the scene buttons for testing.

Issues still:
* The view2d handling and alignment refresh of panels is not correct yet in the
  buttons window. 
* I did not yet bring back the block handlers system. It was basically a system
  that stored which panel was open and where the events for that panel would go.
  Just a few functions, but not sure how it fits in 2.5.
* There was a case where dragging panels would not properly remove the window
  level handler, but could not redo anymore even though I don't think I fixed
  it.
* Some text in the panels goes past the end of the button, that is due to the
  checkmark button drawing, not related to this commit.

Other UI code changes:
* Renamed interface.h to interface_intern.h for consistency.
* Fixed some issues with freeing of blocks when they changed due to context.
* uiDrawBlock now takes a context pointer (mostly for block drawextra).
2008-12-26 13:11:04 +00:00
3c612bc0e2 2.5
Fix: popup menus were not freeing operators.
Made a new Popup menu call for this case:

uiPupmenuOperator(C, maxrow, op, propname, menustr);

It will set enum "propname" to the menu item and call operator,
register it optionally and free it. Use it in "invoke" calls.

Next: automatic menu generating for enum properties!
2008-12-24 14:52:17 +00:00
065155a17d UI:
* Changed pupmenu function name and added back some standard popups.
2008-12-17 16:53:56 +00:00
c1379f6613 UI:
* Added support for defining properties for operator buttons, with
  uiButGetOperatorPtrRNA. Needed to cleanup a hack that was there
  for operator properties in RNA, now a separate OperatorProperties
  type is used for storing operator properties, instead of being part
  of the Operator type itself.
* Allow selecting menu items with mouse release instead of press again.
* Fix some cases with hanging tooltips in the UI.
2008-12-16 20:03:28 +00:00
998e682fc3 UI: added the following functions to create buttons for RNA properties and for
operators. RNA property buttons will automatically fill in the label, min/max,
etc if they are not specified. Operator menu buttons will look up the key
combination in the handlers and add it automatically.

uiDefButR, uiDefIconButR, uiDefIconTextButR
uiDefButO, uiDefIconButO, uiDefIconTextButO

uiDefButO takes a context pointer to do the key lookup, don't really like this..
2008-12-16 07:55:43 +00:00
6283b0c8c5 UI: getting popup menus to work again, just the internal interface
and event handling code still, how it integrates with operators and
handlers is not worked out yet. For testing, Ctrl+Q quit now shows
a confirmation popup using the following call:

okee_operator(C, "WM_OT_exit_blender", "Quit Blender");
2008-12-15 19:19:39 +00:00
f00a75272e UI:
* Added context pointer to function callbacks for buttons and blocks.
* Added a uiBlockSetHandleFunc, which will be called with the button
  return value. This seems kind of redundant with uiBlockSetButmFunc,
  but the latter uses a2 to pass the value.
2008-12-10 19:22:10 +00:00