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:
91
src/qt/gauge.cpp
Normal file
91
src/qt/gauge.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/qt/gauge.cpp
|
||||
// Author: Peter Most, Mariano Reingart
|
||||
// Copyright: (c) 2010 wxWidgets dev team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/gauge.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
|
||||
class wxQtProgressBar : public wxQtEventSignalHandler< QProgressBar, wxGauge >
|
||||
{
|
||||
public:
|
||||
wxQtProgressBar( wxWindow *parent, wxGauge *handler );
|
||||
|
||||
private:
|
||||
void valueChanged(int value);
|
||||
};
|
||||
|
||||
wxQtProgressBar::wxQtProgressBar( wxWindow *parent, wxGauge *handler )
|
||||
: wxQtEventSignalHandler< QProgressBar, wxGauge >( parent, handler )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxGauge::wxGauge()
|
||||
{
|
||||
}
|
||||
|
||||
wxGauge::wxGauge(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
Create( parent, id, range, pos, size, style, validator, name );
|
||||
}
|
||||
|
||||
bool wxGauge::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
m_qtProgressBar = new wxQtProgressBar( parent, this);
|
||||
m_qtProgressBar->setOrientation( wxQtConvertOrientation( style, wxGA_HORIZONTAL ));
|
||||
m_qtProgressBar->setRange( 0, range );
|
||||
m_qtProgressBar->setTextVisible( style & wxGA_TEXT );
|
||||
|
||||
return QtCreateControl( parent, id, pos, size, style, validator, name );
|
||||
}
|
||||
|
||||
|
||||
QProgressBar *wxGauge::GetHandle() const
|
||||
{
|
||||
return m_qtProgressBar;
|
||||
}
|
||||
|
||||
// set/get the control range and value
|
||||
|
||||
void wxGauge::SetRange(int range)
|
||||
{
|
||||
// note that in wx minimun range is fixed at 0
|
||||
m_qtProgressBar->setMaximum(range);
|
||||
}
|
||||
|
||||
int wxGauge::GetRange() const
|
||||
{
|
||||
return m_qtProgressBar->maximum();
|
||||
}
|
||||
|
||||
void wxGauge::SetValue(int pos)
|
||||
{
|
||||
m_qtProgressBar->setValue(pos);
|
||||
}
|
||||
|
||||
int wxGauge::GetValue() const
|
||||
{
|
||||
return m_qtProgressBar->value();
|
||||
}
|
Reference in New Issue
Block a user