Thursday, March 26, 2015

ButtonX Class - ssUltimate Library

As much as I do not want to post here classes of ssUltimate that I retained strictly for my subscribers, since I no longer explain what changes I do now and then inside the library, then they have no way of knowing those; and therefore they are under utilizing it or does not know how to fully utilize it to their maximum advantage.

And so I decided that from now on, I will slowly post here those classes that remains hidden for others to serve as a guide for my Subscribers.  And to make it clear, those that are strictly for them will always have a suffix of - ssUltimate Library.

What is ButtonX?

ButtonX is my final button class which is the predecessor of ssButton series.  Any new features on a button class is done on this one.  This class is highly customizable based on the taste of the developer where you can change the position of the caption, change the theme, its color, etc.

What is new here?

It has better themes than its predecessors. Here are some of the themes, all with 6 colors to choose from, all with hover effect with color changing



Going Flat

Since flat seems to be the trend these days, I gave it new capability to become just like that, flat,  via the existing parameters plus 2 new parameters, i.e., nShpBackColor and nShpCurvature

To make it absolutely flat, all the user needs to do is to change the nTheme parameter into 0. Once you turn nTheme into zero, then it will ignore the existing built-in themes I designed as seen on the above image.  It will make those invisible.


But as you can see, the border is still there.  To turn it into really flat, turn nLineSpecialEffect paramater into 3, and that will remove the borders of the button:



But flat is not simply about removing the borders of the button.  If you look at the trend these days, there are round buttons, etc.  To make this easy, I added as mentioned two new parameters to help give that look, nShpBackColor and nShpCurvature

nShpBackColor = is the color of the new shape for the flat look.
nShpCurvature = is the curvature of that shape, default is 90.  This gives you the ability to make it round, not too much, etc.

On default curvature of 90


Change curvature, your choice.  Here is how it looks with 15 value


In addition to the above, there are 3 colors it does when it is on flatlook appearance:

a.  The color you set for the shape
b.  The color for disabled buttonX which is somewhat of lighter shade than the color you set
c.  Hover color, lighter shade that is slightly different than the disabled color

Mini-X

There is this 3rd additional parameter I have also added here called LWithX.  By default, it is set to .F..  When you turn this into .T., then when a buttonX gets disabled, aside from the effect on the caption and color, it will have a small round red X on the left topmost corner of the button like this:



Flat-look on TitleBarX

If you are not aware of what  TitleBarX is, then take a look at this link http://sandstorm36.blogspot.com/2015/01/titlebarx-class.html .

Now, assuming you already knew about that class which is among those I shared that is part of ssUltimate library, ButtonX can now work on that easy (only on theme 0).  That as you change the color of your objects in your form, ButtonX can now follow with a shade of your choice.

To make it work better with TitleBarX, then instead of setting up the button inside the class itself, you can do that inside TitleBarX' _SwapColor Method like this:

DoDefault()
Thisform.BackColor = This._shade(-.20)
Local lnWhite, lnShade1
lnShade1 = This._shade(-.35)
lnWhite = Rgb(255,255,255)
With Thisform.PageFrame1.Page1
      .BackColor = This._shade(-.18)
      .contSearch.BackColor = This._shade(-.42)
      .cmdAdd._settings('\<Add',0,6,'new1.bmp',2,'Create a new borrower',.T.,,,13,m.lnWhite,,,3,m.lnShade1)
      .cmdEdit._settings('\<Edit',0,6,'openx.bmp',2,'Edit details of an existing borrower!',.T.,,,13,m.lnWhite,,,3,m.lnShade1)
ENDWITH





The last one showing the red X marker when the buttons are toggled as Disabled.  So when you use this last parameter, when you toggle the buttons, aside from the colors, you can easily spot the disabled one via that red X.

I will update soon my subscribers with ssUltimate after I finished posting guides on the latest inside the library.  One is about the new ConX class, the latest class I made to work with TitleBarX as well.  This ConX class can work as a container, a button, and a pageframe tab, your choice.



This also works hand-in-hand with TitleBarX giving you a flat look interface.


Dang, the colors on my laptop is really different than the external LCD, LOL!  Anyway, that is one point of ssUltimate especially the recent classes I made.  To give users the capability to choose whatever color that suits their eyes, individually, anytime.  And considering that every screen have different color balancing, then that fixes also the color difference that looks good on one but not on others.

Needless to say, depending on your taste, xButton can give you cool looking embossed buttons or  flat with curvature of your choice.

So what is ssUltimate Library?  Well all I can say is this library will give your app something that is not looking like a standard VFP app.  When I first created my very first library _sandstorm36, my plan is to terraform VFP Forms.  :)

1 comment:

  1. It is unbelievable, how much effort this guy put, to make our life easy and beautiful to make our forms to look like a thousand of code

    ReplyDelete