Unverified Commit 79cceffb authored by Matthew Dawson's avatar Matthew Dawson
Browse files

WIP

parent c9f7b52e
Loading
Loading
Loading
Loading
+6
Changes for @GUI/close_fig.m: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,12 @@
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = close_fig(object,src,event)
object.Data.open = 0;
object.Data.fig = [];
delete(object.fig)
object.fig = [];
object.Data.purge;
return
if (object.validation_report_handle ~= 0)
    delete(object.validation_report_handle);
    object.validation_report_handle = 0;
+10 −10
Changes for @GUI/init.m: 10 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -15,13 +15,14 @@ elseif object.mode == 0
    name = 'Table Tool';
end
% main figure
object.fig = figure('units','pixels',...
object.fig = uifigure('units','pixels',...
    'position',[0 0 object.fig_width object.fig_height],...
    'menubar','none',...
    'name','Table Tool',...
    'numbertitle','off',...
    'resize','on',...
    'Name',name,...
    'AutoResizeChildren','off',...
    'CloseRequestFcn',@(src,event)close_fig(object,src,event),...
    'ResizeFcn',@(src,event)resize_fig(object,src,event));

@@ -98,6 +99,7 @@ object.settings_pb = uicontrol('style','push',...
% Expression Name Label
object.name_label = uicontrol('style','text',...
    'string','Expression Name',...
    'Parent',object.fig,...
    'HorizontalAlign','right',...
    'BackgroundColor',get(object.fig,'Color'));

@@ -115,18 +117,16 @@ object.function_name_control = uicontrol('style','edit',...
% input list label
object.input_label = uicontrol('style','text',...
    'string','Inputs',...
    'Parent',object.fig,...
    'HorizontalAlign','right',...
    'BackgroundColor',get(object.fig,'Color'));

% input list edit box
object.function_inputs_control = uicontrol('style','edit',...
    'units','pix',...
    'Parent',object.fig,...
object.function_inputs_control = uitextarea(object.fig,...
    'HorizontalAlign','center',...
    'FontWeight','bold',...
    'Max',2.0,...
    'FontSize',12,...
    'KeyPressFcn',@(src,event)textbox_callback(object,src,event),...
    'ValueChangingFcn',@(src,event)textbox_callback(object,src,event),...
    'BackgroundColor',[1 1 1]);


@@ -141,10 +141,10 @@ end


% Set up Menu
filemenu = uimenu('Label','File');
editmenu = uimenu('Label','Edit');
checkmenu = uimenu('Label','Typecheck');
helpmenu = uimenu('Label','Help');
filemenu = uimenu('Label','File','Parent',object.fig);
editmenu = uimenu('Label','Edit','Parent',object.fig);
checkmenu = uimenu('Label','Typecheck','Parent',object.fig);
helpmenu = uimenu('Label','Help','Parent',object.fig);
uimenu(filemenu,'Label','New','Accelerator','n','Callback',@(src,event)new_call(object,src,event));
uimenu(filemenu,'Label','Open...','Callback',@(src,event)open_call(object,src,event));
uimenu(filemenu,'Label','Save to Block','Separator','on','Accelerator','s','Callback',@(src,event)save_call(object,src,event));
+5 −26
Changes for @GUI/textbox_callback.m: 5 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -11,22 +11,10 @@
function [] = textbox_callback(object,src,event)
% make sure the character pressed isn't empty

if((strcmp(event.Character,'z')) && (strcmp(char(event.Modifier),'command') || strcmp(char(event.Modifier),'control')))
    return
end
if((strcmp(event.Character,'r')) && (strcmp(char(event.Modifier),'command') || strcmp(char(event.Modifier),'control')))
    return
end

if strcmp(event.Key,'tab')
    event.Character = '';
    return;
end


if(~isempty(unicode2native(event.Character)))
%if(~isempty(unicode2native(event.Character)))
    % make sure the character is a printable character
    if event.Character > 33 || event.Character == 8
    %if event.Character > 33 || event.Character == 8
        if object.pvs_checked == 1
            object.pvs_checked = 0;
            object.update_Statusbar;
@@ -34,7 +22,7 @@ if(~isempty(unicode2native(event.Character)))
                TableBlock.set_block_display(object.block_handle,object.pvs_checked);
            end
        end
    end
    %end
    
    % hack because api does not update the string field of
    % textbox until after it loses focus. temporarily focus on
@@ -51,25 +39,16 @@ if(~isempty(unicode2native(event.Character)))
    % the findobj function finds java objects contained within a specified 
    % Matlab GUI handle
        
    java_obj = findjobj(src);
    java_obj = java_obj.getComponent(0).getComponent(0);
    Cursor_Pos = java_obj.getCaretPosition();
    uicontrol(object.name_label);
        
    undo_data.action = 1;
    undo_data.grid = [];
    undo_data.cell = src;
    undo_data.text = get(src,'String');
    undo_data.text = event.Value;
    undo_data.subgrid = [];
    
    object.undo_man.new_state(undo_data);

    uicontrol(src);
    java_obj.setCaretPosition(Cursor_Pos);
    figure(object.fig);

    object.update_undoredo;
    
    
    
end
 No newline at end of file
%end
 No newline at end of file
−3456

File deleted.

Preview size limit exceeded, changes collapsed.

−60

File deleted.