* * *

Author Topic: BGRAControls  (Read 98032 times)

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #435 on: January 22, 2012, 03:59:16 am »
I'm 'porting' bitmapthemeutils drawer to bgracontrols, in order to do that in the bgracontrols way, i'm using to draw only bgrabitmap, some canvas for text calculations and to do the drawing in the control of course =)

You need also installed CustomDrawnControls from latest lazarus SVN.

Here a screenshot, as you can see the first button is using bgra fonts (fqAntialiased).

The bgra.fontheight seems fit at 1.15 of canvas.gettextheight in the procedure AssignFontToBGRA:

Code: [Select]
Dest.FontHeight := round(Source.GetTextHeight('QWERTY') * 1.15);
In windows there are only 3 font kind that I can see: default (cleartype), nonAntialiased and Antialiased, the other always do the same as default. So I've created the conversion procedure in that way. If you can show me a screenshot with 7 custom drawn buttons with each font quality in other OS's with the default drawer maybe I can optimize it.

The code is available in the GIT and SVN repository of BGRAControls at sourceforge.
« Last Edit: January 22, 2012, 04:02:43 am by lainz »
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

circular

  • Hero Member
  • *****
  • Posts: 805
Re: BGRAControls
« Reply #436 on: January 23, 2012, 11:15:28 am »
Hello Lainz,

Maybe there is a problem with the font sign. You can try to change the sign (using -Height instead of Height). The behavior of TFont height was different on Windows and on Linux, so I chose apply a sign inversion if needed. Unfortunately, the result may be the opposite of the expected behavior. In BGRABitmap, a positive Height value always the size of the letters, not the size of the whole text line. A negative value is the size of the whole text line. And the property FontFullHeight is always positive and is the size of the whole text line.

Hope this helps.

In AssignFontToBGRA function, in the case statement, you can assign fqProof to fqFineClearType, so we have all of them.
« Last Edit: January 23, 2012, 11:44:30 am by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #437 on: January 24, 2012, 07:45:37 pm »
Ok I will do some test to fully understand.

I've added fqProof as fqFineClearTypeRGB. Thanks!

Also I've added BGRAControls 1.3.0.1:
https://sourceforge.net/projects/bgracontrols/upload/

(also you can get the latest GIT or SVN from that site)

- Added customdrawn_windows7 drawer: the main advantages with the one in bitmapthemeutils is that this uses only bgrabitmap. Some things was fixed like the progressbar now looks closer to the original one. I've added win7_dpi option so you can set the dpi, this changes some images like the checkboxes and radiobuttons size. Another new option is win7_checkbox_use_default_tickmark with this you can change from the default 'v' tickmark to the hidden and never used in Windows 'x' tickmark (this is true?)..
- Working in this drawer: button, statictext, checkbox, radiobutton and progressbar.
- Note: of course this drawer is using CustomDrawnControls package, for those that never used it.
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #438 on: January 27, 2012, 03:07:16 am »
For those that liked the Windows 7 Drawer now you can easily change between Aero and the Windows 8 Aero Lite styles in the same drawer!

See image attached =)

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

Patches are welcome  :'(
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #439 on: February 13, 2012, 12:08:14 am »
I've updated the bgracontrols customdrawn_win7 drawer with the 'luna' theme (Windows XP theme).

More info and screenshot here:
http://lazarus.freepascal.org/index.php/topic,15209.msg86606.html#msg86606
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #440 on: March 01, 2012, 05:48:07 pm »
BGRAControls 1.4.0.0
(maybe the last bgracontrols as you know it!)

Download zip file:
https://sourceforge.net/projects/bgracontrols/files/

Download from svn or git:
https://sourceforge.net/projects/bgracontrols/develop

Changes:

customdrawn_win7
- Added 'Aero Lite' ( Windows 8 )
- Added 'Luna' ( Windows XP )

other
- Small fixes in BGRAImageButton and BGRANeoButton.
- Package option "Add package unit to uses clause" is now unchecked by default (this reduce exe size). With this option lazarus compile only used components, not all.
« Last Edit: March 01, 2012, 05:57:12 pm by lainz »
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

bp

  • Newbie
  • Posts: 4
Re: BGRAControls
« Reply #441 on: March 08, 2012, 10:26:19 am »
Hm, should the IDE built with svn bgracontrols/bgrabitmap work on windows XP? All I'm get is a high CPU utilization on start and then program silently exits.

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #442 on: March 08, 2012, 03:51:53 pm »
Hm, should the IDE built with svn bgracontrols/bgrabitmap work on windows XP? All I'm get is a high CPU utilization on start and then program silently exits.

Which IDE?
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

bp

  • Newbie
  • Posts: 4
Re: BGRAControls
« Reply #443 on: March 08, 2012, 05:16:18 pm »
Which IDE?
Sorry, Lazarus by itself.

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #444 on: March 08, 2012, 05:56:20 pm »
Which IDE?
Sorry, Lazarus by itself.

I've tested only in Win7 and works fine.
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

bp

  • Newbie
  • Posts: 4
Re: BGRAControls
« Reply #445 on: March 09, 2012, 04:07:17 am »
I've tested only in Win7 and works fine.
Ok, I've done some low level trace and determined, that exception occurs in  CreateWindowExW() called from TCDWidgetSet.CreateAppHandle. Just for a test, CreateAppHandle() was replaced by the code from win32 widgets and it worked fine, but then more exceptions occurred in the other place(s) which I can not determine.

Joemanza

  • Newbie
  • Posts: 2
Re: BGRAControls
« Reply #446 on: March 29, 2012, 02:56:59 pm »
still pretty new to programing in general, would it be possible to have wordwraping written into the bgrabutton component of the bgracontrols package? unfortunatley I dont have enough know how to do it myself.

Dibo

  • Hero Member
  • *****
  • Posts: 595
Re: BGRAControls
« Reply #447 on: March 29, 2012, 09:06:47 pm »
I am working on new version of BGRAControls. It will be redesigned totally. I will try add wordwraping support too. Coming soon...

circular

  • Hero Member
  • *****
  • Posts: 805
Re: BGRAControls
« Reply #448 on: March 31, 2012, 12:18:45 am »
Dibo, please make sure the font height is the same with standard controls. You may need to invert the font height sign to do this.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 635
    • WinDS PRO
Re: BGRAControls
« Reply #449 on: April 02, 2012, 12:51:33 am »
Dibo really it will be redesigned totally? there are a lot of components..

BTW if you are doing some kind of 'style drawer' (gradients, borders, shapes, phong shading, styled text..) BGRAButton, BGRAFlashProgressBar, BGRAKnob and BGRAShape will be easy to re-create.

The others are 'VirtualScreen' or fully working with bitmaps. The customdrawn_windows7 it's using the same code used in BGRAImageButton (bitmapthemeutils.pas) and the code isn't complex.

Don't forget the custom drawn.. those needs only a nice style and patches =)
Todos girão e girão, todos baixo do sol, se projeta na vida, borboleta technicolor.

Mariposa Tecknicolor
http://bit.ly/x3QYEG

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads