This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

danpost
danpost presents ...

2012/6/18

Menu Demo

A simple to use menu and button class demo. Create a menu object by sending it an array of strings for the text to display on each button object. A second constructor allows also sending a flag to indicate cancel option open or closed. Multiple methods are provided to alter the appearance of the buttons, as well as changing their active state. The Button class that the Menu class uses can be used by itself to create stand-alone buttons objects or text objects; however, if you use the Menu class in a scenario, you must also have the Button class in it.

Clicking on an active title button object will cancel the menu (remove it, without a selection being made)

The string array contains the title text first, and the option text after.

Options appear confortably on screen if given 25 pixels per option, height-wise.

Active buttons enlarge and brighten when mouse hovers over them.

The latest update includes adding two more sub-classes for the Button class: a 'BlinkText' sub-class (for text that alternates colors) and a 'Marquiss' class which allows the text to scroll across the button. Click on a title button (like 'MENU 0') for examples.

13811 views / 36 in the last 7 days

8 votes | 0 in the last 7 days

Tags: mouse demo with-source menu text button danpost support-class option

This scenario is a member of: Demos by danpost, Support Classes by danpost


open in greenfoot
Your browser does not support the canvas tag.
danpostdanpost

2012/8/10

@Cocky, I believe 'nicht schlecht', translated into English, is 'Not bad'. Am I right?
CockyCocky

2012/8/11

Ja danpost. Aber ich bin eben deutscher!!!
SPowerSPower

2012/8/11

@Cocky aber Deutsch reden ist schwer für die meisten hier In hope this is valid German :)
A new version of this scenario was uploaded on Mon Aug 20 05:24:56 UTC 2012 Added to more sub-classes to the Button class. One for blinking or alternating color text; and the other for scrolling text.
A new version of this scenario was uploaded on Wed Oct 17 16:04:50 UTC 2012 Forgot to include source on last update.
waiswais

2015/1/1

may i ask source code?
danpostdanpost

2015/1/1

@wais, the source IS available. Just click on the big green 'Open in Greenfoot' button above and to the right of the scenario window.
A new version of this scenario was uploaded on 2017-01-19 19:00:14 UTC Updated due to not running on site (for unknown reason).
A new version of this scenario was uploaded on 2019-08-28 19:09:40 UTC
@SPower, yea that is valid German!

See all comments

Want to leave a comment? You must first log in.

Who likes this?

henryufo85 JannisMartensen TomazVDSN mrs.mounsey toytttttt SPower Cocky sparrow72