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$
|
|
|
|
// Copyright: (c) wxWindows team
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-10-12 17:52:17 -04:00
|
|
|
#pragma interface "choicebase.h"
|
1999-07-26 19:02:32 -04:00
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxChoice allows to select one of a non-modifiable list of strings
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-10-22 14:00:39 -04:00
|
|
|
class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
|
1999-07-26 19:02:32 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-22 14:00:39 -04:00
|
|
|
// all generic methods are in wxControlWithItems
|
2001-07-15 14:47:13 -04:00
|
|
|
#ifdef __DARWIN__
|
2001-04-11 02:32:17 -04:00
|
|
|
virtual ~wxChoiceBase() {}
|
|
|
|
#endif
|
1999-07-26 19:02:32 -04:00
|
|
|
|
1999-10-22 14:00:39 -04:00
|
|
|
// single selection logic
|
|
|
|
virtual void SetSelection(int n) = 0;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
1999-07-26 19:02:32 -04:00
|
|
|
|
1999-10-22 14:00:39 -04:00
|
|
|
// don't override this
|
|
|
|
virtual void Select(int n) { SetSelection(n); }
|
1999-07-26 19:02:32 -04:00
|
|
|
|
|
|
|
// set/get the number of columns in the control (as they're not supporte on
|
|
|
|
// 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);
|
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// include the platform-dependent class definition
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-07-10 10:15:17 -04:00
|
|
|
#if 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"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXGTK__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/gtk/choice.h"
|
1998-08-07 16:23:17 -04:00
|
|
|
#elif defined(__WXQT__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/qt/choice.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/mac/choice.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/choice.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXSTUBS__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/stubs/choice.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_CHOICE
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_CHOICE_H_BASE_
|