Ejemplo n.º 1
0
/* This function handles the WM_INITDIALOG message.
 */
BOOL FASTCALL LocalTopic_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam )
{
   HWND hwndList;
   HWND hwndEdit;
   CURMSG curmsg;
   int index;

   /* Fill the listbox with the list of folders.
    */
   hwndList = GetDlgItem( hwnd, IDD_LIST );
   FillListWithFolders( hwnd, IDD_LIST );

   /* Highlight the current folder or topic.
    */
   Ameol2_GetCurrentTopic( &curmsg );
   if( NULL != curmsg.pFolder )
      {
      ASSERT( NULL != curmsg.pcat );
      if( NULL == curmsg.pcl )
         curmsg.pcl = Amdb_GetFirstFolder( curmsg.pcat );
      if( CB_ERR != ( index = ComboBox_FindStringExact( hwndList, -1, curmsg.pcl ) ) )
         ComboBox_SetCurSel( hwndList, index );
      }

   /* Limit the input field.
    */
   VERIFY( hwndEdit = GetDlgItem( hwnd, IDD_EDIT ) );
   Edit_LimitText( hwndEdit, LEN_TOPICNAME );
   EnableControl( hwnd, IDOK, FALSE );
   SetFocus( hwndEdit );
   return( FALSE );
}
Ejemplo n.º 2
0
/* This function handles the WM_INITDIALOG message.
 */
BOOL FASTCALL NewBlinkEntryDlg_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam )
{
   Edit_LimitText( GetDlgItem( hwnd, IDD_EDIT ), 39 );
   EnableControl( hwnd, IDOK, FALSE );
   SetWindowLong( hwnd, DWL_USER, lParam );
   return( TRUE );
}
Ejemplo n.º 3
0
//---------------------------------------------------------------------------
void __fastcall TRightsFrame::UpdateControls()
{
  Color = (FPopup ? clWindow : clBtnFace);
  DirectoriesXCheck->Visible = AllowAddXToDirectories;
  EnableControl(DirectoriesXCheck,
    Enabled && DirectoriesXEffective());
  FInitialized = true;
  DoChange();
}
Ejemplo n.º 4
0
//确定函数
VOID CDlgCustomFace::OnOK()
{
	//连接判断
	bool bConnect=false;

	//系统模式
	if (m_cbMode==MM_SYSTEM)
	{
		CGlobalUserInfo * pGlobalUserInfo=CGlobalUserInfo::GetInstance();
		bConnect=(pGlobalUserInfo->GetGlobalUserData()->wFaceID!=m_wFaceID);
	}

	//自定模式
	if (m_cbMode==MM_CUSTOM)
	{
		//创建缓冲
		CImage ImageCustomFace;
		ImageCustomFace.Create(FACE_CX,FACE_CY,32);

		//创建 DC
		CImageDC BufferDC(ImageCustomFace);
		m_FaceItemCustomWnd.DrawEditImage(CDC::FromHandle(BufferDC),0,0,FACE_CX,FACE_CY);

		//获取数据
		INT nImagePitch=ImageCustomFace.GetPitch();
		LPBYTE cbBitCustomFace=(LPBYTE)ImageCustomFace.GetBits();

		//创建区域
		for (INT nYImagePos=0;nYImagePos<FACE_CY;nYImagePos++)
		{
			for (INT nXImagePos=0;nXImagePos<FACE_CX;nXImagePos++)
			{
				//设置颜色
				DWORD dwImageTarget=nYImagePos*nImagePitch+nXImagePos*4L;
				m_CustomFaceInfo.dwCustomFace[nYImagePos*FACE_CX+nXImagePos]=*(COLORREF *)(cbBitCustomFace+dwImageTarget);
			}
		}

		//设置变量
		bConnect=true;
		m_CustomFaceInfo.dwDataSize=sizeof(m_CustomFaceInfo);
	}

	//激活任务
	if (bConnect==true)
	{
		//控件控制
		EnableControl(false);

		//激活任务
		m_MissionManager.AvtiveMissionItem(this,false);

		return;
	}

	__super::OnOK();
}
Ejemplo n.º 5
0
INT_PTR HintBox::HandleMessage(MessageType message, WPARAM wParam) {
    INT_PTR result = FALSE;

    switch (message) {
    case WM_INITDIALOG: {
        Dialog::HandleMessage(message, wParam);

        if (mGameStyle == GAME_STYLE_CHALLENGE) {
            // disable the stronger hints
            EnableControl(IDC_RADIO_CONNECTED, false);
            EnableControl(IDC_RADIO_USABLE_ANY, false);
            EnableControl(IDC_RADIO_USABLE_SELECTED, false);
        }
        SetHintStrength();
        result = TRUE;
        break;
                        }

    case WM_COMMAND: {
        IdType const id = LOWORD(wParam);
        int const notification_code = HIWORD(wParam);
        switch (id) {
        case IDC_RADIO_NONE:
        case IDC_RADIO_EMPTY:
        case IDC_RADIO_CONNECTED:
        case IDC_RADIO_USABLE_ANY:
        case IDC_RADIO_USABLE_SELECTED:
            if (notification_code == BN_CLICKED) {
                SetHintStrength(id);
            }
            break;
        default:
            break;
        }
        break;
                     }
    }

    if (result == FALSE) {
        result = Dialog::HandleMessage(message, wParam);
    }

    return result;
}
Ejemplo n.º 6
0
/**
 * Set the output set-point value.
 *
 * The scale and the units depend on the mode the Jaguar is in.
 * In PercentVbus Mode, the outputValue is from -1.0 to 1.0 (same as PWM Jaguar).
 * In Voltage Mode, the outputValue is in Volts.
 * In Current Mode, the outputValue is in Amps.
 * In Speed Mode, the outputValue is in Rotations/Minute.
 * In Position Mode, the outputValue is in Rotations.
 *
 * @param outputValue The set-point to sent to the motor controller.
 * @param syncGroup The update group to add this Set() to, pending UpdateSyncGroup().  If 0, update immediately.
 */
void CANJaguar::Set(float outputValue, uint8_t syncGroup)
{
    uint32_t messageID;
    uint8_t dataBuffer[8];
    uint8_t dataSize;

    if (m_safetyHelper && !m_safetyHelper->IsAlive())
    {
	EnableControl();
    }

    switch(m_controlMode)
    {
    case kPercentVbus:
	{
	    messageID = LM_API_VOLT_T_SET;
	    if (outputValue > 1.0) outputValue = 1.0;
	    if (outputValue < -1.0) outputValue = -1.0;
	    dataSize = packPercentage(dataBuffer, outputValue);
	}
	break;
    case kSpeed:
	{
	    messageID = LM_API_SPD_T_SET;
	    dataSize = packFXP16_16(dataBuffer, outputValue);
	}
	break;
    case kPosition:
	{
	    messageID = LM_API_POS_T_SET;
	    dataSize = packFXP16_16(dataBuffer, outputValue);
	}
	break;
    case kCurrent:
	{
	    messageID = LM_API_ICTRL_T_SET;
	    dataSize = packFXP8_8(dataBuffer, outputValue);
	}
	break;
    case kVoltage:
	{
	    messageID = LM_API_VCOMP_T_SET;
	    dataSize = packFXP8_8(dataBuffer, outputValue);
	}
	break;
    default:
	return;
    }
    if (syncGroup != 0)
    {
	dataBuffer[dataSize] = syncGroup;
	dataSize++;
    }
    setTransaction(messageID, dataBuffer, dataSize);
    if (m_safetyHelper) m_safetyHelper->Feed();
}
void CGUIWindowSettingsScreenCalibration::ResetControls()
{
  // disable the video control, so that our other controls take mouse clicks etc.
  CONTROL_DISABLE(CONTROL_VIDEO);
  // disable the UI calibration for our controls
  // and set their limits
  // also, set them to invisible if they don't have focus
  CGUIMoverControl *pControl = dynamic_cast<CGUIMoverControl*>(GetControl(CONTROL_TOP_LEFT));
  RESOLUTION_INFO info = g_graphicsContext.GetResInfo(m_Res[m_iCurRes]);
  if (pControl)
  {
    pControl->SetLimits( -info.iWidth / 4,
                         -info.iHeight / 4,
                         info.iWidth / 4,
                         info.iHeight / 4);
    pControl->SetPosition((float)info.Overscan.left,
                          (float)info.Overscan.top);
    pControl->SetLocation(info.Overscan.left,
                          info.Overscan.top, false);
  }
  pControl = dynamic_cast<CGUIMoverControl*>(GetControl(CONTROL_BOTTOM_RIGHT));
  if (pControl)
  {
    pControl->SetLimits(info.iWidth*3 / 4,
                        info.iHeight*3 / 4,
                        info.iWidth*5 / 4,
                        info.iHeight*5 / 4);
    pControl->SetPosition((float)info.Overscan.right - (int)pControl->GetWidth(),
                          (float)info.Overscan.bottom - (int)pControl->GetHeight());
    pControl->SetLocation(info.Overscan.right,
                          info.Overscan.bottom, false);
  }
  // Subtitles and OSD controls can only move up and down
  pControl = dynamic_cast<CGUIMoverControl*>(GetControl(CONTROL_SUBTITLES));
  if (pControl)
  {
    pControl->SetLimits(0, info.iHeight*3 / 4,
                        0, info.iHeight*5 / 4);
    pControl->SetPosition((info.iWidth - pControl->GetWidth()) * 0.5f,
                          info.iSubtitles - pControl->GetHeight());
    pControl->SetLocation(0, info.iSubtitles, false);
  }
  // lastly the pixel ratio control...
  CGUIResizeControl *pResize = dynamic_cast<CGUIResizeControl*>(GetControl(CONTROL_PIXEL_RATIO));
  if (pResize)
  {
    pResize->SetLimits(info.iWidth*0.25f, info.iHeight*0.5f,
                       info.iWidth*0.75f, info.iHeight*0.5f);
    pResize->SetHeight(info.iHeight * 0.5f);
    pResize->SetWidth(pResize->GetHeight() / info.fPixelRatio);
    pResize->SetPosition((info.iWidth - pResize->GetWidth()) / 2,
                         (info.iHeight - pResize->GetHeight()) / 2);
  }
  // Enable the default control
  EnableControl(m_iControl);
}
Ejemplo n.º 8
0
SRXSpeed::SRXSpeed(int id, double Pvalue, double Ivalue, double Dvalue, int a):CANTalon(id)
{
	SetControlMode(CANTalon::kSpeed);
	SetFeedbackDevice(CANTalon::QuadEncoder);
	SetP(Pvalue);
	SetI(Ivalue);
	SetD(Dvalue);
	EnableControl();
	maxTicks=a;
}
void 
SmartSpeedCANJaguar::Initialize()
{
	ChangeControlMode(kSpeed);								// Set for speed mode
	SetSpeedReference(CANJaguar::kSpeedRef_Encoder);		// Define the encoder type
	ConfigEncoderCodesPerRev(encoderPulsesPerRevolution);	// Define the lines per revolution
	CANJaguar::SetPID(pid_P, pid_I, pid_D);					// Set our passed in PID constants
	EnableControl();										// Must enable the control paramaters									
	CANJaguar::Set(lastSetSpeed);							// Restore the last target speed...
}
Ejemplo n.º 10
0
//---------------------------------------------------------------------------
void __fastcall TSynchronizeDialog::UpdateControls()
{
  EnableControl(StartButton, !LocalDirectoryEdit->Text.IsEmpty() &&
    !RemoteDirectoryEdit->Text.IsEmpty());
  TButton * OldButton = FSynchronizing ? StartButton : StopButton;
  TButton * NewButton = FSynchronizing ? StopButton : StartButton;
  if (!NewButton->Visible || OldButton->Visible)
  {
    NewButton->Visible = true;
    if (OldButton->Focused())
    {
      NewButton->SetFocus();
    }
    OldButton->Default = false;
    NewButton->Default = true;
    OldButton->Visible = false;
    // some of the above steps hides accelerators when start button is pressed with mouse
    ResetSystemSettings(this);
  }
  Caption = FormatFormCaption(this, LoadStr(FSynchronizing ? SYNCHRONIZE_SYCHRONIZING : SYNCHRONIZE_TITLE));
  EnableControl(TransferSettingsButton, !FSynchronizing);
  CancelButton->Visible = !FSynchronizing || FLAGSET(FOptions, soNoMinimize);
  EnableControl(CancelButton, !FSynchronizing);
  EnableControl(DirectoriesGroup, !FSynchronizing);
  EnableControl(OptionsGroup, !FSynchronizing);
  EnableControl(CopyParamGroup, !FSynchronizing);
  MinimizeButton->Visible = FSynchronizing && FLAGCLEAR(FOptions, soNoMinimize);
  EnableControl(SynchronizeSelectedOnlyCheck,
    OptionsGroup->Enabled && FLAGSET(FOptions, soAllowSelectedOnly));

  UnicodeString InfoStr = CopyParams.GetInfoStr(L"; ", ActualCopyParamAttrs());
  CopyParamLabel->Caption = InfoStr;
  CopyParamLabel->Hint = InfoStr;
  CopyParamLabel->ShowHint =
    (CopyParamLabel->Canvas->TextWidth(InfoStr) > (CopyParamLabel->Width * 3 / 2));

  TransferSettingsButton->Style =
    FLAGCLEAR(Options, soDoNotUsePresets) ?
      TCustomButton::bsSplitButton : TCustomButton::bsPushButton;

  if (LogPanel->Visible != FSynchronizing)
  {
    if (FSynchronizing)
    {
      LogPanel->Visible = true;
      ClientHeight = ClientHeight + LogPanel->Height;
    }
    else
    {
      ClientHeight = ClientHeight - LogPanel->Height;
      LogPanel->Visible = false;
    }
  }

  // When minimizing to tray globally, no point showing special "minimize to tray" command
  MinimizeButton->Style =
    !WinConfiguration->MinimizeToTray ? TCustomButton::bsSplitButton : TCustomButton::bsPushButton;
}
//----------------------------------------------------------------------------------------------
//	ApplySetting
//----------------------------------------------------------------------------------------------
VOID CStickPage::ApplySetting()
{
	//	「スティックの機能(左)」
	SetComboBoxIndex( IDC_LEFT_STICK_USAGE, CurrentSetting->StickUsage[INDEX_LEFT_STICK] );
	//	「上下を反転する(左)」
	SetCheckBoxState(
		 IDC_LEFT_STICK_REVERSE_Y
		,CurrentSetting->StickReverseY[INDEX_LEFT_STICK] );
	//	「スティックの機能(左)」が「なし」の場合は、「上下を反転する(左)」を無効にする
	if( CurrentSetting->StickUsage[INDEX_LEFT_STICK] == USAGE_NONE )
	{
		EnableControl( IDC_LEFT_STICK_REVERSE_Y, FALSE );
	} else {
		EnableControl( IDC_LEFT_STICK_REVERSE_Y, TRUE );
	}

	//	「スティックの機能(右)」
	SetComboBoxIndex( IDC_RIGHT_STICK_USAGE, CurrentSetting->StickUsage[INDEX_RIGHT_STICK] );
	//	「上下を反転する(右)」
	SetCheckBoxState(
		 IDC_RIGHT_STICK_REVERSE_Y
		,CurrentSetting->StickReverseY[INDEX_RIGHT_STICK] );
	//	「スティックの機能(右)」が「なし」の場合は、「上下を反転する(右)」を無効にする
	if( CurrentSetting->StickUsage[INDEX_RIGHT_STICK] == USAGE_NONE )
	{
		EnableControl( IDC_RIGHT_STICK_REVERSE_Y, FALSE );
	} else {
		EnableControl( IDC_RIGHT_STICK_REVERSE_Y, TRUE );
	}

	//	「有効範囲」
	SetTrackBarRange(
		 IDC_STICK_THRESHOLD
		,CurrentSetting->StickMinThreshold[INDEX_LEFT_STICK]
		,CurrentSetting->StickMaxThreshold[INDEX_LEFT_STICK] );
	SetTrackBarPos( IDC_STICK_THRESHOLD, CurrentSetting->StickMinThreshold[INDEX_LEFT_STICK] );
	//	「スティックの入力閾値」
	SetTrackBarPos(
		 IDC_STICK_HAT_SWITCH_THRESHOLD
		,CurrentSetting->StickHatSwitchThreshold[INDEX_LEFT_STICK] );
}
Ejemplo n.º 12
0
void CCreateLightNodeWindow::OnClickCreateButton()
{
	//char text[256];
	//GetWindowTextA(mNameTextField, text, 256);

	EditorScene* scene = EditorScene::getInstance();
	EditorWindow* window = EditorWindow::getInstance();

	scene->PrepareAddingLight();
	window->SetMouseState(EMS_ADD_LIGHT);
	EnableControl(IDC_CREATE_LIGHT_BTN, FALSE);
}
Ejemplo n.º 13
0
void CEffectsTab::OnSharpenCancel()
{
    if (!DoCommand(_T("Sharpen"), _T("-3")))
        return;

    EnableControl(IDC_SHARPEN, true);
    ShowControl(IDC_SHARPEN_APPLY, SW_HIDE);
    ShowControl(IDC_SHARPEN_CANCEL, SW_HIDE);

    m_SharpenSlider.SetPos(0);
    m_SharpenSlider.EnableWindow(false);
}
Ejemplo n.º 14
0
void CEffectsTab::OnSmoothCancel()
{
    if (!DoCommand(_T("Smooth"), _T("-3")))
        return;

    EnableControl(IDC_SMOOTH, true);
    ShowControl(IDC_SMOOTH_APPLY, SW_HIDE);
    ShowControl(IDC_SMOOTH_CANCEL, SW_HIDE);

    m_SmoothSlider.SetPos(0);
    m_SmoothSlider.EnableWindow(false);
}
Ejemplo n.º 15
0
void CEffectsTab::OnEdgesCancel()
{
    if (!DoCommand(_T("Edges"), _T("-3")))
        return;

    EnableControl(IDC_EDGES, true);
    ShowControl(IDC_EDGES_APPLY, SW_HIDE);
    ShowControl(IDC_EDGES_CANCEL, SW_HIDE);

    m_EdgesSlider.SetPos(0);
    m_EdgesSlider.EnableWindow(false);
}
Ejemplo n.º 16
0
/* This function handles the WM_COMMAND message.
 */
void FASTCALL RASBlinkProperties_OnCommand( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify )
{
   switch( id )
      {
      case IDD_USERNAME:
      case IDD_PASSWORD:
         if( codeNotify == EN_CHANGE )
            PropSheet_Changed( GetParent( hwnd ), hwnd );
         break;

      case IDD_LIST:
         if( codeNotify == CBN_SELCHANGE )
            PropSheet_Changed( GetParent( hwnd ), hwnd );
         else if( codeNotify == CBN_DROPDOWN && !fRasFill )
            {
            FillRasConnections( hwnd, IDD_LIST );
            fRasFill = TRUE;
            }
         break;

      case IDD_USERAS:{
         BOOL fChecked;

         fChecked = IsDlgButtonChecked( hwnd, IDD_USERAS );
         EnableControl( hwnd, IDD_PAD1, fChecked );
         EnableControl( hwnd, IDD_PAD2, fChecked );
         EnableControl( hwnd, IDD_PAD3, fChecked );
         EnableControl( hwnd, IDD_LIST, fChecked );
         EnableControl( hwnd, IDD_USERNAME, fChecked );
         EnableControl( hwnd, IDD_PASSWORD, fChecked );
         PropSheet_Changed( GetParent( hwnd ), hwnd );
         break;
         }
      }
}
Ejemplo n.º 17
0
void CEffectsTab::OnEdges()
{
    if (!DoCommand(_T("Edges"), _T("-1")))
        return;

    EnableControl(IDC_EDGES, false);
    ShowControl(IDC_EDGES_APPLY, SW_SHOW);
    ShowControl(IDC_EDGES_CANCEL, SW_SHOW);

    m_EdgesSlider.SetPos(0);
    m_EdgesSlider.EnableWindow(true);
    m_iLastValue = -1;
}
Ejemplo n.º 18
0
void CInstanceInfoWindow::OnClickCreateButton()
{
	EditorWindow* window = EditorWindow::getInstance();
	EditorScene* scene = EditorScene::getInstance();
	SNodeInfo* info = window->mMeshNodePanel.mCreateMeshNodeWindow.GetSelectedItemNodeInfo();
	if (info->Category != COLLECTION_CATEGORY)
		return;

	scene->PrepareAddingInstance(info->Id);
	window->SetMouseState(EMS_ADD_INSTANCE);

	EnableControl(IDC_INSTANCE_CREATE_BTN, FALSE);
}
Ejemplo n.º 19
0
/* The selection has changed in the Blink Manager dialog, so
 * update the status buttons.
 */
void FASTCALL Comms_Blink_SelChange( HWND hwnd )
{
   LPBLINKENTRY lpbe;
   HWND hwndList;
   int index;

   VERIFY( hwndList = GetDlgItem( hwnd, IDD_LIST ) );
   index = ListBox_GetCurSel( hwndList );
   ASSERT( index != LB_ERR );
   lpbe = (LPBLINKENTRY)ListBox_GetItemData( hwndList, index );
   ASSERT( 0L != lpbe );
   EnableControl( hwnd, IDD_REMOVE, ( strcmp( lpbe->szName, "Full" ) != 0 && strcmp( lpbe->szName, "Custom" ) != 0 ) );
}
Ejemplo n.º 20
0
void CEffectsTab::OnSmooth()
{
    if (!DoCommand(_T("Smooth"), _T("-1")))
        return;

    EnableControl(IDC_SMOOTH, false);
    ShowControl(IDC_SMOOTH_APPLY, SW_SHOW);
    ShowControl(IDC_SMOOTH_CANCEL, SW_SHOW);

    m_SmoothSlider.SetPos(0);
    m_SmoothSlider.EnableWindow(true);
    m_iLastValue = -1;
}
Ejemplo n.º 21
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::UpdateControls()
{
  EnableControl(OKBtn, !LocalDirectory.IsEmpty() || !RemoteDirectory.IsEmpty());
  UpdateProfilesControls(SessionProfilesView,
    AddSessionBookmarkButton, RemoveSessionBookmarkButton,
    RenameSessionBookmarkButton,  SessionBookmarkMoveToButton, NULL,
    UpSessionBookmarkButton, DownSessionBookmarkButton);
  UpdateProfilesControls(SharedProfilesView,
    AddSharedBookmarkButton, RemoveSharedBookmarkButton,
    RenameSharedBookmarkButton, SharedBookmarkMoveToButton,
    ShortCutSharedBookmarkButton,
    UpSharedBookmarkButton, DownSharedBookmarkButton);
}
Ejemplo n.º 22
0
void CEffectsTab::OnSharpen()
{
    if (!DoCommand(_T("Sharpen"), _T("-1")))
        return;

    EnableControl(IDC_SHARPEN, false);
    ShowControl(IDC_SHARPEN_APPLY, SW_SHOW);
    ShowControl(IDC_SHARPEN_CANCEL, SW_SHOW);

    m_SharpenSlider.SetPos(0);
    m_SharpenSlider.EnableWindow(true);
    m_iLastValue = -1;
}
Ejemplo n.º 23
0
void CBlacklist::on_btnModify_clicked( )
{
    int nRow = ui->tableBlacklist->currentRow( );

    if ( -1 == nRow || ui->lblID->text( ).isEmpty( ) ) {
        CCommonFunction::MsgBox( NULL, CCommonFunction::GetMsgTitle( QMessageBox::Information ),
                                 QString( "请选择要修改的行!" ), QMessageBox::Information );
        return;
    }

    nOperate = 2;
    EnableControl( true );
    ControlButton( false );
}
void CGUIWindowSettingsScreenCalibration::NextControl()
{ // set the old control invisible and not focused, and choose the next control
  CGUIControl *pControl = GetControl(m_iControl);
  if (pControl)
  {
    pControl->SetVisible(false);
    pControl->SetFocus(false);
  }
  // switch to the next control
  m_iControl++;
  if (m_iControl > CONTROL_PIXEL_RATIO)
    m_iControl = CONTROL_TOP_LEFT;
  // enable the new control
  EnableControl(m_iControl);
}
Ejemplo n.º 25
0
CBlacklist::CBlacklist(QWidget* mainWnd, QWidget *parent) :
    QFrame(parent),
    ui(new Ui::CBlacklist)
{
    ui->setupUi(this);
    pParent = dynamic_cast< MainWindow* > ( mainWnd );
    //pParent->OperateTableWidget( ui->tableBlacklist, CommonDataType::BlacklistTable, CommonDataType::InitializeType );
    CCommonFunction::ConnectCloseButton( ui->lblClose );
    EnableControl( false );
    ControlButton( true );
    ui->lblTitle->setText( windowTitle( ) );

    nOperate = -1;
    ui->tableBlacklist->hideColumn( 3 );
    ui->lblID->setVisible( false );
}
Ejemplo n.º 26
0
VOID WINAPI WorkerThreadCleanup( PCOMMONCONTEXT pcmnctx )
{
	if (pcmnctx->status == CLEANUP_COMPLETED)
		return;

	// There are only two times this function gets called:
	// Case 1: The worker thread has exited on its own, and this function
	// was invoked in response to the thread's exit notification.
	// Case 2: A forced abort was requested (app exit, system shutdown, etc.),
	// where this is called right after calling WorkerThreadStop to signal the
	// thread to exit.

	if (pcmnctx->hThread)
	{
		if (pcmnctx->status != INACTIVE)
		{
			// Forced abort, where the thread has been told to stop but has not yet
			// stopped. With the MS Concurrency runtime, there's no simple way to
			// terminate errant threads; it's better to abort the process than to
			// allow them to continue (maybe maxing out the CPU) in the background.
			if (WaitForSingleObject(pcmnctx->hThread, 10000) == WAIT_TIMEOUT)
				abort();
		}

		CloseHandle(pcmnctx->hThread);
        CloseHandle(pcmnctx->hUnpauseEvent);
	}

	pcmnctx->status = CLEANUP_COMPLETED;

	if (!(pcmnctx->dwFlags & HCF_EXIT_PENDING))
	{
		static const UINT16 arCtrls[] =
		{
			IDC_PROG_TOTAL,
			IDC_PROG_FILE,
			IDC_PAUSE,
			IDC_STOP
		};

		UINT i;

		for (i = 0; i < countof(arCtrls); ++i)
			EnableControl(pcmnctx->hWnd, arCtrls[i], FALSE);
	}
}
Ejemplo n.º 27
0
//---------------------------------------------------------------------------
void __fastcall TFullSynchronizeDialog::UpdateControls()
{
    EnableControl(SynchronizeTimestampsButton, FLAGCLEAR(Options, fsoDisableTimestamp));
    if (SynchronizeTimestampsButton->Checked)
    {
        SynchronizeExistingOnlyCheck->Checked = true;
        SynchronizeDeleteCheck->Checked = false;
        SynchronizeByTimeCheck->Checked = true;
    }
    if (SynchronizeBothButton->Checked)
    {
        SynchronizeByTimeCheck->Checked = true;
        SynchronizeBySizeCheck->Checked = false;
        if (MirrorFilesButton->Checked)
        {
            SynchronizeFilesButton->Checked = true;
        }
    }
    EnableControl(MirrorFilesButton, !SynchronizeBothButton->Checked);
    EnableControl(SynchronizeDeleteCheck, !SynchronizeBothButton->Checked &&
                  !SynchronizeTimestampsButton->Checked);
    EnableControl(SynchronizeExistingOnlyCheck, !SynchronizeTimestampsButton->Checked);
    EnableControl(SynchronizeByTimeCheck, !SynchronizeBothButton->Checked &&
                  !SynchronizeTimestampsButton->Checked);
    EnableControl(SynchronizeBySizeCheck, !SynchronizeBothButton->Checked);
    EnableControl(SynchronizeSelectedOnlyCheck, FLAGSET(FOptions, fsoAllowSelectedOnly));

    EnableControl(OkButton, !LocalDirectoryEdit->Text.IsEmpty() &&
                  !RemoteDirectoryEdit->Text.IsEmpty());

    UnicodeString InfoStr = FCopyParams.GetInfoStr(L"; ", ActualCopyParamAttrs());
    CopyParamLabel->Caption = InfoStr;
    CopyParamLabel->Hint = InfoStr;
    CopyParamLabel->ShowHint =
        (CopyParamLabel->Canvas->TextWidth(InfoStr) > (CopyParamLabel->Width * 3 / 2));
    SynchronizeBySizeCheck->Caption = SynchronizeTimestampsButton->Checked ?
                                      LoadStr(SYNCHRONIZE_SAME_SIZE) : UnicodeString(FSynchronizeBySizeCaption);

    TransferSettingsButton->Style =
        FLAGCLEAR(Options, fsoDoNotUsePresets) ?
        TCustomButton::bsSplitButton : TCustomButton::bsPushButton;
}
Ejemplo n.º 28
0
/**
 * Common initialization code called by all constructors.
 */
void CANJaguar::InitCANJaguar()
{
    m_table = NULL;
    m_transactionSemaphore = semMCreate(SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
    if (m_deviceNumber < 1 || m_deviceNumber > 63)
    {
	char buf[256];
	snprintf(buf, 256, "device number \"%u\" must be between 1 and 63", m_deviceNumber);
	wpi_setWPIErrorWithContext(ParameterOutOfRange, buf);
	return;
    }
    uint32_t fwVer = GetFirmwareVersion();
    if (StatusIsFatal())
	return;
    // 3330 was the first shipping RDK firmware version for the Jaguar
    if (fwVer >= 3330 || fwVer < 101)
    {
	char buf[256];
	if (fwVer < 3330)
	{
	    snprintf(buf, 256, "Jag #%u firmware (%u) is too old (must be at least version 101 of the FIRST approved firmware)", m_deviceNumber, (u_int) fwVer);
	}
	else
	{
	    snprintf(buf, 256, "Jag #%u firmware (%u) is not FIRST approved (must be at least version 101 of the FIRST approved firmware)", m_deviceNumber, (u_int) fwVer);
	}
	wpi_setWPIErrorWithContext(JaguarVersionError, buf);
	return;
    }
    switch (m_controlMode)
    {
    case kPercentVbus:
    case kVoltage:
	// No additional configuration required... start enabled.
	EnableControl();
	break;
    default:
	break;
    }
    m_safetyHelper = new MotorSafetyHelper(this);

    nUsageReporting::report(nUsageReporting::kResourceType_CANJaguar, m_deviceNumber, m_controlMode);
    LiveWindow::GetInstance()->AddActuator("CANJaguar", 0, m_deviceNumber, this);
}
Ejemplo n.º 29
0
//---------------------------------------------------------------------
void __fastcall TSynchronizeChecklistDialog::UpdateControls()
{
  StatusBar->Invalidate();

  bool AllChecked = true;
  bool AllUnchecked = true;
  bool AnyBoth = false;
  bool AnyNonBoth = false;
  TListItem * Item = ListView->Selected;
  while (Item != NULL)
  {
    const TSynchronizeChecklist::TItem * ChecklistItem =
      static_cast<const TSynchronizeChecklist::TItem *>(Item->Data);
    if ((ChecklistItem->Action == TSynchronizeChecklist::saUploadUpdate) ||
        (ChecklistItem->Action == TSynchronizeChecklist::saDownloadUpdate))
    {
      AnyBoth = true;
    }
    else
    {
      AnyNonBoth = true;
    }

    if (Item->Checked)
    {
      AllUnchecked = false;
    }
    else
    {
      AllChecked = false;
    }
    Item = ListView->GetNextItem(Item, sdAll, TItemStates() << isSelected);
  }

  EnableControl(OkButton, (FChecked[0] > 0));
  EnableControl(CheckButton, !AllChecked);
  EnableControl(UncheckButton, !AllUnchecked);
  EnableControl(CheckAllButton, (FChecked[0] < FTotals[0]));
  EnableControl(UncheckAllButton, (FChecked[0] > 0));
  EnableControl(UncheckAllButton, (FChecked[0] > 0));
  EnableControl(CustomCommandsButton, AnyBoth && !AnyNonBoth);

  CheckItem->Enabled = CheckButton->Enabled;
  UncheckItem->Enabled = UncheckButton->Enabled;
  SelectAllItem->Enabled = (ListView->SelCount < ListView->Items->Count);
}
Ejemplo n.º 30
0
//关闭事件
bool CDlgCustomFace::OnEventMissionShut(BYTE cbShutReason)
{
	//关闭处理
	if (cbShutReason!=SHUT_REASON_NORMAL)
	{
		//重试任务
		//CMissionManager * pMissionManager=GetMissionManager();
		//if (pMissionManager->AvtiveMissionItem(this,true)==true) return true;

		//显示控件
		EnableControl(true);

		//显示提示
		CInformation Information(this);
		Information.ShowMessageBox(TEXT("由于当前服务器处理繁忙,上传自定义头像失败,请稍后再重试!"),MB_ICONERROR);
	}

	return true;
}