fgGradientButtons (Buttons with Gradient-Color)

derez

Expert
Licensed User
Longtime User
Version 2 updated in the first post.

Includes display of the button name and operating on imagebuttons as well.
 

corwin42

Expert
Licensed User
Longtime User
Hi Filippo,

can you please add a ControlRef property so we can get access to the Dock and Anchor properties of the control with the door.library?

Thank you very much.
 
D

Deleted member 103

Guest
Hi,

i have updated my library, Version 1.006.


@corwin42
ich habe die Dock and Anchor eigenschaft hinzugefügt, ich denke so ist besser.

I have added the property Dock and Anchor, i think that's better.


Ciao,
Filippo
 

corwin42

Expert
Licensed User
Longtime User
Ok thanks Filippo.

That works for me but it is a good idea to provide a ControlRef Property too to allow general access to the control and all its features. I think nearly all Custom Controls (at least all from agraham) for Basic4PPC have the ControlRef property.

But even without this your buttons look great. Together with the blist library it is possible to make applications that look quite "modern" now.

Thanks,
 

agraham

Expert
Licensed User
Longtime User
I've just looked at my previous post and to my surprise there is an error, although it was a cut and paste from a working example. Probably a case of the IDE letting you get away with things the optimising compiler doesn't accept.

It should be

B4X:
Obj1.New1(False)
Obj1.FromLibrary("Main.btnStart", "_btn", B4PObject(2))

There is not much to elaborate. Obj1 now contains a reference to a .NET Button so you can now do Buttony things to it.
 

Cableguy

Expert
Licensed User
Longtime User
Request

Hi Fillipo, is it possible to add the image modes to the button's images?

ie: cStretched, cCentered, etc

Thanks
 
D

Deleted member 103

Guest
Hi Fillipo, is it possible to add the image modes to the button's images?

ie: cStretched, cCentered, etc
I try it in the next version to implement.

PS. Filippo with 1 "L" and 2 "P" ;)
 
Last edited by a moderator:

Cableguy

Expert
Licensed User
Longtime User
Easter came a few days earlier, Thanks Filippo!!!
 

Cableguy

Expert
Licensed User
Longtime User
Hi Filippo,

The " WithPressedEffect" does not woek, the behaviour is the same either set to true of false!
 

klaus

Expert
Licensed User
Longtime User
Hi Paulo,
What are you expecting with the "WithPressedEffect" ?

I tried Filippo's example program and it works perfectly.

The "WithPressedEffect" means that when you click onto the button the colors are inverted, as soon as you release the button, the button gets the original colors.
If you are expecting a "toggle button" that means
1st click button pressed
2nd click button released
3 rd click button pressed
and so on.
This "toggle button" behaviour is not supported.

Hi Filippo,
Toggle buttons could be an interesting function !?

Best regards.
 

Cableguy

Expert
Licensed User
Longtime User
Hi,
Yes, I have tryed the example with the lattest dll version, but the "Shadow-Flip" occours either set to true or false, I was expecting NOT to have the "Shadow flip" animation...But I solved it by not having a gradient...
 
Last edited:

corwin42

Expert
Licensed User
Longtime User
Hallo Filippo,

das AutoScale des Buttons ist ein komplett eigenes und hat nichts mit dem AutoScale von B4PPC zu tun, oder? Es ist nämlich etwas merkwürdig. Ich habe einen Button definiert, der 22 Pixel hoch ist. Wenn ich die Anwendung auf meinem WVGA device starte, wird der Button in der Höhe um Faktor 2.5 vergrößert, nicht um Faktor 2. Die 0.5 ist genau der Faktor, um den WVGA größer ist als VGA. Damit ist der Button aber nicht mehr kompatibel mit dem AutoScale compile von Basic4PPC.

Kann man das Autoscale des Buttons irgendwie abschalten oder kann man es zum Basic4PPC autoscale compile kompatibel machen?


i think the autoscale of the button is different to the autoscale of B4PPC? It's a bit strange. I have created a button which is 22 pixels high. If I start the program on my WVGA device, the button is scaled by factor 2.5 and not factor 2 as expected. The 0.5 is exactly the size that WVGA is larger than VGA. With this the button is not compatible with the autoscale compile of Basic4PPC.

Is it possible to disable the automatic autoscale of the button or make it compatible to the Basic4PPC autoscale compile?
 
D

Deleted member 103

Guest
Hi corwin42,

das AutoScale des Buttons ist ein komplett eigenes und hat nichts mit dem AutoScale von B4PPC zu tun, oder?
genau! Ich berechne so:

exactly! I calculate this:
B4X:
 scaleX = screenWidth / 240

Deshalb empfehle ich dir diese vorgehensweise:
Therefore, I recommend this approach:
B4X:
Sub App_Start
   btnExit.New2("Form1", "", cWhite, 12, 170, 210, 60, 50, cWhite, cGray, True, True )
   Form1.Show
End Sub

Sub Form1_resize
   scale = ScreenScaleX
   btnExit.left= 170 * scale 
   btnExit.top= 210 * scale 
   btnExit.Width= 60 * scale 
   btnExit.Height= 50 * scale 
End Sub

Is it possible to disable the automatic autoscale of the button or make it compatible to the Basic4PPC autoscale compile?
Ich versuche es nach dem Urlaub zu implementieren.

I'm trying to implement to after the holiday.

Ciao,
Filippo
 
Last edited by a moderator:
Top