Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Ondrej Pokorny via Lazarus

On 25.04.2018 16:30, Anthony Walter via Lazarus wrote:

Suggestions?


You obviously know much more in this topic than I do, so it's hard to 
comment for me.


Just a note about win32: AFAIK the LCL supports only Windows XP and up 
officially since 1.8. So there is no problem to switch to GDI+.


I am quite sure any improvements will be highly appreciated.

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


Re: [Lazarus] Component editors and related

2018-04-25 Thread Werner Pamler via Lazarus

Am 25.04.2018 um 20:40 schrieb Vojtěch Čihák via Lazarus:


ad 1: I never tried two level collection. Are they all published (both 
collections and their items)?




Yes. And both collections are accessible in the object inspector: The 
JvOutlookBar has a property "Pages", the ellipsis button next to it 
opens the usual collection property editor which can be used to add, 
delete or rearrange pages. And when one of the pages is selected the 
object inspector displays the property "Buttons", again with an ellipsis 
button to open another collection property editor, now for the buttons. 
This part is working out of the box. The problem is the component tree 
which only shows the page nodes but no button nodes.



ad 2: You can do (in your component editor) something like:

var aHook: TPropertyEditorHook;

begin

  ...

  aHook:=nil;

      if not GetHook(aHook) then exit;

  ...

  //add or insert:

AddedItem:=aComponent.Columns.Add;

aHook.PersistentAdded(AddedItem, True);  //this notifies component tree

aHook.SelectOnlyThis(AddedItem);   //this selects added object

  //deleting

   DeletedItem:=aComponent.Columns[aIndex];

 aHook.DeletePersistent(TPersistent(DeletedItem)); //this notifies 
component tree




This is for notification of the component tree by the component editor 
and this code is already there and working. What I want is notification 
of the component editor by the designer if pages or buttons are added 
while the component editor is open (the component editor is not modal).


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


Re: [Lazarus] Component editors and related

2018-04-25 Thread Vojtěch Čihák via Lazarus

Hi,
 
ad 1: I never tried two level collection. Are they all published (both 
collections and their items)?
 
ad 2: You can do (in your component editor) something like:
 
var aHook: TPropertyEditorHook;
begin
  ...
  aHook:=nil;
      if not GetHook(aHook) then exit;
  ...
  //add or insert:
    AddedItem:=aComponent.Columns.Add;
    aHook.PersistentAdded(AddedItem, True);  //this notifies component tree
    aHook.SelectOnlyThis(AddedItem);   //this selects added object
  //deleting
   DeletedItem:=aComponent.Columns[aIndex];
   aHook.DeletePersistent(TPersistent(DeletedItem));   //this notifies 
component tree
 
V.   
 
__

Od: Werner Pamler via Lazarus 
Komu: Lazarus mailing list 
Datum: 25.04.2018 19:56
Předmět: [Lazarus] Component editors and related


Hi all,

currently I am porting those JVCL components which look interesting to 
me 
(https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/ ), 
but at the moment I am stuck with the component editor of the 
TJvOutlookBar. This is some kind of two-level vertical menu. The top 
level is a list of TJvOutlookBarPage items, and each page has a list of 
TJvOutlookbarButton items as second level. Both lists inherit from 
TCollection. My problem is that in the component tree of the object 
inspector I see only the page items, but not the button "sub-items". See 
attached screen shot of Lazarus and the Delphi version for comparison. 
How can I make the button subnodes appear in the component tree?


Another problem: The component comes with a ComponentEditor for the 
entire class, which looks similar to that of a TCollection, but contains 
a treeview to display the page-button relationships. After some 
twiddling around I was able to make this work in Lazarus, i.e. when I 
add nodes to the tree in the component editor the corresponding buttons 
or pages are added to the control on the form designer; and when I 
navigate in the component editor's tree the selected object follows in 
the component tree and in the object inspector. But the opposite 
direction does not work:  When I add a page or button in the object 
inspector (by using the Pages and Buttons collection property editors) 
the tree in the component editor is not updated. How can I do this?


Any hints greatly appreciated.
Werner




--

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


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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread zeljko via Lazarus

On 25.04.2018 16:30, Anthony Walter via Lazarus wrote:
I am trying to paint controls, so I need to eventually Canvas.Draw() to 
get a graphic onto a control. I've been working on creating a fully 
featured web browser for Lazarus and have been looking at the underlying 
widgetset interface code.


Gtk3, which my project currently works great on, uses the now required 
Cairo system for painting Gtk widgets. I've already had to patch the 
Gtk3 LCL interface section quite a bit to fix errors and I'll submit 
those changes when I publish my project.


That would be nice.



However, the LCL Gtk2 widgetset is stuck using the Gdk system for 
drawing, even though that was deprecated early on in the Gtk2 lifetime 
and Cairo has been recommend for a decade or more. I would like to 
submit a patch for Gtk2 replacing Gdk with Cairo, but using a swtich 
setting that could be changed at runtime.


+1, maybe add Gtk2UseCairo as default.

 paths are also welcome, afair win32,qt and gtk2/3 supports paths 
and it can be implemented inside widgetsets.


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


[Lazarus] Component editors and related

2018-04-25 Thread Werner Pamler via Lazarus

Hi all,

currently I am porting those JVCL components which look interesting to 
me 
(https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/), 
but at the moment I am stuck with the component editor of the 
TJvOutlookBar. This is some kind of two-level vertical menu. The top 
level is a list of TJvOutlookBarPage items, and each page has a list of 
TJvOutlookbarButton items as second level. Both lists inherit from 
TCollection. My problem is that in the component tree of the object 
inspector I see only the page items, but not the button "sub-items". See 
attached screen shot of Lazarus and the Delphi version for comparison. 
How can I make the button subnodes appear in the component tree?


Another problem: The component comes with a ComponentEditor for the 
entire class, which looks similar to that of a TCollection, but contains 
a treeview to display the page-button relationships. After some 
twiddling around I was able to make this work in Lazarus, i.e. when I 
add nodes to the tree in the component editor the corresponding buttons 
or pages are added to the control on the form designer; and when I 
navigate in the component editor's tree the selected object follows in 
the component tree and in the object inspector. But the opposite 
direction does not work:  When I add a page or button in the object 
inspector (by using the Pages and Buttons collection property editors) 
the tree in the component editor is not updated. How can I do this?


Any hints greatly appreciated.
Werner


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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Anthony Walter via Lazarus
I am trying to paint controls, so I need to eventually Canvas.Draw() to get
a graphic onto a control. I've been working on creating a fully featured
web browser for Lazarus and have been looking at the underlying widgetset
interface code.

Gtk3, which my project currently works great on, uses the now required
Cairo system for painting Gtk widgets. I've already had to patch the Gtk3
LCL interface section quite a bit to fix errors and I'll submit those
changes when I publish my project.

However, the LCL Gtk2 widgetset is stuck using the Gdk system for drawing,
even though that was deprecated early on in the Gtk2 lifetime and Cairo has
been recommend for a decade or more. I would like to submit a patch for
Gtk2 replacing Gdk with Cairo, but using a swtich setting that could be
changed at runtime.

GDI+ has been available for Windows since XP was released in 2001, and
Direct2D since Windows 7 in 2009. I think it's about time we upgrade the
Windows graphics from GDI to at least GDI+.

I am willing to contribute to these changes, but I would want assurances
that we would accept a common interface for the advanced features all these
improved graphics back-ends include. They all include alpha blending,
gradient brushes, matrix transforms, vector shaped clipping paths, and
more.

My recommend approach to adding these features to the core LCL Canvas class
would be to:

A) Change the underlying widgetset to operate with these new graphic
backends and operate the same as before, but fixing a few problems like
allowing Canavs.Draw to work between 32 bits per pixel surfaces correctly.

B) Add an advanced canvas interface for new features like gradient brushes,
vector clipping paths and such. Widgetsets can implement the advanced
interface and use it in conjunction with the original TCanvas class.

Examples:

Canvas.Matrix.Rotate(PI / 6);
Canvas.AddPath(Polygon);
Canvas.Clip;
Canvas.Fill(Gradient);

  TPolygon = array of TPointF;

  IAdvancedCanvas = interface
...
procedure AddPath(Polygon: TPolygon);
procedure Clip;
procedure Fill(Brush: IBrush);
property Matrix: IMatrix read GetMatrix write SetMatrix;

  end;

Suggestions?
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Next language feature for pas2js...

2018-04-25 Thread Michael Van Canneyt via Lazarus


Hello,

Now that interface support has been added to the list of implemented language
features of pas2js, we're looking to get feedback on what best to tackle next.

This time, the poll is not on the forum, so you do not need to have an
account to vote.

Here is a link to the poll:

https://docs.google.com/forms/d/e/1FAIpQLScPVu6Y_X1QhOrYLWia4TVeKoZ3wiu-_PiMqJ0Zm8KW39FdCQ/viewform?usp=sf_link

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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Giuliano Colla via Lazarus

Il 25/04/2018 13:05, Michael Van Canneyt via Lazarus ha scritto:


Where are they located?


packages/fcl-image 


Thanks to you and to Ondrej.

Giuliano

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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Michael Van Canneyt via Lazarus



On Wed, 25 Apr 2018, Giuliano Colla via Lazarus wrote:


Il 25/04/2018 06:12, Ondrej Pokorny via Lazarus ha scritto:


2.) Use FPC graphics classes/functions without the LCL overhead.

Where are they located?


packages/fcl-image

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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Ondrej Pokorny via Lazarus

On 25.04.2018 13:00, Giuliano Colla via Lazarus wrote:

Il 25/04/2018 06:12, Ondrej Pokorny via Lazarus ha scritto:


2.) Use FPC graphics classes/functions without the LCL overhead.

Where are they located?


FPC\packages\fcl-image\src\

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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Giuliano Colla via Lazarus

Il 25/04/2018 06:12, Ondrej Pokorny via Lazarus ha scritto:


2.) Use FPC graphics classes/functions without the LCL overhead.

Where are they located?

Giuliano

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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Ondrej Pokorny via Lazarus

On 25.04.2018 12:24, Ondrej Pokorny via Lazarus wrote:

On 25.04.2018 12:18, Anthony Walter wrote:
For years I have my own solution that works 
, but I am interested in 
LCL TCanvas someday working correctly without 3rd party add ins.


Unfortunately, I have experienced the same issues.



But if you don't want to use 3rd party add ins, use the FCL directly. It 
supports transparency, smooth resize etc etc. Actually it supports more 
than you would think at the first glance :)


The LCL graphic classes/methods are very OS-specific. The FCL graphic 
classes/methods are OS-independent.


I'd love to have full transparency support in LCL TBitmap/TCanvas as 
well but it all depends on the underlying OS. If you can fix it (at 
least for some OS/WS), feel free to post a patch.


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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Ondrej Pokorny via Lazarus

On 25.04.2018 12:18, Anthony Walter wrote:
For years I have my own solution that works 
, but I am interested in 
LCL TCanvas someday working correctly without 3rd party add ins.


Unfortunately, I have experienced the same issues.

Ondrej

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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Anthony Walter via Lazarus
Ondrej,

For years I have my own solution that works
, but I am interested in LCL
TCanvas someday working correctly without 3rd party add ins.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Unix PageSetupDialog border fix

2018-04-25 Thread Juha Manninen via Lazarus
On Tue, Apr 24, 2018 at 6:04 PM, AlexeyT via Lazarus
 wrote:
> fix for BorderStyle, dialog was resizable and preview rect is not resizable
> (dont fit to big size)- looks bad.

I applied the patch in r57703. Thanks.

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