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


C++ CComboBox::ShowWindow方法代码示例

本文整理汇总了C++中CComboBox::ShowWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::ShowWindow方法的具体用法?C++ CComboBox::ShowWindow怎么用?C++ CComboBox::ShowWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComboBox的用法示例。


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

示例1: loadSyncModesBox

void CContactSettings::loadSyncModesBox(const char* sourceName)
{
    OutlookConfig* config = getConfig();
    WindowsSyncSourceConfig* ssconf = config->getSyncSourceConfig(sourceName);
    if (!ssconf) return;

    // TODO: use a switch on sourceName when refactoring
    int editBoxResourceID = IDC_CONTACTS_EDIT_SYNCTYPE;
    int comboBoxResourceID = IDC_CONTACTS_COMBO_SYNCTYPE;

    CEdit* editbox = (CEdit*)GetDlgItem(editBoxResourceID);
    CComboBox* combobox = (CComboBox*)GetDlgItem(comboBoxResourceID);
    if (!combobox || !editbox) return;

    //
    // Load the syncmodes in the editbox/dropdown
    //
    CString s1 = "";
    StringBuffer syncModes(ssconf->getSyncModes());
    if (syncModes.find(SYNC_MODE_TWO_WAY) != StringBuffer::npos) {
        s1.LoadString(IDS_SYNCTYPE1);
        combobox->AddString(s1);
    }
    if (syncModes.find(SYNC_MODE_ONE_WAY_FROM_SERVER) != StringBuffer::npos ||
        syncModes.find(SYNC_MODE_SMART_ONE_WAY_FROM_SERVER) != StringBuffer::npos) {
        s1.LoadString(IDS_SYNCTYPE2);
        combobox->AddString(s1);
    }
    if (syncModes.find(SYNC_MODE_ONE_WAY_FROM_CLIENT) != StringBuffer::npos ||
        syncModes.find(SYNC_MODE_SMART_ONE_WAY_FROM_CLIENT) != StringBuffer::npos) {
        s1.LoadString(IDS_SYNCTYPE3);
        combobox->AddString(s1);
    }

    if (combobox->GetCount() > 1) {
        // More than 1 syncmode available: use the dropdown box
        editbox->ShowWindow(SW_HIDE);
        combobox->ShowWindow(SW_SHOW);
    }
    else {
        // Only 1 syncmode available: use the editbox
        editbox->ShowWindow(SW_SHOW);
        combobox->ShowWindow(SW_HIDE);
        SetDlgItemText(editBoxResourceID, s1);
    }
}
开发者ID:PaulCarrick,项目名称:funambol-outlook-client,代码行数:46,代码来源:ContactSettings.cpp

示例2: DoDataExchange


//.........这里部分代码省略.........
					ss1 = ppart->specs.shld.shld_sound1; lss1 = "Sound activate";
					ss2 = ppart->specs.shld.shld_sound2; lss2 = "Sound desactivate";
					cbac->SetCurSel(ppart->specs.shld.shld_AC);
				break;
			}
			cbpt->SetCurSel(ppart->type);
		}
		slot = ppart->slot;
		uid = ppart->uid;
		
		todo1.AppendFormat("suk1 = %d (%04X)\r\n",ppart->suk1,ppart->suk1);
		todo1.AppendFormat("suk2 = %d (%04X)\r\n",ppart->suk2,ppart->suk2);
		char *p1 = (char *)ppart;
		char *p2 = (char *)(&(ppart->TODO[0]));
		int maxi = ppart->size-(int)(p2-p1);
		for (int i=0;i<maxi;i++)
		{
			todo1.AppendFormat("%02X ",ppart->TODO[i]);
			if (!((i+1)%16)) todo1.AppendFormat("\r\n");
		}
		todo1.AppendFormat("\r\nType = %04x\r\n",ppart->type);
		todo1.AppendFormat("\r\npad3 = %02x\r\n",ppart->pad3[0]);
		todo1.AppendFormat("\r\npad4 = %02x%02x\r\n",ppart->pad4[0],ppart->pad4[1]);
	}
	DDX_Text(pDX, IDC_NAME, name);
	DDX_Text(pDX, IDC_MODEL, model);
	DDX_Text(pDX, IDC_OBJ, obj);
	DDX_Text(pDX, IDC_SLOT, slot);
	DDX_Text(pDX, IDC_DESCRIPTION, descr);
	DDX_Text(pDX, IDC_TODO1, todo1);
	DDX_Text(pDX, IDC_UID, uid);
	DDX_Text(pDX, IDC_OVUID, ppart->overriding_uid);
	DDX_Text(pDX, IDC_SIZEOFTAG, ppart->size);
	cbac->ShowWindow(SW_HIDE);
	GetDlgItem(IDC_ACC)->ShowWindow(SW_HIDE);
	if (ppart->isspec)
	{
		CString gs1 = "N/A";
		GetDlgItem(IDC_GS1)->EnableWindow(FALSE);
		GetDlgItem(IDC_USEMASK)->EnableWindow(FALSE);
		DDX_Text(pDX, IDC_GS1, gs1);
		DDX_Text(pDX, IDC_USEMASK, gs1);
	}
	else
	{
		GetDlgItem(IDC_GS1)->EnableWindow(TRUE);
		GetDlgItem(IDC_USEMASK)->EnableWindow(TRUE);
		DDX_Text(pDX, IDC_GS1, ppart->stats_s1);
		DDX_Text(pDX, IDC_USEMASK, usemask);
		if (ppart->type == AGCEquipmentType_Shield)
		{
			cbac->ShowWindow(SW_SHOWNA);
			GetDlgItem(IDC_ACC)->ShowWindow(SW_SHOWNA);
		}
	}
	SetDlgItemText(IDC_PS1,ls1);
	SetDlgItemText(IDC_PS2,ls2);
	SetDlgItemText(IDC_PS3,ls3);
	SetDlgItemText(IDC_PS4,ls4);
	SetDlgItemText(IDC_PS7,ls7);
	SetDlgItemText(IDC_PSS1,lss1);
	SetDlgItemText(IDC_PSS2,lss2);
	SetDlgItemText(IDC_PSS3,lss3);
	SetDlgItemText(IDC_PSS4,lss4);
	SetDlgItemText(IDC_PSS5,lss5);
	GetDlgItem(IDC_S1)->ShowWindow(ls1==""?SW_HIDE:SW_SHOWNA);
开发者ID:AllegianceZone,项目名称:ICE,代码行数:67,代码来源:PartDlg.cpp

示例3: OnInitDialog

BOOL CFormulaAddDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();

    uiutils::setdlgsize(this, &m_ButtonCancel, &m_ButtonOK);

	queryMaterials();
	
	int mCount = this->materialCount;
	// TODO: Add extra initialization here
	int comboboxID = 1000;
	
	int comboLeft = 50;
	int comboTop = 100;
	int comboWidth =170;
	int comboBottom = 330;
	
	int editHeigh = 24;
	int editWidth = 100;
	int editID = 2000;
	int editLeft = 250;
	int editTop = 100;
	
	for(int i = 0; i < mCount ; ++i)
	{
		CString mTitle, pTitle;
		mTitle = (i >= 10) ? "材料名" : "";
		pTitle = (i >= 10) ? "百分比" : "";

		//m_MaterialSecond.SetWindowText(mTitle);
		//m_PercentageSecond.SetWindowText(pTitle);

		if (i == 10)
		{
			comboLeft = 400;
			editLeft = 620;
			comboTop = 100;
			editTop = 100;
		}
		
		CComboBox* testCombox = new CComboBox;
		testCombox->Create(CBS_DROPDOWNLIST|WS_VISIBLE |WS_VSCROLL ,
			CRect(comboLeft,comboTop,comboLeft + comboWidth,comboBottom),  this, comboboxID++);
		
		for (size_t j = 0; j < materialVector.size(); ++j)
		{
			testCombox->AddString(materialVector[j]);
		}

		testCombox->SetFont(SingletonHelper::getInstance()->defaultFont, TRUE);
		testCombox->SetCurSel(0);
		testCombox->ShowWindow(SW_SHOW);
		comboboxVector.push_back(testCombox);
		
		CEdit* testEdit = new CEdit;
		testEdit->CreateEx(WS_EX_CLIENTEDGE, "Edit", "", WS_CHILD|WS_VISIBLE|ES_LEFT,   
			CRect(editLeft,editTop,editLeft + editWidth,editTop + editHeigh), this, editID);
		testEdit->ShowWindow(SW_SHOW);
		editVector.push_back(testEdit);

		comboTop += 50;
		comboBottom += 50;
		editTop += 50;
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:coldbloodx,项目名称:weight,代码行数:68,代码来源:FormulaAddDialog.cpp


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