1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: choice.h
|
|
|
|
// Purpose: wxChoice class
|
1999-10-14 04:43:46 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-14 04:43:46 +00:00
|
|
|
// Created: 10/13/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 04:43:46 +00:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CHOICE_H_
|
|
|
|
#define _WX_CHOICE_H_
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
|
|
|
|
|
|
|
|
// Choice item
|
1999-10-15 21:00:38 +00:00
|
|
|
class WXDLLEXPORT wxChoice: public wxChoiceBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
public:
|
|
|
|
// ctors
|
|
|
|
inline wxChoice() { }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
inline wxChoice(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
long style = 0,
|
1999-11-08 05:18:15 +00:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-10-22 22:00:20 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1999-11-08 05:18:15 +00:00
|
|
|
#endif
|
1999-10-22 22:00:20 +00:00
|
|
|
const wxString& name = wxChoiceNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
|
|
|
}
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
long style = 0,
|
1999-11-08 05:18:15 +00:00
|
|
|
#if wxUSE_VALIDATORS
|
1999-10-22 22:00:20 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1999-11-08 05:18:15 +00:00
|
|
|
#endif
|
1999-10-22 22:00:20 +00:00
|
|
|
const wxString& name = wxChoiceNameStr);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
// Implement base class virtuals
|
|
|
|
virtual int DoAppend(const wxString& item);
|
|
|
|
virtual void Delete(int n);
|
|
|
|
virtual void Clear();
|
1999-10-14 04:43:46 +00:00
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
virtual int GetCount() const;
|
|
|
|
virtual int GetSelection() const ;
|
|
|
|
virtual void SetSelection(int n);
|
1999-10-14 04:43:46 +00:00
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
virtual int FindString(const wxString& s) const;
|
|
|
|
virtual wxString GetString(int n) const ;
|
|
|
|
virtual void SetString(int n, const wxString& s);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 22:00:20 +00:00
|
|
|
// OS2 only
|
|
|
|
virtual bool OS2Command(WXUINT param, WXWORD id);
|
2000-02-21 05:12:34 +00:00
|
|
|
MRESULT OS2WindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
protected:
|
1999-10-22 22:00:20 +00:00
|
|
|
virtual void DoSetItemClientData( int n, void* clientData );
|
|
|
|
virtual void* DoGetItemClientData( int n ) const;
|
|
|
|
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
|
|
|
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
1999-10-14 04:43:46 +00:00
|
|
|
|
|
|
|
// OS2 implementation
|
1999-11-21 01:03:00 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
1999-10-14 04:43:46 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
1999-10-14 04:43:46 +00:00
|
|
|
#endif // _WX_CHOICE_H_
|