Module: Wx::ComboPopup

Included in:
ComboPopupWx
Defined in:
lib/wx/doc/comboctrl.rb

Overview

In order to use a custom popup with ComboCtrl, a class must include ComboPopup.

For more information on how to use it, see Setting Custom Popup for Wx::ComboCtrl.

Instance Method Summary collapse

Instance Method Details

#create(parent) ⇒ Boolean

The including class must implement this to create the popup control.

true if the call succeeded, false otherwise.

Parameters:

Returns:

  • (Boolean)


42
# File 'lib/wx/doc/comboctrl.rb', line 42

def create(parent) end

#destroy_popupvoid

This method returns an undefined value.

You only need to implement this member function if you create your popup class in non-standard way.

The default implementation can handle both multiple-inherited popup control (as seen in Wx::ComboCtrl samples) and one allocated separately in heap. If you do completely re-implement this function, make sure it calls Destroy() for the popup control and also deletes this object (usually as the last thing).



49
# File 'lib/wx/doc/comboctrl.rb', line 49

def destroy_popup; end

#find_item(item, trueItem = false) ⇒ Boolean, String

Implement to customize matching of value string to an item container entry.

Remark:

Default implementation always return true and does not alter trueItem.

Parameters:

  • item (String)

    String entered, usually by user or from SetValue() call.

  • trueItem (Boolean) (defaults to: false)

    if true the true item string should be returned in case matching but different

Returns:

  • (Boolean, String)

    Returns true if a match is found or false if not. If trueItem == true and item matches an entry, but the entry’s string representation is not exactly the same (case mismatch, for example), then the true item string should be returned as the match result.



61
# File 'lib/wx/doc/comboctrl.rb', line 61

def find_item(item, trueItem=false) end

#get_adjusted_size(minWidth, prefHeight, maxHeight) ⇒ Wx::Size

The including class may implement this to return adjusted size for the popup control, according to the variables given.

Remark:

This function is called each time popup is about to be shown.

Parameters:

  • minWidth (Integer)

    Preferred minimum width.

  • prefHeight (Integer)

    Preferred height. May be -1 to indicate no preference.

  • maxHeight (Integer)

    Max height for window, as limited by screen size.

Returns:



74
# File 'lib/wx/doc/comboctrl.rb', line 74

def get_adjusted_size(minWidth, prefHeight, maxHeight) end

#get_combo_ctrlWx::ComboCtrl

Returns pointer to the associated parent Wx::ComboCtrl.

Returns:



17
# File 'lib/wx/doc/comboctrl.rb', line 17

def get_combo_ctrl; end

#get_controlWx::Window

The including class must implement this to return pointer to the associated control created in #create.

Returns:



78
# File 'lib/wx/doc/comboctrl.rb', line 78

def get_control; end

#get_string_valueString

The including class must implement this to return string representation of the value.

Returns:

  • (String)


87
# File 'lib/wx/doc/comboctrl.rb', line 87

def get_string_value; end

#initvoid

This method returns an undefined value.

The including class must implement this to initialize its internal variables.

This method is called immediately after construction finishes. m_combo member variable has been initialized before the call.



23
# File 'lib/wx/doc/comboctrl.rb', line 23

def init; end

#lazy_createBoolean

The including class may implement this to return true if it wants to delay call to #create until the popup is shown for the first time.

It is more efficient, but on the other hand it is often more convenient to have the control created immediately.

Remark:

Base implementation returns false.

Returns:

  • (Boolean)


35
# File 'lib/wx/doc/comboctrl.rb', line 35

def lazy_create; end

#on_combo_char_event(event) ⇒ void

This method returns an undefined value.

The including class may implement this to receive char events from the parent Wx::ComboCtrl.

Events not handled should be skipped, as usual.

Parameters:



105
# File 'lib/wx/doc/comboctrl.rb', line 105

def on_combo_char_event(event) end

#on_combo_double_clickvoid

This method returns an undefined value.

The including class may implement this to do something when the parent Wx::ComboCtrl gets double-clicked.



91
# File 'lib/wx/doc/comboctrl.rb', line 91

def on_combo_double_click; end

#on_combo_key_event(event) ⇒ void

This method returns an undefined value.

The including class may implement this to receive key down events from the parent Wx::ComboCtrl.

Events not handled should be skipped, as usual.

Parameters:



98
# File 'lib/wx/doc/comboctrl.rb', line 98

def on_combo_key_event(event) end

#on_dismissvoid

This method returns an undefined value.

The including class may implement this to do special processing when popup is hidden.



109
# File 'lib/wx/doc/comboctrl.rb', line 109

def on_dismiss; end

#on_popupvoid

This method returns an undefined value.

The including class may implement this to do special processing when popup is shown.



113
# File 'lib/wx/doc/comboctrl.rb', line 113

def on_popup; end

#paint_combo_control(dc, rect) ⇒ void

This method returns an undefined value.

The including class may implement this to paint the parent Wx::ComboCtrl. This is called to custom paint in the combo control itself (ie. not the popup).

Default implementation draws value as string.

Parameters:



122
# File 'lib/wx/doc/comboctrl.rb', line 122

def paint_combo_control(dc, rect) end

#set_string_value(value) ⇒ void

This method returns an undefined value.

The including class must implement this to receive string value changes from Wx::ComboCtrl.

Parameters:

  • value (String)


83
# File 'lib/wx/doc/comboctrl.rb', line 83

def set_string_value(value) end