Changeset 681 for trunk/src/set_object.m


Ignore:
Timestamp:
Sep 2, 2013, 2:42:52 PM (10 years ago)
Author:
sommeria
Message:

mouse action improved for translations, use of magenta color to indicate that REFRESH is needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r680 r681  
    3636function varargout = set_object(varargin)
    3737
    38 % Last Modified by GUIDE v2.5 28-Aug-2013 20:41:02
     38% Last Modified by GUIDE v2.5 02-Sep-2013 11:39:56
    3939
    4040% Begin initialization code - DO NOT REFRESH
     
    9393    ZBounds=0; %default
    9494end
    95 set(handles.Coord,'KeyPressFcn',{@key_press_fcn,handles})%set keyboard action function (allow action on uvmat when set_object is in front)
    9695set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function
    9796set(hObject,'DeleteFcn',{@closefcn})
     
    116115    end
    117116    Type_Callback(hObject, eventdata, handles)% update the GUI set_object depending on the object type   
    118 
     117    set(handles.REFRESH,'BackgroundColor',[1 0 0])
    119118    if isfield(data,'RangeZ') && length(ZBounds) >= 2
    120119        set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3))
     
    219218function Type_Callback(hObject, eventdata, handles)
    220219%------------------------------------------------------------------------
    221 %style_prev=get(handles.Type,'UserData');%previous object style
     220
    222221ListType=get(handles.Type,'String');
    223222Type=ListType{get(handles.Type,'Value')};
     
    271270% --- Executes on selection change in ProjMode.
    272271%------------------------------------------------------------------------
    273 
    274272function ProjMode_Callback(hObject, eventdata, handles)
     273
     274set(handles.REFRESH,'BackgroundColor',[1 0 1])
    275275menu=get(handles.ProjMode,'String');
    276276value=get(handles.ProjMode,'Value');
     
    419419function REFRESH_Callback(hObject, eventdata, handles)
    420420
    421 set(handles.REFRESH,'BackgroundColor',[1 1 0])
     421set(handles.REFRESH,'BackgroundColor',[1 1 0])% indicate activation of REFRESH
    422422drawnow
    423423
     
    588588set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update
    589589set(hhuvmat.CheckViewField,'Value',1)
     590
    590591set(handles.REFRESH,'BackgroundColor',[1 0 0])
     592%set(handles.Coord,'BackgroundColor',[1 1 1])
     593set(handles.num_RangeY_2,'BackgroundColor',[1 1 1])
     594
    591595%------------------------------------------------------------------------
    592596% --- Executes on button press in MenuCoord.
     
    617621
    618622function num_RangeX_2_Callback(hObject, eventdata, handles)
     623
    619624%------------------------------------------------------------------------
    620625%------------------------------------------------------------------------
     
    720725function Coord_CellEditCallback(hObject, eventdata, handles)
    721726%------------------------------------------------------------------------
     727%set(handles.Coord,'BackgroundColor',[1 1 0])
    722728% ListType=get(handles.Type,'String');
    723729% Type=ListType{get(handles.Type,'Value')};
     
    744750end
    745751
    746 %------------------------------------------------------------------------
    747 % --- 'key_press_fcn:' function activated when a key is pressed on the keyboard
    748 %------------------------------------------------------------------------
    749 function key_press_fcn(hObject,eventdata,handles)
    750 
     752
     753function num_Angle_3_Callback(hObject, eventdata, handles)
     754
     755%------------------------------------------------------------------------
     756% --- Executes on key press with selection of a uicontrol
     757%------------------------------------------------------------------------
     758function KeyPressFcn(hObject, eventdata, handles)
     759set(handles.REFRESH,'BackgroundColor',[1 0 1])% se REFRESH to magenta color, indicates that refresh needs to be done
     760
     761%------------------------------------------------------------------------
     762% --- Executes on key press with focus on Coord and none of its controls.
     763%------------------------------------------------------------------------
     764function Coord_KeyPressFcn(hObject, eventdata, handles)
     765
     766set(handles.REFRESH,'BackgroundColor',[1 0 1])
    751767xx=double(get(handles.set_object,'CurrentCharacter')); %get the keyboard character
    752768if ismember(xx,[127 31])% delete, or downward
     
    763779end
    764780
    765 function num_Angle_3_Callback(hObject, eventdata, handles)
    766 % hObject    handle to num_Angle_3 (see GCBO)
    767 % eventdata  reserved - to be defined in a future version of MATLAB
    768 % handles    structure with handles and user data (see GUIDATA)
    769 
    770 % Hints: get(hObject,'String') returns contents of num_Angle_3 as text
    771 %        str2double(get(hObject,'String')) returns contents of num_Angle_3 as a double
     781
     782
Note: See TracChangeset for help on using the changeset viewer.