提交 63813e78 编写于 作者: C cz_012273

解决记事本memo虚拟键盘遮挡

上级 c2f0d0e3
......@@ -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>
......
......@@ -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
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册