/////////////////////////////////////////////////////////////////////////////
// Name: combo.h
-// Purpose: documentation for wxComboPopup class
+// Purpose: interface of wxComboPopup
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
@library{wxcore}
@category{FIXME}
- @seealso
- wxComboCtrl
+ @see wxComboCtrl
*/
class wxComboPopup
{
/**
The derived class must implement this to create the popup control.
-
+
@returns @true if the call succeeded, @false otherwise.
*/
bool Create(wxWindow* parent);
/**
The derived class may implement this to return adjusted size
for the popup control, according to the variables given.
-
+
@param minWidth
Preferred minimum width.
@param prefHeight
@param maxWidth
Max height for window, as limited by
screen size.
-
+
@remarks Called each time popup is about to be shown.
*/
wxSize GetAdjustedSize(int minWidth, int prefHeight,
The derived class must implement this to return
string representation of the value.
*/
- wxString GetStringValue();
+ wxString GetStringValue() const;
/**
The derived class must implement this to initialize
Utility method that returns @true if Create has been called.
Useful in conjunction with LazyCreate().
*/
- bool IsCreated();
+ bool IsCreated() const;
/**
The derived class may implement this to return
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.
-
+
@remarks Base implementation returns @false.
*/
bool LazyCreate();
};
+
/**
@class wxComboCtrl
@wxheader{combo.h}
@category{ctrl}
@appearance{comboctrl.png}
- @seealso
- wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxComboPopup, wxCommandEvent
+ @see wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxComboPopup, wxCommandEvent
*/
class wxComboCtrl : public wxControl
{
//@{
/**
Constructor, creating and showing a combo control.
-
+
@param parent
Parent window. Must not be @NULL.
@param id
Window validator.
@param name
Window name.
-
+
@see Create(), wxValidator
*/
wxComboCtrl();
This member function is not normally called in application code.
Instead, it can be implemented in a derived class to create a
custom popup animation.
-
+
@returns @true if animation finishes before the function returns. @false
otherwise. In the latter case you need to manually call
DoShowPopup after the animation ends.
is properly shown after a popup animation has finished (but only
if AnimateShow() did not finish
the animation within it's function scope).
-
+
@param rect
Position to show the popup window at, in screen coordinates.
@param flags
/**
Returns disabled button bitmap that has been set with
SetButtonBitmaps().
-
+
@returns A reference to the disabled state bitmap.
*/
- const wxBitmap GetBitmapDisabled();
+ const wxBitmap GetBitmapDisabled() const;
/**
Returns button mouse hover bitmap that has been set with
SetButtonBitmaps().
-
+
@returns A reference to the mouse hover state bitmap.
*/
- const wxBitmap GetBitmapHover();
+ const wxBitmap GetBitmapHover() const;
/**
Returns default button bitmap that has been set with
SetButtonBitmaps().
-
+
@returns A reference to the normal state bitmap.
*/
- const wxBitmap GetBitmapNormal();
+ const wxBitmap GetBitmapNormal() const;
/**
Returns depressed button bitmap that has been set with
SetButtonBitmaps().
-
+
@returns A reference to the depressed state bitmap.
*/
- const wxBitmap GetBitmapPressed();
+ const wxBitmap GetBitmapPressed() const;
/**
Returns current size of the dropdown button.
/**
Returns custom painted area in control.
-
+
@see SetCustomPaintWidth().
*/
- int GetCustomPaintWidth();
+ int GetCustomPaintWidth() const;
/**
Returns features supported by wxComboCtrl. If needed feature is missing,
you need to instead use wxGenericComboCtrl, which however may lack
native look and feel (but otherwise sports identical API).
-
+
@returns Value returned is a combination of following flags:
*/
static int GetFeatures();
@b Note: Under wxMSW, this function always returns 0 if the combo control
doesn't have the focus.
*/
- long GetInsertionPoint();
+ long GetInsertionPoint() const;
/**
Returns the last position in the combo control text field.
*/
- long GetLastPosition();
+ long GetLastPosition() const;
/**
Returns current popup interface that has been set with SetPopupControl.
/**
Returns popup window containing the popup control.
*/
- wxWindow* GetPopupWindow();
+ wxWindow* GetPopupWindow() const;
/**
Get the text control which is part of the combo control.
*/
- wxTextCtrl* GetTextCtrl();
+ wxTextCtrl* GetTextCtrl() const;
/**
Returns actual indentation in pixels.
*/
- wxCoord GetTextIndent();
+ wxCoord GetTextIndent() const;
/**
Returns area covered by the text field (includes everything except
borders and the dropdown button).
*/
- const wxRect GetTextRect();
+ const wxRect GetTextRect() const;
/**
Returns text representation of the current value. For writable
combo control it always returns the value in the text field.
*/
- wxString GetValue();
+ wxString GetValue() const;
/**
Dismisses the popup window.
/**
Returns @true if the popup is currently shown
*/
- bool IsPopupShown();
+ bool IsPopupShown() const;
/**
Returns @true if the popup window is in the given state.
Possible values are:
-
+
@c Hidden()
-
+
Popup window is hidden.
-
+
@c Animating()
-
+
Popup window is being shown, but the
popup animation has not yet finished.
-
+
@c Visible()
-
+
Popup window is fully visible.
*/
- bool IsPopupWindowState(int state);
+ bool IsPopupWindowState(int state) const;
/**
Implement in a derived class to define what happens on
/**
Removes the text between the two positions in the combo control text field.
-
+
@param from
The first position.
@param to
/**
Replaces the text between two positions with the given text, in the combo
control text field.
-
+
@param from
The first position.
@param to
/**
Sets custom dropdown button graphics.
-
+
@param bmpNormal
Default button image.
@param pushButtonBg
/**
Sets size and position of dropdown button.
-
+
@param width
Button width. Value = 0 specifies default.
@param height
/**
Sets the insertion point in the text field.
-
+
@param pos
The new insertion point.
*/
/**
Extends popup size horizontally, relative to the edges of the combo control.
-
+
@param extLeft
How many pixel to extend beyond the left edge of the
control. Default is 0.
@param extRight
How many pixel to extend beyond the right edge of the
control. Default is 0.
-
+
@remarks Popup minimum width may override arguments.
*/
void SetPopupExtents(int extLeft, int extRight);
/**
Sets preferred maximum height of the popup.
-
+
@remarks Value -1 indicates the default.
*/
void SetPopupMaxHeight(int height);
/**
Sets minimum width of the popup. If wider than combo control, it will extend to
the left.
-
+
@remarks Value -1 indicates the default.
*/
void SetPopupMinWidth(int width);
/**
Selects the text between the two positions, in the combo control text field.
-
+
@param from
The first position.
@param to
*/
void UseAltPopupWindow(bool enable = true);
};
+