void ShowHideVerticalExtrapolationDialogItems2(DialogPtr dialog) { Boolean extrapolateVertically, okToExtrapolate = false, showVelAtBottom = GetButton(dialog, M33VELOCITYATBOTTOMCHECKBOX); TMap *map = sGridCurrentDialogMover -> GetMoverMap(); if (map && map->IAm(TYPE_PTCURMAP)) { if ((dynamic_cast<PtCurMap *>(map))->GetMaxDepth2() > 0 || ((TimeGridVelRect*) (sGridCurrentDialogMover -> timeGrid))->GetMaxDepth() > 0) okToExtrapolate = true; } if (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || !okToExtrapolate) // if model has depth data assume that is what user wants to use { extrapolateVertically = false; ShowHideDialogItem(dialog, M33EXTRAPOLATEVERTCHECKBOX, extrapolateVertically); ShowHideDialogItem(dialog, M33EXTRAPOLATETOLABEL, extrapolateVertically); ShowHideDialogItem(dialog, M33EXTRAPOLATETOVALUE, extrapolateVertically); ShowHideDialogItem(dialog, M33EXTRAPOLATETOUNITSLABEL, extrapolateVertically); } else { extrapolateVertically = GetButton(dialog, M33EXTRAPOLATEVERTCHECKBOX); ShowHideDialogItem(dialog, M33EXTRAPOLATEVERTCHECKBOX, true); ShowHideDialogItem(dialog, M33EXTRAPOLATETOLABEL, extrapolateVertically); ShowHideDialogItem(dialog, M33EXTRAPOLATETOVALUE, extrapolateVertically); ShowHideDialogItem(dialog, M33EXTRAPOLATETOUNITSLABEL, extrapolateVertically); } ShowHideDialogItem(dialog, M33ARROWDEPTHAT, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate))); ShowHideDialogItem(dialog, M33ARROWDEPTH, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate)) && !showVelAtBottom); ShowHideDialogItem(dialog, M33ARROWDEPTHUNITS, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate)) && !showVelAtBottom); ShowHideDialogItem(dialog, M33VELOCITYATBOTTOMCHECKBOX, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate))); }
void EnableLatLongControls(DialogPtr dialog) { Boolean s = GetButton(dialog, D1SHOWLATLONG), c = GetButton(dialog, D1CUSTOM); MyEnableControl(dialog, D1DEG, s); MyEnableControl(dialog, D1DEGMIN, s); MyEnableControl(dialog, D1DEGMINSEC, s); MyEnableControl(dialog, D1ABOVE, s); MyEnableControl(dialog, D1BELOW, s); MyEnableControl(dialog, D1INTERMEDIATELINES, s && !c); MyEnableControl(dialog, D1CUSTOM, s); EnableTextItem(dialog, D1LONGLINE, s && c); EnableTextItem(dialog, D1LONGLABEL, s && c); EnableTextItem(dialog, D1LATLINE, s && c); EnableTextItem(dialog, D1LATLABEL, s && c); prefPopTable[0].bStatic = !(s && c); prefPopTable[1].bStatic = !(s && c); prefPopTable[2].bStatic = !(s && c); prefPopTable[3].bStatic = !(s && c); PopDraw(dialog, D1LONGLINEUNITSPOPUP); PopDraw(dialog, D1LONGLABELUNITSPOPUP); PopDraw(dialog, D1LATLINEUNITSPOPUP); PopDraw(dialog, D1LATLABELUNITSPOPUP); if (s && c) MySelectDialogItemText(dialog, D1LONGLINE, 0, 100); else MySelectDialogItemText(dialog, D1MACDUMMYTEXT, 0, 100); }
static portTASK_FUNCTION( vButtonTask, pvParameters ) { // portTickType xLastExecutionTime; portTickType xTimeToWait = 500 / portTICK_RATE_MS; // ms /* Just to stop compiler warnings. */ (void) pvParameters; /* Initialize the variable used by the call to vTaskDelayUntil(). */ // xLastExecutionTime = xTaskGetTickCount(); for (;;) { // /* This is a periodic task. Block until it is time to run again. // The task will execute every 200ms. */ // vTaskDelayUntil( &xLastExecutionTime, xTimeToWait ); // check if any button pressed if(GetButton()){ char button; // delay to detect if double button pressed vTaskDelay(50 / portTICK_RATE_MS); // get the button button = GetButton(); // register button in the buton Buffer xButtonSend(button); // delay between pressings vTaskDelay(xTimeToWait); }else{ // taskYIELD(); } } }
short ShioHtsClick(DialogPtr dialog, short itemNum, long lParam, VOIDPTR data) { switch (itemNum) { case SHIOHTSCANCEL: return SHIOHTSCANCEL; case SHIOHTSOK: sDialogStandingWave = GetButton (dialog, SHIOHTSSTANDINGWAVE); sDialogScaleFactor = EditText2Float(dialog, SHIOHTSSCALEFACTOR); return itemNum; case SHIOHTSSTANDINGWAVE: // ToggleButton(dialog, itemNum); // ToggleButton(dialog, SHIOHTSPROGRESSIVEWAVE); //CheckNumberTextItem(dialog, itemNum, FALSE); // break; case SHIOHTSPROGRESSIVEWAVE: SetButton(dialog, SHIOHTSSTANDINGWAVE, itemNum == SHIOHTSSTANDINGWAVE); SetButton(dialog, SHIOHTSPROGRESSIVEWAVE, itemNum == SHIOHTSPROGRESSIVEWAVE); //ToggleButton(dialog, itemNum); // ToggleButton(dialog, SHIOHTSSTANDINGWAVE); //CheckNumberTextItem(dialog, itemNum, FALSE); break; case SHIOHTSSCALEFACTOR: CheckNumberTextItem(dialog, itemNum, TRUE); break; } return 0; }
uint8_t SoftPot::GetTouchedButton(unsigned long max_button_wait_time) { int i = 0; int val, val_old = 0; // values read from SoftPot int curr_noise=0, noise=0; int count = 0; boolean filter_ready=false; uint8_t button = NO_BUTTON; unsigned long t_start, t_end, t_button_start; long stage_time, button_stage_time,frequency=SCAN_FREQUENCY_MS; t_button_start = millis(); memset(filter, 0, sizeof(filter)); do { t_start = millis(); val = analogRead(sp_pin); curr_noise = abs(val_old - val); val_old = val; noise = noise + curr_noise; noise = noise - filter[i]; filter[i] = curr_noise; i++; if (i == FS) { i = 0; filter_ready=true;}; if (noise < MAX_NOISE and val > MIN_VALUE_SP and filter_ready) { if (count == 1) { button = GetButton(val); delay(100); } count++; } else { count = 0; } // Serial.print(val);Serial.print("-");Serial.print(noise);Serial.print("-");Serial.println(millis()); t_end = millis(); stage_time = t_end - t_start; button_stage_time= t_end - t_button_start; if (stage_time<frequency) { delay((unsigned long)(frequency - stage_time)); } // stay in loop until wait time is over or button is pressed } while ((button == NO_BUTTON) && (button_stage_time < max_button_wait_time)); return button; }
//----------------------------------------------------------------------------- int CMRCToolBarCtrl::HitTestButtons(CPoint point) // returns index of button that lies at that point //----------------------------------------------------------------------------- { // Hit test all the buttons. It might be an idea to cache the rectangles for all the // items, but for now this loop doesn't seem too bad for (int i = GetButtonCount(); i >= 0; i--) { TBBUTTON tbButton; CRect rect; if (GetItemRect(i, &rect)) { if (rect.PtInRect(point)) { GetButton(i, &tbButton); if (tbButton.fsStyle == TBSTYLE_SEP) return -1; // inside a separator else return i; // inside a button } if (point.y > rect.bottom) // if point we're testing is below items in the // array, then stop (minor optimization) break; } } return -1; }
BOOL CUIMouseEvent::IsInverse(const CUIEvent &cOther) const { return (ClassName() == ((const CUIMouseEvent *)&cOther)->ClassName()) && (GetButton() == ((const CUIMouseEvent *)&cOther)->GetButton()) && (((GetType() == UIEVENT_MOUSEDOWN) && (cOther.GetType() == UIEVENT_MOUSEUP)) || ((GetType() == UIEVENT_MOUSEUP) && (cOther.GetType() == UIEVENT_MOUSEDOWN))); }
//**************************************************************************************** void CBCGPDropDownToolBar::OnLButtonUp(UINT nFlags, CPoint point) { CRect rectClient; GetClientRect (&rectClient); if (!m_bCustomizeMode && !rectClient.PtInRect (point)) { CFrameWnd* pParentFrame = GetParentFrame (); ASSERT_VALID (pParentFrame); pParentFrame->DestroyWindow (); return; } if (!m_bCustomizeMode && m_iHighlighted >= 0) { m_iButtonCapture = m_iHighlighted; CBCGPToolbarButton* pButton = GetButton (m_iHighlighted); ASSERT_VALID (pButton); pButton->m_nStyle &= ~TBBS_PRESSED; } CBCGPToolBar::OnLButtonUp (nFlags, point); }
void EclWindow::Keypress ( int keyCode, bool shift, bool ctrl, bool alt, unsigned char ascii) { EclButton *currentTextEdit = GetButton( m_currentTextEdit ); if( currentTextEdit ) { currentTextEdit->Keypress( keyCode, shift, ctrl, alt, ascii ); } }
/** * @brief Main thread function for Proxy166. * Runs forever, until MyTaskInitialized is false. * * @todo Update DS switch array */ int Proxy166::Main( int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10) { Robot166 *lHandle = NULL; #if LoggingProxy ProxyLog sl; #endif WaitForGoAhead(); lHandle = Robot166::getInstance(); #if LoggingProxy lHandle->RegisterLogger(&sl); #endif Timer debugTimer; debugTimer.Start(); ProxyJoystick old_sticks[NUMBER_OF_JOYSTICKS+1]; while(MyTaskInitialized) { if(lHandle->IsOperatorControl() && true == AreSettingJoysticks()) { for(int x = 0;x<NUMBER_OF_JOYSTICKS;x++) { old_sticks[x] = GetJoystick(x); } SetJoystick(1, driveStickRight); SetJoystick(2, driveStickLeft); SetJoystick(3, driveStickCopilot); if(tracker.size() > 0) { vector<int>::iterator it = tracker.begin(); while(it != tracker.end()) { int joy_id = *it; int button_id = *(it+1); bool old_button = old_sticks[joy_id].button[button_id]; bool new_button = GetButton(joy_id, button_id); if(old_button == 1 && new_button == 0) { // The button was previously pressed, but is now released (*(it+2))++; // Increase the counter } it += 3; } } if(debugTimer.HasPeriodPassed(1.0)) { // Debug info } } SetBattery(lHandle->GetBatteryVoltage()); #if LoggingProxy sl.PutOne(Battery, GetJoystick(1), GetJoystick(2), GetJoystick(3)); #endif // The task ends if it's not initialized WaitForNextLoop(); } return 0; }
int Client::Run() { bool quit = false; renderer.SetDrawColor(Math::Color::White); renderer.Clear(); while(!quit) { Error::Throw(); for(auto e : SDLW::Events::Poll()) { switch(e.GetType()) { case SDLW::Events::Base::Type::quit: { quit = true; break; } case SDLW::Events::Base::Type::mouse: { auto ev = e.GetMouse(); switch(ev.GetType()) { case SDLW::Events::Event::Mouse::Type::motion: { auto event = ev.GetMotion(); break; } case SDLW::Events::Event::Mouse::Type::button: { auto event = ev.GetButton(); break; } default: { break; } } break; } case SDLW::Events::Base::Type::window: { auto ev = e.GetWindow(); switch(ev.GetType()) { case SDLW::Events::Event::Window::Type::enter: { controll->EnterCursor(); break; } case SDLW::Events::Event::Window::Type::leave: { controll->LeaveCursor(); break; } default: break; } break; } default: { break; } } } controll->Rendering(renderer, Math::Rect(size)); renderer.Present(); frame++; SDLW::Delay(30); } return 0; }
/** * @brief Gets the cache value of the trigger (button 1) of a joystick. * @param joy_id Which joystick to retrieve the trigger status for. * @param reset Whether to reset the button's value after being called. * @return The last read current value */ bool Proxy166::GetTrigger(int joy_id, bool reset) { wpi_assert(joy_id < NUMBER_OF_JOYSTICKS && joy_id >= 0); bool bid = GetButton(joy_id,1); // reset the button so actions are triggered only once if (reset) { SetButton(joy_id, 1, 0); } return bid; }
NS_IMETHODIMP nsDOMMouseEvent::GetWhich(PRUint32* aWhich) { NS_ENSURE_ARG_POINTER(aWhich); PRUint16 button; (void) GetButton(&button); *aWhich = button + 1; return NS_OK; }
void CMuleToolbarCtrl::OnTbnReset(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/) { // First get rid of old buttons // while saving their states for (int i = GetButtonCount()-1; i >= 0; i--) { TBBUTTON Button; GetButton(i, &Button); for (int j = 0; j < m_buttoncount ; j++) { if (TBButtons[j].idCommand == Button.idCommand) { TBButtons[j].fsState = Button.fsState; TBButtons[j].fsStyle = Button.fsStyle; TBButtons[j].iString = Button.iString; } } DeleteButton(i); } TBBUTTON sepButton; sepButton.idCommand = 0; sepButton.fsStyle = TBSTYLE_SEP; sepButton.fsState = TBSTATE_ENABLED; sepButton.iString = -1; sepButton.iBitmap = -1; // set default configuration CString config = strDefaultToolbar; // MORPH START show less controls if (thePrefs.IsLessControls()) config=strDefaultLessControlsToolbar; // MORPH END show less controls for (int i = 0; i <config.GetLength(); i += 2) { int index = _tstoi(config.Mid(i, 2)); if (index == 99) { AddButtons(1, &sepButton); continue; } AddButtons(1, &TBButtons[index]); } // save new (default) configuration thePrefs.SetToolbarSettings(config); Localize(); // we have to localize the button-text theApp.emuledlg->ShowConnectionState(); ChangeTextLabelStyle(thePrefs.GetToolbarLabelSettings(), false, true); SetAllButtonsWidth(); // then calc and set the button width AutoSize(); }
void ButtonGroup::HighlightNewSelection(int newButton) { if(_selectedButton != -1) { // Turn off highlight for currently highlighted button GetButton(_selectedButton)->SetHighlighted(false); } _selectedButton = newButton; // If < 0 then up was pressed when first index was selected // If >= _buttons.size() then down was pressed when last index was selected if(_selectedButton < 0) { _selectedButton = _buttons.size() - 1; } else if(_selectedButton >= (int)_buttons.size()) { _selectedButton = 0; } // Highlight new selection GetButton(_selectedButton)->SetHighlighted(true); }
void ChangeWeatherDialog::InitChangeWeather(CUIXml& xmlDoc) { CUIXmlInit::InitWindow(xmlDoc, "change_weather", 0, this); CUIXmlInit::InitTextWnd(xmlDoc, "change_weather:header", 0, Header); CUIXmlInit::InitStatic(xmlDoc, "change_weather:background", 0, Background); CUIXmlInit::Init3tButton(xmlDoc, "change_weather:btn_cancel", 0, CancelButton); auto& gameWeathers = gMapListHelper.GetGameWeathers(); Initialize(gameWeathers.size()); weathers.resize(gameWeathers.size()); string256 path; for (u32 i = 0; i < weathers.size(); i++) { xr_sprintf(path, "change_weather:btn_%s", gameWeathers[i].Name.c_str()); CUIXmlInit::Init3tButton(xmlDoc, path, 0, GetButton(i).Button); xr_sprintf(path, "change_weather:txt_%s", gameWeathers[i].Name.c_str()); CUIXmlInit::InitTextWnd(xmlDoc, path, 0, GetButton(i).Text); weathers[i].Name = gameWeathers[i].Name; weathers[i].Time = gameWeathers[i].StartTime; } }
//********************************************************************************** void CToolPalette::CheckButtonID(UINT uCommandID) { int index = CommandToIndex (uCommandID); if (index >= 0) { CBCGPToolbarButton* pButton = GetButton (index); ASSERT_VALID (pButton); m_nCheckedIndex = index; Invalidate (); } }
void ChangeGameTypeDialog::InitChangeGameType(CUIXml& xmlDoc) { CUIXmlInit::InitWindow(xmlDoc, "change_gametype", 0, this); CUIXmlInit::InitTextWnd(xmlDoc, "change_gametype:header", 0, Header); CUIXmlInit::InitStatic(xmlDoc, "change_gametype:background", 0, Background); CUIXmlInit::Init3tButton(xmlDoc, "change_gametype:btn_cancel", 0, CancelButton); // XXX nitrocaster: get it from somewhere const int gameTypeCount = 4; Initialize(gameTypeCount); gameTypes.resize(gameTypeCount); string256 path; for (u32 i = 0; i < gameTypes.size(); i++) { xr_sprintf(path, "change_gametype:btn_%d", i+1); CUIXmlInit::Init3tButton(xmlDoc, path, 0, GetButton(i).Button); xr_sprintf(path, "change_gametype:txt_%d", i+1); CUIXmlInit::InitTextWnd(xmlDoc, path, 0, GetButton(i).Text); gameTypes[i] = xmlDoc.ReadAttrib(path, 0, "id"); } }
//**************************************************************************************** void CBCGPropSheetBar::EnsureVisible (int iButton) { ASSERT_VALID (this); CBCGToolbarButton* pButton = GetButton (iButton); ASSERT_VALID (pButton); CRect rectButton = pButton->Rect (); CRect rectWork; GetWorkArea (rectWork); if (rectButton.Height () >= rectWork.Height ()) { // Work area is too small, nothing to do return; } if (rectButton.top >= rectWork.top && rectButton.bottom <= rectWork.bottom) { // Already visible return; } if (rectButton.top < rectWork.top) { while (pButton->Rect ().top < rectWork.top) { int iScrollOffset = m_iScrollOffset; ScrollUp (); if (iScrollOffset == m_iScrollOffset) { break; } } } else { while (pButton->Rect ().bottom > rectWork.bottom) { int iScrollOffset = m_iScrollOffset; ScrollDown (); if (iScrollOffset == m_iScrollOffset) { break; } } } }
void RadioButtonSet::RemButton(int nIndex) { if (nIndex >= (int)m_vtrButtons.size() || nIndex < 0) return; removeChild(GetButton(nIndex)); m_vtrButtons.erase(m_vtrButtons.begin()+nIndex); Layout(); m_vtrPoints.resize(m_vtrPoints.size()-1); }
bool Input::GetMapped(s32 k) { assert(k < Input::Count && k >= 0); auto& map = mappings[k]; if (map.keyCode > 0 && GetKey(map.keyCode)) { return true; } if (map.mouseCode > 0 && GetButton(map.mouseCode)) { return true; } return false; }
logical OToolBox :: SetLabel (int32 indx0, QString qsText ) { logical term = NO; QAbstractButton *button = NULL; BEGINSEQ if(!(button=GetButton(indx0))) ERROR button->setText(qsText); RECOVER term = YES; ENDSEQ return(term); }
int _tmain(int argc, _TCHAR* argv[]) { printf("Open:\n"); printf("https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#remapping\n"); printf(" for an image with axis and button numbers.\n"); printf("Hit ENTER if a given button or axis does not exist on your gamepad.\n\n"); Context ctxt; ctxt.valid = false; if (!SUCCEEDED(DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, reinterpret_cast<void**>(&ctxt.d_interface), NULL))) { fprintf(stderr, "Could not create DirectInput interface."); return 1; } ctxt.d_interface->EnumDevices( DI8DEVCLASS_GAMECTRL, &EnumCallback, &ctxt, DIEDFL_ATTACHEDONLY); if (!ctxt.valid) { fprintf(stderr, "No DirectInput devices found!\n"); fprintf(stderr, "Press ENTER to exit.\n"); while (GetKeyState(VK_RETURN) >= 0) // Wait for enter to be pressed. Sleep(50); exit(1); } ctxt.device->Acquire(); for (int i = 0; i < 17; i++) { GetButton(&ctxt, i); WaitForNeutralGamepad(&ctxt); } for (int i = 0; i < 4; i++) { if (i < 2) { GetAxis(&ctxt, "left thumbstick", i); } else { GetAxis(&ctxt, "right thumbstick", i); } WaitForNeutralGamepad(&ctxt); } printf("Thanks! Please file a bug at http://crbug.com with your gamepad information.\n"); printf("Press SPACE to exit.\n"); while (GetKeyState(VK_SPACE) >= 0) // Wait for enter to be pressed. Sleep(50); }
void RadioButtonSet::RemButton(int nFrom, int nTo) { if (nTo < nFrom) return; if (nFrom >= (int)m_vtrButtons.size() || nFrom < 0) return; if (nTo >= (int)m_vtrButtons.size() || nTo < 0) return; for (int i=nFrom; i<=nTo; ++i) { removeChild(GetButton(i)); m_vtrButtons.erase(m_vtrButtons.begin()+i); } Layout(); m_vtrPoints.resize(m_vtrPoints.size()-(nTo-nFrom+1)); }
LRESULT CModControlBar::OnHelpHitTest(WPARAM, LPARAM lParam) //---------------------------------------------------------- { TBBUTTON tbbn; POINT point; point.x = (signed short)(LOWORD(lParam)); point.y = (signed short)(HIWORD(lParam)); int ndx = HitTest(&point); if ((ndx >= 0) && (GetButton(ndx, &tbbn))) { return HID_BASE_COMMAND + tbbn.idCommand; } return 0; }
void Get_Object(unsigned int X, unsigned int Y) { button_order = -1; image_order = -1; radio_button_order = -1; // Buttons for ( _object_count = 0 ; _object_count < CurrentScreen->ButtonsCount ; _object_count++ ) { local_button = GetButton(_object_count); if (local_button->Active == 1) { if (IsInsideObject(X, Y, local_button->Left, local_button->Top, local_button->Width, local_button->Height) == 1) { button_order = local_button->Order; exec_button = local_button; } } } // Images for ( _object_count = 0 ; _object_count < CurrentScreen->ImagesCount ; _object_count++ ) { local_image = GetImage(_object_count); if (local_image->Active == 1) { if (IsInsideObject(X, Y, local_image->Left, local_image->Top, local_image->Width, local_image->Height) == 1) { image_order = local_image->Order; exec_image = local_image; } } } // RadioButtons for ( _object_count = 0 ; _object_count < CurrentScreen->RadioButtonsCount ; _object_count++ ) { local_radio_button = GetRadioButton(_object_count); if (local_radio_button->Active == 1) { if (IsInsideObject(X, Y, local_radio_button->Left, local_radio_button->Top, local_radio_button->Width, local_radio_button->Height) == 1) { radio_button_order = local_radio_button->Order; exec_radio_button = local_radio_button; } } } _object_count = -1; if (button_order > _object_count) _object_count = button_order; if (image_order > _object_count ) _object_count = image_order; if (radio_button_order > _object_count ) _object_count = radio_button_order; }
HRESULT CMenuToolbarBase::MenuBarMouseDown(INT iIndex, BOOL isLButton) { TBBUTTON btn; GetButton(iIndex, &btn); if ((m_initFlags & SMINIT_VERTICAL) || m_popupBar || m_cancelingPopup) { m_cancelingPopup = FALSE; return S_OK; } return ProcessClick(btn.idCommand); }
HRESULT CMenuToolbarBase::MenuBarMouseUp(INT iIndex, BOOL isLButton) { TBBUTTON btn; m_cancelingPopup = FALSE; if (!(m_initFlags & SMINIT_VERTICAL)) return S_OK; GetButton(iIndex, &btn); if (isLButton) return ProcessClick(btn.idCommand); else return ProcessContextMenu(btn.idCommand); }
void CToolbarBottom::onBtnClickedResult(ToolbarButtonType btnType, ZOOM_SDK_NAMESPACE::SDKError ret, bool bOn) { CButtonUI* button = GetButton(btnType); if(NULL == button) return; buttonStatusType btnStatusType = Button_Enabled; if(ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS == ret) { if(bOn) btnStatusType = Button_UnMuted; else btnStatusType = Button_Muted; } UpdateButton(btnType, btnStatusType); }
LRESULT TaskbarWindowPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { nsRefPtr<TaskbarWindowPreview> kungFuDeathGrip(this); switch (nMsg) { case WM_COMMAND: { uint32_t id = LOWORD(wParam); uint32_t index = id; nsCOMPtr<nsITaskbarPreviewButton> button; nsresult rv = GetButton(index, getter_AddRefs(button)); if (NS_SUCCEEDED(rv)) mController->OnClick(button); } return 0; } return TaskbarPreview::WndProc(nMsg, wParam, lParam); }