Lazarus

Programming => Graphics => Graphics and Multimedia => BGRABitmap and LazPaint => Topic started by: lainz on April 08, 2014, 04:11:29 am

Title: BGRA Controls
Post by: lainz on April 08, 2014, 04:11:29 am
The new BGRA Controls is available on GitHub:

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

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

Delphi Compatibility
https://forum.lazarus.freepascal.org/index.php/topic,24176.msg303533.html#msg303533

Support
If you like BGRAControls please support us
https://github.com/bgrabitmap/bgracontrols/#support-us
Title: Re: BGRA-Controls
Post by: lainz on April 08, 2014, 03:01:29 pm
in svn r2
- Now all *_icon.lrs are in the 'icons' subdirectory
- Now all *.lpi has Debug and Release compilation modes (added 'automatically' with Lazarus)
- Now licence and readme are in the 'docs' subdirectory
- Added 'LoadFromFile' and 'SaveToFile' methods for some components
- Deleted DataType.inc, added the code directly in bgraimagemanipulation.pas, since no other unit is using it
Title: Re: BGRA-Controls
Post by: lainz on April 08, 2014, 10:03:00 pm
BGRA-Controls 3.0
I think that is everything ok so it has no sense keeping this in alpha.
Title: Re: BGRA-Controls
Post by: circular on April 08, 2014, 11:42:57 pm
Wow great website!  :)
Title: Re: BGRA-Controls
Post by: lainz on April 09, 2014, 01:44:57 am
Thanks, is a single html template from the people at Bootstrap, grab one and just write!
You know, is as simple as uploading with ftp to the web files of your project. And SF has more like databases and php too, so you can install a forum or a wordpress site-

---

r3
bcimagebutton.pas
- streaming with LoadFromFile and SaveToFile methods
- Bitmap loading with BitmapFile and LoadFromBitmapFile
- Smoother Animation and now can be enabled or disabled
tests: save settings in lps files
other: version 3.1 svn

r4
bcbutton.pas now can be assigned from file with the method AssignFromFile, it styles the control from a saved file with SaveToFile method

basically the revision 4 is all we wanted some time ago! To skin our BCButton with simple and editable text files at runtime. It can be added for all components implementing 'Assign' in each one and then AssignFromFile, that's a modified version of LoadFromFile.
Title: Re: BGRA-Controls
Post by: circular on April 09, 2014, 10:40:45 pm
I am doing some Linux and I have replaced TImageList by TBGRAImageList in LazPaint. There was another bug of offset of drawing that was added to images in toolbars. Now it's fixed on SVN and TBGRAImageList works fine again.
Title: Re: BGRA-Controls
Post by: lainz on April 10, 2014, 03:48:31 am
r5
bcimagebutton.pas now has Assign and AssignFromFile methods and the property TextVisible
r6
new TBCPixel in bctypes.pas to use in components
property change: .res files not ignored (will be used as standard resource in next lazarus)
bgracontrols.lpk: required packages min BGRABitmap 7.2

Now you can use TBCPixel instead of Tcolor+alpha in the object inspector. Suggestions are welcome. Instead of creating a property editor for the ide i've implemented this...
Title: Re: BGRA-Controls
Post by: Deepaak on April 10, 2014, 05:07:50 pm
wow, nice to see bgra-controls back
Title: Re: BGRA-Controls
Post by: Dibo on April 10, 2014, 11:52:02 pm
Yep, I agree. Thanks Lainz for keeping alive this package :) . When I finally find more time I'll add new features. Beauty of open source ;)
Title: Re: BGRA-Controls
Post by: lainz on April 14, 2014, 02:14:37 pm
A lot of downloads this week, seems that this is still used by users, that's good!

r7
Required packages min version: BGRABitmap 7.3

Minimum version of BGRABitmap is now 7.3 that has a lot of improvements that will be used in controls.
Title: Re: BGRA-Controls
Post by: lainz on April 19, 2014, 02:05:50 am
r8
Added bgraresizespeedbutton (http://forum.lazarus.freepascal.org/index.php/topic,24290.msg146132.html#msg146132)
Added Align and Anchors for bgragraphiccontrol
Title: Re: BGRA-Controls
Post by: lainz on April 19, 2014, 02:32:25 am
r9
Added uEcontrols
- From http://sourceforge.net/projects/uecontrols/ version 5.14. Author Miguel Alberto Risco Castillo.
- Changes: changed icon folder and components tab in register procedure, removed package units to add all the units in the bgracontrols package.
Title: Re: BGRA-Controls
Post by: lainz on April 19, 2014, 12:20:46 pm
r10
- Added icon for bgraresizespeedbutton
- Changed readme

Version 3.1 is available for download:
- All changes from r4 to r10 on SVN
improvements in bcimagebutton, bcbutton, bgragraphiccontrol, added TBCPixel that you can use to store bgrapixel in components, bgraresizespeedbutton and added uEcontrols to package
Title: Re: BGRA-Controls
Post by: karaba on April 20, 2014, 03:18:19 am
Any chance that the clock & gauge controls from http://forum.lazarus.freepascal.org/index.php/topic,19700.msg118916.html#msg118916 (http://forum.lazarus.freepascal.org/index.php/topic,19700.msg118916.html#msg118916) will be included?
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2014, 03:43:54 am
Any chance that the clock & gauge controls from http://forum.lazarus.freepascal.org/index.php/topic,19700.msg118916.html#msg118916 (http://forum.lazarus.freepascal.org/index.php/topic,19700.msg118916.html#msg118916) will be included?

Sure i will check it. Thanks.

Edit: Analog Controls available from SVN r11.
Title: Re: BGRA-Controls
Post by: karaba on April 20, 2014, 04:39:17 am
That was fast thanks.
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2014, 04:51:45 am
Great controls.

SVN r12
I've fixed the small problems in Analog Controls, all working.
Title: Re: BGRA-Controls
Post by: lainz on April 22, 2014, 04:24:32 am
SVN r14
bgra-controls 3.2

We have 25 controls in the BGRA Controls pallete. BCFilters, BCEffect and units with overridable visual components. Games, Custom Drawn Drawer and TAChart demo and other example projects.

Now with Analog Controls: 2 clock and 2 gauge controls. One for quick use and other with custom styling.

Try AssignFromFile for BCButton and BCImageButton to load styles from plain text files at runtime.

Well that's all! Thanks to all contributors in the readme.txt and in this forum that helped to achieve this!
Title: Re: BGRA-Controls
Post by: lainz on August 15, 2014, 06:54:30 pm
In the lattest SVN added: BGRAScript.pas and test_bgrascript project.

BGRAScript:
    {TFPCustomImage override}
SetSize,320,240
    {Loading functions}
SaveToFile,"file.png"
    {Loading functions}
SetHorizLine,0,0,100,"rgba(0,0,0,255)"
XorHorizLine,0,0,100,"rgba(0,0,0,255)"
DrawHorizLine,0,0,100,"rgba(0,0,0,255)"
FastBlendHorizLine,0,0,100,"rgba(0,0,0,255)"
AlphaHorizLine,0,0,100,"rgba(0,0,0,255)"
SetVertLine,0,0,100,"rgba(0,0,0,255)"
XorVertLine,0,0,100,"rgba(0,0,0,255)"
DrawVertLine,0,0,100,"rgba(0,0,0,255)"
FastBlendVertLine,0,0,100,"rgba(0,0,0,255)"
AlphaVertLine,0,0,100,"rgba(0,0,0,255)"
DrawHorizLinediff,0,0,100,"rgba(0,0,0,255)","rgba(255,255,255,255)",128
    //--
FillTransparent
Rectangle,0,0,100,100,"rgba(0,0,0,255)","rgba(255,255,255,255)"
RectangleAntiAlias,"0,5","0,5","99,5","99,5","rgba(0,0,0,255)","1,5","rgba(255,255,255,255)"
Title: Re: BGRA-Controls
Post by: circular on August 15, 2014, 09:11:37 pm
Just a hint about rgba: the last parameter is a single from 0 to 1. I did it like that to follow CSS spec.  8-)
Title: Re: BGRA-Controls
Post by: lainz on August 15, 2014, 10:48:09 pm
Just a hint about rgba: the last parameter is a single from 0 to 1. I did it like that to follow CSS spec.  8-)

Ok thanks!
Title: Re: BGRA-Controls
Post by: lainz on August 29, 2014, 09:29:37 pm
Code: [Select]
procedure FilterRGB(Bitmap: TBGRABitmap; R, G, B: byte);

procedure RBG(Bitmap: TBGRABitmap);
procedure GRB(Bitmap: TBGRABitmap);
procedure GBR(Bitmap: TBGRABitmap);
procedure BRG(Bitmap: TBGRABitmap);
procedure BGR(Bitmap: TBGRABitmap);
procedure RRG(Bitmap: TBGRABitmap);
procedure RGR(Bitmap: TBGRABitmap);
procedure GRR(Bitmap: TBGRABitmap);
procedure RRB(Bitmap: TBGRABitmap);
procedure RBR(Bitmap: TBGRABitmap);
procedure BRR(Bitmap: TBGRABitmap);
procedure GGR(Bitmap: TBGRABitmap);
procedure GRG(Bitmap: TBGRABitmap);
procedure RGG(Bitmap: TBGRABitmap);
procedure GGB(Bitmap: TBGRABitmap);
procedure GBG(Bitmap: TBGRABitmap);
procedure BGG(Bitmap: TBGRABitmap);
procedure BBR(Bitmap: TBGRABitmap);
procedure BRB(Bitmap: TBGRABitmap);
procedure RBB(Bitmap: TBGRABitmap);
procedure BBG(Bitmap: TBGRABitmap);
procedure BGB(Bitmap: TBGRABitmap);
procedure GBB(Bitmap: TBGRABitmap);
procedure RRR(Bitmap: TBGRABitmap);
procedure GGG(Bitmap: TBGRABitmap);
procedure BBB(Bitmap: TBGRABitmap);

Added all these filters, now you can switch easily between all possible combinations of RGB channels.

Added rain project: a random generated animated rain.
Title: Re: BGRA-Controls
Post by: Roland57 on August 30, 2014, 11:11:33 am
Hello 007!

Where can I find the latest version of BGRA-Controls? Could you give a link please?
Title: Re: BGRA-Controls
Post by: Jurassic Pork on August 30, 2014, 11:39:45 am
Salut Roland,

va voir par ici :   http://sourceforge.net/p/bgra-controls/code/HEAD/tree/ (http://sourceforge.net/p/bgra-controls/code/HEAD/tree/)

007  is it the good link ?
Title: Re: BGRA-Controls
Post by: Roland57 on August 30, 2014, 01:22:22 pm
Merci! That's what I was looking for.
Title: Re: BGRA-Controls
Post by: Basile B. on August 30, 2014, 04:37:18 pm
Hi 007. Would it be possible for you to put a hook on the SF svn and then to mirror it on gitHUB ? (a bit like what's been done for FPC & Laz) ?

For example if someday, someone uses BGRA-Ctrls in a project hosted on GH it'll be more simple for the guy to put it as a sub dependency. (although it's not granted it'll ever happend).
Title: Re: BGRA-Controls
Post by: lainz on August 30, 2014, 10:03:36 pm
that's the link.

about gh we have one copy but is outdated https://github.com/bgrabitmap
Title: Re: BGRA-Controls
Post by: Basile B. on August 31, 2014, 01:31:50 am
Thx. Thumb up.

http://referentiel.nouvelobs.com/file/8118406-video-de-quelle-mysterieuse-maladie-souffre-kaleem.jpg (http://referentiel.nouvelobs.com/file/8118406-video-de-quelle-mysterieuse-maladie-souffre-kaleem.jpg)

 :D, yes I'm an ashole. I joke with this. :P
Title: Re: BGRA-Controls
Post by: circular on August 31, 2014, 01:45:04 pm
Wow Basile that's impressive!
Title: Re: BGRA-Controls
Post by: Jurassic Pork on August 31, 2014, 02:26:48 pm
more infos about Kaleem
here  (http://www.dailymail.co.uk/news/article-2729249/The-boy-TWO-STONE-hands-bigger-head-Indian-doctors-baffled-eight-year-old-s-fingers-swell-giant-proportions.html)
Title: Re: BGRA-Controls
Post by: lainz on August 31, 2014, 04:25:03 pm
Ok.  ::)

Updates in SVN and GitHub:
in bgrascript now you can use let keyword to store values

Code: [Select]
let mynumber 1234
and modify the same way

Code: [Select]
let mynumber 5678
the type doesn't matter, is always stored as string and then converted by the function. you can

Code: [Select]
let mynumber "hello there!"
let mode1 boTransparent
let mode2 dmDrawWithTransparency

example:

Code: [Select]
// "store some values"
let oneh 100

// "Draw rectangles, lines and bitmap"
Rectangle 0,0,oneh,oneh,"rgba(0,0,0,0.6)","rgba(250,250,250,1)","dmDrawWithTransparency"
Title: Re: BGRA-Controls
Post by: circular on August 31, 2014, 04:46:44 pm
I checked the rain project. That looks great!  :)

I could not resist but to try to do my own version of the rain. So here is my take on it:
Title: Re: BGRA-Controls
Post by: lainz on August 31, 2014, 09:24:13 pm
Awesome! i'll add it to the bgra test folder.
Title: Re: BGRA-Controls
Post by: lainz on September 02, 2014, 06:59:38 pm
Added print, input and goto in BGRAScript.

print show a dialog message with a concatenation of strings
input show a input message that stores the result in a variable
goto is usefull to skip lines
Title: Re: BGRA-Controls
Post by: CM630 on September 08, 2014, 07:53:52 am
I have added some features to the Knob and the Led from the UE Controls (http://wiki.lazarus.freepascal.org/uE_Controls) package. These controls are included in the BGRA-Controls. Since the author of UE Controls refuses to accept contributions, I wonder if I should publish my fork on a separate place or maybe my contributions could be added to BGRA-Controls?
Title: Re: BGRA-Controls
Post by: circular on September 08, 2014, 07:47:05 pm
Yes that is a good idea. You could rename them BC or BGRA something. What do you think 007? I don't know if we need an authorisation from the author of UE controls. The thing is if we don't change the name, both controls the original and modified one would collide.
Title: Re: BGRA-Controls
Post by: lainz on September 09, 2014, 01:29:18 am
Ok. We can change the code because the controls are open source so I think there's no problem.

paskal try to change all names to bc or bgra, for all if possible, and then we can upload it. If you need it we can give you svn access if is more easy for you.
Title: Re: BGRA-Controls
Post by: CM630 on September 09, 2014, 07:04:47 am
Ok. We can change the code because the controls are open source so I think there's no problem.

paskal try to change all names to bc or bgra, for all if possible, and then we can upload it. If you need it we can give you svn access if is more easy for you.
There won't be a problem to change the names, I already did change to something else, I will switch them to BGRA.
I think I won't made changes too often, so I won't need svn acces, a patch or two will do.
But, IMHO it would be better if I do some changes in the icons of the components, to prevent users from confusing them.
BTW, BGRAKnob needs a scale, I will see if I can do something (when the right time comes).


Edit: Any hint for the easiest way to extract an image from a LRS is welcome.
Title: Re: BGRA-Controls
Post by: lainz on September 09, 2014, 07:31:18 pm
Ok.

And for the lrs
http://stackoverflow.com/questions/10905802/extract-lazarus-resource
Title: Re: BGRA-Controls
Post by: taazz on September 09, 2014, 10:59:27 pm
Edit: Any hint for the easiest way to extract an image from a LRS is welcome.
http://sourceforge.net/projects/lrsexplorer/ (http://sourceforge.net/projects/lrsexplorer/) my second installation after lazarus was this tool. It manages an lrs file by importing and exporting resources to/from it. I still install it in all my workstations even though I haven't used after I converted everything to rc files.
Title: Re: BGRA-Controls
Post by: CM630 on September 10, 2014, 02:13:49 pm
Enhanced versions of LED and Knob are attached.
Knob is named BGRARKnob, where R stand for "raster", because there is always a scalable knob in the package.

 
http://sourceforge.net/projects/lrsexplorer/ (http://sourceforge.net/projects/lrsexplorer/) my second installation after lazarus was this tool. It manages an lrs file by importing and exporting resources to/from it.
That is the answer I was looking for. I added a link to the app in the Lazarus Resources wiki.
Title: Re: BGRA-Controls
Post by: lainz on September 11, 2014, 03:43:29 pm
Enhanced versions of LED and Knob are attached.
Knob is named BGRARKnob, where R stand for "raster", because there is always a scalable knob in the package.

 
http://sourceforge.net/projects/lrsexplorer/ (http://sourceforge.net/projects/lrsexplorer/) my second installation after lazarus was this tool. It manages an lrs file by importing and exporting resources to/from it.
That is the answer I was looking for. I added a link to the app in the Lazarus Resources wiki.

Thanks. They're in the lattest svn.
Title: Re: BGRA-Controls
Post by: CM630 on September 14, 2014, 08:27:54 pm
I wonder why TDTAnalogGauge and two more widgets have no icons in the Lazarus toolbar?
Title: Re: BGRA-Controls
Post by: lainz on September 14, 2014, 11:19:38 pm
I wonder why TDTAnalogGauge and two more widgets have no icons in the Lazarus toolbar?

I have rescued them from oblivion, brought no icon.

TBCXButton control has no icon and is purposely, is a sample control to be extended by the programmer.
Title: Re: BGRA-Controls
Post by: lainz on September 16, 2014, 04:28:30 am
More than 1000 downloads of BGRA-Controls 3.2, amazing how it grows!
Title: Re: BGRA-Controls
Post by: circular on September 16, 2014, 10:36:06 pm
Congratulations! :)
Title: Re: BGRA-Controls
Post by: circular on September 19, 2014, 07:04:51 am
Ahah I like that gameboy filter  :)

If I may, you can optimise it by not dividing by 3 and do the case with the numbers multiplied by 3.

It is also possible to reduce the number of comparisons by first checking if the value is above or below the middle, and then in each case to check if it is the lower or higher quarter.
Title: Re: BGRA-Controls
Post by: lainz on September 19, 2014, 01:58:26 pm
Thanks, i've seen on internet, tried with Corel Photopaint, worked, then programmed  ::)

You have svn access to this repository, i've improved it but can't figure how to improve multiply by 3 instead of div (changed the values, but doesn't look good)

I don't know how to programm dithering, maybe is easy for you to understand.
http://en.wikipedia.org/wiki/Dither#Algorithms

I've already used Threshold, is the same as GameBoy filter.

For the GameBoy filter the best seems to be Bayer matrix or "void-and-cluster", it looks like old video-games.

For photos, everything else.
Title: Re: BGRA-Controls
Post by: circular on September 19, 2014, 09:14:22 pm
About the multiplication by 3, to do this, simply remove the "div 3", and then when checking the value, use the values multiplied by 3. So if it was 128, then it becomes 128*3.

About dithering, I always thought it was too complicated for me. However now that I read the Floyd-Steinberg dithering page on wikipedia, it seems to be rather simple. Well, when I have got some time, I might implement dithering in BGRABitmap.
Title: Re: BGRA-Controls
Post by: lainz on September 19, 2014, 10:38:51 pm
About the multiplication by 3, to do this, simply remove the "div 3", and then when checking the value, use the values multiplied by 3. So if it was 128, then it becomes 128*3.

About dithering, I always thought it was too complicated for me. However now that I read the Floyd-Steinberg dithering page on wikipedia, it seems to be rather simple. Well, when I have got some time, I might implement dithering in BGRABitmap.

Yeah the problem was I did not change the data from byte to integer.

Yeah does not seem hard the Floyd-Steinberg dithering, I will try too.
Title: Re: BGRA-Controls
Post by: Mike.Cornflake on September 19, 2014, 11:31:18 pm
Hi guys :-)   This has nothing to do with BGRA-Controls, but everyone in here seems to be graphics savvy :-)

Any chance one of you guys can check the TCanvas.AngleArc patch in http://bugs.freepascal.org/view.php?id=7290 and let us know if it's good?   

Looks good to me, but I don't really know what I'm looking at :-)
Title: Re: BGRA-Controls
Post by: lainz on September 21, 2014, 11:35:06 pm
Hi guys :-)   This has nothing to do with BGRA-Controls, but everyone in here seems to be graphics savvy :-)

Any chance one of you guys can check the TCanvas.AngleArc patch in http://bugs.freepascal.org/view.php?id=7290 and let us know if it's good?   

Looks good to me, but I don't really know what I'm looking at :-)

Sorry I have no idea.

In BGRA-Controls SVN:
- Added GameBoy, GameBoyDithering and BlackAndWhiteDithering filters in BCFilters.
- Added pix2svg in test_extra: a tool to convert from bitmap to a map of rectangles, ellipses or hexagons stored in a svg file (maybe is usefull for artists only).
Title: Re: BGRA-Controls
Post by: lainz on September 26, 2014, 09:22:13 pm
Added BCTileMap, a unit to load .ini tile map files. Currently it support loading and editing at runtime, but I will add save feature quickly.

Added test_bctilemap, a project that opens a .ini tile map and draw into a BGRAVirtualScreen, and also support for 'painting' selecting the Tile ID in a combobox and then changing the map with the mouse (the most basic code in order to start a map editor).
Title: Re: BGRA-Controls
Post by: riad02 on October 01, 2014, 06:33:26 pm
HI,
About bgra controls.
I create an instance of this library.
the question is what should I do and what I should not do?
Title: Re: BGRA-Controls
Post by: lainz on October 01, 2014, 08:20:09 pm
HI,
About bgra controls.
I create an instance of this library.
the question is what should I do and what I should not do?

If you solve bugs or make improvements you can share patch files here and we can apply them and it will remain in the same library, that you can use for commercial or non-comercial use.

If you do modifications of the library, basically you must: keep as software library, add to the files the changes you made, license for free, provide 'functional' source code.

I don't know if modify is the same as, for example, create inherited classes from the objects in the library..

PD: We must update to LGPL v3?

LGPL v2:
Code: [Select]
  2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices
    stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no
    charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a
    table of data to be supplied by an application program that uses
    the facility, other than as an argument passed when the facility
    is invoked, then you must make a good faith effort to ensure that,
    in the event an application does not supply such function or
    table, the facility still operates, and performs whatever part of
    its purpose remains meaningful.

    (For example, a function in a library to compute square roots has
    a purpose that is entirely well-defined independent of the
    application.  Therefore, Subsection 2d requires that any
    application-supplied function or table used by this function must
    be optional: if the application does not supply it, the square
    root function must still compute square roots.)
Title: Re: BGRA-Controls
Post by: riad02 on October 02, 2014, 12:44:43 am
Sorry, I do not modify but create a derived class from the library without the slightest change.

About modifying, I've made ​​a little change on bcimagebutton. because if it is not modified hover state is not lost when modal show on the button.

So, how do I send these changes?
Title: Re: BGRA-Controls
Post by: lainz on October 02, 2014, 01:10:23 am
Ok if you don't modify the library you don't need to do anything.

If you're using SVN you can make a patch, or just upload the modified pas file here, since there is no other change in bcimagebutton we can see the changes easily.
Title: Re: BGRA-Controls
Post by: riad02 on October 02, 2014, 04:30:23 am
 Yappss,
Means I may make a derived class.
and I could use the library derived for commercial and non-commercial?  :)
If I change the library I'll tell you. Thank you ..


I changed in this section

Code: [Select]
procedure TBCCustomImageButton.DoMouseUp;
var
  Ctrl : TControl;
begin
  FFade.Mode := fmFadeIn;


  if Animation then
    FFade.Step := 20
  else
    FFade.Step := 255;


  Ctrl := Application.GetControlAtMouse;
  if Ctrl = Self then
    DoMouseEnter
  else
    DoMouseLeave;


  inherited DoMouseUp;
end;
Title: Re: BGRA-Controls
Post by: lainz on October 02, 2014, 05:13:23 pm
Yappss,
Means I may make a derived class.
and I could use the library derived for commercial and non-commercial?  :)
If I change the library I'll tell you. Thank you ..

Thanks for the patch. About a derived class I have no idea I will ask here:
http://forum.lazarus.freepascal.org/index.php/topic,26009.0.html
Title: Re: BGRA-Controls
Post by: CM630 on October 06, 2014, 06:31:19 pm
I cannot find a control in BGRAControls which can show GIF files. Is there such one?
Title: Re: BGRA-Controls
Post by: lainz on October 06, 2014, 08:55:30 pm
TBGRASpriteAnimation

TBGRASpriteAnimation.AnimatedGifToSprite(Filename: string);
Title: Re: BGRA-Controls
Post by: riad02 on October 09, 2014, 12:24:33 pm
May i request?

add property in bcbutton.
glyph position and caption position..  :)
Title: Re: BGRA-Controls
Post by: lainz on October 09, 2014, 10:02:21 pm
May i request?

add property in bcbutton.
glyph position and caption position..  :)

Glyph is vertically centered. You can move it horizontally with the GlyphMargin property. (It will add extra pixels surrounding the bitmap).
Text is managed for each state. You can move it with StateNormal.FontEx.TextAlignment
Title: Re: BGRA-Controls
Post by: lainz on October 16, 2014, 04:21:33 am
BGRAControls 3.4 released:
https://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/

Changes:
- Added bgrascript.pas (own scripting system): line by line scripting unit with test project.
- Added Rain: two projects with rain animation
- Added more filters in bcfilters.pas
- Added bgraled and bgraknob: mod versions of ueled and ueknob
- Improved AnimatedGifToSprite in BGRASpriteAnimation
- Fixes in BGRASpriteAnimation
- Pix2SVG project: The matrix of pixels is converted to a matrix of rectangles. This is usefull for pixel-art done with svg software.
- BCTileMap: tilemap support and test project
- Improved bcimagebutton: hover state not lost when modal show on the button (fixed by riad02)
- Added BGRAPascalScript with test
- Added BGRAPascalScriptLibrary with test to create bgrabitmap.dll with BGRAPascalScript unit

Notes
- The BGRAScript is not the same as BGRAPascalScript. The first is an own script system very limited, but you can easilly grow it adding more functions. The second uses Pascal Script and comes with a IDE plugin, usage is demostrated in a test project.
- BGRAPascalScriptLibrary uses BGRAPascalScript to create a library (.dll, etc..)
- BCTileMap is included but no longer updated, if you want a improved version get it with BGRA Games: http://forum.lazarus.freepascal.org/index.php/topic,26026.0.html
Title: Re: BGRA-Controls
Post by: aradeonas on October 20, 2014, 01:52:24 pm
@007
Take a look to this post,with this package can do really interesting jobs.
Title: Re: BGRA-Controls
Post by: lainz on October 21, 2014, 06:38:40 pm
@007
Take a look to this post,with this package can do really interesting jobs.

Thanks!

I've updated SVN: added include files support in the test_bgrapascalscript. Really usefull thing.
Title: Re: BGRA-Controls
Post by: aradeonas on October 21, 2014, 06:55:09 pm
@007 Also take look at this post and test it with delphi >=2010,BGRAControls with some animations:
http://forum.lazarus.freepascal.org/index.php?topic=26193.msg160564 (http://forum.lazarus.freepascal.org/index.php?topic=26193.msg160564)
Title: Re: BGRA-Controls
Post by: lainz on October 21, 2014, 09:00:07 pm
@007 Also take look at this post and test it with delphi >=2010,BGRAControls with some animations:
http://forum.lazarus.freepascal.org/index.php?topic=26193.msg160564 (http://forum.lazarus.freepascal.org/index.php?topic=26193.msg160564)

I dont have Delphi. Btw if theres a pre compiled binary ill test it.

We already have bcimagebutton with fading it just uses a internal timer to do the animations. Bgraspriteanimation is another example.
Title: Re: BGRA-Controls
Post by: aradeonas on October 21, 2014, 09:23:38 pm
Yes there is:
http://sourceforge.net/projects/accessquery/files/latest/download (http://sourceforge.net/projects/accessquery/files/latest/download)
The code only works in Delphi and need porting but its animation is really interesting.
Title: Re: BGRA-Controls
Post by: lainz on October 21, 2014, 11:08:01 pm
The panels animation and notifications are really cool. I don't have the knowledge to port them from delphi. BTW maybe someone else can do it.
Title: Re: BGRA-Controls
Post by: aradeonas on October 21, 2014, 11:15:21 pm
If I can,can you use it in BGRA-Controls?
Probably I can port it but I don't have the knowledge to extent BGRA-Controls and I really like them both.
Title: Re: BGRA-Controls
Post by: lainz on October 22, 2014, 12:59:46 am
Sure, we always are adding more stuff.
Title: Re: BGRA-Controls
Post by: aradeonas on October 22, 2014, 12:26:01 pm
OK then,probably I try it and if I succeed let you know and wait for cool things ;)
Title: Re: BGRA-Controls
Post by: lainz on October 25, 2014, 12:27:08 am
BTW if the controls you port to lazarus don't use BGRABitmap it has no much sense to add it to BGRA-Controls!
Title: Re: BGRA-Controls
Post by: aradeonas on October 25, 2014, 08:23:55 am
It seems you have no idea about this package.
This package is not a set of controls .it is an animation library and with this we can make BGRAControls animated or form animating or notifications or games or ... .
I finished a simple one but I am busy for now,when I fully finished it,I will share it.
Title: Re: BGRA-Controls
Post by: lainz on October 25, 2014, 04:20:23 pm
I know the purpose of that controls. I say to you that is not bgra specific, so IMO maybe more people is benefited for those controls if you put them in a separate package, people that don't want to install BGRA-Controls but wants animation can install them.
Title: Re: BGRA-Controls
Post by: aradeonas on October 25, 2014, 04:36:31 pm
Yes you are right but no I said not that is bgra specific I just say It can be vary useful with bgra.
When Its done I let you know.
Thank you
Title: Re: BGRA-Controls
Post by: aradeonas on October 25, 2014, 10:46:51 pm
Thake look here:
http://forum.lazarus.freepascal.org/index.php?topic=26193 (http://forum.lazarus.freepascal.org/index.php?topic=26193)
Title: Re: BGRA-Controls
Post by: lainz on November 14, 2014, 05:38:51 am
Added "Shadow" test project in BGRA-Controls SVN.

In the example is shown how to apply a shadow to a transparent bitmap. In this case a logo.

It can be usefull to apply shadow to any shape.
Title: Re: BGRA-Controls
Post by: aradeonas on November 14, 2014, 09:52:49 am
It is very helpful and SingleColor procedure is new for me.
Thank you.
Title: Re: BGRA-Controls
Post by: lainz on November 14, 2014, 03:14:41 pm
SingleColor is like pixel filters are done in BGRABitmap. Check BCFilters unit.
Title: Re: BGRA-Controls
Post by: Zittergie on January 05, 2015, 01:14:04 pm
Hi,

Is it possible to add 'mousewheel' event to BGRAFlashProgressBar ?
Title: Re: BGRA-Controls
Post by: Josh on March 03, 2015, 05:18:25 pm
Just installed fresh Laz 1.5 anf fpc 3.1.1 from trunk on New Win 7 64 Computer.
Installed BGRABITMAP 7.9.3
When trying to install bgracontrols 3.5 and getting the following error
Compile package bgracontrols 3.5: Exit code 1, Errors: 1
bgraled.pas(95,35) Fatal: Syntax error, "READ" expected but "identifier DEFAULT" found

in
BGRALED
line 95 property ParentColor: Boolean default False;

Any ideas?
Title: Re: BGRA-Controls
Post by: circular on April 01, 2015, 03:40:28 pm
Here is a patch for:
- bug fix in resizing BGRAVirtualScreen
- limit memory usage of BCButton
- mousewheel event for BGRAFlashProgressBar

Applied on SVN.

Cheers
Title: Re: BGRA-Controls
Post by: lainz on April 05, 2015, 04:21:56 pm
New BGRA-Controls 3.4.1:
https://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/

- added include files support in the test_bgrapascalscript
- added "Shadow" test project in BGRA-Controls SVN.
- bug fix in resizing BGRAVirtualScreen
- limit memory usage of BCButton
- mousewheel event for BGRAFlashProgressBar
Title: Re: BGRA-Controls
Post by: Zittergie on April 05, 2015, 05:24:43 pm
Thanks :)
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2015, 07:22:11 am
I think we're out of new controls long time ago..
Missing from my point of view are those that can be focused like in custom drawn (that it stopped their development too). Transparency is not an issue when you really need to focus things in the form to speed up the usability of the application (specially those that has repetitive input in edit fields from user).
I've not tried FPGUI because I'm used to the LCL and the classic form editor.
I never see the fully customizable form, never finished a complete drawer (also because custom drawn not works fully on desktops), not to be despective is a really good job done by felipe, I wish to help, but I'm not as good making components as others here :(
Using Lazarus owner draw components (i.e listbox owner draw item) just broken some of my apps because the drawing takes time and is not fully tested in real case scenarios. Too lazy to report bugs now that I know the time they take to will be fixed (sometimes never) So I opted out in using broken things.
But I like all the options here, but I don't see the customization an easy thing for lazarus developers.
That's all!
Title: Re: BGRA-Controls
Post by: circular on April 20, 2015, 12:27:03 pm
Personally I am happy to use LCL controls when it works on all platforms, and to use BGRAControls to fill the gaps, missing controls or buggy controls with LCL. But I reckon some people may prefer to have a smaller file size without including the LCL.

By the way, I could provide some BGRA controls by adapting them from LazPaint.

Regards
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2015, 07:28:51 pm
Hey thanks for the new TrackBar component ;)
Title: Re: BGRA-Controls
Post by: circular on April 20, 2015, 07:33:10 pm
Hi, I just updated it, so that all colors are customisable and the trackbar can be removed so that it becomes a simple updown.

Note: it is an adaptation of the trackbarupdowns in LazPaint
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2015, 08:01:45 pm
Nice!

I've added TBCToolBar

Is a TToolBar with OnRedraw event, with BGRABitmap so you can style in your own. Also works withouth themes. Tested only under Windows. It comes with a function to style like in Windows 7 ToolBar (needs to be improved..).

Title: Re: BGRA-Controls
Post by: circular on April 20, 2015, 08:09:08 pm
Looks nice.

On my computer however, the toolbar completely black, nothing appears in it.
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2015, 08:17:08 pm
Ok, you opened the demo or just placed the component?

I will add a default theme so it does not appear black.
Title: Re: BGRA-Controls
Post by: circular on April 20, 2015, 08:18:54 pm
I just placed the component in a random app.
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2015, 08:26:27 pm
Ok, now it should draw a default thing.

The thing is to use the onredraw event, not a list of pre defined themes. But if it is black we need a default one :)
Title: Re: BGRA-Controls
Post by: circular on April 20, 2015, 08:37:38 pm
Yes, a default theme is necessary so that people can use the component like that.

I would suggest to add a property to choose among the default themes (including Win7 theme).

And one theme could be "OwnerDraw", that draws nothing, and then have a OnDrawBar event that can be overriden.
Title: Re: BGRA-Controls
Post by: lainz on April 20, 2015, 08:43:16 pm
The event is already there. OnRedraw And a default drawer is the Windows 7 if you don't use the event.

I don't have any other themes right now, I was using this code in a canvas program with no bgra, but I need to install it here and there and you know, better to get all things in one place to speed up things.. So I converted the canvas drawing to bgrabitmap.

Maybe more defaults can help but right now I dont have others :(

The thing is we can't style the buttons withouth changing a lot of code.. but the trick is combine with TBCButton and it works nicely.
Title: Re: BGRA-Controls
Post by: circular on April 21, 2015, 01:26:10 pm
That's already very good.  :)

We can add a property to choose the default theme later.

I did some changes:
- when drawing the toolbar, to avoid using Canvas property because switching between Canvas and native BGRABitmap function can be slow.
- add a LimitMemoryUsage property to free the bitmap as soon as possible

That's not related but I also defined an icon for DTThemedClock (in BGRAControls tab)
Title: Re: BGRA-Controls
Post by: lainz on April 21, 2015, 03:37:50 pm
Nice. The memory usage thing is nice, perfect for big images, to save memory.

I've added OnRedraw event for FlashProgressBar, for example if we want to display the number of percent advanced, add extra elements or just override all the drawing.

Title: Re: BGRA-Controls
Post by: circular on April 21, 2015, 06:52:06 pm
That's interesting.

Hey I've added a percentage in the test project.
Title: Re: BGRA-Controls
Post by: lainz on April 27, 2015, 07:08:18 pm
I've added comments on source of BCButton.

Now when you select a property in the object inspector additional information is shown at the bottom. Also when you use a public method / like LoadFromFile / and you hover it in the code editor also information will be shown.

Doing this I found an unused property: property ClickOffset; Any ideas? It was added by Mora when added the stuff that improves dropdown arrow.

Also I found myself into a question: When using LoadFromFile is the same as AssignFromFile? BTW I wrote both methods but I can't remember LOL that's because we never documented nothing  ::)

I think that LoadFromFile stream all the published stuff and assign all, but AssignFromFile assigns only the style related stuff.

Any better comment to replace the current is apreciated.

Code: [Select]
{ Save all published settings to file }
    procedure SaveToFile(AFileName: string);
    { Load and assign all published settings from file }
    procedure LoadFromFile(AFileName: string);
    { Assign the properties from AFileName to this instance }
    procedure AssignFromFile(AFileName: string);
Title: Re: BGRA-Controls
Post by: lainz on April 28, 2015, 11:06:27 pm
Hi, I've added c# file for using with BGRABitmapLibrary

This is a test:
Code: [Select]
   
using BGRABitmapLibrary;

            // Create a new bitmap and save to file
            BGRABitmap.bgraCreateWithSize(0,100,100);
            BGRABitmap.bgraSaveToFile(0,"file.png");

            // Create another bitmap
            BGRABitmap.bgraCreate(1);

            // Get Highest ID available
            int id = BGRABitmap.bgraGetHighestID();

            // Display highest ID (1)
            MessageBox.Show(id.ToString());

            // Destroy bitmaps
            BGRABitmap.bgraDestroy(1);
            BGRABitmap.bgraDestroy(0);

            // Create a new bitmap from file
            BGRABitmap.bgraCreateFromFile(0, @"C:\lazarus\images\LazarusSource.bmp");

            // Get bitmap 0 pixel at 19 37 (somewhat brown)
            // Is getting the pixel
            uint pixel = BGRABitmap.bgraGetPixel(0, 19, 37);

            // Is setting the pixel
            BGRABitmap.bgraSetPixel(0, 1, 1, pixel);

            // and saving a modified copy
            BGRABitmap.bgraSaveToFile(0, "file2.png");

            // Destroy bitmap
            BGRABitmap.bgraDestroy(0);
Title: Re: BGRA-Controls
Post by: circular on April 29, 2015, 05:34:41 pm
Wow that's impressive.
Title: Re: BGRA-Controls
Post by: lainz on April 29, 2015, 06:17:13 pm
Wow that's impressive.

Thanks. I go slowly but its working  :)
Title: Re: BGRA-Controls
Post by: Mukatai on April 30, 2015, 03:02:03 pm
Hi,

Is it possible to add mousewheel events to BCButton, BCPanel and BCLabel ? (and other button if it's possible)

Thanks for your very good work !

@+
Title: Re: BGRA-Controls
Post by: lainz on April 30, 2015, 06:45:57 pm
Hi,

Is it possible to add mousewheel events to BCButton, BCPanel and BCLabel ? (and other button if it's possible)

Thanks for your very good work !

@+

Added. Please test if works. Added also OnClick and other events to BCLabel.
In which other button you need the event?
Title: Re: BGRA-Controls
Post by: Mukatai on April 30, 2015, 08:53:10 pm
Thanks for your reactivity!

When i compile a program with a function in all MouseWheel event i have an error message and program won't start.

For OnMouseWheel/OnMouseWheelDown/OnMouseWheelUp with BCButton and BCPanel :
Unknown Property
Adress 43BDC1
Adress 43D512

For OnMouseWheel/OnMouseWheelDown/OnMouseWheelUp with BCLabel :
Unknown Property
Adress 43BD91
Adress 43D4E2

BGRAControls : Snapshot r88
Lazraus : 1.4.0/FPC 2.6.4 32Bit
OS : Windows 7 Pro 64Bit

@+
Title: Re: BGRA-Controls
Post by: lainz on April 30, 2015, 09:05:21 pm
It works for me. You rebuild lazarus?
Title: Re: BGRA-Controls
Post by: Mukatai on April 30, 2015, 09:10:09 pm
Yes uninstall lastest stable version (rebuild) and install snapshot (rebuild).
Title: Re: BGRA-Controls
Post by: Mukatai on April 30, 2015, 09:33:58 pm
For my test, I use a new program without save it and I have some error. But if i save the program it work fine !

Added. Please test if works. Added also OnClick and other events to BCLabel.
In which other button you need the event?

BCImageButton and BGRASpeedButton.

Thanks for your work.

@+
Title: Re: BGRA-Controls
Post by: lainz on May 01, 2015, 12:20:14 am
For my test, I use a new program without save it and I have some error. But if i save the program it work fine !

Added. Please test if works. Added also OnClick and other events to BCLabel.
In which other button you need the event?

BCImageButton and BGRASpeedButton.

Thanks for your work.

@+

BCImageButton and BGRASpeedButton already had the event.
Title: Re: BGRA-Controls
Post by: lainz on May 02, 2015, 11:10:49 pm
Hi, there is a new version of bgra-controls 3.6
https://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/

It contains new stuff and bug fixes, improvements and so on:
- BGRABitmap Library is now working and its tested. And it compiles as Java library too (thanks to Fred vS for helping in the making of the library)
- Added new control BCToolBar (A TToolBar with style)
- Added new control BCTrackBarUpDown (A nice scalable trackbar component)
- Added OnMouseWheel event for some controls.
- Added comments on BCButton, now you can see information of what are you changing in the object inspector.
- Added a missing icon for a clock control.
- BCButton works now with less memory if you configure it :)
- Bug Fix in resizing bgravirtualscreen
- Added new event for flashprogressbar
- A lot of bug fixes for rectangles coordinates in controls thanks to circular
- Something maybe i'm missing, but if you see it there of course we did it :)

And now you can check also the new BGRABitmap that has nogui and fpgui features. Nogui is actually beign used for the bgrabitmap library project to save memory and file size of the compiled .dll.

Thanks to all that contributes to this!
Title: Re: BGRA-Controls
Post by: Mukatai on May 03, 2015, 12:04:42 am
BCImageButton and BGRASpeedButton already had the event.

Ok i not use it now but in future yes...

Another request, with BCButton it's possible to align image to left with marge ? (You can see an exemple in attachment)

I think you need add these properties : Glyph align (center, right or left), Glyph Marge Left and Glyph Marge Right .

Thanks

@+
Title: Re: BGRA-Controls
Post by: lainz on May 03, 2015, 05:04:49 am
I cant remember. If it is not in the settings you cant.

Edit: if you know how you can try to add that feature. Or you can use the event OnAfterRenderBCButton that allows put your own drawing code to the already rendered button-
Title: Re: BGRA-Controls
Post by: DonAlfredo on May 03, 2015, 05:14:11 pm
Hello,

I have incorporated bgra-controls into fpcup.
But unfortunately, compilation fails in:

bgraled.pas @ property ParentColor: boolean default False

If I comment this property out, bgra-controls installs well !!
See included pictures (Linux i386 and OSX).

Thanks.
Title: Re: BGRA-Controls
Post by: lainz on May 03, 2015, 06:00:36 pm
Hello,

I have incorporated bgra-controls into fpcup.
But unfortunately, compilation fails in:

bgraled.pas @ property ParentColor: boolean default False

If I comment this property out, bgra-controls installs well !!
See included pictures (Linux i386 and OSX).

Thanks.
hi, fpcup is using lazarus and fpc trunk right? so i cant really help you because im using lazarus 1.4 release.
try to fix it

maybe add the complete syntax
ParentColor:boolean read ... write ... default...
Title: Re: BGRA-Controls
Post by: DonAlfredo on May 03, 2015, 06:18:08 pm
Yes, currently I use fpc trunk and Lazarus trunk.

But fpcup can install any version you want.

However, if you just change
Code: [Select]
property ParentColor: Boolean default False;into
Code: [Select]
property ParentColor;
all is ok !
Title: Re: BGRA-Controls
Post by: lainz on May 03, 2015, 06:26:39 pm
Yes, currently I use fpc trunk and Lazarus trunk.

But fpcup can install any version you want.

However, if you just change
Code: [Select]
property ParentColor: Boolean default False;into
Code: [Select]
property ParentColor;
all is ok !
Thankyou i will add this to svn repo asap.
Title: Re: BGRA-Controls
Post by: DonAlfredo on May 03, 2015, 06:55:28 pm
Thank you for your changes !
bgra-controls now installs out-of-the-box with fpcup on all systems !!
Thanks for your quick response.
Title: Re: BGRA-Controls
Post by: lainz on May 03, 2015, 07:26:16 pm
Thank you for your changes !
bgra-controls now installs out-of-the-box with fpcup on all systems !!
Thanks for your quick response.

Amazing!
Title: Re: BGRA-Controls
Post by: circular on May 04, 2015, 01:30:47 pm
Hi! Here is a patch with:
- InnerMargin property for label and button (so that it is possible to make it look as before by using value 0.5 for InnerMargin)
- for sprite animation, when loading a gif, to use the speed of the gif file
- for sprite animation, fixed some resource variable
Title: Re: BGRA-Controls
Post by: Mukatai on May 04, 2015, 02:25:30 pm
I cant remember. If it is not in the settings you cant.

Edit: if you know how you can try to add that feature. Or you can use the event OnAfterRenderBCButton that allows put your own drawing code to the already rendered button-
Hi,

Thanks, work perfectly with OnAfterRenderBCButton !

@+
Title: Re: BGRA-Controls
Post by: lainz on May 04, 2015, 03:28:10 pm
Hi! Here is a patch with:
- InnerMargin property for label and button (so that it is possible to make it look as before by using value 0.5 for InnerMargin)
- for sprite animation, when loading a gif, to use the speed of the gif file
- for sprite animation, fixed some resource variable

I was trying to implement the gif thing a lot of time ago, finally is here!
Title: Re: BGRA-Controls
Post by: M.A.R.C. on May 23, 2015, 10:21:52 am
r9
Added uEcontrols
- From http://sourceforge.net/projects/uecontrols/ version 5.14. Author Miguel Alberto Risco Castillo.
- Changes: changed icon folder and components tab in register procedure, removed package units to add all the units in the bgracontrols package.

Please remove uEControls and related units and files (ue*.pas) from BGRAControls, it conflicts with uEControls installations.
Title: Re: BGRA-Controls
Post by: lainz on May 26, 2015, 02:23:25 pm
r9
Added uEcontrols
- From http://sourceforge.net/projects/uecontrols/ version 5.14. Author Miguel Alberto Risco Castillo.
- Changes: changed icon folder and components tab in register procedure, removed package units to add all the units in the bgracontrols package.

Please remove uEControls and related units and files (ue*.pas) from BGRAControls, it conflicts with uEControls installations.

Really? Does lazarus has this problem?

It happens when you try to rebuild lazarus or only if you use both packages in a single project?
Title: Re: BGRA-Controls
Post by: wp on May 26, 2015, 03:18:08 pm
You cannot have two packages with equally named components in Lazarus (I had a similar issue with TAChart and a demo version of TeeChart for Lazarus).

mrisco wants to administrate his uecontrols by himself (http://forum.lazarus.freepascal.org/index.php/topic,13592.msg178530.html#msg178530 (http://forum.lazarus.freepascal.org/index.php/topic,13592.msg178530.html#msg178530)). So, you'll have to remove uecontrols from BGRAControls. Anything else would be extremely unfair to the author of uecontrols.
Title: Re: BGRA-Controls
Post by: circular on May 26, 2015, 06:16:55 pm
If the author would like to take control over its controls, of course that is fair. I suppose also it was a little help to promote the controls through BGRAControls. I suppose that was the intention in the first place.

One need also to take into consideration the users of BGRAControls. What would be the transition for a project using those controls in BGRAControls package? After the controls are removed, is it as simple adding in the projects the dependency to the specific package for uecontrols? As they have the same name, I suppose there is no need to modify the LFM files.

007, what would prevent you from removing the controls? Are there modifications that have been done on those controls? In that case, you could suggest them as patches to ueControls to mrisco.
Title: Re: BGRA-Controls
Post by: lainz on May 26, 2015, 09:25:16 pm
Ah ok. I will remove them. There is no problem. Of course if the author does not want it included it's ok.

BTW I don't remember if there is some bugfix or not, I think uE is unchanged. I think I've fixed the clock components, but those are not from uE.

You cannot have two packages with equally named components in Lazarus (I had a similar issue with TAChart and a demo version of TeeChart for Lazarus).

Ok, this is the answer to my questions, BTW is weird :)
So component names are "Global" maybe I must say that? Not "BGRAControls.SomeComponent"

If the author would like to take control over its controls, of course that is fair. I suppose also it was a little help to promote the controls through BGRAControls. I suppose that was the intention in the first place.

One need also to take into consideration the users of BGRAControls. What would be the transition for a project using those controls in BGRAControls package? After the controls are removed, is it as simple adding in the projects the dependency to the specific package for uecontrols? As they have the same name, I suppose there is no need to modify the LFM files.

007, what would prevent you from removing the controls? Are there modifications that have been done on those controls? In that case, you could suggest them as patches to ueControls to mrisco.

No problem, as I said I think there is no fix on these. I'm removing them now.
Title: Re: BGRA-Controls
Post by: circular on May 26, 2015, 09:36:14 pm
Ok so the transition will probably be easy for users.

Quote
So component names are "Global" maybe I must say that? Not "BGRAControls.SomeComponent"
I am not sure. Maybe in Lazarus code there isn't the unit name. Also LFM files that describe forms do not mention unit names, so there is no way to know in which unit to look for them.

It is a bit a result of the principle of Pascal that has simple unit names, and not composed ones like in .NET, like System.Windows.Forms. Well except the .NET version of Pascal of course.
Title: Re: BGRA-Controls
Post by: lainz on May 26, 2015, 09:41:11 pm
Ok so the transition will probably be easy for users.

Quote
So component names are "Global" maybe I must say that? Not "BGRAControls.SomeComponent"
I am not sure. Maybe in Lazarus code there isn't the unit name. Also LFM files that describe forms do not mention unit names, so there is no way to know in which unit to look for them.

It is a bit a result of the principle of Pascal that has simple unit names, and not composed ones like in .NET, like System.Windows.Forms. Well except the .NET version of Pascal of course.

Oh really there is a .NET version of Pascal? :)

Yes I'm using C# and VS2013 with .NET right now, and well is organized in that way.

So, is not possible. All names must be unique.

Just updated the package. You can try the new package? For some reason I opened Lazarus and everything is broken! I cant even run it, all packages are with the red icon in my components explorer, something weird, I'm downloading lazarus again..
Title: Re: BGRA-Controls
Post by: lainz on May 26, 2015, 10:17:25 pm
Done :)

It was some unit left that was using uE, I think that unit was contributed some time ago by an user. So it maybe want to be added in uE controls.

BGRARKnob.
http://forum.lazarus.freepascal.org/index.php/topic,24176.msg157006.html#msg157006

This is the only one that was user contribution that can be added to uEcontrols. mrisco please check it.

For bgracontrols users:
- If you want to use these components please download uEcontrols.
- Or Download bgracontrols-3.6-2015-05-02.zip (2.4 MB), is the last version including these components.
Title: Re: BGRA-Controls
Post by: Josh on May 31, 2015, 11:01:57 pm
Hi
I am having problem downloading from snapshot and svn

snapshot just goes on forever
svn error not found

Is it broken?
Title: Re: BGRA-Controls
Post by: Josh on June 01, 2015, 07:08:09 pm
Hi

Snapshot started working about 1 hr ago.

I have removed, BGRAcontrols 3.6 installled latest brabitmap, installed new uecontrols, then the new bgracontrols.

Now i cannot open my projects, one of the smaller ones I get property picture deprecated use bitmap.

So now removed the new uecontrols and bgracontrols, and have gone back to bgracontrols 3.6

Is there a guide/instruction how to seperate the uecontrols and bgracontrols and how to modify projects that used the previous bundle? As am unable to get the form to display. ?


Title: Re: BGRA-Controls
Post by: lainz on June 03, 2015, 06:36:47 am
Hi josh,

We can do nothing :( Please ask in the uEControls thread
http://forum.lazarus.freepascal.org/index.php/topic,13592.msg179239/topicseen.html#new

Trunk is working here.
Title: Re: BGRA-Controls
Post by: circular on June 03, 2015, 11:38:33 am
I don't know if this would help you josh but you can try the following.

While having loaded the project with BGRAControls version 3.6, add ueControls in the project inspector and save the project. Do this for all your projects.

Then close any opened package and open the new version of BGRAControls and install it. Recompile Lazarus and when you restart, your projects will be opened using controls from ueControls.

If this does not work, I suppose there is some difference in the controls.

Quote
property picture deprecated use bitmap.
Maybe can you expand on that?
Title: Re: BGRA-Controls
Post by: CM630 on June 05, 2015, 08:40:16 pm
Done :)

It was some unit left that was using uE, I think that unit was contributed some time ago by an user.
This user was me (my user name is Paskal). You can return my contributions back, they should not have problems with the original UEControls.
Title: Re: BGRA-Controls
Post by: lainz on June 05, 2015, 09:44:00 pm
Done :)

It was some unit left that was using uE, I think that unit was contributed some time ago by an user.
This user was me. You can return my contributions back, they should not have problems with the original UEControls.

Ok. The main problem is if we does not include the dependencies it will not compile for users that does not have UEControls package. Because that I removed them.

The solution is you contact uEcontrols project leader and send him the modifications you have done.
Title: Re: BGRA-Controls
Post by: CM630 on June 05, 2015, 09:54:13 pm
In fact, he refused to accept cooperation, that is why I forked some of the components.
I suppose that uerotimage.pas rotate is the only dependency?  Maybe it can be renamed and added to BGRA- Controls, so my components will work again.
Title: Re: BGRA-Controls
Post by: lainz on June 05, 2015, 11:53:19 pm
In fact, he refused to accept cooperation, that is why I forked some of the components.
I suppose that uerotimage.pas rotate is the only dependency?  Maybe it can be renamed and added to BGRA- Controls, so my components will work again.

I think you can do a fork and upload it to sourceforge and you directly mantain it.

Sorry i do not want problems with they.

Even if the License allow us to do the thing you say.
Title: Re: BGRA-Controls
Post by: CM630 on June 06, 2015, 07:42:39 am
Ok.
Title: Re: BGRA-Controls
Post by: circular on June 06, 2015, 12:22:58 pm
@CM630: When you proposed the changes, what answer did the maintainer of ueControls give to you? Was there a particular reason that would prevent them from applying those changes?
Title: Re: BGRA-Controls
Post by: CM630 on June 06, 2015, 06:56:31 pm
I suppose there was a particular reason, but he did not bother to mention it.
Anyway, I read than explicit permision by the developer of UEControls is needed to use it in commersial apps. I suppose that contradicts with the general license of BGRA- Controls.
Title: Re: BGRA-Controls
Post by: lainz on June 12, 2015, 05:39:55 am
Really? I misread the license, MPL

Wikipedia quote (yes, is not the license text):

 In the absence of patents, MPL-licensed code can be freely used, altered, and redistributed. Versions with patented code can still be used, transferred, and even sold, but cannot be altered without special permission.

Also they are using bgrabitmap and maybe lcl units so it gets complex.

No one license debate ends fine in this forum, because that I just removed the files as asked by developers of uecontrols.
Title: Re: BGRA-Controls
Post by: M.A.R.C. on June 24, 2015, 07:58:51 pm
Apologize for my delayed response.

First, thank you for remove uE controls.

We need to admin our package because it is used for our students in ours projects and also some of them like to use BGRAcontrols.

We recently change the way that the controls load their images, that is the reason of have the message "The property 'Picture' is deprecated, use Image". Before we use the property "Picture" for load the images, now the controls use the property "Image".

@CM630, some of the changes that you proposed breaks the functionality in our designs, is for that, we say that you could modify them to best suit your application.

Best regards.

uE Group.
Title: Re: BGRA-Controls
Post by: lainz on June 24, 2015, 09:08:25 pm
Apologize for my delayed response.

First, thank you for remove uE controls.

We need to admin our package because it is used for our students in ours projects and also some of them like to use BGRAcontrols.
Best regards.

uE Group.

Alright  8)
Title: Re: BGRA-Controls
Post by: lainz on June 29, 2015, 06:59:44 pm
Hi,

In SVN of BGRA-Controls:
- I've added LoadFromBitmapResource for BCImageButton. You can load the bitmap from a resource now.

You can add the resources to your executable in the Project Options of the Lazarus IDE.
Code: [Select]
Project > Project Options > Resources > Add
Then, load the bitmap like this:
Code: [Select]
uses
... LCLType;

BCImageButton1.LoadFromBitmapResource('BITMAP1', RT_RCDATA);

Finally, this is better than storing in a TBitmap like in the older (really older) TBGRAImageButton, because the bitmap is stored in the original format, so size not increase, for example when you store a png image you can save a lot of space.

Also you can reuse the same resource and load it for all the BCImageButtons you want, saving more space.
Title: Re: BGRA-Controls
Post by: lainz on July 09, 2015, 05:50:17 pm
Hi,

BGRA-Controls latest repository SVN mirror is now on GitHub
https://github.com/bgrabitmap/bgracontrols/
Title: Re: BGRA-Controls
Post by: lainz on April 11, 2016, 04:35:41 pm
Hi, I've added on SVN the BCButtonFocus
- Is a button derived of CustomControl and has everything the same as BCButton plus it can handle focus (you can click it and give it focus, and do onclick pressing spacebar or return).

ToDo:
- Enable TabStop (pressing tab key focus the button). Done.
- Add focus styles, to see when the button is focused.
Title: Re: BGRA-Controls
Post by: circular on April 11, 2016, 07:26:35 pm
Cool.  :)

How does this button handle transparency?
Title: Re: BGRA-Controls
Post by: lainz on April 11, 2016, 08:56:48 pm
Cool.  :)

How does this button handle transparency?

It uses the Color property as background, so there is no background transparency. But it can be still used with no major problems if you set the color of the form / panel you're using.
Title: Re: BGRA-Controls
Post by: circular on April 11, 2016, 09:15:23 pm
Yes, makes sense.  8-)
Title: Re: BGRA-Controls
Post by: lainz on April 13, 2016, 08:16:23 pm
Added on SVN:
- BCRadialProgressBar

ToDo:
- Add all properties for text, shadows, colors, etc.
Title: Re: BGRA-Controls
Post by: circular on April 13, 2016, 10:14:20 pm
Wow, that's neat!
Title: Re: BGRA-Controls
Post by: aradeonas on April 14, 2016, 01:52:17 am
Very nice.
Happy to see you after a while lainz.
Title: Re: BGRA-Controls
Post by: coasting on April 15, 2016, 08:13:11 pm
Hey guys

one of the previous releases contained a unit called "Ribbon". I can only guess that it got designed as a starter for a new Ribbon Component based on BGRA controls. Unfortunately it was never completed and at some point got kicked out of the recent releases. As I like the new flat style of MS Office 2016 very much, I prepared a project template based on this unit. You can find sources and a screenshot here -> http://www.lazarusforum.de/viewtopic.php?f=29&t=9582  (http://www.lazarusforum.de/viewtopic.php?f=29&t=9582) If you like you can put it into SVN and distribute it with the BGRA controls as an additional example...

coasting

Title: Re: BGRA-Controls
Post by: lainz on April 15, 2016, 09:11:42 pm
Hi coasting, you can upload it here, since I have no account in lazarusforum.de
Title: Re: BGRA-Controls
Post by: coasting on April 15, 2016, 10:22:42 pm
Here you are... ;)

...but couldn't upload an executable as file size is limited to 250kb..?
Title: Re: BGRA-Controls
Post by: wp on April 15, 2016, 10:38:23 pm
Unit uresize.pas contains a copyright and license text which could cause problems. The unit doesn't look too complicated. Can't you replace it with a unit written by yourself? Or can you drop it? It looks as if it is not called at all.
Title: Re: BGRA-Controls
Post by: coasting on April 15, 2016, 10:44:24 pm
Unit uresize.pas contains a copyright and license text which could cause problems. The unit doesn't look too complicated. Can't you replace it with a unit written by yourself?

Yes I could, but it's actually not needed. You can cut it out from the project. I added it as an option to resize the form from all borders.
Title: Re: BGRA-Controls
Post by: JD on April 16, 2016, 12:35:04 am
Here you are... ;)

...but couldn't upload an executable as file size is limited to 250kb..?

That is beautiful. Well done! Does it render the same on Linux? I can't test it myself right now.

JD
Title: Re: BGRA-Controls
Post by: lainz on April 16, 2016, 02:09:06 am
Thanks, now it's added to SVN under test folder.

Amazing work!

I've added a copy of the boost license into docs folder too, for uresize.pas (anyone can check the license and see if can use it or not, BTW license is very permissive).
Title: Re: BGRA-Controls
Post by: coasting on April 16, 2016, 12:06:10 pm

That is beautiful. Well done! Does it render the same on Linux? I can't test it myself right now.

JD

It does! The borderless form is even resized and painted by the system routines. However I am not sure with the buttons... I tested it with Lazarus 1.2.4 on Ubuntu. It compiled without errors, but for whatever reason the big button images are not painted. Another point that needs to be checked is the slide- in/out of the menu. On Windows its looks nicely but on Linux its a bit weird...
Title: Re: BGRA-Controls
Post by: coasting on April 16, 2016, 12:13:46 pm
Thanks, now it's added to SVN under test folder.

Amazing work!

I've added a copy of the boost license into docs folder too, for uresize.pas (anyone can check the license and see if can use it or not, BTW license is very permissive).

Perfect ;) It's still a work in progress and will post updates from time to time in this thread.
Title: Re: BGRA-Controls
Post by: circular on April 17, 2016, 09:07:08 pm
This app looks beautiful.  :)

Regarding the sliding, I would suggest to use a timer with 15 ms and to determine the actual elapsed time in an accumulator.

Code: Delphi  [Select][+][-]
  1. uses DateUtils;
  2.  
  3. var
  4.   PrevTime: TDateTime;
  5.   AccTimeMs: Int64;
  6.  
  7. procedure TfrmMain.Timer1Timer(Sender: TObject);
  8. const TimeGrain = 15;
  9. var NewTime: TDateTime;
  10.   StepsToDo: Int64;
  11. begin
  12.   Timer1.Enabled := false;
  13.   if PrevTime <> 0 then
  14.   begin
  15.     NewTime := Now;
  16.     AccTimeMs += MilliSecondsBetween(PrevTime, NewTime);
  17.     PrevTime := NewTime;
  18.   end;
  19.   StepsToDo := trunc(AccTimsMs/TimeGrain);
  20.   AccTimeMs -= TimeGrain*StepsToDo;
  21.   AnimationProc(StepsToDo);  //your procedure to animate the content
  22.   Timer1.Enabled := true;
  23. end;  
Title: Re: BGRA-Controls
Post by: lainz on April 30, 2016, 01:03:06 am
Thanks circular, you can add this directly into the demo and upload it here?

In SVN I've changed BGRABitmapPack to the lcl opengl one, so in the future there's no problem on installing the bgra opengl package and bgra controls.
Title: Re: BGRA-Controls
Post by: circular on April 30, 2016, 10:30:37 am
Hi Lainz!

Regarding the demo, coasting says he's taking care of posting new updates. So I would rather let him use this code.

I am not sure about changing the reference to BGRABitmap4LCL_OpenGL package in general, because this does the following:
- imposes RGBA order on bitmaps (which is a bit slower on windows)
- adds a dependency to lazopenglcontext package

For people who don't use OpenGL, it is better to keep the regular version. I don't know if there is an easy solution. For now, I would say that people need to change the reference in BGRAControls package to either BGRABitmap or BGRABitmap4LCL_OpenGL depending on their needs. If they are going to use BGRABitmap4LCL_OpenGL package (for TBGLVirtualScreen and OpenGL functions), then they need to change the reference in BGRAControls package accordingly.
Title: Re: BGRA-Controls
Post by: lainz on April 30, 2016, 03:05:02 pm
Ok, so it is slower on windows, well i'm reverting the changes now ;)
Title: Re: BGRA-Controls
Post by: circular on April 30, 2016, 04:51:27 pm
Yes, apologies.

I am thinking in fact that maybe with OpenGL we could use the same channel order (BGRA for Windows and RGBA for Linux) and simply swap when sending textures to OpenGL. Indeed the gain of speed with OpenGL is only when keeping the same textures and avoiding any transfer of textures so the swaping of red and blue is not very important for that.

Still the package for OpenGL would depend on lazopenglcontext package.
Title: Re: BGRA-Controls
Post by: aradeonas on April 30, 2016, 05:36:28 pm
But we need a better way to manage these situations like we talked before.
Title: Re: BGRA-Controls
Post by: circular on April 30, 2016, 05:40:45 pm
Yes. Well the thing is the pixel format is defined by the record TBGRAPixel so it is not possible to compile two versions with a different definition of it within the same program.

I am thinking maybe to split things differently. Like putting the maximum of the OpenGL stuff in the main BGRABitmap package, and add other packages that plug into this one. And so the OpenGL package would use the usual TBGRAPixel. As said before, it does not really matter because textures are loaded once, swapping red/blue does not matter much for the framerate.
Title: Re: BGRA-Controls
Post by: aradeonas on April 30, 2016, 05:46:05 pm
It seems a better solution.
Title: Re: BGRA-Controls
Post by: lainz on July 12, 2016, 09:18:32 pm
Hi, I'm releasing BGRA-Controls v3.8


Download it here:
https://github.com/bgrabitmap/bgracontrols/releases
Title: Re: BGRA-Controls
Post by: lainz on August 22, 2016, 01:35:07 am
I'm updating the Git repository with new stuff:
- Added fpGUI theme (Windows 8 / 10 like) is a draft and I think I'm not updating this anymore, doesn't worth, use LCL default if you need native
- Added Plugins test in extra folder, how to create a dll to add third party functionality to a virtual screen
- Added material design animation test in extra folder, how to create a button with material design animation like

Edit: Added material design button component

Get it here:
https://github.com/bgrabitmap/bgracontrols
Title: Re: BGRA-Controls
Post by: lainz on August 29, 2016, 12:52:02 am
BGRA Controls v3.9

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

Changelog:
* Added Material Design Button
* Added fpGUI theme test extra
* Added plugins test extra
* Fixes compiling in lazarus trunk
Title: Re: BGRA-Controls
Post by: lainz on September 02, 2016, 12:06:04 am
BGRA Controls v4.0

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

Changelog:
* Added BGRA Custom Drawn controls, see here: http://forum.lazarus-ide.org/index.php/topic,33887.msg220730/topicseen.html

We have about 33 different controls now!
Title: Re: BGRA-Controls
Post by: Josh on September 02, 2016, 05:18:51 am
Hi Lainz,
Went to try Version 4 ( Laz 1.3, fpc 2.7.1 on Windows)
and I get
bgracontrols-4.0\bgracustomdrawn.pas(61,15) Error: There is no method in an ancestor class to be overridden: "DrawButton(TFPCustomCanvas;POINT;SIZE;TCDControlState;TCDButtonStateEx);"

Same error using Laz 1.4.4 on OSX

Is the update only for FPC 3 and above?

Josh
Title: Re: BGRA-Controls
Post by: lainz on September 02, 2016, 02:56:27 pm
Hi Lainz,
Went to try Version 4 ( Laz 1.3, fpc 2.7.1 on Windows)
and I get
bgracontrols-4.0\bgracustomdrawn.pas(61,15) Error: There is no method in an ancestor class to be overridden: "DrawButton(TFPCustomCanvas;POINT;SIZE;TCDControlState;TCDButtonStateEx);"

Same error using Laz 1.4.4 on OSX

Is the update only for FPC 3 and above?

Josh

I'm using it with Lazarus 1.6 and Lazarus trunk. If you can't compile you can:
- Remove that unit from the package.
- Update all custom drawn units (note that are a lot, not only these included in the customdrawn package, see the folder LCL for example).
Title: Re: BGRA-Controls
Post by: Josh on September 02, 2016, 03:17:16 pm
Hi Lainz,

I can't compile the package to install it.

Is it now only for Laz 1.6/1.7 with FPC 3.0.0 or above?

Title: Re: BGRA-Controls
Post by: lainz on September 02, 2016, 03:31:49 pm
Hi Lainz,

I can't compile the package to install it.

Is it now only for Laz 1.6/1.7 with FPC 3.0.0 or above?

Maybe customdrawn is not available in older versions of lazarus?

Try the BGRAControls 3.8/3.9 is available for download on github, you will get everything except the new Custom Drawn ones.

PD: I forget, in 3.9 and newer there is a new dependency with LazUTF8, maybe is not available in older lazarus too.
Title: Re: BGRA-Controls
Post by: esvignolo on September 02, 2016, 07:04:14 pm
@Lainz,@circular, i just want to write to thank you for the time, effort and a lot of knowledge you put into FPC. And give us new tools to developers.

Many others thanks.

BGRA Controls v4.0

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

Changelog:
* Added BGRA Custom Drawn controls, see here: http://forum.lazarus-ide.org/index.php/topic,33887.msg220730/topicseen.html

We have about 33 different controls now!
Title: Re: BGRA-Controls
Post by: lainz on September 02, 2016, 09:20:31 pm
@Lainz,@circular, i just want to write to thank you for the time, effort and a lot of knowledge you put into FPC. And give us new tools to developers.

Many others thanks.

Thankyou!
Title: Re: BGRA-Controls
Post by: lainz on September 14, 2016, 09:22:31 pm
Hi, I'm updating to BGRA-Controls 4.1:
https://github.com/bgrabitmap/bgracontrols/releases

- TBCDPanel: a panel that is not from custom drawn package, but is styled to match our BGRA drawer (dark theme).
- Updated some icons of the package, added missing icons.
- Added default size for all controls that had that stuff missing.
- Added more properties and updated visibility of FBGRA* images in TBCXButton.
- Removed old readme, updated README.md

These are small changes but now is easy to mantain a list of the controls we have thanks to the new readme file:
https://github.com/bgrabitmap/bgracontrols#bgra-controls

The missing icons was a suggestion from circular, that he read on a review.

You can see a review of BGRA-Controls made by third party here:
http://lazarus.developpez.com/actu/103444/Sortie-de-BGRA-Controls-v4-0-une-bibliotheque-de-composants-graphiques-pour-Free-Pascal-Lazarus/

Suggestions and new controls are welcome  ;)
Title: Re: BGRA-Controls
Post by: lainz on October 06, 2016, 04:54:14 pm
New release BGRA-Controls 4.2:
https://github.com/bgrabitmap/bgracontrols/releases

TBCNumericKeyboard

A panel with numeric buttons to store the input in a string. Then you can use the events to edit it to fit your needs and assign to other controls that value.

TBCRealNumericKeyboard

A panel with numeric buttons to do the real input of the keys on keyboard. What you type is sent to the focused control directly.

TBCDefaultThemeManager

A component to style all the selected buttons in a form with the need to style only a single button. Can be used entirely with code.
Title: Re: BGRA-Controls
Post by: circular on October 07, 2016, 02:02:39 pm
Theme manager that's great. That will allow easily to have the same style for one form.
Title: Re: BGRA-Controls
Post by: lainz on October 07, 2016, 02:50:25 pm
Theme manager that's great. That will allow easily to have the same style for one form.

And you can call Apply() for the current form and Apply(AControl: TWinControl) to apply for example in another form or panel. By default it does not iterate through panels in the form, so it will be applied exactly to these controls you want.
Title: Re: BGRA-Controls
Post by: lainz on October 15, 2016, 11:47:06 pm
Hi, I've added some stuff to BGRA-Controls on Git, like the Material Design colors and an unit contributed by the user esvignolo, that can set automatically the color of the font based on the background (used currently in themes for windows 8 and material design), and a bright function.

You can access the colors adding MaterialColors in uses, and doing something like this:

Code: Pascal  [Select][+][-]
  1. MaterialColorsList.KeyData['Red'].M500

to access from a string (so you can use text-based color configuration settings in your application easily)

or

Code: Pascal  [Select][+][-]
  1. MaterialRed.M500

to access a color directly.

Each color has 14 shades 50, 100, ... 900, A100, A200, A400 and A700 (taken every single color from the Material Design website).

Because I can't just use the numer I've prefixed them with 'M', so 50 is M50, the 'A' prefixed ones are the same.

If you want to use set-based configuration, all the material design colors was added to the BCSamples unit, together with the Windows 8 colors and other default themes, that are available in the default theme manager.
Title: Re: BGRA-Controls
Post by: lainz on October 19, 2016, 10:18:21 pm
Hi people fans of BGRABitmap  8)

Here is BGRA Controls v4.3:
https://github.com/bgrabitmap/bgracontrols/releases/tag/v4.3

* Fix in bcnumerickeyboard
* Added bckeyboard
* Fix in bcimagebutton
* Separated scripting units into a new package
* Added material colors unit
* Updated bcsamples unit
* Removed unnecessary BGRAToColor and ColorToBGRA in all files
* Revised hints (now you get a more clean compile of the package)
* Improved bcmaterialdesignbutton: now it's faster and has AutoSize

Notice that you need at least BGRABitmap 9.2.1 to run this version of BGRA Controls.

The keyboard is a work in progress, but we have a touch keyboard now!
Title: Re: BGRA-Controls
Post by: circular on October 19, 2016, 10:23:39 pm
I did not realise it was possible to pass parameters with an implicit custom ":=" overload. That's quite convenient :)
Title: Re: BGRA-Controls
Post by: lainz on October 19, 2016, 10:31:28 pm
Yes is really good, the one places were I can't replace is where is used as ColorToBGRA(ColorToRGB(SomeColor), SomeAlpha), else I need to create new variables and do SomeBGRAPixel.FromColor(SomeColor, SomeAlpha). I don't know maybe I change these later.

PD: Here is a screenshot of the keyboard.
Title: Re: BGRA-Controls
Post by: circular on October 19, 2016, 10:42:06 pm
Cool! That's especially useful with a tactile screen like on a smartphone.
Title: Re: BGRA-Controls
Post by: lainz on October 22, 2016, 04:31:35 pm
I'm learning Java and I found that it contains something called JavaFX where you can make complex UI with CSS, for example things like Material Design can be implemented with no effort and hardware accelerated.

We're far from that but someone can think on a way to make it. Of course if it's hardware accelerated we need to create controls for OpenGL not lazarus LCL controls, and the CSS well, a pain. In fact that BGRABitmap uses CPU it will be only displayed fast but rendered as any other controls.

Then the editor must be done too, we can't use the Lazarus designer.
Title: Re: BGRA-Controls
Post by: circular on October 22, 2016, 05:53:12 pm
About doing OpenGL controls, maybe we could do it within Lazarus designer. We could have some OpenGL container, and then put controls in them. Those controls would need to be able to display their content with regular Canvas during design time and to use OpenGL at runtime. Maybe not so obvious to do, but with a hybrid canvas that could draw either on LCL Canvas or on OpenGL, that would be kind of possible.
Title: Re: BGRA-Controls
Post by: lainz on October 22, 2016, 06:47:40 pm
Great idea, that's the way TCustomOpenGLControl works. Just see this line:

Code: Pascal  [Select][+][-]
  1. FCanvas: TCanvas; // only valid at designtime

So we can use that canvas in designtime. WMPaint event for normal Canvas (if csDesigning in ComponentState) and DoOnPaint for OpenGL.

I'm not familiar with contexts, we need a single context for all controls or separate contexts?

Code: Pascal  [Select][+][-]
  1.   { TCustomOpenGLControl }
  2.   { Sharing:
  3.     You can share opengl contexts. For example:
  4.     Assume OpenGLControl2 and OpenGLControl3 should share the same as
  5.     OpenGLControl1. Then set
  6.    
  7.         OpenGLControl2.SharedControl:=OpenGLControl1;
  8.         OpenGLControl3.SharedControl:=OpenGLControl1;
  9.  
  10.      After this OpenGLControl1.SharingControlCount will be two and
  11.      OpenGLControl1.SharingControls will contain OpenGLControl2 and
  12.      OpenGLControl3.
  13.     }

In the case we need a single context, we can add a property like 'Container: TCustomOpenGLControl' and set it at design time.
Title: Re: BGRA-Controls
Post by: circular on October 22, 2016, 08:04:01 pm
Yes we need a single context, so that we can draw things over other things using OpenGL. I guess we can design the controls to be within the container so that there is no need to define a property. Like you would do with a panel, except the panel is the OpenGL container.
Title: Re: BGRA-Controls
Post by: lainz on October 22, 2016, 08:57:26 pm
Got it. I will try to do something. If works you will know  :)

Edit: I have a main problem and is that the FCanvas is a private declaration, so we can't access it. So the control draws perfect at runtime but in design is just a rectangle with a red cross.
Title: Re: BGRA-Controls
Post by: circular on October 22, 2016, 10:28:36 pm
Hmmm... maybe you can create a second canvas the same way it is done in TCustomOpenGLContext.Create:
Code: Pascal  [Select][+][-]
  1. if (csDesigning in ComponentState) then begin
  2.     FMyCanvas := TControlCanvas.Create;
  3.     FMyCanvas.Control := Self;
  4.   end

Also I suppose you need to redefine the LM_PAINT handler:
Code: Pascal  [Select][+][-]
  1. procedure MyWMPaint(var Message: TLMPaint); message LM_PAINT;
Title: Re: BGRA-Controls
Post by: circular on October 23, 2016, 07:54:35 am
Another solution would be to have a container that is a sort of TPanel and that at runtime, it creates an OpenGL controlinside itself with Align:=clClient and transfers all its subcontrols into this OpenGL control. So at design time, you would not have anything to do for the regular OnPaint to be called.
Title: Re: BGRA-Controls
Post by: lainz on October 23, 2016, 01:54:30 pm
I have it working. Thanks for your help.

Try it here:
https://github.com/bgrabitmap/bgracontrolsfx

A challenge: Is possible to have the FXMaterialDesignButton at full speed when you maximize the window? Maybe I don't know how to optimize it more, maybe you can see the code and find a speed improvement.
Title: Re: BGRA-Controls
Post by: circular on October 23, 2016, 05:27:49 pm
Wonderful.  :)

About the invalidate problem, you can for example call Invalidate of the container.

It can be optimised to use OpenGL speedup. In FXDraw, the content of fx (TBGLBitmap) variable is changed each time even if the bitmap FBGRA is not updated. So image data is transmitted to video memory each time. But that's not necessary because the content does not always change.

Instead you can use TBGLBitmap only. Indeed you can draw a TBGLBitmap on a regular canvas.

Otherwise, if you would like your control to work also without the container, with the regular canvas and without OpenGL, you can continue using TBGRABitmap, but not TBGLBitmap. Only keep a texture variable. When the bitmap is changed, for example set the texture to nil, so you know you need to create it again in case you draw it in the container. The texture can be created using BGLTexture(...). At that time it will be transferred to video memory.

When computing the shadow you can use rbBox:
Code: Pascal  [Select][+][-]
  1.     BGRAReplace(FBGRAShadow, FBGRAShadow.FilterBlurRadial(FShadowSize/sqrt(2),
  2.       FShadowSize/sqrt(2), rbBox) as TBGRABitmap);  

Here attached is a patch example. Note that there may be some problems when the texture is freed, in particular if there are multiple OpenGL contexts. It would be safe to add some FXFree procedure that would be called when the context is freed. The container could call those functions. Note that the function MakeCurrent of the OpenGL context must be called to ensure the correct context is selected.

For the background gradient of the container, as OpenGL is fast for gradients, you can simply do:
Code: Pascal  [Select][+][-]
  1.   BGLCanvas.FillRectLinearColor(0,0,FXContainer1.Width,FXContainer1.Height,BGRABlack,BGRABlack,BGRAWhite,BGRAWhite);  
Title: Re: BGRA-Controls
Post by: lainz on October 23, 2016, 06:39:06 pm
Many thanks!

I've improved it a lot with two new properties. Please see the new test. So now the DoOnPaint are called only by only a control when needed, doing an improvement of speed on controls with animations (like FXMaterialDesignButton). Run the demo and click faster each control, everything will be smooth as always. Also it can be smoother defining with an external timer the refresh rate of all controls in the form. Is really fast now.
Title: Re: BGRA-Controls
Post by: circular on October 23, 2016, 07:04:05 pm
Hi!

Wait. When you set FTexture := nil in the FXDraw procedure, it means the texture will be transferred next time. But that's not necessary if the bitmap has not changed. That's why I've put it in the Draw function. Or, even better, instead of directly setting FNeedDraw to False, you can make a protected function "DiscardBitmap" that will set FNeedDraw to false and set FTexture to nil.

The "ReceivePaintFrom" will not always work. Suppose you have one button with a long animation, and then a second button with a short animation. The short animation will end before the end of the long animation. As said above, you can simply call Parent.Invalidate.
Title: Re: BGRA-Controls
Post by: lainz on October 23, 2016, 07:22:59 pm
Ok I need to fix that. The need draw is set to false only once so I'll put in there.

I need to try with invalidate.

Edit: I've applied all your suggestions and works well  :D

I've keept the "ReceivePaintFrom", but with a different use, I don't know if it's ok or not so I ask you. For example instead of using the timer inside the MaterialDesignButton or any control it will use an external timer like for a videogame, so the entire window will be redrawn in a specified interval and will not be invalidated by the controls even when there is user interaction.
Title: Re: BGRA-Controls
Post by: circular on October 23, 2016, 09:07:34 pm
You could do that, however it means it will use CPU even if nothing happens. For a game, that does not really happen because the game is always doing something, but for an interface, sometimes nothing happens.
Title: Re: BGRA-Controls
Post by: lainz on October 23, 2016, 09:11:00 pm
It's ok suppose that I want to animate the background constantly and in top of it have the ui (animated or not), instead of creating a separate control i can use the container. I will left it as an option. By default is not used and for the controls it only adds a line or two so there is no problem.
Title: Re: BGRA-Controls
Post by: circular on October 23, 2016, 09:30:13 pm
I see what you're saying. Yes indeed that's no problem.

I am a bit confused though how to use ReceivePaintFrom. If I understand what you're saying, it would be something like a boolean?
Title: Re: BGRA-Controls
Post by: lainz on October 23, 2016, 09:42:29 pm
Is like a boolean, but instead of using a boolean uses a control.

Take a look at this code, if ReceivePaintFrom is nil it will paint, since there is no control that has set the ReceivePaintFrom. In the case the ReceivePaintFrom control is set it will not call Parent.Invalidate.

With the use we well do from now is not neccessary to be a control and can be a boolean. But as is you can actually two things: if there is activated the option and wich control activated that. Also you can check if your specific control is the one that uses that setting. As I said it was prepared for the other use, but still works for the new use.

Code: Pascal  [Select][+][-]
  1. if Parent is TFXContainer then
  2.   begin
  3.     if TFXContainer(Parent).ReceivePaintFrom = nil then
  4.       Parent.Invalidate;
  5.   end
  6.   else
  7.     Invalidate;

The other property was intended for the previous use that I explained. LockReceivePaint will lock the change of the control that's actually the one that does ReceivePaintFrom. So if a control like an external timer set that property, then no other control can change that.

Changes in git: Now the controls are Hybrid, so you can put them in a form or in a FXContainer. Of course in a form will be painted in canvas and in the other case with OpenGL
Title: Re: BGRA-Controls
Post by: circular on October 23, 2016, 09:53:55 pm
Ok so a control can take control of the repaint process.  :)

What glitch?
Title: Re: BGRA-Controls
Post by: lainz on October 23, 2016, 09:57:46 pm
Ok so a control can take control of the repaint process.  :)

What glitch?

Nothing I fixed that.
Title: Re: BGRA-Controls
Post by: lainz on October 24, 2016, 01:13:50 am
Well after two days of work here it is the first release, thanks for your help!:
http://forum.lazarus-ide.org/index.php/topic,34534.0.html

For some reason AutoSize is not working inside the FXContainer at runtime, any ideas? The control is resized but not the painting. When put in a form it works..
Title: Re: BGRA-Controls
Post by: Josh on October 24, 2016, 08:22:26 am
HI
Just upgraded to 9.2.1 and bgracontrols 4.3 and have a problem on cocoa

As soon as I resize my form, all text with bclabel and bcbutton disappears.

The resize routine; adjust the controls dimensions and proportionally the font size.  The controls dimension adjusts as the borders etc are adjusting, but the text vanishes.

This is working fine with win32 LCL and carbon; bit now cocoa is not rendering the resized font. Could it be x64 related?

No errors are shown if run in console.

ANy ideas?
Title: Re: BGRA-Controls
Post by: lainz on October 24, 2016, 03:50:50 pm
Sorry I don't have a Mac to test it. BTW you can make a small demo to show the problem.
Title: Re: BGRA-Controls
Post by: Josh on October 25, 2016, 12:51:53 am
Hi

Done some further testing; the problem surfaces when you change the font that a bgra control is using.
I have uploaded a zipped version; if you change the displayed fonts to something else; then in the code of the button click change the font to another one that is on your system, you will see that in carbon and windows all behaves as it should, but when compiled for cocoa, when you change font the bgra controls no longer display text. However the standard Tlabel is adjusting and scaling.

Please excuse the rough dirty code...

Josh
box of video showing the issue as well
https://app.box.com/s/0pn5pt2wpao3qbh9b8m87c7ve54qyw20

Hope it helps
Title: Re: BGRA-Controls
Post by: lainz on October 25, 2016, 01:07:47 am
Hi, that happens only with BCButton and BCLabel or with other controls that contains text like BCImageButton, BCMaterialDesignButton?

Edit: BCImageButton changing text at runtime is not working, try with BCMaterialDesignButton.
Title: Re: BGRA-Controls
Post by: Josh on October 25, 2016, 01:16:49 am
I will have to check,
I mainly use these controls; I will try with others and report back
Title: Re: BGRA-Controls
Post by: lainz on October 25, 2016, 01:18:55 am
I will have to check,
I mainly use these controls; I will try with others and report back

BCImageButton changing text at runtime is not working, try with BCMaterialDesignButton.

Ok yes the thing is that if is not working with MaterialDesignButton I don't know how to fix it. But if is only in BCLabel and BCButton maybe we can try something since these are using a different way to draw things.
Title: Re: BGRA-Controls
Post by: Josh on October 25, 2016, 01:49:01 am
Hi

cocoa
When I add a Materialsdesignbutton, then the previous bcbutton and bclabel that scaled before now loose their text when scaled ( even before I change the font).

carbon
adding materialdesignbutton everything is scaling corectly; even after a font change.

Removing the added control and the unit for materialdesign, then under cocoa it is back to behaving as in the video.

So materialdesign makes everything worse in cocoa ( ok for carbon).

Hope that helps.

ps Took a while to find the parameters to adjust in materialsdesign; any reason for params like textsize; textfont etc.
Would not the 'standard' grouping in a font section be better?  Font.name,font.height etc.
Purely an observation.
Title: Re: BGRA-Controls
Post by: lainz on October 25, 2016, 01:58:18 am
Ok basically I can't fix it if it doesn't helps, sorry.

Yes I've used that because I didn't know how to invalidate the control when normal Font property changes, so I've coded that. The ones in BCButton and BCLabel are grouped but aren't the standard Font property too. That's because we need to invalidate under certain conditions to avoid redrawing the bitmaps to save speed, and draw them in some conditions too, so we avoid the standard things. But seems that not using the standard Font does that drawing doesn't works in cocoa as you noticed. But can be also a bug in BGRABitmap and not in bgracontrols, because as you maybe know we don't use the default drawing that comes with lazarus but we use bgrabitmap.

Maybe creating a new control that only uses bgrabitmap for the background and using the default canvas fot the text, and the default Font property will work. But is just an idea, I can't ensure that will work..
Title: Re: BGRA-Controls
Post by: circular on October 25, 2016, 11:54:52 am
A similar problem was raise by Josh about cocoa, it is related to bitmap formats, and this affects text rendering:
http://forum.lazarus-ide.org/index.php/topic,34229.msg223695.html
Title: Re: BGRA-Controls
Post by: Josh on October 25, 2016, 01:33:21 pm
Hi Circular,
This is slghtly different, I can scale a control in cocoa and all is fine; the problem is when I assign the font in code to the controls; the fonts then totally vanish.
WHen I add a materialdesign button to form then the controls do not resize at all; removing the materialdesign then I am back to the the scaling woring until I change the font.

Not sure if you have watch the vid I uploaded it shows the issue pretty well, as this has non bgra controlls, ie tabel, timage. that scale correctly when  the font s changed.

I have not used BGRABITMAP directly; so if you have a sample application I can try that does roughly what the test vid does; I will gladly try this to narrow down where the issue lies.
Title: Re: BGRA-Controls
Post by: circular on October 25, 2016, 01:38:34 pm
Oh I see what you're saying. That's a bit mysterious. What would help indeed I suppose would be to narrow it to a simpler example.

For example if you create a TBGRABitmap, set the font name and draw on it, would you get the same error?

See:
http://wiki.freepascal.org/BGRABitmap_tutorial_12
Title: Re: BGRA-Controls
Post by: Josh on October 25, 2016, 11:40:57 pm
Hi

I done some mods to the test4lcl so that when i dbl click the form it changes the font.

This works fine in carbon, but cocoa no text is displayed. ( graphics are displayed );

I added

Code: [Select]
procedure TForm1.FormDblClick(Sender: TObject);
begin
  if fnt='Eurostile' then FNT:='Gill SANS MT'
  else  if fnt='Gill SANS MT' then FNT:='Century Gothic'
  else if fnt='Century Gothic' then FNT:='Eurostile'
end;           

and also added into draw routine
Code: [Select]
procedure DrawEllipseHello(bmp: TBGRABitmap);
var br: TBGRACustomBitmap;
begin
  bmp.FontName:=fnt;   

and declared gobal var fnt:string='Eurostile';

Hope that helps; I can do a vid if you like; but its just a blank screen with gradiated form.
Title: Re: BGRA-Controls
Post by: circular on October 26, 2016, 04:51:33 pm
So does it mean that with Arial font it works and with other fonts it doesn't work?
Title: Re: BGRA-Controls
Post by: Josh on October 26, 2016, 06:00:21 pm
Hi Circular

I have tried using Arial as one of the fonts and this does not work when it is assigned in the control, if you leave out the font definition then it will scale correctly, as soon as you explicitly set the font name; then nothing renders.
With lcl controls like tlabel etcl these scale and change font correctly in cocoa.

It appears as though ant change of the Font Name causes a problem; not sure whether BGRABITMAO is changing the font name in any way ie chaninging its case; as cocoa requires the Font case to be 100% correct.

Not sure if any of that helps.
Title: Re: BGRA-Controls
Post by: lainz on October 26, 2016, 07:46:57 pm
What if you change Bitmap.Canvas.Font and draw text with that canvas, not using BGRABitmap direct text functions?
Title: Re: BGRA-Controls
Post by: Josh on October 26, 2016, 08:39:36 pm
Hi Lainz,

I can try that later.

I have been trying some other components.

TPanel caption is also not showing in cocoa, so I will report this as another cocoa bug, and see if I get response.

Josh
Title: Re: BGRA-Controls
Post by: lainz on October 28, 2016, 03:23:01 am
Hope you can solve it. Bug tracker can be slow sometimes. Some bugs I reported years ago are not solved today.
Title: Re: BGRA-Controls
Post by: lainz on November 04, 2016, 10:05:40 pm
BGRA Controls v4.3.1.1:

Added Paper ListBox test
Added External JSON for OPM
Removed fpGUI test
Added description in lpk
Some test fixes
Title: Re: BGRA Controls v4.3.1.1
Post by: lainz on January 01, 2017, 12:06:55 pm
New website, automatically made with GitHub Pages:
https://bgrabitmap.github.io/bgracontrols/
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on January 03, 2017, 11:43:07 pm
BGRA Controls v4.3.1.2:

* Added BCPaperPanel
* Added BCListBox
* Added BCPaperListBox

Now the Paper ListBox is a real control. The only thing left is to use the streaming of the listbox inside the PaperPanel. Currently you can only access the ListBox by code.
Title: Re: BGRA Controls v4.3.1.2
Post by: Paul_ on March 28, 2017, 08:19:23 pm
Hello,

When I click in Style manager on the styles what I created it always crashes with "Read error" and 2x "Access violation".
Styles are created on the fly from components what i design previously. After saving it crashes also. So it can't make a preview?

Windows 10, Lazarus 1.6.4 32bit, BGRAControls lastest version

Some advice? :)

Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on April 03, 2017, 03:07:24 pm
Hi, sorry for the delay, only 2 of all these styles are broken. These are just text files, and seems that you have invalid properties inside.

Launcher_Button and Settings_Button are broken, the other styles you made are working fine.

Maybe an advice is to save them only from the object inspector, and not from code. If you created them from code, load them from code also.

Or seems that these contains parents properties or something like that that's not supported.
Title: Re: BGRA Controls v4.3.1.2
Post by: Paul_ on April 25, 2017, 04:28:49 pm
Thanks for answer, I made special form for styles from which is saving working.

Problem is that style contains lot of things instead of graphic design only. It's also breaking anchors and so.

But anyway, thanks for great stuff :)

Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on April 25, 2017, 05:35:30 pm
How you saved it? From the object inspector or from code?

I'm not the author of that control BTW, I just contributed some code on it. These properties should not be stored I think..
Title: Re: BGRA Controls v4.3.1.2
Post by: Paul_ on April 25, 2017, 08:47:28 pm
I tried:
1) Select  button on the form + rightclick/Assign style/Create new style from.. 
2) Select  button on the form + in Object inspector/AssignStyle property/Create new style from .. 

Both have same problems.
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on April 25, 2017, 09:19:46 pm
I tried:
1) Select  button on the form + rightclick/Assign style/Create new style from.. 
2) Select  button on the form + in Object inspector/AssignStyle property/Create new style from .. 

Both have same problems.

Ok. I'm not sure if it's ok to touch that code BTW..

But I can tell from the code I wrote. You can use:
Code: Pascal  [Select][+][-]
  1. { Save all published settings to file }
  2.     procedure SaveToFile(AFileName: string);
  3.     { Load and assign all published settings from file }
  4.     procedure LoadFromFile(AFileName: string);
  5.     { Assign the properties from AFileName to this instance }
  6.     procedure AssignFromFile(AFileName: string);

SaveToFile... this stores all properties, like saving a new theme does
LoadFromFile... this is like loading entirely all settings
AssignFromFile... this is what you want, it apply only the style related stuff

but i not tested in the case you say, may work or have the same bug as the other.

another way is style only one button and call assign from another control that needs the same style.

i know is not the best solution, i'm not working on this from a lot of months
Title: Re: BGRA Controls v4.3.1.2
Post by: MISV on May 22, 2017, 05:54:33 pm
Sorry for crashing this thread.

These controls - is there any way to use this for skinning without you have to remove all your old controls and place the new ones. Is there some way these controls can be applied runtime upon startup?

Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on May 25, 2017, 12:25:02 am
Sorry for crashing this thread.

These controls - is there any way to use this for skinning without you have to remove all your old controls and place the new ones. Is there some way these controls can be applied runtime upon startup?

There's no way since these are not compatible property by property-
Title: Re: BGRA Controls v4.3.1.2
Post by: Paul_ on May 25, 2017, 01:23:17 am
Probably not all, but you can try this: in Object Inspector select component / right click / change class

It's working e.g. for TButton / TBCButton, labels etc. I changed maybe 20 components and  got no error and app was working correctly.

Title: Re: BGRA Controls v4.3.1.2
Post by: MISV on May 25, 2017, 07:15:16 pm
But if you check this help page it states
http://wiki.freepascal.org/Lazarus_Custom_Drawn_Controls (http://wiki.freepascal.org/Lazarus_Custom_Drawn_Controls)

Quote
Imitates the Windows 7 look, and also can be used to imitate Windows XP and Windows 8 look, and most msstyles or Windows skins. Currently is available only with BGRABitmap graphic library, and you can get this drawer in the BGRAControls package: BGRAControls
You can try to get this working if you convert the slicescaling.pas unit. The technique used to draw the images is 9-slice scaling.
Some working code to create 9-slice scaling is available here: http://sourceforge.net/p/bmpthemeutils/home/Home/

So BGRAControls seems to contain an import drawer for LCL-cusomdraw - one where I somehow (not specified in help how, but possibly obvious when you get started using dsWindows7) even can select another substyle of dsWindows7 (i.e. the drawer supports win8 look and various ms styles as well)

Is this just like a "bonus" or is there some kind of correlation between LCL-customdraw and BGRAControls?

i.e. if I can experiment drawing my app on Win+Mac in unspecified microsoft styles hat sounds pretty close to perfect skinning.
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on May 25, 2017, 10:22:11 pm
Is everything in the demo. The code is simple to read also.

It works with bitmaps like normal Windows themes does. A bitmap contains the style for the control. If you change the bitmaps, you change the look of the control.

Currently a theme is stored in a zip file, that's loaded and theme applied.
Title: Re: BGRA Controls v4.3.1.2
Post by: MISV on May 26, 2017, 04:48:39 pm
Great - then it sounds like Lazarus actually supports a very powerful skinning and styling solution :)
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on May 26, 2017, 07:34:31 pm
Great - then it sounds like Lazarus actually supports a very powerful skinning and styling solution :)

Try it then tell us how works for you.

I did my best on it.
Title: Re: BGRA Controls v4.3.1.2
Post by: jc99 on May 27, 2017, 12:45:44 am
Hi, i just wanted to add the running-Lazarus-Cheeta (the logo.gif), an an animation, is there an easy way to add an Animated-gif ? e.G. in a TBGRASpriteAnimation ?
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on May 27, 2017, 01:06:54 am
Hi, i just wanted to add the running-Lazarus-Cheeta (the logo.gif), an an animation, is there an easy way to add an Animated-gif ? e.G. in a TBGRASpriteAnimation ?

TBGRASpriteAnimation

try this:

Code: Pascal  [Select][+][-]
  1. procedure AnimatedGifToSprite(Filename: string);

or if you store it as a resource call this:

Code: Pascal  [Select][+][-]
  1. LoadFromResourceName(Instance: THandle; const ResName: string);
Title: Re: BGRA Controls v4.3.1.2
Post by: Paul_ on May 28, 2017, 08:29:16 pm
There is one a little bit annoying thing, when you doubleclick BCButton component on form it launches Style manager instead of OnClick property like TButton.
Title: Re: BGRA Controls v4.3.1.2
Post by: MISV on June 05, 2017, 03:01:56 pm
Great - then it sounds like Lazarus actually supports a very powerful skinning and styling solution :)

Try it then tell us how works for you.

I did my best on it.

Will do - returning to it now.
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on June 05, 2017, 03:30:01 pm
Great - then it sounds like Lazarus actually supports a very powerful skinning and styling solution :)

Try it then tell us how works for you.

I did my best on it.

Will do - returning to it now.

Notice that's purely a skin, if you need to improve behaviour you need to modify Custom Drawn, not BGRAControls.
Title: Re: BGRA Controls v4.3.1.2
Post by: MISV on June 05, 2017, 03:47:22 pm
I very happy if controls/forms can get painted differently.

I am aiming for my software to have same look across platform - and preferably slightly unique look.

For now I reported a bug in Lazarus customdraw 1.6.4/Windows that prevents me from compiling
https://bugs.freepascal.org/view.php?id=31968

But installing your BGRA packages went well - will hopefully get around to testing later today :)

Title: Re: BGRA Controls v4.3.1.2
Post by: Awesome Programmer on June 08, 2017, 03:42:17 pm
 :D Let me start by saying that whoever came up with the idea of writing and developing BGRA components is a GENIUS. I love all the components in BGRA. Thank you. In fact, I am able to use one of your component, BGRA Sprite animation successfully in my program. However, I am trying to use one of the other components in the BGRA tabs but not successful namely TBCButton.

What I am simply trying to do is incorporate TBCButton and enable its 3D polished and glossy look but running into problem. I can easily setup its skin during design time through style manager by double-clicking on button. However, I want to be able to do this while runtime programmatically or with my code, but I searched and searched for an answer there is seem to none. I selected the TBCButton and looked in its object inspector. It has style properties but only with two different options - bbtbutton and bbtdropdown.

So, how do you programmatically change the skin of the TBCButton? or Can you? If you can, could you please show me a sample code. Thank you.

I did ask a question related to this issue in the general section and got no reply. Here is the link to that question, which also has images attached to it. https://forum.lazarus.freepascal.org/index.php/topic,37108.msg248335.html#msg248335
Title: Re: BGRA Controls v4.3.1.2
Post by: lainz on June 08, 2017, 03:53:18 pm
You can, check the demos, at least are two demos showing this how to.
Title: Re: BGRA Controls v4.3.2
Post by: lainz on August 18, 2017, 04:27:35 pm
BGRAControls v4.3.2.0
https://github.com/bgrabitmap/bgracontrols/releases

- PreserveGlyphOnAssign added, by default is on and prevents the glyph being replaced in any Assign call.
- BCImageButton toggle functionality: Now you can use it as 'toggle' button, and get/set pressed state.
- Using .lrs instead of .rc (bcpaperlistbox)
- published Constraints in bcbutton
- Added LoadFromBitmapResource overloaded method with less parameters
- Improved BCPaperListBox, now it has a property editor.

Notice the change on Assign, if this breaks your current code, just toggle PreserveGlyphOnAssign off in the object inspector.
Title: Re: BGRA Controls v4.3.2
Post by: Josh on September 15, 2017, 03:09:45 pm
Hi
I am having a problem where BCLabel and BCButton is not displaying Russian, all I get is [][][][]....
A standard TLabel is displaying correctly when I select Eurostile or Gill San Font ( these are the 2 main ones I use), when i change fontex to same font; i get the above.

Title: Re: BGRA Controls v4.3.2
Post by: lainz on September 15, 2017, 07:39:27 pm
Hi
I am having a problem where BCLabel and BCButton is not displaying Russian, all I get is [][][][]....
A standard TLabel is displaying correctly when I select Eurostile or Gill San Font ( these are the 2 main ones I use), when i change fontex to same font; i get the above.

Hi, that happens, for example, with TBCImageButton also?

Remember we're using BGRABitmap, maybe you can test this:
- Add a BGRAVirtualScreen
- Add OnRedraw event
- Write something with that font in that event, so we can see if BGRABitmap library can use that kind of fonts. If yes the problem is in the controls, if not the problem is with BGRABitmap.
Title: Re: BGRA Controls v4.3.2
Post by: Josh on September 15, 2017, 08:44:13 pm
Hi Lainz,

Done some testing with other bgracontrols

Image attached
BCLabel
BCMaterialsDesignButton
BCImageButton.

So far BCImage Button is the only one which is showing the font and language correctly.
Title: Re: BGRA Controls v4.3.2
Post by: lainz on September 16, 2017, 12:37:00 am
Hi Lainz,

Done some testing with other bgracontrols

Image attached
BCLabel
BCMaterialsDesignButton
BCImageButton.

So far BCImage Button is the only one which is showing the font and language correctly.

Ok. That's strange, I did BCImageButton and BCMaterialDesignButton, and one works and the other doesn't works  :o
Sure is the text drawing function we're using, one different for each control.
Title: Re: BGRA Controls v4.3.2
Post by: Josh on September 27, 2017, 11:44:52 pm
Hi Lainz,

ANy update on thie issue, or were you waiting for some tests from me?

Josh
Title: Re: BGRA Controls v4.3.2
Post by: lainz on October 01, 2017, 04:09:03 pm
Hi Lainz,

ANy update on thie issue, or were you waiting for some tests from me?

Josh

Sorry I forget. I will report it in GitHub of BGRABitmap so if Circular has some free time can investigate this.

https://github.com/bgrabitmap/bgrabitmap/issues/11

Is sure about two different methods of drawing text, I can do nothing by myself to solve this.
Title: Re: BGRA Controls v4.3.2
Post by: Josh on October 20, 2017, 02:37:02 am
unfortunatley I do not get much spare time to check forum for updates.
i assume this issue is still pending?
Title: Re: BGRA Controls v4.3.2
Post by: mtron on November 28, 2017, 08:59:22 pm
Hi friends,

Hopefully, this is correct forum thread ...

I am experimenting with BGRA Controls on a Mac with High Sierra and high-dpi (retina) screen. It looks like BGRA Controls on a Mac are not yet dpi aware. Is that expected behaviour at this time?

Using it with Lazarus 1.8RC5, installed BGRA Controls from Lazarus Online Package Manager, which states BGRA Controls "4.3.2.0 Up to date".

Attaching screenshots illustrating problem, during the design time, running as Carbon, running as Cocoa/64bit: regular LCL TButton, TLabel are rendered properly, however TBCButton and TBCLabel are not.

Hope somebody can point me to the right direction, thanks in advance!
Title: Re: BGRA Controls v4.3.2
Post by: lainz on November 28, 2017, 10:08:42 pm
Hi, and what happens for example when you draw something OnPaint event of form, is also blurry?

The same happens on Windows when you set High DPI, you need to change the manifest of your application to enable High DPI in the entire form.

Seems that Mac doesn't know that these controls can be scaled properly, instead of trying to change it's width and height, it just scales the original bitmap.

There must be a setting to handle properly High DPI on mac.

Else *any* not just bgracontrols, any custom control will get blurry.

Information:
https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012302
Title: Re: BGRA Controls v4.3.2
Post by: lainz on November 28, 2017, 11:53:25 pm
With esvignolo found that BGRABitmap is the problem
https://github.com/bgrabitmap/bgrabitmap/issues/13

I can do nothing for fixing it, I just reported that bug.
Title: Re: BGRA Controls v4.3.2
Post by: mtron on November 29, 2017, 06:06:38 pm
Hi lainz,

Thanks for confirming and reporting the issue on GitHub!
Title: Re: BGRA Controls v4.3.2
Post by: lainz on November 29, 2017, 08:22:13 pm
Hi lainz,

Thanks for confirming and reporting the issue on GitHub!

No problem.

I've added a new control called ColorSpeedButton in BGRAControls. It uses BGRABitmap only for the Glyph on Linux. For all the drawings it uses normal Canvas, that works fine on retina display.

It has only a border and a body color, but is something you can use, not to replace all stuff that is handled in BCButton, but is fast and nice.
Title: Re: BGRA Controls v4.3.2
Post by: mtron on November 30, 2017, 06:36:14 am

I've added a new control called ColorSpeedButton in BGRAControls. It uses BGRABitmap only for the Glyph on Linux. For all the drawings it uses normal Canvas, that works fine on retina display.

It has only a border and a body color, but is something you can use, not to replace all stuff that is handled in BCButton, but is fast and nice.

Excellent, works great! Attaching screenshot from Cocoa 64 sample.

Huge thanks!
Title: Re: BGRA Controls v4.3.3.1
Post by: lainz on November 30, 2017, 03:18:00 pm
Thanks for testing. Tested on all desktop platforms by now.
Title: Re: BGRA Controls v4.4
Post by: lainz on December 13, 2017, 10:35:53 pm
BGRAControls 4.4
Since v4.4 the components TBCDefaultThemeManager, TBCKeyboard and TBCNumericKeyboard are not installed by default to allow Linux users to get a seamless installation with the Online Package Manager not installing third party stuff. If you want these components turn on the "Register unit" in the package options for each file (bcdefaulthememanager.pas, bckeyboard.pas, bcnumerickeyboard.pas) then compile and rebuild Lazarus. On Linux you need to install libxtst-dev and libgl-dev first.
Title: Re: BGRA Controls v4.4
Post by: lainz on December 19, 2017, 12:08:34 am
Hi, I decided that instead of making a new set of components I will keep updating BGRAControls, I need your support in Patreon!
https://www.patreon.com/lainz

Keep coding with BGRAControls, I will add all the new stuff and exclusive packages in Patreon.

Lainz.
Title: Re: BGRA Controls v4.4
Post by: Paul_ on December 19, 2017, 01:13:59 am
Ok, I send some support (2 months) because I'm using it BGRABitmap and Controls long time.


Title: Re: BGRA Controls v4.4
Post by: lainz on December 19, 2017, 01:30:12 am
Ok, I send some support (2 months) because I'm using it BGRABitmap and Controls long time.

Many thanks =)
Title: Re: BGRA Controls v4.4
Post by: seliman on December 19, 2017, 08:07:08 pm
Hi , my name is Ramiro ,

I want install package BGRA Control v4.4 , and found one error , please can you help me ??


This is error

lazarus 1.8

bcbutton.pas(407,4) Fatal: Cannot open include file "icons\bcbutton_icon.lrs"

Thanks in advance

Sorry my english
Title: Re: BGRA Controls v4.4
Post by: lainz on December 19, 2017, 08:30:29 pm
Hi , my name is Ramiro ,

I want install package BGRA Control v4.4 , and found one error , please can you help me ??


This is error

lazarus 1.8

bcbutton.pas(407,4) Fatal: Cannot open include file "icons\bcbutton_icon.lrs"

Thanks in advance

Sorry my english

Hi, try using Online Package Manager to get BGRABitmap and BGRAControls.
Title: Re: BGRA Controls v4.4
Post by: seliman on December 19, 2017, 11:21:49 pm
Hi , my name is Ramiro ,

I want install package BGRA Control v4.4 , and found one error , please can you help me ??


This is error

lazarus 1.8

bcbutton.pas(407,4) Fatal: Cannot open include file "icons\bcbutton_icon.lrs"

Thanks in advance

Sorry my english

Hi, try using Online Package Manager to get BGRABitmap and BGRAControls.



Hi Lainz , yes I m to probe with Online Manager , but is the same error , I don t Know what make it  , the bcbutton_icon.lrs  is in your directory , but is not read , I m looking in google and not found nothing

Thanks in advance
Title: Re: BGRA Controls v4.4
Post by: lainz on December 19, 2017, 11:29:17 pm
Hi again.. What's your OS and your Lazarus version?
Title: Re: BGRA Controls v4.4
Post by: seliman on December 20, 2017, 12:35:57 am
Hi again.. What's your OS and your Lazarus version?


Hi , thanks for you response , my OS is w7 64 bits , lazarus is 1,8 new installation 32 bits (lazarus-1.8.0-fpc-3.0.4-win32.exe) , this package is the only whats have one error ,I dont know whats happened

Thanks
Title: Re: BGRA Controls v4.4
Post by: lainz on December 20, 2017, 01:36:47 am
Hi again.. What's your OS and your Lazarus version?


Hi , thanks for you response , my OS is w7 64 bits , lazarus is 1,8 new installation 32 bits (lazarus-1.8.0-fpc-3.0.4-win32.exe) , this package is the only whats have one error ,I dont know whats happened

Thanks

Estoy instalando esa versión de Lazarus para probarlo. Pero tengo Windows 10 y el antivirus de Windows. Eso tambien puede ser que afecte, igualmente lo pruebo.

Edito: Instale la misma versión de Lazarus 1.8 32bit Windows, instale Online Package Manager de la carpeta de componentes y después instale BGRABitmap y BGRAControls, se puede instalar sin problemas.

Quizas hay algo con tu instalación o quizás tengas algún otro programa que hace conflicto con el programa que compila los recursos?

Antivirus?
Title: Re: BGRA Controls v4.4
Post by: seliman on December 20, 2017, 02:06:00 am
Hi again.. What's your OS and your Lazarus version?


Hi , thanks for you response , my OS is w7 64 bits , lazarus is 1,8 new installation 32 bits (lazarus-1.8.0-fpc-3.0.4-win32.exe) , this package is the only whats have one error ,I dont know whats happened

Thanks

Estoy instalando esa versión de Lazarus para probarlo. Pero tengo Windows 10 y el antivirus de Windows. Eso tambien puede ser que afecte, igualmente lo pruebo.

Edito: Instale la misma versión de Lazarus 1.8 32bit Windows, instale Online Package Manager de la carpeta de componentes y después instale BGRABitmap y BGRAControls, se puede instalar sin problemas.

Quizas hay algo con tu instalación o quizás tengas algún otro programa que hace conflicto con el programa que compila los recursos?

Antivirus?


Mil Gracias .... ahora pruebo y te aviso si lo soluciono ....muchisimas gracias
Title: Re: BGRA Controls v4.4
Post by: seliman on December 20, 2017, 07:51:37 pm
Hi again.. What's your OS and your Lazarus version?


Hi , thanks for you response , my OS is w7 64 bits , lazarus is 1,8 new installation 32 bits (lazarus-1.8.0-fpc-3.0.4-win32.exe) , this package is the only whats have one error ,I dont know whats happened

Thanks

Estoy instalando esa versión de Lazarus para probarlo. Pero tengo Windows 10 y el antivirus de Windows. Eso tambien puede ser que afecte, igualmente lo pruebo.

Edito: Instale la misma versión de Lazarus 1.8 32bit Windows, instale Online Package Manager de la carpeta de componentes y después instale BGRABitmap y BGRAControls, se puede instalar sin problemas.

Quizas hay algo con tu instalación o quizás tengas algún otro programa que hace conflicto con el programa que compila los recursos?

Antivirus?

Hola Lainz , recien termino de poner en condiciones mi maquina ...al fin pude instalar sin problemas todo ...no se que habra pasado pero ahora anda todo

Mil gracias por tu apoyo ...y consejos

Muchisimas gracias


Saludos
Title: Re: BGRA Controls v4.4
Post by: lainz on December 22, 2017, 04:40:49 pm
Hola Lainz , recien termino de poner en condiciones mi maquina ...al fin pude instalar sin problemas todo ...no se que habra pasado pero ahora anda todo

Mil gracias por tu apoyo ...y consejos

Muchisimas gracias


Saludos

De nada.

-----------------

BGRAControls 4.4.0.2

* In GitHub I've added TBCSVGViewer, a work in progress visual component to load and show SVG files, it uses of course BGRABitmap capability of loading SVG, that's actually beign improved, is not perfect right now so if your SVG is not loading well just wait.

* New package icons
Title: Re: BGRA Controls v4.4.0.2
Post by: six1 on January 03, 2018, 10:43:17 am
Hi lainz,
first let me thank you for your great work on BGRA.

I've been using BCRadialProgressBar in one of my Projects.
It's ok so far, but LineWidth from Arc is fix at Object "Width / 50".
I've modified the Component for publishing LineWidth.
Would be great, if you will change it in official download.

Atached the fork of BCRadialProgressBar with changable LineWidth

Best, Michael
Title: Re: BGRA Controls v4.4.0.2
Post by: Thaddy on January 03, 2018, 11:48:45 am
I did not look at the code yet, but: "Width / 50"?
I would expect "Width div 50"......
Title: Re: BGRA Controls v4.4.0.2
Post by: six1 on January 03, 2018, 11:58:24 am
...
it isn't width, it is height  ::) my fault...

FBitmap.Canvas2D.lineWidth := Height / 50;

Edit:
But you're right... maybe lineWidth accepts float  ::) and truncate value... who knows, but compiler doesn't throw error.

This is correct, because DIV returns INT Value of divide:
FBitmap.Canvas2D.lineWidth := Height DIV 50;


FBitmap.Canvas2D.lineWidth is type single... so all right

best, Michael   
Title: Re: BGRA Controls v4.4.0.2
Post by: lainz on January 03, 2018, 12:20:37 pm
In fact the line width is Height / 50 because it's a single value not int. So it scales properly with the height, that's the metric I use to determine the size of the circle.

You published that as int or single?

And you must add something like when LineWidth = 0 draw the older way, to keep it compatible with old behaviour, that's the line shriks or grows with the height of the control.

I will try to add that when I finish my work today.
Title: Re: BGRA Controls v4.4.0.2
Post by: six1 on January 03, 2018, 01:01:42 pm
Hi lainz,
i changed LineWidth to single.
If LineWidth Property is set to 0, then LineWidth is calculated as before (Height / 50)
in all other cases LineWidth is used to set Canvas2D.lineWidth

I corrected above Appendix...

best, Michael
Title: Re: BGRA Controls v4.4.0.2
Post by: lainz on January 03, 2018, 04:56:08 pm
Thanks, tested and working well, I've commited that on Git.
Title: Re: BGRA Controls v4.4.0.2
Post by: six1 on January 03, 2018, 04:59:10 pm
Thank you lainz!

It's a big help for me, if i had to reinstall Lazarus on new Versions...


Best, Michael
Title: Re: BGRA Controls v4.4.0.2
Post by: lainz on January 12, 2018, 07:13:42 pm
Now on Git: you can try the new SVG Viewer improved by @circular. Stretch, align and proportional settings added.

You can download it with dev-bgrabitmap and dev-bgracontrols branches for now, until it get released.
Title: Re: BGRA Controls v4.4.0.3
Post by: lainz on January 19, 2018, 02:48:35 pm
BGRAControls 4.4.0.3
- Added Toggle option in TColorSpeedButton
Title: Re: BGRA Controls v4.5
Post by: lainz on January 20, 2018, 03:30:12 pm
BGRAControls v4.5
- Improvements to SVG Viewer by @circular17
- New SVG Viewer test project

Notice that you need BGRABitmap 9.6
Title: Re: BGRA Controls v4.5
Post by: Phoenix on January 20, 2018, 04:53:02 pm
Thanks for this new release !!!  :D
Title: Re: BGRA Controls v4.5
Post by: Paul_ on January 21, 2018, 09:54:37 pm
Code: Pascal  [Select][+][-]
  1. procedure TForm1.BGRASpeedButton1DblClick(Sender: TObject);
  2. begin
  3.   if colordialog1.Execute then
  4.     ChangeToolColor( colordialog1.Color );
  5. end;  
  6.  

BGRASpeedButton have doubleclick event but it looks like it's not working.
Title: Re: BGRA Controls v4.5
Post by: lainz on January 21, 2018, 10:55:16 pm
Code: Pascal  [Select][+][-]
  1. procedure TForm1.BGRASpeedButton1DblClick(Sender: TObject);
  2. begin
  3.   if colordialog1.Execute then
  4.     ChangeToolColor( colordialog1.Color );
  5. end;  
  6.  

BGRASpeedButton have doubleclick event but it looks like it's not working.

I can do nothing, that is a bug in TSpeedButton, TBGRASpeedButton only changes the glyph. Report the bug for TSpeedButton in the bugtracker.
Title: Re: BGRA Controls v4.5
Post by: Paul_ on January 22, 2018, 12:15:15 am
Ok thanks.

I found thats standard behavior for some reason. And with groupindex > 0 it's ok.

Title: Re: BGRA Controls v4.5
Post by: tr_escape on January 24, 2018, 09:58:25 am
Hello,

I am trying to left menu with bgracontrols and I have a question about button text style.

Is it possible to use button's text style as Tpanel's text style?

I mean bgracontrols has centered text style but I need left , right and of course center too.

In attach you can see what I mean.
Title: Re: BGRA Controls v4.5
Post by: lainz on January 24, 2018, 12:15:49 pm
Hello,

I am trying to left menu with bgracontrols and I have a question about button text style.

Is it possible to use button's text style as Tpanel's text style?

I mean bgracontrols has centered text style but I need left , right and of course center too.

In attach you can see what I mean.

BCButton1.StateNormal.FontEx.TextAlignment := bcaLeftCenter;

There are more states: StateClicked and StateHover. And more alignments for text.
Title: Re: BGRA Controls v4.3.2
Post by: lainz on February 06, 2018, 11:59:48 pm
Hi
I am having a problem where BCLabel and BCButton is not displaying Russian, all I get is [][][][]....
A standard TLabel is displaying correctly when I select Eurostile or Gill San Font ( these are the 2 main ones I use), when i change fontex to same font; i get the above.

Hi Josh, seems that this was a Lazarus bug fixed in 1.8, can you confirm?
Title: Re: BGRA Controls v4.5
Post by: Josh on February 07, 2018, 12:20:23 am
Hi Lainz,

I do not have a 1.8 installed on this machine, I have the lateset Trunk (laz and FPC) updated this morning.

Unfortunately the problem is still there, image attached.


I can try on 1.8 probably tomorrow.

Title: Re: BGRA Controls v4.5
Post by: Josh on February 07, 2018, 12:25:01 am
Just tested on mac mini that has 1.8 installed, and the issue is still there.

The Russian shows when the default font is used, but when font name is changed to Eurostile then i get the boxes.
Using standard TLabel, Tmemo, etc then the russian is displayed ok when font is changed to Eurostile.

Hope it helps
Title: Re: BGRA Controls v4.5
Post by: lainz on February 07, 2018, 12:36:00 am
Just tested on mac mini that has 1.8 installed, and the issue is still there.

The Russian shows when the default font is used, but when font name is changed to Eurostile then i get the boxes.
Using standard TLabel, Tmemo, etc then the russian is displayed ok when font is changed to Eurostile.

Hope it helps

Ok thanks.
Title: Re: BGRA Controls v4.5
Post by: Josh on February 07, 2018, 01:16:21 am
The Odd thing is that it is not all fonts

See pic using century gothic font all is ok.

But using the ones that fail causes a problem as the fonts display ok with standard controls and textout routines.
Title: Re: BGRA Controls v4.5
Post by: lainz on February 07, 2018, 11:06:31 pm
Hi josh, the bug in GitHub was closed as can't fix, @circular says he can do nothing to fix this.  :(
Title: Re: BGRA Controls v4.5
Post by: Josh on February 08, 2018, 12:33:36 am
Hi Lainz,

Thanks for getting Back to me, not the answer I was hoping for.

I will have to experiment with other Graphics Libraries to see if they display unicode text correctly with installed fonts, and possibly overtime refrain from using bgrabitmap and bgracontrols.

A shame as its a very good library.
Title: Re: BGRA Controls v4.5
Post by: lainz on February 08, 2018, 02:05:16 am
Hi, josh, the problem is on Lazarus TCanvas, try drawing unicode text on a TCanvas, it doesn't display well also. BGRABitmap uses LCL for drawing text, not his own way.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormPaint(Sender: TObject);
  2. begin
  3.   Canvas.Font.Name:='Eurostile LT Std';
  4.   Canvas.TextOut(0, 0, 'TextRect: ƉҼИ');
  5. end;  
       

The thing is that LCL controls does not use canvas, but the system drawing for text, because that you see the unicode text on these. But not if you make, for example, a custom control with canvas drawing for text.

So, in fact, we can't fix it if that is not fixed on Lazarus first.
Title: Re: BGRA Controls v4.5
Post by: engkin on February 08, 2018, 03:12:15 am
The Odd thing is that it is not all fonts

See pic using century gothic font all is ok.
I guess the fonts that work have the needed glyphs. Check the fonts that don't work, do they have the missing glyphs?

For instance, on my system using charmap (Unicode Subrange - Cyrillic) Century Gothic has Cyrillic glyphs. While Eurostile does not.

So, in fact, we can't fix it if that is not fixed on Lazarus first.
There is nothing to fix, if the font does not include needed glyphs.
Title: Re: BGRA Controls v4.5
Post by: Josh on February 08, 2018, 11:40:00 am
Hi

The fonts that I use, work fine on other components and also when used within all other applications, like word, libreoffice, excel etc.

I quick video done showing the issue with other control I have been testing.

This is as Lainz has said not just BGAControls but effects half of the 3rd party controls I have tested.

Title: Re: BGRA Controls v4.5
Post by: lainz on February 08, 2018, 12:51:05 pm
So, in fact, we can't fix it if that is not fixed on Lazarus first.
There is nothing to fix, if the font does not include needed glyphs.

Yes, but as I can see, the system when draws text uses a fallback font if the font you provide does not have the glyphs. That's the reason why TLabel and TButton works fine.

But Canvas uses also the OS implementation, is not a custom canvas for the LCL, so there is nothing to fix, you're right.
Title: Re: BGRA Controls v4.5
Post by: Josh on February 08, 2018, 05:56:06 pm
Hi Lainz.

Just done another fresh install of Trunk on Windows SVN57273 and getting a probloem trying to install latest bgracontrols.

Downloaded and installed bgrabitmap 9.6.1 all ok, and appear in list of packages.
Downloaded bgracontrols 4.5 and when I try to install package I get.
Code: [Select]
bcimagebutton.pas(48,32) Fatal: Cannot find BGRASliceScaling used by BCImageButton, incompatible ppu=C:\Components\bgrabitmap-9.6.1\bgrabitmap\lib\i386-win32\3.1.1\bgraslicescaling.ppu, package BGRABitmapPack

Has something changed with the installation ?
Title: Re: BGRA Controls v4.5
Post by: lainz on February 08, 2018, 06:34:02 pm
Hi Lainz.

Just done another fresh install of Trunk on Windows SVN57273 and getting a probloem trying to install latest bgracontrols.

Downloaded and installed bgrabitmap 9.6.1 all ok, and appear in list of packages.
Downloaded bgracontrols 4.5 and when I try to install package I get.
Code: [Select]
bcimagebutton.pas(48,32) Fatal: Cannot find BGRASliceScaling used by BCImageButton, incompatible ppu=C:\Components\bgrabitmap-9.6.1\bgrabitmap\lib\i386-win32\3.1.1\bgraslicescaling.ppu, package BGRABitmapPack

Has something changed with the installation ?

Something changed in Lazarus, exactly TImageList and that is causing problems with the installation.

But, there is another problem with your installation, I don't know. Try deleting bgracontrols and removing it complete first from lazarus. Then redonwnload and reinstall.
Title: Re: BGRA Controls v4.5
Post by: Josh on February 08, 2018, 06:57:18 pm
Hi

I have removed Lazarus completely, re-insatlled latest trunk, download latest 9.6.1 installed, re-downloaded bgracontrol 4.5 and am getting the same error.

I think the lates trunk from the last few days is causing issues, with lazarus, as when you install a component the ide rebuilds, but when lazarus auto-starts it does not open as normal, you have to click the icon in the task bar to see it.  Even tools build  lazarus exhibits the same behaviour

Title: Re: BGRA Controls v4.5
Post by: engkin on February 08, 2018, 09:23:51 pm
Yes, but as I can see, the system when draws text uses a fallback font if the font you provide does not have the glyphs. That's the reason why TLabel and TButton works fine.

On Windows, TextOutW (and its variations) uses the supplied font, while DrawTextW does font substitution for missing glyphs.
Title: Re: BGRA Controls v4.5
Post by: lainz on February 08, 2018, 10:13:46 pm
Yes, but as I can see, the system when draws text uses a fallback font if the font you provide does not have the glyphs. That's the reason why TLabel and TButton works fine.

On Windows, TextOutW (and its variations) uses the supplied font, while DrawTextW does font substitution for missing glyphs.

Thanks, I will report in the BGRABitmap bug page.

Hi

I have removed Lazarus completely, re-insatlled latest trunk, download latest 9.6.1 installed, re-downloaded bgracontrol 4.5 and am getting the same error.

I think the lates trunk from the last few days is causing issues, with lazarus, as when you install a component the ide rebuilds, but when lazarus auto-starts it does not open as normal, you have to click the icon in the task bar to see it.  Even tools build  lazarus exhibits the same behaviour



Try with Online Package Manager.
Title: Re: BGRA Controls v4.5
Post by: Josh on February 08, 2018, 10:36:46 pm
Hi

I managed to get it to finally install, for some reason I had to install BGABitmap and BGRACOntrols in the same session before a rebuild of IDE, previously I installed bgrabitmap then my own components (that use bgrabitmap); then rebuilt the ide, then tried bgracontrols which failed. So something is odd in trunk.

Unfortunatly I do not use OPM, as I find that it oftens leaves multiple mis-installed components, ie if a component failed to install I have to go manually into packaged installed packages and remove them, its as though OPM is updating component list even if it fails to install them. Also I prefer to have my own set of used components with known versions that work, across different pc and platforms. I have used it though to get some latest components but do not install them from OPM, I just use OPM to download them and then I move them to my component folder.  This is not negative of OPM as I think it is a very good utility to get access to components, and I do use it but not in its 'intended way'. :)
Title: Re: BGRA Controls v4.5
Post by: lainz on February 08, 2018, 10:38:35 pm
Hi

I managed to get it to finally install, for some reason I had to install BGABitmap and BGRACOntrols in the same session before a rebuild of IDE, previously I installed bgrabitmap then my own components (that use bgrabitmap); then rebuilt the ide, then tried bgracontrols which failed. So something is odd in trunk.

Unfortunatly I do not use OPM, as I find that it oftens leaves multiple mis-installed components, ie if a component failed to install I have to go manually into packaged installed packages and remove them, its as though OPM is updating component list even if it fails to install them. Also I prefer to have my own set of used components with known versions that work, across different pc and platforms. I have used it though to get some latest components but do not install them from OPM, I just use OPM to download them and then I move them to my component folder.  This is not negative of OPM as I think it is a very good utility to get access to components, and I do use it but not in its 'intended way'. :)

I know is not perfect yet, but you must report these bugs as is the best tool I know to install stuff in Lazarus.
Title: Re: BGRA Controls v4.5
Post by: lainz on February 08, 2018, 11:31:18 pm
New BGRAControls v4.5.1
- Fix compiling in Lazarus trunk for Linux, now BGRAImageList is like a normal Image List with no fixes for transparency (Reason: Changes in ImageList that broken BGRAImageList).

If you're using Lazarus 1.8 and still want these transparency fixes is really easy to enable: go to BGRAImageList.pas and change

Code: Pascal  [Select][+][-]
  1. { $DEFINE BGRA_DRAW}
to
Code: Pascal  [Select][+][-]
  1. {$DEFINE BGRA_DRAW}
(remove first empty space to enable the define) at the top of the file.
Title: Re: BGRA Controls v4.5.1
Post by: boxofrelays on February 09, 2018, 04:22:25 am
I seemed to have problems on the latest install as I was adding packages for my development on the version 64-bit version but not the 32-bit version. I have a 32-bit and a 64-bit Lazarus install on my Win10 64-bit machine.  Download was from source forge. I tried a download from a mirror site and no problem on the 64-bit install and adding packages on both 64 and 32 some BRGA controls in the mix. Wondering if there is some variance on the installers from mirror sites and the source forge site?   8)
Title: Re: BGRA Controls v4.5.1
Post by: balazsszekely on February 09, 2018, 07:01:11 am
@josh
Quote
Unfortunatly I do not use OPM, as I find that it oftens leaves multiple mis-installed components, ie if a component failed to install I have to go manually into packaged installed packages and remove them, its as though OPM is updating component list even if it fails to install them. Also I prefer to have my own set of used components with known versions that work, across different pc and platforms. I have used it though to get some latest components but do not install them from OPM, I just use OPM to download them and then I move them to my component folder.  This is not negative of OPM as I think it is a very good utility to get access to components, and I do use it but not in its 'intended way'.
It's perfectly fine if you don't want to use OPM, you can even criticize it, I don't mind.  :) In fact I don't think there is a tool that fits everyone needs. About multiple "mis-installed components" there is a "Cleanup" button(see attached image), which will automatically remove every non-installed package from the local repository. The "Open" button will open the local repository in a separate filemanager/explorer window.

@lainz
I updated BGRAControls.
Title: Re: BGRA Controls v4.5.1
Post by: lainz on February 09, 2018, 12:21:10 pm
I seemed to have problems on the latest install as I was adding packages for my development on the version 64-bit version but not the 32-bit version. I have a 32-bit and a 64-bit Lazarus install on my Win10 64-bit machine.  Download was from source forge. I tried a download from a mirror site and no problem on the 64-bit install and adding packages on both 64 and 32 some BRGA controls in the mix. Wondering if there is some variance on the installers from mirror sites and the source forge site?   8)

BGRAControls is now only on GitHub. Try using Online Package Manager to get packages from now.

@lainz
I updated BGRAControls.

Thanks  :)
Title: Re: BGRA Controls v4.5.1
Post by: Josh on February 09, 2018, 12:32:52 pm
@getmem
Just an idea, that would make it far more useful to me , would be if I set the download folder to be my central component folder, then when components are downloaded they are stored in a folder that also contains there version number, ie BGRABITMAP_8_5_2 etc, that way when I update a component in one of my lazarus installation, it will not effect the other installations; until I am ready to upgrade those as well.  As I have some old lazarus installations that are still in use but not all the updated component/libraries work with.


Ooops posted in wrong place , so I have copied the post to Online Package Manager Topic.
Title: Re: BGRA Controls v4.5
Post by: niotronic on March 08, 2018, 02:37:10 pm
Hi,

I just came across the same problem when trying to install BGRAControls 4.5.1 with Lazarus 1.9 and FPC3.1.1 on an Odroid C2.

bcimagebutton.pas(48,32) Fatal: Cannot find BGRASliceScaling used by BCImageButton, incompatible ppu=C:\Components\bgrabitmap-9.6.1\bgrabitmap\lib\i386-win32\3.1.1\bgraslicescaling.ppu, package BGRABitmapPack

I already tried to completely remove and reinstall it always ending up with error above at the compile step. On Lazarus 1.7 with FPC3.0 this was compiling and installing fine...
Anyone having any more ideas how to install it properly ?

Thanks in advance!


Hi Lainz.

Just done another fresh install of Trunk on Windows SVN57273 and getting a probloem trying to install latest bgracontrols.

Downloaded and installed bgrabitmap 9.6.1 all ok, and appear in list of packages.
Downloaded bgracontrols 4.5 and when I try to install package I get.
Code: [Select]
bcimagebutton.pas(48,32) Fatal: Cannot find BGRASliceScaling used by BCImageButton, incompatible ppu=C:\Components\bgrabitmap-9.6.1\bgrabitmap\lib\i386-win32\3.1.1\bgraslicescaling.ppu, package BGRABitmapPack

Has something changed with the installation ?
Title: Re: BGRA Controls v4.5.1
Post by: lainz on March 08, 2018, 03:21:23 pm
BGRASliceScaling is part of BGRABitmap. So you have a problem with BGRABitmap.
Title: Re: BGRA Controls v4.5.1
Post by: niotronic on March 08, 2018, 05:24:30 pm
This problem occurs when I'm trying to install the package BGRAControls 4.5.1 -  I tried installing using the online package manager, as well as a manual download and manually opening the package file. It always stops at the compile state with above message.
But you're right - it happens when BRGAbitmapPack is processed by the compiler...
Title: Re: BGRA Controls v4.5.1
Post by: Josh on March 21, 2018, 11:15:20 am
Hi
Using the TFXMaterialButton control,

how can I disable the Animation. If I have multiple Buttons and then click these rapidly, my cpu uage goes from 0% to 21%

would it be possible to add some properties
down (true/false),
NomalColor,HoverColor,ClickColor,DownColor (TMaterialColors)
Title: Re: BGRA Controls v4.5.1
Post by: lainz on March 21, 2018, 01:11:26 pm
Hi
Using the TFXMaterialButton control,

how can I disable the Animation. If I have multiple Buttons and then click these rapidly, my cpu uage goes from 0% to 21%

would it be possible to add some properties
down (true/false),
NomalColor,HoverColor,ClickColor,DownColor (TMaterialColors)

I know. But I know also if it's not for a game it will not make sense. No one clicks all buttons rapidly in a GUI application.

The material works only with an animation, for that will be needed another button control that does not use a Timer.

You can try changing it. Actually is not hard because there is a lot of sources available (BGRAControls for example). Or make your own.

If you want, we can add it to the package when ready, but only as a new control.

I want to say I started making controls when I have no idea about OOP, and I was a newby, so it's possible for anyone.
Title: Re: BGRA Controls v4.5.1
Post by: lainz on April 05, 2018, 01:18:36 am
Hi
Using the TFXMaterialButton control,

how can I disable the Animation. If I have multiple Buttons and then click these rapidly, my cpu uage goes from 0% to 21%

would it be possible to add some properties
down (true/false),
NomalColor,HoverColor,ClickColor,DownColor (TMaterialColors)

Here you go, is not finished but it does not have animations (yet) so you can copy this exact revision with no animations:
https://github.com/bgrabitmap/materialdesign/blob/8af3937990fbc3d2dece2df66077c92fd5d253d3/mdbutton.pas
Title: Re: BGRA Controls v4.5.1
Post by: lainz on April 06, 2018, 03:27:17 am
Hi Josh, I was very bussy with job to make new controls, but this week I found some time.

I make a new package
https://github.com/bgrabitmap/materialdesign

This has currently an (unfinished) MaterialDesignButton (MDButton).

I've added an option so this can animate only a button at a time, to prevent slowness.

Code: Pascal  [Select][+][-]
  1. // Set this to animate only a MDBUTTON at a time
  2. {$DEFINE MDBUTTON_ANIMATEONLYONE}

This button currently is something like this:
https://material.angular.io/components/button/overview

"Basic Buttons", so normal buttons with no shadow.

It runs a bit faster, not too much. I've tested it, and runs fast a half of the screen at 1920x1080. When fullscreen and full size it runs slow, of course since is not hardware accelerated.

I want to make this work better. Currently I've added the options you need StyleNormal, StyleHover, StyleActive (MouseDown) and StyleDisabled.. You can set FontColor and Color for each state.

You can now disable animations if you want, by default are disabled.

Please, you can test it?

Regards.
Title: Re: BGRA Controls v4.5
Post by: lainz on May 15, 2018, 10:48:26 pm
Hi Lainz,

Thanks for getting Back to me, not the answer I was hoping for.

I will have to experiment with other Graphics Libraries to see if they display unicode text correctly with installed fonts, and possibly overtime refrain from using bgrabitmap and bgracontrols.

A shame as its a very good library.

Hi, @circular solved it in dev-bgrabitmap branch today.
https://github.com/bgrabitmap/bgrabitmap/commits/dev-bgrabitmap
Title: Re: BGRA Controls v4.5.1
Post by: circular on May 17, 2018, 08:29:53 pm
Indeed  :)

http://forum.lazarus.freepascal.org/index.php/topic,24239.msg286180.html#msg286180
Title: Re: BGRA Controls v4.5.1
Post by: Pascal on May 23, 2018, 12:36:21 pm
Unit BGRAVirtualScreen.pas has a little bug.
TBGRAVirtualScreen has a hidden border of width 1 due to the BevelOuter of the inherited TCustomPanel set to bvRaised.
You can simply fix it by adding:
Code: Pascal  [Select][+][-]
  1.   inherited BevelOuter := bvNone;
after
Code: Pascal  [Select][+][-]
  1.   inherited Create(TheOwner);
in TCustomBGRAVirtualScreen.Create.

Maybe it's even better to inherit TCustomBGRAVirtualScreen from TCustomControl instead of TCustomPanel.
This way you do not have to redefine private properties.

Title: Re: BGRA Controls v4.5.1
Post by: lainz on May 23, 2018, 04:28:06 pm
Hi, I will fix that. Thanks for reporting.
Title: Re: BGRA Controls v4.5.1
Post by: lainz on May 24, 2018, 03:33:45 am
@Pascal, Fixed in dev-bgracontrols branch.
Title: Re: BGRA Controls v4.5.1
Post by: circular on June 03, 2018, 09:42:09 pm
Here I made some screenshots on Linux (using dev branch of BGRABitmap, that I will release today when we fix the little bugs).

Font is approximately the same size. Would be great to compare with Windows as well.
Title: Re: BGRA Controls v4.5.1
Post by: circular 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.

Title: Re: BGRA Controls v4.5.1
Post by: lainz 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 =)
Title: Re: BGRA Controls v4.5.1
Post by: circular 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.
Title: Re: BGRA Controls v4.5.1
Post by: lainz 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.
Title: Re: BGRA Controls v4.6
Post by: circular 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.
Title: Re: BGRA Controls v4.6
Post by: lainz 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.
Title: Re: BGRA Controls v4.6.1
Post by: lainz 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.
Title: Re: BGRA Controls v4.6.2
Post by: lainz 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.
Title: Re: BGRA Controls v4.6.2
Post by: lainz 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).
Title: Re: BGRA Controls v4.6.2
Post by: lainz 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.
Title: Re: BGRA Controls v5.0
Post by: lainz 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.
Title: Re: BGRA Controls v5.0.1
Post by: lainz 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)
Title: Re: BGRA Controls v5.0.1
Post by: Hydexon 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.
Title: Re: BGRA Controls v5.0.1
Post by: lainz 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.
Title: Re: BGRA Controls v5.0.1
Post by: Hydexon 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 (http://"https://sourceforge.net/projects/bgracontrols/files/") (REALLY OLD, 6 years ago), and doesn't work anymore, it needs some good porting work since BGRAControls changed a lot.
Title: Re: BGRA Controls v5.0.2
Post by: lainz on October 23, 2018, 08:33:51 pm
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 (http://"https://sourceforge.net/projects/bgracontrols/files/") (REALLY OLD, 6 years ago), and doesn't work anymore, it needs some good porting work since BGRAControls changed a lot.

It should be easy to port, just are changes in property names, nothing more.

New BGRAControls v5.0.2

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

* less warnings
* compilation fix for old lazarus (requires latest BGRABitmap)
* Missing Math unit in colorspeedbutton.pas

This last fix allows to compile it in trunk-trunk (tested myself on Windows 10 and Mac OS 10.13)

The latest commits on GitHub of BGRABitmap allows to install it on Linux properly.

If you have issues installing BGRABitmap or BGRAControls, please try the following:
- remove bgracontrols package from lazarus (uninstall)
- remove bgrabitmap and bgracontrols folders
- download a fresh copy
- try installing again

We don't know why it fails sometimes, lazarus evolves fast and we make changes when we can, to keep it running on trunk.
Title: Re: BGRA Controls v5.0.3
Post by: lainz on November 22, 2018, 11:22:03 pm
BGRAControls v5.0.3
https://github.com/bgrabitmap/bgracontrols/releases/tag/v5.0.3

* Move all buttons to BGRA Button Controls tab.
* Default theme for BCImageButton. Default image for BCSVGButton. Default theme for ColorSpeedButton.
* Fixing timers in BCImageButton and BGRASpriteAnimation.

The buttons now are on his own tab, because we have a lot of them.
Default themes for these buttons.
And finally, timers are destroyed well now, and not used when there is no animation in these controls.
Title: Re: BGRA Controls v5.0.3
Post by: circular on November 22, 2018, 11:59:02 pm
Thanks. That's easier to browse with a separate tab for buttons.  :)
Title: Re: BGRA Controls v5.0.3
Post by: lainz on November 23, 2018, 12:31:31 am
 :) Yes is good.

The timer thing cost me about an hour of debugging because that bug breaks the Lazarus Ide.  %)
Title: Re: BGRA Controls v5.0.3
Post by: circular on November 23, 2018, 01:15:14 am
That's kind of strange. Congrats for solving the bug  :)
Title: Re: BGRA Controls v5.0.3
Post by: BSaidus on November 24, 2018, 10:38:33 pm
BCMaterialDesignButton !!

Hi, the BCMaterialDesignButton I think it bugs, It do not change colors even if NormalColor property set.
It seems that ShadowColor only Color's the button.
See screenshot.

Thanks
Title: Re: BGRA Controls v5.0.3
Post by: lainz on November 25, 2018, 01:44:22 am
Hi, is a bug but not in the control, the solution is that you need to recompile BGRABitmap and BGRAControls with clean option.
Title: Re: BGRA Controls v5.0.3
Post by: BSaidus on November 25, 2018, 06:17:32 pm
Hi, is a bug but not in the control, the solution is that you need to recompile BGRABitmap and BGRAControls with clean option.
I even cleaned all lazarus and all lib\*.o , lib\*.ppu and recompiled lazarus, but still buggy.
Title: Re: BGRA Controls v5.0.3
Post by: lainz on November 25, 2018, 06:32:03 pm
Hi, what version of BGRABitmap do you have? Edit: and also lazarus version, fpc version and bitness, bgracontrols version, maybe it's a buggy combination for that control.

Working fine here.
Title: Re: BGRA Controls v5.0.3
Post by: BSaidus on November 25, 2018, 06:56:13 pm
Ok thinks,
I'v downloaded the master branch on github.
It works now.

Thunk you.
Title: Re: BGRA Controls v5.0.3
Post by: lainz on November 25, 2018, 07:06:07 pm
Great!, thanks for sharing the solution.
Title: Re: BGRA Controls v6
Post by: lainz on December 01, 2018, 01:45:37 am
BGRAControls v6

* Added Delphi Compatibility (from v5.0.1 copy thanks to @edivando-fpc)
* Added again changes from v5.0.1 to v5.0.3
* Added AlphaTest and AlphaTestValue in BCImageButton
* Added LoadFromBitmapResource in BGRASpriteAnimation

Note, delphi compatibility requires a separate download of BGRABitmap
https://github.com/edivando-fpc/BGRABitmap

The BGRAControls version in edivando's repo is not the same as the one in our repo, our repo contains more fixes currently. I asked edivando if there are more changes to create a fork so we can have updated versions for delphi and lazarus.
Title: Re: BGRA Controls v6.0.2
Post by: lainz on December 06, 2018, 11:43:31 pm
New BGRAControls v6.0.2
https://github.com/bgrabitmap/bgracontrols/releases

* Added BCImageButton toggle button test.
* Fix compiling in FPC 3.0.4.
Title: Re: BGRA Controls v6.0.2
Post by: Phoenix on December 09, 2018, 05:06:10 pm
Thanks   :D!!
Title: Re: BGRA Controls v6.0.2
Post by: Josh on December 11, 2018, 01:32:37 pm
Hi Lainz,

posted same on bgrabitmap topic, but added here also incase its bgracontrols.

Something has happened in either bgrabitmap,bgracontrols, or latest trunk of carbon widgetset.

If I place a TBGRAShape ona  form, it is not drawn on ide or when compiled, it has no corners, border coloring does not work, and background coloring does not work.
Doing same on windows and cocoa on mac is working.

I am not sure if its latest trunk, bgrabitmap or bgracontrols.

Apologies for being vague.

Also it does the same with BCRadialProgressBar.

i386-darwin-carbon  fpc 3.3.1  svn 59789.

Update---
I have an older laz installation rev 59686; which works fine on carbon.
So I think its a Laz Issue.


Also tried cross compiling from cocoa 64 to carbon 32 and get the same problem
Title: Re: BGRA Controls v6.0.2
Post by: lainz on December 13, 2018, 04:26:43 pm
Hi, I tested with Lazarus RC 2 32 bit and it's working fine.

I'm using bgrabitmap development branch.
Title: Re: BGRA Controls v6.0.2
Post by: Josh on December 13, 2018, 06:26:39 pm
Hi

Yes confirmed RC2 is working, as is 1.8.5.

the issue is within trunk of both i386-carbon and x64-cocoa cross compiling to carbon.
Rev 59686 is working but latest trunk is not.

If the upcoming RC3 is based on latest trunk, then this will have the issue.
Title: Re: BGRA Controls v6.0.2
Post by: lainz on January 19, 2019, 06:22:17 pm
Hi josh, how it's working now with RC3?

I'm out of ideas we have a lot of controls already:

- Button (a lot of them)
- CheckBox (MDButton)
- RadioButton (MDButton)
- Progress Bar (normal and radial)
- Image displaying and animation / gif
- SVG displaying
- Label
- Panel
- PaintBox
- ToolBar
- Numeric edit
- Knob
- Shape
- Clocks
- ListBox (themed only)

If you choose to install Custom Drawn as well there are
- Edit
- Many more

And some extras
- Virtual Keyboard / Virtual Numeric Keyboard
- BCButton theme manager
- Pascal Script utilities

Yet a full theme is missing, and I think it will be like that since is hard to make TMainMenu, ComboBox, Edit (that works smoothly, it already comes with Custom Drawn Package).

And now it works on Delphi as well.

What's next, I think we can move to web development with Pas2JS.

Release 6.0.3 with small fixes
https://github.com/bgrabitmap/bgracontrols/releases

* Added BorderSpacing and Constraints in some controls that had these properties missing.
* Fix for DropDown on Linux (BCButton)
* Removed unused units
Title: Re: BGRA Controls v6.0.4
Post by: lainz on February 09, 2019, 09:09:50 pm
Hi, in dev branch I've added BGRA Themes (and deleted the old repository from github). Today I created BGRAThemeRadioButton.
Title: Re: BGRA Controls v6.0.4
Post by: Mocte on February 11, 2019, 06:44:26 pm
Great work Lainz, I don't use Lazarus as much as I wish but I like to follow the BGRA developments and is only getting better, keep up the good work  :)
Title: Re: BGRA Controls v6.0.4
Post by: lainz on February 26, 2019, 05:19:40 pm
Thanks, yes I use Lazarus at work, but outside that I'm not using it too much too for personal projects, but I like to code with BGRABitmap is the only reason I have to keep this updated.

New release
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.1

Added BGRAThemes into the release with @circular fixes and bctools.pas fixes thanks to @Phoenix.

Edit: About Delphi Compatibility, the latest version tested with Delphi is the one located here https://forum.lazarus.freepascal.org/index.php/topic,24176.msg303533.html#msg303533, I'm not further adding to Delphi new components because I don't use it.
Title: Re: BGRA Controls v6.2.1
Post by: lainz on May 04, 2019, 10:17:06 pm
Hi, new release BGRA Controls v6.2.1

Now it has a new button control called TBCGradientButton, with this button you can create something like this:

Gif of the control
https://giphy.com/gifs/pascal-lazarus-bgrabitmap-Js2QZmHR0t9KZl04pu

And that's all, is a component made in 1 hour, is something like Windows 10 start menu buttons... I get inspired with those. You can set LockVertical to look the same as the start menu ones that only moves the gradient horizontally.

The button is only responsible to draw the gradient hover light and the border, when you click it dims the control (all these colors are customizable by object inspector, with alpha channel) the rest must be drawn by the user, in the demo I put a background color and a background image, but can be text or wathever you want!

Enjoy!
Title: Re: BGRA Controls v6.2.1
Post by: AFFRIZA 亜風実 on July 15, 2019, 05:07:32 am
Btw, is there any chance for created TBCEdit or something like that in the future version? Hehe... It would be nice if we have that :D
Title: Re: BGRA Controls v6.2.1
Post by: circular on July 17, 2019, 10:32:17 pm
Btw, is there any chance for created TBCEdit or something like that in the future version? Hehe... It would be nice if we have that :D
I think that would not be too much work use BGRATextBidi unit. Look for example at bgrabitmap/test/testbiditext2.
Title: Re: BGRA Controls v6.2.1
Post by: lainz on July 18, 2019, 12:53:02 am
There is one in CustomDrawn package, I just did a theme with BGRABitmap units, maybe port that to entirely BGRA with no need of using custom drawn package?
Title: Re: BGRA Controls v6.2.1
Post by: circular on July 18, 2019, 02:03:47 pm
Indeed, we could have a component independant from custom drawn.

In fact I was rather thinking about a multiline text editor, like TMemo. Using BGRATextBidi, you don't need to program the text layout, selection or caret position computation.

Though thinking about it, it may be a bit different from TEdit, in particular the horizontal scrolling when the text is bigger than the box.
Title: Re: BGRA Controls
Post by: lainz on August 07, 2019, 06:22:18 pm
New release of BGRAControls v6.3:

https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.3

- Added DiscardBitmap(ARect) in BGRAVirtualScreen.
- Added BCComboBox.
- Added OnChange event for BGRAThemeRadioButton.
- Added negative values in BCTrackBarUpDown.
Title: Re: BGRA Controls
Post by: circular on August 07, 2019, 07:08:43 pm
Cool that will make LazPaint beautiful  :)
Title: Re: BGRA Controls
Post by: lainz on August 08, 2019, 06:41:44 pm
Cool that will make LazPaint beautiful  :)

For sure =)

New release 6.3.1

https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.3.1

BCButton
- Add text padding
- Default property values can't be used because of custom style
Title: Re: BGRA Controls
Post by: lainz on August 14, 2019, 05:00:11 pm
New release 6.4

https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.4

- Style editor for combobox (double-click on control in designer to open)
- Glyph alignment for BCButton
- Added BGRAThemeCheckBox
- Fix MouseDown for RadioButton
- AutoSize of BCButton
Title: Re: BGRA Controls
Post by: circular on August 14, 2019, 07:01:34 pm
Note that to have the new glyph alignment and autosize of BCButtons, you need to set the property GlyphOldPlacement to False in the object inspector.
Title: Re: BGRA Controls
Post by: lainz on August 18, 2019, 09:47:47 pm
New BGRAControls 6.5

https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.5

Fix combobox dropdown size on windows
Title: Re: BGRA Controls
Post by: lainz on November 03, 2019, 12:56:42 pm
New BGRAControls v6.6
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.6

* Fix popup combobox
* Sprite Animation methods
* Fix deprecated code
Title: Re: BGRA Controls
Post by: lainz on December 20, 2019, 02:58:14 pm
New BGRAControls v6.6.1
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.6.1

- Fix in ColorSpeedButton property TextAutoSize: now it ignores the text height as well for the AutoSize if the property is false, useful for example to put in an array of buttons with a form / panel with ChildSizing and having consistent width and height.
Title: Re: BGRA Controls
Post by: lainz on May 01, 2020, 03:15:52 pm
New BGRAControls v6.7
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.7

-Fix ColorSpeedButton borders
-Anchors property for BCComboBox
-Added parent background property in TBCPanel
-Added transparency in TCustomControl descendants

What I found interesting is that despite all threads talking that TCustomControl descendants can't have transparency is not 100% true.

There's an option called csParentBackground in ControlStyle, so you can have for example a background gradient in a TBCPanel and put a TBCButtonFocus in top of it and it will be drawn like a transparent control.

Just adding this line:
Code: Pascal  [Select][+][-]
  1. ControlStyle := ControlStyle + [csParentBackground];

Enables the behaviour.
Title: Re: BGRA Controls
Post by: lainz on May 01, 2020, 03:28:32 pm
Tetst of transparency attached. Please test on macos and linux.
Title: Re: BGRA Controls
Post by: circular on May 01, 2020, 03:34:30 pm
It doesn't seem to work on Linux Mint.
Title: Re: BGRA Controls
Post by: lainz on May 01, 2020, 03:36:37 pm
Alright, thanks for the screenshot.  :)
Title: Re: BGRA Controls
Post by: circular on May 01, 2020, 06:19:02 pm
So that's an improvement only for lucky Windows users.  :D
Title: Re: BGRA Controls
Post by: lainz on May 01, 2020, 11:22:29 pm
So that's an improvement only for lucky Windows users.  :D

Yes, for now it is.

I've filed a bug: csParentBackground not working on Linux
https://bugs.freepascal.org/view.php?id=37005
Title: Re: BGRA Controls
Post by: Roland57 on May 01, 2020, 11:39:46 pm
Hello!

I cannot compile BGRAControls 6.7:

Code: Pascal  [Select][+][-]
  1. bcpanel.pas(98,15) Error: There is no method in an ancestor class to be overridden: "SetParentBackground(const Boolean);"

Linux, Lazarus 1.8.4.

Maybe I made something wrong...

Title: Re: BGRA Controls
Post by: lainz on May 01, 2020, 11:45:23 pm
Hello!

I cannot compile BGRAControls 6.7:

Code: Pascal  [Select][+][-]
  1. bcpanel.pas(98,15) Error: There is no method in an ancestor class to be overridden: "SetParentBackground(const Boolean);"

Linux, Lazarus 1.8.4.

Maybe I made something wrong...

I'm not at the PC right now, but you can try on a more recent version of Lazarus?
Title: Re: BGRA Controls
Post by: Roland57 on May 01, 2020, 11:50:10 pm
I'm not at the PC right now, but you can try on a more recent version of Lazarus?

Thank you for your answer. OK, I will try.
Title: Re: BGRA Controls
Post by: lainz on May 02, 2020, 12:08:30 am
I'm not at the PC right now, but you can try on a more recent version of Lazarus?

Thank you for your answer. OK, I will try.

Thanks for reporting I will try to make it compatible with older versions.

Edit: I tried adding $IF LCL_FULLVERSION but it always gray out the code, even if I have an higher version...
Title: Re: BGRA Controls
Post by: Roland57 on May 02, 2020, 11:12:29 am
Thanks for reporting I will try to make it compatible with older versions.

I installed Lazarus 2.0.8. Now I can compile BGRAControls 6.7.
Title: Re: BGRA Controls
Post by: circular on May 02, 2020, 11:17:52 am
@Lainz

Is there LCLVersion in uses clause?
Title: Re: BGRA Controls
Post by: lainz on May 03, 2020, 12:47:35 am
@Lainz

Is there LCLVersion in uses clause?

Yes, I commited the changes in the dev branch. But it grayes out the code, I have LCL 2.1.0.0, for that i'm not sure if is working fine. The target is 2.0.8.0 that's one version where the code works...
Title: Re: BGRA Controls
Post by: circular on May 03, 2020, 06:32:11 pm
Can you show me the code with the $IF?
Title: Re: BGRA Controls
Post by: lainz on May 03, 2020, 07:34:24 pm
Here it is, TBCPanel, lines 98 and 234
https://github.com/bgrabitmap/bgracontrols/commit/08db8ea8f361e46e439ff59ba9bb7ad42ab7f4c1
Title: Re: BGRA Controls
Post by: circular on May 03, 2020, 07:46:30 pm
Oh indeed.

I think it is a bug in the source editor.

But in fact when it compiles, it is checked correctly.

You can try by adding an unknown identifier in the gray code to check that it is compiled.
Title: Re: BGRA Controls
Post by: lainz on May 04, 2020, 01:56:30 am
Oh indeed.

I think it is a bug in the source editor.

But in fact when it compiles, it is checked correctly.

You can try by adding an unknown identifier in the gray code to check that it is compiled.

Thanks.

New release
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.7.1

- Compatibility with older Lazarus
Title: Re: BGRA Controls
Post by: lainz on May 28, 2020, 09:52:12 pm
New release v6.7.2

Fix:
- Use parent form style in bccombobox. So it does not overlap other windows when the style is not fsStayOnTop.

And also we're starting to port BGRAControls to MSEide, the first change was using a Drawer unit in ProgressBar, next will be adding some ifdef's to use the same unit both in LCL and MSEide.

I started with ProgressBar since is one of the units that has less lines of code, well written BTW.

Due to this change now you must use BarColor in our ProgressBar instead of Color.
Title: Re: BGRA Controls
Post by: mb on June 02, 2020, 07:13:17 pm
There seems to be a bug in control "BcRadialProgressbar".
Changing property "Color" in editor does not change Preview until I also change "FontShadowColor".
Title: Re: BGRA Controls
Post by: lainz on June 03, 2020, 01:00:13 am
There seems to be a bug in control "BcRadialProgressbar".
Changing property "Color" in editor does not change Preview until I also change "FontShadowColor".

ok, im adding the bug report in the issues on github
Title: Re: BGRA Controls
Post by: lainz on July 20, 2020, 04:24:28 pm
BGRAControls 6.8
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.8

- Save / Load BCButton from JSON with cascading.
- Retina scaling (macOS) for some controls.
- ComboBox usage with arrow keys.

It requires BGRABitmap 11.2
Title: Re: BGRA Controls
Post by: balazsszekely on July 20, 2020, 05:29:41 pm
Hi lainz,

How do you install BGRAControls (FPC 3.2.0/Lazarus 2.0.10 or trunk)? I always get the incompatible ppu error. It doesn't matter if I install it from OPM or manually.
Title: Re: BGRA Controls
Post by: lainz on July 20, 2020, 05:35:32 pm
Hi, I have it already installed. I'm using trunk. So when I edit it just recompiles, or I recompile the IDE if we add more controls.

I will try on the newest release of Lazarus 2.0.10, but it should be working as well, what I do if the ppu error comes, is selecting the build options that cleans up all the files, that is the trick. The IDE takes more time to build but it works finally.

Edit: the build options -> I mean the Lazarus build options
Title: Re: BGRA Controls
Post by: balazsszekely on July 20, 2020, 05:54:41 pm
Thanks, I did try the "Clean all" option in "Configure build Lazarus" dialog, still does not works for me. I attach the screenshot with the error.
Title: Re: BGRA Controls
Post by: lainz on July 20, 2020, 06:18:41 pm
Hi GetMem, thanks for helping me to fix this.

I think I found the problem. Seems that there is a conflict when installing BGRABitmap and BGLControls (from BGRABitmap package) and then installing BGRAControls.

If I use OPM and I select only bgrabitmappack and bgracontrols with nothing more, it works.

Say that next I want to install BGLControls, then I get a similar problem:

bcbutton.pas(80,12) Fatal: Can't find unit BCButton used by bgracontrols

Can you reproduce this bug in this order of installing packages? BGRABitmap, BGRAControls, BGLControls.
Title: Re: BGRA Controls
Post by: balazsszekely on July 20, 2020, 06:30:33 pm
Quote
I think I found the problem.
Cool.

Quote
If I use OPM and I select only bgrabitmappack and bgracontrols with nothing more, it works.
Yes. I can confirm this, BGRABitmap with BGRAControls can be installed without any issues. :)

Quote
Say that next I want to install BGLControls, then I get a similar problem:
This is also confirmed.

What solution do you propose? Isn't BGLControls from BGRABitmap an old version of BGRAControls(I'm just asking, I don't know)?

Title: Re: BGRA Controls
Post by: lainz on July 20, 2020, 06:49:03 pm
Hi, BGLControls is used if you want to do OpenGL stuff like a game or something like that, with BGRABitmap.

I will ask circular, maybe we can merge that into BGRAControls and get rid of the problem.
Title: Re: BGRA Controls
Post by: circular on July 21, 2020, 12:49:43 pm
Hi,

I initially created BGLControls as a separate package because it depends on lazopenglcontext. I wanted to avoid this dependency as sometimes the linker fails with OpenGL library.

I just installed BGRAControls and BGLControls on Lazarus 2.0.8 MacOS and it compiled fine. I am not using OPM here, just getting the Git branch. I don't know if that makes a difference.

I don't see why there would be the problem. I can't find any circular reference. Could it be that there are multiple version of the packages at the same time?
Title: Re: BGRA Controls
Post by: lainz on July 21, 2020, 05:54:08 pm
I don't know why it fails but it does at least on Windows. So I asked GetMem to remove BGLControls from OPM, but if anyone wants to install it can open the lpk from the OPM downloads.

But basically most people wants to install bgrabitmap and then bgracontrols, and that was failing if bglcontrols was installed first.

I'm sure it's a bug, not sure where it's located, just how to reproduce  :(
Title: Re: BGRA Controls
Post by: balazsszekely on July 21, 2020, 09:22:31 pm
@circular

Please test with Lazarus 2.0.10(or Trunk) and FPC 3.2.0. You will be unable to install BGRABitmaps with BGRAControls. 
I did not remove BGLControls from OPM, for now is not installed by default. Maybe you guys can come up with a better solution. The main difference is FPC 3.2.0, with FPC 3.0.4 there was no problem installing the packages.
Title: Re: BGRA Controls
Post by: circular on July 22, 2020, 01:36:27 pm
Hi

I've tested with Lazarus 2.0.10 and I get the checksum problem. Though I can compile a project that uses BGRAControls and BGLControls. So that seem to be a problem with the way Lazarus compiles itself.

I don't know why there is this checksum problem. Can it be related to compiler options that would be different depending on the package?
Title: Re: BGRA Controls
Post by: circular on July 22, 2020, 02:08:18 pm
I successfully compiled Lazarus with both packages by doing the following:
- set cleanup option
- compile with BGLControls only
- remove cleanup option
- add BGRAControls and compile

Does it work for you?
Title: Re: BGRA Controls
Post by: lainz on July 22, 2020, 06:06:15 pm
Hi, I've used the 'clean all' option, installed first BGRAControls and then BGLControls and it did work.
Title: Re: BGRA Controls
Post by: wp on July 23, 2020, 03:17:21 pm
It seems to me that bgrabitmap and bgracontrols have files in the same directory. Separate them when such things happen, make sure that two packages do not share any files in the same directory, use separate directories instead. Do not set unit path in on one package to point to the sources of another package. Also make sure that the output directories of each package are different

martin_fr has explained it several times, e.g. https://forum.lazarus.freepascal.org/index.php/topic,47643.msg341661.html#msg341661.
Title: Re: BGRA Controls
Post by: lainz on July 23, 2020, 04:46:59 pm
Hi, thanks wp.

Currently bgrabitmap and bgracontrols are even in separate github repositories, so that can not be the problem, these are always into separate folders and we don't add paths, just package dependency. But the bglcontrols shares his folder with bgrabitmap, but again no path is added, is added as package dependency.

The thing is why it works in 3.0.4 and not in 3.2?
Title: Re: BGRA Controls
Post by: circular on July 23, 2020, 05:25:29 pm
Hmmm BGLControls and BGRABitmap do not share files, but as they are in the same directory, could it be that the directory is added twice to the search path?
Title: Re: BGRA Controls
Post by: wp on July 23, 2020, 06:36:58 pm
I remember I had lots of problems with JVCL which constists of many units and packages. Initially all the runtime units were in a single directory, and everything worked fine. But the more units I added compilation become more and more complex, it only worked when I compiled them in a given order, and maintainance become a nightmare. Martin finally told me to separate the code into individual folders, all the units of package 1 go into folder 1, the units of package 2 to folder 2 etc. I also separated the output folders, i.e. package 1 compiles to lib/package1, package 2 to lib/package2 etc. This way the compilation issues could be solved. There is still a "duplicate unit" message sometimes.

lainz, having the packages in several repositories has no effect on the compilation issues when you merge both repositiories to the same folder on the compiling machine.
Title: Re: BGRA Controls
Post by: circular on July 23, 2020, 06:47:37 pm
lainz, having the packages in several repositories has no effect on the compilation issues when you merge both repositiories to the same folder on the compiling machine.
Repositories are not merged into a single folder.
Title: Re: BGRA Controls
Post by: circular on July 23, 2020, 07:04:54 pm
I've moved BGLControls to a separate folder and it seems it has fixed the problem. I suppose that happens because the folder of the package is always considered as a source of units.

I also separated the output folders, i.e. package 1 compiles to lib/package1, package 2 to lib/package2 etc. This way the compilation issues could be solved. There is still a "duplicate unit" message sometimes.
I get "ambiguous unit" if I only change the output folder.
Title: Re: BGRA Controls
Post by: lainz on August 02, 2020, 10:40:12 pm
For those that are willing to install BGRAControls under Linux, please download the latest release of BGRABitmap, at least version 11.2.1 that fixes the compiling on Linux  :)
Title: Re: BGRA Controls
Post by: kirchfritz on August 13, 2020, 04:21:31 pm
Hello Lainz,

I did some modifications to the original BCMDButtons.pas file.
For example, I implemented the feature to specify the color of a checked TabButton and the feature to specify the position of the colored check mark of an checked TabButton.
See the screenshot of my test-file here:  https://www.screencast.com/t/aRIXUtnB

I am not familar with GitHub, pull-requests and so on.
Are you willing to put my modifications to the offical source code?

Attached you will find my bcmdbutton.pas file and a ZIP Archive with the test-project

Fritz
Title: Re: BGRA Controls
Post by: lainz on August 13, 2020, 04:26:35 pm
Hi, thanks for the improvements, when I have free time I will check that, I made a copy of your post here:
https://github.com/bgrabitmap/bgracontrols/issues/85
Title: Re: BGRA Controls
Post by: lainz on August 15, 2020, 03:20:12 pm
Hello Lainz,

I did some modifications to the original BCMDButtons.pas file.
For example, I implemented the feature to specify the color of a checked TabButton and the feature to specify the position of the colored check mark of an checked TabButton.
See the screenshot of my test-file here:  https://www.screencast.com/t/aRIXUtnB

I am not familar with GitHub, pull-requests and so on.
Are you willing to put my modifications to the offical source code?

Attached you will find my bcmdbutton.pas file and a ZIP Archive with the test-project

Fritz

Hi. I've applied your changes to BCMDButton and the test project.

I ask you a question, it will be better if for example we can configure the color of the checked tab button for each state, like mouse over, normal, pressed and disabled?

As well if we can configure the position of the checkmark individually?

We can keep the globals, and add custom properties. If for example is clDefault the global is used. If is another color, the specific color is used.

We can add the position to each control and a boolean, if it's checked it uses the global, if not it uses the local position.

What do you think?
Title: Re: BGRA Controls
Post by: WD4080 on August 17, 2020, 12:21:14 pm
I want to use the TBCButton in a form that is in the dll, however when exiting the dll it gets an error alert. The call stack is below.
Standard controls do not cause this behavior. I found that it is enough to put any BGRA .. component on the form to trigger this behavior.

 Is there any solution for this?

winapi.inc:180
Code: Pascal  [Select][+][-]
  1. function DeleteObject(GDIObject: HGDIOBJ): Boolean;
  2. begin
  3.   Result := WidgetSet.DeleteObject(GDIObject);
  4. end;  

#0 DELETEOBJECT(738529576) at .\include\winapi.inc:180
#1 TCUSTOMBITMAP__FREEMASKHANDLE(<error reading variable>) at .\include\custombitmap.inc:110
#2 TCUSTOMBITMAP__DESTROY(<incomplete type>, <error reading variable>) at .\include\custombitmap.inc:56
#3 SYSTEM$_$TOBJECT_$__$$_FREE at :0
#4 FINALIZE$_$BGRATEXT at :0
#5 SYSTEM_$$_FINALIZEUNITS at :0
#6 SYSTEM_$$_SYSFLUSHSTDIO at :0
#7 VMT_$FORMS_$$_TSCREEN$indirect at :0
#8 ?? at :0
#9 SYSINITPAS_$$__FPC_DLLMAINCRTSTARTUP$LONGINT$LONGWORD$POINTER at :0
#10 wcsncmp at :0
#11 ntdll!RtlGetDaclSecurityDescriptor at :0
#12 ntdll!LdrUnloadDll at :0
#13 ?? at :0
#14 KERNELBASE!FreeLibrary at :0
Title: Re: BGRA Controls
Post by: lainz on August 17, 2020, 01:30:15 pm
Can you provide a project we can compile and debug? And some kind of instruction on how to test that.

I never coded such a thing like a form on a dll so I have no idea.
Title: Re: BGRA Controls
Post by: kirchfritz on August 18, 2020, 07:17:39 am
Hi lainz,

you mentioned individual colors of the checked tab buttons according to its state and indiviudally positions of the check marks.
Very good idea. Individually positions enable on a single form tab buttons on the left and on the right side. With a global position this is impossible.
Individually check mark colors increase the GUI's flexibility, although I think it's not really necessary.

Personally I was not able to program this individuality. My method of creating global variables was good enough for me. But for a general purpose BGRA Tab Button having more flexibilty is always the best solution.

Title: Re: BGRA Controls
Post by: WD4080 on August 21, 2020, 09:53:38 am
Can you provide a project we can compile and debug? And some kind of instruction on how to test that.

I never coded such a thing like a form on a dll so I have no idea.

Hello
I solved this problem. It was caused by the bgratext.pas module, where a bitmap is free in the finalization section.
It turns out that for dll it can't be that place. That's why I added a function to the module that free this bitmap.
Now i can free bitmap before closing the dll and the problem is gone.
Title: Re: BGRA Controls
Post by: circular on August 21, 2020, 04:24:04 pm
@WD4080: Ok so I suppose that there is not this problem with latest version of BGRABitmap as I removed this global TBitmap variable.
Title: Re: BGRA Controls
Post by: lainz on August 23, 2020, 06:08:49 am
 Thanks Johann for solving it :)
Title: Re: BGRA Controls
Post by: Zvoni on September 11, 2020, 10:57:48 am
FYI:
Manjaro Cinnamon - Linux Kernel 5.8.x (?)
Both Fixes Laz2.0.11/FPC3.2.1 (current as of yesterday)

Installing BGRA (Bitmap and Controls) from OPM causes my Lazarus to stop working after re-compiling the IDE
(No idea about BGRA-Version, since i'm at work now)

It just won't start. No Lazarus Splash-Screen, no nothing.
Sounds like an Exception during startup.
Title: Re: BGRA Controls
Post by: lainz on September 12, 2020, 12:37:45 am
Hi, what do you select when installing BGRABitmap and BGRAControls. There are several packages included, and not all works out of the box in all systems.

Try selecting only bgrabitmappack.lpk and bgracontrols.lpk
Title: Re: BGRA Controls
Post by: lainz on September 27, 2020, 05:44:03 pm
New BGRAControls v6.9
https://github.com/bgrabitmap/bgracontrols/releases/tag/v6.9

- Changes to BCMDButton by Fritz. Added global to change the position of the checkmark in tab mode. Added a global to change the color of the checkmark.
- New component ATShapeLineBGRA (ported from ATShapeLine, added antialiasing)
- Added BCRoundedImage
- Retina scaling (macOS) for TBGRAShape
- Retina scaling (macOS) for BCTrackbarUpDown
- Fixed bug 61 (https://github.com/bgrabitmap/bgracontrols/issues/61)
- Fixed bug 76 (https://github.com/bgrabitmap/bgracontrols/issues/76)
Title: Re: BGRA Controls
Post by: lainz on October 18, 2020, 07:30:38 pm
New version BGRAControls v7.0
https://github.com/bgrabitmap/bgracontrols/releases/tag/v7.0

It requires BGRABitmap 11.2.5 or newer

* Fixes for BCComboBox on MacOS and Linux
* Retina scaling in TBGRAGraphicControl
* Retina scaling for TBCButton and TBCComboBox
* Mouse wheel for updown control
* Fixes for BCFont
Title: Re: BGRA Controls
Post by: lainz on November 14, 2020, 04:08:05 am
We have working 3 svg controls in dev-bgracontrols branch. It has theme support with XML files, so you can easily load and save themes within the Lazarus IDE.

Many thanks to circular, he is the genius behind these controls with bgrabitmap library :)

I never imagined getting so far with this package, checked all the test folder and I'm very proud of the work done by all the contributors.
Title: Re: BGRA Controls
Post by: circular on November 14, 2020, 04:21:55 am
Thanks Lainz.

I am very excited by the SVG controls. And the dream in the end not to have to prepare bitmaps of all possible sizes.
Title: Re: BGRA Controls
Post by: Okoba on November 14, 2020, 05:43:29 am
Good job to both of you. I never saw a good set of SVG supported solution for UI, until now.
Title: Re: BGRA Controls
Post by: lainz on November 14, 2020, 03:30:02 pm
Thankyou!

I've implemented the BGRA SVG Image List, is not compatible with TImageList, but it will be useful for new SVG controls.
Title: Re: BGRA Controls
Post by: lainz on November 23, 2020, 10:54:51 pm
Posting here to see my new SVG avatar. Looks really nice.
Hope we can release soon the svg controls are ready to use. I'm not using them but maybe I can use that in some project some day.
Title: Re: BGRA Controls
Post by: circular on November 24, 2020, 12:24:34 am
I am fixing a few things related to coordinates. That's so complicated.  %)

But I think I am close to getting it right.
Title: Re: BGRA Controls
Post by: lainz on November 24, 2020, 12:59:55 am
I found some other thing not sure if related. When I create 1px border with inkscape is not 1px in the svg controls. But it is 1px in chrome.

I think it has to do with the units and the zoom factor. I need to change it as I shown in the github issue to work fine.

It's easy to test just create a new inkscape document with the default settings then draw a rectangle with a border of 1px. Align to perfect pixel coordinates so there is no antialiasing when drawn. In chrome its 1px, when drawn by bgrabitmap is not 1px is blurred.

Edit: tested it right now and seems that you already fixed it, cool so no extra inkscape settings to setup now, the units can be in millimeters or any.
Title: Re: BGRA Controls
Post by: Okoba on November 24, 2020, 08:11:22 am
I think an excellent use case will be LazPaint.
Title: Re: BGRA Controls
Post by: lainz on November 28, 2020, 04:29:29 am
New BGRA Controls v7.1
https://github.com/bgrabitmap/bgracontrols/releases/tag/v7.1

Repository:
- Fix gitignore for macOS

Button:
- BCButton fix loading from json
- BCButton image list for retina display and glyph for retina display

ComboBox:
- BCComboBox fixes for macOS

SVG Themes:
- Added SVG Theme
- Added SVG Image List
- Fix ThemeButton applied style in special cases

BCButton is now more retina display compatible, continuing the retina changes from the last release.

Now we have SVG Themes: button, checkbox and radiobutton. You can customize the theme with your own SVG's, color and size properties. Full retina / high dpi compatible.

The new image list can be used with the ThemeButton component to have SVG icon. As well you can draw to canvas or get the bitmap. Full retina / high dpi compatible.

It requires BGRABitmap v11.3
Title: Re: BGRA Controls
Post by: circular on November 28, 2020, 11:27:13 am
That's great  8)

Vector power  :-*
Title: Re: BGRA Controls
Post by: lainz on November 28, 2020, 11:50:49 am
That's great  8)

Vector power  :-*

Yes is really nice. Also I just tested and I'm using an image embedded in the SVG file as well for the button, so it works for checkbox and radiobutton as well =) We have the image theme and the SVG theme all in one.
Title: Re: BGRA Controls
Post by: circular on November 28, 2020, 12:29:29 pm
Indeed.  :)
Title: Re: BGRA Controls
Post by: lainz on December 05, 2020, 03:14:34 pm
A tutorial about BGRAControls I found on YouTube:

Spanish version
https://www.youtube.com/watch?v=ZMKV4r4XvGU&t

Portuguese version
https://www.youtube.com/watch?v=NNbE557ZOgw

Is to create a glass like panel with BGRAGraphicControl and using anchors to move the controls when you move the BGRAGraphicControl.
Title: Re: BGRA Controls
Post by: circular on December 05, 2020, 09:07:34 pm
Great  :)

That's a good use of anchors to controls.
Title: Re: BGRA Controls
Post by: lainz on December 12, 2020, 05:44:13 am
I had no idea about that anchor feature. :-[
Title: Re: BGRA Controls
Post by: circular on December 12, 2020, 02:08:46 pm
Basically it is a bit like Anchors (akLeft, akTop etc.) but you can specify a control instead of the form border.
Title: Re: BGRA Controls
Post by: lucamar on December 12, 2020, 03:00:37 pm
Basically it is a bit like Anchors (akLeft, akTop etc.) but you can specify a control instead of the form border.

That's how normal Anchors work too, isn't it? Only you have to use either the Anchor Editor or set it in code (with AnchorSideTop/-Left/-Right/-Bottom, or AnchorSide[], etc.)

Excuse me if that was what you were referring to; it was not clear for me (I can be a little slow at times :-[).
Title: Re: BGRA Controls
Post by: lainz on December 12, 2020, 03:37:54 pm
Yes I think we're talking about 2 different properties.
https://wiki.freepascal.org/Anchor_Sides

Like Anchors (akLeft akTop) and AnchorSide (that uses akLeft akTop as well, but it uses a control).
Title: Re: BGRA Controls
Post by: circular on December 12, 2020, 06:25:55 pm
@lucamar: that's what I am talking about
Title: Re: BGRA Controls
Post by: lainz on February 16, 2021, 06:42:08 pm
BGRAControls v7.2
https://github.com/bgrabitmap/bgracontrols/releases/tag/v7.2

@circular17 redundant copyright
@circular17 linking exception available as SPDX (for LGPL-3.0)
@circular17 update sprite on change
@circular17 implement AutoSize, add 180 rotation, implement Color property
@circular17 use AssignToBitmap, handle more formats
@circular17 Assign sprite to and from animated Gif
@circular17 autosize when sprite count changes, fix memory leak
@circular17 unnecessary trunc

The last fix solves the compiling issues.
Title: Re: BGRA Controls
Post by: lainz on April 18, 2021, 10:22:19 pm
Hi, I found a bug that produces a memory leak and closing bad the application if you use the TBGRASVGImageList.

Bug:
https://forum.lazarus.freepascal.org/index.php/topic,54216.msg402599.html#msg402599

To solve (now), try using it without design mode, create the object with code, and comment this method:

Code: Pascal  [Select][+][-]
  1. procedure TBGRASVGImageList.ReadData(Stream: TStream);
  2. var
  3.   FXMLConf: TXMLConfig;
  4. begin
  5.   FXMLConf := TXMLConfig.Create(Self);
  6.   try
  7.     Stream.Position := 0;
  8.      // COMMENT THESE LINES
  9.     {FXMLConf.LoadFromStream(Stream);
  10.     Load(FXMLConf);}
  11.   finally
  12.     FXMLConf.Free;
  13.   end;
  14. end;

Hope we can find a compatible solution with current designed forms.
Title: Re: BGRA Controls
Post by: circular on April 18, 2021, 11:25:23 pm
There is small memory leak with some XML functions, maybe that's not so important.
Title: Re: BGRA Controls
Post by: lainz on April 19, 2021, 12:24:01 am
There is small memory leak with some XML functions, maybe that's not so important.

The problem is not the leak itself, just that the app doesn't close properly sometimes.
Title: Re: BGRA Controls
Post by: lainz on April 19, 2021, 02:54:03 am
There is small memory leak with some XML functions, maybe that's not so important.

Oh I see, yes you're right. The problem is that I detected the bug in an application that has an access violation when closing  :(

I think both things was related, but maybe not, and is just a memory leak.
Title: Re: BGRA Controls
Post by: circular on April 19, 2021, 08:42:24 am
Yeah. That may be unrelated.
Title: Re: BGRA Controls
Post by: lainz on May 15, 2021, 06:42:07 pm
In master branch contributions to image manipulation component and autosize for theme button.
No new version yet.
Title: Re: BGRA Controls
Post by: lainz on May 31, 2021, 02:57:41 pm
BGRAControls v7.3
- Contributions to image manipulation component and autosize for theme button

https://github.com/bgrabitmap/bgracontrols/releases/tag/v7.3
Title: Re: BGRA Controls
Post by: Josh on June 24, 2021, 06:12:19 pm
placing a BGRASHAPE and then setting BorderStyle to psClear, causes a crash and access violation in IDE.
Any project that previously has this set will not open.

bgracontrols 7.3
bgrabitmap 11.3.1

Title: Re: BGRA Controls
Post by: lainz on October 26, 2021, 01:26:42 am
I've added in dev branch 3 new controls: material edit, material spin edit & material float spin edit.
Title: Re: BGRA Controls
Post by: lainz on March 12, 2022, 01:48:10 am
New BGRAControls v7.4
https://github.com/bgrabitmap/bgracontrols/releases/tag/v7.4

- Fix compilation in main (bcgamegrid edit)
- Added disabled color for text (BCButton)
- Added material spin edit, material edit, material float spin edit
- Added Rotation and DrawText in BCRadialProgressBar
- Added TabOrder in TBCButtonFocus
Title: Re: BGRA Controls
Post by: circular on March 12, 2022, 06:16:09 am
Thanks for maintaining those beautiful controls  :)
Title: Re: BGRA Controls
Post by: lainz on March 19, 2022, 08:17:35 pm
Thanks for maintaining those beautiful controls  :)

Thank you.  :)
Title: Re: BGRA Controls
Post by: six1 on March 30, 2022, 09:27:14 am
Hi lainz, Circular

i've made a few improvements on BCRadialProgressBar.
-New Component property "digits" to format Value on Progressbar. ( digits=0: 10%, digits=1: 10.1% a.s.o.)
-Background transparency on Color clNone
-LineBkgColor transparency on Color clNone

Maybe it's usefull for someone else.

Best, Michael

Title: Re: BGRA Controls
Post by: Josh on May 26, 2022, 09:28:29 pm
Hi

I have ben developing an Expanding Button control v0.1.18 Alpha, based on BCButton, It is in Alpha stage, so hopefully some people can test it out and report back any issues or improvement suggestion.
it allows you to supply via a csv string, the captions, hints and anwers for various buttons that will appear in a panel when you click the button/ or rollover the button. the panel can look like a callout bubble, you can specify left,riggh alignment.... lots of other parameters.

If you install the package it will appear in the BGRA Buttons package.

https://github.com/josh65github/BGRACONTROLS-Expanding-Buttons/releases/tag/V0.1.18A

video
https://github.com/josh65github/BGRACONTROLS-Expanding-Buttons/blob/main/Vids/exp_but.mp4

Picture attached is of the Example 3 project, included in the package.
Title: Re: BGRA Controls
Post by: circular on May 27, 2022, 05:40:58 pm
I quite like the triangular shape that joins the bubble to the button.  :)
Title: Re: BGRA Controls
Post by: lainz on May 27, 2022, 10:48:49 pm
Please test on macos and linux, if I remember well the panel transparency was working only under Windows.
Title: Re: BGRA Controls
Post by: circular on May 28, 2022, 07:58:42 pm
Indeed, transparency doesn't work on MacOS:
Title: Re: BGRA Controls
Post by: Josh on May 28, 2022, 10:38:47 pm
Hi

It captures the image underneath the panel, then copies it to the panel canvas, maybe MacOs does not like the copyscreen routine?.

Lubuntu seems ok.
Title: Re: BGRA Controls
Post by: circular on May 28, 2022, 11:47:02 pm
Oh in fact, it is not transparent, but the content copied. That solves the problem of transparency indeed.

So, I come to the same conclusion, that on MacOS, the part the copies the background is not doing so.
Title: Re: BGRA Controls
Post by: lainz on May 29, 2022, 03:29:25 am
We can publish this control with bgracontrols Josh?
Title: Re: BGRA Controls
Post by: circular on May 29, 2022, 09:08:20 am
I've added (on dev) a property "TargetRasterImageList" to the TBGRASVGImageList to automatically populate a TImageList. Whenever the size or the items are modified, the target list is updated, which can be used at design time for controls using the raster image list.
Title: Re: BGRA Controls
Post by: lainz on May 30, 2022, 11:10:04 pm
New release BGRAControls v7.5
-Fix TabStop setting it to false in object inspector
-Update bctrackbarupdown.pas
-avoid hint
-populate ImageList automatically
-clearing raster imagelist, avoid rasterize on loading
-TBCMaterialProgressBarMarquee

Josh please add your controls in dev-bgracontrols branch if you wish, add the examples in the examples folder, so we can make another release with your controls.
Title: Re: BGRA Controls
Post by: AFFRIZA 亜風実 on May 31, 2022, 04:47:36 am
Hello, everyone. I am using BC 7.4, seems rounding on BCPanel doesn't work as expected but BCButton works fine. Also, when I assigned a style macos-highsierra.bcpnl, the width and height always 0, I can't modify them. Sorry for my bad English.
Title: Re: BGRA Controls
Post by: circular on June 05, 2022, 09:31:36 am
I've tried TBCMaterialProgressBarMarquee. That works well on MacOS. An interesting way of showing progression when we don't know how much time it is going to take.  :)
Title: Re: BGRA Controls
Post by: lainz on June 12, 2022, 01:52:01 am
I've tried TBCMaterialProgressBarMarquee. That works well on MacOS. An interesting way of showing progression when we don't know how much time it is going to take.  :)

Thanks. I did my best to keep much as posible as the Android progress bar animation.
Title: Re: BGRA Controls
Post by: lainz on August 06, 2022, 04:43:20 pm
BGRAControls v7.6

## What's Changed
* Dev bgracontrols by @lainz in https://github.com/bgrabitmap/bgracontrols/pull/131
**Full Changelog**: https://github.com/bgrabitmap/bgracontrols/compare/v7.5...v7.6
Title: Re: BGRA Controls
Post by: lainz on June 17, 2023, 06:00:22 pm
New BGRAControls v7.7 (release made by @circular)
https://github.com/bgrabitmap/bgracontrols/releases/tag/v7.7
Title: Re: BGRA Controls
Post by: lainz on November 29, 2023, 10:32:06 pm
New BGRAControls v8.0
https://github.com/bgrabitmap/bgracontrols/releases/tag/v8.0


Title: Re: BGRA Controls
Post by: andrew Bubble on November 29, 2023, 11:44:33 pm
Hi Lainz

I am currently using BGRAControls V7.7, how do I upgrade to your latest.

Is it as simple as copying all the flies and directories from the latest and doing an IDE rebiuld.

Regards Andrew
Title: Re: BGRA Controls
Post by: paweld on November 30, 2023, 07:53:16 am
Quote from: andrew Bubble
...
Is it as simple as copying all the flies and directories from the latest and doing an IDE rebiuld....
yes
Title: Re: BGRA Controls
Post by: petevick on December 10, 2023, 11:10:00 am
Due to compatibility issues, I need to install version 7.3 of the BGRA Controls, but the Online Package Manager installs version 8.0. Is there a way to force v7.3 to be installed ??
Title: Re: BGRA Controls
Post by: paweld on December 10, 2023, 11:54:32 am
@petevick: no, OPM installs the version it has in its library. Most often it is the latest version reported by the component's author.   
But it is very easy to install the package in Lazarus manually. You download the component package you want to install ( bgracontrosl 7.3: https://github.com/bgrabitmap/bgracontrols/archive/refs/tags/v7.3.zip and the required bgrabitmap: https://github.com/bgrabitmap/bgrabitmap/archive/refs/tags/v11.5.8.zip ).
You unpack both archives and then move the unpacked folders to the "components" folder in the Lazarus directory.
You launch lazarus and in the menu select "Package > Opena Package File (lpk)" and then point to the file "bgrabitmap\bgrabitmappack.lpk" in the path where you placed the component. A package window will open, where you press "Compile". Then you again choose "Package > Opena Package File (lpk)" you point to the file you point to "bgracontrols\bgracontrols.lpk". In the package window, you press "Compile", and when the compilation is complete, you press "Use > Install". After rebuilding the IDE, the components should be visible on the component palette.
Title: Re: BGRA Controls
Post by: petevick on December 10, 2023, 12:08:48 pm
Thanks for the reply paweld, that sounds like just what I need. Many thanks  :D
Title: Re: BGRA Controls
Post by: lainz on December 12, 2023, 02:29:19 am
Thanks for the reply paweld, that sounds like just what I need. Many thanks  :D

Hi.

What's wrong with the newest version that you need to get back to old version?

Just to see if we can do something.

 ;)
Title: Re: BGRA Controls
Post by: petevick on December 12, 2023, 07:58:26 am
Hi.

What's wrong with the newest version that you need to get back to old version?

Just to see if we can do something.

 ;)
Hi lainz, I'm sure there's nothing wrong with the newest version, it's just that I use Lazarus in various OS VM's to check and compile projects (Windows, Linux x64, x32 etc), I know it's not ideal, but there you go. I've just added another Linux flavour VM, so it's to keep the consistency across all VM's. I've since found the easiest way is to copy an existing Linux .lazarus folder to the new VM.
I suppose really I should get brave and update all of the VM's to the latest version  :o
Title: Re: BGRA Controls
Post by: Josh on December 26, 2023, 05:37:39 pm
bgracontrol v8

Lazarus 3.1 (rev lazarus_3_0-11-gd3a957ea98) FPC 3.2.3 i386-win32-win32/win64

bgrabitmap dev 10.5.8

bgacontrols v8.0 nowgetting error

Code: Pascal  [Select][+][-]
  1. bgraknob.pas(162,47) Error: Incompatible types: got "TPointF" expected "Single"
Title: Re: BGRA Controls
Post by: circular on December 27, 2023, 05:40:44 am
Hi Josh,

I've applied a fix on the dev-bgracontrols branch. It is as well related to FPC 3.2.3 as was the error you encountered with BGRABitmap.

Does it compile now?

Regards
Title: Re: BGRA Controls
Post by: Josh on December 27, 2023, 08:35:39 pm
Hi

Yep compiled and all appears good.

thanks for your rapid fix  :)
Title: Re: BGRA Controls
Post by: circular on December 28, 2023, 05:24:54 pm
You're very welcome.

I am glad to keep BGRABitmap and BGRAControls afloat   :)
Title: Re: BGRA Controls
Post by: JohnSmith on January 13, 2024, 11:45:01 am
Hi

Is there something I missing when compiling aarch64. Heap trace report memory leaks when added a DTAnalogGauge.
I use the latest version 8
FPC 3.2.2
Lazarus V3

Added a timer with code below
DTAnalogLoad.Position:= Random (5000);
if DTAnalogLoad.Position > 3000 then
   DTAnalogLoad.FaceSettings.ColorEnd := Clred;
else
  DTAnalogLoad.FaceSettings.ColorEnd := ClLime;


Heaptrace +- 2252 with in a 2 sec runtime
Call trace for block $0000007FA4533B80 size 0
$00000000009504A4 GETCUSTOMPENSTYLE, line 1159 of bgrapen.pas
$00000000009511D8 COMPUTEPOLYLINE, line 1288 of bgrapen.pas
$00000000008649A8 DRAWLINEANTIALIAS, line 1012 of unibitmapgeneric.inc
$0000000000842170 DRAWGAUGENEEDLE, line 394 of dtanaloggauge.pp
$0000000000841334 DRAWGAUGE, line 176 of dtanaloggauge.pp
$00000000008422F0 PAINT, line 455 of dtanaloggauge.pp
$0000000000584560 WMPAINT, line 58 of include/graphiccontrol.inc
$0000000000435B64
$0000000000579930 WNDPROC, line 2299 of include/control.inc
$0000000000577A24 PERFORM, line 1625 of include/control.inc
$0000000000569984 PAINTCONTROLS, line 4970 of include/wincontrol.inc
$00000000005696A4 PAINTHANDLER, line 4881 of include/wincontrol.inc
$000000000056E300 WMPAINT, line 6825 of include/wincontrol.inc
$0000000000584C7C WMPAINT, line 103 of include/customcontrol.inc
$0000000000435B64
$0000000000579930 WNDPROC, line 2299 of include/control.inc
Call trace for block $0000007FA4533AA0 size 0
$00000000009504A4 GETCUSTOMPENSTYLE, line 1159 of bgrapen.pas
$00000000009511D8 COMPUTEPOLYLINE, line 1288 of bgrapen.pas
$00000000008649A8 DRAWLINEANTIALIAS, line 1012 of unibitmapgeneric.inc
$0000000000841D44 DRAWGAUGESCALE, line 352 of dtanaloggauge.pp
$0000000000841324 DRAWGAUGE, line 175 of dtanaloggauge.pp
$00000000008422F0 PAINT, line 455 of dtanaloggauge.pp
$0000000000584560 WMPAINT, line 58 of include/graphiccontrol.inc
$0000000000435B64
$0000000000579930 WNDPROC, line 2299 of include/control.inc
$0000000000577A24 PERFORM, line 1625 of include/control.inc
$0000000000569984 PAINTCONTROLS, line 4970 of include/wincontrol.inc
$00000000005696A4 PAINTHANDLER, line 4881 of include/wincontrol.inc
$000000000056E300 WMPAINT, line 6825 of include/wincontrol.inc
$0000000000584C7C WMPAINT, line 103 of include/customcontrol.inc
$0000000000435B64
$0000000000579930 WNDPROC, line 2299 of include/control.inc

Task manager startup +-26MB
Task manager +-10 hours 127.4MB VM at 143MB
Title: Re: BGRA Controls
Post by: Ernest on January 16, 2024, 03:06:10 pm
Hallo @Lainz,

Thanks for keep updating both BGRABitmap and BGRAControls.
Your last improvement by adding a Color property of BCPanel was great!

I'd have four suggestions to TBCComboBox component (numbering below in order of increasing effort, more or less):

Please consider above suggestions while updating the components next time!

Best wishes,
Ernest
Title: Re: BGRA Controls
Post by: hedgehog on January 17, 2024, 01:38:44 pm
Hi all.

I have developed a small ProgressRing (like WinUI3 ProgressRing).
There are two modes: Determinate and Indeterminate.

Honestly, I'm not sure if I used Canvas2D correctly for drawing or should I choose CanvasBGRA?
Title: Re: BGRA Controls
Post by: lainz on January 17, 2024, 02:56:20 pm
Hallo @Lainz,

Thanks for keep updating both BGRABitmap and BGRAControls.
Your last improvement by adding a Color property of BCPanel was great!

I'd have four suggestions to TBCComboBox component (numbering below in order of increasing effort, more or less):
  • adding a color property to set "original" component backgroud (see attached pic)
  • adding a horizontal line between the items in combo box with width and color property
  • Drop Down menu as one class -> one property like TBCButtonState
  • separated class for triangle to set parameters like color, width, proportion, etc. Maybe it will be enough to add one of the buttons on the triangle's place? As design idea please see attached pic.

Please consider above suggestions while updating the components next time!

Best wishes,
Ernest

Thanks. Unfortunatelly I have no time to implement new things. But feel free to add these yourself if you can and provide a pull request.

Hi all.

I have developed a small ProgressRing (like WinUI3 ProgressRing).
There are two modes: Determinate and Indeterminate.

Honestly, I'm not sure if I used Canvas2D correctly for drawing or should I choose CanvasBGRA?

Thanks. I've added this to dev-bgracontrols with the demo app as well.
Title: Re: BGRA Controls
Post by: lainz on March 17, 2024, 12:22:50 pm
New BGRAControls v9.0
https://github.com/bgrabitmap/bgracontrols/releases/tag/v9.0

Changelog:
- TBCMaterialDesignButton ClickMe
- New BGRAVirtualScreen test 'blur panels with shadows'
- Added custom drawn package back
- BCExpandedPanels (thanks to maxm74)
- Fix BCPaperPanel
- Keeps EOL in SVG Image List
- Added bcfluentprogressring by hedgehog
- ImageManipulation fixes
TinyPortal © 2005-2018