Commit history was lost in the git to svn merge for trunk, so this reflect work done in two GSOC projects and/or by several authors. Lines changed by each user was the main metric used to ack major contributions. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
86 lines
2.4 KiB
C++
86 lines
2.4 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: src/qt/checklst.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/checklst.h"
|
|
|
|
wxCheckListBox::wxCheckListBox()
|
|
{
|
|
}
|
|
|
|
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
|
const wxPoint& pos,
|
|
const wxSize& size,
|
|
int nStrings,
|
|
const wxString *choices,
|
|
long style,
|
|
const wxValidator& validator,
|
|
const wxString& name )
|
|
{
|
|
Create( parent, id, pos, size, nStrings, choices, style, validator, name );
|
|
}
|
|
|
|
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
|
const wxPoint& pos,
|
|
const wxSize& size,
|
|
const wxArrayString& choices,
|
|
long style,
|
|
const wxValidator& validator,
|
|
const wxString& name )
|
|
{
|
|
Create( parent, id, pos, size, choices, style, validator, name );
|
|
}
|
|
|
|
wxCheckListBox::~wxCheckListBox()
|
|
{
|
|
Clear();
|
|
}
|
|
|
|
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
|
const wxPoint& pos,
|
|
const wxSize& size,
|
|
int n, const wxString choices[],
|
|
long style,
|
|
const wxValidator& validator,
|
|
const wxString& name )
|
|
{
|
|
return wxCheckListBoxBase::Create( parent, id, pos, size, n, choices, style, validator, name );
|
|
}
|
|
|
|
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
|
const wxPoint& pos,
|
|
const wxSize& size,
|
|
const wxArrayString& choices,
|
|
long style,
|
|
const wxValidator& validator,
|
|
const wxString& name )
|
|
{
|
|
return wxCheckListBoxBase::Create( parent, id, pos, size, choices, style, validator, name );
|
|
}
|
|
|
|
void wxCheckListBox::Init()
|
|
{
|
|
m_hasCheckBoxes = true;
|
|
}
|
|
|
|
bool wxCheckListBox::IsChecked(unsigned int n) const
|
|
{
|
|
QListWidgetItem* item = m_qtListWidget->item(n);
|
|
wxCHECK_MSG(item != NULL, false, wxT("wrong listbox index") );
|
|
return item->checkState() == Qt::Checked;
|
|
}
|
|
|
|
void wxCheckListBox::Check(unsigned int n, bool check )
|
|
{
|
|
QListWidgetItem* item = m_qtListWidget->item(n);
|
|
wxCHECK_RET(item != NULL, wxT("wrong listbox index") );
|
|
return item->setCheckState(check ? Qt::Checked : Qt::Unchecked);
|
|
}
|
|
|