Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cz_012273
MyDelphi
提交
b98b0d90
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 搜索 >>
提交
b98b0d90
编写于
7月 29, 2023
作者:
C
cz_012273
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改记事本横屏界面(分别设计横竖屏布局),处理虚拟键盘打开时旋转屏幕出错的问题(用close命令退出虚拟键盘编辑状态)。
上级
09a81f8f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
121 addition
and
24 deletion
+121
-24
MainForm.pas
MainForm.pas
+1
-1
MyDelphi.dproj
MyDelphi.dproj
+5
-5
Unit1.LgXhdpiPh.fmx
Unit1.LgXhdpiPh.fmx
+8
-0
Unit1.pas
Unit1.pas
+99
-11
mainform.LgXhdpiPh.fmx
mainform.LgXhdpiPh.fmx
+8
-7
未找到文件。
MainForm.pas
浏览文件 @
b98b0d90
...
...
@@ -194,7 +194,7 @@ end;
procedure
TToolsForm
.
ComboBox1ClosePopup
(
Sender
:
TObject
);
begin
ComboBox1
.
resetfocus
;
ComboBox1
.
resetfocus
;
//ComboBox1失去焦点
end
;
procedure
TToolsForm
.
DisplayRationale
(
Sender
:
TObject
;
...
...
MyDelphi.dproj
浏览文件 @
b98b0d90
...
...
@@ -346,23 +346,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
浏览文件 @
b98b0d90
...
...
@@ -2,6 +2,7 @@ inherited Form1_LgXhdpiPh: TForm1_LgXhdpiPh
ClientHeight = 720
ClientWidth = 450
FormFactor.Height = 720
OnResize = DoOrientationChanged
OnShow = Formshow
DesignerMasterStyle = 3
inherited Image1: TImage
...
...
@@ -19,37 +20,44 @@ inherited Form1_LgXhdpiPh: TForm1_LgXhdpiPh
Viewport.Height = 498.000000000000000000
end
inherited Button1: TButton
Anchors = [akTop]
StyledSettings = [Family, Size, Style]
Position.X = 371.000000000000000000
Size.Width = 80.000000000000000000
TextSettings.FontColor = claDarkgreen
end
inherited Filedelete: TButton
Anchors = []
Position.X = 6.000000000000000000
Position.Y = 665.000000000000000000
Size.Width = 165.000000000000000000
end
inherited FileExit: TButton
Anchors = []
Position.X = 278.000000000000000000
Position.Y = 665.000000000000000000
Size.Width = 165.000000000000000000
end
inherited FileNew: TButton
Anchors = []
Position.X = 6.000000000000000000
Position.Y = 537.000000000000000000
Size.Width = 165.000000000000000000
end
inherited FileOpen: TButton
Anchors = []
Position.X = 278.000000000000000000
Position.Y = 537.000000000000000000
Size.Width = 165.000000000000000000
end
inherited FileSave: TButton
Anchors = []
Position.X = 6.000000000000000000
Position.Y = 601.000000000000000000
Size.Width = 165.000000000000000000
end
inherited FileSaveAs: TButton
Anchors = []
Position.X = 278.000000000000000000
Position.Y = 601.000000000000000000
Size.Width = 165.000000000000000000
...
...
Unit1.pas
浏览文件 @
b98b0d90
...
...
@@ -4,7 +4,7 @@ interface
uses
System
.
SysUtils
,
System
.
Types
,
System
.
UITypes
,
System
.
Classes
,
System
.
Variants
,
System
.
Variants
,
FMX
.
VirtualKeyboard
,
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
,
Posix
.
Unistd
;
...
...
@@ -36,6 +36,7 @@ type
procedure
FiledeleteMouseUp
(
Sender
:
TObject
;
Button
:
TMouseButton
;
Shift
:
TShiftState
;
X
,
Y
:
Single
);
procedure
Memo1MouseMove
(
Sender
:
TObject
;
Shift
:
TShiftState
;
X
,
Y
:
Single
);
procedure
DoOrientationChanged
(
Sender
:
TObject
);
private
{ Private declarations }
...
...
@@ -65,7 +66,7 @@ implementation
uses
{$IFDEF ANDROID}
{$ENDIF}
MyDialogs
;
MyDialogs
,
FMX
.
Platform
;
type
TTextFormat
=
(
tfAnsi
,
tfUnicode
,
tfUnicodeBigEndian
,
tfUtf8
);
...
...
@@ -74,6 +75,8 @@ var
today
:
Cardinal
;
selstart
:
integer
;
sellength
:
integer
;
screenstate
:
integer
;
const
// TextFormatFlag: array[tfAnsi..tfUtf8] of word=($0000,$FFFE,$FEFF,$EFBB);
...
...
@@ -81,8 +84,10 @@ const
$
BBEF
);
// 编码标志高低字节互换
{$R *.fmx}
{$R *.LgXhdpiPh.fmx ANDROID}
resourcestring
sSaveChanges
=
'是否将未更改保存到 %s?'
;
sOverWrite
=
'%s 已存在。'
+
#
13
#
10
+
'要替换它吗?'
;
...
...
@@ -91,6 +96,85 @@ resourcestring
sColRowInfo
=
'Line: %3d Col: %3d'
;
sCommonDlgFileName
=
'文本文档(*.txt)|*.txt|所有文件(*.*)|*.*'
;
procedure
TForm1
.
DoOrientationChanged
(
Sender
:
TObject
);
var
screenService
:
IFMXScreenService
;
Keyboard
:
IFMXVirtualKeyboardService
;
begin
if
Assigned
(
Label_A
)
and
Assigned
(
Button_A
)
then
begin
if
TPlatformServices
.
Current
.
SupportsPlatformService
(
IFMXVirtualKeyboardService
,
Keyboard
)
then
begin
if
TVirtualKeyBoardState
.
Visible
in
Keyboard
.
GetVirtualKeyBoardState
then
begin
Keyboard
.
HideVirtualKeyboard
;
//关闭虚拟键盘
end
end
;
Close
;
//使编辑框失去焦点
Label_A
.
visible
:=
false
;
Label_B
.
visible
:=
false
;
Button_A
.
visible
:=
false
;
Button_B
.
visible
:=
false
;
end
;
if
TPlatformServices
.
Current
.
SupportsPlatformService
(
IFMXScreenService
,
screenService
)
then
begin
case
screenService
.
GetScreenOrientation
of
TScreenOrientation
.
Portrait
:
//竖屏状态
begin
screenstate
:=
1
;
memo1
.
height
:=
480
;
memo1
.
width
:=
344
;
button1
.
position
.
x
:=
275
;
filenew
.
position
.
x
:=
6
;
filenew
.
position
.
y
:=
527
;
filesave
.
position
.
x
:=
6
;
filesave
.
position
.
y
:=
591
;
filedelete
.
position
.
x
:=
6
;
filedelete
.
position
.
y
:=
655
;
fileopen
.
position
.
x
:=
188
;
fileopen
.
position
.
y
:=
527
;
filesaveas
.
position
.
x
:=
188
;
filesaveas
.
position
.
y
:=
591
;
fileexit
.
position
.
x
:=
188
;
fileexit
.
position
.
y
:=
655
;
end
;
TScreenOrientation
.
Landscape
:
//横屏状态
begin
screenstate
:=
2
;
memo1
.
height
:=
328
;
memo1
.
width
:=
532
;
button1
.
position
.
x
:=
463
;
filenew
.
position
.
x
:=
555
;
filenew
.
position
.
y
:=
10
;
filesave
.
position
.
x
:=
555
;
filesave
.
position
.
y
:=
70
;
filedelete
.
position
.
x
:=
555
;
filedelete
.
position
.
y
:=
130
;
fileopen
.
position
.
x
:=
555
;
fileopen
.
position
.
y
:=
190
;
filesaveas
.
position
.
x
:=
555
;
filesaveas
.
position
.
y
:=
250
;
fileexit
.
position
.
x
:=
555
;
fileexit
.
position
.
y
:=
310
;
end
;
TScreenOrientation
.
InvertedPortrait
:
//倒竖屏状态
begin
screenstate
:=
3
;
memo1
.
height
:=
480
;
memo1
.
width
:=
344
;
button1
.
position
.
x
:=
275
;
filenew
.
position
.
x
:=
6
;
filenew
.
position
.
y
:=
527
;
filesave
.
position
.
x
:=
6
;
filesave
.
position
.
y
:=
591
;
filedelete
.
position
.
x
:=
6
;
filedelete
.
position
.
y
:=
655
;
fileopen
.
position
.
x
:=
188
;
fileopen
.
position
.
y
:=
527
;
filesaveas
.
position
.
x
:=
188
;
filesaveas
.
position
.
y
:=
591
;
fileexit
.
position
.
x
:=
188
;
fileexit
.
position
.
y
:=
655
;
end
;
TScreenOrientation
.
InvertedLandscape
:
//倒横屏状态
begin
screenstate
:=
4
;
memo1
.
height
:=
328
;
memo1
.
width
:=
532
;
button1
.
position
.
x
:=
463
;
filenew
.
position
.
x
:=
555
;
filenew
.
position
.
y
:=
10
;
filesave
.
position
.
x
:=
555
;
filesave
.
position
.
y
:=
70
;
filedelete
.
position
.
x
:=
555
;
filedelete
.
position
.
y
:=
130
;
fileopen
.
position
.
x
:=
555
;
fileopen
.
position
.
y
:=
190
;
filesaveas
.
position
.
x
:=
555
;
filesaveas
.
position
.
y
:=
250
;
fileexit
.
position
.
x
:=
555
;
fileexit
.
position
.
y
:=
310
;
end
;
end
;
end
;
end
;
procedure
TForm1
.
SetFileName
(
const
FileName
:
String
);
begin
FFileName
:=
System
.
IOUtils
.
Tpath
.
GetSharedDocumentsPath
+
'/'
+
...
...
@@ -259,7 +343,7 @@ begin
Label_B
.
free
;
Button_A
.
free
;
Button_B
.
free
;
Memo1
.
height
:=
51
0
;
// 将meno控件恢复到默认高度
Memo1
.
height
:=
48
0
;
// 将meno控件恢复到默认高度
Memo1
.
Lines
.
clear
;
end
;
FWantExit
:=
True
;
...
...
@@ -289,20 +373,24 @@ end;
procedure
TForm1
.
Memo1MouseLeave
(
Sender
:
TObject
);
// 改变memo1高度以适应虚拟键盘
var
i
:
integer
;
const
halfscreen
:
integer
=
403
;
//显示输入法界面后的memo高度
halfscreen
:
integer
;
//显示输入法界面后的memo高度
begin
i
:=
Memo1
.
selstart
;
// showmessage(inttostr(i));
if
(
i
>
0
)
and
(
Memo1
.
height
>
430
)
then
if
(
screenstate
=
2
)
or
(
screenstate
=
4
)
then
halfscreen
:=
298
else
halfscreen
:=
403
;
if
(
i
>
0
)
and
(
Memo1
.
height
>
halfscreen
)
then
begin
Memo1
.
height
:=
halfscreen
;
Memo1
.
selstart
:=
i
;
//创建显示行、列号标签
Label_A
:=
tlabel
.
Create
(
Self
);
if
not
Assigned
(
Label_A
)
then
Label_A
:=
tlabel
.
Create
(
Self
);
with
Label_A
do
begin
Parent
:=
Self
;
...
...
@@ -314,7 +402,7 @@ begin
Visible
:=
true
;
end
;
Label_B
:=
tlabel
.
Create
(
Self
);
if
not
Assigned
(
Label_B
)
then
Label_B
:=
tlabel
.
Create
(
Self
);
with
Label_B
do
begin
Parent
:=
Self
;
...
...
@@ -328,7 +416,7 @@ begin
//创建滚动条加速按钮
Button_A
:=
tButton
.
Create
(
Self
);
if
not
Assigned
(
Button_A
)
then
Button_A
:=
tButton
.
Create
(
Self
);
with
Button_A
do
begin
Parent
:=
Self
;
...
...
@@ -341,7 +429,7 @@ begin
onclick
:=
Button_A_Click
;
//设置点击事件
end
;
Button_B
:=
tButton
.
Create
(
Self
);
if
not
Assigned
(
Button_B
)
then
Button_B
:=
tButton
.
Create
(
Self
);
with
Button_B
do
begin
Parent
:=
Self
;
...
...
@@ -356,7 +444,7 @@ begin
end
;
if
Memo1
.
height
=
halfscreen
then
//动态更新行列号
if
(
Memo1
.
height
=
halfscreen
)
and
(
Assigned
(
Label_A
))
then
//动态更新行列号
begin
Label_A
.
Text
:=
'当前行号:'
+
IntToStr
(
Memo1
.
CaretPosition
.
line
+
1
);
Label_B
.
Text
:=
'当前列号:'
+
IntToStr
(
Memo1
.
CaretPosition
.
Pos
+
1
);
...
...
mainform.LgXhdpiPh.fmx
浏览文件 @
b98b0d90
...
...
@@ -32280,6 +32280,7 @@ inherited ToolsForm_LgXhdpiPh: TToolsForm_LgXhdpiPh
end
inherited Panel1: TPanel
Position.X = 16.000000000000000000
Size.Width = 330.000000000000000000
Size.Height = 305.000000000000000000
inherited Label1: TLabel
StyledSettings = [Family, Style, FontColor]
...
...
@@ -32294,7 +32295,7 @@ inherited ToolsForm_LgXhdpiPh: TToolsForm_LgXhdpiPh
inherited Label3: TLabel
StyledSettings = [Family, Style, FontColor]
Position.X = 7.000000000000000000
Position.Y = 1
8
0.000000000000000000
Position.Y = 1
7
0.000000000000000000
Size.Width = 50.000000000000000000
Size.Height = 25.000000000000000000
Text = #25628#32034
...
...
@@ -32302,7 +32303,7 @@ inherited ToolsForm_LgXhdpiPh: TToolsForm_LgXhdpiPh
inherited Label2: TLabel
StyledSettings = [Family, Style, FontColor]
Position.X = 7.000000000000000000
Position.Y =
102
.000000000000000000
Position.Y =
97
.000000000000000000
Size.Width = 50.000000000000000000
Size.Height = 25.000000000000000000
TextSettings.Font.Size = 24.000000000000000000
...
...
@@ -32310,13 +32311,13 @@ inherited ToolsForm_LgXhdpiPh: TToolsForm_LgXhdpiPh
end
inherited Edit2: TEdit
Position.X = 72.000000000000000000
Position.Y = 1
7
5.000000000000000000
Position.Y = 1
6
5.000000000000000000
Size.Width = 250.000000000000000000
end
inherited Edit1: TEdit
Text = 'www.baidu.com'
Position.X = 72.000000000000000000
Position.Y = 9
7
.000000000000000000
Position.Y = 9
2
.000000000000000000
Size.Width = 250.000000000000000000
end
inherited ComboBox1: TComboBox
...
...
@@ -32329,12 +32330,12 @@ inherited ToolsForm_LgXhdpiPh: TToolsForm_LgXhdpiPh
inherited SpeedButton1: TSpeedButton
AutoTranslate = False
Position.X = 24.000000000000000000
Position.Y = 2
5
0.000000000000000000
Position.Y = 2
4
0.000000000000000000
OnClick = SpeedButton1Click
end
inherited SpeedButton2: TSpeedButton
Position.X = 20
0
.000000000000000000
Position.Y = 2
5
0.000000000000000000
Position.X = 20
2
.000000000000000000
Position.Y = 2
4
0.000000000000000000
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录