1999-07-26 19:02:32 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/choice.h
|
|
|
|
// Purpose: wxChoice class interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 26.07.99
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) wxWidgets team
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-26 19:02:32 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_CHOICE_H_BASE_
|
|
|
|
#define _WX_CHOICE_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2005-03-16 11:18:31 -05:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_CHOICE
|
|
|
|
|
1999-10-22 14:00:39 -04:00
|
|
|
#include "wx/ctrlsub.h" // the base class
|
1999-07-26 19:02:32 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxChoiceNameStr[];
|
1999-07-26 19:02:32 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxChoice allows to select one of a non-modifiable list of strings
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxChoiceBase : public wxControlWithItems
|
1999-07-26 19:02:32 -04:00
|
|
|
{
|
|
|
|
public:
|
2004-01-15 08:49:22 -05:00
|
|
|
wxChoiceBase() { }
|
2004-10-12 16:14:23 -04:00
|
|
|
virtual ~wxChoiceBase();
|
1999-07-26 19:02:32 -04:00
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
// all generic methods are in wxControlWithItems
|
|
|
|
|
2006-10-30 11:04:27 -05:00
|
|
|
// get the current selection: this can only be different from the normal
|
|
|
|
// selection if the popup items list is currently opened and the user
|
|
|
|
// selected some item in it but didn't close the list yet; otherwise (and
|
|
|
|
// currently always on platforms other than MSW) this is the same as
|
|
|
|
// GetSelection()
|
|
|
|
virtual int GetCurrentSelection() const { return GetSelection(); }
|
|
|
|
|
2003-06-23 10:49:46 -04:00
|
|
|
// set/get the number of columns in the control (as they're not supported on
|
1999-07-26 19:02:32 -04:00
|
|
|
// most platforms, they do nothing by default)
|
|
|
|
virtual void SetColumns(int WXUNUSED(n) = 1 ) { }
|
|
|
|
virtual int GetColumns() const { return 1 ; }
|
|
|
|
|
1999-10-22 14:00:39 -04:00
|
|
|
// emulate selecting the item event.GetInt()
|
|
|
|
void Command(wxCommandEvent& event);
|
2003-07-21 20:24:07 -04:00
|
|
|
|
2007-07-26 09:54:14 -04:00
|
|
|
// override wxItemContainer::IsSorted
|
|
|
|
virtual bool IsSorted() const { return HasFlag(wxCB_SORT); }
|
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
private:
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxChoiceBase);
|
1999-07-26 19:02:32 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// include the platform-dependent class definition
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-11-17 18:13:55 -05:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/choice.h"
|
2004-09-29 04:03:26 -04:00
|
|
|
#elif defined(__SMARTPHONE__) && defined(__WXWINCE__)
|
2004-08-23 06:53:57 -04:00
|
|
|
#include "wx/msw/wince/choicece.h"
|
2001-11-17 18:13:55 -05:00
|
|
|
#elif defined(__WXMSW__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/msw/choice.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/motif/choice.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/gtk/choice.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/choice.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 15:17:41 -04:00
|
|
|
#include "wx/osx/choice.h"
|
2003-03-22 01:18:36 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/choice.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/choice.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_CHOICE
|
|
|
|
|
2006-10-30 11:04:27 -05:00
|
|
|
#endif // _WX_CHOICE_H_BASE_
|