* * *

Author Topic: BGRA Controls v4.6.2  (Read 103713 times)

circular

  • Hero Member
  • *****
  • Posts: 2723
    • Personal webpage
Re: BGRA Controls v4.5.1
« Reply #330 on: June 03, 2018, 09:49:06 pm »
More screenshots. Where I run into some bugs.

In BCToolbar, when I hover a button or click it, its background becomes uniform gray.

In BCXButton, the background of Button 4 is half black. Maybe related to rendering of transparent pixels.

In BGRARibbon, the some icons are not displayed and the text is written twice. The text written twice comes from the fact that the ShowCaption is set to False only after the first render. I would suggest to set it to False in the designer or in FormCreate. About the icon not displayed, I am not sure why.

Progressbars are ok.

« Last Edit: June 03, 2018, 09:55:38 pm by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 2708
  • I'm coding :)
    • Lainz
Re: BGRA Controls v4.5.1
« Reply #331 on: June 03, 2018, 11:29:45 pm »
More screenshots. Where I run into some bugs.

In BCToolbar, when I hover a button or click it, its background becomes uniform gray.

I think that's the normal way of these buttons on Linux and mac, on Windows these are semi transparent, but I did not paint them, these are painted by the OS.

Maybe we can override the paintbutton event and paint these by ourselves to have a consistent look.

Some time ago I reported a bug when then was implemented the paint and paintbutton events for normal toolbar.

In BCXButton, the background of Button 4 is half black. Maybe related to rendering of transparent pixels.

I've seen that bug on Windows as well in normal buttons not BGRA ones, is due to how LCL handles transparency, nothing to do with BGRABitmap.

In BGRARibbon, the some icons are not displayed and the text is written twice. The text written twice comes from the fact that the ShowCaption is set to False only after the first render. I would suggest to set it to False in the designer or in FormCreate. About the icon not displayed, I am not sure why.

Ok. We can fix that. And about the images, maybe some change in BGRAImageList.. that is descendant from ImageList, and that component is different in trunk and 1.8, maybe I broken that opening the project in trunk.

Progressbars are ok.

Good =)

circular

  • Hero Member
  • *****
  • Posts: 2723
    • Personal webpage
Re: BGRA Controls v4.5.1
« Reply #332 on: June 04, 2018, 05:40:24 pm »
I have fixed the Ribbon example caption in the dev branch of BGRAControls. About the BGRAImageList, the LCL puts zero values in alpha channel. In BGRABitmap, there is a fix for this, but it was not active. I've changed that in the dev branch of BGRABitmap.

Note that it works as long as the color clBlack is not used. Indeed this color is equivalent to transparent. Icons may contain such color so it is better to draw using BGRA drawing functions instead (CanvasBGRA/PutImage). In the TBCButton code, it already does that. Just in the example, it is using Canvas and icons do not use clBlack. So there is nothing to change there.

I also added a function in BGRABitmap to draw a TBitmap directly with PutImage and used it in BCButton (so it requires latest dev of BGRABitmap). I makes the code easier to read.

By the way about the placement of the text in the button, we could do something similar to .NET :
Code: C  [Select]
  1.     public enum TextImageRelation {
  2.         Overlay = AnchorStyles.None,
  3.         ImageBeforeText = AnchorStyles.Left,
  4.         TextBeforeImage = AnchorStyles.Right,
  5.         ImageAboveText = AnchorStyles.Top,
  6.         TextAboveImage = AnchorStyles.Bottom
  7.     };

ImageAboveText: Specifies that the image is displayed vertically above the text of a control.
ImageBeforeText: Specifies that the image is displayed horizontally before the text of a control.
Overlay: Specifies that the image and text share the same space on a control.
TextAboveImage: Specifies that the text is displayed vertically above the image of a control.
TextBeforeImage: Specifies that the text is displayed horizontally before the image of a control.

What do you think?

I think that's the normal way of these buttons on Linux and mac, on Windows these are semi transparent, but I did not paint them, these are painted by the OS.

Maybe we can override the paintbutton event and paint these by ourselves to have a consistent look.
Hmm ok so that would be in BGRAControls then.

Quote
I've seen that bug on Windows as well in normal buttons not BGRA ones, is due to how LCL handles transparency, nothing to do with BGRABitmap.
Alright.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 2708
  • I'm coding :)
    • Lainz
Re: BGRA Controls v4.5.1
« Reply #333 on: June 04, 2018, 07:39:22 pm »
Hi, sorry I need to revert a change you did to TBCButton, seems that only works in newest BGRABitmap, that can't compile in lazarus trunk... So until fixed I reverted the usage of TBitmap instead of TBGRABitmap for TBCButton. Later we can bring it back to use the new feature.

In Delphi there is a way to make controls based on putting controls on a WYSWYG way, I wish to implement that for BGRAControls.

For example, drag a background, drag text, drag an icon and you have a brand new control made by you, that accepts standard events. These items are like plugins you put in a base control.

Then we can get rid of the complexity of making alignments, since we can use LCL that's already good doing that.

For example:

Base Control: TCustomControl descendant
- TImage
- TLabel

Then you simply align the image where you want (even with fixed pixel positions if you want it) and align the label (top, left, right, etc.)

And that's all, you assign by code the click event, that can be one for each element or one for all. There is the concept of HitTest or somewhat in these lines, that means you clic the icon but it passes through it and instead you clic the whole thing.

Is a bit harder to make, but once it's done, we have our own multi component, and forget about aligning and that hard stuff =)

I did something like that for this application: https://github.com/Arandusoft/fpcpaymowidget

But I coded the layout by hand, the idea is to have an own designer to implement the controls.

And new release: BGRAControls 4.6
    * BGRAVirtualScreen: Redraw when caption changes, partial redraw
    * BGRAVirtualScreen: Fix BevelOuter
    * Fixing icon example
    * ColorSpeedButton: added TextAutoSize

I've released that soon because I need the new color speed button feature to work with it, in multiple PC's so I'm using OPM to distribute it. Sorry if it's too early to release.

circular

  • Hero Member
  • *****
  • Posts: 2723
    • Personal webpage
Re: BGRA Controls v4.6
« Reply #334 on: June 05, 2018, 12:27:14 am »
Ok for the revert. It can stay that way.

I understand what you're suggesting for the layout.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 2708
  • I'm coding :)
    • Lainz
Re: BGRA Controls v4.6
« Reply #335 on: June 05, 2018, 12:41:41 am »
Ok. Thanks.

Well, I will try to implement something when I have free time or ideas =)

The editor can be the normal form editor.

lainz

  • Hero Member
  • *****
  • Posts: 2708
  • I'm coding :)
    • Lainz
Re: BGRA Controls v4.6.1
« Reply #336 on: June 14, 2018, 06:55:50 pm »
BGRA Controls 4.6.1 available in Github and OPM (with update from source option).
https://github.com/bgrabitmap/bgracontrols/releases

* Fix in bcbutton glyph introduced in latest version.

Notice that it requires BGRABitmap 9.8.1 to work.

lainz

  • Hero Member
  • *****
  • Posts: 2708
  • I'm coding :)
    • Lainz
Re: BGRA Controls v4.6.2
« Reply #337 on: June 16, 2018, 11:19:57 pm »
Hi, new version of BGRAControls available
https://github.com/bgrabitmap/bgracontrols/releases

BGRAControls 4.6.2
* Added SVG Button created by @josh.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus