Commit c61404cf authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Update draw_onto to be protected.

The draw_onto function is now protected, protecting it from being called when it shouldn't be.


git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_refactor@8788 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent a4eb4a80
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -23,9 +23,11 @@ classdef GUIBase < handle
        end
    end
    
    methods(Abstract)
    methods(Abstract, Access = protected)
        draw_onto(object, parent_handle);
    end
    
    methods(Abstract)
        [x, y] = get_bounding_box( object );
    end
    
+4 −0
Original line number Diff line number Diff line
@@ -27,5 +27,9 @@ classdef GridLayout < GUIBase
        end
    end
    
    methods(Access = protected)
        draw_onto(object, phandle)
    end
    
end
+4 −0
Original line number Diff line number Diff line
@@ -30,5 +30,9 @@ classdef HorizontalLineGridDraw < GUIBase
        end
    end
    
    methods(Access = protected)
        grid_controls = draw_onto( object, parent_handle, grid, grid_controls)
    end
    
end
+8 −6
Original line number Diff line number Diff line
@@ -25,6 +25,14 @@ classdef LetStatmentsDraw < GUIBase
            data.addlistener('StructureChanged', @(src, event)redraw_and_update_bb(object, src, event));
        end
        
        function [x, y] = get_bounding_box(object)
            x = object.gui_params.edit_width+20+object.gui_params.edit_width*2;
            
            y = object.gui_params.edit_height*object.my_data.size() + 20;
        end
    end
    
    methods(Access = protected)
        function draw_onto(object, parent_handle)
            [~, y] = object.get_bounding_box();
            
@@ -75,12 +83,6 @@ classdef LetStatmentsDraw < GUIBase
            set(pb_delete, 'Position', [80, 0, 80, 20]);
            set(pb_new, 'Position', [0, 0, 80, 20]);
        end
        
        function [x, y] = get_bounding_box(object)
            x = object.gui_params.edit_width+20+object.gui_params.edit_width*2;
            
            y = object.gui_params.edit_height*object.my_data.size() + 20;
        end
    end
end
+3 −1
Original line number Diff line number Diff line
@@ -13,7 +13,9 @@ classdef LinearLayoutBase < LayoutBase
            object.children{end+1} = child;
            child.addlistener('BoundingBoxChanged', @(src, event)object.relayout());
        end
    end
    
    methods(Access = protected)
        %NOTE REMOVAL IS NOT SUPPORTED!!!!
        function draw_onto(object, phandle)
            assert(size(object.children, 2) >= size(object.children_controls, 2), 'DONT DO THAT!');
Loading