wxGenericComboControl Class Reference

#include <combog.h>

Inheritance diagram for wxGenericComboControl:

wxComboCtrlBase wxComboCtrl wxGridCombo wxOwnerDrawnComboBox wxSliderCombo List of all members.

Public Member Functions

 wxGenericComboControl ()
 wxGenericComboControl (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &value=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr)
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &value=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr)
virtual ~wxGenericComboControl ()

Static Public Member Functions

static int GetFeatures ()

Protected Member Functions

virtual void OnResize ()
void OnPaintEvent (wxPaintEvent &event)
void OnMouseEvent (wxMouseEvent &event)

Private Member Functions

void Init ()

Detailed Description

Definition at line 49 of file combog.h.


Constructor & Destructor Documentation

wxGenericComboControl::wxGenericComboControl  )  [inline]
 

Definition at line 53 of file combog.h.

00053 : wxComboCtrlBase() { Init(); }

wxGenericComboControl::wxGenericComboControl wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  value = wxEmptyString,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxComboBoxNameStr
[inline]
 

Definition at line 55 of file combog.h.

00063         : wxComboCtrlBase()
00064     {
00065         Init();
00066 
00067         (void)Create(parent, id, value, pos, size, style, validator, name);
00068     }

wxGenericComboControl::~wxGenericComboControl  )  [virtual]
 

Definition at line 167 of file combog.cpp.

00168 {
00169 }


Member Function Documentation

bool wxGenericComboControl::Create wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxString &  value = wxEmptyString,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxComboBoxNameStr
 

Reimplemented from wxComboCtrlBase.

Reimplemented in wxOwnerDrawnComboBox.

Definition at line 96 of file combog.cpp.

00104 {
00105 
00106     // Set border
00107     long border = style & wxBORDER_MASK;
00108 
00109     if ( !border )
00110     {
00111 #if defined(__WXUNIVERSAL__)
00112         border = wxBORDER_SIMPLE;
00113 #elif defined(__WXMSW__)
00114         // For XP, have 1-width custom border, for older version use sunken
00115         if ( wxUxThemeEngine::GetIfActive() )
00116         {
00117             border = wxBORDER_NONE;
00118             m_widthCustomBorder = 1;
00119         }
00120         else
00121             border = wxBORDER_SUNKEN;
00122 #elif defined(__WXGTK__)
00123         border = wxBORDER_NONE;
00124         //m_widthCustomBorder = 2;
00125         m_widthCustomBorder = 1;
00126 #else
00127         border = wxBORDER_SIMPLE;
00128 #endif
00129 
00130         style = (style & ~(wxBORDER_MASK)) | border;
00131     }
00132 
00133 #if defined(__WXGTK__)
00134     Customize( wxCC_BUTTON_OUTSIDE_BORDER |
00135                wxCC_NO_TEXT_AUTO_SELECT );
00136 #endif
00137 
00138     if ( style & wxCC_STD_BUTTON )
00139         m_iFlags |= wxCC_POPUP_ON_MOUSE_UP;
00140 
00141     // create main window
00142     if ( !wxComboCtrlBase::Create(parent,
00143                                   id,
00144                                   value,
00145                                   pos,
00146                                   size,
00147                                   style | wxFULL_REPAINT_ON_RESIZE,
00148                                   wxDefaultValidator,
00149                                   name) )
00150         return false;
00151 
00152     // Create textctrl, if necessary
00153     CreateTextCtrl( wxNO_BORDER, validator );
00154 
00155     // Add keyboard input handlers for main control and textctrl
00156     InstallInputHandlers( true );
00157 
00158     // Set background
00159     SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering
00160 
00161     // SetBestSize should be called last
00162     SetBestSize(size);
00163 
00164     return true;
00165 }

static int wxGenericComboControl::GetFeatures  )  [inline, static]
 

Definition at line 81 of file combog.h.

00081 { return wxComboCtrlFeatures::All; }

void wxGenericComboControl::Init  )  [private]
 

Reimplemented from wxComboCtrlBase.

Reimplemented in wxGridCombo, wxOwnerDrawnComboBox, and wxSliderCombo.

Definition at line 92 of file combog.cpp.

00093 {
00094 }

void wxGenericComboControl::OnMouseEvent wxMouseEvent &  event  )  [protected]
 

Definition at line 273 of file combog.cpp.

00274 {
00275     bool isOnButtonArea = m_btnArea.Inside(event.m_x,event.m_y);
00276     int handlerFlags = isOnButtonArea ? wxCC_MF_ON_BUTTON : 0;
00277 
00278     // Preprocessing fabricates double-clicks and prevents
00279     // (it may also do other common things in future)
00280     if ( PreprocessMouseEvent(event,handlerFlags) )
00281         return;
00282 
00283 #ifdef __WXMSW__
00284     const bool ctrlIsButton = true;
00285 #else
00286     const bool ctrlIsButton = false;
00287 #endif
00288 
00289     if ( ctrlIsButton &&
00290          (m_windowStyle & (wxCC_SPECIAL_DCLICK|wxCB_READONLY)) == wxCB_READONLY )
00291     {
00292         // if no textctrl and no special double-click, then the entire control acts
00293         // as a button
00294         handlerFlags |= wxCC_MF_ON_BUTTON;
00295         if ( HandleButtonMouseEvent(event,handlerFlags) )
00296             return;
00297     }
00298     else
00299     {
00300         if ( isOnButtonArea || HasCapture() )
00301         {
00302             if ( HandleButtonMouseEvent(event,handlerFlags) )
00303                 return;
00304         }
00305         else if ( m_btnState )
00306         {
00307             // otherwise need to clear the hover status
00308             m_btnState = 0;
00309             RefreshRect(m_btnArea);
00310         }
00311     }
00312 
00313     //
00314     // This will handle left_down and left_dclick events outside button in a Windows/GTK-like manner.
00315     // See header file for further information on this method.
00316     HandleNormalMouseEvent(event);
00317 
00318 }

void wxGenericComboControl::OnPaintEvent wxPaintEvent &  event  )  [protected]
 

void wxGenericComboControl::OnResize  )  [protected, virtual]
 

Implements wxComboCtrlBase.

Definition at line 171 of file combog.cpp.

00172 {
00173 
00174     // Recalculates button and textctrl areas
00175     CalculateAreas(DEFAULT_DROPBUTTON_WIDTH);
00176 
00177 #if 0
00178     // Move separate button control, if any, to correct position
00179     if ( m_btn )
00180     {
00181         wxSize sz = GetClientSize();
00182         m_btn->SetSize( m_btnArea.x + m_btnSpacingX,
00183                         (sz.y-m_btnSize.y)/2,
00184                         m_btnSize.x,
00185                         m_btnSize.y );
00186     }
00187 #endif
00188 
00189     // Move textctrl, if any, accordingly
00190     PositionTextCtrl( TEXTCTRLXADJUST, TEXTCTRLYADJUST );
00191 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:03:17 2007 for Camelot by  doxygen 1.4.4