本文整理匯總了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 );
}
示例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 );
}
示例3: EnableControl
//---------------------------------------------------------------------------
void __fastcall TRightsFrame::UpdateControls()
{
Color = (FPopup ? clWindow : clBtnFace);
DirectoriesXCheck->Visible = AllowAddXToDirectories;
EnableControl(DirectoriesXCheck,
Enabled && DirectoriesXEffective());
FInitialized = true;
DoChange();
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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...
}
示例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;
}
示例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] );
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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 ) );
}