File: ComboCtrl.xsp

package info (click to toggle)
libwx-perl 1%3A0.9928-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,300 kB
  • ctags: 2,322
  • sloc: cpp: 11,044; perl: 8,646; ansic: 710; makefile: 48
file content (120 lines) | stat: -rw-r--r-- 4,285 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#############################################################################
## Name:        XS/ComboCtrl.xsp
## Purpose:     XS++ for Wx::ComboCtrl
## Author:      Mattia Barbon
## Modified by:
## Created:     12/08/2007
## RCS-ID:      $Id: ComboCtrl.xsp 2626 2009-10-18 22:48:17Z mbarbon $
## Copyright:   (c) 2007, 2009 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or
##              modify it under the same terms as Perl itself
#############################################################################

%module{Wx};

#if WXPERL_W_VERSION_GE( 2, 7, 2 )

#include <wx/combo.h>

%typemap{wxComboPopup*}{simple};
%typemap{wxComboCtrl*}{simple};

%name{Wx::ComboCtrl} class wxComboCtrl
{
%{
void
new( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_VOIDM_REDISP( newDefault )
        MATCH_ANY_REDISP( newFull )
    END_OVERLOAD( "Wx::ComboCtrl::new" )
%}

    %name{newDefault} wxComboCtrl()
        %code{% RETVAL = new wxComboCtrl();
                wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
                %};
    %name{newFull} wxComboCtrl( wxWindow *parent,
                                wxWindowID id = wxID_ANY,
                                const wxString& value = wxEmptyString,
                                const wxPoint& pos = wxDefaultPosition,
                                const wxSize& size = wxDefaultSize,
                                long style = 0,
                                const wxValidator& validator = wxDefaultValidatorPtr,
                                const wxString& name = wxEmptyString)
        %code{% RETVAL = new wxComboCtrl( parent, id, value, pos, size,
                                          style, *validator, name );
                wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
                %};

    bool Create( wxWindow *parent,
                 wxWindowID id,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = 0,
                 const wxValidator& validator = wxDefaultValidatorPtr,
                 const wxString& name = wxEmptyString );

    void ShowPopup();
    void HidePopup();

##    virtual void OnButtonClick();

    bool IsPopupShown() const;

    void SetPopupControl( wxComboPopup* popup );
    wxComboPopup* GetPopupControl();

    wxWindow *GetPopupWindow() const;
    wxTextCtrl *GetTextCtrl() const;
    wxWindow *GetButton() const;

    wxString GetValue() const;
    void SetValue( const wxString& value );
    void Copy();
    void Cut();
    void Paste();
    void SetInsertionPoint( long pos );
    void SetInsertionPointEnd();
    long GetInsertionPoint() const;
    long GetLastPosition() const;
    void Replace( long from, long to, const wxString& value );
    void Remove( long from, long to );
    void SetSelection( long from, long to );
    void Undo();

    void SetText( const wxString& value );
    void SetPopupMinWidth( int width );
    void SetPopupMaxHeight( int height );
    void SetPopupExtents( int extLeft, int extRight );
    void SetCustomPaintWidth( int width );
    int GetCustomPaintWidth() const;
    void SetPopupAnchor( int anchorSide );
    void SetButtonPosition( int width = -1,
                            int height = -1,
                            int side = wxRIGHT,
                            int spacingX = 0 );
    wxSize GetButtonSize();
    void SetButtonBitmaps( const wxBitmap& bmpNormal,
                           bool pushButtonBg = false,
                           const wxBitmap& bmpPressed = wxNullBitmapPtr,
                           const wxBitmap& bmpHover = wxNullBitmapPtr,
                           const wxBitmap& bmpDisabled = wxNullBitmapPtr );

#if WXPERL_W_VERSION_LT( 2, 7, 0 ) || WXWIN_COMPATIBILITY_2_6
    void SetTextIndent( int indent );
    wxCoord GetTextIndent() const;
#endif
    const wxRect& GetTextRect() const;

    void UseAltPopupWindow( bool enable = true );
    void EnablePopupAnimation( bool enable = true );
    const wxBitmap& GetBitmapNormal() const;
    const wxBitmap& GetBitmapPressed() const;
    const wxBitmap& GetBitmapHover() const;
    const wxBitmap& GetBitmapDisabled() const;
};

#endif