Quick Search for:  in language:    
example,ownerdrawing,menu,contrast,most,sampl
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Delphi Stats

 Code: 209,911. lines
 Jobs: 14. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for Delphi.
Record From Microphone to Wave File
By Una-Rat on 11/25


List Manager
By james hill on 11/17


Click here to see a screenshot of this code!Skin app
By Jonathan Curry on 11/15

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Flat menu

Print
Email
 
winzip icon
Submitted on: 12/7/2001 3:47:43 AM
By: Mark van Renswoude  
Level: Intermediate
User Rating: By 8 Users
Compatibility:Delphi 5, Delphi 4

Users have accessed this code 5635 times.
 

 
     An example of ownerdrawing a menu. But, in contrast to most samples, this one also paints the border of the menu... Next on my list is painting bitmaps on the menu for full customization, but this is a little more complicated if the borders are more than 3 pixels wide... Hope this helps :) (btw, had people test it on Windows XP, worked fine too)

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
12/7/2001 11:24:01 PM:kirse
Sweeet!  Only one thing... can you make 
the menu flat before the mouse hovers 
over it?  5 globes for you.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/10/2001 4:06:50 AM:Mark van Renswoude
I noticed that too, but the strange 
thing is, it only happens on some 
systems. Works fine on mine, but 
another computer, running Windows 2000 
too, displays the 3D 
border...
Working on a solution 
though, even if I have to fake the 
whole menu :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/12/2001 9:54:46 AM:Mark van Renswoude
Found the answer, I disabled menu 
transitions, but if you have the menu 
either scroll or fade in, the border 
looks 3D at first.
Still working on 
a solution :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/12/2001 10:15:38 AM:Mark van Renswoude
Got a solution, set MenuAnimation to 
maNone :)
This will disable both 
scrolling, and even fading in Win2K...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/21/2001 5:42:57 PM:kirse
Ok thanks.  I am running Win2k, so 
that's why I was seeing the "problem".  
Glad you could fix it!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/17/2002 12:24:04 AM:Kush Desai
Simple and excellent! This is the 
reason i chose Delphi in the first 
place. So easy to extend and customise. 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/30/2002 11:54:41 AM:Chen Friedman
five globes, although you can put some 
images in this menu 2.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/30/2002 8:17:34 PM:Vlad Vissoultchev
"Found the answer, I disabled menu 
transitions" - the funniest comment 
ever :-)) what you need to do is to 
implement WM_PRINT (and/or 
WM_PRINTCLIENT) message handler. This 
is used by the OS to "animate" the 
window content -- this includes fading, 
roll-up (like in menus and like 
combos). The idea is that the OS 
creates a memory dc, selects a bitmap 
and sends WM_PRINT with wParam being 
the dc handle to the control/menu for 
it to render its view. Then the OS 
grabs the bitmap and does whatever it 
likes with it.
check out my Office 
menus at 
http://www.planet-source-code.com/vb/scr
ipts/ShowCode.asp?txtCodeId=40518&lngWId
=1
HTH,
</wqw>
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/5/2003 10:55:21 PM:
I have 3d borders on win98 when the 
popup first appears, that's with 
MenuAnimation set to maNone, it works 
fine on win2000 and winxp but I guess 
it would be great if it works on 
98,
by the way great work
Kind Regards
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Delphi Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.