Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cz_012273
MyDelphi
提交
63813e78
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 搜索 >>
提交
63813e78
编写于
10月 17, 2021
作者:
C
cz_012273
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决记事本memo虚拟键盘遮挡
上级
c2f0d0e3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
51 addition
and
50 deletion
+51
-50
MyDelphi.dproj
MyDelphi.dproj
+9
-9
Unit1.fmx
Unit1.fmx
+1
-0
Unit1.pas
Unit1.pas
+41
-41
未找到文件。
MyDelphi.dproj
浏览文件 @
63813e78
...
...
@@ -300,15 +300,15 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="
Icon\Authenticator(2).png" Configuration="Debug" Class="Android_LauncherIcon48
">
<DeployFile LocalName="
$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png" Configuration="Debug" Class="Android_NotificationIcon72
">
<Platform Name="Android64">
<RemoteName>ic_
launcher
.png</RemoteName>
<RemoteName>ic_
notification
.png</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="
$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png" Configuration="Debug" Class="Android_NotificationIcon72
">
<DeployFile LocalName="
Icon\Authenticator(2).png" Configuration="Debug" Class="Android_LauncherIcon48
">
<Platform Name="Android64">
<RemoteName>ic_
notification
.png</RemoteName>
<RemoteName>ic_
launcher
.png</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
...
...
@@ -348,23 +348,23 @@
<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>
</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>
...
...
Unit1.fmx
浏览文件 @
63813e78
...
...
@@ -26,6 +26,7 @@ object Form1: TForm1
Size.Height = 473.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
OnMouseLeave = Memo1MouseLeave
Viewport.Width = 393.000000000000000000
Viewport.Height = 465.000000000000000000
end
...
...
Unit1.pas
浏览文件 @
63813e78
...
...
@@ -27,8 +27,10 @@ type
procedure
Formshow
(
Sender
:
TObject
);
procedure
FormClose
(
Sender
:
TObject
;
var
Action
:
TCloseAction
);
//procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure
FormKeyUp
(
Sender
:
TObject
;
var
Key
:
Word
;
var
KeyChar
:
Char
;
Shift
:
TShiftState
);
// procedure FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
// Shift: TShiftState);
procedure
Memo1MouseLeave
(
Sender
:
TObject
);
private
...
...
@@ -126,6 +128,7 @@ begin
reader
.
Free
;
label1
.
text
:=
'当前文件:'
+
AFileName
;
//取文件名
memo1
.
selstart
:=
0
;
//光标放最前面
end
;
end
;
...
...
@@ -178,29 +181,6 @@ end;
procedure
TForm1
.
FileSaveAsClick
(
Sender
:
TObject
);
//另存
begin
GetFileSaveDialog
(
ResultProc1
);
//调用通用对话框
{
TDialogService.PreferredMode:=TDialogService.TPreferredMode.Async; //:全平台用异步模式:
TDialogService.InputQuery('另存为', [string('').PadLeft(7,#32)+'请输入文件名:'], [''],
procedure(const AResult: TModalResult; const AValues: array of string)
var
LCaption: string;
begin
LCaption := AValues[0];
if AResult=mrOk then
begin
if not LCaption.IsEmpty then
begin
SetFileName(LCaption);
Memo1.Lines.SaveToFile(FFileName); //根据输入文件名保存
end
else FileSaveAsClick(Sender); //:如果没有用户输入,就反复执行自己
end
else if AResult=mrCancel then
exit
else FileSaveAsClick(Sender); //:如果没有用户输入,就反复执行自己
end);
}
end
;
procedure
TForm1
.
FileExitClick
(
Sender
:
TObject
);
//退出
...
...
@@ -229,6 +209,25 @@ begin
label1
.
text
:=
'当前文件:'
+
sUntitled
;
end
;
procedure
TForm1
.
Memo1MouseLeave
(
Sender
:
TObject
);
//改变memo1高度以适应虚拟键盘
var
i
:
Integer
;
begin
i
:=
Memo1
.
SelStart
;
//showmessage(inttostr(i));
if
(
i
>
0
)
and
(
memo1
.
height
>
470
)
then
begin
memo1
.
height
:=
370
;
memo1
.
selstart
:=
i
;
end
;
end
;
function
WordLoHiExchange
(
w
:
Word
):
word
;
//高低位互换
var
hi
:
word
;
...
...
@@ -264,22 +263,23 @@ begin
end
;
end
;
procedure
TForm1
.
FormKeyUp
(
Sender
:
TObject
;
var
Key
:
Word
;
var
KeyChar
:
Char
;
//按两次退出过程,不起作用?
Shift
:
TShiftState
);
begin
{$IFDEF ANDROID}
if
(
Key
=
vkHardwareBack
)
then
begin
if
not
FWantExit
then
begin
Key
:=
0
;
ToastConfirm
(
'再按一次退出程序.'
);
end
else
MainActivity
.
finish
;
FWantExit
:=
True
;
end
;
{$ENDIF}
end
;
//procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; //按两次退出过程,不起作用?
// Shift: TShiftState);
//begin
//{$IFDEF ANDROID}
// if (Key = vkHardwareBack) then
// begin
// if not FWantExit then
// begin
// Key := 0;
// ToastConfirm('再按一次退出程序.');
// end else
// MainActivity.finish;
// FWantExit := True;
// end;
//{$ENDIF}
//end;
procedure
TForm1
.
AniToastFinish
(
Ani
:
TObject
);
//按两次退出提示框结束
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录