Merge wxQT branch into the trunk.

This merges in the latest sources from GSoC 2014 wxQt project with just a few
minor corrections, mostly undoing wrong changes to common files in that branch
(results of a previous bad merge?) and getting rid of whitespace-only changes.
Also remove debug logging from wxGrid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-08-24 01:50:11 +00:00
parent d513d3e2f0
commit df13791078
381 changed files with 24333 additions and 938 deletions

103
src/qt/anybutton.cpp Normal file
View File

@@ -0,0 +1,103 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/qt/anybutton.cpp
// Author: Mariano Reingart
// Copyright: (c) 2014 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef wxHAS_ANY_BUTTON
#ifndef WX_PRECOMP
#include "wx/anybutton.h"
#endif
#include "wx/bitmap.h"
#include "wx/qt/private/utils.h"
#include "wx/qt/private/winevent.h"
class wxQtPushButton : public wxQtEventSignalHandler< QPushButton, wxAnyButton >
{
public:
wxQtPushButton( wxWindow *parent, wxAnyButton *handler);
private:
void clicked(bool);
};
wxQtPushButton::wxQtPushButton(wxWindow *parent, wxAnyButton *handler)
: wxQtEventSignalHandler< QPushButton, wxAnyButton >( parent, handler )
{
connect(this, &QPushButton::clicked, this, &wxQtPushButton::clicked);
}
void wxQtPushButton::clicked( bool WXUNUSED(checked) )
{
wxAnyButton *handler = GetHandler();
if ( handler )
{
wxCommandEvent event( wxEVT_BUTTON, handler->GetId() );
EmitEvent( event );
}
}
void wxAnyButton::QtCreate(wxWindow *parent)
{
// create the default push button (used in button and bmp button)
m_qtPushButton = new wxQtPushButton( parent, this );
}
void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap )
{
// load the bitmap and resize the button:
QPixmap *pixmap = bitmap.GetHandle();
m_qtPushButton->setIcon( QIcon( *pixmap ));
m_qtPushButton->setIconSize( pixmap->rect().size() );
}
void wxAnyButton::SetLabel( const wxString &label )
{
m_qtPushButton->setText( wxQtConvertString( label ));
}
QPushButton *wxAnyButton::GetHandle() const
{
return m_qtPushButton;
}
void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
switch ( which )
{
case State_Normal:
QtSetBitmap(bitmap);
InvalidateBestSize();
break;
case State_Pressed:
wxMISSING_IMPLEMENTATION( wxSTRINGIZE( State_Pressed ));
break;
case State_Current:
wxMISSING_IMPLEMENTATION( wxSTRINGIZE( State_Current ));
break;
case State_Focused:
wxMISSING_IMPLEMENTATION( wxSTRINGIZE( State_Focused ));
break;
case State_Disabled:
wxMISSING_IMPLEMENTATION( wxSTRINGIZE( State_Disabled ));
break;
case State_Max:
wxMISSING_IMPLEMENTATION( wxSTRINGIZE( State_Max ));
}
}
#endif // wxHAS_ANY_BUTTON