Foxite.COM Community Weblog

Foxite.COM Community Weblog - free weblog service for the Visual FoxPro Community.
Welcome to Foxite.COM Community Weblog Sign in | Join | Help
in
Home Blogs Forum Photos Forum Archives

Luis Guillermo Navas Dangel



Visual FoxPro Popup Class

Hi to all, when I saw Emerson Reed Outlook Class I love it at the first time, so I tried to create my small contribussion to this community that has give me a lot.

That is how this class was born, I'm taking some ideas from the Emerson source, and other that came to my mind while I was working. The class it's free, and it's really easy to use:

Take a look at this code:

Public oPopup As Object
Set Classlib To popup Additive
oPopup=NewObject("popup","menus")
With oPopup
    .AddPad("New","FileNew.Bmp","New File","Modify Command Temp")
    .AddPad("Open","FileOpen.Bmp","Open File","Getfile()")
    .AddPad("Save As...","FileSave.Bmp","Save File","PutFile()")
    .Addpad("\-") &&Separator
    .AddPad("First","NavigateFirst.bmp","Navigates to First Record","Messagebox('You Selected First Previous')")
    .AddPad("Previous","NavigatePrevious.bmp","Navigates to Previous Record","Messagebox('You Selected Navigate Previous')")
    .AddPad("Next","NavigateNext.bmp","Navigates to Next Record","Messagebox('You Selected Navigate Next')")
    .AddPad("Last","NavigateLast.bmp","Navigates to Last Record","Messagebox('You Selected Last Next')")
    .Addpad("\-") &&Separator
    .AddPad("Disabled Item and without Picture","","Selects all data in the Current Control","Messagebox('Disabled')",".F.")
    .AddPad("Last Popup Item","","Selects all data in the Current Control","Messagebox('Last Popup Item')")
    .Show()
EndWith

This will create a popup like this image:




The class will detect in an automatic way the 3 standard themes of XP.

Olive


Silver


The AddPad method will receive this parameters:
lcCaption As String
Caption of the Menupad
lcPicture As String
Picture to use in the Menupad
lcMessage As String
Message to display in Statusbar when selected or mouse over it.
lcCommand As String
Command to run when the user clicl on the pad
lcSkipFor As String
Expresion that must evaluate to boolean to enable or disable a menupad.

Future Features that I wish to add:

1. Enable to handle Sub Popups.
2. Create a MenuBar
3. Create a Builder
4. Ability to define shortcuts and support for hotkeys
5. Support to any Windows XP Theme.
6. Create a toolbar base class to be partner of the menubar
7. Fix all the bugs it may have.

If anyone of you is interested in make it better, feel free to do it, I'm sure a lot of people will come with better ideas than this. Just let me know any update and please share it with all VFP developers.

I hope you like

Take care

Luis Navas

Published Monday, October 02, 2006 11:42 PM by luisn
Filed Under:
Attachment(s): MenuTest.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Rajesh said:

Luis,
Extremely interesting..
Thanks for sharing it with us.
Regards,
Rajesh
October 5, 2006 11:04 AM
 

Bernard Peligro said:

Hi Luis! I like the popup! it's so cool! I hope you could share with us your future features!

Thanks!

Bernard Peligro
October 9, 2006 3:49 AM
 

MikeSP said:

The Attachment(s): MenuTest.zip downloads a fle named 2579.ashx. What's up with that?
October 9, 2006 3:35 PM
 

Michael Mead said:

I cannot download the file.  I get an XML error.
October 20, 2006 6:29 PM
 

Cesar Chalom said:

Hola Luis,

I don't know how this post escaped to me...

Very interesting and easy to use.
Great job !

Did you manage to improve the class ?

Your class may cause a small bug on the creation of the gradient background for the pads.

Please add a ".DLL" in the declaration of the GDI+ gradient function.
It needs to be this way:

* Declare API
Declare Long GdipCreateLineBrushI In GDIPlus.DLL ;
String point1, String point2, ;
Long color1, Long color2, ;
Long wrapMode, Long @lineGradient

You can obtain more info here:
http://weblogs.foxite.com/cesarchalom/archive/2007/01/24/3178.aspx

Hope to see this class improved !
Thanks
Cesar
January 31, 2007 5:11 PM
 

Koen said:

I feel this is a welcome extra to the OutlookMenuClass.
Regards
Koen
May 9, 2007 10:51 PM

What do you think?

(required) 
(optional)
(required) 

This Blog

Post Calendar

<October 2006>
SuMoTuWeThFrSa
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

Post Categories

Syndication