#include "wx/timer.h"
#endif
-#include "wx/dcbuffer.h"
#include "wx/tooltip.h"
#include "wx/combo.h"
#if defined(__WXMSW__)
#define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED 0 // 1 if text in textctrl is vertically centered
//#undef wxUSE_POPUPWIN
//#define wxUSE_POPUPWIN 0
#elif defined(__WXGTK__)
#define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered
#elif defined(__WXMAC__)
#define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered
#else
#define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered
#endif
IMPLEMENT_ABSTRACT_CLASS(wxComboCtrlBase, wxControl)
-// Have global double buffer - should be enough for multiple combos
-static wxBitmap* gs_doubleBuffer = (wxBitmap*) NULL;
-
void wxComboCtrlBase::Init()
{
m_winPopup = (wxWindow *)NULL;
{
if ( !(m_windowStyle & wxCB_READONLY) )
{
+ if ( m_text )
+ m_text->Destroy();
+
// wxTE_PROCESS_TAB is needed because on Windows, wxTAB_TRAVERSAL is
// not used by the wxPropertyGrid and therefore the tab is processed by
// looking at ancestors to see if they have wxTAB_TRAVERSAL. The
if ( HasCapture() )
ReleaseMouse();
- delete gs_doubleBuffer;
- gs_doubleBuffer = (wxBitmap*) NULL;
-
#if INSTALL_TOPLEV_HANDLER
delete ((wxComboFrameEventHandler*)m_toplevEvtHandler);
m_toplevEvtHandler = (wxEvtHandler*) NULL;
wxSize sz = GetClientSize();
int customBorder = m_widthCustomBorder;
+#if !TEXTCTRL_TEXT_CENTERED
if ( (m_text->GetWindowStyleFlag() & wxBORDER_MASK) == wxNO_BORDER )
{
// Centre textctrl
}
}
else
+#else
+ wxUnusedVar(textCtrlXAdjust);
+ wxUnusedVar(textCtrlYAdjust);
+#endif
{
- m_text->SetSize( m_tcArea.x,
- 0,
- sz.x - m_btnArea.x - m_widthCustomPaint - customBorder,
- sz.y );
+ // If it has border, have textctrl will the entire text field.
+ m_text->SetSize( m_tcArea.x + m_widthCustomPaint,
+ customBorder,
+ sz.x - m_btnArea.width - m_widthCustomPaint - customBorder,
+ sz.y-(customBorder*2) );
}
}
}
}
-wxBitmap& wxComboCtrlBase::GetBufferBitmap( const wxSize& sz ) const
-{
- // If size is larger, recalculate double buffer bitmap
- if ( !gs_doubleBuffer ||
- sz.x > gs_doubleBuffer->GetWidth() ||
- sz.y > gs_doubleBuffer->GetHeight() )
- {
- delete gs_doubleBuffer;
- gs_doubleBuffer = new wxBitmap(sz.x+25,sz.y);
- }
- return *gs_doubleBuffer;
-}
-
// ----------------------------------------------------------------------------
// miscellaneous event handlers
// ----------------------------------------------------------------------------