Added "undo" and "redo" commands.

This commit is contained in:
David Capello 2007-09-27 20:45:12 +00:00
parent 76b09886da
commit ec0d508f77
3 changed files with 24 additions and 8 deletions

View File

@ -20,14 +20,21 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "raster/undo.h"
#endif
bool command_enabled_redo(const char *argument)
{
return current_sprite != NULL && undo_can_redo(current_sprite->undo);
}
void command_execute_redo(const char *argument)
{
undo_redo(current_sprite->undo);
sprite_generate_mask_boundaries(current_sprite);
GUI_Refresh(current_sprite);
}

View File

@ -20,14 +20,21 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "raster/undo.h"
#endif
bool command_enabled_undo(const char *argument)
{
return current_sprite != NULL && undo_can_undo(current_sprite->undo);
}
void command_execute_undo(const char *argument)
{
undo_undo(current_sprite->undo);
sprite_generate_mask_boundaries(current_sprite);
GUI_Refresh(current_sprite);
}

View File

@ -106,6 +106,7 @@ void command_execute_quick_copy(const char *argument);
void command_execute_quick_move(const char *argument);
void command_execute_record_screen(const char *argument);
void command_execute_rectangle_tool(const char *argument);
bool command_enabled_redo(const char *argument);
void command_execute_redo(const char *argument);
void command_execute_refresh(const char *argument);
void command_execute_remove_frame(const char *argument);
@ -127,6 +128,7 @@ void command_execute_split_editor_vertically(const char *argument);
void command_execute_spray_tool(const char *argument);
void command_execute_sprite_properties(const char *argument);
void command_execute_tips(const char *argument);
bool command_enabled_undo(const char *argument);
void command_execute_undo(const char *argument);
static Command commands[] = {
@ -142,8 +144,8 @@ static Command commands[] = {
{ CMD_SAVE_SESSION, NULL, NULL, NULL, NULL },
CMD0(about),
CMD0(exit),
{ CMD_UNDO, NULL, NULL, NULL, NULL },
{ CMD_REDO, NULL, NULL, NULL, NULL },
CMD1(undo),
CMD1(redo),
{ CMD_CUT, NULL, NULL, NULL, NULL },
{ CMD_COPY, NULL, NULL, NULL, NULL },
{ CMD_PASTE, NULL, NULL, NULL, NULL },