Statistics
| Revision:

root / trunk / install / launcher / izpack-launcher-1.3_linux / src / wx / include / wx / gtk / combobox.h @ 6834

History | View | Annotate | Download (4.21 KB)

1
/////////////////////////////////////////////////////////////////////////////
2
// Name:        combobox.h
3
// Purpose:
4
// Author:      Robert Roebling
5
// Created:     01/02/97
6
// Id:          $Id: combobox.h 6834 2006-08-24 08:23:24Z jmvivo $
7
// Copyright:   (c) 1998 Robert Roebling
8
// Licence:           wxWindows licence
9
/////////////////////////////////////////////////////////////////////////////
10

    
11

    
12
#ifndef __GTKCOMBOBOXH__
13
#define __GTKCOMBOBOXH__
14

    
15
#include "wx/defs.h"
16

    
17
#if wxUSE_COMBOBOX
18

    
19
#include "wx/object.h"
20
#include "wx/control.h"
21

    
22
//-----------------------------------------------------------------------------
23
// classes
24
//-----------------------------------------------------------------------------
25

    
26
class wxComboBox;
27

    
28
//-----------------------------------------------------------------------------
29
// global data
30
//-----------------------------------------------------------------------------
31

    
32
extern const wxChar* wxComboBoxNameStr;
33
extern const wxChar* wxEmptyString;
34

    
35
//-----------------------------------------------------------------------------
36
// wxComboBox
37
//-----------------------------------------------------------------------------
38

    
39
class wxComboBox : public wxControl
40
{
41
public:
42
    inline wxComboBox() {}
43
    inline wxComboBox(wxWindow *parent, wxWindowID id,
44
           const wxString& value = wxEmptyString,
45
           const wxPoint& pos = wxDefaultPosition,
46
           const wxSize& size = wxDefaultSize,
47
           int n = 0, const wxString choices[] = (const wxString *) NULL,
48
           long style = 0,
49
           const wxValidator& validator = wxDefaultValidator,
50
           const wxString& name = wxComboBoxNameStr)
51
    {
52
        Create(parent, id, value, pos, size, n, choices, style, validator, name);
53
    }
54
    ~wxComboBox();
55
    bool Create(wxWindow *parent, wxWindowID id,
56
           const wxString& value = wxEmptyString,
57
           const wxPoint& pos = wxDefaultPosition,
58
           const wxSize& size = wxDefaultSize,
59
           int n = 0, const wxString choices[] = (const wxString *) NULL,
60
           long style = 0,
61
           const wxValidator& validator = wxDefaultValidator,
62
           const wxString& name = wxComboBoxNameStr);
63

    
64
    void Append( const wxString &item );
65
    void Append( const wxString &item, void* clientData );
66
    void Append( const wxString &item, wxClientData* clientData );
67
  
68
    void SetClientData( int n, void* clientData );
69
    void* GetClientData( int n );
70
    void SetClientObject( int n, wxClientData* clientData );
71
    wxClientData* GetClientObject( int n );
72
  
73
    void SetClientObject( wxClientData *data )  { wxControl::SetClientObject( data ); }
74
    wxClientData *GetClientObject() const       { return wxControl::GetClientObject(); }
75
    void SetClientData( void *data )            { wxControl::SetClientData( data ); }
76
    void *GetClientData() const                 { return wxControl::GetClientData(); }
77
    
78
    void Clear();
79
    void Delete( int n );
80
  
81
    int FindString( const wxString &item );
82
    int GetSelection() const;
83
    wxString GetString( int n ) const;
84
    wxString GetStringSelection() const;
85
    int GetCount() const { return Number(); }
86
    int Number() const;
87
    void SetSelection( int n );
88
    void SetStringSelection( const wxString &string );
89

    
90
    wxString GetValue() const;
91
    void SetValue(const wxString& value);
92

    
93
    void Copy();
94
    void Cut();
95
    void Paste();
96
    void SetInsertionPoint( long pos );
97
    void SetInsertionPointEnd();
98
    long GetInsertionPoint() const;
99
    long GetLastPosition() const;
100
    void Replace( long from, long to, const wxString& value );
101
    void Remove( long from, long to );
102
    void SetSelection( long from, long to );
103
    void SetEditable( bool editable );
104
  
105
    // implementation
106
    
107
    virtual void SetFocus();
108
    
109
    void OnSize( wxSizeEvent &event );
110
    void OnChar( wxKeyEvent &event );
111
  
112
    bool     m_alreadySent;
113
    wxList   m_clientDataList;
114
    wxList   m_clientObjectList;
115
    int      m_prevSelection;
116

    
117
    void DisableEvents();
118
    void EnableEvents();
119
    void AppendCommon( const wxString &item );
120
    GtkWidget* GetConnectWidget();
121
    bool IsOwnGtkWindow( GdkWindow *window );
122
    void ApplyWidgetStyle();
123
 
124
protected:
125
    virtual wxSize DoGetBestSize() const;
126

    
127
private: 
128
    DECLARE_DYNAMIC_CLASS(wxComboBox)
129
    DECLARE_EVENT_TABLE()
130
};
131

    
132
#endif
133

    
134
#endif
135

    
136
  // __GTKCOMBOBOXH__