Widget Set: Difference between revisions
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
=Widgets= | =Widgets= | ||
[[Image:Widgets.png|The Widget and Layout classes]] | |||
==Base== | |||
Status: complete | |||
This interface defines the draw(), keyup(), and keydown() methods. Every widget will inherit this class. | This interface defines the draw(), keyup(), and keydown() methods. Every widget will inherit this class. | ||
keyup()/keydown() have boolean return types. These methods should return true if they processed the keystroke, and false if they did not. | keyup()/keydown() have boolean return types. These methods should return true if they processed the keystroke, and false if they did not. | ||
==Widget== | ==Widget== | ||
Status: complete | |||
A base Widget. This class can have a background image. Any class which will actually draw something to the screen should inherit this class. This class can draw a halo or something similar around itself if it is the active widget. | A base Widget. This class can have a background image. Any class which will actually draw something to the screen should inherit this class. This class can draw a halo or something similar around itself if it is the active widget. | ||
==Label== | ==Label== | ||
Status: complete | |||
Can draw a string | Can draw a string | ||
==TextEdit== | ==TextEdit== | ||
Status: complete | |||
Can take input, handles string modification. | Can take input, handles string modification. | ||
==Button== | ==Button== | ||
Status: Partially complete, need to improve callback mechanism | |||
A label that can activate a callback. It will contain separate images for each state. | A label that can activate a callback. It will contain separate images for each state. | ||
==Option== | ==Option== | ||
A button that has a state | Status: Complete | ||
A button that has a state. | |||
==OptionList== | ==OptionList== | ||
Status: not started | |||
A list of options. This class verifies that only one Option object is selected at a time. | A list of options. This class verifies that only one Option object is selected at a time. | ||
==Layout== | ==Layout== | ||
Status: complete | |||
An object of this class can contain other objects. It handles focus and widget traversal by the user. This base class will take coordinates to position its children. | An object of this class can contain other objects. It handles focus and widget traversal by the user. This base class will take coordinates to position its children. | ||
==GridLayout== | ==GridLayout== | ||
Status: Not started | |||
Positions its children in a 2 dimensional grid. | Positions its children in a 2 dimensional grid. | ||
==ListLayout== | ==ListLayout== | ||
Status: Not started | |||
Positions its children in a horizontal or vertically drawn list | Positions its children in a horizontal or vertically drawn list | ||
=Possible Changes= | =Possible Changes= | ||
*It may not be necessary for base and widget to be to separate classes. The only reason is if there is a need to differentiate between widget and layout objects. | *It may not be necessary for base and widget to be to separate classes. The only reason is if there is a need to differentiate between widget and layout objects. | ||
=Screen Shot of Current Work= | |||
Beware, programmer art shown: | |||
[[Image:Guisshot.png]] | |||
Shown here are two option boxes, three labels, three textboxes, and two buttons. These are contained by a hierarchy of three layout objects. |
Latest revision as of 19:21, 23 July 2008
Introduction
This is a suggested design of the widgets in the code. The old code is several years old, with very little work done on it.
Widgets
Base
Status: complete
This interface defines the draw(), keyup(), and keydown() methods. Every widget will inherit this class. keyup()/keydown() have boolean return types. These methods should return true if they processed the keystroke, and false if they did not.
Widget
Status: complete
A base Widget. This class can have a background image. Any class which will actually draw something to the screen should inherit this class. This class can draw a halo or something similar around itself if it is the active widget.
Label
Status: complete
Can draw a string
TextEdit
Status: complete
Can take input, handles string modification.
Button
Status: Partially complete, need to improve callback mechanism
A label that can activate a callback. It will contain separate images for each state.
Option
Status: Complete
A button that has a state.
OptionList
Status: not started
A list of options. This class verifies that only one Option object is selected at a time.
Layout
Status: complete
An object of this class can contain other objects. It handles focus and widget traversal by the user. This base class will take coordinates to position its children.
GridLayout
Status: Not started
Positions its children in a 2 dimensional grid.
ListLayout
Status: Not started
Positions its children in a horizontal or vertically drawn list
Possible Changes
- It may not be necessary for base and widget to be to separate classes. The only reason is if there is a need to differentiate between widget and layout objects.
Screen Shot of Current Work
Beware, programmer art shown:
Shown here are two option boxes, three labels, three textboxes, and two buttons. These are contained by a hierarchy of three layout objects.