-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml_app.m
More file actions
90 lines (72 loc) · 2.69 KB
/
Copy pathhtml_app.m
File metadata and controls
90 lines (72 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
classdef html_app < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
HTML_2 matlab.ui.control.HTML
Label matlab.ui.control.Label
HTML matlab.ui.control.HTML
end
% Callbacks that handle component events
methods (Access = private)
% Data changed function: HTML
function HTMLDataChanged(app, event)
data = app.HTML.Data;
% 登录界面
% 问题: 请问登录和密码都用html做 应该怎么做?
data=string(data);
if data== "123"
delete(app.UIFigure)
run app2.mlapp
else
msgbox("你不是一个好鸭子")
return ;
end
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 617 368];
app.UIFigure.Name = 'MATLAB App';
% Create HTML
app.HTML = uihtml(app.UIFigure);
app.HTML.HTMLSource = 'passwordEdit.html';
app.HTML.DataChangedFcn = createCallbackFcn(app, @HTMLDataChanged, true);
app.HTML.Position = [45 242 397 30];
% Create Label
app.Label = uilabel(app.UIFigure);
app.Label.FontSize = 24;
app.Label.FontWeight = 'bold';
app.Label.FontColor = [1 0.4118 0.1608];
app.Label.Position = [91 293 304 31];
app.Label.Text = '小刘鸭王交流群登录器';
% Create HTML_2
app.HTML_2 = uihtml(app.UIFigure);
app.HTML_2.HTMLSource = 'passwordEdit.html';
app.HTML_2.Position = [46 122 397 30];
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = html_app
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end