void QueueManager::CurrentPlaylistChanged(Playlist* playlist) { if (current_playlist_) { disconnect(current_playlist_->queue(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(UpdateButtonState())); disconnect(current_playlist_->queue(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(UpdateButtonState())); disconnect(current_playlist_->queue(), SIGNAL(layoutChanged()), this, SLOT(UpdateButtonState())); disconnect(current_playlist_, SIGNAL(destroyed()), this, SLOT(PlaylistDestroyed())); } current_playlist_ = playlist; connect(current_playlist_->queue(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(UpdateButtonState())); connect(current_playlist_->queue(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(UpdateButtonState())); connect(current_playlist_->queue(), SIGNAL(layoutChanged()), this, SLOT(UpdateButtonState())); connect(current_playlist_, SIGNAL(destroyed()), this, SLOT(PlaylistDestroyed())); ui_->list->setModel(current_playlist_->queue()); connect(ui_->list->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(UpdateButtonState())); }
// Called every frame, before the events and after drawing, for you to update your object if necessary // Return 1 (do not call again) or 0 (continue calling) BOOL ExtObject::OnFrame() { if(!remote.IsConnected()) return 0; /*if(remote.RefreshState() == NO_CHANGE) return 0;*/ remote.RefreshState(); CalculateIrXY(); //iterate through controls, set states vector<RunControl>::iterator i = controls.begin(); for(; i!= controls.end(); i++) { float state = pRuntime->GetControlState(i->control.c_str(), i->player); state = max(state, ButtonDown(i->button)); pRuntime->SetControlState(i->control.c_str(), 0, state); //debugLastAction = i->control; } for(int i = 0; i < BUTTONS; i++) UpdateButtonState(i); return 0; }
void OpNumberEdit::SetMinValue(double new_min) { if (m_min_value != new_min) { m_min_value = new_min; UpdateButtonState(); } }
void OpNumberEdit::SetMaxValue(double new_max) { if (m_max_value != new_max) { m_max_value = new_max; UpdateButtonState(); } }
void OpNumberEdit::SetWrapAround(BOOL wrap_around) { if (m_wrap_around != wrap_around) { m_wrap_around = wrap_around; UpdateButtonState(); } }
void CStudentDemoListDlg::OnLvnItemchangedAvailableList(NMHDR *pNMHDR, LRESULT *pResult) { //LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); UpdateButtonState(); *pResult = 0; }
void CStudentDemoListDlg::OnCbnSelchangeListType() { m_nSelectType = m_wndListType.GetCurSel(); InitAvailableList(m_nSelectType); UpdateButtonState(); CButton* pBtn = (CButton*)GetDlgItem(IDC_CHK_SELECT_ALL); pBtn->EnableWindow(m_nSelectType != DEMO_TO_ALL); pBtn->SetCheck(BST_UNCHECKED); }
void CStudentDemoListDlg::OnBnClickedChkSelectAll() { BOOL bRet = ((CButton*)GetDlgItem(IDC_CHK_SELECT_ALL))->GetCheck(); int nCount = m_wndAvailableList.GetItemCount(); for (int i=0; i < nCount; i++) { m_wndAvailableList.SetCheck(i, bRet); } UpdateButtonState(); }
void OpNumberEdit::OnChange(OpWidget *widget, BOOL changed_by_mouse /*= FALSE */) { OP_ASSERT(widget == m_edit); // if (widget == m_edit) { if (listener) { listener->OnChange(this); } UpdateButtonState(); } }
BOOL CStudentDemoListDlg::OnInitDialog() { CElcSkinDialog::OnInitDialog(); AdjustImagePanePos(IDC_IMAGE_PANE); BindButton(IDC_BTN_HELP); BindButton(ID_BTN_OK); BindButton(ID_BTN_CANCEL); BindPictureCtrl(IDC_STUDENT_DEMO_ICON, IDR_RT_STUDENT_DEMO); if (!GetParent()) { SetParent(m_pWndParent); SetOwner(m_pWndParent); } CString strText; strText.LoadString(IDS_DEMO_TO_ALL); m_wndListType.InsertString(0, strText); strText.LoadString(IDS_DEMO_TO_STUDENT); m_wndListType.InsertString(1, strText); strText.LoadString(IDS_DEMO_TO_GROUP); m_wndListType.InsertString(2, strText); m_wndListType.SetCurSel(0); m_wndAvailableList.EnableCheck(IDB_STATE_IMAGE_LIST16); m_wndAvailableList.EnableSelect(TRUE); m_nSelectType = DEMO_TO_ALL; GetDlgItem(IDC_CHK_SELECT_ALL)->EnableWindow(m_nSelectType != DEMO_TO_ALL); InitAvailableList(m_nSelectType); UpdateButtonState(); if (m_pTeacherFrame) { DWORD dwCallbackMask; dwCallbackMask = ITeacherFrame::ELC_MEMBER_CONNECTED | ITeacherFrame::ELC_MEMBER_DISCONNECTED | ITeacherFrame::ELC_MEMBER_NAMECHANGED | ITeacherFrame::ELC_EXIT; m_pTeacherFrame->RegisterCallback(dwCallbackMask, this, NULL); } if (m_pDemoMemberInfo) { GetWindowText(strText); strText += (CString)_T(" [") + m_pDemoMemberInfo->szDefaultName + (CString)_T("] "); SetWindowText(strText); } return TRUE; }
void RefSysWidgetThreePointsWithoutOriginStep1::OnReseivePose(const tPoseEuler& pose/* = */) { SystemDialogWidgetParent::OnReseivePose(pose); if (IsTeached()) { m_coorInfo->UpdatePoseEuler(pose); } else { m_coorInfo->AddCoorSysInfo({ static_cast<CoordinateSystemTeachInfo::Orientation>(m_btnGroup->checkedId()), std::make_shared<tPoseEuler>(pose) }); } UpdateButtonState(); }
void ToolSysWidgetFourPoints::OnReseivePose(const tPoseEuler& pose/* = */) { SystemDialogWidgetParent::OnReseivePose(pose); if (IsTeached()) { m_coorInfo->UpdatePoseEuler(pose); } else { m_coorInfo->AddPoseEuler(pose); } UpdateButtonState(); }
void OpNumberEdit::SetNumberValue(double value_number) { OpString value_str; uni_char* value_buf = value_str.Reserve(33); if (!value_buf) { // FIXME OOM! return; } OP_STATUS status = WebForms2Number::DoubleToString(value_number, value_buf); if (OpStatus::IsSuccess(status)) { m_edit->SetTextAndFireOnChange(value_str.CStr()); } UpdateButtonState(); }
void CViewComments::OnInitialUpdate() //----------------------------------- { if(m_nListId == 0) { m_nListId = IDC_LIST_SAMPLES; // For XM, set the instrument list as the default list CModDoc *pModDoc = GetDocument(); CSoundFile *pSndFile; if(pModDoc) { pSndFile= pModDoc->GetSoundFile(); if(pSndFile && (pSndFile->m_nType & MOD_TYPE_XM) && pSndFile->m_nInstruments > 0) { m_nListId = IDC_LIST_INSTRUMENTS; } } } CChildFrame *pFrame = (CChildFrame *)GetParentFrame(); CRect rect; if (pFrame) { COMMENTVIEWSTATE *pState = pFrame->GetCommentViewState(); if (pState->cbStruct == sizeof(COMMENTVIEWSTATE)) { m_nListId = pState->nId; } } GetClientRect(&rect); m_ToolBar.Create(WS_CHILD|WS_VISIBLE|CCS_NOPARENTALIGN, rect, this, IDC_TOOLBAR_DETAILS); m_ToolBar.Init(CMainFrame::GetMainFrame()->m_MiscIcons, CMainFrame::GetMainFrame()->m_MiscIconsDisabled); m_ItemList.Create(WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_SINGLESEL|LVS_EDITLABELS|LVS_NOSORTHEADER, rect, this, IDC_LIST_DETAILS); m_ItemList.ModifyStyleEx(0, WS_EX_STATICEDGE); // Add ToolBar Buttons m_ToolBar.AddButton(IDC_LIST_SAMPLES, IMAGE_SAMPLES); m_ToolBar.AddButton(IDC_LIST_INSTRUMENTS, IMAGE_INSTRUMENTS); //m_ToolBar.AddButton(IDC_LIST_PATTERNS, TIMAGE_TAB_PATTERNS); m_ToolBar.SetIndent(4); UpdateButtonState(); OnUpdate(NULL, HINT_MODTYPE, NULL); }
BOOL CTabOrderDlg::OnInitDialog() { CDialog::OnInitDialog(); if (m_pObjList != NULL) { int nIndex = 0; while (1) { BOOL bFind = FALSE; POSITION pos = m_pObjList->GetHeadPosition(); while (pos != NULL) { CDevObj* pObj = (CDevObj *)m_pObjList->GetNext(pos); if (pObj->IsKindOf(RUNTIME_CLASS(CCtrlObj))) { CCtrlObj* pCtrlObj = (CCtrlObj *)pObj; if (pCtrlObj->m_nTabIndex == nIndex) { m_listOrder.InsertString(nIndex, pCtrlObj->GetDisplayName()); ASSERT(nIndex != LB_ERR); m_listOrder.SetItemData(nIndex, (DWORD)pCtrlObj); bFind = TRUE; break; } } } if (!bFind) break; nIndex++; } } if (m_listOrder.GetCount()) m_listOrder.SetCurSel(0); UpdateButtonState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
OP_STATUS OpNumberEdit::SetText(const uni_char* text) { if (text && *text) { double val; uni_char* end_ptr = NULL; val = uni_strtod(text, &end_ptr); // Check for NaN and Infinity if (!end_ptr || *end_ptr || op_isinf(val) || op_isnan(val)) { return OpStatus::ERR; } } RETURN_IF_ERROR(m_edit->SetText(text)); UpdateButtonState(); return OpStatus::OK; }
void CTabOrderDlg::OnDown() { int nSel = m_listOrder.GetCurSel(); if (nSel != LB_ERR) { if (nSel < m_listOrder.GetCount() - 1) { CString strItem; m_listOrder.GetText(nSel, strItem); DWORD dwData = m_listOrder.GetItemData(nSel); m_listOrder.DeleteString(nSel); nSel++; int nIndex = m_listOrder.InsertString(nSel, strItem); ATLASSERT(nIndex == nSel); m_listOrder.SetItemData(nIndex, dwData); m_listOrder.SetCurSel(nIndex); } } UpdateButtonState(); }
void CTabOrderDlg::OnSelchangeList() { UpdateButtonState(); }
void main() { CYGlobalIntEnable; /* Enable global interrupts */ ADC_DelSig_1_Start();/* Configure and power up ADC */ LCD_Char_1_Start(); /* Initialize and clear the LCD */ /* Move the cursor to Row 0 Column 0 */ LCD_Char_1_Position(ROW_0,COLUMN_0); /* Print Label for the pot voltage raw count */ LCD_Char_1_PrintString("TEMP NOW: C"); LCD_Char_1_Position(ROW_1,COLUMN_0); LCD_Char_1_PrintString("TEMP SET: C"); ADC_DelSig_1_StartConvert(); /* Force ADC to initiate a conversion */ /* Start capsense and initialize baselines and enable scan */ CapSense_Start(); CapSense_InitializeAllBaselines(); CapSense_ScanEnabledWidgets(); /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */ //Start the pwm; PWM_1_Start(); for(;;) { /* If scanning is completed update the baseline count and check if sensor is active */ while(CapSense_IsBusy()); /* Update baseline for all the sensors */ CapSense_UpdateEnabledBaselines(); CapSense_ScanEnabledWidgets(); /* Test if button widget is active */ stateB_1 = CapSense_CheckIsWidgetActive(CapSense_BUTTON0__BTN); stateB_2 = CapSense_CheckIsWidgetActive(CapSense_BUTTON1__BTN); /* Wait for end of conversion */ ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT); /* Get converted result */ voltageRawCount = ADC_DelSig_1_GetResult16(); //Change voltageRawCount to Temperature; temp = voltageRawCount / 3.870 * 0.1017 + 0.5; cold = (9999 - (temp > temp_set ? temp - temp_set : 0) * 50); if(cold < 1000) cold = 1000; if(cold > 9999) cold = 9999; //Change the pwm; PWM_1_WriteCompare(cold); /* Set range limit */ if (temp > 0x7FFF) { temp = 0; } else { /* Continue on */ } if(show < 10) { show++; } else { show = 0; UpdateDisplay(temp, 0); /* Print result on LCD */ UpdateButtonState(stateB_1, stateB_2); } } }