///////////////////////////////////////////////////////////////////////////// // Name: wxBitmapComboBox // Purpose: A wxComboBox type button for bitmaps and strings // Author: John Labenski // Modified by: // Created: 11/05/2002 // Copyright: (c) John Labenski // Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// /* wxBitmapComboBox is a wxComboBox widget for bitmaps You Append some bitmaps either individually or with an array. Since bitmaps are refed this should be a fast process and you don't have to keep them around. The size of the items is calculated from the max bitmap and max label so that they will all line up nicely. It acts just like a wxComboBox otherwise, sends a EVT_COMBOBOX when selections are made with either the mouse on the pulldown list or by pressing the up/down arrows. */ #ifndef _WX_BMPCOMBO_H_ #define _WX_BMPCOMBO_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "bmpcombo.h" #endif #include "wx/things/thingdef.h" #include "wx/things/dropdown.h" class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxKeyEvent; class WXDLLEXPORT wxPaintEvent; class WXDLLEXPORT wxDC; class WXDLLIMPEXP_THINGS wxCustomButton; class WXDLLIMPEXP_THINGS wxBitmapComboPopupChild; class WXDLLIMPEXP_THINGS wxBitmapComboLabel; enum wxBitmapComboBox_Style { // Position of the labels relative to the bitmaps, use only one wxBMPCOMBO_LEFT = wxCB_DROPDOWN, wxBMPCOMBO_RIGHT = wxCB_SIMPLE }; class WXDLLIMPEXP_THINGS wxBitmapComboBox : public DropDownBase { public: wxBitmapComboBox() : DropDownBase() { Init(); } // Compatible with a wxComboBox, uses strings only wxBitmapComboBox(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, // used only if first choice is !null const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString *) NULL, long style = wxBMPCOMBO_RIGHT, const wxValidator& val = wxDefaultValidator, const wxString& name = wxT("wxBitmapComboBox")) :DropDownBase() { Init(); if ((n > 0) || (!value.IsEmpty())) { if ((n > 0) && choices) { for (int i=0; i