Three functionalities in one commit, but there's overlap so I can't

separate it...

1) Curve/Surface editmode undo
Uses same syntax as mesh undo, so simple to integrate. Edit-curve data is
also quite simpler, so no need for any hack at all.
It re-uses the undo system from next point, which is nice short & clean
local code

2) Framework for global undo
The undo calls themselves are commented out. In a next commit I want to
enable it for a couple of main features, for further feedback.
The speed goes surprisingly well, especially with this new version that
'pushes' undo after a command, ensuring interactivity isnt frustrated

3) framework for texture based icons in Blender
Not activated code, but tested here. Part of 2.3 UI project.

btw: Johnny Matthews will assist in (and complete) the undo project
This commit is contained in:
2004-08-31 13:43:18 +00:00
parent 19a24abcb2
commit 0a305446a5
11 changed files with 668 additions and 248 deletions

View File

@@ -1796,6 +1796,7 @@ static int ui_do_but_NUMSLI(uiBut *but)
}
else {
uiActAsTextBut(but);
uibut_do_func(but); // this is done in ui_do_but_SLI() not in uiActAsTextBut()
}
while(get_mbut() & L_MOUSE) BIF_wait_for_statechange();
@@ -3090,6 +3091,8 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
if(inside || uevent->event!=LEFTMOUSE) {
butevent= ui_do_button(block, but, uevent);
// if(but->type!=BLOCK) BIF_write_undo(but->str);
if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent);
/* i doubt about the next line! */
@@ -3198,15 +3201,13 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
glColor4ub(0, 0, 0, 20);
glBegin(GL_POLYGON);
gl_round_box(x1+3, y1-1, x2+1, y2-2, 2.0);
gl_round_box(x1+3, y1-2, x2+2, y2-2, 3.0);
gl_round_box(GL_POLYGON, x1+3, y1-1, x2+1, y2-2, 2.0);
gl_round_box(GL_POLYGON, x1+3, y1-2, x2+2, y2-2, 3.0);
glColor4ub(0, 0, 0, 8);
gl_round_box(x1+3, y1-3, x2+3, y2-3, 4.0);
gl_round_box(x1+3, y1-4, x2+4, y2-3, 5.0);
glEnd();
gl_round_box(GL_POLYGON, x1+3, y1-3, x2+3, y2-3, 4.0);
gl_round_box(GL_POLYGON, x1+3, y1-4, x2+4, y2-3, 5.0);
glDisable(GL_BLEND);