Thursday, October 6, 2011

ssMonthCal class


This class is based on my ssCal sub-class.  The main differences are it does not contain a front page, it does not contain any outside image, it is easier for user to navigate between months and years, and it will not clutter your form where this class will be dragged with a lot of unnecessary objects that the class has.

This is an experiment how to make some of my classes pretty without the need for an outside image and I think I can safely say that the experiment is a success.  This class uses all native VFP objects like shapes, optiongroup, spinner and combobox.  This is neater and leaner both in objects and codes versus its ancestor ssCal classes.

Since ssClasses are known for its ability to provide the developer different colors as each of us has our own taste, right now this have 7 colors:




Its usage is really simple.  Just drag it in your form and it will work on default values which is Green (4) and current date.  If you want to specify the color or the date, then double-click it and on its INIT event, type:

This._settings(6,date()-5)  

That will mean color blue and date will be current date minus 5 days.  Colors are numbered 1 to 7:
1 = red
2 = orange
3 = yellow
4 = green (default)
5 = brown
6 = blue
7 = pink

This class can immediately perform any action when the date is changed.  Let us say that you have a grid on your form and that you wanted to repopulate it with new values based on the date you will select on the class.  So in the class' CLICK event, do something like this:

Click Event:
thisform._gridrefresh()    && a method that will repopulate the grid with an SQL SELECT...

To get its value is just like on any other native VFP objects.

ldDate = thisform.ssMonthCal1.Value
Messagebox(thisform.ssMonthCal1.Value)

Note:  The title bar you see here is ssTitleBar class and is using Theme 3 Blue.  ssTitleBar can change the color of the title bar on the spot via ssSpinner class embedded onto it (left side of the bar).

See a sample below (click it to see the actual size):


For the current listing of ssClasses, click this link:  http://sandstorm36.blogspot.com/2011/10/ssclasses-components-list.html





No comments:

Post a Comment