Tuesday, November 29, 2005

Proof of concept
The following is just a quick proof of concept, so please don't expect coding brilliance or even real great encapsulation in the class library. With that having been said, I decided yesterday that I would like to create something similar to the System Tasks panel that is shown on the left-hand side of Windows Explorer (when the folders panel isn't open). Now, that System Tasks panel uses a bunch of cool gradients, handles XP Theme colors and even fades the panels out when they are collapsing... none of which is in this proof of concept. Never-the-less, I like what I was able to come up with in a very short amount of time using pure Visual FoxPro.

Data driven
The content area of the panels in my creation is actually a grid, so the panels can be data driven. I create a cursor with the following structure...

CREATE CURSOR crsPanel1 (imgfile c(254), capt c(75), selected L, command c(254))

The imgfile field is the name of an image file that has been compiled into the exe, though you could use a fullpath for that if you have an images directory that you distribute. The next field, capt is used to designate what the caption should be for a particular item in the panel. Selected is just a boolean field that I use to control the underlining (via the column's DynamicFontUnderline) of the items as the mouse passes over them. And, finally there is a command field that will hold the VFP script to be executed (via the ExecScript function) when the user clicks on an item. You can find where I have built the cursors that data drive the 3 panels for the example I've included in the download in the Example form's load event. Pretty straight-forward stuff.

Possible use for the scrollable container
One of the improvements to this that I've been thinking of is using the Scrollable Container I created for an earlier blog entry to allow the container that is holding the panels (cparentpanel class) to provide a scrollbar when the stacked panels exceed the length of the form. But, I figure that it is good enough as is to at least put it out there and get some feedback. I recevied an email from Jonathan Clark some weeks back suggesting that something like the interface that is used at http://www.live.com/ would be a pretty cool thing to do with VFP. Eventually, I will encapsulate the expand and collapse functionality and some of the other features that most panels have these days so that it is seperate from the UI portion of this. Once that is done, creating controls and interfaces that provide this sort of look and feel will be a piece of cake.

XP Themes - possible future project
While I'm on the subject of things I'd like to do, I'd also like to get a handle on XP Themes as well. Though the gradients that themes use are difficult to mimic, it would be nice to get closer to the ability to implement some form of XP Themes on most the controls and custom classes we are creating. VFP's out-of-the-box UI already looks antiquated, and since the MS Fox Team doesn't appear to have this sort of thing on their radar at the moment, I think it would serve us well to do something about it. I can certainly draw most anything using GDI+, so maybe there is some things we can do to shore this up a little.

Download and screen shot
I'll stop myself with that lest I ramble for an hour or two... Here's the download link and a screen shot of VFP Panels in action. NOTE: When you run the example you'll notice that I allow the panels to be hidden (click the X in the top right-hand corner of the panel you want to hide). In order to re-show a hidden panel, right-click on the dark blue container and select the hidden panel from the Show context menu.

Download VFPPanels.vcx Source and Example (220 KB approx.)

vfppanels.jpg

Tuesday, November 29, 2005 10:02:13 AM (Central Standard Time, UTC-06:00)  #    Comments [7]
Tuesday, November 29, 2005 3:46:06 PM (Central Standard Time, UTC-06:00)
This looks very much like the Open-Dialog found in Visual Extend (http://www.visualextend.com/visualextend_en/default.htm). Been using this type of menu for a few years now - much more attractive then the traditional top menu.
Steve Harris
Tuesday, November 29, 2005 3:52:52 PM (Central Standard Time, UTC-06:00)
Why wouldn't you consider the Task Panel approach?
Tuesday, November 29, 2005 10:37:13 PM (Central Standard Time, UTC-06:00)
Hi Steve,

I went out and took a look at the manual they have available with Visual Extend, and it shows a screen shot of the Open-Dialog. It looks very much like the Windows Explorer task panel (System Tasks). Thanks for making me aware of this product (perhaps others as well).

Hi Andrew,

>>Why wouldn't you consider the Task Panel approach?

Are you referring to the fact that the panels don't look like the ones in Windows XP? Or is there something known as the "Task Panel approach" that I am unaware of? I would be more than happy to make this look exactly like the ones in Windows XP (in fact that's where I'm headed - though I wanted to scour the net for a screen shot of how MS did this in Vista first). I'm all for making VFP controls look and act like native Windows controls.

These panels are just a quick-and-dirty example. I didn't want to spend my time on the curved containers and gradients for this proof of concept. I do want it to have the ability to hide and show different panels. I was thinking that it should have the ability to allow the user to customize the Tasks presented if they want so they can customize their work space (developer could shut off this feature if they wanted to or would have full control over which panels are available and which panels can't be hidden).

If you have some specific suggestions on what you would like to see and features it should have, post a comment here or drop me an email Andrew. Your feedback is always welcome.
Wednesday, November 30, 2005 12:17:59 AM (Central Standard Time, UTC-06:00)
Very nice start. I went the extra mile and made the curved corners and gradient. I like your right-click hide a panel feature too. One other feature I added was the ability to make the whole panel "fly in/out" so that more screen real estate can be had. Kinda like VS.NET's IDE.

Keep those ideas flowing (over to SednaX?). VFP Rocks!
Mike
Wednesday, November 30, 2005 12:40:38 AM (Central Standard Time, UTC-06:00)
Hi Mike,

Thanks for the positive feedback. Your implementation sounds really cool. Is there somewhere that I could see an example of it?
Wednesday, November 30, 2005 12:57:51 AM (Central Standard Time, UTC-06:00)
Can I include a screenshot with my comments? If so, how?
Mike
Wednesday, November 30, 2005 11:36:40 AM (Central Standard Time, UTC-06:00)
Craig is Back!
Welcome back Craig

I would like to propose some enhanchments in this class since I have already implemented a similar class

1. OnTheFly created Gradient title background favor to Christof Wollenhaupt's code on Advisor Magazine.
2. Second image property in every option in case you want to have a disabled (second) picture option.
3. ChainControl property in the class in case you want to have the ability when you close this panel automatically the following panel be moved appropriately.
4. In my framework, the form has "Panel Guides", empty shapes controls where I want to have the panels. Every Panel Guide act as a proxy control. When a panel is being activated is looking for a non used placeholder and fits in.

Just some thoughts

p.s As I have said in the SednaX messageboards my classes are in community's disposal at any time. I wait for SednaX projects to be announced.

Vassilis Aggelakos
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

<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678