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相应鼠标事件的更多相关文章

  1. 7.JAVA之GUI编程鼠标事件

    鼠标事件: 功能: 1.基本窗体功能实现 2.鼠标移动监听,当鼠标移动到按钮上时,触发打印事件. 3.按钮活动监听,当按钮活动时,触发打印事件. 4.按钮被单击时触发打印事件. 源码如下: impor ...

  2. [javaSE] GUI(鼠标事件)

    调用Button对象的addMouseListener方法,参数:MouseListener对象,这个类是个接口,需要实现以下方法 mouseClicked mousePressed mouseRel ...

  3. 6.JAVA之GUI编程Action事件

    功能:单击一个按钮实现关闭窗口: import java.awt.*; import java.awt.event.*; public class StudyAction { // 定义该图形所需的组 ...

  4. JAVA之旅(三十一)——JAVA的图形化界面,GUI布局,Frame,GUI事件监听机制,Action事件,鼠标事件

    JAVA之旅(三十一)--JAVA的图形化界面,GUI布局,Frame,GUI事件监听机制,Action事件,鼠标事件 有段时间没有更新JAVA了,我们今天来说一下JAVA中的图形化界面,也就是GUI ...

  5. 十. 图形界面(GUI)设计13.鼠标事件

    鼠标事件的事件源往往与容器相关,当鼠标进入容器.离开容器,或者在容器中单击鼠标.拖动鼠标时都会发生鼠标事件.java语言为处理鼠标事件提供两个接口:MouseListener,MouseMotionL ...

  6. Java GUI 鼠标事件

    import java.awt.Button; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.event.Mou ...

  7. Unity3D笔记十六 输入输出-键盘事件、鼠标事件

    输入与控制操作Unity为开发者提供了Input类库,其中包括键盘事件.鼠标事件和触摸事件等一切跨平台所需要的控制事件. 一.键盘事件 1.按下事件 Input.GetKeyDown():如果按键被按 ...

  8. MATLAB鼠标事件

    来源:https://blog.csdn.net/weixin_39090239/article/details/80586930 前记: 人机交互的方式--键盘开关.鼠标.触摸屏.体感传感器(Kin ...

  9. 5.JAVA之GUI编程窗体事件

    我们回顾下第三篇时的内容: 在3.JAVA之GUI编程Frame窗口中窗体是无法直接关闭的,想要关闭须进程管理器结束进程方式关掉. 现在我们就来解决下这个问题. ******************* ...

随机推荐

  1. 前端 HTML body标签相关内容

    想要在网页上展示出来的内容一定要放在body标签中. 常用标签: 标题标签 h1-h6 段落标签 p标签 超链接标签 a标签 列表标签 ul,ol,li 定义列表<dl> 子标签 div ...

  2. CentOS 7.2编译安装nginx1.10.3+MySQL5.5.38+PHP5.5.38

    1.关闭firewallad 关闭防火墙 systemctl stop firewalld.service 禁止firewall开机启动 systemctl disable firewalld.ser ...

  3. metasploit的安装

    //直接安装 apt-get update apt-get install metasploit-framework //连接和安装postgresql apt-get install postgre ...

  4. jmeter之最佳实践

    官方文档: http://jmeter.apache.org/usermanual/best-practices.html 翻译: 16.最佳实践 16.1 始终使用最新版本的JMeter JMete ...

  5. dxCameraControl控件(拍照)

    拍照演示 主要属性设置 Active:True DeviceIndex:设备号,默认为0 其他方法 procedure Capture; //捕获 procedure Pause; //暂停 proc ...

  6. vue中indexDB的应用

    // indexedDB.js,浏览器本地数据库操作 export default { // indexedDB兼容 indexedDB: window.indexedDB || window.web ...

  7. React对比Vue(03 事件的对比,传递参数对比,事件对象,ref获取DOM节点,表单事件,键盘事件,约束非约束组件等)

    import React from 'react'; class Baby extends React.Component { constructor (props) { super(props) t ...

  8. javaIO流

    File类(File类的概述和构造方法) A:File类的概述 File更应该叫做一个路径 文件路径或者文件夹路径 路径分为绝对路径和相对路径 绝对路径是一个固定的路径,从盘符开始 相对路径相对于某个 ...

  9. node.js初识10

    post请求 form.html <!DOCTYPE html> <html lang="en"> <head> <meta charse ...

  10. 监控Tomcat

    监控Tomcat 无论是使用Zabbix.还是jconsole等其他工具,当需要监控Tomcat时,需对Tomcat进行jmx配置.此处以Linux系统为例,配置Tomcat. 注意: 下文中出现的: ...