Commit 99222c5c authored by Colin Eles's avatar Colin Eles
Browse files

latest update, undo manager working better, need to implement redo for a few...

latest update, undo manager working better, need to implement redo for a few senarios, and fix undo when deleting the last remaining cell in a grid

git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@6207 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent 108599b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
                delete(object.cond);
                object.cond = [];
                object.grid_pb = [];
                delete(object);
                %delete(object);
            else
                % delete the subgrid
                object.subgrid.deep_delete
@@ -21,7 +21,7 @@
                delete(object.cond);
                object.cond = [];
                object.grid_pb = [];
                delete(object);
                %delete(object);
            end
        end
        
+16 −0
Original line number Diff line number Diff line
@@ -8,10 +8,26 @@
        %   none
        function [] = pb_call(object,src,event)
            gui = get(src,'userdata');
            
            
            
            
            object.new_Grid;
            gui.reset_wh();
            %gui.draw_grid2(gui.Grid2);
            gui.draw_allgrids(0);
            
             if isempty(event) || event ~= 1

                undo_data.action = 4;
                undo_data.grid = object.subgrid;
                undo_data.cell = object;
                undo_data.text = [];
                undo_data.subgrid = [];
                
                gui.undo_man.new_state(undo_data);
            end
            
        end
        
        
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
                pos(2) = pos2(2);
                pos(3) = pos1(3);
                pos(4) = pos2(4);
                if isempty(grid.Cells(i).result) || load == 1
                if isempty(grid.Cells(i).result) || ~ishandle(grid.Cells(i).result)%load == 1
                    
                    grid.Cells(i).result = object.create_std_text(object.fig,pos);
                    % if we are loading the cell, try to restore the text
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
                pos(1) = pos(1) + (i-1)*grid.cells(i).condition_text_width + grid.cells(i).condition_text_offset + pb_space;
                % if the edit box does not exist create it, if it does
                % adjust it's position.
                if (isempty(grid.cells(i).cond) || load == 1)
                if (isempty(grid.cells(i).cond) || ~ishandle(grid.cells(i).cond))%load == 1)
                    grid.cells(i).cond = object.create_std_text(object.fig,pos);
                    if (load == 1)
                        set(grid.cells(i).cond,'String',grid.cells(i).cond_text); 
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
                    
                    % if the edit box does not exist, ie. it is just being
                    % created or we are loading the figure
                    if (isempty(grid.cells(i).cond) || load == 1)
                    if (isempty(grid.cells(i).cond) || ~ishandle(grid.cells(i).cond))%load == 1)
                        % create the new edit box
                        grid.cells(i).cond = object.create_std_text(object.fig,pos);
                        % if cell is the first in the grid use the new
Loading