//*********************************************************************************************************** void CBCGPBaseVisualCtrl::PreSubclassWindow() { CStatic::PreSubclassWindow(); if (!m_bIsPopup) { InitCtrl(); InitTooltip(); } ModifyStyle(0, SS_NOTIFY); if (GetRect().IsRectEmpty()) { CRect rect; GetClientRect(rect); SetRect(rect); } CBCGPGestureConfig gestureConfig; if (GetGestureConfig(gestureConfig)) { bcgpGestureManager.SetGestureConfig(GetSafeHwnd(), gestureConfig); } }
BOOL CSHDispDialog::Create() { m_hWnd = CreateDialog(GetModuleHandle(_T("winacc.exe")),MAKEINTRESOURCE(IDD_DISP_DIALOG),NULL,CSHDispDialog::DlgMessageProc); if(!m_hWnd) { int error=GetLastError(); } RECT rect; GetWindowRect(m_hWnd,&rect); m_peerMager = new ShListControl(m_hWnd,rect.right-rect.left-10,rect.bottom-rect.top-15); m_hList = m_peerMager->GetListWnd(); //添加HEADER信息 InitCtrl(); DWORD dwHeight = GetSystemMetrics(SM_CYSCREEN); // 屏幕高度 DWORD dwWidth = GetSystemMetrics(SM_CXSCREEN); // 屏幕宽度 DWORD dwX,dwY; dwX = ( dwWidth - (rect.right - rect.left)*2.8 ) / 2; dwY = ( dwHeight - rect.bottom + rect.top ) / 2; SetWindowPos(m_hWnd,NULL,dwX,dwY,(rect.right-rect.left)*2.8,rect.bottom-rect.top,SWP_HIDEWINDOW); SendMessage(m_hWnd,WM_SIZE,0,0); SetTimer(m_hWnd,1,1000,NULL); return TRUE; }
// Init Controller Configuration bool srvCallbackInit(cob_srvs::Switch::Request &req, cob_srvs::Switch::Response &res ) { if(is_initialized_bool_ == false) { is_initialized_bool_ = InitCtrl(); // intializes some configuration variabes res.success = is_initialized_bool_; if (is_initialized_bool_) { ROS_INFO("Undercarriage-Ctrl initialized"); // reset Time last_time_ = ros::Time::now(); } else { ROS_INFO("Undercarriage-Ctrl initialization failed"); res.errorMessage.data = "initialization of undercarriage controller failed"; } } else { ROS_ERROR("... undercarriage controller already initialized..."); res.success = false; res.errorMessage.data = "undercarriage controller already initialized"; } return true; }
//*********************************************************************************************************** int CBCGPBaseVisualCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CStatic::OnCreate(lpCreateStruct) == -1) return -1; if (m_bIsPopup) { SendMessage(WM_IDLEUPDATECMDUI, (WPARAM)TRUE); } InitCtrl(); InitTooltip(); if (GetRect().IsRectEmpty()) { CRect rect; GetClientRect(rect); SetRect(rect); } CBCGPGestureConfig gestureConfig; if (GetGestureConfig(gestureConfig)) { bcgpGestureManager.SetGestureConfig(GetSafeHwnd(), gestureConfig); } return 0; }
//*********************************************************************************************** int CBCGPRibbonGalleryCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CBCGPRibbonPanelMenuBar::OnCreate(lpCreateStruct) == -1) return -1; InitCtrl(); return 0; }
BOOL CStoreDlg::OnInitDialog() { CIBADialog::OnInitDialog(); InitCtrl(); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
BOOL CDlgStockList::OnInitDialog() { CDialog::OnInitDialog(); InitCtrl(); Display(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CModuleDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CString str; str.Format("[%s] pid: %d", m_strName, m_dwPID); SetWindowText(str); InitCtrl(); EnumModule(); return TRUE; }
BOOL CDlgDeviceLedger::OnInitDialog() { CDialog::OnInitDialog(); // TODO: 在此添加额外的初始化 m_pBackBmp = new CBitmap; m_pBackBmp->LoadBitmap(IDB_BITMAP_BACK); InitCtrl(); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
BOOL CShortPathDlg::OnInitDialog() { CDialog::OnInitDialog(); LONG styles=GetWindowLong(ctrlShortPathList.m_hWnd,GWL_STYLE); SetWindowLong(ctrlShortPathList.m_hWnd,GWL_STYLE,styles | LVS_REPORT ); ctrlShortPathList.SetExtendedStyle(LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT|LVS_EX_ONECLICKACTIVATE); ctrlShortPathList.InsertColumn(0,_T("终点"),LVCFMT_LEFT,50); ctrlShortPathList.InsertColumn(1,_T("路权和"),LVCFMT_LEFT,60); ctrlShortPathList.InsertColumn(2,_T("路径"),LVCFMT_LEFT,240); InitCtrl(); return FALSE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
BOOL CSelectConectionDlg::OnInitDialog() { CDialog::OnInitDialog(); // 初始化listctrl控件 InitCtrl(); // 更新数据到界面 MemToInterface(); // 已选择的网卡高亮显示 SetListState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
// CGeneralSettings message handlers BOOL CGeneralSettingsDlg::OnInitDialog() { CDialog::OnInitDialog(); m_LocalLang.TreeControls(m_hWnd,m_Configs.bDebug?TRUE:FALSE,this->IDD,false); ((CButton*)GetDlgItem(IDC_CHECK_AUTO ))->SetCheck(m_Configs.bAutoTest ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_ONLYAT ))->SetCheck(m_Configs.bOnlyAt ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_FUSE ))->SetCheck(m_Configs.bFuse ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_WV ))->SetCheck(m_Configs.bWideVine ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_WVREAD ))->SetCheck(m_Configs.bWideVineRead?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_USEDB ))->SetCheck(m_Configs.bUseDB ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_FORCEWRITE ))->SetCheck(m_Configs.bForceWrite ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_REBOOT ))->SetCheck(m_Configs.bReboot ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_READ_FUSE ))->SetCheck(m_Configs.bFuseRead ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_SCRIPT_BIN ))->SetCheck(m_Configs.bIsBinScript ?BST_CHECKED:BST_UNCHECKED); /*set mode **/ CComboBox* hCtl = (CComboBox*)GetDlgItem(IDC_COMBO_MODE); INT CurSel = -1; for(int i = 0 ; i < dim(RebootMode); i ++ ) { hCtl->AddString(RebootMode[i].strMode); if(m_Configs.nMode == RebootMode[i].type) { CurSel = i; } } if(-1 != CurSel) { hCtl->SetCurSel(CurSel); } /*set mode end ***/ if( m_Configs.bIsBin) { ((CButton*)GetDlgItem(IDC_CHECK_BIN))->SetCheck(BST_CHECKED); ((CButton*)GetDlgItem(IDC_CHECK_XML))->SetCheck(BST_UNCHECKED); } else { ((CButton*)GetDlgItem(IDC_CHECK_BIN))->SetCheck(BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_XML))->SetCheck(BST_CHECKED); } InitCtrl(); return TRUE; }
BOOL CDlgNewEMBTask::OnInitDialog() { CDialog::OnInitDialog(); DateTime_SetFormat(m_dtCtrlPlaytime.GetSafeHwnd(), TEXT("yyyy-MM-dd HH:mm:ss")); m_lstSrcFtp.SetExtendedStyle( (m_lstSrcFtp.GetExtendedStyle()|LVS_EX_FULLROWSELECT|LVS_EX_CHECKBOXES|LVS_EX_GRIDLINES|LVS_SHOWSELALWAYS) &(~LVS_EX_TRACKSELECT)); // TODO: 在此添加额外的初始化 InitFtpListHeader(); InitCtrl(); m_ptcCtrlLength = (CMxtTimecodeCtrl*)GetDlgItem(IDC_TCODE_LENGTH); m_ptcCtrlSom = (CMxtTimecodeCtrl*)GetDlgItem(IDC_TCODE_SOM); m_ptcCtrlEom = (CMxtTimecodeCtrl*)GetDlgItem(IDC_TCODE_EOM); InitInfo(); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
BOOL CSHPeerDialog::Create() { m_hWnd = CreateDialog(GetModuleHandle(_T("winacc.exe")),MAKEINTRESOURCE(IDD_PEER_INFO),NULL,CSHPeerDialog::DlgMessageProc); RECT rect; GetWindowRect(m_hWnd,&rect); m_peerMager = new ShListControl(m_hWnd,rect.right-rect.left,rect.bottom-rect.top); m_hList = m_peerMager->GetListWnd(); InitCtrl(); DWORD dwHeight = GetSystemMetrics(SM_CYSCREEN); // 屏幕高度 DWORD dwWidth = GetSystemMetrics(SM_CXSCREEN); // 屏幕宽度 DWORD dwX,dwY; dwX = ( dwWidth - (rect.right + rect.left)*2.2 ) / 2; dwY = ( dwHeight - rect.bottom + rect.top ) / 2; SetWindowPos(m_hWnd,NULL,dwX,dwY,(rect.right-rect.left)*2.2,rect.bottom-rect.top,SWP_HIDEWINDOW); SendMessage(m_hWnd,WM_SIZE,0,0); return TRUE; }
// reset Controller Configuration bool srvCallbackReset(cob_srvs::Switch::Request &req, cob_srvs::Switch::Response &res ) { bool ctrlr_reset; if (is_initialized_bool_) { // flag that Controller is not initialized is_initialized_bool_ = false; // first of all stop controller (similar to EMStop) // Set desired value for Plattform Velocity to zero (setpoint setting) ucar_ctrl_.SetDesiredPltfVelocity( 0.0, 0.0, 0.0, 0.0); // ToDo: last value (0.0) is not used anymore --> remove from interface // Set EM flag and stop Ctrlr ucar_ctrl_.setEMStopActive(true); // now re-init controller configuration ctrlr_reset = InitCtrl(); if (ctrlr_reset) { // restart controller // Set desired value for Plattform Velocity to zero (setpoint setting) ucar_ctrl_.SetDesiredPltfVelocity( 0.0, 0.0, 0.0, 0.0); // ToDo: last value (0.0) is not used anymore --> remove from interface // Set EM flag and stop Ctrlr ucar_ctrl_.setEMStopActive(false); // reset Time last_time_ = ros::Time::now(); // and reset odometry x_rob_m_ = 0.0; y_rob_m_ = 0.0; theta_rob_rad_ = 0.0; // flag that controller is initialized is_initialized_bool_ = true; // set answer for service request ROS_INFO("Undercarriage Controller resetted"); res.success = true; } else { // set answer for service request ROS_INFO("Re-Init after Reset of Undercarriage Controller failed"); res.success = false; res.errorMessage.data = "reinit after reset of undercarriage controller failed"; } } else { // Reset not possible, because Controller not yet set up ROS_ERROR("... undercarriage controller not yet initialized, reset not possible ..."); // set answer for service request res.success = false; res.errorMessage.data = "undercarriage controller not yet initialized"; } return true; }
CGradientCtrl::CGradientCtrl(wxWindow *pParent, wxWindowID id , const wxPoint& pos , const wxSize& size , long style , const wxString& name) : wxPanel(pParent, id, pos, size, style, name) , m_pSelectedCursor(NULL) { InitCtrl(); }
void PerformTest(int argc, char **argv) { int handle1, handle2; int br, i; TIMECAPS tmcps; int needTimeEndPeriod = 0; switch (Bitrate) { case 1000000: br = canBITRATE_1M; break; case 500000: br = canBITRATE_500K; break; case 250000: br = canBITRATE_250K; break; case 125000: br = canBITRATE_125K; break; case 100000: br = canBITRATE_100K; break; case 62500: br = canBITRATE_62K; break; case 50000: br = canBITRATE_50K; break; case 20000: br = Bitrate; break; case 10000: br = Bitrate; break; case 5000: br = Bitrate; break; default: // qqq printf("Unsupported bitrate, choose 1000/500/250/125/100/62.5/50/20/10/5 k.\n"); exit(1); } BitrateConverted = br; if (timeGetDevCaps(&tmcps, sizeof(TIMECAPS)) == TIMERR_NOERROR) { needTimeEndPeriod = 1; // Set resolution as low as possible timeBeginPeriod(tmcps.wPeriodMin); if (Verbose && tmcps.wPeriodMin >= 8) printf("PC-timer resolution set to %d\n", tmcps.wPeriodMin); } else { if (Verbose) printf("Couldn't set PC-timer resolution\n"); } handle1 = InitCtrl(First, br); handle2 = InitCtrl(Second, br); for (i=0; i<LoopCount; i++) { if (Verbose) { int j; printf("\n*** Loop %d *** (", i); for (j=0; j<argc; j++) printf("%s ", argv[j]); printf(")\n"); fflush(stdout); } canBusOff(handle1); canBusOff(handle2); handle1 = ReInitialize(handle1, First, br); handle2 = ReInitialize(handle2, Second, br); timeStampTester(handle1, handle2); if (_kbhit() && _getch() == 27) { // ESC hit? break; } } canClose(handle1); canClose(handle2); if (needTimeEndPeriod) { timeEndPeriod(tmcps.wPeriodMin); // reset resolution } }
int ReInitialize(int ctrl, int channel, int br) { canClose(ctrl); return InitCtrl(channel, br); }
CGradientColorBoard::CGradientColorBoard(wxWindow *parent, wxWindowID id , const wxPoint& pos , const wxSize& size , long style , const wxString& name) : wxPanel(parent, id, pos, size, style, name) { InitCtrl(); }