1999-07-26 23:02:32 +00: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-15 00:23:28 +00:00
|
|
|
#ifndef _WX_CHOICE_H_BASE_
|
|
|
|
#define _WX_CHOICE_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-10-12 21:52:17 +00:00
|
|
|
#pragma interface "choicebase.h"
|
1999-07-26 23:02:32 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if wxUSE_CHOICE
|
|
|
|
|
1999-10-22 18:00:39 +00:00
|
|
|
#include "wx/ctrlsub.h" // the base class
|
1999-07-26 23:02:32 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxChoice allows to select one of a non-modifiable list of strings
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-10-22 18:00:39 +00:00
|
|
|
class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
|
1999-07-26 23:02:32 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-10-22 18:00:39 +00:00
|
|
|
// all generic methods are in wxControlWithItems
|
2001-07-15 18:47:13 +00:00
|
|
|
#ifdef __DARWIN__
|
2001-04-11 06:32:17 +00:00
|
|
|
virtual ~wxChoiceBase() {}
|
|
|
|
#endif
|
1999-07-26 23:02:32 +00:00
|
|
|
|
1999-10-22 18:00:39 +00:00
|
|
|
// single selection logic
|
|
|
|
virtual void SetSelection(int n) = 0;
|
|
|
|
virtual bool SetStringSelection(const wxString& s);
|
1999-07-26 23:02:32 +00:00
|
|
|
|
1999-10-22 18:00:39 +00:00
|
|
|
// don't override this
|
|
|
|
virtual void Select(int n) { SetSelection(n); }
|
1999-07-26 23:02:32 +00: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 18:00:39 +00:00
|
|
|
// emulate selecting the item event.GetInt()
|
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
1999-07-26 23:02:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// include the platform-dependent class definition
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-07-10 14:15:17 +00:00
|
|
|
#if defined(__WXMSW__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/msw/choice.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/motif/choice.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXGTK__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/gtk/choice.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/mac/choice.h"
|
1999-07-28 03:38:12 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/choice.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXSTUBS__)
|
1999-07-26 23:02:32 +00:00
|
|
|
#include "wx/stubs/choice.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_CHOICE
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_CHOICE_H_BASE_
|