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

Report as inappropriate.

bourne
bourne presents ...

2013/3/1

GUI Components

Originally uploaded around November 2010.

Reusable GUI components.


What’s the big new thing?
- TextBox: Selecting Text, and Copy/Cut/Paste abilities on clipboard.
- Windows and Containers (Find examples from the Menu in the top left corner).

GUI_Component
--WindowComponent
----DropDownList
----TextBox
----Slider
----Menu
----Button
------SwitchButton
----ListBox
----Label
------CheckBoxLabel
----ImageHolder
----Container
----Spacer
--Window
----Palette
----ConfirmWindow
----InputWindow
----FontWindow
----SelectionWindow
----MessageWindow
----TextWindow


Note: No subclass of GUI_Component should appear in World's paint order:
setPaintOrder(GUI_Component.class);

8519 views / 40 in the last 7 days

17 votes | 0 in the last 7 days

Tags: mouse demo menu reusable gui textbox label button bourne palette

This scenario is a member of: Reusable actors & support classes


open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

shrucis1shrucis1

2013/12/21

Hey bourne, when looking at your code, I noticed this interesting little statement: if(CodeGenerator.haveUser())... But the source code for Code Generator was not included. When I changed this statement to false, I notice that this appears at the end of the textbox: "Enter this code into bourne's Residents scenario: OVGDPLDO" Just curious, but what does this mean? I couldn't find your Residents scenario, if you have one.
JetLennitJetLennit

2013/12/21

Is it a part of your project?
oooh! Is this the secret thing you were talking about previously?
bournebourne

2013/12/21

It is indeed my big project that is nearly ready. The code will unlock something in it for you. The code will be different from that what it gave you now. And unique to you, more details when I upload my project.
A new version of this scenario was uploaded on Sun Jan 26 00:51:52 UTC 2014 Made all text anti-aliased. Bug fixes. Improvements. Made the Demo World code more readable.
A new version of this scenario was uploaded on Fri Jan 31 21:21:45 UTC 2014 A couple small fixes to the TextBox. ** The select Color is no longer set permanently as Yellow, but now uses GUI_Component selectColor - influenced by the static setDefaultColors method, and can be changed via the inherited setSelectColor(Color) method. ** Using the setText(String) method will reset the scroll to the "top", was a noticeable bug when having scrolled down some text, then using the setText method with a sufficiently large String
A new version of this scenario was uploaded on Mon Mar 10 19:22:17 UTC 2014 GUI_Component now has a protected method redraw() which is called whenever one of its set color or font methods are invoked. This method is used for those GUI_Components that avoid redrawing every act cycle. Overwrite it to make use of it. The Container class now listens for if its components have resized, needing to redistribute them. Included the Spacer and ImageHolder classes. A number of other improvements.
A new version of this scenario was uploaded on Mon Apr 28 19:18:04 UTC 2014 * TextBox: double/triple click to select "word" or line. Small fixes to FontWindow. * Improvements to ListBox. ListBox only redraws when needed. ListBox has better border. Some small improvements to GUI_Component. * Improvement to DropDownList. Additional fix on Window close on lose focus bug. * Button and Window now have better border, no longer single line. CheckBoxLabel enable/disable feature. Improvements to Window. Window bug fix where if the Window is set to close when lose focus, it closed if one of its components were clicked on and not gaining focus before Window realizes it no longer has focus.
A new version of this scenario was uploaded on Mon Apr 28 21:52:52 UTC 2014 TextBox focusable enable/disable feature. Fix where select by dragging would deselect when finished.
RidicolasRidicolas

2016/11/26

its not running :(

See all comments

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

Who likes this?

Nosson1459 ElNo Topdeck1 Pointifix MrHam Kartoffelbrot JetLennit Zamoht Gevater_Tod4711 MatheMagician SPower plsurveyor FlyingRabidUnicornPig Builderboy2005 Reflection Upupzealot birdy