// Copyright 2001-2005, Danger, Inc.  All Rights Reserved.
// This file is subject to the Danger, Inc. Sample Code License,
// which is provided in the file SAMPLE_CODE_LICENSE.
// Copies are also available from http://developer.danger.com/

package com.example.GUIDemo;

import danger.ui.Color;
import danger.ui.Menu;
import danger.ui.MenuItem;
import danger.ui.MenuWindow;
import danger.ui.Pen;

/**
 * This class demonstrates a method to override the drawing of the MenuWindow,
 * which pops up for Menu activation.
 * 
 * This will change the color of the Shortcut Icons. This is similar to the
 * phone application's Recent List, where it will add a green phone icon to the
 * end of the menu.
 */
public class DrawMenuWindow extends MenuWindow {

	public DrawMenuWindow(Menu arg0) {
		super(arg0);
	}

	public DrawMenuWindow() {
		super();
	}

	protected void drawMenuItem(Pen p, int left, int top, int right,
			int bottom, MenuItem item, int offset, boolean inEnabled,
			boolean inSelected) {

		// Just change the shortCut color for a simple demonstration of
		// drawing override.
		item.setShortcutColor(Color.GREEN);

		super.drawMenuItem(p, left, top, right, bottom, item, offset,
				inEnabled, inSelected);
	}

}
