Ejemplo n.º 1
0
AddParticipantBox::AddParticipantBox(ChatData *chat) :
	_scroll(this, st::newGroupScroll), _inner(chat),
	_filter(this, st::contactsFilter, lang(lng_participant_filter)),
	_invite(this, lang(lng_participant_invite), st::btnSelectDone),
	_cancel(this, lang(lng_cancel), st::btnSelectCancel),
	_hiding(false), a_opacity(0, 1), af_opacity(anim::linear) {

	_width = st::participantWidth;
	_height = App::wnd()->height() - st::boxPadding.top() - st::boxPadding.bottom();
	if (_height > st::participantMaxHeight) _height = st::participantMaxHeight;

	resize(_width, _height);

	_scroll.setWidget(&_inner);
	_scroll.setFocusPolicy(Qt::NoFocus);

	connect(&_invite, SIGNAL(clicked()), this, SLOT(onInvite()));
	connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(closed()));
	connect(&_scroll, SIGNAL(scrolled()), &_inner, SLOT(updateSel()));
	connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
	connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
	connect(&_filter, SIGNAL(cancelled()), this, SIGNAL(onClose()));
	connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int)));
	connect(&_inner, SIGNAL(selectAllQuery()), &_filter, SLOT(selectAll()));

	showAll();
	_cache = myGrab(this, rect());
	hideAll();
}
Ejemplo n.º 2
0
ContactsBox::ContactsBox() : _scroll(this, st::newGroupScroll), _inner(),
	_addContact(this, lang(lng_add_contact_button), st::contactsAdd),
	_filter(this, st::contactsFilter, lang(lng_participant_filter)),
	_close(this, lang(lng_contacts_done), st::contactsClose),
	_hiding(false), a_opacity(0, 1) {

	_width = st::participantWidth;
	_height = App::wnd()->height() - st::boxPadding.top() - st::boxPadding.bottom();
	if (_height > st::participantMaxHeight) _height = st::participantMaxHeight;

	resize(_width, _height);

	_scroll.setWidget(&_inner);
	_scroll.setFocusPolicy(Qt::NoFocus);

	connect(&_addContact, SIGNAL(clicked()), App::wnd(), SLOT(onShowAddContact()));
	connect(&_close, SIGNAL(clicked()), this, SLOT(onClose()));
	connect(&_scroll, SIGNAL(scrolled()), &_inner, SLOT(updateSel()));
	connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
	connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
	connect(&_filter, SIGNAL(cancelled()), this, SLOT(onClose()));
	connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int)));

	showAll();
	_cache = myGrab(this, rect());
	hideAll();
}
Ejemplo n.º 3
0
void ContactsInner::mousePressEvent(QMouseEvent *e) {
	_mouseSel = true;
	_lastMousePos = e->globalPos();
	updateSel();
	if (e->button() == Qt::LeftButton) {
		chooseParticipant();
	}
}
Ejemplo n.º 4
0
void CountrySelectInner::mousePressEvent(QMouseEvent *e) {
	_mouseSel = true;
	_lastMousePos = e->globalPos();
	updateSel();
	if (e->button() == Qt::LeftButton) {
		chooseCountry();
	}
}
Ejemplo n.º 5
0
CountrySelectBox::CountrySelectBox() : ItemListBox(st::countriesScroll, st::boxWidth)
, _inner()
, _filter(this, st::boxSearchField, lang(lng_country_ph))
, _filterCancel(this, st::boxSearchCancel)
, _topShadow(this) {
	ItemListBox::init(&_inner, st::boxScrollSkip, st::boxTitleHeight + _filter.height());

	connect(&_scroll, SIGNAL(scrolled()), &_inner, SLOT(updateSel()));
	connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
	connect(&_filter, SIGNAL(submitted(bool)), this, SLOT(onSubmit()));
	connect(&_filterCancel, SIGNAL(clicked()), this, SLOT(onFilterCancel()));
	connect(&_inner, SIGNAL(mustScrollTo(int, int)), &_scroll, SLOT(scrollToY(int, int)));
	connect(&_inner, SIGNAL(countryChosen(const QString&)), this, SIGNAL(countryChosen(const QString&)));

	_filterCancel.setAttribute(Qt::WA_OpaquePaintEvent);

	prepare();
}
Ejemplo n.º 6
0
LRESULT COptionsPageClips::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_combo.Attach(GetDlgItem(IDC_SCHEMECOMBO));
	m_list.Attach(GetDlgItem(IDC_CLIPLIST));

	m_combo.Load(m_pSchemes);

	CRect rcScintilla;
	::GetWindowRect(GetDlgItem(IDC_PLACEHOLDER), rcScintilla);
	ScreenToClient(rcScintilla);
	m_scintilla.Create(m_hWnd, rcScintilla, _T("ClipText"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_TABSTOP, WS_EX_STATICEDGE);
	::SetWindowPos(m_scintilla, GetDlgItem(IDC_PLACEHOLDER), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
	m_scintilla.SetWrapMode(SC_WRAP_WORD);
	m_scintilla.AssignCmdKey(SCK_HOME, SCI_HOMEDISPLAY);
	m_scintilla.AssignCmdKey(SCK_END, SCI_LINEENDDISPLAY);
	m_scintilla.SetMarginWidthN(1, 0);
	
	// Stop scintilla from capturing the escape and tab keys...
	m_scintilla.ClearCmdKey(SCK_ESCAPE);
	m_scintilla.ClearCmdKey(SCK_TAB);

	SchemeManager::GetInstance()->GetDefaultScheme()->Load(m_scintilla);

	m_scintilla.SetReadOnly(true);

	CRect rc;
	m_list.GetClientRect(&rc);
	int wCol = rc.right - rc.left - 20 - 80;
	m_list.InsertColumn(0, LS(IDS_HDR_CLIPS_SHORTCUT), LVCFMT_LEFT, 80, 0);
	m_list.InsertColumn(1, LS(IDS_HDR_CLIPS_HINT), LVCFMT_LEFT, wCol, 0);
	m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);

	updateSel();

	return 0;
}
Ejemplo n.º 7
0
LRESULT COptionsPageClips::OnSchemeComboChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	updateSel();

	return 0;
}
Ejemplo n.º 8
0
void ContactsInner::mouseMoveEvent(QMouseEvent *e) {
	_mouseSel = true;
	_lastMousePos = e->globalPos();
	updateSel();
}
Ejemplo n.º 9
0
void ContactsInner::leaveEvent(QEvent *e) {
	setMouseTracking(false);
	updateSel();
}
Ejemplo n.º 10
0
void NewGroupInner::mouseMoveEvent(QMouseEvent *e) {
	_mouseSel = true;
	_lastMousePos = e->globalPos();
	updateSel();
}
Ejemplo n.º 11
0
void NewGroupInner::leaveEvent(QEvent *e) {
	setMouseTracking(false);
	updateSel();
}
Ejemplo n.º 12
0
void AddParticipantInner::mouseMoveEvent(QMouseEvent *e) {
	_mouseSel = true;
	_lastMousePos = e->globalPos();
	updateSel();
}
Ejemplo n.º 13
0
void AddParticipantInner::leaveEvent(QEvent *e) {
	setMouseTracking(false);
	updateSel();
}