Loading #my_func.pvs# −9 File deleted. Show changes @Cell/Cell.m +43 Changes for @Cell/Cell.m: 43 added lines, 0 removed lines. 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 +26 Changes for @Cell/cal_height.m: 26 added lines, 0 removed lines. 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 +28 Changes for @Cell/delete_Cell.m: 28 added lines, 0 removed lines. 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 +25 Changes for @Cell/flag_cell.m: 25 added lines, 0 removed lines. 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
@Cell/Cell.m +43 Changes for @Cell/Cell.m: 43 added lines, 0 removed lines. 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 +26 Changes for @Cell/cal_height.m: 26 added lines, 0 removed lines. 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 +28 Changes for @Cell/delete_Cell.m: 28 added lines, 0 removed lines. 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 +25 Changes for @Cell/flag_cell.m: 25 added lines, 0 removed lines. 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