Re: [Lazarus] Cannot compile EpikTimer

2014-09-02 Thread Graeme Geldenhuys



On Tuesday 02/09/2014 at 15:30, Mattias Gaertner  wrote:


clock_gettime is defined in unit Linux.


It seems FPC it out of date then. Because clock_gettime is a POSIX.1 
standard, and FreeBSD has support for it.


 http://www.freebsd.org/cgi/man.cgi?query=clock_gettime

I'll file a bug report on Mantis if one doesn't already exist.




Regards,
 - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TAChart with transparent background

2014-09-02 Thread Werner Pamler
It is not fully clear to me what you mean by "a chart with transparent 
background". Do you want to see the form underneath the chart? I fear 
this is not easily possible. Or do you want to have a background image 
in the chart? For the latter case this code is working fine with me:


type
  TForm1 = class(TForm)
Chart1: TChart;
procedure Chart1BeforeDrawBackground(ASender: TChart; ACanvas: TCanvas;
  const ARect: TRect; var ADoDefaultDrawing: Boolean);
procedure Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;
  const ARect: TRect; var ADoDefaultDrawing: Boolean);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
  private
{ private declarations }
FBackImage: TPicture;
  public
{ public declarations }
  end;

procedure TForm1.Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;
  const ARect: TRect; var ADoDefaultDrawing: Boolean);
begin
  ADoDefaultDrawing := false;
  ACanvas.StretchDraw(ARect, FBackImage.Graphic);
end;

procedure TForm1.Chart1BeforeDrawBackground(ASender: TChart; ACanvas: 
TCanvas;

  const ARect: TRect; var ADoDefaultDrawing: Boolean);
begin
  ACanvas.GradientFill(ARect, clSkyBlue, clWhite, gdVertical);
  ADoDefaultDrawing := false;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  FBackImage := TPicture.Create;
  FBackImage.LoadFromFile('C:\lazarus-svn\images\splash_logo.png');
  // please adapt this path to your lazarus installation
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FBackImage.Free;
end;

The basic idea is to assign a handler to the chart events 
OnBeforeDrawBackWall or OnBeforeDrawBackground and disable the default 
background painting by setting ADoDefaultDrawing to false. The first 
event replaces painting of the area enclosed by the chart's frame ("Back 
wall"), the other one replaces painting of the entire chart background. 
Above example paints the Lazarus splash-logo as BackWall and a gradient 
as background.


Maybe I'll once write a tutorial on this topic...


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to crosscompile from linux to wince?

2014-09-02 Thread Sven Barth
Am 02.09.2014 14:25 schrieb "FreeMan" :
>
> When I try run my Application in Win CE, I get this error:
>
> "Cannot find project1 (or one of its components); make sure the path and
filename are correct and filename are correct and that all required
libraries are available."
> What I have todo or intall on wince?
> And has anyone wince demo(s) for lazarus?

Are you trying on Windows Mobile or pure Windows CE? For the latter you
AFAIK need an additional library. Take a look at the WinCE related entries
on the Lazarus wiki as I currently can't remember which one...

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to crosscompile from linux to wince?

2014-09-02 Thread FreeMan


On 02-09-2014 17:05, Paul Breneman wrote:


It isn't for Lazarus but there is a 3 MB zip with a mini-distribution 
of Free Pascal for WinCE near the bottom of this page:

http://turbocontrol.com/easyfpgui.htm

Might be a useful troubleshooting tool if nothing else...


Thank you very much, I my test project work on wince now.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cannot compile EpikTimer

2014-09-02 Thread Xiangrong Fang
Thanks, this worked.  I added unit Linux in here:

{$IFDEF Windows}
  Windows, MMSystem,
{$ELSE}
  unix, unixutil, baseunix, *Linux*,
{$ENDIF}

Should this be considered a minor bug in epiktimer's platform dependant
code?

Xiangrong


2014-09-02 22:28 GMT+08:00 Mattias Gaertner :

> On Tue, 2 Sep 2014 22:18:38 +0800
> Xiangrong Fang  wrote:
>
> > Hi All,
> >
> > While trying to install epiktimer following this wiki page:
> >
> > http://wiki.lazarus.freepascal.org/EpikTimer
> >
> > I got this error:
> >
> > /home/xrfang/git/epiktimer/epiktimer.pas(403,29) Error: Identifier not
> > found "clock_gettime"
>
> clock_gettime is defined in unit Linux.
>
> > I am running Lazarus 1.2.4/FPC2.6.2 on Ubuntu 14.10 64bit.
>
> Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cannot compile EpikTimer

2014-09-02 Thread Mattias Gaertner
On Tue, 2 Sep 2014 22:18:38 +0800
Xiangrong Fang  wrote:

> Hi All,
> 
> While trying to install epiktimer following this wiki page:
> 
> http://wiki.lazarus.freepascal.org/EpikTimer
> 
> I got this error:
> 
> /home/xrfang/git/epiktimer/epiktimer.pas(403,29) Error: Identifier not
> found "clock_gettime"

clock_gettime is defined in unit Linux.

> I am running Lazarus 1.2.4/FPC2.6.2 on Ubuntu 14.10 64bit.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Cannot compile EpikTimer

2014-09-02 Thread Xiangrong Fang
Hi All,

While trying to install epiktimer following this wiki page:

http://wiki.lazarus.freepascal.org/EpikTimer

I got this error:

/home/xrfang/git/epiktimer/epiktimer.pas(403,29) Error: Identifier not
found "clock_gettime"

I am running Lazarus 1.2.4/FPC2.6.2 on Ubuntu 14.10 64bit.

Any ideas?

Thanks a lot.

Xiangrong
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TAChart with transparent background

2014-09-02 Thread Roberto P.
Dear List,

is it possible to have a chart with transparent background, so that a
picture behind the plot is visible?

>From the wiki I understand that TAChart does not support BackImage property
as in Delphi, which would fit the purpouse.
However I read thay using BGRAbitmap as a back-end it is possible to use
transparency. I managed to install the required packages and activate the
back-end, but I did not understand from the tutorial (
http://wiki.freepascal.org/BGRABitmap_tutorial_TAChart) how to go on.

Does anyone has an example?

Thanks a lot,

  R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to crosscompile from linux to wince?

2014-09-02 Thread Paul Breneman

On 09/02/2014 08:24 AM, FreeMan wrote:

When I try run my Application in Win CE, I get this error:

"Cannot find project1 (or one of its components); make sure the path and
filename are correct and filename are correct and that all required
libraries are available."
What I have todo or intall on wince?
And has anyone wince demo(s) for lazarus?

Thank you.



It isn't for Lazarus but there is a 3 MB zip with a mini-distribution of 
Free Pascal for WinCE near the bottom of this page:

http://turbocontrol.com/easyfpgui.htm

Might be a useful troubleshooting tool if nothing else...


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Enabling menu-options depending on a Lazarus-setting?

2014-09-02 Thread Martin Frb

On 02/09/2014 12:11, Joost van der Sluis wrote:

Hi all,

On Linux there's the option to view a window with the console-output 
of applications being debugged.


This option is enabled with the define DBG_ENABLE_TERMINAL in three 
units.


In debugger/debugger.pp the define is set for linux only, with the 
result that the window is actually visible in the menu.


In components/lazdebuggergdbmi/gdbmimiscclasses.pp and 
components/lazdebuggergdbmi/gdbmimiscclasses.pp the define is also set 
on linux, so that this debugger actually sends the console output to 
the screen.


Now I have my own debugger, and this debugger also supports the 
console-window on OS/X. So I could adapt the define in debugger.pp for 
OS/X, but then the menu-item also appears when a gdb-based debugger is 
used, which do not support this option on OS/X.


So, question: what would be the correct way to display this 
menu-option, based onto the selected debugger. (Add a property to 
TDebuggerIntf, but after that?)




Add a class[1] method to the debugger-class. return true/false, 
depending on the availability of the feature.


The base class, would have the current ifdef. All other code depends on 
the value of the method.



In ide/DebugManager the debugger class is selected and setup. That would 
be the place to update the menu (maybe enable/disable instead of hiding).


[1] If it is a class method debug manager may be able to decide on the 
class. If the code in debug manager allows to wait for the instance, 
then it can be a normal method.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to crosscompile from linux to wince?

2014-09-02 Thread FreeMan

When I try run my Application in Win CE, I get this error:

"Cannot find project1 (or one of its components); make sure the path and 
filename are correct and filename are correct and that all required 
libraries are available."

What I have todo or intall on wince?
And has anyone wince demo(s) for lazarus?

Thank you.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Why lazchmhelp.pas sets InheritHandle conditionally on fpc version?

2014-09-02 Thread Luca Olivetti
El 02/09/14 11:19, Mattias Gaertner ha escrit:
> On Tue, 02 Sep 2014 09:54:50 +0200
> Luca Olivetti  wrote:
> 
>> I saw in the 1.2.4 source this:
>>
>> {$if FPC_FULLVERSION<20604}
>> Proc.InheritHandles := false;
>> {$endif}
>>
>>
>> Why is it conditional?
> 
> It is not conditional in 1.3.

[...]

> 1.3 has the above code.

I should have checked trunk.

Thank you
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Enabling menu-options depending on a Lazarus-setting?

2014-09-02 Thread Joost van der Sluis

Hi all,

On Linux there's the option to view a window with the console-output of 
applications being debugged.


This option is enabled with the define DBG_ENABLE_TERMINAL in three units.

In debugger/debugger.pp the define is set for linux only, with the 
result that the window is actually visible in the menu.


In components/lazdebuggergdbmi/gdbmimiscclasses.pp and 
components/lazdebuggergdbmi/gdbmimiscclasses.pp the define is also set 
on linux, so that this debugger actually sends the console output to the 
screen.


Now I have my own debugger, and this debugger also supports the 
console-window on OS/X. So I could adapt the define in debugger.pp for 
OS/X, but then the menu-item also appears when a gdb-based debugger is 
used, which do not support this option on OS/X.


So, question: what would be the correct way to display this menu-option, 
based onto the selected debugger. (Add a property to TDebuggerIntf, but 
after that?)


regards,

Joost.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Why lazchmhelp.pas sets InheritHandle conditionally on fpc version?

2014-09-02 Thread Mattias Gaertner
On Tue, 02 Sep 2014 09:54:50 +0200
Luca Olivetti  wrote:

> I saw in the 1.2.4 source this:
> 
> {$if FPC_FULLVERSION<20604}
> Proc.InheritHandles := false;
> {$endif}
> 
> 
> Why is it conditional?

It is not conditional in 1.3.

> Maybe I'm biased by my bad experience with it being true by default, but
> I think it should be always set to false (apart from the fact that it
> didn't work in fpc, and it has been fixed exactly in 2.6.4, making the
> above completely useless).
> 
> BTW, in my local copy I also modify lazhelphtml.pas
> 
> 
> --- lcl/lazhelphtml.pas (revisiĆ³n: 45586)
> +++ lcl/lazhelphtml.pas (copia de trabajo)
> @@ -367,6 +367,7 @@
>try
>  BrowserProcess:=TProcessUTF8.Create(nil);
>  try
> +  BrowserProcess.InheritHandles:=false;
>BrowserProcess.CommandLine:=CommandLine;
>BrowserProcess.Execute;
>  finally

1.3 has the above code.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Why lazchmhelp.pas sets InheritHandle conditionally on fpc version?

2014-09-02 Thread Luca Olivetti
I saw in the 1.2.4 source this:

{$if FPC_FULLVERSION<20604}
Proc.InheritHandles := false;
{$endif}


Why is it conditional?
Maybe I'm biased by my bad experience with it being true by default, but
I think it should be always set to false (apart from the fact that it
didn't work in fpc, and it has been fixed exactly in 2.6.4, making the
above completely useless).

BTW, in my local copy I also modify lazhelphtml.pas


--- lcl/lazhelphtml.pas (revisiĆ³n: 45586)
+++ lcl/lazhelphtml.pas (copia de trabajo)
@@ -367,6 +367,7 @@
   try
 BrowserProcess:=TProcessUTF8.Create(nil);
 try
+  BrowserProcess.InheritHandles:=false;
   BrowserProcess.CommandLine:=CommandLine;
   BrowserProcess.Execute;
 finally

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus