classdef GUIBase < handle
    %GUIBASE Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
        phandle = -1
    end
    
    methods
        function draw(object, parent_handle)
            %TODO delete old controls
            object.phandle = parent_handle;
            object.redraw();
        end
        
        function redraw(object)
            draw_onto(object, object.phandle);
        end
        
        function redraw_and_update_bb(object, src, event)
            object.redraw();
            object.notify('BoundingBoxChanged');
        end
    end
    
    methods(Abstract)
        draw_onto(object, parent_handle);
        
        [x, y] = get_bounding_box( object );
    end
    
    events
       BoundingBoxChanged 
    end
    
end

