void CFileEditCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { // check for CTRL + 'period' keystroke, if found, simulate a mouse click on the button if ((nChar == 0xBE || nChar == 0x6E) && GetKeyState(VK_CONTROL) < 0) ButtonClicked(); inherited::OnKeyDown(nChar, nRepCnt, nFlags); }
Maemo5Tray::Maemo5Tray() : NotificationBackend("Tray") { setDescription(QT_TR_NOOP("Maemo 5 blink icon in the tray")); m_activeAccount = 0; m_offlineIconPath = IconLoader::iconPath("qutim-offline",Maemo5Docklet::GetIconSize()); m_mailIconPath = IconLoader::iconPath("mail-message-new-qutim",Maemo5Docklet::GetIconSize()); m_typingIconPath = IconLoader::iconPath("im-status-message-edit",Maemo5Docklet::GetIconSize()); m_chatUserJoinedIconPath = IconLoader::iconPath("list-add-user-conference",Maemo5Docklet::GetIconSize()); m_chatUserLeftIconPath = IconLoader::iconPath("list-remove-user-conference",Maemo5Docklet::GetIconSize()); m_qutimIconPath = IconLoader::iconPath("qutim",Maemo5Docklet::GetIconSize()); m_transferCompletedIconPath = IconLoader::iconPath("mdocument-save-filetransfer-comleted",Maemo5Docklet::GetIconSize()); m_defaultNotificationIconPath = IconLoader::iconPath("dialog-information",Maemo5Docklet::GetIconSize()); Maemo5Docklet::Enable(); Maemo5Docklet::SetTooltip("qutIM::Offline"); Maemo5Docklet::SetIcon(m_offlineIconPath,false); connect(Maemo5Docklet::Instance(), SIGNAL(ButtonClicked()),this, SLOT(onActivated())); QMap<QString, Protocol*> protocols; foreach (Protocol *proto, Protocol::all()) { protocols.insert(proto->id(), proto); connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)), this, SLOT(onAccountCreated(qutim_sdk_0_3::Account*))); }
void LayerControl::HandleEvent(SDL_Event &event) { if (event.type != SDL_MOUSEBUTTONDOWN || event.button.button != SDL_BUTTON_LEFT) { return; } // // Start/Stop button click. // if (ButtonClicked(event.button.x, event.button.y, m_startButton)) { if (System::Stopped()) { System::Start(); m_startButton.SetLabel("Stop"); } else { System::Stop(); m_startButton.SetLabel("Start"); } m_startButton.Click(); } // // Reset button click. // else if (ButtonClicked(event.button.x, event.button.y, m_resetButton)) { System::Reset(); m_resetButton.Click(); m_startButton.SetLabel("Start"); } // // Exit button click. // else if (ButtonClicked(event.button.x, event.button.y, m_exitButton)) { System::Quit(); m_exitButton.Click(); } }
void QSelectFaceWidget::SetEmotionGridLayout() { QFileInfoList InfoList = QDir(this->faceIconDir).entryInfoList(); QFileInfo fileInfo; QImage* img=new QImage; //gridLayout QGridLayout* gridLayout = new QGridLayout(this); gridLayout->setMargin(2); gridLayout->setRowStretch(0, 1); gridLayout->setRowStretch(1, 1); gridLayout->setRowStretch(2, 1); gridLayout->setColumnStretch(0, 1); gridLayout->setColumnStretch(1, 1); gridLayout->setColumnStretch(2, 1); gridLayout->setColumnStretch(3, 1); //get picures int picCount = 0; foreach(fileInfo, InfoList) { if(!fileInfo.isFile()) continue; if(0==fileInfo.suffix().compare("jpg") || 0==fileInfo.suffix().compare("png")) { qDebug() << fileInfo.filePath(); if(! ( img->load(fileInfo.filePath()) ) ) { qCritical() << "\t" <<"Load image failed ! "; delete(img); img = NULL; return ; } QPainter painter(this); QPixmap pixmapToShow = QPixmap::fromImage( img->scaled(size(), Qt::KeepAspectRatio) ); painter.drawPixmap(0,0, pixmapToShow); QIcon *icon = new QIcon(pixmapToShow); MyPushButton* imgButton = new MyPushButton(this); imgButton->setIcon(*icon); imgButton->setText(""); imgButton->setIconSize(QSize(60, 60)); imgButton->setFixedSize(60, 60); imgButton->setAccessibleDescription(fileInfo.filePath()); connect(imgButton, SIGNAL(ButtonClicked(QString)), this, SLOT(on_face_selected(QString))); gridLayout->addWidget(imgButton, picCount/4, picCount%4); picCount++; } } }
RtKeyButton::RtKeyButton(QWidget *parent, int iListIndex) :QPushButton(parent) { m_iStartY = 0; m_bIsScroll = false; m_iListIndex = iListIndex; m_RectText = QRect(); m_LeftTop = QPoint(0,0); m_iStyle = AlignLeftTop; m_bExtKey = false; if(m_iListIndex != -1) connect(this, SIGNAL(clicked()), this, SLOT(ButtonClicked())); }
void wcSliderButton::OnNcLButtonDown(UINT nHitTest, CPoint point) { CEdit::OnNcLButtonDown(nHitTest, point); if (ScreenPointInButtonRect(point)) { // Capture mouse input, set the focus to this control, // and draw the button as pressed m_bMouseCaptured = TRUE; SetFocus(); DrawButton(BTN_DOWN); ButtonClicked(point); } }
void TabBar::OnClicked(const int id, bool check) { for(ButtonIter iter = buttons_.begin(); iter != buttons_.end(); ++iter) { if (id != (*iter)->id()) { (*iter)->setChecked(false); } else { (*iter)->setChecked(true); } } emit ButtonClicked(id); }
QNumButton::QNumButton(QWidget *parent) : QWidget(parent) { mainCheckBox = new QCheckBox; connect(mainCheckBox,SIGNAL(clicked()),this,SLOT(CheckBoxClicked())); mainButton = new QPushButton; connect(mainButton,SIGNAL(clicked()),this,SLOT(ButtonClicked())); sequenceNumber = new int; *sequenceNumber = -1; mainLayout = new QHBoxLayout; mainLayout->addWidget(mainCheckBox); mainLayout->addWidget(mainButton); mainLayout->addStretch(); setLayout(mainLayout); }
void CFileEditCtrl::OnLButtonUp(UINT nFlags, CPoint point) { inherited::OnLButtonUp(nFlags, point); // Release the mouse capture and draw the button as normal. If the // cursor is over the button, simulate a click by carrying // out the required action. if (m_bMouseCaptured) { ReleaseCapture(); m_bMouseCaptured = FALSE; if (m_nButtonState != BTN_UP) DrawButton(BTN_UP); point.Offset(1,1); if (m_rcButtonArea.PtInRect(point)) ButtonClicked(); } }
void Maemo5Docklet::clickedSignal() { emit ButtonClicked(); }