Mega Code Archive

 
Categories / Delphi / Examples
 

TBarPopupMenu Make your PopupMenu look like Start menu in a few seconds!

Title: TBarPopupMenu: Make your PopupMenu look like Start-menu in a few seconds! Question: This is continued part of my article at www.delphi3000.com. Article ID 1133, http://www.delphi3000.com/article.asp?id=1133 I got requests to make component which would wrap bar drawing I introduced in my earlier articled. So, here it is! Answer: Component: TBarPopupMenu ====================================================================== Bluecave Software (C) Copyright 2000, Jouni Airaksinen (Mintus@Codefield.com) ====================================================================== Last Updated date: 2000-06-28 (yyyy-mm-dd) ---------------------------------------------------------------------- Download the latest version of the component from: http://Mintus.Codefield.com/download/BarPopupMenu.zip -- Version 1.1.0 -- (2000-06-28) - Made the drawing to use double buffer. Now it can refresh the bar part when needed and doesn't give flicker. This modification also allows to e.g. animate the bar easily ... when I have the time to add animation stuff.. - Bug: If you don't have menu glyphs assigned to any item, drawing of items bugs. This happens with normal TPopupMenu as well. Probably some VCL 'bug'. I have fix to this, but need to test it first. (note, this bug has been in all earlier versions too) -- Version 1.0.3 -- (2000-06-24) - Support for my Expanding menu component system ( ignores items with caption as '#' ) -- Version 1.0.2 -- - property BarVisible: Boolean -- Version 1.0.1 -- - Fixed bug with VerticalFont assignment with elipses button -- Version 1.0.0 -- - First release This is continued part of my article at www.delphi3000.com. Article ID 1133, http://www.delphi3000.com/article.asp?id=1133 TBarPopupMenu component for Delphi 5. Be my guest and use it where-ever you like, just mention my name and e-mail somewhere in your software. Copy/Paste here, "TBarPopupMenu, Copyright 2000: Jouni Airaksinen, Mintus@Codefield.com" There is demo program at Demo\ directory. New properties in TBarPopupMenu: property Bitmap: TBitmap Bitmap to be positioned somewhere in the popupmenu (e.g. application logo) property BarWidth: Integer Width of bar on the left side of popupmenu property BarVisible: Boolean If this is set to false, no bar is drawn or displayed in anyway. property BitmapOffsetX: Integer property BitmapOffsetY: Integer Offset values to position bitmap property BitmapVertAlignment: TBitmapVertAlignment property BitmapHorzAlignment: TBitmapHorzAlignment Alignment values to position bitmap, fine tune position with Offsets property GradientEnd: TColor property GradientStart: TColor Gradient colors, if set to same color it is drawn with one FillRect call property Transparent: Boolean Transparency of Bitmap property VerticalFont: TFont property VerticalText: string Vertical text and it's font on the bar property VerticalTextOffsetY: Integer Offset for vertical text, normally you want it to be negative e.g. defaults to -6. Notes about root Items: You can't assign (well you can, but events don't get executed) OnMeasureItem nor OnAdvancedDrawItem events to root items. Maybe I fix this later, if someone really needs those.. Otherwise, you can use Actions and other stuff normally. ---------------------------------------------------------------------- Questions to, Jouni Airaksinen, (programming: Mintus@Codefield.com; personal: virgin@sci.fi) Bluecave Software, (http://www.bluecave.net/) Codefield.com, (http://Codefield.com/) == COPYRIGHT, FEES & DISCLAIMER ====================================== YOU MUST include my name and e-mail address somewhere in your application; Splash screen, About screen, readme file or something else. Place where it's readable by normal user. "TBarPopupMenu, Copyright 2000: Jouni Airaksinen, Mintus@Codefield.com" THIS CODE is free. Yes, free. I'm not going to ask any money from you. Remember to mention my name and you are ready to go. You may use this in your products which are: freeware, shareware, commericalware, whateverware. ---------------------------------------------------------------------- COPYRIGHT remains with me. If you are going to use my code as base for your own component(s), please ask permission first. I want to know how my code is used. You are NOT allowed to claim that you have created this/these component(s) or to copy it's code into your own component(s) and claim that it was your idea. My name and e-mail must be present. IF YOU FIND bugs or alter the component(s), please DO NOT just send the corrected/new code out on the Internet, but instead send it to me. This way I can put it into the official version, if I find your code useful. You will get the credit. IF YOU USE; You agree to accept my changes into the component(s). Even if it would cause work for you (please contact me if amount of work goes into another millennium, maybe we can have some peaceful solution). BY USING this/these component(s), or parts, you are accepting the full responsibility of it's use. You agree not to hold me responsible in anyway of any problems from the use of this/these component(s). IF I DECIDE to make my component(s) commercial, it's my decision. Also if I want to stop developing my component(s) any further, I'm allowed to do so (Most likely, if component(s) is commercial, I will develope it as long as there is need for it). FINANCIAL LOST caused by my component(s) (including possible registration fee of my component(s)) is not my headache. You cover your loss. Jouni Airaksinen (Mintus@Codefield.com) Web: http://Mintus.Codefield.com/ ======================================================================