Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cz_012273
MyDelphi
提交
13ee56e8
MyDelphi
项目概览
cz_012273
/
MyDelphi
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MyDelphi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
13ee56e8
编写于
11月 15, 2021
作者:
C
cz_012273
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
临时修改,未完成(html调试)
上级
a62b4413
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
56 addition
and
23 deletion
+56
-23
MainForm.pas
MainForm.pas
+5
-5
MyDelphi.dproj
MyDelphi.dproj
+6
-6
Unit1.LgXhdpiPh.fmx
Unit1.LgXhdpiPh.fmx
+4
-1
Unit1.fmx
Unit1.fmx
+6
-0
Unit1.pas
Unit1.pas
+35
-11
未找到文件。
MainForm.pas
浏览文件 @
13ee56e8
...
...
@@ -58,7 +58,7 @@ uses
var
urlstr
:
string
;
procedure
TToolsForm
.
Button1Click
(
Sender
:
TObject
);
procedure
TToolsForm
.
Button1Click
(
Sender
:
TObject
);
//确定按钮
var
Intent
:
JIntent
;
...
...
@@ -75,13 +75,13 @@ begin
TAndroidHelper
.
Activity
.
startActivity
(
Intent
);
end
;
procedure
TToolsForm
.
Button2Click
(
Sender
:
TObject
);
procedure
TToolsForm
.
Button2Click
(
Sender
:
TObject
);
//清空按钮
begin
edit1
.
text
:=
''
;
edit2
.
text
:=
''
;
end
;
procedure
TToolsForm
.
Button3Click
(
Sender
:
TObject
);
procedure
TToolsForm
.
Button3Click
(
Sender
:
TObject
);
//健康码
var
Intent
:
JIntent
;
healthcodeurl
:
string
;
...
...
@@ -94,14 +94,14 @@ begin
TAndroidHelper
.
Activity
.
startActivity
(
Intent
);
end
;
procedure
TToolsForm
.
Button4Click
(
Sender
:
TObject
);
procedure
TToolsForm
.
Button4Click
(
Sender
:
TObject
);
//记事本
begin
form1
.
show
;
end
;
procedure
TToolsForm
.
Button5Click
(
Sender
:
TObject
);
procedure
TToolsForm
.
Button5Click
(
Sender
:
TObject
);
//日程表
begin
...
...
MyDelphi.dproj
浏览文件 @
13ee56e8
...
...
@@ -227,7 +227,7 @@
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="
MainF
orm.pas">
<DCCReference Include="
mainf
orm.pas">
<FormDeviceName>iPhone</FormDeviceName>
<Form>ToolsForm</Form>
<FormType>fmx</FormType>
...
...
@@ -342,23 +342,23 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="
$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png" Configuration="Debug" Class="Android_NotificationIcon24
">
<DeployFile LocalName="
Android64\Debug\colors.xml" Configuration="Debug" Class="Android_Colors
">
<Platform Name="Android64">
<RemoteName>ic_notification.png</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Android64\Debug\
AndroidManifest.xml" Configuration="Debug" Class="ProjectAndroidManifest
">
<DeployFile LocalName="Android64\Debug\
styles.xml" Configuration="Debug" Class="AndroidSplashStyles
">
<Platform Name="Android64">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="
Android64\Debug\colors.xml" Configuration="Debug" Class="Android_Colors
">
<DeployFile LocalName="
$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png" Configuration="Debug" Class="Android_NotificationIcon24
">
<Platform Name="Android64">
<RemoteName>ic_notification.png</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Android64\Debug\
styles.xml" Configuration="Debug" Class="AndroidSplashStyles
">
<DeployFile LocalName="Android64\Debug\
AndroidManifest.xml" Configuration="Debug" Class="ProjectAndroidManifest
">
<Platform Name="Android64">
<Overwrite>true</Overwrite>
</Platform>
...
...
Unit1.LgXhdpiPh.fmx
浏览文件 @
13ee56e8
...
...
@@ -37,7 +37,6 @@ inherited Form1_LgXhdpiPh: TForm1_LgXhdpiPh
Position.X = 6.000000000000000000
Position.Y = 512.000000000000000000
Size.Width = 165.000000000000000000
OnClick = FileNewClick
end
inherited FileOpen: TButton
Position.X = 278.000000000000000000
...
...
@@ -57,4 +56,8 @@ inherited Form1_LgXhdpiPh: TForm1_LgXhdpiPh
inherited Label1: TLabel
Size.Width = 450.000000000000000000
end
inherited WebBrowser1: TWebBrowser
Size.Width = 450.000000000000000000
Size.Height = 670.000000000000000000
end
end
Unit1.fmx
浏览文件 @
13ee56e8
...
...
@@ -121,4 +121,10 @@ object Form1: TForm1
Text = 'Label1'
TabOrder = 12
end
object WebBrowser1: TWebBrowser
Align = Client
Size.Width = 418.000000000000000000
Size.Height = 682.000000000000000000
Size.PlatformDefault = False
end
end
Unit1.pas
浏览文件 @
13ee56e8
...
...
@@ -6,7 +6,8 @@ uses
System
.
SysUtils
,
System
.
Types
,
System
.
UITypes
,
System
.
Classes
,
System
.
Variants
,
FMX
.
Types
,
FMX
.
Controls
,
FMX
.
Forms
,
FMX
.
Graphics
,
FMX
.
Dialogs
,
FMX
.
Memo
.
Types
,
FMX
.
Controls
.
Presentation
,
FMX
.
ScrollBox
,
FMX
.
Memo
,
FMX
.
Layouts
,
FMX
.
StdCtrls
,
System
.
IOUtils
,
FMX
.
Objects
,
FMX
.
Ani
,
FMX
.
Effects
,
system
.
DateUtils
;
System
.
IOUtils
,
FMX
.
Objects
,
FMX
.
Ani
,
FMX
.
Effects
,
system
.
DateUtils
,
FMX
.
WebBrowser
;
type
TForm1
=
class
(
TForm
)
...
...
@@ -19,6 +20,7 @@ type
FileSave
:
TButton
;
FileSaveAs
:
TButton
;
Label1
:
TLabel
;
WebBrowser1
:
TWebBrowser
;
procedure
FileNewClick
(
Sender
:
TObject
);
procedure
FileOpenClick
(
Sender
:
TObject
);
...
...
@@ -61,7 +63,7 @@ implementation
uses
{$IFDEF ANDROID}
FMX
.
Platform
.
Android
,
Androidapi
.
JNI
.
GraphicsContentViewText
,
Androidapi
.
Helpers
,
Androidapi
.
JNI
.
Net
,
{$ENDIF}
MyDialogs
;
type
...
...
@@ -103,7 +105,7 @@ end;
procedure
TForm1
.
ResultProc
(
AResult
:
Boolean
;
AFileName
:
string
);
//默认参数过程,打开用到
var
reader
:
TStreamReader
;
TextEncode
,
s
:
string
;
TextEncode
,
s
,
s1
:
string
;
begin
if
AResult
then
begin
...
...
@@ -129,7 +131,13 @@ begin
reader
.
Free
;
s
:=
copy
(
AFileName
,
pos
(
'Documents/'
,
AFileName
)+
10
,
50
);
//取文件名(不带路径)
s1
:=
copy
(
s
,
pos
(
'.'
,
s
)+
1
,
5
);
//取扩展名
label1
.
text
:=
'当前文件:'
+
s
;
if
s1
=
'html'
then
button1
.
text
:=
'运行'
//如打开文件为html网页类型,加入运行调试功能
else
button1
.
text
:=
'选当前行'
;
//如不是html文件,则加入选择当前行功能
memo1
.
selstart
:=
0
;
//光标放最前面
end
;
end
;
...
...
@@ -188,17 +196,33 @@ begin
GetFileSaveDialog
(
ResultProc1
);
//调用通用对话框
end
;
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
);
//选择当前行文本
内容
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
);
//选择当前行文本
(或调试运行html)
var
//Intent : JIntent;
doc
,
url
:
Olevariant
;
Line
:
integer
;
begin
Memo1
.
setfocus
;
with
Memo1
do
begin
Line
:=
CaretPosition
.
line
;
SelStart
:=
SelStart
-
CaretPosition
.
pos
;
if
lines
.
count
>
0
then
SelLength
:=
Length
(
Lines
[
Line
])
;
//如不是空文件,选当前行
end
;
if
button1
.
text
<>
'运行'
then
begin
Memo1
.
setfocus
;
with
Memo1
do
begin
Line
:=
CaretPosition
.
line
;
SelStart
:=
SelStart
-
CaretPosition
.
pos
;
if
lines
.
count
>
0
then
SelLength
:=
Length
(
Lines
[
Line
])
;
//如不是空文件,选当前行
end
;
end
else
begin
url
:=
'about:blank'
;
//或者一个有实际意义的url
WebBrowser1
.
url
:=
url
;
//这样就激活了!
//Intent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW,TJnet_Uri.JavaClass.parse(StringToJString('file://'+FFileName)));
//Intent.setPackage(StringToJString('com.android.browser')); //设置包名;
//TAndroidHelper.Activity.startActivity(Intent);
end
;
end
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录