Monday, August 20, 2007

Designing Enhancements for Visual Subclasses
-and VFP's designers

I've been toying around with some ideas I had sometime back. I wanted to find ways to not only create sublclassed controls that work as dynamically at design-time as the VFP baseclasses, but also create additional designer features in Visual FoxPro starting with the Form and Class designers. The following 15 minute screencast shows how both of these things can be accomplished using existing Visual FoxPro IDE features and events.


[click to watch the entire screencast]


Just a Hint of Things to Come?
-I think so

The animated GIF above is showing a simple Visual FoxPro container control containing 3 buttons to simulate a scrollbar class. Creating a subclass like this is obviously very easy, however what you might find interesting is that the size, position, and even the picture property of the controls contained in that subclass are being dynamically changed at design-time (yep, that's design-time, not to be confused with run-time) in response to my changes to the container itself.

Watch, Download, and Review
-feedback is always appreciated

If you are interested in how this is made possible and what it might mean for Visual FoxPro moving forward, then I urge you to watch the screencast and download the source code provided below.

Download the xfcDesigner Screencast for Offline Viewing (approx. 8.4 MB)

Download the xfcDesigner Source Demonstrated in the Screencast (approx. 8 KB)

Monday, August 20, 2007 1:09:40 PM (Central Daylight Time, UTC-05:00)  #    Comments [12]
Tuesday, August 21, 2007 12:50:48 AM (Central Daylight Time, UTC-05:00)
Craig,

You and Bo are pure genius. This solution is so simple. The only time it would fail is if the Property Sheet is not open, but I think that is really rare. What happens if your Property Sheet is docked and is not visible (like behind the Command Window in your docked environment)?

The evaluation of the property in the Property Sheet might be a way to get a custom developer toolbar to stay alive through a CLEAR ALL.

Rick
Rick Schummer
Tuesday, August 21, 2007 1:09:37 AM (Central Daylight Time, UTC-05:00)
Actually this works even if the property sheet is closed. Try copying the scrollbar subclass that is on the form a few times. You'll notice that the behavior still works.

However, when dragging the control on to the form from the classlib or throwing it on from the form controls toolbar it doesn't work right away. The reason is that there is an asterisks on the front of the designerstart property. I am currently putting it there so that the developer has to remove it so that the property is no longer the default value that is contained in the baseclass. Why? Well, VFP doesn't evaluate properties in a subclass that come from the baseclass and are still the default value.

Bo and I have been kicking around some ideas for getting around this, and one of them would be using an external FLL to handle everything instead of relying on VFP's property evaluation behavior. But for now, I figured this was a start and worth showing.

As you've noted there are some real possibilities here. Getting around the Clear All would be great. Thanks for stopping by Rick.
Tuesday, August 21, 2007 6:20:58 AM (Central Daylight Time, UTC-05:00)
Craig

I am completely blown away. This is something I have always wanted and could not have... till now.

I have gotta examine this in more detail and look at the possibilities, especially the MemberData stuff.

Absolutely awesome.

Bernard
Tuesday, August 21, 2007 6:40:21 AM (Central Daylight Time, UTC-05:00)
Bernard,

Glad to hear that you were suitably impressed. I look forward to your feedback and ideas. Thanks for stopping by.
Tuesday, August 21, 2007 7:44:23 AM (Central Daylight Time, UTC-05:00)
Two ways :-)
<a href="http://mail.ctkrepro.cz/fox/clanek.php?id=c3a7689e3bc768">Dynamicaly change postion and size of object at designe time</a>
<a href="http://mail.ctkrepro.cz/fox/download.php?id=23">IRes component</a>
Tuesday, August 21, 2007 8:25:28 AM (Central Daylight Time, UTC-05:00)
Wow this is really cool. I'm going to have to do with my controls.
Ken Knorr
Tuesday, August 21, 2007 11:40:02 AM (Central Daylight Time, UTC-05:00)
Absolutely terrific !!!
This is something I always wanted, but had completely lost my hopes.

Apart from all the great ideas that you've shown in your screencast, I'd like to see these techniques aplied to Carlos Alloatti's VFPX controls.

Craig,
Thanks very much for this new one.
I just wish I had enough time to play and really dig deeply into all the possibilities you bring.

Now I really believe that we have in our hands true conditions to extend and expand VFP by the community hands.

Regards
Cesar
Tuesday, August 21, 2007 1:40:51 PM (Central Daylight Time, UTC-05:00)
Brilliant! Thanks a lot for sharing that, it's some great stuff. Just selecting a property and pressing Enter forces the property to be set explicitly to the inherited value. Assuming that causes the property to be evaluated in the designer, that would be a slightly simpler solution that removing an asterisk. I downloaded the code and will be trying that out. But if someone can come up with an FLL or something which fires immediately, that would be sweet.

Fox Rocks!
Mike
Friday, August 24, 2007 5:53:13 AM (Central Daylight Time, UTC-05:00)
Craig,

Thanks for this new ideas, this is really great stuff. Visual foxpro controls will be much more flexible with this codes. This is a whole new concept in foxpro design...

Lando

Rolando Pelpinosas
Wednesday, December 12, 2007 10:55:42 AM (Central Standard Time, UTC-06:00)
Gracias, excelentes tips, sigue adelante.
Wednesday, May 28, 2008 2:30:32 AM (Central Daylight Time, UTC-05:00)
That's great~~~But how can I apply this feature in my control, it seems not easy, let me try~~~
Tuesday, July 01, 2008 12:08:59 PM (Central Daylight Time, UTC-05:00)
Hi Craig,
fantastic stuff. Saw this on your initial post, but had not found time to test it. What an impressing stuff!!!!

We downloaded your code today and found a little glitch which you could easily correct.

In your timerevent of your xfcdesigner you use a loop around bindevent() to handle more than one event. Unfortunately your usage of Splitting-Characters in ALINES() is wrong.

Wrong: ",; ")
Correct: ",",";"," ")

Just a glitch, nothing showstopping :-)))

We are using a container of checkboxes (like the radiobutton-"container"). With your fantastic idea we now can increase the membercount and voilá: more checkboxes appear by magic.

So again Thanks for your great work and contributions to the Fox-community.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u)  

Enter the code shown (prevents robots):


 

Archive

<July 2008>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789