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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2002-08-31 07:29:13 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
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
|
2002-01-07 16:52:28 -05:00
|
|
|
virtual ~wxChoiceBase();
|
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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-11-17 18:13:55 -05:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/choice.h"
|
|
|
|
#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"
|
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-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
1999-07-26 19:02:32 -04:00
|
|
|
#include "wx/mac/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
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_CHOICE_H_BASE_
|