当前位置 : 主页 > 编程语言 > delphi >

Delphi中的Unicode形式为TRectangle TText

来源:互联网 收集:自由互联 发布时间:2021-06-23
我是Delphi的新手.在DelphiXE4编辑器中,我试图在表格上制作棋盘gui,使用x64 TRectangle作为棋盘(替代颜色).我想添加unicode国际象棋棋子,但是当我添加unicode时,它会在ObjectInspector属性中逐字地显
我是Delphi&的新手.在DelphiXE4编辑器中,我试图在表格上制作棋盘gui,使用x64 TRectangle作为棋盘(替代颜色).我想添加unicode国际象棋棋子,但是当我添加unicode时,它会在ObjectInspector属性中逐字地显示在表单上.如何将Unicode添加到TText(因此表单将unicode显示为棋子)?
(之后我想将dragndrop添加到TRectangles / unicode国际象棋 – 任何想法?).

Rectangle63: TRectangle;
Rectangle64: TRectangle;
Text1: TText;
Text2: TText;

这是截图显示问题:

我非常感谢你的帮助,谢谢

编辑:
Jeroen的答案为我解决了这个问题(我将实际的unicode棋子图像复制/粘贴到TText文本属性中).到目前为止我添加了exe的截图.接下来我要为这些作品添加DRAGNDROP …..

EDIT2:
(Jeroen字体大小问题已修复)
固定unicode黑色王显示 – 见截图:

Unicode Chess Pieces可以在任何德尔福应用程序中显示,只要您喜欢包含0700表示 Unicode的各种 CodePoints(表示 Chess Pieces).

Actually, it does not matter what platform or development environment
you use, as long as they support Unicode and you have the right font.

你需要:

>输入这些Unicode CodePoints的方法
>在目标平台上将这些Unicode CodePoints表示为字形的字体

从Microsoft Windows开始,对于Microsoft Windows,这些字体工作正常:

> Segoe UI
> Tahoma
> Arial Unicode MS

为了进入这些,Microsoft Windows有两种方法:

>如果在注册表中启用它:在键盘上输入hexadecimal Unicode CodePoint数字到Alt-codes
> copy/paste他们来自提供文本的应用程序(即Unicode Input: Selection from Screen)

对于复制/粘贴,我经常使用支持Unicode的Web Browser转到具有正确字符的网页,或使用Character Map应用程序搜索它们.

要使复制/粘贴更容易:

>这些是白色的:♔♕♖♗♘♙
>这些是黑色的部分:♚♛♜♝♞♟

示例FireMonkey表单,其中包含一个TTRectangle中的1 TText中的所有部分:

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 480
  ClientWidth = 640
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]
  DesignerMobile = False
  DesignerWidth = 0
  DesignerHeight = 0
  DesignerDeviceName = ''
  DesignerOrientation = 0
  object Rectangle1: TRectangle
    Height = 50.000000000000000000
    Width = 80.000000000000000000
    object Text1: TText
      Color = claBlack
      Height = 50.000000000000000000
      Text = #9812#9813#9814#9815#9816#9817#9818#9819#9820#9821#9822#9823
      Width = 80.000000000000000000
    end
  end
end

编辑

我认为您的表单文件中存在字体大小问题.使用表单文件的文本创建一个新问题.有两种方法可以做到:

>打开记事本,并在记事本中打开与您的表单一起的.FMX文件;将文本复制到剪贴板
>在Delphi中,右键单击表单,然后选择“以文本形式查看”,选择所有文本并将其复制到剪贴板,右键单击表单文本,然后选择“以表单形式查看”.

将代码粘贴到http://pastebin.com/或https://gist.github.com/,然后在新问题中发布该链接.在那之后你做了评论,我会看一看.

网友评论