mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 08:25:45 -07:00
Add functions provided by the midend to tell a front end whether GUI
buttons for undo and redo should currently be greyed out. [originally from svn r9139]
This commit is contained in:
10
midend.c
10
midend.c
@ -428,6 +428,16 @@ void midend_new_game(midend *me)
|
||||
me->pressed_mouse_button = 0;
|
||||
}
|
||||
|
||||
int midend_can_undo(midend *me)
|
||||
{
|
||||
return (me->statepos > 1);
|
||||
}
|
||||
|
||||
int midend_can_redo(midend *me)
|
||||
{
|
||||
return (me->statepos < me->nstates);
|
||||
}
|
||||
|
||||
static int midend_undo(midend *me)
|
||||
{
|
||||
if (me->statepos > 1) {
|
||||
|
Reference in New Issue
Block a user