Recent

Author Topic: BGRA Controls  (Read 221598 times)

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #420 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

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #421 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?

WD4080

  • Newbie
  • Posts: 3
Re: BGRA Controls
« Reply #422 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

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #423 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.
« Last Edit: August 17, 2020, 01:32:30 pm by lainz »

kirchfritz

  • Jr. Member
  • **
  • Posts: 53
  • WIN10 LAZ 2.2.4 FPC 3.2.2
Re: BGRA Controls
« Reply #424 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.


WD4080

  • Newbie
  • Posts: 3
Re: BGRA Controls
« Reply #425 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.
« Last Edit: August 21, 2020, 09:57:07 am by WD4080 »

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: BGRA Controls
« Reply #426 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.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #427 on: August 23, 2020, 06:08:49 am »
 Thanks Johann for solving it :)

Zvoni

  • Hero Member
  • *****
  • Posts: 2300
Re: BGRA Controls
« Reply #428 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.
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #429 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

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #430 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)

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #431 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

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: BGRA Controls
« Reply #432 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.
« Last Edit: November 14, 2020, 04:11:06 am by lainz »

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: BGRA Controls
« Reply #433 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.
Conscience is the debugger of the mind

Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: BGRA Controls
« Reply #434 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.
« Last Edit: November 24, 2020, 08:09:37 am by OkobaPatino »

 

TinyPortal © 2005-2018