Ignore:
Timestamp:
Feb 20, 2014, 3:49:21 PM (10 years ago)
Author:
sommeria
Message:

improving figure extracting and keyboard callback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/msgbox_uvmat.m

    r654 r713  
    6262set(handles.Cancel,'Position',[300 2 60 30])
    6363set(handles.Cancel,'FontSize',15)
    64 
     64%set(hObject,'WindowKeyPressFcn',{'@keyboard_callback',handles})%set keyboard action function
    6565
    6666% Update handles structure
     
    206206    else
    207207        if strcmp(get(handles.edit_box,'Style'),'listbox')
    208              varargout{1}=get(handles.edit_box,'Value');
     208            varargout{1}=get(handles.edit_box,'Value');
    209209        else
    210         varargout{1}=get(handles.edit_box,'String');
     210            varargout{1}=get(handles.edit_box,'String');
    211211        end
    212         if isempty(varargout{1}) 
     212        if isempty(varargout{1})
    213213            varargout{1}='Yes';
    214214        end
    215215    end
     216    if strcmp(get(handles.edit_box, 'Visible'), 'on')
     217        varargout{2}=get(handles.edit_box,'String');
     218    end
    216219    % The figure can be deleted now
    217220    delete(handles.figure1);
    218221end
     222
    219223%  delete(handles.figure1);
    220224
     
    276280end   
    277281
    278 
    279 
    280 
    281 
     282%'keyboard_callback:' function activated when a key is pressed on the keyboard
     283%-----------------------------------
     284function keyboard_callback(hObject,eventdata,handleshaxes)
     285cur_axes=get(hObject,'CurrentAxes');%current plotting axes of the figure with handle hObject
     286xx=double(get(hObject,'CurrentCharacter')) %get the keyboard character
     287
     288
     289
Note: See TracChangeset for help on using the changeset viewer.