void kGUIMovieControlObj::PressPlayPause(kGUIEvent *event) { switch(event->GetEvent()) { case EVENT_PRESSED: if(m_movie->GetPlaying()==false) { if(m_movie->GetDone()==true) m_movie->ReStart(); m_movie->SetPlayAudio(true); m_movie->SetPlaying(true); } else m_movie->SetPlaying(false); UpdateButton(); break; case EVENT_RIGHTCLICK: /* show 1 frame */ if(m_movie->GetPlaying()==false) { if(m_movie->LoadNextFrame()==false) m_movie->ReStart(); } UpdateButton(); break; } }
void SP_BT_PolClick() { //Polarity Swiching if (Hvpolartiyflag == Positive) // Pos -> Neg { // Set PWM Voltage to 0 PWM1_10bit(0); PWM2_10bit(0); // Wait 1 sec for voltage drop to 0 delay_ms(1000); // Turn Neg on, HVMRelay = 0; // Power Supply 2 Neg delay_ms(100); HVPSRelay = 1; delay_ms(100); //set to Voltset PWM1_10bit(Voltset*5+23); // Update HVFlag Hvpolartiyflag = Negtive; // Update Display UpdateButton(&SP_BT_Pol,"-"); } else //Neg to Pos { // Set PWM Voltage to 0 PWM1_10bit(0); PWM2_10bit(0); delay_ms(1000); HVMRelay = 1; // Pos Supply Off // Wait 1 sec for voltage drop to 0 delay_ms(100); // Turn Neg on, set to Voltset HVPSRelay = 0; delay_ms(100); PWM1_10bit(Voltset*5+23); PWM2_10bit(Voltset*5+23); // Update HVFlag Hvpolartiyflag = Positive; // Update Display UpdateButton(&SP_BT_Pol,"+"); } }
void CFormatTabDlg::OnSelchange() { UpdateButton(m_buttonClearAll, m_nCount > 0); // force these since if the edit control is empty and // an item in the box is clicked on, the edit control will // not be filled in first UpdateButton(m_buttonSet, TRUE); UpdateButton(m_buttonClear, TRUE); WORD wID = LOWORD(GetDefID()); if (wID != IDC_BUTTON_SET) SetDefID(IDC_BUTTON_SET); }
void CFormatTabDlg::UpdateButtons() { UpdateButton(m_buttonClearAll, m_nCount > 0); BOOL bHasText = (m_comboBox.GetWindowTextLength() > 0); UpdateButton(m_buttonSet, bHasText); UpdateButton(m_buttonClear, bHasText); WORD wID = LOWORD(GetDefID()); if (bHasText && wID != IDC_BUTTON_SET) SetDefID(IDC_BUTTON_SET); else if (!bHasText && wID != IDOK) SetDefID(IDOK); }
void CFlatToolbar::OnLButtonUp(UINT nFlags, CPoint point) { if (m_iButtonCapture < 0) { CControlBar::OnLButtonUp(nFlags, point); return; // not captured } AFX_TBBUTTON* pTBB = _GetButtonPtr(m_iButtonCapture); ASSERT(!(pTBB->nStyle & TBBS_SEPARATOR)); UINT nIDCmd = 0; UINT nNewStyle = (pTBB->nStyle & ~TBBS_PRESSED); if (GetCapture() == this) { // we did not lose the capture ReleaseCapture(); if (HitTest(point) == m_iButtonCapture) { // give button a chance to update UpdateButton(m_iButtonCapture); // then check for disabled state if (!(pTBB->nStyle & TBBS_DISABLED)) { // pressed, will send command notification nIDCmd = pTBB->nID; if (pTBB->nStyle & TBBS_CHECKBOX) { // auto check: three state => down if (nNewStyle & TBBS_INDETERMINATE) nNewStyle &= ~TBBS_INDETERMINATE; nNewStyle ^= TBBS_CHECKED; } } } } GetOwner()->SendMessage(WM_SETMESSAGESTRING, AFX_IDS_IDLEMESSAGE); int iButtonCapture = m_iButtonCapture; m_iButtonCapture = -1; if (nIDCmd != 0) GetOwner()->SendMessage(WM_COMMAND, nIDCmd); // send command SetButtonStyle(iButtonCapture, nNewStyle); UpdateButton(iButtonCapture); UpdateWindow(); // immediate feedback }
//============== // PRIVATE SLOTS //============== void LTaskManagerPlugin::UpdateButtons(){ if(updating){ timer->start(); return; } //check again in a moment //Make sure this only runs one at a time updating=true; //Get the current window list QList<WId> winlist = LX11::WindowList(); //qDebug() << "Update Buttons:" << winlist; //Now go through all the current buttons first for(int i=0; i<BUTTONS.length(); i++){ //Get the windows managed in this button QList<LWinInfo> WI = BUTTONS[i]->windows(); bool updated=false; for(int w=0; w<WI.length(); w++){ if( winlist.contains( WI[w].windowID() ) ){ //Still current window - update it later winlist.removeAll(WI[w].windowID()); //remove this window from the list since it is done }else{ //Window was closed - remove it if(WI.length()==1){ //Remove the entire button this->layout()->takeAt(i); //remove from the layout delete BUTTONS.takeAt(i); i--; updated = true; //prevent updating a removed button break; //break out of the button->window loop }else{ BUTTONS[i]->rmWindow(WI[w]); // one of the multiple windows for the button WI.removeAt(w); //remove this window from the list w--; } updated=true; //button already changed } } if(!updated){ QTimer::singleShot(1,BUTTONS[i], SLOT(UpdateButton()) ); //keep moving on } } //Now go through the remaining windows for(int i=0; i<winlist.length(); i++){ //New windows, create buttons for each (add grouping later) //Check for a button that this can just be added to QString ctxt = LX11::WindowClass(winlist[i]); bool found = false; for(int b=0; b<BUTTONS.length(); b++){ if(BUTTONS[b]->text().section("(",0,0).simplified() == ctxt){ found = true; BUTTONS[b]->addWindow(winlist[i]); break; } } if(!found){ //No group, create a new button LTaskButton *but = new LTaskButton(this); but->addWindow( LWinInfo(winlist[i]) ); this->layout()->addWidget(but); BUTTONS << but; } } updating=false; }
void SS_BT_PMClick() { // if (Patternflag == Started) { UpdateButton(&SP_BT_ST,"Stop"); } else { UpdateButton(&SP_BT_ST,"Start"); } Countervalue=0; DrawScreen(&PatternMode); SP_BT_Active(); sprintf(strtmp,"%6u",ZapNum); UpdateLabel(&SP_LB_Pulse,strtmp); }
//--------------------------------------------------------------------------- void __fastcall TMessageTimeout::DoTimer(TObject * /*Sender*/) { if (FTimeout <= MSecsPerSec) { assert(FButton != NULL); TForm * Dialog = dynamic_cast<TForm *>(FButton->Parent); assert(Dialog != NULL); Dialog->ModalResult = FButton->ModalResult; } else { unsigned int & Timeout = (FSuspended > 0) ? FSuspended : FTimeout; if (Timeout > Interval) { Timeout -= Interval; } else { Timeout = 0; } UpdateButton(); } }
void SM_BT_CTClick() { // Counter Button Start/Stop //Change Flag Counterflag = !Counterflag; //Update Text in Button GUI if (Counterflag == Started) { UpdateButton(&SM_BT_CT,"Stop"); } else { UpdateButton(&SM_BT_CT,"Start"); } }
void CFlatToolbar::OnLButtonDown(UINT nFlags, CPoint point) { if ((m_iButtonCapture = HitTest(point)) < 0) // nothing hit { CControlBar::OnLButtonDown(nFlags, point); return; } AFX_TBBUTTON* pTBB = _GetButtonPtr(m_iButtonCapture); ASSERT(!(pTBB->nStyle & TBBS_SEPARATOR)); // update the button before checking for disabled status UpdateButton(m_iButtonCapture); if (pTBB->nStyle & TBBS_DISABLED) { m_iButtonCapture = -1; return; // don't press it } // TONYCL: START: // Kill the UPSTATE style so that the button is drawn in the downstate pTBB->nStyle &= ~TBBS_UPSTATE; // TONYCL: END: pTBB->nStyle |= TBBS_PRESSED; InvalidateButton(m_iButtonCapture); UpdateWindow(); // immediate feedback SetCapture(); GetOwner()->SendMessage(WM_SETMESSAGESTRING, (WPARAM)pTBB->nID); }
void UpdateAllButtons() { int i; for(i = 0; i < MAXBUTTONS;i++) { if(ButtonList[i].inuse)UpdateButton(&ButtonList[i]); } }
void UpdateButtonsByLayer(int layer) { int i; for(i = 0; i < MAXBUTTONS;i++) { if((ButtonList[i].inuse)&&(ButtonList[i].layer == layer))UpdateButton(&ButtonList[i]); } }
void SS_BT_MMClick() { // Countervalue=0; UpdateButton(&SM_BT_CT,"Start"); DrawScreen(&ManualMode); CurrentMode = 0; }
static void Update() { UpdateCaption(); UpdateButton(_T("RegistrationButton"), plane.registration); UpdateButton(_T("CompetitionIDButton"), plane.competition_id); UpdateButton(_T("TypeButton"), plane.type); UpdateButton(_T("PolarButton"), plane.polar_name); LoadFormProperty(*dialog, _T("HandicapEdit"), plane.handicap); LoadFormProperty(*dialog, _T("WingAreaEdit"), plane.wing_area); LoadFormProperty(*dialog, _T("MaxBallastEdit"), plane.max_ballast); LoadFormProperty(*dialog, _T("DumpTimeEdit"), plane.dump_time); LoadFormProperty(*dialog, _T("MaxSpeedEdit"), ugHorizontalSpeed, plane.max_speed); }
void LTaskButton::rmWindow(LWinInfo win){ for(int i=0; i<WINLIST.length(); i++){ if(WINLIST[i].windowID() == win.windowID()){ WINLIST.removeAt(i); break; } } UpdateButton(); }
void LTaskManagerPlugin::UpdateButton(WId win){ for(int i=0; i<BUTTONS.length(); i++){ if(BUTTONS[i]->windows().contains(win)){ qDebug() << "Update Task Manager Button (single window ping)"; QTimer::singleShot(0,BUTTONS[i], SLOT(UpdateButton()) ); break; } } }
static void TypeClicked(gcc_unused WndButton &button) { if (!dlgTextEntryShowModal(*(SingleWindow *)dialog->get_root_owner(), plane.type.buffer(), plane.type.MAX_SIZE)) return; UpdateButton(_T("TypeButton"), plane.type); }
//--------------------------------------------------------------------------- __fastcall TMessageTimeout::TMessageTimeout(TComponent * AOwner, unsigned int Timeout, TButton * Button) : TTimer(AOwner), FOrigTimeout(Timeout), FTimeout(Timeout), FButton(Button) { OnTimer = DoTimer; Interval = MSecsPerSec; FOrigCaption = FButton->Caption; FSuspended = 0; UpdateButton(); }
void cJoystickSDL::Update() { if ( NULL != mJoystick ) { ClearStates(); for ( Int32 i = 0; i < mButtons; i++ ) { UpdateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) ); } } }
void CToolbarBottom::SetChatUIStatus(bool bOn) { m_bInChat = bOn; buttonStatusType btnStatusType = Button_Disabled; if(m_bInChat) btnStatusType = Button_Muted; else btnStatusType = Button_UnMuted; UpdateButton(Toolbar_Button_Chat, btnStatusType); }
static void CompetitionIDClicked(gcc_unused WndButton &button) { if (!dlgTextEntryShowModal(*(SingleWindow *)dialog->get_root_owner(), plane.competition_id.buffer(), plane.competition_id.MAX_SIZE)) return; UpdateButton(_T("CompetitionIDButton"), plane.competition_id); }
void CToolbarBottom::DoShareButtonClick() { if(m_pToolbarMgr) m_pToolbarMgr->ShowShareWindow(); buttonStatusType btnStatusType = Button_Disabled; if(m_bInShare) btnStatusType = Button_Muted; else btnStatusType = Button_UnMuted; UpdateButton(Toolbar_Button_Share, btnStatusType); }
static void RegistrationClicked(gcc_unused WndButton &button) { if (!dlgTextEntryShowModal(*(SingleWindow *)dialog->get_root_owner(), plane.registration.buffer(), plane.registration.MAX_SIZE)) return; UpdateCaption(); UpdateButton(_T("RegistrationButton"), plane.registration); }
void CToolbarBottom::DoChatButtonClick() { if(m_pToolbarMgr) m_pToolbarMgr->ShowChatWindow(); buttonStatusType btnStatusType = Button_Disabled; if(m_bInChat) btnStatusType = Button_Muted; else btnStatusType = Button_UnMuted; UpdateButton(Toolbar_Button_Chat, btnStatusType); }
void ManualControl::on_ONRB_clicked() { cpu::CpuMemory::Instance().DB33.Reset(); cpu::CpuMemory::Instance().DB35.Reset(); if ( ui->ONRB->isChecked() ) { mControlBits.SetONRA( false ); UpdateButton( ui->ONRA, mControlBits.ONRA ); //MX45.2 ВКЛ катушку А } mControlBits.SetONRB( ui->ONRB->isChecked() ); }
void CToolbarBottom::DoParticipantButtonClick() { if(m_pToolbarMgr) m_pToolbarMgr->ShowParticipantWindow(); buttonStatusType btnStatusType = Button_Disabled; if(m_bInParticipant) btnStatusType = Button_Muted; else btnStatusType = Button_UnMuted; UpdateButton(Toolbar_Button_Participant, btnStatusType); }
void SP_BT_DisMClick() { if (Dismodeflag==CD) { // Change to AD Mode Dismodeflag = AD; CharRelay = 1; DisCRelay = 1; UpdateButton(&SP_BT_DisM, "AD"); } else { // Change to CD Mode Dismodeflag = CD; CharRelay = 0; DisCRelay = 0; UpdateButton(&SP_BT_DisM, "CD"); } }
void SM_BY_HVOF() { if(HVOnflag==0) { // Set HV Flag On setvolt(Voltset); HVOnflag = 1; UpdateButton(&SM_BT_HVOF, "HV On"); } else { // Set HV Flag off setvolt(0); HVOnflag = 0; UpdateButton(&SM_BT_HVOF, "HV Off"); } }
LTaskManagerPlugin::LTaskManagerPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ timer = new QTimer(this); timer->setSingleShot(true); timer->setInterval(10); // 1/100 second connect(timer, SIGNAL(timeout()), this, SLOT(UpdateButtons()) ); usegroups = true; //backwards-compatible default value if(id.contains("-nogroups")){ usegroups = false; } connect(LSession::handle(), SIGNAL(WindowListEvent()), this, SLOT(checkWindows()) ); connect(LSession::handle(), SIGNAL(WindowListEvent(WId)), this, SLOT(UpdateButton(WId)) ); this->layout()->setContentsMargins(0,0,0,0); QTimer::singleShot(0,this, SLOT(UpdateButtons()) ); //perform an initial sync //QTimer::singleShot(100,this, SLOT(OrientationChange()) ); //perform an initial sync }
void CXTPSkinObjectFrame::UpdateButtons() { DWORD dwExStyle = GetExStyle(); DWORD dwStyle = GetStyle(); if (m_dwStyle == dwStyle && m_dwExStyle == dwExStyle) return; m_dwExStyle = dwExStyle; m_dwStyle = dwStyle; RemoveButtons(); if (HasCaption()) { BOOL bToolWindow = (dwExStyle & WS_EX_TOOLWINDOW) == WS_EX_TOOLWINDOW; BOOL bMaximized = (dwStyle & WS_MAXIMIZE) == WS_MAXIMIZE; BOOL bMinimized = (dwStyle & WS_MINIMIZE) == WS_MINIMIZE; BOOL bSysMenu = (dwStyle & WS_SYSMENU); BOOL bDialogFrame = (dwStyle & WS_DLGFRAME || dwExStyle & WS_EX_DLGMODALFRAME); BOOL bEnableClose = TRUE; BOOL bEnabledMaximize = ((dwStyle & WS_MAXIMIZEBOX) == WS_MAXIMIZEBOX); BOOL bEnabledMinimize = ((dwStyle & WS_MINIMIZEBOX) == WS_MINIMIZEBOX); BOOL bShowMinMaxButtons = !bToolWindow && bSysMenu && (bEnabledMaximize || bEnabledMinimize); if (bSysMenu && !bToolWindow && ((m_dwExStyle & WS_EX_MDICHILD) == 0)) { HMENU hMenu = ::GetSystemMenu(m_hWnd, FALSE); if (::GetMenuState(hMenu, SC_CLOSE, MF_BYCOMMAND) & (MF_DISABLED | MF_GRAYED)) bEnableClose = FALSE; } UpdateButton(SC_CLOSE, !bDialogFrame || bSysMenu, bEnableClose, HTCLOSE, bToolWindow? WP_SMALLCLOSEBUTTON: WP_CLOSEBUTTON); UpdateButton(SC_MAXIMIZE, !bMaximized && bShowMinMaxButtons, bEnabledMaximize, HTMAXBUTTON, WP_MAXBUTTON); if (bMinimized) { UpdateButton(SC_RESTORE, bShowMinMaxButtons, bEnabledMinimize, HTMINBUTTON, WP_RESTOREBUTTON); } else { UpdateButton(SC_RESTORE, bMaximized && bShowMinMaxButtons, bEnabledMaximize, HTMAXBUTTON, WP_RESTOREBUTTON); UpdateButton(SC_MINIMIZE, bShowMinMaxButtons, bEnabledMinimize, HTMINBUTTON, WP_MINBUTTON); } UpdateButton(SC_CONTEXTHELP, ((dwExStyle & WS_EX_CONTEXTHELP) == WS_EX_CONTEXTHELP) && !bToolWindow && bSysMenu, TRUE, HTHELP, WP_HELPBUTTON); } }