Recent

Author Topic: [CLOSED] BGRAControls  (Read 549784 times)

circular

  • Hero Member
  • *****
  • Posts: 4217
    • Personal webpage
Re: BGRAControls
« Reply #330 on: October 09, 2011, 03:11:37 am »
I don't understand what to test. I've tested with LazPaint in debug mode, and after resample, there was no memory leak.

EDIT: Ok, I found what you are talking about.
« Last Edit: October 09, 2011, 03:16:01 am by circular »
Conscience is the debugger of the mind

lainz

  • Guest
Re: BGRAControls
« Reply #331 on: October 15, 2011, 06:18:40 pm »
Commit changes:
- Added ModalResult in TBGRAImageButton. DoButtonDown / DoPlaySound only if mouse = mbLeft.

Hydexon

  • Full Member
  • ***
  • Posts: 170
Re: BGRAControls
« Reply #332 on: October 18, 2011, 07:53:29 pm »
If possible to put Glyph Layout property in BGRAButton?, i need this feature for a project thats i developing
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook (old)
Lazarus 2.0.2 Stable - FPC 3.0.2 - Windows | Lenovo IdeaPad Y

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: BGRAControls
« Reply #333 on: October 18, 2011, 08:25:06 pm »
If possible to put Glyph Layout property in BGRAButton?, i need this feature for a project thats i developing
better usr TBGRAImageButton, it's more adapted for your need.
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

circular

  • Hero Member
  • *****
  • Posts: 4217
    • Personal webpage
Re: BGRAControls
« Reply #334 on: October 18, 2011, 10:58:46 pm »
Well, there is already a glyph property, so why not a layout ?

Hydexon, can you try to add this property by yourself using lastest version from subversion ? When you're done, just post it here and someone will update it.
Conscience is the debugger of the mind

Hydexon

  • Full Member
  • ***
  • Posts: 170
Re: BGRAControls
« Reply #335 on: October 20, 2011, 11:14:04 pm »
Well, i can do it, but i don't know if can affect the gradient drawings, i not very good in the graphics manipulation..., my code to put glyph layouts are based in the SpeedButton.
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook (old)
Lazarus 2.0.2 Stable - FPC 3.0.2 - Windows | Lenovo IdeaPad Y

lainz

  • Guest
Re: BGRAControls
« Reply #336 on: October 21, 2011, 07:16:31 pm »
Quote
Well, i can do it, but i don't know if can affect the gradient drawings, i not very good in the graphics manipulation..., my code to put glyph layouts are based in the SpeedButton.

Ok try it.

I've released bgracontrols 1.1.0.8, another 'build number' increase (i'm not good assigning the version numbers).

Download:
https://sourceforge.net/projects/bgracontrols/files/?

TBGRAImageButton:
- Added Sound (at this moment is not portable - Windows only).
- Added ModalResult property.
- Added Toggle property.
- Added Checked property.
- Added other properties (most used in TButton, some curretly doesn't works like BiDi mode).
- TBGRAImageButton is now descendant of TCustomBGRAImageButton, so you now can create custom image buttons overriding the functions you need and publish only the properties you want.
- Other fixes.

Other:
- Added 'Accent color image button' (Metro UI with TBGRAImageButton) in testbgracontrols project.

Patches and new components, examples, ideas & criticism are welcome.
« Last Edit: October 21, 2011, 07:32:09 pm by lainz »

lainz

  • Guest
Re: BGRAControls
« Reply #337 on: October 24, 2011, 02:20:27 am »
Commit changes:

- Added 'TextCanvas' in TBGRAButton. This allow to use TBGRABitmap.CanvasBGRA.TextRect instead TBGRABitmap.TextOut to have a closer look to the OS fonts ( it needs ClearType , some help ? ) if you choose this the Shadow will not be applied.
- Improved Windows 7 ToolBar example.

lainz

  • Guest
Re: BGRAControls
« Reply #338 on: October 25, 2011, 08:29:59 pm »
Commit changes:

- Added BGRASamples (Is the old known ubgrasamples. Now is part of the library instead as part of a test project).
- Added TBGRAWin7ToolBar (isn't TToolBar descendant. Reason: TToolBar has flickering with themes disabled, also using DoubleBuffered  :(, so at this moment is TBGRAVirtualScreen descendant).

circular

  • Hero Member
  • *****
  • Posts: 4217
    • Personal webpage
Re: BGRAControls
« Reply #339 on: October 26, 2011, 02:59:38 am »
BGRASamples can be useful to help with BGRAControls.  :)

I'm wondering about using BGRAControls in LazPaint. This would add a dependency so I think this would be reasonable only if there is a real difference.
Conscience is the debugger of the mind

lainz

  • Guest
Re: BGRAControls
« Reply #340 on: October 28, 2011, 04:44:55 am »
BGRASamples can be useful to help with BGRAControls.  :)

I'm wondering about using BGRAControls in LazPaint. This would add a dependency so I think this would be reasonable only if there is a real difference.

Well now that BGRABitmap has full ClearType support I can say that is usefull to design custom buttons with BGRAButton that will look fine in most OS's that has ClearType support =)

BTW BGRAButton need some improvements, for example try to change from the object inspector the property 'Enabled'. You need to move the button to see the change.

Also you need more controls to use in LazPaint, like ComboBox, a real TToolBar, TTrackBar..

look of the current situation of some bgracontrols:

BGRALabel: well this really need to be coded again, or something because has a lot of code that I'm wondering if is used or something..
SpriteAnimation: the code isn't optimized, so it is really slow.

We need more developers =)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: BGRAControls
« Reply #341 on: October 28, 2011, 06:37:11 am »
We need more developers =)

Aren't we just writing the same thing?

http://wiki.lazarus.freepascal.org/Lazarus_Custom_Drawn_Controls

I could use more developers in the Custom Drawn Controls too ;)

Note that Custom Drawn Controls is not just a package, I want to add it inside the LCL and use it as a major building block for a new custom drawn widgeset.

I think that we are all writing the same thing, but our architecture is totally different. BGRAControls and BGRABitmap fix the performance and reliability problem by building on top of the LCL. I want to fix the problem inside the LCL by introducing a new custom drawn widgetset. It will have its own non-native Canvas which should be very fast if correctly optimized, so then TCanvas would go back to being a major development tool instead of each person going to a different secondary library because of problems with the current TCanvas. Of course TCanvas would still lack all kinds of special drawing routines, but those could be implemented as a TFPCustomCanvas descendent which would connect with the inner TLazIntfImage of TCanvas, or with a generated TLazIntfImage for existing widgetsets (I could add something like TCanvas.GetLazIntfImage).

I agree that my approach is totally different from BGRABitmap, so I wouldn't try to convince circular to drop it and work with me, but in this case, lainz, I think we are writing 100% the same thing. By joining efforts we could gain a lot!

Well now that BGRABitmap has full ClearType support I can say that is usefull to design custom buttons with BGRAButton that will look fine in most OS's that has ClearType support =)

How does BGRABitmap implement it's font support? I also need font support in the new customdrawn widgetset =)
« Last Edit: October 28, 2011, 06:39:29 am by felipemdc »

lainz

  • Guest
Re: BGRAControls
« Reply #342 on: October 28, 2011, 03:25:00 pm »
Well we're doing the same in a different way. I'm a user of BGRABitmap, I know how to use it but really don't understand how it works inside.

See here:
http://wiki.lazarus.freepascal.org/BGRAControls

I've done only 'BGRAImageButton' / 'BGRASpriteAnimation' / 'BGRALabelFX' (using the bgrabitmap labelfx unit) the hard works was done by others =)

But if I can I will contribute something.

Maybe circular is interested, he know about graphics programming.
« Last Edit: October 28, 2011, 03:28:25 pm by lainz »

circular

  • Hero Member
  • *****
  • Posts: 4217
    • Personal webpage
Re: BGRAControls
« Reply #343 on: October 28, 2011, 07:28:29 pm »
I agree that my approach is totally different from BGRABitmap, so I wouldn't try to convince circular to drop it and work with me, but in this case, lainz, I think we are writing 100% the same thing. By joining efforts we could gain a lot!
Well I don't really understand what you are doing, but if you need to use routines from BGRABitmap, that's not a problem. You can cut'n'paste whatever you want and only change the direct pixel access part.

EDIT: I've look at customdrawn directory, now I understand. You are right we are doing quite the same thing. I think it would be possible to adapt some BGRABitmap algorithm to use it with FPCanvas. In fact, I noticed that some functions are not implemented in FPCanvas, but to be free to develop I've done my library aside. Moreover I'm working with LCL while the FreePascal team want pure console app.

Quote
Well now that BGRABitmap has full ClearType support I can say that is usefull to design custom buttons with BGRAButton that will look fine in most OS's that has ClearType support =)

How does BGRABitmap implement it's font support? I also need font support in the new customdrawn widgetset =)
In fact my ClearType implementation does not need that the OS has ClearType support. I've done it myself at the pixel level.

About font support, currently BGRABitmap uses internally a TBitmap and the standard Canvas.TextOut function. That's why it's not fast. It would be faster to render directly from TTF files, but it's more complicated to do of course.
« Last Edit: October 28, 2011, 07:47:35 pm by circular »
Conscience is the debugger of the mind

lainz

  • Guest
Re: BGRAControls
« Reply #344 on: October 30, 2011, 01:54:33 pm »
Code: [Select]
You can cut'n'paste whatever you want...
The same apply for BGRAControls, is LGPL.

Commit changes:
- I've fixed the math game in testbgracontrols, now with no duplicate numbers in options.

 

TinyPortal © 2005-2018