Recent

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

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRAControls
« Reply #390 on: December 01, 2011, 10:00:56 pm »
I've downloaded lastest version of BGRAControls, but it does not seem to work. When bitmap option is not enabled, the image is clipped, and when bitmap option is enabled, it repeats pixels strangely.
Conscience is the debugger of the mind

lainz

  • Guest
Re: BGRAControls
« Reply #391 on: December 02, 2011, 12:33:51 am »
I've downloaded lastest version of BGRAControls, but it does not seem to work. When bitmap option is not enabled, the image is clipped, and when bitmap option is enabled, it repeats pixels strangely.

You can give me that image?

The image must have 4 states: normal, enter, pressed and disabled, all of the same height and width (this is also for normal ImageButton).

The border is inside the image, you must specify only the width and height of the border in the image.

Try with the attached image:

BorderWidth := 5; BorderHeight:=5;

Or try with the image in this post
http://lazarus.freepascal.org/index.php/topic,12411.msg82590.html#msg82590

BitmapOptions.Enable := True;
BitmapOptions.FillCenter := True; 
BitmapOptions.BorderWidth := 2;
BitmapOptions.BorderHeight := 2;

Or this one:
http://wiki.lazarus.freepascal.org/Image:samplebgraimagebutton.png

BorderHeight := 2; BorderWidth := 2;
« Last Edit: December 02, 2011, 12:46:32 am by lainz »

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRAControls
« Reply #392 on: December 02, 2011, 02:00:13 pm »
Ok, now I understand. In fact, everything's fine. I just had to make four images.

I tested the border features, it works fine !  :)

So in fact, you need to have for each state an image which has a border, and inside some content that can be repeated. Then with FillCenter option, it gets repeated while the borders stay as they are.
« Last Edit: December 02, 2011, 02:03:44 pm by circular »
Conscience is the debugger of the mind

lainz

  • Guest
Re: BGRAControls
« Reply #393 on: December 02, 2011, 02:23:00 pm »
Ok, now I understand. In fact, everything's fine. I just had to make four images.

I tested the border features, it works fine !  :)

So in fact, you need to have for each state an image which has a border, and inside some content that can be repeated. Then with FillCenter option, it gets repeated while the borders stay as they are.

That description is going to the wiki  :)

digeo

  • Jr. Member
  • **
  • Posts: 54
    • Digeotek
Re: BGRAControls
« Reply #394 on: December 09, 2011, 11:51:05 am »
Hi

I just switched to Lazarus from Delphi and I am very excited about the BGRA based components and libraries.  ;D

Just 2 questions

Is there a method to determine which part of the button has been clicked on when using dropdown style. In other words, the button part or dropdown part.

Can we download a button maker somewhere like an app that you can choose colors etc to design the button with check boxes and color selectors.

lainz

  • Guest
Re: BGRAControls
« Reply #395 on: December 09, 2011, 04:18:54 pm »
Hi

I just switched to Lazarus from Delphi and I am very excited about the BGRA based components and libraries.  ;D

Just 2 questions

Is there a method to determine which part of the button has been clicked on when using dropdown style. In other words, the button part or dropdown part.

Well  use the event 'OnButtonClick'- But seems that doesn't works?

Try the new version BGRAControls 1.2.0.6:
- Now 'OnClick' fires when the button is clicked and 'OnButtonClick' fires when the dropdown part is clicked.

Quote
Can we download a button maker somewhere like an app that you can choose colors etc to design the button with check boxes and color selectors.

No, there isn't a button maker, you can use the Object Inspector.
« Last Edit: December 09, 2011, 04:34:57 pm by lainz »

lainz

  • Guest
Re: BGRAControls
« Reply #396 on: December 10, 2011, 04:46:57 pm »
@Dibo

You can check 'testbgracontrols' and enable the debug in TBGRAButton (line 49) and then check 'bgraimagebuttontest'  and enable the debug in TBGRAImageButton (custombgraimagebutton.inc line 11).

Seems that the button is repainted in some cases that is unnecesary. In TBGRAImageButton I've partially* solved that using the code in TCustomBitmappedButton invalidating only when neccesary:

Code: [Select]
procedure TCustomBitmappedButton.DoButtonDown();
var
  NewState: TBitmappedButtonState;
begin
  NewState := bbsDown;

  case FState of
    bbsNormal, bbsFocused: NewState := bbsDown;
    //  bbsChecked, bbsCheckedSelected: NewState := bbsCheckedDown;
  end;

  if NewState <> FState then
  begin
    FState := NewState;
    Invalidate;
  end;
end;

* Partially because sometimes when AutoSize is enabled the updateBmp is called twice and when I assign the bitmap from code.

lainz

  • Guest
Re: BGRAControls
« Reply #397 on: December 11, 2011, 03:06:58 pm »
BGRAControls 1.2.0.8

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

1.2.0.8:
- Now the 'enter' state works better when mouse pressed.
- Updated bgraimagebutton test.

1.2.0.7:
TBGRAImageButton:
- Added 'Animation': it's a nice glowing effect when mouse over and pressed. If you want your own animation you can create a control based on TCustomBGRAImageButton.
- Code optimization in 'UpdateBmp' thanks to circular.
« Last Edit: December 11, 2011, 05:56:55 pm by lainz »

wcleyton

  • Jr. Member
  • **
  • Posts: 80
Re: BGRAControls
« Reply #398 on: December 12, 2011, 02:48:13 pm »
I tried to compile version 1.2.0.8 with Lazarus-0.9.31-fpc-2.7.1-34124-20111212-win32.exe and did not install the components.

OS: Win XP SP3

Picture of the error attached.

lainz

  • Guest
Re: BGRAControls
« Reply #399 on: December 12, 2011, 03:03:00 pm »
I have too lazarus trunc but FPC 2.4.4 and works.

Try with FPC 2.4.4

digeo

  • Jr. Member
  • **
  • Posts: 54
    • Digeotek
Re: BGRAControls
« Reply #400 on: December 13, 2011, 12:47:41 pm »
 @circular

can you turn that color chooser (color wheel form) from lazpaint into a component to use as color picker? it then return the color value when the dialog is closed.

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRAControls
« Reply #401 on: December 13, 2011, 06:57:45 pm »
That's a good idea. I may do it someday.
Conscience is the debugger of the mind

lainz

  • Guest
Re: BGRAControls
« Reply #402 on: December 13, 2011, 11:29:10 pm »
BGRAControls 1.2.0.9
https://sourceforge.net/projects/bgracontrols/files/?

- Added 'Android' buttons in bgraimagebuttontest project. See "NOTICE.txt", if you use that images you need to put the file "NOTICE.txt" with your program.
 http://wiki.lazarus.freepascal.org/BGRAControls#TBGRAImageButton

- Apply ik patch to fix compilation problem in FPC 2.6.0 (rc).
 http://lazarus.freepascal.org/index.php/topic,15513.msg83436/topicseen.html

Takeda

  • Full Member
  • ***
  • Posts: 157
Re: BGRAControls
« Reply #403 on: December 14, 2011, 05:19:09 am »
The component which most active developed.. I love it..  :)

Thank you, Lainz.. ^^

Bit the rock solid.. break the worries about the OpenSource rumors coz It's always maintained and updated.. :)

That's why I love Lazarus, and that's why I always use BGRAControls + BRGABitmap.. :)

Salute..
-MT-
Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRAControls
« Reply #404 on: December 14, 2011, 02:21:51 pm »
Lainz & Circular, the winning team !   8)

And we should not forget about Dibo, the father (or mother?) of BGRAControls  :D
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018