GUI相应鼠标事件
function varargout = GUI18(varargin)
% GUI18 MATLAB code for GUI18.fig
% GUI18, by itself, creates a new GUI18 or raises the existing
% singleton*.
%
% H = GUI18 returns the handle to a new GUI18 or the handle to
% the existing singleton*.
%
% GUI18('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI18.M with the given input arguments.
%
% GUI18('Property','Value',...) creates a new GUI18 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before GUI18_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to GUI18_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help GUI18 % Last Modified by GUIDE v2. -Jan- :: % Begin initialization code - DO NOT EDIT
gui_Singleton = ;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI18_OpeningFcn, ...
'gui_OutputFcn', @GUI18_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{})
gui_State.gui_Callback = str2func(varargin{});
end if nargout
[varargout{:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT % --- Executes just before GUI18 is made visible.
function GUI18_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to GUI18 (see VARARGIN) % Choose default command line output for GUI18
handles.output = hObject; global ButtonDown pos1;
ButtonDown = [];
pos1 = []; % Update handles structure
guidata(hObject, handles); % UIWAIT makes GUI18 wait for user response (see UIRESUME)
% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.
function varargout = GUI18_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) global ButtonDown pos1;
if strcmp(get(gcf,'SelectionType'),'normal')
ButtonDown = ;
pos1 = get (handles.axes1,'CurrentPoint');
end % Get default command line output from handles structure
varargout{} = handles.output; % --- Executes on mouse motion over figure - except title and menu.
function figure1_WindowButtonMotionFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) global ButtonDown pos1 if ButtonDown ==
pos = get (handles.axes1,'CurrentPoint');
line([pos1(,) pos(,)],[pos1(,) pos(,)],'LineWidth',);
pos1=pos;
end % --- Executes on key release with focus on figure1 or any of its controls.
function figure1_WindowKeyReleaseFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.FIGURE)
% Key: name of the key that was released, in lower case
% Character: character interpretation of the key(s) that was released
% Modifier: name(s) of the modifier key(s) (i.e., control, shift) released
% handles structure with handles and user data (see GUIDATA) % --- Executes on mouse press over figure background, over a disabled or
% --- inactive control, or over an axes background.
function figure1_WindowButtonUpFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global ButtonDown
ButtonDown = ;
画线:
GUI相应鼠标事件的更多相关文章
- 7.JAVA之GUI编程鼠标事件
鼠标事件: 功能: 1.基本窗体功能实现 2.鼠标移动监听,当鼠标移动到按钮上时,触发打印事件. 3.按钮活动监听,当按钮活动时,触发打印事件. 4.按钮被单击时触发打印事件. 源码如下: impor ...
- [javaSE] GUI(鼠标事件)
调用Button对象的addMouseListener方法,参数:MouseListener对象,这个类是个接口,需要实现以下方法 mouseClicked mousePressed mouseRel ...
- 6.JAVA之GUI编程Action事件
功能:单击一个按钮实现关闭窗口: import java.awt.*; import java.awt.event.*; public class StudyAction { // 定义该图形所需的组 ...
- JAVA之旅(三十一)——JAVA的图形化界面,GUI布局,Frame,GUI事件监听机制,Action事件,鼠标事件
JAVA之旅(三十一)--JAVA的图形化界面,GUI布局,Frame,GUI事件监听机制,Action事件,鼠标事件 有段时间没有更新JAVA了,我们今天来说一下JAVA中的图形化界面,也就是GUI ...
- 十. 图形界面(GUI)设计13.鼠标事件
鼠标事件的事件源往往与容器相关,当鼠标进入容器.离开容器,或者在容器中单击鼠标.拖动鼠标时都会发生鼠标事件.java语言为处理鼠标事件提供两个接口:MouseListener,MouseMotionL ...
- Java GUI 鼠标事件
import java.awt.Button; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.event.Mou ...
- Unity3D笔记十六 输入输出-键盘事件、鼠标事件
输入与控制操作Unity为开发者提供了Input类库,其中包括键盘事件.鼠标事件和触摸事件等一切跨平台所需要的控制事件. 一.键盘事件 1.按下事件 Input.GetKeyDown():如果按键被按 ...
- MATLAB鼠标事件
来源:https://blog.csdn.net/weixin_39090239/article/details/80586930 前记: 人机交互的方式--键盘开关.鼠标.触摸屏.体感传感器(Kin ...
- 5.JAVA之GUI编程窗体事件
我们回顾下第三篇时的内容: 在3.JAVA之GUI编程Frame窗口中窗体是无法直接关闭的,想要关闭须进程管理器结束进程方式关掉. 现在我们就来解决下这个问题. ******************* ...
随机推荐
- ORACLE12C架构图
- pip升级时报错--- No module named 'pip._internal'
一.问题: 之前python3.6是安装的pip版本为:pip=9.0.1,我按照提示升级报错,一直装不上pip18.0,于是直接在site-package目录下删掉了pi ...
- WIN32,_WIN32_WIN64
MSDN 里说,VC 有 3 个预处理常量,分别是 _WIN32,_WIN64,WIN32. 只要包含了 Windows.h,那么 WIN32 常量是肯定定义了的,所以不能用于判断平台环境(如果x64 ...
- Python 全栈开发三 python基础 条件与循环
一. 条件语句 python条件语句是根据一条或多条语句的执行结果的真假(True Or False)来决定代码块的执行. 而执行内容可以多行,以缩进来区分表示同一范围. 1.Python判断条件真假 ...
- 强制SVN上传代码时添加日志
因SVN不能像Git一样,审核代码之后才合入到主版本.为了使开发人员养成良好的上传习惯,强制要求上付时必须写明上传内容. 可以通过以下方法设置 1,在SVN服务器上找到源码仓库路径,找到下面文件夹:C ...
- 关于RTSP-Over-HTTP
--------------------更新2018.07.10------------------- myRtspClient-1.3.0开始支持RTSP-Over-HTTP ----------- ...
- [LeetCode] 130. Surrounded Regions_Medium tag: DFS/BFS
Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A reg ...
- JAVA代码(GET方式)请求URL(HTTP,HTTPS)
/** * * @param url 这个只支持http地址,不支持https * @param request * @return */ public static String sendMessa ...
- javascript另类方法高效实现htmlencode()与htmldecode()函数
最常见的做法是采用正则表达式替换的方法,将特殊字符如 < > & 等进行替换,htmlencode的时候这样替换还比较容易,但发过来htmldecode的时候就不一定好用了,因为需 ...
- jquery dataTables例子
https://datatables.net/examples/styling/bootstrap.html http://datatables.club/example/#styling http: ...