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. Ajax请求 一般处理程序参数传递的几种方式

    //第一种Ajax请求 $.ajax({ type:"GET", //请求类型,有get,post等类型,和表单提交是一样的 url:"Result.aspx" ...

  2. 20180323 DataTable增加DataRow方式优化

    1. 我开始开发程序时,很多问题考虑不周期,不断的在改进中 最开始我的写法,创建一个DataTable 的Columns,采用语句 dt2.Columns.Add("ID"); 这 ...

  3. Math.max.apply(null,arr)求最大值

    1.首先了解一下call和apply call 和 apply 的第一个参数是null/undefined时函数内的this指向window 或global call/apply 用来改变函数的执行上 ...

  4. 算法 -- 求最长公共字符串&PHP

    https://blog.csdn.net/hongyuancao/article/details/83308093 本文是利用PHP,求最长公共字符串.思路:利用动态规划和矩阵的思想. 动态规划:就 ...

  5. 【UML】-NO.43.EBook.5.UML.1.003-【UML 大战需求分析】- 状态机图(State Machine Diagram)

    1.0.0 Summary Tittle:[UML]-NO.43.EBook.1.UML.1.003-[UML 大战需求分析]- 状态机图(State Machine Diagram) Style:D ...

  6. 15个Node.js项目列表

    前言: Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台,是一个事件驱动I/O服务端JavaScript环境,基于Google的V8引擎,V8引擎执行Javascri ...

  7. 搭建redsocks 测试环境

    1. 先来谈谈pc的测试环境 socks5代理,因为要在centos下设置,没有yum到socks, 就安装ss5,wget http://jaist.dl.sourceforge.net/proje ...

  8. jquery tooltip插件

    qtip2:http://qtip2.com/ bower install qtip2 // lowercase! 引入一个css和插件即可. <script type="text/j ...

  9. python 判断字符串是否包含子字符串

    第一种方法:in string = 'helloworld' if 'world' in string: print 'Exist' else: print 'Not exist' 第二种方法:fin ...

  10. iOS 第三方框架-SDWebImage

    iOS中著名的牛逼的网络图片处理框架.包含的功能:图片下载.图片缓存.下载进度监听.gif处理等等.用法极其简单,功能十分强大,大大提高了网络图片的处理效率.国内超过90%的iOS项目都有它的影子. ...