1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: choice.h
|
|
|
|
// Purpose: wxChoice class
|
|
|
|
// Author: Julian Smart
|
1999-07-26 19:02:32 -04:00
|
|
|
// Modified by: Vadim Zeitlin to derive from wxChoiceBase
|
1998-05-20 10:12:05 -04:00
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
1999-07-26 19:02:32 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_CHOICE_H_
|
|
|
|
#define _WX_CHOICE_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-07-26 19:02:32 -04:00
|
|
|
#pragma interface "choice.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:12:05 -04:00
|
|
|
// Choice item
|
1999-07-26 19:02:32 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxChoice : public wxChoiceBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-02-22 06:01:13 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
|
|
|
|
|
|
|
public:
|
1999-07-26 19:02:32 -04:00
|
|
|
// ctors
|
|
|
|
wxChoice() { }
|
1999-10-23 19:40:55 -04:00
|
|
|
virtual ~wxChoice();
|
1999-07-26 19:02:32 -04:00
|
|
|
|
|
|
|
wxChoice(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int n = 0, const wxString choices[] = NULL,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxChoiceNameStr)
|
1999-02-22 06:01:13 -05:00
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
|
|
|
}
|
|
|
|
|
1999-07-26 19:02:32 -04: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,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxChoiceNameStr);
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
1999-10-02 20:05:52 -04:00
|
|
|
virtual int DoAppend(const wxString& item);
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual void Delete(int n);
|
|
|
|
virtual void Clear();
|
1999-07-26 19:02:32 -04:00
|
|
|
|
|
|
|
virtual int GetCount() const;
|
|
|
|
virtual int GetSelection() const;
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual void SetSelection(int n);
|
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
virtual int FindString(const wxString& s) const;
|
|
|
|
virtual wxString GetString(int n) const;
|
1999-10-22 14:00:39 -04:00
|
|
|
virtual void SetString(int n, const wxString& s);
|
1999-02-22 06:01:13 -05:00
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
// MSW only
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
1998-08-07 19:52:45 -04:00
|
|
|
|
|
|
|
protected:
|
1999-10-22 14:00:39 -04: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;
|
1998-08-07 19:52:45 -04:00
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
// MSW implementation
|
1999-07-02 18:02:05 -04:00
|
|
|
virtual wxSize DoGetBestSize();
|
1999-02-22 06:01:13 -05:00
|
|
|
virtual void DoSetSize(int x, int y,
|
1999-07-02 18:02:05 -04:00
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1999-10-23 19:40:55 -04:00
|
|
|
|
|
|
|
// free all memory we have (used by Clear() and dtor)
|
|
|
|
void Free();
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
1999-07-26 19:02:32 -04:00
|
|
|
#endif // _WX_CHOICE_H_
|