Re: [Lazarus] Run Parameters Dialog

2016-09-26 Thread Juha Manninen via Lazarus
On Tue, Sep 27, 2016 at 8:07 AM, Lars via Lazarus
 wrote:
> The designer of Lazarus didn't necessarily need this feature...

Mattias is the designer of Lazarus. :)

Juha
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Run Parameters Dialog

2016-09-26 Thread Lars via Lazarus
On Fri, September 23, 2016 12:19 am, Mattias Gaertner wrote:
> On Thu, 22 Sep 2016 18:46:49 -0600
> "Lars"  wrote:
>
>
>> Hi in the Run Parameters dialog, it appears as though $macros such as
>> $TargetFile() or the current project directory, etc., don't get
>> expanded
>
> Please create a bug report.
>
>

Not sure if it was intended as design.

The designer of Lazarus didn't necessarily need this feature...

I will create one but it could be as designed
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Launching External Tool Cmd.exe in Windows

2016-09-26 Thread Lars via Lazarus
On Sat, September 24, 2016 11:06 pm, Cyrax via Lazarus wrote:
>> Any idea what workarounds people used before? Surely someone used
>> cmd.exe before as an external tool in an older version.  I tend to not
>> use the latest version from source control. But I can, if I have to!
>>
>
> In Tools->Configure External tools...->Add dialog, input these:
>
>
> Title : Command Prompt
> Program Filename : $Env(COMSPEC)
> Parameters : '/c "start "Command Prompt" "%COMSPEC%""'
>
>

Genius! Any idea how to launch a console app using this trick?


i.e. I develop a console app in lazarus (the $TargetFile()) and want to
launch it but leave it open. Cmd /k was what I thought.

 other option would be to make a ms dos batch file, that launches a
command window, and run it. Or like the other poster said, create a
launcher program
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Kostas Michalopoulos via Lazarus
Yes, overloaded versions that take both TColor and TFPColor (with the
former calling the latter with conversion function) should be the best
approach both to preserve backwards compatibility (for existing code) and
consistency (for any new function).

On Mon, Sep 26, 2016 at 6:41 PM, Graeme Geldenhuys via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> On 2016-09-26 16:15, Kostas Michalopoulos via Lazarus wrote:
> > Is there a need for alpha *everywhere* a color is used?
>
> So how would functions that take TColor parameters work? For example,
> drawing a gradient with increasing Alpha value, say via a
> TCanvas.GradientFill() call. In the case of GradientFill() it has a
> Start/Stop TColor parameter. Also other functions like
> DrawGradientWindow() etc. So for each such cases, new overloaded
> versions will be implemented, replacing TColor with TFPColor?
>
> Regards,
>   Graeme
>
> --
> fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
> http://fpgui.sourceforge.net/
>
> My public PGP key:  http://tinyurl.com/graeme-pgp
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus-ide.org
> http://lists.lazarus-ide.org/listinfo/lazarus
>
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Breaking change in fcl-pdf

2016-09-26 Thread Michael Van Canneyt via Lazarus


Hi,

A small warning:

There is a small breaking change in the fcl-pdf package:
the color parameter in the AddFont() call has been removed.
It was ignored anyway and didn't play any useful role.
If your code no longer compiles, just remove the color parameter.

An option not to embed fonts was also introduced.
The next change will be partial embedding of fonts: 
to embed only actually used characters.


Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
> I personally prefer to use private as default. I will add the option.

Me too, at least an option for an useful shortcut.
Happy to hear that.

Regards,
Ara


-- 
http://www.fastmail.com - Same, same, but different...

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


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 20:24, Mattias Gaertner via Lazarus wrote:

I personally prefer to use private as default.
I will add the option.


Good. I add most methods to the private section as well. It looks like 
more people do: http://mantis.freepascal.org/view.php?id=13994 :)


Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Mattias Gaertner via Lazarus
On Mon, 26 Sep 2016 11:06:15 -0700
Aradeonas via Lazarus  wrote:

> Thanks Ondrej for your works.
> 
> You talk about various IDE options but as I searched I cant find any
> options to make this message off and also from my view it makes no sense
> forcing anybody to a shortcut do just one thing and make all the stuff
> in Public.
> But as you are the maintainer and no one attracted in this topic for
> know, its your decision and yours is no so it is as is but Im grateful
> for your works as always.

I personally prefer to use private as default.
I will add the option.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
Thanks Ondrej for your works.

You talk about various IDE options but as I searched I cant find any
options to make this message off and also from my view it makes no sense
forcing anybody to a shortcut do just one thing and make all the stuff
in Public.
But as you are the maintainer and no one attracted in this topic for
know, its your decision and yours is no so it is as is but Im grateful
for your works as always.

Regards,
Ara


-- 
http://www.fastmail.com - Choose from over 50 domains or use your own

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


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 19:10, Aradeonas via Lazarus wrote:

I dont know who changed it but here is a screen shot from 1.6


I implemented the option in 1.5 trunk and I extended it in 1.7. During 
this extension I decided to delete the option because now there are much 
more options and it doesn't make sense for me to have duplicate 
functionality (+C with IDE various IDE options and +X with dialog). I 
decided to keep it simple.


But if you get support from other devs and/or users, you can revert the 
option part of the 1.7 change and bring it back. In that case send a 
patch through mantis. But please first try to get the green light.


Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
I dont know who changed it but here is a screen shot from 1.6

 

Regards,
Ara


-- 
http://www.fastmail.com - Does exactly what it says on the tin

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


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 18:45, Mattias Gaertner via Lazarus wrote:

On Mon, 26 Sep 2016 16:26:06 +0200
Ondrej Pokorny via Lazarus  wrote:


On 26.09.2016 16:01, Aradeonas via Lazarus wrote:

Hi,

In Lazarus 1.6 when I used code creation for procedures and events
they will be made in private part of class and I had an option in
Codetool named "Insert new event methods to section" but now in
Lazarus trunk I cant find that and methods will made in public part.

What is wrong?

http://wiki.freepascal.org/index.php?title=Lazarus_1.8.0_release_notes

Where does it mention the change from default section to public section?


Obviously nowhere. At least I cannot find that information there.

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Mattias Gaertner via Lazarus
On Mon, 26 Sep 2016 16:26:06 +0200
Ondrej Pokorny via Lazarus  wrote:

> On 26.09.2016 16:01, Aradeonas via Lazarus wrote:
> > Hi,
> >
> > In Lazarus 1.6 when I used code creation for procedures and events 
> > they will be made in private part of class and I had an option in 
> > Codetool named "Insert new event methods to section" but now in 
> > Lazarus trunk I cant find that and methods will made in public part.
> >
> > What is wrong?  
> 
> http://wiki.freepascal.org/index.php?title=Lazarus_1.8.0_release_notes

Where does it mention the change from default section to public section?

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TImage shows loaded image rotated by 90?

2016-09-26 Thread Thierry Andriamirado via Lazarus


Le 26 septembre 2016 15:07:06 UTC+03:00, LacaK via Lazarus 
 a écrit :
>I have created small Exif reader for my own needs.
>I have looked also in FCL TFPReaderJpeg (which uses pasjpeg) if there
>is 
>no support, but I do not see.
>If there would be interest for extending functionality of this reader
>to 
>support reading of Exif information I can prepare patch.
>
>Here is my simple implementation if somebody is interested:
>

This is great! Please do, if you have time.
Anyway, thanks for this code.

Thierry

-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
Yes, and it isnt tiny and also programmers like me are lazy and a click
or a enter more very time is a pain.
I didnt want option for every detail just font like messages ;) Also we
had it before :D

Regards,
Ara


-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow

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


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Graeme Geldenhuys via Lazarus
On 2016-09-26 16:15, Kostas Michalopoulos via Lazarus wrote:
> Is there a need for alpha *everywhere* a color is used?

So how would functions that take TColor parameters work? For example,
drawing a gradient with increasing Alpha value, say via a
TCanvas.GradientFill() call. In the case of GradientFill() it has a
Start/Stop TColor parameter. Also other functions like
DrawGradientWindow() etc. So for each such cases, new overloaded
versions will be implemented, replacing TColor with TFPColor?

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 17:01, Aradeonas via Lazarus wrote:
Cause we had an option before, can we have it back for Ctrl+C ? just 
like 1.6 and no hard coded option so anyone can choose what he like?


Well I don't know if we should make an option for every tiny feature 
that can be easily compensated with another existing feature. What is so 
painful on Ctrl+Shift+X and Enter? Do you create so many methods in one 
particular section?


Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Kostas Michalopoulos via Lazarus
Is there a need for alpha *everywhere* a color is used? From my experience,
i've only really needed alpha for TCanvas (so i can draw, e.g. translucent
rectangles). I don't think there is a need to add more baggage in controls
by introducing yet another mostly redundant FPColor property. Controls that
need color with alpha could just provide a ColorAlpha property (for Color
property - if a Color property is named Foreground or SecondaryColor then
the alpha would be ForegroundAlpha or SecondaryColorAlpha).

If one doesn't care about compatibility with Delphi, a Color: TFPColor
property could be used and Lazarus be made (if it doesn't already) to
handle TFPColor similarly to TColor but with a custom dialog that can edit
the alpha.

For TCanvas, a TFPColor behind the scenes that is mapped to both TFPColor
and TColor properties on access should be enough. Yes, it is redundant, but
since most Canvas use is done via code (instead of a visual property
editor), i'd say that being able to access RGBA as a single value instead
of a value pair is cleaner.


On Mon, Sep 26, 2016 at 4:52 PM, Martin Schreiber via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> On Monday 26 September 2016 15:01:04 Graeme Geldenhuys via Lazarus wrote:
> > On 2016-09-26 13:52, Martin Schreiber via Lazarus wrote:
> > > Or:
> > > "
> > >  Alpha := ...; // property Alpha: TColor
> > > "
> > > for alpha per colour channel.
> >
> > In that case I would make it a record type with RedAlpha, GreenAlpha and
> > BlueAlpha: Byte. Why?, Because TColor's range is way to large, with most
> > of the acceptable values being meaningless.
> >
> Using TColor has the advantage that the same mechanism of RGB-lookup
> of "logical" colours as with normal TColor values can be used. TColor with
> the MSB = 0 is a special case where the lower bytes contain the RGB values.
> Simple and efficient.
> In MSEgui the MSB defines the kind of the logical color value, "functional"
> (cl_invalid,cl_default..), "mapped" (cl_dkshadow,cl_shadow...), "named RGB"
> (cl_black, cl_dkgray...) and "user".
>
> Martin
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus-ide.org
> http://lists.lazarus-ide.org/listinfo/lazarus
>
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
Cause we had an option before, can we have it back for Ctrl+C ? just
like 1.6 and no hard coded option so anyone can choose what he like?

Regards,
Ara


-- 
http://www.fastmail.com - mmm... Fastmail...

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


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 16:45, Aradeonas via Lazarus wrote:
> I want my old behavior back, its a pain to see a dialog every time.

Well not a pain for me. But you can raise a discussion about the default 
section for methods for +C. I always use +X for methods; the same if I 
want to declare an object variable. Maybe it can be changed to private.


> it at least can use last chosen value with +X dialog.

This is a no-go for me.

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
Oh no :(

I want my old behavior back, its a pain to see a dialog every time. it
at least can use last chosen value with +X dialog.

Regards,
Ara


-- 
http://www.fastmail.com - Or how I learned to stop worrying and
  love email again

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


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 16:34, Aradeonas via Lazarus wrote:
Thanks Ondrej but Ctrl+Shift+X will show the message and I set it on 
private but problem is how can I set Ctrl+Shift+c default?


You cannot. +C is always without dialog (predefined hard-coded 
settings), whereas +X is always with dialog.


Also If I want to it adds method after class name not in private 
section, what should I do?


This section is "published".

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
Thanks Ondrej but Ctrl+Shift+X will show the message and I set it on
private but problem is how can I set Ctrl+Shift+c default?
Also If I want to it adds method after class name not in private
section, what should I do?

Regards,
Ara


-- 
http://www.fastmail.com - Access your email from home and the web

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


Re: [Lazarus] New methods code creation

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 16:01, Aradeonas via Lazarus wrote:

Hi,

In Lazarus 1.6 when I used code creation for procedures and events 
they will be made in private part of class and I had an option in 
Codetool named "Insert new event methods to section" but now in 
Lazarus trunk I cant find that and methods will made in public part.


What is wrong?


http://wiki.freepascal.org/index.php?title=Lazarus_1.8.0_release_notes

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] New methods code creation

2016-09-26 Thread Aradeonas via Lazarus
Hi,

In Lazarus 1.6 when I used code creation for procedures and events they
will be made in private part of class and I had an option in Codetool
named "Insert new event methods to section" but now in Lazarus trunk I
cant find that and methods will made in public part.

What is wrong?

Regards,
Ara

-- 
http://www.fastmail.com - Send your email first class

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


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Martin Schreiber via Lazarus
On Monday 26 September 2016 15:01:04 Graeme Geldenhuys via Lazarus wrote:
> On 2016-09-26 13:52, Martin Schreiber via Lazarus wrote:
> > Or:
> > "
> >  Alpha := ...; // property Alpha: TColor
> > "
> > for alpha per colour channel.
>
> In that case I would make it a record type with RedAlpha, GreenAlpha and
> BlueAlpha: Byte. Why?, Because TColor's range is way to large, with most
> of the acceptable values being meaningless.
>
Using TColor has the advantage that the same mechanism of RGB-lookup 
of "logical" colours as with normal TColor values can be used. TColor with 
the MSB = 0 is a special case where the lower bytes contain the RGB values. 
Simple and efficient.
In MSEgui the MSB defines the kind of the logical color value, "functional" 
(cl_invalid,cl_default..), "mapped" (cl_dkshadow,cl_shadow...), "named RGB" 
(cl_black, cl_dkgray...) and "user".

Martin
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] warning on compile

2016-09-26 Thread Thierry Andriamirado via Lazarus


Le 24 septembre 2016 22:50:14 UTC+03:00, Chris Kelling via Lazarus 
 a écrit :
>On a new project, and I keep getting this warning: tubes.lpr(20,1) 
>Warning: "crtbeginS.o" not found, this will probably cause a linking 
>failure
>
>Linking doesn't; actually fail, and the compile completes.  Any clue 
>what library and were it needs to go to clear this warning?

Are you cross-compiling to i386 ?
Find crtbeginS.o on your system and add its directory in fpc.cfg.
AFAIR, there's at least 2 of them, within 2 subtories (./32 and ./x32): one of 
them is the good one. Just try them one by one.
(Sorry if I can't give precise advices: I'm on a tablet)

Good luck. Thierry


-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Graeme Geldenhuys via Lazarus
On 2016-09-26 13:52, Martin Schreiber via Lazarus wrote:
> Or:
> "
>  Alpha := ...; // property Alpha: TColor
> "
> for alpha per colour channel.

In that case I would make it a record type with RedAlpha, GreenAlpha and
BlueAlpha: Byte. Why?, Because TColor's range is way to large, with most
of the acceptable values being meaningless.

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Graeme Geldenhuys via Lazarus
On 2016-09-26 13:50, Ondrej Pokorny via Lazarus wrote:
> Aah, I see now what you mean. Then ColorAlpha :)

An then you start getting the contradicting properties.

For example:

  Label1.Color := clRed;
  Label1.ColorAlpha := 170;
  Label1.Transparent := True;

or, what to do if Label1.Transparent = False?

Or does in now mean the TLabel.Transparent property is going to be
deprecated because ColorAlpha will replace its job. Oh, but then we have
the Delphi-compatibility issues to deal with too. :-(


Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 14:41, Mattias Gaertner via Lazarus wrote:

On Mon, 26 Sep 2016 14:25:14 +0200
Ondrej Pokorny via Lazarus  wrote:


[...]
In this case maybe this property pair would be more appropriate (?):

Color := ...;
Alpha := ...; // property Alpha: Byte

A property "Alpha" sounds like setting the alpha of the whole control.


Aah, I see now what you mean. Then ColorAlpha :)

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TImage shows loaded image rotated by 90?

2016-09-26 Thread LacaK via Lazarus





I have created small Exif reader for my own needs.
I have looked also in FCL TFPReaderJpeg (which uses pasjpeg) if there 
is no support, but I do not see.
If there would be interest for extending functionality of this reader 
to support reading of Exif information I can prepare patch.


There is interest :)


Hm, looking deeper into TFPCustomImageReader architecture intention of 
such readers is constitute TFPCustomImage.
Now I am not sure where metadata (Exif) should go ? (As far as 
TFPCustomImage holds only true image data)


I can extend TFPReaderJpeg, by adding boolean option ("ReadExif") either 
to constructor or as a standalone property, which will signal to reader 
if read also this kind of data.
If set to true then in "InternalRead" I can read from supplied stream 
and store them in record inside TFPReaderJpeg ... so user must ask 
reader later to obtain exif data


Or do not touch TReaderJpeg and add only new "helper" class which will 
read from supplied stream exif data (just as in source which I have 
attached to my prior mail)


What do you prefer ?

-Laco.

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


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Martin Schreiber via Lazarus
On Monday 26 September 2016 14:25:14 Ondrej Pokorny via Lazarus wrote:
>
> In this case maybe this property pair would be more appropriate (?):
>
> Color := ...;
> Alpha := ...; // property Alpha: Byte
>
Or:
"
 Alpha := ...; // property Alpha: TColor
"
for alpha per colour channel. MSEgui works this way with pixmap opacity. In 
case of pixmaps with simple alpha channel the 8 bit alpha value is (R+G+B) 
div 3.
In MSEgui mask- and color-data of TMaskedBitmap are separate pixmaps with own 
canvas. 

Martin
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Mattias Gaertner via Lazarus
On Mon, 26 Sep 2016 14:25:14 +0200
Ondrej Pokorny via Lazarus  wrote:

>[...]
> In this case maybe this property pair would be more appropriate (?):
> 
> Color := ...;
> Alpha := ...; // property Alpha: Byte

A property "Alpha" sounds like setting the alpha of the whole control.

Also FPColor contains 16bit channels.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 14:15, Mattias Gaertner via Lazarus wrote:

On Mon, 26 Sep 2016 13:09:30 +0100
Graeme Geldenhuys via Lazarus  wrote:


[...]

The idea is to use the FPColor property for alpha, but that is not
implemented yet by the LCL interfaces. Hmm, I wonder how hard it would
be...

Does that also mean every widget in LCL will have a Color and FPColor
property?

   eg:
 Label1.Color := ;
 Label1.FPColor := ;

That would be very messy!

First of all setting Pen.FPColor sets Pen.Color and vice versus, so
you only set one.
And second I doubt that alpha is useful for all native widgets.


In this case maybe this property pair would be more appropriate (?):

Color := ...;
Alpha := ...; // property Alpha: Byte

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Mattias Gaertner via Lazarus
On Mon, 26 Sep 2016 13:09:30 +0100
Graeme Geldenhuys via Lazarus  wrote:

>[...]
> > The idea is to use the FPColor property for alpha, but that is not
> > implemented yet by the LCL interfaces. Hmm, I wonder how hard it would
> > be...  
> 
> Does that also mean every widget in LCL will have a Color and FPColor
> property?
> 
>   eg:
> Label1.Color := ;
> Label1.FPColor := ;
> 
> That would be very messy!

First of all setting Pen.FPColor sets Pen.Color and vice versus, so
you only set one.
And second I doubt that alpha is useful for all native widgets.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Graeme Geldenhuys via Lazarus
On 2016-09-26 12:33, Mattias Gaertner via Lazarus wrote:
>>  Does TColor support the Alpha channel,
> 
> No.

Wow, that's surprising.


> The idea is to use the FPColor property for alpha, but that is not
> implemented yet by the LCL interfaces. Hmm, I wonder how hard it would
> be...

Does that also mean every widget in LCL will have a Color and FPColor
property?

  eg:
Label1.Color := ;
Label1.FPColor := ;

That would be very messy!


> Usually I use the RGBToColor function, so I only see RGB.

Ah, thanks for that tip.



Regards,
  Graeme

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


Re: [Lazarus] TImage shows loaded image rotated by 90?

2016-09-26 Thread Michael Van Canneyt via Lazarus



On Mon, 26 Sep 2016, LacaK via Lazarus wrote:


I have created small Exif reader for my own needs.
I have looked also in FCL TFPReaderJpeg (which uses pasjpeg) if there is 
no support, but I do not see.
If there would be interest for extending functionality of this reader to 
support reading of Exif information I can prepare patch.


There is interest :)

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TImage shows loaded image rotated by 90?

2016-09-26 Thread LacaK via Lazarus

I have created small Exif reader for my own needs.
I have looked also in FCL TFPReaderJpeg (which uses pasjpeg) if there is 
no support, but I do not see.
If there would be interest for extending functionality of this reader to 
support reading of Exif information I can prepare patch.


Here is my simple implementation if somebody is interested:


  { TJpegExifReader }

  TJpegExifReader = class
private
  type
TIFDEntry = record
  TagNo: Word;
  DataType: Word;
  Count: DWord;
  Value: DWord; // This  tag  records  the  offset  from the  
start  of  the  TIFF  header  to  the  position  where  the value  
itself  is  recorded.
// In cases where the value fits in 4 bytes, 
the value itself is recorded. If the value is smaller than 4 bytes, the 
value is stored in the 4-byte area starting from the left, i.e., from 
the lower end

end;

TExifData = record
  Make,
  Model,
  Software,
  DateTime: string;
  Orientation: smallint;
  XResolution,
  YResolution: double;
  ResolutionUnit: smallint;
end;

  var
FBA: Word;

  function Swap(w: Word): Word; overload;
protected
  FIFD: array of TIFDEntry;
  FExif: TExifData;
public
  constructor Create(const FileName: string); overload;
  constructor Create(Stream: TFileStream); overload;

  function Orientation: smallint;
  function XResolution: double;
  function YResolution: double;
  function ResolutionUnit: string;
  function DateTime: TDateTime;
  end;

{ TJpegExifReader }

function TJpegExifReader.Swap(w: Word): Word;
begin
  if FBA = $4D4D then
// Motorola align: first byte in data is highest byte (big endian)
Result := BEtoN(w)
  else
// Intel align: first byte in data is lowest byte (little endian)
Result := LEtoN(w);
end;

constructor TJpegExifReader.Create(const FileName: string);
var
  Stream: TFileStream;
begin
  Stream := TFileStream.Create(FileName, fmOpenRead+fmShareDenyWrite);
  try
Create(Stream);
  finally
Stream.Free;
  end;
end;

constructor TJpegExifReader.Create(Stream: TFileStream);
type
  TRATIONAL=record
numerator: dword;
denominator: dword;
  end;
var
  w, Size: word;
  dw: dword;
  n,i,c: integer;
  S: AnsiString;
  R: TRATIONAL;
  D: double;
begin
  inherited Create;

  Stream.Position := 0;
  Stream.Read(w,SizeOf(w));
  if w <> NtoLE($D8FF) then Exit;  // 0-1: Jpeg SOI (Start of 
image: FFD8)

  Stream.Read(w, SizeOf(w));
  if w <> NtoLE($E1FF) then Exit;  // 2-3: APP1 (Application 
marker: FFE1)
  Stream.Read(Size, SizeOf(Size)); // 4-5: Size of APP1 data area 
(high byte first)

  Size := BEtoN(Size);
  Dec(Size, 2);
  // Exif
  Stream.Read(dw, SizeOf(dw));
  if dw <> NtoLE($66697845) then Exit; // 6-9: 'Exif'
  Stream.Read(w, SizeOf(w));
  if w <> NtoLE($) then Exit;  // 10-11: 
  Dec(Size, 6);
  // TIFF header
  Stream.Read(FBA, SizeOf(FBA));   // 12-13: byte order
  if (FBA<>$4949) and (FBA<>$4D4D) then Exit; // 4949=Intel, 4D4D=Motorola
  Stream.Read(w, SizeOf(w));
  if Swap(w) <> $002A then Exit;   // Tag Mark
  Stream.Read(dw, SizeOf(dw)); // Offset to first IFD (usualy 8)
  Dec(Size, 8);

  // IFD: Image file directory
  SetLength(FIFD, 0);
Stream.Read(w, SizeOf(w)); // No of IFD entries
Dec(Size, 2);
n := Swap(w);
SetLength(FIFD, Length(FIFD)+n);
// Read IFD entries
for i:=0 to n-1 do begin
  Stream.Read(FIFD[i], SizeOf(TIFDEntry));
  Dec(Size, SizeOf(TIFDEntry));
end;
Stream.Read(dw, SizeOf(dw));   // Offset to next IFD (0=last)

  // Parse IFD entries
  for i:=0 to n-1 do begin
case Swap(FIFD[i].DataType) of
  1: w:=1; // unsigned byte
  2: w:=1; // ascii string (terminated with 0)
  3: w:=2; // unsigned short (2 bytes)
  4: w:=4; // unsigned long (4 bytes)
  5: w:=8; // unsigned rational (4+4 long)
  else w:=1;
end;
c := w * Swap(FIFD[i].Count);

if c > 4 then begin
  // Value contains offset from TIFF header to data
  Stream.Position := 12 + Swap(FIFD[i].Value);
  case Swap(FIFD[i].DataType) of
2: begin
   Dec(c);
   SetLength(S, c);
   Stream.Read(S[1], c);
   end;
5: begin
   Stream.Read(R, SizeOf(R));
   D := R.numerator / R.denominator;
   end;
  end;
end
else
  case Swap(FIFD[i].DataType) of
3: w := Swap(FIFD[i].Value);
  end;

case Swap(FIFD[i].TagNo) of
  $010F: FExif.Make := S;
  $0110: FExif.Model := S;
  $0112: FExif.Orientation := w;
  $011A: FExif.XResolution := D;
  $011B: FExif.YResolution := D;
  $0128: FExif.ResolutionUnit := w;
  $0131: FExif.Software := S;
  $0132: FExif.DateTime := S;
  $8769: // offset to Exi

Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Ondrej Pokorny via Lazarus

On 26.09.2016 13:33, Mattias Gaertner via Lazarus wrote:

The idea is to use the FPColor property for alpha, but that is not
implemented yet by the LCL interfaces. Hmm, I wonder how hard it would
be...


Speaking from my experince, nearly impossible :(

It doesn't really make sense for me anyway because windows with handles 
(TWinControl descendants) don't support alpha-transparency on Windows.


For me it would be just a source of bugs and incomplete WS-dependent 
implementations.


Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Mattias Gaertner via Lazarus
On Mon, 26 Sep 2016 11:37:48 +0100
Graeme Geldenhuys via Lazarus  wrote:

> Hi,
> 
> All LCL colors seem to be defined in the format TColor($BBGGRR) - all
> without the Alpha channel information.

Correct.


>  Does TColor support the Alpha channel,

No.
The hi byte is used for system colors. Under Delphi also for palette.
The idea is to use the FPColor property for alpha, but that is not
implemented yet by the LCL interfaces. Hmm, I wonder how hard it would
be...


>[...]
> Inconsistency noted:
> 
>   Also there is an inconsistency at least with LCL-GTK2's Color Select
> dialog. If I type the hex color Red in the Color Select Dialog, the
> format must be typed as FF  (RRGGBB), but when I code the color Red
> in Lazarus, it must be typed as FF  (BBGGRR).  I guess because of
> the LCL "native widget set" idea, there is nothing that can be done
> about this.

Usually I use the RGBToColor function, so I only see RGB.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TColor and Alpha channel support

2016-09-26 Thread Vojtěch Čihák via Lazarus

Hi,
 
on one hand,
 
TColor = TGraphicsColor
and
TGraphicsColor = -$7FFF-1..$7FFF;
 
on the other hand, there are defined colors like
 
clNone    = TColor($1FFF);
clDefault = TColor($2000);
 
So I'm also curious if its possible *somehow*.
 
Vojtěch
__

Od: Graeme Geldenhuys via Lazarus 
Komu: Lazarus mailing list 
Datum: 26.09.2016 12:37
Předmět: [Lazarus] TColor and Alpha channel support


Hi,

All LCL colors seem to be defined in the format TColor($BBGGRR) - all
without the Alpha channel information.  Does TColor support the Alpha
channel, and if it does, will it it be applied everywhere or all
supported widgetsets?


Regards,
 Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp 

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


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


[Lazarus] TColor and Alpha channel support

2016-09-26 Thread Graeme Geldenhuys via Lazarus
Hi,

All LCL colors seem to be defined in the format TColor($BBGGRR) - all
without the Alpha channel information.  Does TColor support the Alpha
channel, and if it does, will it it be applied everywhere or all
supported widgetsets?

If TColor does support the Alpha channel, in which format should the
TColor be defined?

   TColor($AABBGGRR)
or
   TColor($BBGGRRAA)


Inconsistency noted:

  Also there is an inconsistency at least with LCL-GTK2's Color Select
dialog. If I type the hex color Red in the Color Select Dialog, the
format must be typed as FF  (RRGGBB), but when I code the color Red
in Lazarus, it must be typed as FF  (BBGGRR).  I guess because of
the LCL "native widget set" idea, there is nothing that can be done
about this.


Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form resize reverted after click on component palette

2016-09-26 Thread Lukas Gradl via Lazarus
Oh - sorry - forgot that vital information. Was before my first coffee  
in the morning...


Zitat von Mattias Gaertner via Lazarus :


When I resize or move a form in the designer and click on a component
in the palette afterwards (to place it on the form) the change is
reverted - the form has the same size and position as before my change.


What platform?
Do you a docked IDE?


Debian Linux x64, Cinnamon, GTK2, Anchordocking
Lazarus SVN-Revision 53015
FPC 3.0 fixes branch, SVN-Revision 34552


This happens even after saving the change or if you do something else
in between (e.g. writing some eventhandler)

E.g:
Move or resize the form - click on the OnActivate-event - write some
code - save the whole project - click on a component (e.g. TEdit) in
the component palette - form has same size and position as before the
resize/move.


It works here.


Just retested - happens all the time, new project, reopened old  
project - always the same.


Problem disappears when switching to QT - so it seems to be a problem  
in GTK2. Unfortunatly no Windows around, so can not test there.
I switched my IDE to QT now - but it still might be worth a look to  
hunt down the problem.




I use Lazarus mainly for developing applications without GUI - so I
can't really say since when I have that problem.

But perhaps someone has an Idea what I might do wrong?


Mattias


Thanks for all help,

Lukas
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form resize reverted after click on component palette

2016-09-26 Thread Mattias Gaertner via Lazarus
On Mon, 26 Sep 2016 09:37:20 +
Lukas Gradl via Lazarus  wrote:

> Hi!
> 
> When I resize or move a form in the designer and click on a component  
> in the palette afterwards (to place it on the form) the change is  
> reverted - the form has the same size and position as before my change.

What platform?
Do you a docked IDE?

> This happens even after saving the change or if you do something else  
> in between (e.g. writing some eventhandler)
> 
> E.g:
> Move or resize the form - click on the OnActivate-event - write some  
> code - save the whole project - click on a component (e.g. TEdit) in  
> the component palette - form has same size and position as before the  
> resize/move.

It works here.

 
> I use Lazarus mainly for developing applications without GUI - so I  
> can't really say since when I have that problem.
> 
> But perhaps someone has an Idea what I might do wrong?

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Form resize reverted after click on component palette

2016-09-26 Thread Lukas Gradl via Lazarus

Hi!

When I resize or move a form in the designer and click on a component  
in the palette afterwards (to place it on the form) the change is  
reverted - the form has the same size and position as before my change.


This happens even after saving the change or if you do something else  
in between (e.g. writing some eventhandler)


E.g:
Move or resize the form - click on the OnActivate-event - write some  
code - save the whole project - click on a component (e.g. TEdit) in  
the component palette - form has same size and position as before the  
resize/move.


I use Lazarus mainly for developing applications without GUI - so I  
can't really say since when I have that problem.


But perhaps someone has an Idea what I might do wrong?

Thanks
Lukas
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus