提交 13ee56e8 编写于 作者: C cz_012273

临时修改,未完成(html调试)

上级 a62b4413
......@@ -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
......
......@@ -227,7 +227,7 @@
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="MainForm.pas">
<DCCReference Include="mainform.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>
......
......@@ -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
......@@ -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
......@@ -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.
先完成此消息的编辑!
想要评论请 注册