* * *

Author Topic: BGRA Controls v5.0.1  (Read 115336 times)

circular

  • Hero Member
  • *****
  • Posts: 2744
    • 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: 2828
    • Home
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: 2744
    • 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: 2828
    • Home
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: 2744
    • 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: 2828
    • Home
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: 2828
    • Home
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: 2828
    • Home
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.

lainz

  • Hero Member
  • *****
  • Posts: 2828
    • Home
Re: BGRA Controls v4.6.2
« Reply #338 on: July 21, 2018, 07:53:46 pm »
Hi, in the dev branch I've added new styles for buttons and panel, like macos high sierra style (aproximated style, can be tweaked a bit more).

Also the new demo shows how to add a semi transparent image as background of the form with a component (0 lines of code for you).
« Last Edit: July 21, 2018, 08:11:27 pm by lainz »

lainz

  • Hero Member
  • *****
  • Posts: 2828
    • Home
Re: BGRA Controls v4.6.2
« Reply #339 on: July 28, 2018, 05:08:39 am »
In dev branch I've fixed the BCImageButton font property if anyone is using it  ::)

And here an old school button I made today in Corel Draw, then I exported it as bitmap, and its ready to use with BCImageButton, just set the bitmap options correctly and you have an old school 3d button with light and shadows.

Ready to use source code in a project attached.
« Last Edit: July 28, 2018, 05:12:31 am by lainz »

lainz

  • Hero Member
  • *****
  • Posts: 2828
    • Home
Re: BGRA Controls v5.0
« Reply #340 on: July 28, 2018, 08:35:53 pm »
Hi, today I'm releasing BGRA Controls 5.0.

https://github.com/bgrabitmap/bgracontrols/releases/

Is a 'big number change' due to incompatibility with the previous installation mode.

Breaking changes:
* Remove BGRACustomDrawn from the normal installation (outdated, not mantained) but can be installed by hand by the user (units not removed). (Please see here if you're interested why we made this change https://forum.lazarus.freepascal.org/index.php/topic,41961.msg292194.html)

Fixes:
* Fix in BCImageButton (font rendering when changing font properties)

Additions:
* Added dashboard test project
* Added mac os drawings and styles (bgramacos repository)
* Added material design (materialdesign repository)
* Added new BCImageButton demo

I know installing a lot of packages for getting only a single component or demo is bad, so I merged materialdesign and bgramacos components and examples into BGRAControls. Hopefully you can find these demos more easily / use these component from now.

lainz

  • Hero Member
  • *****
  • Posts: 2828
    • Home
Re: BGRA Controls v5.0.1
« Reply #341 on: August 09, 2018, 04:06:58 am »
Hi, this is BGRAControls 5.0.1, a small release
https://github.com/bgrabitmap/bgracontrols/releases

* Fix in BGRAVirtualScreen: Client size change with Border
* Added background properties in BGRAFlashProgressBar
* Fix to bug #26 (System Color Problem in BCTrackBarUpDown)

Hydexon

  • Full Member
  • ***
  • Posts: 161
    • My Blog (Spanish Only)...
Re: BGRA Controls v5.0.1
« Reply #342 on: August 27, 2018, 11:51:19 pm »
Someone have the original BGRAControls 2010-style Ribbon Demo :-[ ?, the new one looks cool but i prefer the 2010 one a lot, i crawed throught BGRAControls Git commits repo and no luck. Thanks.
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook

lainz

  • Hero Member
  • *****
  • Posts: 2828
    • Home
Re: BGRA Controls v5.0.1
« Reply #343 on: August 28, 2018, 01:19:30 am »
Hi, things get lost in time. Is good that you can remember that "style". But I also don't have it anymore.

Hydexon

  • Full Member
  • ***
  • Posts: 161
    • My Blog (Spanish Only)...
Re: BGRA Controls v5.0.1
« Reply #344 on: August 30, 2018, 03:00:06 am »
Hi, things get lost in time. Is good that you can remember that "style". But I also don't have it anymore.

It's alright, i found it anyway, it was in the BGRAControls 1.4.0.1 Release, (the last version which includes it) found in the old BGRAControls Sourceforge project (REALLY OLD, 6 years ago), and doesn't work anymore, it needs some good porting work since BGRAControls changed a lot.
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook

 

Recent

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