当前位置: 首页>>代码示例>>C++>>正文


C++ EnableControl函数代码示例

本文整理汇总了C++中EnableControl函数的典型用法代码示例。如果您正苦于以下问题:C++ EnableControl函数的具体用法?C++ EnableControl怎么用?C++ EnableControl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了EnableControl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LocalTopic_OnInitDialog

/* 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 );
}
开发者ID:cixonline,项目名称:ameol,代码行数:34,代码来源:local.c

示例2: NewBlinkEntryDlg_OnInitDialog

/* 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 );
}
开发者ID:cixonline,项目名称:ameol,代码行数:9,代码来源:blinkman.c

示例3: EnableControl

//---------------------------------------------------------------------------
void __fastcall TRightsFrame::UpdateControls()
{
  Color = (FPopup ? clWindow : clBtnFace);
  DirectoriesXCheck->Visible = AllowAddXToDirectories;
  EnableControl(DirectoriesXCheck,
    Enabled && DirectoriesXEffective());
  FInitialized = true;
  DoChange();
}
开发者ID:mpmartin8080,项目名称:winscp,代码行数:10,代码来源:Rights.cpp

示例4: BufferDC

//确定函数
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();
}
开发者ID:cyrillic7,项目名称:CPFrom,代码行数:58,代码来源:DlgCustomFace.cpp

示例5: switch

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;
}
开发者ID:stephengold,项目名称:gold-tiles,代码行数:44,代码来源:hintbox.cpp

示例6: EnableControl

/**
 * 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();
}
开发者ID:errorcodexero,项目名称:porting,代码行数:69,代码来源:CANJaguar.cpp

示例7: CONTROL_DISABLE

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);
}
开发者ID:evilhamster,项目名称:xbmc,代码行数:56,代码来源:GUIWindowSettingsScreenCalibration.cpp

示例8: SetControlMode

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;
}
开发者ID:FRCTeam159,项目名称:2016-Robot-Code,代码行数:10,代码来源:SRXSpeed.cpp

示例9: ChangeControlMode

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...
}
开发者ID:FRCTeam1073-TheForceTeam,项目名称:robot11Elot,代码行数:10,代码来源:SmartSpeedCANJaguar.cpp

示例10: EnableControl

//---------------------------------------------------------------------------
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;
}
开发者ID:anyue100,项目名称:winscp,代码行数:59,代码来源:Synchronize.cpp

示例11: SetComboBoxIndex

//----------------------------------------------------------------------------------------------
//	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] );
}
开发者ID:MasashiWada,项目名称:Xbox360-Controller-Driver,代码行数:44,代码来源:stick_page.cpp

示例12: EnableControl

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);
}
开发者ID:Wu1994,项目名称:GameFinal,代码行数:12,代码来源:CCreateLightNodeWindow.cpp

示例13: RASBlinkProperties_OnCommand

/* 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;
         }
      }
}
开发者ID:cixonline,项目名称:ameol,代码行数:37,代码来源:blinkman.c

示例14: EnableControl

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);
}
开发者ID:Wu1994,项目名称:GameFinal,代码行数:13,代码来源:CInstanceInfoWindow.cpp

示例15: Comms_Blink_SelChange

/* 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 ) );
}
开发者ID:cixonline,项目名称:ameol,代码行数:16,代码来源:blinkman.c


注:本文中的EnableControl函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。