CodeTyphon version 1.70 released

CodeTyphon是一个lazarus的集成mod版本,集成了许多的第三方控件,1.70版本已经发布,可以发现,lnet和indy等库已经移植到wince了,不用担心wince下网络库的缺乏了。

changed log:

======> 22-May-2011 ver 1.70 =================================================

   -ADD pl_Graphics32VPR ,Vectorial Polygon Rasterizer for Graphics32 (Win32, Win64, WinCE)
   -ADD pl_BGRAcontrols  ,Visual Components for pl_BGRAbitmap library (Win32, Win64, Linux32, Linux64, WinCE) 
   -ADD pl_pl_ZenGLD3D   ,ZenGL library for DirectX  (Win32, Win64)

   -Rename/Update pl_mooncomp to pl_GeoGIScomp (Win32, Win64, WinCE, Linux32, Linux64) 

   -Update/Fix pl_freefpider 
   -Update pl_Synapse      (SVN 20-5-2011)
   -Update pl_BGRAbitmap   (SVN 20-5-2011)
   -Update pl_ZenGL        (SVN 20-5-2011) 
   -Update pl_GLScene      (SVN 22-5-2011)
   -Update pl_LNetComp     (SVN 20-5-2011)
   -Update pl_KambiEngine  (SVN 20-5-2011)
   -Update pl_LNetComp     (SVN 20-5-2011) 
   -Update pl_FortesReport (SVN 20-5-2011)
   -Update pl_OpenWire     (SVN 20-5-2011)

   -Port pl_Graphics32 to WinCE
   -Port pl_Synapse to WinCE
   -Port pl_lNet to WinCE
   -Port pl_Indy to WinCE
   -Port pl_VisualPlanIt to WinCE
   -Port pl_APE to WinCE
   -Port pl_DCP to WinCE
   -Port pl_FreeSpider to WinCE
   -Port pl_PowerPDF to WinCE
   -Port pl_OpenWire to WinCE

   -Port pl_GLScene to Linux32 and Linux64 (Manual installation to Lazarus IDE for Linux)
   -Port pl_KambiEngine to Linux32 and Linux64 (Manual installation to Lazarus IDE for Linux)    
   

NOTE:  Lazarus 0.9.31   Source from SVN 22-05-2011 Rev 30845
       FreePascal 2.5.1 Source from SVN 19-05-2011 Rev 17500

继续阅读

lazarus中json解析时“string exceeds end of line”错误

Lazarus 0.9.31

jp:=TJSONParser.Create(UTF8Encode(pl));
try
   adList:=jp.Parse as TJSONArray;  

报错:

An exception was raised on the server: string exceeds end of line

其中,pl包含从memo中返回的text值,用superobject的asjson(false,false)编码

其实,就是包含了”’#10’”的字符

 

继续阅读

CodeTyphon version 1.50 发布

CodeTyphon

CodeTyphon is a "Visual Pascal Programming Platform",
with Lazarus+FPC+Tools+Free Components+Free Libraries and all these with full source.
Is a Distribution of Lazarus IDE and FreePascal compiler…

 

更新:

======> 16-Mar-2011 ver 1.50 =================================================

   -ADD Cross Build Targets:
              - armeb-Linux (freepascal only)

   -ADD pl_LNetComp samples to CodeOcean
   -ADD more pl_GLScene samples to CodeOcean

   -Update pl_GLScene      (SVN 16-3-2011)
   -Update pl_KambiEngine  (SVN 16-3-2011)
   -Update pl_BGRAbitmap   (SVN 16-3-2011)
   -Update pl_ZenGL        (SVN 16-3-2011)
   -Update pl_LNetComp     (SVN 16-3-2011)


NOTE:  Lazarus 0.9.31   Source from SVN 16-03-2011 Rev 29875
       FreePascal 2.5.1 Source from SVN 06-03-2011
 Rev 17141

 

下载:

Server 1 (main Server)

Server 2 (Filefactory.com)

Server 3 (Fileserve.com)

在程序运行时,取消系统的关闭显示器和屏保

方法1

procedure WMSysCommand(var Msg : TWMSysCommand); message WM_SYSCOMMAND;
[pascal]
// SWITCH OFF THE SCREENSAVER AND THE MONITOR POWER SAVER IF THEY TRY TO CUT IN
procedure TForm1.WMSysCommand(var Msg : TWMSysCommand);
begin
//catch the message and turn it off
if (Msg.CmdType = SC_MONITORPOWER) or (Msg.CmdType = SC_SCREENSAVE) then
begin
Msg.Result := -1;
end
else
inherited;///Otherwise do whatever is supposed to be done
end;
[/pascal]

方法2:

type
EXECUTION_STATE = DWORD;
const
ES_SYSTEM_REQUIRED = DWORD($00000001);
ES_DISPLAY_REQUIRED = DWORD($00000002);
ES_USER_PRESENT = DWORD($00000004);
ES_CONTINUOUS = DWORD($80000000);
function SetThreadExecutionState(esFlags: EXECUTION_STATE): EXECUTION_STATE; stdcall; external kernel32;

 

Lazarus中,Windows没有定义SetThreadExecutionState,需自己定义,然后

SetThreadExecutionState(ES_DISPLAY_REQUIRED or ES_CONTINUOUS); // this will fix current state and disable screensaver

lazarus 出现Error: Undefined symbol:错误

一个Lazarus的项目,在重新安装了新版本的Lazarus 后,编译都通过了,但是链接是出现

Error: Undefined symbol: FPJSON_TJSONOBJECT_$__GETFLOATS$ANSISTRING$$DOUBLE

搜索到Lazarus的论坛http://lazarus.firmos.at/index.php?topic=7683.0

提到可能是ide或者是fpc的问题,考虑到之前有修改过fpjson的源码,怀疑是这个问题,于是重新编译了fpc

重新编译,问题依旧。

查看工程选项,修改resource类型为fpc resource,原来是lrs的

image

重新编译,一切顺利。

并且,原来编译新版的geckport,老是出错,这次编译,一次成功,gecko组件在设计时添加了背景图

image

呵呵,挺不错的吧。

lazarus 中安装第三方控件

Lazarus是类似于Delphi的freepascal开发环境,近年来,也算是进步神速了。

Lazarus的第三方控件安装,相较于Delphi,还是有许多的不足,就在于第三方控件必须静态链接到Lazarus的ide本身。

以indy为例,说说如何安装控件包

本例中的indy为pl_indy ,是来自于codetyphon项目,整合了许多优秀控件的Lazarus发布版。

1.把pl_indy源码解压到Lazarus的components目录下

目录结构:

image

pl_indy目录

image

source

继续阅读

Lazarus 中TrayIcon的图标运用(Windows)[转]

1、用文本工具建立RC文件放在工程目录下,如tray_test.rc,内容如下:

101    ICON    "Aire_095.ico"
102    ICON    "Aire_063.ico"

用lazarus的lazarusppbini386-win32中的Windres生成RES文件:

windres -i tray_test.rc -o tray_test.res

2、从组件栏的Additional中选择TTrayIcon,放在Form上,并修改主Main的Form的代码:

在Interface区添加:

{$ifdef win32}
  {$R tray_test.res}
{$endif}

在Uses区添加:

//contains LOADICON(针对Windows平台)

Jwawinuser

3、在运用TrayIcon的按钮中添加实效代码:

procedure Form1.Button1Click(Sender: TObject);
const
  IDI_ICON1=101;
begin
{$ifdef win32}
  SystrayIcon.Icon.Handle := LoadIcon(hInstance,MAKEINTRESOURCE(IDI_ICON1));
{$else}
  SystrayIcon.Icon.LoadFromFile(‘/path_to_icon/icon.ico’);
{$endif}

  SystrayIcon.ShowHint := True;
  SystrayIcon.Hint := ‘my tool tip’;
  SystrayIcon.PopUpMenu := MyPopUpMenu;
  SystrayIcon.Show;
end;

[From]半步: 电脑工程

lazarus 删除控件后程序的奇怪问题

最近在使用Lazarus时,发现这么一些奇怪的问题:

1.删除了timer控件和相应的ontimer事件,运行时,总会提示“error reading timerXXX.ontimer ‘invalid value for property”,然后就只能选择退出了。只好再加上相应的ontimer事件。

2.在一个panel上动态添加控件,可是总会出现一个莫名其妙的控件,和之前添加中panel上的一个控件很相似。

 

最终,才发现是在窗体进行删除修改时,Lazarus的相应资源文件并没有进行相应的更新,导致链接了旧的控件等资源。

 

解决办法:

删除窗体文件的相应lrs文件,即,如果窗体叫unit1.pas,则删除unit1.lrs。