| container.hpp | | container.hpp | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| */ | | */ | |
| Container(); | | Container(); | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| */ | | */ | |
| virtual ~Container(); | | virtual ~Container(); | |
| | | | |
| /** | | /** | |
| * Sets the container to be opaque or not. If the container | | * Sets the container to be opaque or not. If the container | |
|
| * is opaque it's background will be drawn, if it's not opaque | | * is opaque its background will be drawn, if it's not opaque | |
| * it's background will not be drawn, and thus making the container | | * its background will not be drawn, and thus making the container | |
| * completely transparent. | | * completely transparent. | |
| * | | * | |
| * NOTE: This is not the same as to set visibility. A non visible | | * NOTE: This is not the same as to set visibility. A non visible | |
|
| * container will not itself nor will it draw it's content. | | * container will not itself nor will it draw its content. | |
| * | | * | |
| * @param opaque True if the container should be opaque, false othe
rwise. | | * @param opaque True if the container should be opaque, false othe
rwise. | |
| * @see isOpaque | | * @see isOpaque | |
| */ | | */ | |
| void setOpaque(bool opaque); | | void setOpaque(bool opaque); | |
| | | | |
| /** | | /** | |
| * Checks if the container is opaque or not. | | * Checks if the container is opaque or not. | |
| * | | * | |
| * @return True if the container is opaque, false otherwise. | | * @return True if the container is opaque, false otherwise. | |
| | | | |
| skipping to change at line 111 | | skipping to change at line 111 | |
| | | | |
| /** | | /** | |
| * Adds a widget to the container. | | * Adds a widget to the container. | |
| * | | * | |
| * @param widget The widget to add. | | * @param widget The widget to add. | |
| * @see remove, clear | | * @see remove, clear | |
| */ | | */ | |
| virtual void add(Widget* widget); | | virtual void add(Widget* widget); | |
| | | | |
| /** | | /** | |
|
| * Adds a widget to the container and also specifices the widget's | | * Adds a widget to the container and also specifies the widget's | |
| * postion in the container. The position is relative to the contai | | * position in the container. The position is relative to the conta | |
| ner | | iner | |
| * and not relative to the screen. | | * and not relative to the screen. | |
| * | | * | |
| * @param widget The widget to add. | | * @param widget The widget to add. | |
|
| * @param x The x coordinat for the widget. | | * @param x The x coordinate for the widget. | |
| * @param y The y coordinat for the widget. | | * @param y The y coordinate for the widget. | |
| * @see remove, clear | | * @see remove, clear | |
| */ | | */ | |
| virtual void add(Widget* widget, int x, int y); | | virtual void add(Widget* widget, int x, int y); | |
| | | | |
| /** | | /** | |
| * Removes a widget from the Container. | | * Removes a widget from the Container. | |
| * | | * | |
| * @param widget The widget to remove. | | * @param widget The widget to remove. | |
| * @throws Exception when the widget has not been added to the | | * @throws Exception when the widget has not been added to the | |
| * container. | | * container. | |
| | | | |
End of changes. 4 change blocks. |
| 8 lines changed or deleted | | 8 lines changed or added | |
|
| dropdown.hpp | | dropdown.hpp | |
| | | | |
| skipping to change at line 60 | | skipping to change at line 60 | |
| #include "guichan/focushandler.hpp" | | #include "guichan/focushandler.hpp" | |
| #include "guichan/focuslistener.hpp" | | #include "guichan/focuslistener.hpp" | |
| #include "guichan/keylistener.hpp" | | #include "guichan/keylistener.hpp" | |
| #include "guichan/listmodel.hpp" | | #include "guichan/listmodel.hpp" | |
| #include "guichan/mouselistener.hpp" | | #include "guichan/mouselistener.hpp" | |
| #include "guichan/platform.hpp" | | #include "guichan/platform.hpp" | |
| #include "guichan/selectionlistener.hpp" | | #include "guichan/selectionlistener.hpp" | |
| #include "guichan/widgets/listbox.hpp" | | #include "guichan/widgets/listbox.hpp" | |
| #include "guichan/widgets/scrollarea.hpp" | | #include "guichan/widgets/scrollarea.hpp" | |
| | | | |
|
| namespace gcn | | namespace gcn { | |
| { | | | |
| /** | | /** | |
|
| * An implementation of a drop downable list from which an item can be | | * An implementation of a drop downable list from which an item can be | |
| selected. | | * selected. The drop down consists of an internal ScrollArea and an | |
| * The drop down consists of an internal ScrollArea and an internal Lis | | * internal ListBox. The drop down also uses an internal FocusHandler t | |
| tBox. | | o | |
| * The drop down also uses an internal FocusHandler to handle the focus | | * handle the focus of the internal ScollArea and the internal ListBox. | |
| of the | | The | |
| * internal ScollArea and the internal ListBox. The scroll area and the | | * scroll area and the list box can be passed to the drop down if a cus | |
| list box | | tom | |
| * can be passed to the drop down if a custom scroll area and or a cust | | * scroll area and or a custom list box is preferable. | |
| om list box | | | |
| * is preferable. | | | |
| * | | * | |
| * To be able display a list the drop down uses a user provided list mo
del. | | * To be able display a list the drop down uses a user provided list mo
del. | |
| * A list model can be any class that implements the ListModel interfac
e. | | * A list model can be any class that implements the ListModel interfac
e. | |
| * | | * | |
|
| * If an item is selected in the drop down a select event will be sent | | * If an item is selected in the drop down a select event will be sent | |
| to all selection | | to | |
| * listeners of the drop down. If an item is selected by using a mouse | | * all selection listeners of the drop down. If an item is selected by | |
| click or by using | | * using a mouse click or by using the enter or space key an action eve | |
| * the enter or space key an action event will be sent to all action li | | nt | |
| steners of the | | * will be sent to all action listeners of the drop down. | |
| * drop down. | | | |
| */ | | */ | |
| class GCN_CORE_DECLSPEC DropDown : | | class GCN_CORE_DECLSPEC DropDown : | |
| public ActionListener, | | public ActionListener, | |
| public BasicContainer, | | public BasicContainer, | |
| public KeyListener, | | public KeyListener, | |
| public MouseListener, | | public MouseListener, | |
| public FocusListener, | | public FocusListener, | |
| public SelectionListener | | public SelectionListener | |
| { | | { | |
| public: | | public: | |
| | | | |
| skipping to change at line 149 | | skipping to change at line 148 | |
| * drop down's parent's height. It's used to not make the drop down | | * drop down's parent's height. It's used to not make the drop down | |
| * draw itself outside of it's parent if folded down. | | * draw itself outside of it's parent if folded down. | |
| */ | | */ | |
| void adjustHeight(); | | void adjustHeight(); | |
| | | | |
| /** | | /** | |
| * Adds a selection listener to the drop down. When the selection | | * Adds a selection listener to the drop down. When the selection | |
| * changes an event will be sent to all selection listeners of the | | * changes an event will be sent to all selection listeners of the | |
| * drop down. | | * drop down. | |
| * | | * | |
|
| | | * If you delete your selection listener, be sure to also remove it | |
| | | * using removeSelectionListener(). | |
| | | * | |
| * @param selectionListener the selection listener to add. | | * @param selectionListener the selection listener to add. | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| */ | | */ | |
| void addSelectionListener(SelectionListener* selectionListener); | | void addSelectionListener(SelectionListener* selectionListener); | |
| | | | |
| /** | | /** | |
| * Removes a selection listener from the drop down. | | * Removes a selection listener from the drop down. | |
| * | | * | |
| * @param selectionListener the selection listener to remove. | | * @param selectionListener the selection listener to remove. | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| | | | |
| skipping to change at line 172 | | skipping to change at line 174 | |
| // Inherited from Widget | | // Inherited from Widget | |
| | | | |
| virtual void draw(Graphics* graphics); | | virtual void draw(Graphics* graphics); | |
| | | | |
| void setBaseColor(const Color& color); | | void setBaseColor(const Color& color); | |
| | | | |
| void setBackgroundColor(const Color& color); | | void setBackgroundColor(const Color& color); | |
| | | | |
| void setForegroundColor(const Color& color); | | void setForegroundColor(const Color& color); | |
| | | | |
|
| void setFont(Font *font); | | void setFont(Font *font); | |
| | | | |
| void setSelectionColor(const Color& color); | | void setSelectionColor(const Color& color); | |
| | | | |
| // Inherited from BasicContainer | | // Inherited from BasicContainer | |
| | | | |
| virtual Rectangle getChildrenArea(); | | virtual Rectangle getChildrenArea(); | |
| | | | |
| // Inherited from FocusListener | | // Inherited from FocusListener | |
| | | | |
| virtual void focusLost(const Event& event); | | virtual void focusLost(const Event& event); | |
| | | | |
| skipping to change at line 251 | | skipping to change at line 253 | |
| bool mDroppedDown; | | bool mDroppedDown; | |
| | | | |
| /** | | /** | |
| * True if the drop down has been pushed with the mouse, false | | * True if the drop down has been pushed with the mouse, false | |
| * otherwise. | | * otherwise. | |
| */ | | */ | |
| bool mPushed; | | bool mPushed; | |
| | | | |
| /** | | /** | |
| * Holds what the height is if the drop down is folded up. Used whe
n | | * Holds what the height is if the drop down is folded up. Used whe
n | |
|
| * checking if the list of the drop down was clicked or if the uppe | | * checking if the list of the drop down was clicked or if the uppe | |
| r part | | r | |
| * of the drop down was clicked on a mouse click | | * part of the drop down was clicked on a mouse click. | |
| */ | | */ | |
| int mFoldedUpHeight; | | int mFoldedUpHeight; | |
| | | | |
| /** | | /** | |
| * The scroll area used. | | * The scroll area used. | |
| */ | | */ | |
| ScrollArea* mScrollArea; | | ScrollArea* mScrollArea; | |
| | | | |
| /** | | /** | |
| * The list box used. | | * The list box used. | |
| | | | |
End of changes. 6 change blocks. |
| 24 lines changed or deleted | | 23 lines changed or added | |
|
| exception.hpp | | exception.hpp | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| */ | | */ | |
| | | | |
| #ifndef GCN_EXCEPTION_HPP | | #ifndef GCN_EXCEPTION_HPP | |
| #define GCN_EXCEPTION_HPP | | #define GCN_EXCEPTION_HPP | |
| | | | |
| #include <string> | | #include <string> | |
| | | | |
| #include "guichan/platform.hpp" | | #include "guichan/platform.hpp" | |
| | | | |
|
| #ifdef _MSC_VER | | #ifndef __FUNCTION__ | |
| #if _MSC_VER <= 1200 | | | |
| #define __FUNCTION__ "?" | | #define __FUNCTION__ "?" | |
| #endif | | #endif | |
|
| #endif | | | |
| | | | |
| /* | | /* | |
| * A macro used to create a standard exception object. | | * A macro used to create a standard exception object. | |
| * What it basicly does is that it creates a new exception | | * What it basicly does is that it creates a new exception | |
| * and automatically sets the filename and line number where | | * and automatically sets the filename and line number where | |
| * the exception occured by using other compiler macros. | | * the exception occured by using other compiler macros. | |
| */ | | */ | |
| #define GCN_EXCEPTION(mess) gcn::Exception(mess, \ | | #define GCN_EXCEPTION(mess) gcn::Exception(mess, \ | |
| __FUNCTION__, \ | | __FUNCTION__, \ | |
| __FILE__, \ | | __FILE__, \ | |
| | | | |
End of changes. 2 change blocks. |
| 3 lines changed or deleted | | 1 lines changed or added | |
|
| gui.hpp | | gui.hpp | |
| | | | |
| skipping to change at line 312 | | skipping to change at line 312 | |
| /** | | /** | |
| * Handles modal mouse input focus. Modal mouse input focus needs | | * Handles modal mouse input focus. Modal mouse input focus needs | |
| * to be checked at each logic iteration as it might be necessary t
o | | * to be checked at each logic iteration as it might be necessary t
o | |
| * distribute mouse entered or mouse exited events. | | * distribute mouse entered or mouse exited events. | |
| * | | * | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| */ | | */ | |
| virtual void handleModalMouseInputFocus(); | | virtual void handleModalMouseInputFocus(); | |
| | | | |
| /** | | /** | |
|
| * Handles modal focus gained. If modal focus has been gaind it mig
ht | | * Handles modal focus gained. If modal focus has been gained it mi
ght | |
| * be necessary to distribute mouse entered or mouse exited events. | | * be necessary to distribute mouse entered or mouse exited events. | |
| * | | * | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| */ | | */ | |
| virtual void handleModalFocusGained(); | | virtual void handleModalFocusGained(); | |
| | | | |
| /** | | /** | |
|
| * Handles modal mouse input focus gained. If modal focus has been | | * Handles modal mouse input focus gained. If modal focus has been | |
| gaind | | * gained it might be necessary to distribute mouse entered or mous | |
| * it might be necessary to distribute mouse entered or mouse exite | | e | |
| d events. | | * exited events. | |
| * | | * | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| */ | | */ | |
| virtual void handleModalFocusReleased(); | | virtual void handleModalFocusReleased(); | |
| | | | |
| /** | | /** | |
| * Distributes a mouse event. | | * Distributes a mouse event. | |
| * | | * | |
| * @param type The type of the event to distribute, | | * @param type The type of the event to distribute, | |
| * @param button The button of the event (if any used) to distribut
e. | | * @param button The button of the event (if any used) to distribut
e. | |
| | | | |
End of changes. 2 change blocks. |
| 5 lines changed or deleted | | 5 lines changed or added | |
|
| imagefont.hpp | | imagefont.hpp | |
| | | | |
| skipping to change at line 61 | | skipping to change at line 61 | |
| #include "guichan/rectangle.hpp" | | #include "guichan/rectangle.hpp" | |
| | | | |
| namespace gcn | | namespace gcn | |
| { | | { | |
| class Color; | | class Color; | |
| class Graphics; | | class Graphics; | |
| class Image; | | class Image; | |
| | | | |
| /** | | /** | |
| * A font using an image containing the font data. ImageFont can be use
d | | * A font using an image containing the font data. ImageFont can be use
d | |
|
| * with any supported by the current used ImageLoader. | | * with any image supported by the currently used ImageLoader. | |
| * | | * | |
| * These are two examples of an image containing a font. | | * These are two examples of an image containing a font. | |
| * \image html imagefontexample.bmp | | * \image html imagefontexample.bmp | |
| * \image html imagefontexample2.bmp | | * \image html imagefontexample2.bmp | |
| * | | * | |
|
| * The Image font format works like this: The first pixel, the pixal at | | * The first pixel at coordinate (0,0) tells which color the image font | |
| * coordinate (0,0), tells which color to look for when seperating glyp | | * looks for when seperating glyphs. The glyphs in the image is provide | |
| hs. | | d | |
| * You create an image with your glyphs and simple separates them with | | * to the image font's constructor in the order they appear in the imag | |
| * the seperation color. When you create your image font you supply the | | e. | |
| * constructor with the glyphs present in your image. | | | |
| * | | * | |
| * To create an ImageFont from the first image example above the follow
ing | | * To create an ImageFont from the first image example above the follow
ing | |
| * constructor call should be made: | | * constructor call should be made: | |
| * @code gcn::ImageFont imageFont("fixedfont_big.bmp"," abcdefghijklmno
\ | | * @code gcn::ImageFont imageFont("fixedfont_big.bmp"," abcdefghijklmno
\ | |
| pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); @endcode | | pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); @endcode | |
| * | | * | |
|
| * Note worthy is that the first glyph actually gives the width of spac
e. | | * Noteworthy is that the first glyph actually gives the width of space
. | |
| * Glyphs can, as seen in the second image example above, be seperated
with | | * Glyphs can, as seen in the second image example above, be seperated
with | |
| * horizontal lines making it possible to draw glyphs on more then one | | * horizontal lines making it possible to draw glyphs on more then one | |
|
| * line in the image. However, these vertical lines must have a height
of | | * line in the image. However, these horizontal lines must have a heigh
t of | |
| * one pixel! | | * one pixel! | |
| */ | | */ | |
| class GCN_CORE_DECLSPEC ImageFont: public Font | | class GCN_CORE_DECLSPEC ImageFont: public Font | |
| { | | { | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| * Constructor. Takes an image file containing the font and | | * Constructor. Takes an image file containing the font and | |
| * a string containing the glyphs. The glyphs in the string should | | * a string containing the glyphs. The glyphs in the string should | |
| * be in the same order as they appear in the font image. | | * be in the same order as they appear in the font image. | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 201 | |
| | | | |
| // Inherited from Font | | // Inherited from Font | |
| | | | |
| virtual int getWidth(const std::string& text) const; | | virtual int getWidth(const std::string& text) const; | |
| | | | |
| virtual void drawString(Graphics* graphics, const std::string& text
, | | virtual void drawString(Graphics* graphics, const std::string& text
, | |
| int x, int y); | | int x, int y); | |
| | | | |
| virtual int getHeight() const; | | virtual int getHeight() const; | |
| | | | |
|
| virtual int getStringIndexAt(const std::string& text, int x); | | virtual int getStringIndexAt(const std::string& text, int x) const; | |
| | | | |
| protected: | | protected: | |
| /** | | /** | |
| * Scans for a certain glyph. | | * Scans for a certain glyph. | |
| * | | * | |
| * @param glyph The glyph to scan for. Used for exception messages. | | * @param glyph The glyph to scan for. Used for exception messages. | |
| * @param x The x coordinate where to begin the scan. The coordinat
e | | * @param x The x coordinate where to begin the scan. The coordinat
e | |
| * will be updated with the end x coordinate of the glyph | | * will be updated with the end x coordinate of the glyph | |
| * when the scan is complete. | | * when the scan is complete. | |
| * @param y The y coordinate where to begin the scan. The coordinat
e | | * @param y The y coordinate where to begin the scan. The coordinat
e | |
| | | | |
End of changes. 5 change blocks. |
| 10 lines changed or deleted | | 9 lines changed or added | |
|
| imageloader.hpp | | imageloader.hpp | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |
| * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | |
| * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
| * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| */ | | */ | |
| | | | |
| #ifndef GCN_IMAGELOADER_HPP | | #ifndef GCN_IMAGELOADER_HPP | |
| #define GCN_IMAGELOADER_HPP | | #define GCN_IMAGELOADER_HPP | |
| | | | |
|
| #include <iosfwd> | | #include <string> | |
| | | | |
| #include "guichan/platform.hpp" | | #include "guichan/platform.hpp" | |
| | | | |
| namespace gcn | | namespace gcn | |
| { | | { | |
| class Image; | | class Image; | |
| | | | |
| /** | | /** | |
| * Abstract class for providing functions for loading images. | | * Abstract class for providing functions for loading images. | |
| * | | * | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|
| key.hpp | | key.hpp | |
| | | | |
| skipping to change at line 104 | | skipping to change at line 104 | |
| bool isLetter() const; | | bool isLetter() const; | |
| | | | |
| /** | | /** | |
| * Gets the value of the key. If an ascii value exists it | | * Gets the value of the key. If an ascii value exists it | |
| * will be returned. Otherwise an enum value will be returned. | | * will be returned. Otherwise an enum value will be returned. | |
| * | | * | |
| * @return the value of the key. | | * @return the value of the key. | |
| */ | | */ | |
| int getValue() const; | | int getValue() const; | |
| | | | |
|
| /** | | /** | |
| * Compares to keys. | | * Compares two keys. | |
| * | | * | |
| * @param key The key to compare this key with. | | * @param key The key to compare this key with. | |
| * @return True if the keys are equal, false otherwise. | | * @return True if the keys are equal, false otherwise. | |
| */ | | */ | |
| bool operator==(const Key& key) const; | | bool operator==(const Key& key) const; | |
| | | | |
|
| /** | | /** | |
| * Compares to keys. | | * Compares two keys. | |
| * | | * | |
| * @param key The key to compare this key with. | | * @param key The key to compare this key with. | |
| * @return True if the keys are not equal, false otherwise. | | * @return True if the keys are not equal, false otherwise. | |
| */ | | */ | |
| bool operator!=(const Key& key) const; | | bool operator!=(const Key& key) const; | |
| | | | |
| /** | | /** | |
| * An enum with key values. | | * An enum with key values. | |
| */ | | */ | |
| enum | | enum | |
| { | | { | |
| SPACE = ' ', | | SPACE = ' ', | |
| TAB = '\t', | | TAB = '\t', | |
| ENTER = '\n', | | ENTER = '\n', | |
| LEFT_ALT = 1000, | | LEFT_ALT = 1000, | |
| | | | |
End of changes. 2 change blocks. |
| 14 lines changed or deleted | | 14 lines changed or added | |
|
| listbox.hpp | | listbox.hpp | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| namespace gcn | | namespace gcn | |
| { | | { | |
| class SelectionListener; | | class SelectionListener; | |
| | | | |
| /** | | /** | |
| * An implementation of a list box where an item can be selected. | | * An implementation of a list box where an item can be selected. | |
| * | | * | |
| * To be able display a list the list box uses a user provided list mod
el. | | * To be able display a list the list box uses a user provided list mod
el. | |
| * A list model can be any class that implements the ListModel interfac
e. | | * A list model can be any class that implements the ListModel interfac
e. | |
| * | | * | |
|
| * If an item is selected in the list box a select event will be sent t | | * If an item is selected in the list box a select event will be sent t | |
| o all selection | | o | |
| * listeners of the list box. If an item is selected by using a mouse c | | * all selection listeners of the list box. If an item is selected by u | |
| lick or by using | | sing | |
| * the enter or space key an action event will be sent to all action li | | * a mouse click or by using the enter or space key an action event wil | |
| steners of the | | l be | |
| * list box. | | * sent to all action listeners of the list box. | |
| */ | | */ | |
| class GCN_CORE_DECLSPEC ListBox : | | class GCN_CORE_DECLSPEC ListBox : | |
| public Widget, | | public Widget, | |
| public MouseListener, | | public MouseListener, | |
| public KeyListener | | public KeyListener | |
| { | | { | |
| public: | | public: | |
| /** | | /** | |
| * Constructor. | | * Constructor. | |
| */ | | */ | |
| | | | |
| skipping to change at line 132 | | skipping to change at line 132 | |
| * @see setListModel | | * @see setListModel | |
| */ | | */ | |
| ListModel *getListModel(); | | ListModel *getListModel(); | |
| | | | |
| /** | | /** | |
| * Adjusts the size of the list box to fit it's list model. | | * Adjusts the size of the list box to fit it's list model. | |
| */ | | */ | |
| void adjustSize(); | | void adjustSize(); | |
| | | | |
| /** | | /** | |
|
| * Checks whether the list box wraps when selecting items with a ke | | * Checks whether the list box wraps when selecting items with a | |
| yboard. | | * keyboard. | |
| * | | * | |
|
| * Wrapping means that the selection of items will be wrapped. That | | * Wrapping means that the selection of items will be wrapped. That | |
| is, if | | is, | |
| * the first item is selected and up is pressed, the last item will | | * if the first item is selected and up is pressed, the last item w | |
| get | | ill | |
| * selected. If the last item is selected and down is pressed, the | | * get selected. If the last item is selected and down is pressed, | |
| first item | | the | |
| * will get selected. | | * first item will get selected. | |
| * | | * | |
| * @return true if wrapping is enabled, fasle otherwise. | | * @return true if wrapping is enabled, fasle otherwise. | |
| * @see setWrappingEnabled | | * @see setWrappingEnabled | |
| */ | | */ | |
| bool isWrappingEnabled() const; | | bool isWrappingEnabled() const; | |
| | | | |
| /** | | /** | |
|
| * Sets the list box to wrap or not when selecting items with a key | | * Sets the list box to wrap or not when selecting items with a | |
| board. | | * keyboard. | |
| * | | * | |
|
| * Wrapping means that the selection of items will be wrapped. That | | * Wrapping means that the selection of items will be wrapped. That | |
| is, if | | is, | |
| * the first item is selected and up is pressed, the last item will | | * if the first item is selected and up is pressed, the last item w | |
| get | | ill | |
| * selected. If the last item is selected and down is pressed, the | | * get selected. If the last item is selected and down is pressed, | |
| first item | | the | |
| * will get selected. | | * first item will get selected. | |
| * | | * | |
| * @see isWrappingEnabled | | * @see isWrappingEnabled | |
| */ | | */ | |
| void setWrappingEnabled(bool wrappingEnabled); | | void setWrappingEnabled(bool wrappingEnabled); | |
| | | | |
| /** | | /** | |
| * Adds a selection listener to the list box. When the selection | | * Adds a selection listener to the list box. When the selection | |
| * changes an event will be sent to all selection listeners of the | | * changes an event will be sent to all selection listeners of the | |
| * list box. | | * list box. | |
| * | | * | |
|
| | | * If you delete your selection listener, be sure to also remove it | |
| | | * using removeSelectionListener(). | |
| | | * | |
| * @param selectionListener The selection listener to add. | | * @param selectionListener The selection listener to add. | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| */ | | */ | |
| void addSelectionListener(SelectionListener* selectionListener); | | void addSelectionListener(SelectionListener* selectionListener); | |
| | | | |
| /** | | /** | |
| * Removes a selection listener from the list box. | | * Removes a selection listener from the list box. | |
| * | | * | |
| * @param selectionListener The selection listener to remove. | | * @param selectionListener The selection listener to remove. | |
| * @since 0.8.0 | | * @since 0.8.0 | |
| */ | | */ | |
| void removeSelectionListener(SelectionListener* selectionListener); | | void removeSelectionListener(SelectionListener* selectionListener); | |
| | | | |
|
| /** | | /** | |
| * Gets the height of a row. Should be overridden if another | | * Gets the height of a row. Should be overridden if another row | |
| row | | * height than the font height is preferred. | |
| * height than the font height is preferred. | | * | |
| * | | * @return The height of a row. | |
| * @return The height of a row. | | * @since 0.8.0 | |
| * @since 0.8.0 | | */ | |
| */ | | virtual unsigned int getRowHeight() const; | |
| virtual unsigned int getRowHeight() const; | | | |
| | | | |
| // Inherited from Widget | | // Inherited from Widget | |
| | | | |
| virtual void draw(Graphics* graphics); | | virtual void draw(Graphics* graphics); | |
| | | | |
| virtual void logic(); | | virtual void logic(); | |
| | | | |
| // Inherited from KeyListener | | // Inherited from KeyListener | |
| | | | |
| virtual void keyPressed(KeyEvent& keyEvent); | | virtual void keyPressed(KeyEvent& keyEvent); | |
| | | | |
End of changes. 7 change blocks. |
| 34 lines changed or deleted | | 36 lines changed or added | |
|
| tabbedarea.hpp | | tabbedarea.hpp | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| #include "guichan/platform.hpp" | | #include "guichan/platform.hpp" | |
| | | | |
| namespace gcn | | namespace gcn | |
| { | | { | |
| class Container; | | class Container; | |
| class Tab; | | class Tab; | |
| | | | |
| /** | | /** | |
| * An implementation of a tabbed area where a user can display a widget
by | | * An implementation of a tabbed area where a user can display a widget
by | |
| * selecting a tab. | | * selecting a tab. | |
|
| | | * | |
| | | * @since 0.8.0 | |
| */ | | */ | |
| class GCN_CORE_DECLSPEC TabbedArea: | | class GCN_CORE_DECLSPEC TabbedArea: | |
| public ActionListener, | | public ActionListener, | |
| public BasicContainer, | | public BasicContainer, | |
| public KeyListener, | | public KeyListener, | |
| public MouseListener | | public MouseListener | |
| { | | { | |
| friend class Tab; | | friend class Tab; | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 86 | | skipping to change at line 88 | |
| * Constructor. | | * Constructor. | |
| */ | | */ | |
| TabbedArea(); | | TabbedArea(); | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| */ | | */ | |
| virtual ~TabbedArea(); | | virtual ~TabbedArea(); | |
| | | | |
| /** | | /** | |
|
| * Adds a tab to the tabbed area. | | * Sets the tabbed area to be opaque or not. If the tabbed area is | |
| | | * opaque its background will be drawn, if it's not opaque its | |
| | | * background will not be drawn. By default, a tabbed area is not | |
| | | * opaque. | |
| | | * | |
| | | * The tabbed area's background is normally only visible behind the | |
| | | * tabs, since the container holding the tab contents is opaque by | |
| | | * default. | |
| | | * | |
| | | * @param opaque True if the tabbed area should be opaque, false | |
| | | * otherwise. | |
| | | * @see isOpaque | |
| | | */ | |
| | | void setOpaque(bool opaque); | |
| | | | |
| | | /** | |
| | | * Checks if the tabbed area is opaque or not. | |
| | | * | |
| | | * @return true if the tabbed area is opaque, false otherwise. | |
| | | * @see setOpaque | |
| | | */ | |
| | | bool isOpaque() const; | |
| | | | |
| | | /** | |
| | | * Adds a tab to the tabbed area. The newly created tab will be | |
| | | * automatically deleted by the tabbed area when it is removed. | |
| * | | * | |
| * @param caption The caption of the tab to add. | | * @param caption The caption of the tab to add. | |
| * @param widget The widget to view when the tab is selected. | | * @param widget The widget to view when the tab is selected. | |
| * @see removeTab, removeTabWithIndex | | * @see removeTab, removeTabWithIndex | |
| */ | | */ | |
| virtual void addTab(const std::string& caption, Widget* widget); | | virtual void addTab(const std::string& caption, Widget* widget); | |
| | | | |
| /** | | /** | |
|
| * Adds a tab to the tabbed area. | | * Adds a tab to the tabbed area. The tab will not be deleted by th | |
| | | e | |
| | | * tabbed area when it is removed. | |
| * | | * | |
| * @param tab The tab widget for the tab. | | * @param tab The tab widget for the tab. | |
| * @param widget The widget to view when the tab is selected. | | * @param widget The widget to view when the tab is selected. | |
| * @see removeTab, removeTabWithIndex | | * @see removeTab, removeTabWithIndex | |
| */ | | */ | |
| virtual void addTab(Tab* tab, Widget* widget); | | virtual void addTab(Tab* tab, Widget* widget); | |
| | | | |
| /** | | /** | |
| * Removes a tab from the tabbed area. | | * Removes a tab from the tabbed area. | |
| * | | * | |
| | | | |
| skipping to change at line 202 | | skipping to change at line 230 | |
| // Inherited from KeyListener | | // Inherited from KeyListener | |
| | | | |
| virtual void keyPressed(KeyEvent& keyEvent); | | virtual void keyPressed(KeyEvent& keyEvent); | |
| | | | |
| // Inherited from MouseListener | | // Inherited from MouseListener | |
| | | | |
| virtual void mousePressed(MouseEvent& mouseEvent); | | virtual void mousePressed(MouseEvent& mouseEvent); | |
| | | | |
| protected: | | protected: | |
| /** | | /** | |
|
| * Adjusts the size of the tabbed area. | | * Adjusts the size of the tab container and the widget container. | |
| */ | | */ | |
| void adjustSize(); | | void adjustSize(); | |
| | | | |
| /** | | /** | |
| * Adjusts the positions of the tabs. | | * Adjusts the positions of the tabs. | |
| */ | | */ | |
| void adjustTabPositions(); | | void adjustTabPositions(); | |
| | | | |
| /** | | /** | |
| * Holds the selected tab. | | * Holds the selected tab. | |
| | | | |
| skipping to change at line 238 | | skipping to change at line 266 | |
| * A tab that is to be deleted is a tab that has been | | * A tab that is to be deleted is a tab that has been | |
| * internally created by the tabbed area. | | * internally created by the tabbed area. | |
| */ | | */ | |
| std::vector<Tab*> mTabsToDelete; | | std::vector<Tab*> mTabsToDelete; | |
| | | | |
| /** | | /** | |
| * A map between a tab and a widget to display when the | | * A map between a tab and a widget to display when the | |
| * tab is selected. | | * tab is selected. | |
| */ | | */ | |
| std::vector<std::pair<Tab*, Widget*> > mTabs; | | std::vector<std::pair<Tab*, Widget*> > mTabs; | |
|
| | | | |
| | | /** | |
| | | * True if the tabbed area is opaque, false otherwise. | |
| | | */ | |
| | | bool mOpaque; | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif // end GCN_TABBEDAREA_HPP | | #endif // end GCN_TABBEDAREA_HPP | |
| | | | |
End of changes. 5 change blocks. |
| 3 lines changed or deleted | | 37 lines changed or added | |
|
| widget.hpp | | widget.hpp | |
| | | | |
| skipping to change at line 840 | | skipping to change at line 840 | |
| | | | |
| /** | | /** | |
| * Gets the focus listeners of the widget. | | * Gets the focus listeners of the widget. | |
| * | | * | |
| * @return The focus listeners of the widget. | | * @return The focus listeners of the widget. | |
| * @since 0.7.0 | | * @since 0.7.0 | |
| */ | | */ | |
| virtual const std::list<FocusListener*>& _getFocusListeners(); | | virtual const std::list<FocusListener*>& _getFocusListeners(); | |
| | | | |
| /** | | /** | |
|
| * Gets the area of the widget that the widget's children occupy. | | * Gets the area of the widget occupied by the widget's children. | |
| | | * By default this method returns an empty rectangle as not all | |
| | | * widgets are containers. If you want to make a container this | |
| | | * method should return the area where the children resides. This | |
| | | * method is used when drawing children of a widget when computing | |
| | | * clip rectangles for the children. | |
| * | | * | |
|
| * @return The area of the widget that the widget's children occupy | | * An example of a widget that overloads this method is ScrollArea. | |
| . | | * A ScrollArea has a view of its contant and that view is the | |
| | | * children area. The size of a ScrollArea's children area might | |
| | | * vary depending on if the scroll bars of the ScrollArea is shown | |
| | | * or not. | |
| | | * | |
| | | * @return The area of the widget occupied by the widget's children | |
| | | . | |
| | | * @see BasicContainer | |
| | | * @see BasicContainer::getChildrenArea | |
| | | * @see BasicContainer::drawChildren | |
| * @since 0.1.0 | | * @since 0.1.0 | |
| */ | | */ | |
| virtual Rectangle getChildrenArea(); | | virtual Rectangle getChildrenArea(); | |
| | | | |
| /** | | /** | |
| * Gets the internal focus handler used. | | * Gets the internal focus handler used. | |
| * | | * | |
| * @return the internalFocusHandler used. If no internal focus hand
ler | | * @return the internalFocusHandler used. If no internal focus hand
ler | |
| * is used, NULL will be returned. | | * is used, NULL will be returned. | |
| * @see setInternalFocusHandler | | * @see setInternalFocusHandler | |
| | | | |
End of changes. 2 change blocks. |
| 3 lines changed or deleted | | 17 lines changed or added | |
|