当前位置: 首页 > news >正文

开发游戏软件公司新网seo关键词优化教程

开发游戏软件公司,新网seo关键词优化教程,长沙做网站的公司有哪些,搭建企业网站流程目录 一、前言 二、实现方法 1. 第一步 2. 第二步 3. 第三步 三、主程序代码 四、下载 1. 可执行程序 2. 程序源代码 一、前言 在用Delphi做日常开发的时候,经常需要显示程序运行的日志,一般我们会使用TMemo,使用起来简单&#xff0c…

目录

一、前言

二、实现方法

1. 第一步

2. 第二步

3. 第三步

三、主程序代码

四、下载

1. 可执行程序

2. 程序源代码


一、前言

        在用Delphi做日常开发的时候,经常需要显示程序运行的日志,一般我们会使用TMemo,使用起来简单,方便。但是缺点也很明显,就是只能显示单色文字,字体也只能统一设置,无法实现个性颜色和字体。

        但是我们看大的一些系统,日志则非常美观、漂亮、专业。

        例如,Delphi的编译日志如下:

        那么,我们能收实现这样的日志显示框呢,当然可以,而且非常简单,无需使用任何第三方控件,使用Delphi自带的TRichEdit就可以。

二、实现方法

        通过对TRichEdit进行Helper构造,增加一个显示多颜色的命令即可。

1. 第一步

        编写一个uTRichEdit_Helper.pas单元,在该单元中增加一个Add_Color_Log方法,该方法有5个参数:

序号参数类别默认说明
1msgstring需要显示的消息字符串
2FontColorTColorclBlack(黑色)字体显示的颜色
3FontSizeByte9字体大小
4FontStyleTFontStyles[ ]字体格式
5LeftMarginByte4左边预留空格
{********************************************************  时间:2023-12-03*  作者:sensor wu*  功能:实现TRichEdit的彩色可编程 Log 功能**  此处为 VCL,FMX不支持该控件**  说明:*    msg: 需要显示的消息内容*    FontColor: 需要现实的颜色,默认黑色*    FontSize : 字体大小,默认9号字体*    FontStyle: 字体是否加粗、斜体等显示,默认不是*    LeftMargin: 左边留空格数量,默认是4**  快捷用法:*  1.  RichEdit.Add_Color_log('编译成功!'#13#10, clGreen);   //显示一行绿色*  2.  RichEdit.Add_Color_log('编译错误:');*      RichEdit.Add_Color_log('23行缺少逗号...'#13#10,clRed);  //显示一行:编译错误: 23行缺少逗号...  前面黑色,后面红色*******************************************************}
unit uTRichEdit_Helper;interface
usesVcl.Graphics,      //TColorWinapi.Messages,   //消息常量,例如:EM_SCROLLCARET ,为了减少空间,可以不引该单元,直接使用数字解开Winapi.Windows,    //消息常量,例如:SB_ENDSCROLLVcl.ComCtrls;typeTRichEditHelper = class helper for TRichEditpublicprocedure Add_Color_log(msg: string; FontColor : TColor = clBlack; FontSize : Byte = 9; FontStyle : TFontStyles = []; LeftMargin: Byte = 4);end;implementation{ TRichEditHelper }procedure TRichEditHelper.Add_Color_log(msg: string; FontColor: TColor;FontSize: Byte; FontStyle: TFontStyles; LeftMargin: Byte);
begin//此处省略了实现代码
end;end.

2. 第二步

        在主程序中引用该单元:

implementationusesuTRichEdit_Helper;

3. 第三步

        使用:

  RichEdit1.Add_Color_log(#13#10);RichEdit1.Add_Color_log('Checking project dependencies...'#13#10,clBlack,9,[fsBold]);RichEdit1.Add_Color_log('Compiling RichEdit_Helper_Demo.dproj (Debug,Win32)'#13#10,clBlack,9,[fsBold]);RichEdit1.Add_Color_log('brcc32 command line for "RicheEdit_Helper_Demo.vrc"'#13#10,clBlack);RichEdit1.Add_Color_log('dcc32 command line for "RicheEdit_Helper_Demo.dpr"'#13#10,clBlack);RichEdit1.Add_Color_log('Success'#13#10,clGreen,9,[fsBold]);RichEdit1.Add_Color_log('Elapsed time: 00:00:01.2'#13#10);

三、主程序代码

unit uMainForm_RichEdit;interfaceusesWinapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdUDPServer, IdGlobal, IdSocketHandle,Vcl.ExtCtrls, IdUDPClient, System.ImageList, Vcl.ImgList,Vcl.VirtualImageList, Vcl.BaseImageCollection, Vcl.ImageCollection,IdBaseComponent, IdComponent, IdUDPBase, Vcl.Menus, Vcl.ExtActns,System.Actions, Vcl.ActnList, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.VirtualImage,Vcl.Buttons;typeTForm_RichEdit = class(TForm)Panel_Command: TPanel;SpeedButton6: TSpeedButton;SpeedButton1: TSpeedButton;SpeedButton2: TSpeedButton;SpeedButton7: TSpeedButton;SpeedButton10: TSpeedButton;VirtualImage1: TVirtualImage;Panel_Client: TPanel;Panel_LeftCommand: TPanel;SpeedButton4: TSpeedButton;RichEdit1: TRichEdit;ActionList1: TActionList;Action_Start: TAction;Action_Stop: TAction;Action_RegService: TAction;Action_UnRegService: TAction;Action_SetParams: TAction;SendMail1: TSendMail;ImageCollection1: TImageCollection;VirtualImageList1: TVirtualImageList;procedure SpeedButton4Click(Sender: TObject);procedure Action_StartExecute(Sender: TObject);procedure Action_SetParamsExecute(Sender: TObject);procedure Action_StopExecute(Sender: TObject);procedure Action_RegServiceExecute(Sender: TObject);procedure Action_UnRegServiceExecute(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varForm_RichEdit: TForm_RichEdit;implementationusesuTRichEdit_Helper;{$R *.dfm}procedure TForm_RichEdit.Action_RegServiceExecute(Sender: TObject);
beginRichEdit1.Add_Color_log('Web服务端口号: ');RichEdit1.Add_Color_log('8080'#13#10,clBlue,9,[]);
end;procedure TForm_RichEdit.Action_SetParamsExecute(Sender: TObject);
beginRichEdit1.Add_Color_log(#13#10);RichEdit1.Add_Color_log('Checking project dependencies...'#13#10,clBlack,9,[fsBold]);RichEdit1.Add_Color_log('Compiling RichEdit_Helper_Demo.dproj (Debug,Win32)'#13#10,clBlack,9,[fsBold]);RichEdit1.Add_Color_log('brcc32 command line for "RicheEdit_Helper_Demo.vrc"'#13#10,clBlack);RichEdit1.Add_Color_log('dcc32 command line for "RicheEdit_Helper_Demo.dpr"'#13#10,clBlack);RichEdit1.Add_Color_log('Success'#13#10,clGreen,9,[fsBold]);RichEdit1.Add_Color_log('Elapsed time: 00:00:01.2'#13#10);
end;procedure TForm_RichEdit.Action_StartExecute(Sender: TObject);
beginRichEdit1.Add_Color_log('服务已经成功启动 (绿色)'#13#10,clGreen,9,[]);
end;procedure TForm_RichEdit.Action_StopExecute(Sender: TObject);
beginRichEdit1.Add_Color_log('服务已经成功停止 (红色)'#13#10,clRed,9,[]);
end;procedure TForm_RichEdit.Action_UnRegServiceExecute(Sender: TObject);
beginRichEdit1.Add_Color_log('UDP在这个端口');RichEdit1.Add_Color_log('8192',clGreen,9,[fsBold,fsItalic]);RichEdit1.Add_Color_log('收到数据');RichEdit1.Add_Color_log('(' + FormatDateTime('YYYY-MM-DD hh:mm:ss',Now) +')'#13#10,clGray,9,[]);
end;procedure TForm_RichEdit.SpeedButton4Click(Sender: TObject);
beginRichEdit1.Clear;
end;end.

四、下载

1. 可执行程序

        下载(EXE)程序

2. 程序源代码

        下载(源程序:¥14.9)

        

http://www.hkea.cn/news/746218/

相关文章:

  • 宁夏网站建设优化外贸网站优化推广
  • 开发网站开发工程师培训心得简短200字
  • 网站优化工具升上去软文营销代理
  • 北京监理协会培训网站变现流量推广app
  • 邯郸做wap网站最全bt搜索引擎入口
  • 用网站做自我介绍pptsem推广竞价托管
  • 建设网站项目的目的是什么意思营销型网站方案
  • 濮阳网站建设价格南昌seo排名收费
  • jsp做网站案例steam交易链接在哪里看
  • 做网站需要招聘内容范本信息流广告
  • 如何建公众号外贸网站建设优化
  • 怎么把网站横幅做很大东莞营销推广公司
  • 网站运营与管理实训报告松松软文平台
  • 奉化云优化seo手机网站排名优化软件
  • h5响应式集团网站推荐电商平台有哪些?
  • 企业所得税税率三个档次关键词优化快排
  • 长宁区网站建设b2b免费发布平台
  • php 个人网站网站安全检测工具
  • 做的网站很卡是什么原因seochan是什么意思
  • 怎么做盗版视频网站吗百度权重1
  • 政府网站 建设 计划品牌推广策划方案案例
  • 临沂网站建设那家好小米市场营销案例分析
  • 德化网站建设企业中层管理人员培训课程
  • 网站怎么通过流量赚钱爱站网能不能挖掘关键词
  • 网站建设课后感营销型网站有哪些平台
  • 哪个网站做生鲜配送厦门seo外包公司
  • 水电行业公司设计logo重庆seo排名扣费
  • 可信赖的南昌网站制作站长工具网站
  • 济南建站公司电话成都关键词自然排名
  • 门户网站开发公司推广网页