Sunday, November 16, 2008

Updated Property/Method Replacement Dialogs Project

Jim Nelson has added some very cool new features to the Edit Property/Method replacement dialog project on VFPX. Among the new features are:


  • New columns in the grid showing the member hierarchy (native, inherited, or custom) and favorites.
  • Ability to sort the list by clicking on a column header.
  • Filtering so you can see only properties or methods and only native, non-native, inherited, or custom members.
  • Color-coding: in the image above, I specified red for custom members and blue for inherited.
  • Apply and Revert buttons that are enabled when you change an attribute; the grid is also disabled while you're editing a member to ensure you're finished before selecting another member.
  • Editing the value of native properties.

He also fixed a few bugs and updated the user interface to be cleaner. He made some similar UI changes to the New Property/Method dialog.

If you aren't using these dialog, you don't know what you're missing. They are so much better than the dialogs built into VFP that you'd be crazy not to use them. As great as they were, though, the changes Jim made take these dialogs up to a whole new level of productivity. Great job, Jim!

German DevCon

Rainer Becker and his staff once again put on a great conference. This was the 15th annual German DevCon, and my fourth time speaking at it. It was nice renewing acquaintances with people I only see once a year, such as Igor Vit, Hans and Gaby Lochmann, and of course Rainer, his wife, and their new baby.

I presented the two sessions I did at Southwest Fox--Creating Explorer Interfaces in Visual FoxPro and Advantage Database Server for Visual FoxPro Developers--plus a new one, Practical Uses for XML. Since I'm not an organizer for this conference like I am at Southwest Fox, I had a lot more time to attend sessions. I saw Rick Schummer's Extending the Sedna Data Explorer and was inspired to start playing with the Data Explorer again. I also saw his two-part Using VFPX Components in Production Applications. Rick is a terrific speaker, but he outdid himself on these sessions. His enthusiasm for VFPX is infectious and he did a great job showing how some of the VFPX projects can breath new life into the user interface of your applications.

I also saw Tamar Granor present We Used to Do it That Way, But …, a great refresher session on when and why to use some of the newer functions in VFP. I learned several new SQL tricks I wasn't aware of in her Solving Common Problems with VFP’s SQL session. However, the session I liked best was her Making the Most of the Toolbox session. I'd played with the Toolbox a bit before but never got into the habit of using it. However, she showed some ways the Toolbox can make you more productive, such as automatically executing script code when you drop a control on a form. For example, I'm going to create a script for my OK and Cancel button subclasses to automatically name them cmdOK and cmdCancel when I drop them on a form, saving me the time to do that every time I use those controls.

Two sessions I looked forward to seeing were Bo Durban's Creating Custom Report Controls with Sedna and VFP9 and SP2 Reporting Component Basics sessions. Bo has done some really cool things with the new features added to the Report Designer in VFP 9 SP2. I got some great ideas for features to add to Stonefield Query from his sessions plus learned a few things I didn't know, such as how to get a custom page in a report designer dialog to see the changes made to properties on other pages (set Thisform.Frame.AutoRefreshOnPageChange to .T.).

I also watched Kevin McNeish present Building Rich Internet Applications in Silverlight 2.0. He discussed how Silverlight can be used to create rich interfaces for Web applications and showed some cool demos, including zooming in and out of a library of images, that really couldn't be done any other way.

Ken Levy discussed the status of VFP in the keynote session. He reminded everyone that the future of VFP is in the community's hands now, primarily through projects on VFPX. He also did a bonus session one night showing some of the utilities in Sedna (My and .NET4COM) and a new code searching tool he's created called AppScanX. He plans on submitting AppScanX as a VFPX project, but if you want to find out more about it now, listen to his interview with Andrew MacNeill in The FoxShow #60.

As is normal for this conference, there's a ton of delicious food. You definitely have to pace yourself at this conference, because Rainer says his goal is for attendees to gain 5 kg (more than 10 lbs). I tried to be good by not going for seconds, skipping dessert on all but the last meal (the speaker dinner Saturday night), and working out a couple of times in the hotel's exercise room (the best equipped I've ever seen in a hotel) but fear I'll have to work a little harder on the bike for a few weeks once I get home.

Thanks again to Rainer and his right-hand Tina for putting on a terrific conference. You can read more about it on the Universal Thread's coverage by Jan Vit and Jan Kral.

Setting the Background Color of a TreeView Control

Although disabling a TreeView control is easy (you have to set oTree.Object.Enabled rather than oTree.Enabled), making it appear disabled is a different matter. One way to do it is to set the background color of the control to a disabled-looking color. However, when you try to do that, you'll discover the TreeView doesn't have a BackColor property.

The trick to setting the background color of the TreeView is to use some API calls. Also, you need to set the BackColor of each node. Here's the code to do that. Pass it a reference to the TreeView and the RGB value to use for the color.

lparameters toTree, ;
local lnhWnd, ;
loNode, ;

* Declare some Windows API functions and constants we need.

declare long GetWindowLong in Win32API long hWnd, long nIndex
declare long SetWindowLong in Win32API long hWnd, long nIndex, ;
long dwNewLong
declare SendMessage in Win32API long hWnd, long Msg, long wParam, ;
long lParam
#define GWL_STYLE -16
#define TVM_SETBKCOLOR 4381
#define TVS_HASLINES 2

* Get the TreeView's window handle.

lnhWnd = toTree.hWnd

* Set the BackColor for every node.

for each loNode in toTree.Nodes
loNode.BackColor = tnColor
next loNode

* Set the BackColor for the TreeView's window.

SendMessage(lnhWnd, TVM_SETBKCOLOR, 0, tnColor)

* Get the current style, then temporarily hide lines and redisplay them so
* they'll redraw in the new color.

lnStyle = GetWindowLong(lnhWnd, GWL_STYLE)
SetWindowLong(lnhWnd, GWL_STYLE, bitxor(lnStyle, TVS_HASLINES))
SetWindowLong(lnhWnd, GWL_STYLE, lnStyle)

Monday, November 10, 2008

Off to Germany

Tomorrow morning, I'm heading to Frankfurt for the 15th annual German DevCon. This is such a great conference: the sessions are interesting, the food is incredible and in copious amounts, the beer flows freely, even during evening sessions, and it's fun meeting people from other countries sharing a common interest.


Friday, November 07, 2008

Southwest Fox and VFPX

One of the goals of Southwest Fox was to increase the exposure of VFPX to the VFP community. At several conferences last year, Rick Schummer asked attendees how many were familiar with VFPX and was astounded at how few hands went up. So, we purposely had several presentations on VFPX at Southwest Fox this year, including showing some of the projects in the keynote and having a bonus session on VFPX, both of which are available on streaming video. The idea was not just to get more people downloading the various cool VFPX projects but also to fire up the imagination of the VFP community and get more people participating.

It looks like the plan worked. Joel Leach started a new project for the FoxTabs utility (not a new utility but it was languishing and wasn't a community project); he also started blogging. Jim Nelson and Matt Slay started working on the New and Edit Property/Method Replacement Dialog project and have added several cool new features, including filtering by member type. A new person is helping Andrew MacNeill with the Code Analyst project. The VFPX administrators have received submissions for other projects that hopefully will come online soon.

So, what's your idea for a VFPX project? What tools have you created that make your development life a little easier? Or perhaps you have ideas that will take an existing project to the next level. It's time to share them with the community.