diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 23:32:28 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 23:37:32 +0200 |
commit | fe25bc152de747eb64a1c1f6084f0399faf125e8 (patch) | |
tree | 83746ebff16b87ad36c71908667ed1a81489ebe6 /src/gui/widgets/dropdown.h | |
parent | ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73 (diff) | |
download | mana-fe25bc152de747eb64a1c1f6084f0399faf125e8.tar.gz mana-fe25bc152de747eb64a1c1f6084f0399faf125e8.tar.bz2 mana-fe25bc152de747eb64a1c1f6084f0399faf125e8.tar.xz mana-fe25bc152de747eb64a1c1f6084f0399faf125e8.zip |
Have the DropDown create its ScrollArea and ListBox
And also clean them up again. Fixes some memory leaks and simplifies the
code. Also got rid of the basically unused "opaque" setting of DropDown.
Diffstat (limited to 'src/gui/widgets/dropdown.h')
-rw-r--r-- | src/gui/widgets/dropdown.h | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 601d55c8..83d43f63 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -28,11 +28,9 @@ class Image; class ImageRect; /** - * A drop down box from which you can select different values. It is one of - * the most complicated Widgets you will find in Guichan. For drawing the - * DroppedDown box it uses one ScrollArea and one ListBox. It also uses an - * internal FocusHandler to handle the focus of the internal ScollArea and - * ListBox. DropDown uses a ListModel to handle the list. To be able to use + * A drop down box from which you can select different values. + * + * A ListModel provides the contents of the drop down. To be able to use * DropDown you must give DropDown an implemented ListModel which represents * your list. */ @@ -47,37 +45,14 @@ class DropDown : public gcn::DropDown * @param listBox the listBox to use. * @see ListModel, ScrollArea, ListBox. */ - DropDown(gcn::ListModel *listModel = NULL, - gcn::ScrollArea *scrollArea = NULL, - gcn::ListBox *listBox = NULL, - bool opacity = true); + DropDown(gcn::ListModel *listModel = NULL); - /** - * Destructor. - */ ~DropDown(); void draw(gcn::Graphics *graphics); void drawFrame(gcn::Graphics *graphics); - /** - * Sets the widget to be opaque, that is sets the widget to display its - * background. - * - * @param opaque True if the widget should be opaque, false otherwise. - */ - void setOpaque(bool opaque) { mOpaque = opaque; } - - /** - * Checks if the widget is opaque, that is if the widget area displays - * its background. - * - * @return True if the widget is opaque, false otherwise. - */ - bool isOpaque() const { return mOpaque; } - - protected: /** * Draws the button with the little down arrow. @@ -91,8 +66,6 @@ class DropDown : public gcn::DropDown static Image *buttons[2][2]; static ImageRect skin; static float mAlpha; - - bool mOpaque; }; #endif // end DROPDOWN_H |