Commit f6057400 authored by Colin Eles's avatar Colin Eles
Browse files

rename new directory to original directory

git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@5987 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parents cf0c0574 a86efb1d
Loading
Loading
Loading
Loading

#my_func.pvs#

deleted100644 → 0
+0 −9
Original line number Diff line number Diff line
my_func:THEORY
BEGIN
IMPORTING ENUM_TYPES
my_func(x:real,y:real,z:real):real = 
COND
x>1->y+z,
x<1->y-z
ENDCOND
END my_func
 No newline at end of file

@Cell/Cell.m

0 → 100644
+43 −0
Original line number Diff line number Diff line
classdef Cell < handle
    
    
    properties
        subgrid = [];
        cond = [];
        cond_text = [];
        cell_index = 0;
        parent_grid = [];
        width = 0;
        height = 0;
        grid_pb = [];
        pb_flag = 0;
        color = [];
        
        condition_text_width = 200;
        condition_text_height = 60;
        condition_text_x = 10;
        condition_text_y = 10;
        condition_text_offset = 20;
        
        grid_push_width = 30;
    end
    
    methods
        %% Cell
        %    
        % inputs:
        %   index:integer - cells index
        %   p_grid:Grid - Parent grid of cell
        % outputs;
        %   object:Cell - created cell
        function object = Cell(index, p_grid)
            object.cell_index = index;
            object.parent_grid = p_grid;
            object.pb_flag = 1;
            
        end
        
    end   
    
end

@Cell/cal_height.m

0 → 100644
+26 −0
Original line number Diff line number Diff line
%% cal_height
%    calculates the height in number of cells of the current cell.
%    if the cell does not have a subgrid the height will be 1, else
%    it will be the height of the subgrid.
% inputs:
%   object:Cell - Current Cell Object 
%   edit:boolean - 0 when not in edit mode, 1 in edit mode
% outputs;
%   h:double - height in number of cells
function h = cal_height(object,edit)
    h = 0;
    if (isempty(object.subgrid))
        h = 1;
    else
        for i=1:size(object.subgrid.cells,2)
            h = h + cal_height(object.subgrid.cells(i),edit);
        end
        % edit button is half a cell high, if in edit mode increase
        % by 0.5
        if (edit == 1)
            h = h + 0.5;
        end

    end
end
       
 No newline at end of file

@Cell/delete_Cell.m

0 → 100644
+28 −0
Original line number Diff line number Diff line
 %% delete_Cell
        %    deletes the current cell, will recursively delete any subgrids
        %    if they exist.
        % inputs:
        %   object:Cell - Current Cell Object         
        % outputs;
        %   none
        function [] = delete_Cell(object)
            if(isempty(object.subgrid))
                delete(object.grid_pb);
                delete(object.cond);
                object.cond = [];
                object.grid_pb = [];
                delete(object);
            else
                % delete the subgrid
                object.subgrid.deep_delete
                if(ishghandle(object.grid_pb))
                    delete(object.grid_pb);
                end
                delete(object.cond);
                object.cond = [];
                object.grid_pb = [];
                delete(object);
            end
        end
        
        
 No newline at end of file

@Cell/flag_cell.m

0 → 100644
+25 −0
Original line number Diff line number Diff line
        %% flag_cell
        % mode
        %   0 - normal
        %   1 - red (error/false)
        %   2 - green (ok/true)
        function [] = flag_cell(object,mode)
        
            if (isempty(object.color))
                object.color = get(object.cond,'BackgroundColor');
            end
            
            if (mode == 0)
                set(object.cond,'BackgroundColor',object.color);
            elseif (mode == 1)
                set(object.cond,'BackgroundColor',[0.92 0.65 0.65])
            elseif (mode == 2)
                set(object.cond,'BackgroundColor',[0.03 1.0 0.32]);
            end
        
        end
        
        function new_cell = clone()
            
        end
    end
 No newline at end of file
Loading