VOID FillHdwFilterDlg(HWND hwnd,DCB *pstComDCB)
  {
  char szReplaceChar[5];

  sprintf(szReplaceChar,"%02X",pstComDCB->ErrChar);
  WinSetDlgItemText(hwnd,HWR_ERRCHAR,szReplaceChar);

  sprintf(szReplaceChar,"%02X",pstComDCB->BrkChar);
  WinSetDlgItemText(hwnd,HWR_BRKCHAR,szReplaceChar);

  if (pstComDCB->Flags2 & F2_ENABLE_ERROR_REPL)
    CheckButton(hwnd,HWR_ENABERR,TRUE);
  else
    {
    ControlEnable(hwnd,HWR_ERRTTT,FALSE);
    ControlEnable(hwnd,HWR_ERRTT,FALSE);
    ControlEnable(hwnd,HWR_ERRT,FALSE);
    ControlEnable(hwnd,HWR_ERRCHAR,FALSE);
    }
  if (pstComDCB->Flags2 & F2_ENABLE_NULL_STRIP)
    CheckButton(hwnd,HWR_ENABNUL,TRUE);

  if (pstComDCB->Flags2 & F2_ENABLE_BREAK_REPL)
    CheckButton(hwnd,HWR_ENABBRK,TRUE);
  else
    {
    ControlEnable(hwnd,HWR_BRKTTT,FALSE);
    ControlEnable(hwnd,HWR_BRKTT,FALSE);
    ControlEnable(hwnd,HWR_BRKT,FALSE);
    ControlEnable(hwnd,HWR_BRKCHAR,FALSE);
    }
  }
BOOL TCHdwProtocolDlg(HWND hwnd,USHORT idButton)
  {
  switch(idButton)
    {
    case HWP_5BITS:
//      CheckButton(hwnd,idButton,~Checked(hwnd,idButton));
      ControlEnable(hwnd,HWP_15BITS,TRUE);
      ControlEnable(hwnd,HWP_2BITS,FALSE);
      if (Checked(hwnd,HWP_2BITS))
        {
        CheckButton(hwnd,HWP_2BITS,FALSE);
        CheckButton(hwnd,HWP_15BITS,TRUE);
        }
      break;
    case HWP_8BITS:
    case HWP_7BITS:
    case HWP_6BITS:
//      CheckButton(hwnd,idButton,~Checked(hwnd,idButton));
      ControlEnable(hwnd,HWP_15BITS,FALSE);
      ControlEnable(hwnd,HWP_2BITS,TRUE);
      if (Checked(hwnd,HWP_15BITS))
        {
        CheckButton(hwnd,HWP_15BITS,FALSE);
        CheckButton(hwnd,HWP_2BITS,TRUE);
        }
    default:
      return(FALSE);
    }
   return(TRUE);
  }
void FillHdwTimeoutDlg(HWND hwnd,DCB *pstComDCB)
  {
  char szTimeout[8];

  sprintf(szTimeout,"%u",pstComDCB->ReadTimeout);
  WinSetDlgItemText(hwnd,HWT_RTIME,szTimeout);
  WinSendDlgItemMsg(hwnd,HWT_RTIME,EM_SETTEXTLIMIT,MPFROMSHORT(5),(MPARAM)NULL);

  sprintf(szTimeout,"%u",pstComDCB->WrtTimeout);
  WinSendDlgItemMsg(hwnd,HWT_WTIME,EM_SETTEXTLIMIT,MPFROMSHORT(5),(MPARAM)NULL);
  WinSetDlgItemText(hwnd,HWT_WTIME,szTimeout);

  if (pstComDCB->Flags3 & F3_INFINITE_WRT_TIMEOUT)
    {
    ControlEnable(hwnd,HWT_WTIMET,FALSE);
    ControlEnable(hwnd,HWT_WTIME,FALSE);
    CheckButton(hwnd,HWT_WINF,TRUE);
    }
  else
    CheckButton(hwnd,HWT_WNORM,TRUE);

  if ((pstComDCB->Flags3 & F3_RTO_MASK) == F3_WAIT_NONE) // first mask significant bits
    {
    ControlEnable(hwnd,HWT_RTIMET,FALSE);
    ControlEnable(hwnd,HWT_RTIME,FALSE);
    CheckButton(hwnd,HWT_RNOWAIT,TRUE);
    }
  else
    {
    if ((pstComDCB->Flags3  & F3_RTO_MASK) == F3_WAIT_SOMETHING)
      CheckButton(hwnd,HWT_RWAITSOME,TRUE);
    else
      CheckButton(hwnd,HWT_RNORM,TRUE);
    }
  }
Exemple #4
0
void QtButton::keyPressEvent(QKeyEvent *e)
{
	_QtEdit = QtEdit::getInstance();
	size = _QtEdit->sliderButton.count();
	if (Qt::Key_A== e->key())
	{
		//emit leftButtonClicked();
		CheckButton(1);
	}
	else if (Qt::Key_D == e->key())
	{
		//emit rightButtonClicked();
		CheckButton(2);
	}
	else if (Qt::Key_Control == e->key())
	{
		_QtEdit->Ctrl_Is_On = true;
	}
	else if (Qt::Key_Shift == e->key())
	{
		_QtEdit->Shift_is_ON = true;
	}
	else if (Qt::Key_S == e->key())
	{
		if (_QtEdit->Ctrl_Is_On)
		{
			_QtEdit->saveAllData();
		}
	}
	else if (Qt::Key_Space == e->key())
	{
		_QtEdit->Space_is_ON = true;
	}

}
Exemple #5
0
void  WardShaderDlg::LoadDialog(BOOL draw) 
{
	if (pShader && hRollup) {
		dlevSpin->SetValue(FracToPc(pShader->GetDiffuseLevel()),FALSE);
		dlevSpin->SetKeyBrackets(KeyAtCurTime(PB_DIFFUSE_LEV));

		slevSpin->SetValue(FracToPc(pShader->GetSpecularLevel()/SPEC_MAX),FALSE);
		slevSpin->SetKeyBrackets(KeyAtCurTime(PB_SPECULAR_LEV));

		glxSpin->SetValue( 100.0f * ((ALPHA_MAX - pShader->GetGlossiness())/ALPHA_SZ),FALSE);
		glxSpin->SetKeyBrackets(KeyAtCurTime(PB_GLOSSINESS_X));
		glySpin->SetValue(100.0f * ((ALPHA_MAX - pShader->GetGlossinessY())/ALPHA_SZ),FALSE);
		glySpin->SetKeyBrackets(KeyAtCurTime(PB_GLOSSINESS_Y));

		trSpin->SetValue(FracToPc(pMtl->GetOpacity( curTime )),FALSE);
		trSpin->SetKeyBrackets(pMtl->KeyAtTime(OPACITY_PARAM, curTime));

		CheckButton(hRollup, IDC_LOCK_AD, pShader->GetLockAD() );
		CheckButton(hRollup, IDC_LOCK_DS, pShader->GetLockDS() );
		SetCheckBox(hRollup, IDC_NORMALIZE_CHECK, !pShader->GetNormalizeOn() ); 
	 	UpdateLockADTex( FALSE ); //don't send to mtl

		UpdateColSwatches();
		UpdateHilite();
	}
}
void CMuleToolbarCtrl::PressMuleButton(int nID)
{
	// Customization might splits up the button-group, so we have to (un-)press them on our own
	if (m_iLastPressedButton != -1)
		CheckButton(m_iLastPressedButton, FALSE);
	CheckButton(nID, TRUE);
	m_iLastPressedButton = nID;
}
VOID FillHdwProtocolDlg(HWND hwnd,LINECHAR *pstLineChar)
  {
  WORD idDisableField;
  WORD idEntryField;

  idDisableField = HWP_15BITS;
  switch (pstLineChar->DataBits)
    {
    case 8:
      idEntryField = HWP_8BITS;
      break;
    case 7:
      idEntryField = HWP_7BITS;
      break;
    case 6:
      idEntryField = HWP_6BITS;
      break;
    case 5:
      idEntryField = HWP_5BITS;
      idDisableField = HWP_2BITS;
      break;
    }
  CheckButton(hwnd,idEntryField,TRUE);
  ControlEnable(hwnd,idDisableField,FALSE);
  switch (pstLineChar->StopBits)
    {
    case 0:
      idEntryField = HWP_1BIT;
      break;
    case 1:
      idEntryField = HWP_15BITS;
      break;
    case 2:
      idEntryField = HWP_2BITS;
      break;
    }
  CheckButton(hwnd,idEntryField,TRUE);
  switch (pstLineChar->Parity)
    {
    case 0:
      idEntryField = HWP_NONE;
      break;
    case 1:
      idEntryField = HWP_ODD;
      break;
    case 2:
      idEntryField = HWP_EVEN;
      break;
    case 3:
      idEntryField = HWP_ZERO;
      break;
    case 4:
      idEntryField = HWP_ONE;
      break;
    }
  CheckButton(hwnd,idEntryField,TRUE);
  }
Exemple #8
0
void VDVideoFilterInterlaceDialog::OnDataExchange(bool write) {
	if (write) {
		mConfig.mbLaceFields = IsButtonChecked(IDC_SOURCE_ALTERNATING);
		mConfig.mbOddFieldFirst = IsButtonChecked(IDC_FIELDORDER_ODDFIRST);
	} else {
		CheckButton(mConfig.mbLaceFields ? IDC_SOURCE_ALTERNATING : IDC_SOURCE_PROGRESSIVE, true);
		CheckButton(mConfig.mbOddFieldFirst ? IDC_FIELDORDER_ODDFIRST : IDC_FIELDORDER_EVENFIRST, true);
	}
}
void VDVideoFilterGammaCorrectDialog::OnDataExchange(bool write) {
	if (write) {
		mConfig.mbConvertToLinear = IsButtonChecked(IDC_SRGBTOLINEAR);
	} else {
		if (mConfig.mbConvertToLinear)
			CheckButton(IDC_SRGBTOLINEAR, true);
		else
			CheckButton(IDC_LINEARTOSRGB, true);
	}
}
Exemple #10
0
MRESULT EXPENTRY fnwpCOMeventStatesDlg(HWND hwnd,USHORT msg,
                                         MPARAM mp1,MPARAM mp2)
  {
  WORD *pwEvent;
  WORD wEvent;

  switch (msg)
    {
    case WM_INITDLG:
//      CenterDlgBox(hwnd);
      WinSetFocus(HWND_DESKTOP,hwnd);
      pwEvent = PVOIDFROMMP(mp2);
      if (*pwEvent & 0x0001)
        CheckButton(hwnd,CEV_BIT0,TRUE);
      if (*pwEvent & 0x0002)
        CheckButton(hwnd,CEV_BIT1,TRUE);
      if (*pwEvent & 0x0004)
        CheckButton(hwnd,CEV_BIT2,TRUE);
      if (*pwEvent & 0x0008)
        CheckButton(hwnd,CEV_BIT3,TRUE);
      if (*pwEvent & 0x0010)
        CheckButton(hwnd,CEV_BIT4,TRUE);
      if (*pwEvent & 0x0020)
        CheckButton(hwnd,CEV_BIT5,TRUE);
      if (*pwEvent & 0x0040)
        CheckButton(hwnd,CEV_BIT6,TRUE);
      if (*pwEvent & 0x0080)
        CheckButton(hwnd,CEV_BIT7,TRUE);
      if (*pwEvent & 0x0100)
        CheckButton(hwnd,CEV_BIT8,TRUE);
      break;
//    case WM_BUTTON1DOWN:
//      WinDismissDlg(hwnd,TRUE);
//      return(FALSE);
    case WM_COMMAND:
      switch(SHORT1FROMMP(mp1))
        {
        case DID_HELP:
          DisplayHelpPanel(HLPP_COM_EVENT_BITS);
          return((MRESULT)FALSE);
        case DID_CLEAR:
          if (GetCOMevent(&stIOctl,hCom,&wEvent) != NO_ERROR)
            {
            WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
            WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
            }
        case DID_OK:
        case DID_CANCEL:
          break;
        default:
          return WinDefDlgProc(hwnd,msg,mp1,mp2);
        }
      WinDismissDlg(hwnd,TRUE);
      return((MRESULT)TRUE);
    default:
      return(WinDefDlgProc(hwnd,msg,mp1,mp2));
    }
  return FALSE;
  }
BOOL CFifa2AutoLauncher::Run()
{
	StartLauncherWindow();

	if (NULL == m_hMainWindow) {
		return FALSE;
	}

	if (DISCONNECT == m_state) {
		ClickButton(m_hMainWindow, m_iFailedOkButtonID);
		return FALSE;
	}

	if (FALSE == CheckButton(m_iAcceptCheckboxID)) {
		return FALSE;
	}

	if (FALSE == CheckButton(m_iZone1RadioButtonID)) {
		return FALSE;
	}

	HWND hStartButton = ::GetDlgItem(m_hMainWindow, m_iStartButtonID);
	if (NULL == hStartButton) {
		return FALSE;
	}

	HANDLE hThread = ::CreateThread(NULL, 0, MonitorThreadFunction, this, 0, NULL);

	if (NULL == hThread) {
		return FALSE;
	}

	while (hStartButton != NULL) {
	
		if (FALSE == ClickButton(m_iStartButtonID)) {
			return FALSE;
		}

		hStartButton = ::GetDlgItem(m_hMainWindow, m_iStartButtonID);
	}

	if (FALSE == WaitForComplete()) {
		return FALSE;
	}

	::WaitForSingleObject(hThread, INFINITE);
	::CloseHandle(hThread);

	if (TRUE == m_bIsFailed)
	{
		return FALSE;
	}
	return TRUE;
}
Exemple #12
0
__interrupt void Timer_A3(void){
  switch( TAIV ){
    case 2: 
      UpdateMsec();
      TACCR1=TAR+TACCR_1;
      break;
    case 4:
      CheckButton(&ButtonLeft);
      CheckButton(&ButtonRight);
      CheckButton(&ButtonEnter);
      TACCR2=TAR+TACCR_2;
      break;
  }
}
Exemple #13
0
void  OrenNayarShaderDlg::LoadDialog(BOOL draw) 
{
	if (pShader && hRollup) {
		shSpin->SetValue(FracToPc(pShader->GetGlossiness()),FALSE);
		shSpin->SetKeyBrackets(KeyAtCurTime(onb_glossiness));

		ssSpin->SetValue(FracToPc(pShader->GetSpecularLevel()),FALSE);
		ssSpin->SetKeyBrackets(KeyAtCurTime(onb_specular_level));

		softSpin->SetValue(pShader->GetSoftenLevel(),FALSE);
		softSpin->SetKeyBrackets(KeyAtCurTime(onb_soften));

		trSpin->SetValue(FracToPc(pMtl->GetOpacity( curTime )),FALSE);
		trSpin->SetKeyBrackets(pMtl->KeyAtTime(OPACITY_PARAM, curTime));

		dlevSpin->SetValue(FracToPc(pShader->GetDiffuseLevel()),FALSE);
		dlevSpin->SetKeyBrackets(KeyAtCurTime(onb_diffuse_level));

		roughSpin->SetValue(FracToPc(pShader->GetDiffuseRoughness()),FALSE);
		roughSpin->SetKeyBrackets(KeyAtCurTime(onb_roughness));

		CheckButton(hRollup, IDC_LOCK_AD, pShader->GetLockAD() );
		CheckButton(hRollup, IDC_LOCK_DS, pShader->GetLockDS() );
	 	UpdateLockADTex( FALSE ); //don't send to mtl

		BOOL colorSelfIllum = pShader->IsSelfIllumClrOn();
		SetCheckBox(hRollup,IDC_SI_COLORON, colorSelfIllum ); 
		if( colorSelfIllum ) {
//			ShowWindow( siSpin->GetHwnd(), SW_HIDE );
			ShowWindow( GetDlgItem(hRollup, IDC_SI_EDIT), SW_HIDE );
			ShowWindow( GetDlgItem(hRollup, IDC_SI_SPIN), SW_HIDE );

			ShowWindow( cs[N_SI_CLR]->GetHwnd(), SW_SHOW );
		} else {
			// disable the color swatch
			ShowWindow( cs[N_SI_CLR]->GetHwnd(), SW_HIDE );
			// show self-illum slider
//			ShowWindow( siSpin->GetHwnd(), SW_SHOW );
			ShowWindow( GetDlgItem(hRollup, IDC_SI_EDIT), SW_SHOW );
			ShowWindow( GetDlgItem(hRollup, IDC_SI_SPIN), SW_SHOW );

			siSpin->SetValue(FracToPc(pShader->GetSelfIllum()), FALSE);
			siSpin->SetKeyBrackets(KeyAtCurTime(onb_self_illum_amnt));
		}

		UpdateColSwatches();
		UpdateHilite();
	}
}
Exemple #14
0
static portTASK_FUNCTION(MainTask, pvParameters) {
  (void)pvParameters; /* not used */
#if PL_HAS_TSS
  Configure(); /* initialize TSS library */
#endif
  for(;;) {
#if PL_HAS_TSS
    TSS_Task(); /* call TSS library to process touches */
#else
    CheckButton();
#endif
#if PL_APP_FOLLOW_OBSTACLE
    FollowObstacle();
#endif
#if PL_HAS_LED_BLUE
    LEDB_Neg();
#endif
#if PL_HAS_RADIO
    (void)RADIO_Handle();
#endif
#if PL_HAS_EVENTS
    EVNT_HandleEvent(RADIO_AppHandleEvent);
#endif
    StateMachine(FALSE);
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  }
}
Exemple #15
0
/*-----------------------------------------------------------------------------
*  main
*/
int main(void) {

   uint8_t ret;
   int   sioHdl;

   /* set clock prescaler to 2 (set clock to 7.3928 MHz) */
   CLKPR = 1 << CLKPCE;
   CLKPR = 1;

   /* get module address from EEPROM */
   sMyAddr = eeprom_read_byte((const uint8_t *)MODUL_ADDRESS);
   GetClientListFromEeprom();
    
   PortInit();
   TimerInit();
   ButtonInit();
   PwmInit();
   ApplicationInit();

   SioInit();
   SioRandSeed(sMyAddr);

   /* sio for bus interface */
   sioHdl = SioOpen("USART1", eSioBaud9600, eSioDataBits8, eSioParityNo,
                    eSioStopBits1, eSioModeHalfDuplex);

   SioSetIdleFunc(sioHdl, IdleSio1);
   SioSetTransceiverPowerDownFunc(sioHdl, BusTransceiverPowerDown);
   BusTransceiverPowerDown(true);

   BusInit(sioHdl);
   spBusMsg = BusMsgBufGet();

   /* warten for full operation voltage */
   while (!POWER_GOOD);

   /* enable ints before RestorePwm() */
   ENABLE_INT;
   TimerStart();
   RestorePwm();

   /* ext int for power fail: INT0 low level sensitive */
   EICRA &= ~((1 << ISC01) | (1 << ISC00));
   EIMSK |= (1 << INT0);

   ApplicationStart();
   
   /* Hauptschleife */
   while (1) {
      Idle();
      ret = BusCheck();
      ProcessBus(ret);
      CheckButton();
      PwmCheck();
      ApplicationCheck();
      CheckEvent();
   }
   return 0;
}
BOOL CLauncher::CheckButton( int iButtonID, WORD wState)
{
	if (FALSE == CheckButton(m_hMainWindow, iButtonID, wState)) {
		return FALSE;
	}

	return TRUE;
}
Exemple #17
0
bool CPasswordDialog::OnInit()
{
  #ifdef LANG
  LangSetWindowText(HWND(*this), 0x02000B00);
  LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
  #endif
  _passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD));
  CheckButton(IDC_CHECK_PASSWORD_SHOW, ShowPassword);
  SetTextSpec();
  return CModalDialog::OnInit();
}
bool CPasswordDialog::OnInit()
{
  #ifdef LANG
  LangSetWindowText(*this, IDD_PASSWORD);
  LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
  #endif
  _passwordEdit.Attach(GetItem(IDE_PASSWORD_PASSWORD));
  CheckButton(IDX_PASSWORD_SHOW, ShowPassword);
  SetTextSpec();
  return CModalDialog::OnInit();
}
Exemple #19
0
void OrenNayarShaderDlg::SetLockDS(BOOL lock) 
{
	if (lock) {
		if (IDYES!=MessageBox(hwmEdit, GetString(IDS_KE_LOCKDS),GetString(IDS_DS_LOCKCOL), MB_YESNO)) {
			CheckButton(hRollup, IDC_LOCK_DS, FALSE);	
			return;	
		}
		pShader->SetSpecularClr( pShader->GetDiffuseClr(), 0 );
		UpdateColSwatches();
	}
	pShader->SetLockDS( lock );
}
Exemple #20
0
void WardShaderDlg::UpdateLockADTex( BOOL passOn) {
	int lock = 	pShader->GetLockADTex();
	CheckButton(hRollup, IDC_LOCK_ADTEX, lock);

	ShowWindow(GetDlgItem(hRollup, IDC_MAPON_AM), !lock);
	texMBut[ 0 ]->Enable(!lock);

	if ( passOn ) 
		pMtl->SyncADTexLock( lock );
	
//	UpdateMtlDisplay();
}
Exemple #21
0
BYTE GetButtonsEvents(void)
{	
	BYTE Event = 0;
	
	Event = CheckButton(UP_BUTTON_IDX);
	if (Event != EVENT_NOTHING) 
		return(Event);
	
	Event = CheckButton(DN_BUTTON_IDX);
	if (Event != EVENT_NOTHING) 
		return(Event);

	Event = CheckButton(LEFT_BUTTON_IDX);
	if (Event != EVENT_NOTHING) 
		return(Event);

	Event = CheckButton(RIGHT_BUTTON_IDX);
	if (Event != EVENT_NOTHING) 
		return(Event);

	Event = CheckButton(OK_BUTTON_IDX);
	if (Event != EVENT_NOTHING) 
		return(Event);

    Event = CheckButton(MENU_BUTTON_IDX);
	if (Event != EVENT_NOTHING) 
		return(Event);

	return(EVENT_NOTHING);
}
BOOL CAuditionAutoLauncher::Run()
{

	HWND hMainWnd = StartLauncherWindow(L"GOPLAY", L"goPlay");
	if (NULL == hMainWnd) {
		return FALSE;
	}
	
	if (FALSE == SelectAudition()) {
		return FALSE;
	}

	HWND hPanel = ::GetDlgItem(hMainWnd, m_iPanelID);
	if (NULL == hPanel) {
		return FALSE;
	}

	if (FALSE == CheckButton(hPanel, m_iHCMButtonID)) {
		return FALSE;
	}

	if (FALSE == CheckButton(hPanel, m_iHNButtonID, BST_UNCHECKED)) {
		return FALSE;
	}

	HANDLE hThread = ::CreateThread(NULL, 0, CAuditionAutoLauncher::MonitorThreadFunction, this, 0, NULL);

	if (NULL == hThread) {
		return FALSE;
	}

	if (FALSE == ClickButton(hPanel, m_iGoButtonID)) {
		return FALSE;
	}
	
	::WaitForSingleObject(hThread, INFINITE);
	::CloseHandle(hThread);

	return TRUE;
}
Exemple #23
0
MRESULT EXPENTRY fnwpCOMstatusStatesDlg(HWND hwnd,USHORT msg,
                                         MPARAM mp1,MPARAM mp2)
  {
  WORD *pwEvent;

  switch (msg)
    {
    case WM_INITDLG:
//      CenterDlgBox(hwnd);
      WinSetFocus(HWND_DESKTOP,hwnd);
      pwEvent = PVOIDFROMMP(mp2);
      if (*pwEvent & 0x0001)
        CheckButton(hwnd,CST_BIT0,TRUE);
      if (*pwEvent & 0x0002)
        CheckButton(hwnd,CST_BIT1,TRUE);
      if (*pwEvent & 0x0004)
        CheckButton(hwnd,CST_BIT2,TRUE);
      if (*pwEvent & 0x0008)
        CheckButton(hwnd,CST_BIT3,TRUE);
      if (*pwEvent & 0x0010)
        CheckButton(hwnd,CST_BIT4,TRUE);
      if (*pwEvent & 0x0020)
        CheckButton(hwnd,CST_BIT5,TRUE);
      if (*pwEvent & 0x0040)
        CheckButton(hwnd,CST_BIT6,TRUE);
      if (*pwEvent & 0x0080)
        CheckButton(hwnd,CST_BIT7,TRUE);
      break;
//    case WM_BUTTON1DOWN:
//      WinDismissDlg(hwnd,TRUE);
//      return(FALSE);
    case WM_COMMAND:
      switch(SHORT1FROMMP(mp1))
        {
        case DID_HELP:
          DisplayHelpPanel(HLPP_COM_STATUS_BITS);
          return((MRESULT)FALSE);
        case DID_OK:
        case DID_CANCEL:
          break;
        default:
          return WinDefDlgProc(hwnd,msg,mp1,mp2);
        }
      WinDismissDlg(hwnd,TRUE);
      return((MRESULT)TRUE);
    default:
      return(WinDefDlgProc(hwnd,msg,mp1,mp2));
    }
  return FALSE;
  }
Exemple #24
0
void OrenNayarShaderDlg::SetLockAD(BOOL lock)
{
	if (lock) {
		if (IDYES!=MessageBox(hwmEdit, GetString(IDS_DS_LOCKAD), GetString(IDS_DS_LOCKCOL), MB_YESNO)) {
			CheckButton(hRollup, IDC_LOCK_AD, FALSE);	
			return;	
		}
		// set ambient color to diffuse
		pShader->SetAmbientClr( pShader->GetDiffuseClr(), 0 );
		UpdateColSwatches();
	}
	pShader->SetLockAD(lock);
}
Exemple #25
0
MRESULT EXPENTRY fnwpConfigCommDlg(HWND hwnd,USHORT msg,MPARAM mp1,MPARAM mp2)
  {
  static COMADDR *pstAddr;

  switch (msg)
    {
    case WM_INITDLG:
      pstAddr = (COMADDR *)mp2;
      WinSendDlgItemMsg(hwnd,CFG_ADDRESS,EM_SETTEXTLIMIT,MPFROMSHORT(40),(MPARAM)NULL);
      WinSetDlgItemText(hwnd,CFG_ADDRESS,pstAddr->szAddressee);
      if (pstAddr->fAddrType == BY_ADDR)
        CheckButton(hwnd,CFG_IS_ADDRESS,TRUE);
      else
        CheckButton(hwnd,CFG_IS_HOST_NAME,TRUE);
      break;
    case WM_COMMAND:
      switch(SHORT1FROMMP(mp1))
        {
        case DID_OK:
          WinQueryDlgItemText(hwnd,CFG_ADDRESS,40,pstAddr->szAddressee);
          if (Checked(hwnd,CFG_IS_ADDRESS))
            pstAddr->fAddrType = BY_ADDR;
          else
            pstAddr->fAddrType = BY_HOST;
          WinDismissDlg(hwnd,TRUE);
          break;
        case DID_CANCEL:
          WinDismissDlg(hwnd,FALSE);
          break;
        default:
          return(WinDefDlgProc(hwnd,msg,mp1,mp2));
        }
      break;
    default:
      return(WinDefDlgProc(hwnd,msg,mp1,mp2));
    }
  return(FALSE);
  }
HRESULT CMenuToolbarBase::ChangePopupItem(CMenuToolbarBase * toolbar, INT item)
{
    // Ignore the change if it already matches the stored info
    if (m_popupBar == toolbar && m_popupItem == item)
        return S_FALSE;

    // Notify the toolbar if the popup-tracking this toolbar
    if (m_popupBar == this && toolbar != this)
    {
        CheckButton(m_popupItem, FALSE);
        m_isTrackingPopup = FALSE;
    }

    m_popupBar = toolbar;
    m_popupItem = item;

    if (m_popupBar == this)
    {
        CheckButton(m_popupItem, TRUE);
    }

    InvalidateDraw();
    return S_OK;
}
Exemple #27
0
// get key status
unsigned char OsdGetCtrl(void)
{
	static unsigned char c2;
	static unsigned short repeat;
	unsigned char c1,c;

	// send command and get current ctrl status
	c1 = OsdCommand(OSDCMDREAD);

	// add front menu button
	if (CheckButton())
	{	c1 = KEY_MENU;	}

	// generate normal "key-pressed" event
	c = 0;
	if (c1!=c2)
	{	c = c1;	}

	c2 = c1;

	/*generate repeat "key-pressed" events
	do not for menu button*/
	#if	defined(PGL100818)
		if (c1 & KEY_UPSTROKE)
		{	repeat = GetTimer(REPEATDELAY);		}
		else if (CheckTimer(repeat))
		{
			repeat = GetTimer(REPEATRATE);
			if (c1==KEY_UP || c1==KEY_DOWN || GetASCIIKey(c1))
			{	c = c1;	}
		}
	#else
		if (!c1)
		{	repeat = GetTimer(REPEATDELAY);		}
		else if (CheckTimer(repeat))
		{
			repeat = GetTimer(REPEATRATE);
			if (c1==KEY_UP || c1==KEY_DOWN || GetASCIIKey(c1))
			{	c = c1;	}
		}
	#endif

	// return events
	return(c);
}
Exemple #28
0
static portTASK_FUNCTION(MainTask, pvParameters) {
  (void)pvParameters; /* not used */
#if PL_USE_TSS
  Configure(); /* initialize TSS library */
#endif
  for(;;) {
#if PL_USE_TSS
    TSS_Task(); /* call TSS library to process touches */
#else
    CheckButton();
#endif
#if PL_HAS_LED_BLUE
    LEDB_Neg();
#endif
    StateMachine(FALSE);
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  }
}
bool ExampleUpdate()
{
    for (int i = 0; i < MAX_SAMPLES; i++)
    {
        if (!g_Buttons[i])
            break;
        if (CheckButton(g_Buttons[i]) & S3E_KEY_STATE_RELEASED)
        {
            s3eDebugTracePrintf("pressed button %d", i);
            
            if (i % 2)
            {
                if (!Play(i, 1))
                    g_SampleState[i] = 1;
            }
            else
            {
                switch(g_SampleState[i])
                {
                case 0:
                    if (!Play(i, 3))
                        g_SampleState[i] = 1;
                    break;
                case 1:
                    if (!Pause(i))
                        g_SampleState[i] = 2;                        
                    break;
                case 2:
                    if (!Resume(i))
                        g_SampleState[i] = 1;                        
                    break;
                }
            }
        }
    }

    return true;
}
Exemple #30
0
//===========================================================================
LRESULT CALLBACK Toolbar_WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	static UINT msgs[] =
	{
		BB_RECONFIGURE,
		BB_TASKSUPDATE,
		BB_SETTOOLBARLABEL,
		BB_BROADCAST,
		BB_DESKTOPINFO,
		BB_REDRAWGUI,
		0
		};

	switch (message)
	{
		//====================
	case WM_CREATE:
		DisableInputMethod(hwnd);
		TBInfo.hwnd = Toolbar_hwnd = hwnd;
		MessageManager_AddMessages (hwnd, msgs);
		MakeSticky(hwnd);
		Toolbar_UpdatePosition();
		break;

		//====================
	case WM_DESTROY:
		RemoveSticky(hwnd);
		MessageManager_RemoveMessages (hwnd, msgs);
		SetDesktopMargin(Toolbar_hwnd, 0, 0);
		if (Toolbar_hFont) DeleteObject(Toolbar_hFont), Toolbar_hFont = NULL;
		TBInfo.hwnd = Toolbar_hwnd = NULL;
		break;

		//====================
	case BB_RECONFIGURE:
	tbreconfig:
		Toolbar_UpdatePosition();
		Toolbar_ShowMenu(false);
		InvalidateRect(hwnd, NULL, FALSE);
		break;

		//====================
	case BB_REDRAWGUI:
		if (wParam & BBRG_TOOLBAR)
		{
			Toolbar_force_button_pressed = 0 != (wParam & BBRG_PRESSED);
			Toolbar_UpdatePosition();
			InvalidateRect(hwnd, NULL, FALSE);
		}
		break;

		//====================
	case BB_TASKSUPDATE:
	showlabel:
		Toolbar_setlabel();
		InvalidateRect(hwnd, NULL, FALSE);
		break;

	case BB_DESKTOPINFO:
		Toolbar_setlabel();
		InvalidateRect(hwnd, NULL, FALSE);
		break;

		//====================
	case WM_ACTIVATEAPP:
		if (wParam) SetOnTop(hwnd);
		break;

		//====================

	case WM_PAINT:
		{
			PAINTSTRUCT ps;
			HDC hdc = BeginPaint(hwnd, &ps);
			PaintToolbar(hdc, &ps.rcPaint);
			EndPaint(hwnd, &ps);
			break;
		}

		//====================

	case BB_SETTOOLBARLABEL:
		SetTimer(hwnd, TOOLBAR_SETLABEL_TIMER, 2000, (TIMERPROC)NULL);
		Toolbar_ShowingExternalLabel = true;
		strcpy_max(Toolbar_CurrentWindow, (LPCTSTR)lParam, sizeof(Toolbar_CurrentWindow)/sizeof(TCHAR));
		InvalidateRect(hwnd, NULL, FALSE);
		break;

		//====================

	case WM_TIMER:
		if (wParam == TOOLBAR_AUTOHIDE_TIMER)
		{
			if (TBInfo.autoHide)
			{
				if (check_mouse(hwnd) || (TBInfo.bbsb_hwnd && check_mouse(TBInfo.bbsb_hwnd)))
					break;

				Toolbar_AutoHide(true);
			}
			KillTimer(hwnd, wParam);
			break;
		}

		if (wParam == TOOLBAR_UPDATE_TIMER)
		{
			Toolbar_setclock();
			InvalidateRect(hwnd, NULL, FALSE);
			break;
		}

		KillTimer(hwnd, wParam);

		if (wParam == TOOLBAR_SETLABEL_TIMER)
		{
			Toolbar_ShowingExternalLabel = false;
			goto showlabel;
		}

		break;

		//====================
		/*
        case WM_DROPFILES:
            drop_style((HDROP)wParam);
            break;
		 */
		//====================

	case WM_LBUTTONDOWN:
		if (wParam & MK_CONTROL)
		{
			// Allow window to move if control key is being held down,
			UpdateWindow(hwnd);
			SendMessage(hwnd, WM_SYSCOMMAND, 0xf012, 0);
			break;
		}
		goto left_mouse;

	case WM_LBUTTONDBLCLK:
		if (wParam & MK_CONTROL)
		{
			// double click moves the window back to the default position
			Toolbar_set_pos();
			break;
		}
		goto left_mouse;

	case WM_MOUSEMOVE:
		if (TBInfo.autohidden)
		{
			// bring back from autohide
			SetTimer(hwnd, TOOLBAR_AUTOHIDE_TIMER, 250, NULL);
			Toolbar_AutoHide(false);
			break;
		}
		goto left_mouse;

	case WM_LBUTTONUP:
	left_mouse:
		{
			POINT MouseEventPoint;
			MouseEventPoint.x = (short)LOWORD(lParam);
			MouseEventPoint.y = (short)HIWORD(lParam);
			if (HandleCapture(hwnd, message, MouseEventPoint))
				break;

			for (int i=0; i<5; i++)
				if (CheckButton(
					hwnd,
					message,
					MouseEventPoint,
					&Toolbar_Button[i].r,
					&Toolbar_Button[i].pressed,
					Toolbar_button_event,
					i
					)) goto _break;

			if (message == WM_LBUTTONDOWN)
				SetActiveWindow(hwnd);
		}
	_break:
		break;

		//====================
		// show menus

	case WM_RBUTTONUP:
		{
			int x = (short)LOWORD(lParam);
			if (x < tbClockW)
				PostMessage(BBhwnd, BB_MENU, BB_MENU_TASKS, 0);
			else
				if (x >= TBInfo.width - tbClockW)
					PostMessage(BBhwnd, BB_MENU, BB_MENU_ROOT, 0);
				else
					Toolbar_ShowMenu(true);
			break;
		}

		//====================

	case WM_MBUTTONUP:
		// Is shift key held down?
		if (wParam & MK_SHIFT)
			PostMessage(BBhwnd, BB_TOGGLEPLUGINS, 0, 0);
		else
			PostMessage(BBhwnd, BB_TOGGLETRAY, 0, 0);
		break;

		//====================
		// If moved, snap window to screen edges...

	case WM_WINDOWPOSCHANGING:
		if (Toolbar_moving)
			SnapWindowToEdge((WINDOWPOS*)lParam, 0, SNAP_FULLSCREEN);
		break;

	case WM_ENTERSIZEMOVE:
		Toolbar_moving = true;
		break;

	case WM_EXITSIZEMOVE:
		Toolbar_moving = false;
		break;

		//====================

	case BB_BROADCAST:
		if (0 == _tmemcmp((LPTSTR)lParam, _T("@Toolbar"), 8))
		{
			const TCHAR *argument = (LPTSTR)lParam;
			const struct cfgmenu *p_menu, *p_item;
			const void *v = exec_internal_broam(argument, tb_main, &p_menu, &p_item);
			if (v) goto tbreconfig;
			break;
		}
		if (!_tcsicmp((LPCTSTR)lParam, _T("@BBShowPlugins")))
		{
			Toolbar_hidden = false;
			Toolbar_UpdatePosition();
			break;
		}
		if (!_tcsicmp((LPCTSTR)lParam, _T("@BBHidePlugins")))
		{
			if (Settings_toolbarPluginToggle)
			{
				Toolbar_hidden = true;
				Toolbar_UpdatePosition();
			}
			break;
		}
		break;

	case WM_CLOSE:
		break;

	default:
		return DefWindowProc(hwnd,message,wParam,lParam);

		//====================
	}
	return 0;
}