本文整理汇总了C++中CComboBox::AddString方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::AddString方法的具体用法?C++ CComboBox::AddString怎么用?C++ CComboBox::AddString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::AddString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL CMissionNotesDlg::OnInitDialog()
{
int i;
CComboBox *box;
// set up the radio box states
coop = (CButton *)GetDlgItem(IDC_COOP);
team = (CButton *)GetDlgItem(IDC_TEAMVTEAM);
dogfight = (CButton *)GetDlgItem(IDC_DOGFIGHT);
m_mission_title_orig = m_mission_title = _T(The_mission.name);
m_designer_name_orig = m_designer_name = _T(The_mission.author);
m_created = _T(The_mission.created);
m_modified = _T(The_mission.modified);
m_mission_notes_orig = m_mission_notes = convert_multiline_string(The_mission.notes);
m_mission_desc_orig = m_mission_desc = convert_multiline_string(The_mission.mission_desc);
m_red_alert = The_mission.red_alert;
m_scramble = The_mission.scramble;
m_disallow_support = (The_mission.support_ships.max_support_ships == 0) ? 1 : 0;
m_no_promotion = (The_mission.flags & MISSION_FLAG_NO_PROMOTION) ? 1 : 0;
m_no_builtin_msgs = (The_mission.flags & MISSION_FLAG_NO_BUILTIN_MSGS) ? 1 : 0;
m_no_traitor = (The_mission.flags & MISSION_FLAG_NO_TRAITOR) ? 1 : 0;
m_ship_trails = (The_mission.flags & MISSION_FLAG_SHIP_TRAILS) ? 1 : 0;
m_support_repairs_hull = (The_mission.flags &MISSION_FLAG_SUPPORT_REPAIRS_HULL) ? 1 : 0;
m_beam_free_all_by_default = (The_mission.flags & MISSION_FLAG_BEAM_FREE_ALL_BY_DEFAULT) ? 1 : 0;
// m_old_warp_effect = (The_mission.flags & MISSION_FLAG_OLD_WARP_EFFECT) ? 1 : 0;
m_no_briefing = (The_mission.flags & MISSION_FLAG_NO_BRIEFING) ? 1 : 0;
m_no_debriefing = (The_mission.flags & MISSION_FLAG_NO_DEBRIEFING) ? 1 : 0;
m_loading_640=_T(The_mission.loading_screen[GR_640]);
m_loading_1024=_T(The_mission.loading_screen[GR_1024]);
//CDialog::OnInitDialog();
//return TRUE;
box = (CComboBox *) GetDlgItem(IDC_MUSIC);
box->AddString("None");
for (i=0; i<Num_soundtracks; i++){
box->AddString(Soundtracks[i].name);
}
// squad info
if(strlen(The_mission.squad_name) > 0){
m_squad_name = _T(The_mission.squad_name);
m_squad_filename = _T(The_mission.squad_filename);
} else {
m_squad_name = _T(NO_SQUAD);
m_squad_filename = _T("");
}
m_type = The_mission.game_type;
m_music = Current_soundtrack_num + 1;
m_full_war = Mission_all_attack;
// set up the game type checkboxes accoring to m_type
if ( m_type & MISSION_TYPE_SINGLE ){
((CButton *) GetDlgItem(IDC_SINGLE))->SetCheck(1);
}
// for multiplayer -- be sure to assign a default type if not already assigned.
if ( m_type & MISSION_TYPE_MULTI ){
((CButton *) GetDlgItem(IDC_MULTI))->SetCheck(1);
}
if ( m_type & MISSION_TYPE_TRAINING ){
((CButton *) GetDlgItem(IDC_TRAINING))->SetCheck(1);
}
// we need to set one of these three multiplayer modes so interface looks correct
if ( !(m_type & (MISSION_TYPE_MULTI_COOP | MISSION_TYPE_MULTI_DOGFIGHT | MISSION_TYPE_MULTI_TEAMS)) ){
m_type |= MISSION_TYPE_MULTI_COOP;
}
if ( m_type & MISSION_TYPE_MULTI_COOP ){
coop->SetCheck(1);
} else if ( m_type & MISSION_TYPE_MULTI_TEAMS ){
team->SetCheck(1);
} else if ( m_type & MISSION_TYPE_MULTI_DOGFIGHT ){
dogfight->SetCheck(1);
} else {
Int3(); // get allender -- multiplayer mode not set!!!
}
m_respawn_spin.SetRange(0, 99);
m_num_respawns = The_mission.num_respawns;
m_max_hull_repair_val = The_mission.support_ships.max_hull_repair_val;
m_max_subsys_repair_val = The_mission.support_ships.max_subsys_repair_val;
set_types();
UpdateData(FALSE);
theApp.init_window(&Mission_notes_wnd_data, this);
return TRUE;
}
示例2: initialize_data_safe
//.........这里部分代码省略.........
else
m_arrival_tree.load_tree(Wings[cur_wing].arrival_cue);
m_departure_tree.load_tree(Wings[cur_wing].departure_cue, "false");
m_hotkey = Wings[cur_wing].hotkey+1;
if (Wings[cur_wing].flags & WF_IGNORE_COUNT)
m_ignore_count = 1;
else
m_ignore_count = 0;
if (Wings[cur_wing].flags & WF_NO_ARRIVAL_MUSIC)
m_no_arrival_music = 1;
else
m_no_arrival_music = 0;
if ( Wings[cur_wing].flags & WF_NO_ARRIVAL_MESSAGE )
m_no_arrival_message = 1;
else
m_no_arrival_message = 0;
if ( Wings[cur_wing].flags & WF_NO_ARRIVAL_WARP )
m_no_arrival_warp = 1;
else
m_no_arrival_warp = 0;
if ( Wings[cur_wing].flags & WF_NO_DEPARTURE_WARP )
m_no_departure_warp = 1;
else
m_no_departure_warp = 0;
ptr = (CComboBox *) GetDlgItem(IDC_WING_SPECIAL_SHIP);
ptr->ResetContent();
for (i=0; i<Wings[cur_wing].wave_count; i++)
ptr->AddString(Ships[Wings[cur_wing].ship_index[i]].ship_name);
m_threshold_spin.SetRange(0, Wings[cur_wing].wave_count - 1);
for (i=0; i<Num_reinforcements; i++)
if (!stricmp(Reinforcements[i].name, Wings[cur_wing].name))
break;
if (i < Num_reinforcements)
m_reinforcement = TRUE;
else
m_reinforcement = FALSE;
}
if (full_update)
UpdateData(FALSE);
GetDlgItem(IDC_WING_NAME)->EnableWindow(enable);
GetDlgItem(IDC_WING_SQUAD_LOGO_BUTTON)->EnableWindow(enable);
GetDlgItem(IDC_WING_SPECIAL_SHIP)->EnableWindow(enable);
GetDlgItem(IDC_WING_WAVES)->EnableWindow(player_enabled);
GetDlgItem(IDC_WING_WAVE_THRESHOLD)->EnableWindow(player_enabled);
GetDlgItem(IDC_DISBAND_WING)->EnableWindow(enable);
GetDlgItem(IDC_SPIN_WAVES)->EnableWindow(player_enabled);
GetDlgItem(IDC_SPIN_WAVE_THRESHOLD)->EnableWindow(player_enabled);
GetDlgItem(IDC_ARRIVAL_LOCATION)->EnableWindow(enable);
GetDlgItem(IDC_ARRIVAL_DELAY)->EnableWindow(player_enabled);
GetDlgItem(IDC_ARRIVAL_DELAY_MIN)->EnableWindow(player_enabled);
GetDlgItem(IDC_ARRIVAL_DELAY_MAX)->EnableWindow(player_enabled);
GetDlgItem(IDC_ARRIVAL_DELAY_SPIN)->EnableWindow(player_enabled);
if (m_arrival_location) {
GetDlgItem(IDC_ARRIVAL_DISTANCE)->EnableWindow(enable);
GetDlgItem(IDC_ARRIVAL_TARGET)->EnableWindow(enable);
示例3: OnInitDialog
BOOL orient_editor::OnInitDialog()
{
char text[80];
int type;
CComboBox *box;
object *ptr;
CDialog::OnInitDialog();
theApp.init_window(&Object_wnd_data, this);
((CButton *) GetDlgItem(IDC_POINT_TO_OBJECT))->SetCheck(1);
box = (CComboBox *) GetDlgItem(IDC_OBJECT_LIST);
box->ResetContent();
total = 0;
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (Marked != 1 || OBJ_INDEX(ptr) != cur_object_index) {
if ((ptr->type == OBJ_START) || (ptr->type == OBJ_SHIP)) {
box->AddString(Ships[ptr->instance].ship_name);
index[total++] = OBJ_INDEX(ptr);
} else if (ptr->type == OBJ_WAYPOINT) {
int waypoint_num;
waypoint_list *wp_list = find_waypoint_list_with_instance(ptr->instance, &waypoint_num);
Assert(wp_list != NULL);
sprintf(text, "%s:%d", wp_list->get_name(), waypoint_num + 1);
box->AddString(text);
index[total++] = OBJ_INDEX(ptr);
} else if ((ptr->type == OBJ_POINT) || (ptr->type == OBJ_JUMP_NODE)) {
} else
Assert(0); // unknown object type.
}
ptr = GET_NEXT(ptr);
}
type = Objects[cur_object_index].type;
if (Marked == 1 && type == OBJ_WAYPOINT) {
GetDlgItem(IDC_POINT_TO_CHECKBOX)->EnableWindow(0);
GetDlgItem(IDC_POINT_TO_OBJECT)->EnableWindow(0);
GetDlgItem(IDC_POINT_TO_LOCATION)->EnableWindow(0);
GetDlgItem(IDC_OBJECT_LIST)->EnableWindow(0);
GetDlgItem(IDC_LOCATION_X)->EnableWindow(0);
GetDlgItem(IDC_LOCATION_Y)->EnableWindow(0);
GetDlgItem(IDC_LOCATION_Z)->EnableWindow(0);
m_object_index = -1;
} else {
m_object_index = 0;
}
m_spin1.SetRange((short)9999, (short)-9999);
m_spin1.SetPos((int) convert(m_position_x));
m_spin2.SetRange((short)9999, (short)-9999);
m_spin2.SetPos((int) convert(m_position_y));
m_spin3.SetRange((short)9999, (short)-9999);
m_spin3.SetPos((int) convert(m_position_z));
m_spin4.SetRange((short)9999, (short)-9999);
m_spin5.SetRange((short)9999, (short)-9999);
m_spin6.SetRange((short)9999, (short)-9999);
UpdateData(FALSE);
return TRUE;
}
示例4: OnInitDialog
BOOL CPreferencesOnlinePage::OnInitDialog()
{
CComboBox *pDialupsCombo;
CButton *pBtnModem, *pBtnDirect;
CString csResource;
m_bSetActiveOnce = FALSE;
CDialog::OnInitDialog();
m_bVisitedThisPage = FALSE;
#if 0
BOOL bAG = GetConfiguration()->Product() == CPrintMasterConfiguration::plAmericanGreetings;
if(bAG)
{
CWnd* pWndDesign = GetDlgItem(IDC_DESIGN_CHECK);
if(pWndDesign )
pWndDesign->ShowWindow(SW_HIDE);
CWnd* pWndCheck = GetDlgItem(IDC_USE_PROMPT);
if(pWndCheck )
pWndCheck->ShowWindow(SW_HIDE);
}
#endif
m_bOwnSettings = FALSE;
DeInit();
if(m_pConnSettings == NULL)
{
m_bOwnSettings = TRUE;
m_pConnSettings = new CConnectionSettings;
m_pConnSettings->Update(FALSE, FALSE);
}
pBtnModem = (CButton *) GetDlgItem(IDC_CONNECTION_MODEM);
ASSERT(pBtnModem);
pBtnDirect = (CButton *) GetDlgItem(IDC_CONNECTION_DIRECT);
ASSERT(pBtnDirect);
if(m_pConnSettings->GetType() != CConnectionSettings::typeDirect)
{
if(pBtnModem)
pBtnModem->SetCheck(1);
m_comboDialups.EnableWindow(TRUE);
m_btnAdvanced.EnableWindow(TRUE);
}
else
{
if(pBtnDirect)
pBtnDirect->SetCheck(1);
m_comboDialups.EnableWindow(FALSE);
m_btnAdvanced.EnableWindow(FALSE);
}
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
if(pDialupsCombo)
{
CDialupConnections *pDialups;
int nItemIndex=-1;
int nModemAOLIndex, nCompuServeIndex;
int nModemDialupIndex, nDirectIndex, nModemCustomIndex;
BOOL bEnableAdvanced;
nModemAOLIndex = nModemDialupIndex = nDirectIndex = nModemCustomIndex = -1;
if(m_pConnSettings->IsAOL95Installed())
{
csResource.LoadString(IDS_AOL);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nModemAOLIndex = pDialupsCombo->AddString(csResource);
ASSERT(nModemAOLIndex >= 0);
if(nModemAOLIndex >= 0)
pDialupsCombo->SetItemData(
nModemAOLIndex,
(DWORD) CConnectionSettings::typeModemAOL);
}
if(m_pConnSettings->IsCompuServeInstalled())
{
csResource.LoadString(IDS_COMPUSERVE);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nCompuServeIndex = pDialupsCombo->AddString(csResource);
ASSERT(nCompuServeIndex >= 0);
if(nCompuServeIndex >= 0)
pDialupsCombo->SetItemData(
nCompuServeIndex,
(DWORD) CConnectionSettings::typeModemCompuServe);
}
pDialups = m_pConnSettings->GetDialups();
ASSERT(pDialups);
if(pDialups->GetEntryCount())
{
csResource.LoadString(IDS_DIALUP);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nModemDialupIndex = pDialupsCombo->AddString(csResource);
ASSERT(nModemDialupIndex >= 0);
if(nModemDialupIndex >= 0)
pDialupsCombo->SetItemData(
nModemDialupIndex,
(DWORD) CConnectionSettings::typeModemDialup);
//.........这里部分代码省略.........
示例5: OnDefaultReloaddirectories
void CNifConvertDlg::OnDefaultReloaddirectories()
{
logMessage(NCU_MSG_TYPE_INFO, "scanning directories...");
// re-scan texture path
CComboBox* pCBox = (CComboBox*) GetDlgItem(IDC_COMBO_TEXTURE);
CString pathTmpl(glConfig._pathSkyrim.c_str());
set<string> directories;
// reset selection box
pCBox->ResetContent();
// add subdirectory
pathTmpl += "\\Data\\Textures";
// parse directory
parseDir(pathTmpl, directories);
// in case of existing data
if (directories.size() > 0)
{
// add files to selection box
for (set<string>::iterator tIter = directories.begin(); tIter != directories.end(); tIter++)
{
pCBox->AddString(CString((*tIter).c_str()) + _T("\\"));
}
pCBox->SelectString(-1, CString(glConfig._lastTexture.c_str()));
// make sure one entry is selected
GetDlgItem(IDC_COMBO_TEXTURE) ->GetWindowTextW(pathTmpl);
if (pathTmpl.IsEmpty())
{
pCBox->SetCurSel(0);
}
// reset last choosen template
GetDlgItem(IDC_COMBO_TEXTURE)->GetWindowTextW(pathTmpl);
glConfig._lastTexture = CStringA(pathTmpl).GetString();
}
// re-scan templates
pCBox = (CComboBox*) GetDlgItem(IDC_COMBO_TEMPLATE);
pathTmpl = glConfig._pathTemplate.c_str();
directories.clear();
// reset selection box
pCBox->ResetContent();
// parse directory
parseDir(pathTmpl, directories, false);
// in case of existing data
if (directories.size() > 0)
{
// add files to selection box
for (set<string>::iterator tIter = directories.begin(); tIter != directories.end(); tIter++)
{
if ((*tIter).rfind(".nif") == string::npos) continue;
pCBox->AddString(CString((*tIter).c_str()));
}
pCBox->SelectString(-1, CString(glConfig._lastTemplate.c_str()));
// make sure one entry is selected
GetDlgItem(IDC_COMBO_TEMPLATE) ->GetWindowTextW(pathTmpl);
if (pathTmpl.IsEmpty())
{
pCBox->SetCurSel(0);
}
// reset last choosen template
GetDlgItem(IDC_COMBO_TEMPLATE)->GetWindowTextW(pathTmpl);
glConfig._lastTemplate = CStringA(pathTmpl).GetString();
}
logMessage(NCU_MSG_TYPE_INFO, "scan done.");
}
示例6: OnInitDialog
BOOL CWZAdvanced::OnInitDialog()
{
CWZPropertyPage::OnInitDialog();
CString cs_text, cs_tmp;
int iItem(-1);
// Make Next button say the function
cs_tmp.LoadString(m_pWZPSH->GetButtonID());
m_pWZPSH->GetDlgItem(ID_WIZNEXT)->SetWindowText(cs_tmp);
// Make sure back button is displayed
m_pWZPSH->GetDlgItem(ID_WIZBACK)->EnableWindow(TRUE);
m_pWZPSH->GetDlgItem(ID_WIZBACK)->ShowWindow(SW_SHOW);
m_bsAllowedFields.reset();
m_bsDefaultSelectedFields.reset();
m_bsMandatoryFields.reset();
switch (m_iIndex) {
case WZAdvanced::COMPARE:
cs_text.LoadString(IDS_COMPAREX);
break;
case WZAdvanced::MERGE:
cs_text.LoadString(IDS_MERGEX);
break;
case WZAdvanced::SYNCH:
cs_text.LoadString(IDS_SYNCHRONIZEX);
break;
case WZAdvanced::EXPORT_TEXT:
cs_text.Format(IDS_EXPORT_TEXTX);
break;
case WZAdvanced::EXPORT_ENTRYTEXT:
cs_text.LoadString(IDS_EXPORT_TEXTX_SINGLE);
break;
case WZAdvanced::EXPORT_XML:
cs_text.Format(IDS_EXPORT_XMLX);
break;
case WZAdvanced::EXPORT_ENTRYXML:
cs_text.LoadString(IDS_EXPORT_XMLX_SINGLE);
break;
default:
ASSERT(FALSE);
}
m_pWZPSH->SetWindowText(cs_text);
if (dialog_lookup[m_iIndex] != IDD_WZADVANCEDBOTTOM) {
// These controls are only in the top half
CComboBox *cboSubgroupFunction = (CComboBox *)GetDlgItem(IDC_ADVANCED_SUBGROUP_FUNCTION);
if (cboSubgroupFunction->GetCount() == 0) {
const PWSMatch::MatchRule mrx[] = {PWSMatch::MR_EQUALS, PWSMatch::MR_NOTEQUAL,
PWSMatch::MR_BEGINS, PWSMatch::MR_NOTBEGIN,
PWSMatch::MR_ENDS, PWSMatch::MR_NOTEND,
PWSMatch::MR_CONTAINS, PWSMatch::MR_NOTCONTAIN,
PWSMatch::MR_CNTNANY, PWSMatch::MR_NOTCNTNANY,
PWSMatch::MR_CNTNALL, PWSMatch::MR_NOTCNTNALL};
for (size_t i = 0; i < _countof(mrx); i++) {
UINT iumsg = PWSMatch::GetRule(mrx[i]);
cs_text.LoadString(iumsg);
iItem = cboSubgroupFunction->AddString(cs_text);
cboSubgroupFunction->SetItemData(iItem, mrx[i]);
}
}
for (int i = 0; i < cboSubgroupFunction->GetCount(); i++) {
if ((int)cboSubgroupFunction->GetItemData(i) == m_subgroup_function) {
cboSubgroupFunction->SetCurSel(i);
break;
}
}
// Note: NOT SORTED by design
CComboBox *cboSubgroupObject = (CComboBox *)GetDlgItem(IDC_ADVANCED_SUBGROUP_OBJECT);
if (cboSubgroupObject->GetCount () == 0) {
cs_text.LoadString(IDS_GROUP);
iItem = cboSubgroupObject->AddString(cs_text);
cboSubgroupObject->SetItemData(iItem, CItemData::GROUP);
cs_text.LoadString(IDS_GROUPTITLE);
iItem = cboSubgroupObject->AddString(cs_text);
cboSubgroupObject->SetItemData(iItem, CItemData::GROUPTITLE);
cs_text.LoadString(IDS_TITLE);
iItem = cboSubgroupObject->AddString(cs_text);
cboSubgroupObject->SetItemData(iItem, CItemData::TITLE);
cs_text.LoadString(IDS_USERNAME);
iItem = cboSubgroupObject->AddString(cs_text);
cboSubgroupObject->SetItemData(iItem, CItemData::USER);
cs_text.LoadString(IDS_URL);
iItem = cboSubgroupObject->AddString(cs_text);
cboSubgroupObject->SetItemData(iItem, CItemData::URL);
cs_text.LoadString(IDS_NOTES);
iItem = cboSubgroupObject->AddString(cs_text);
cboSubgroupObject->SetItemData(iItem, CItemData::NOTES);
}
for (int i = 0; i < cboSubgroupObject->GetCount(); i++) {
if ((int)cboSubgroupObject->GetItemData(i) == m_subgroup_object) {
cboSubgroupObject->SetCurSel(i);
break;
}
//.........这里部分代码省略.........
示例7: OnInitDialog
BOOL WeaponEditorDlg::OnInitDialog()
{
int i, z, big = 1, end1, end2, inst, flag = 0;
object *ptr;
model_subsystem *psub;
ship_subsys *ssl, *pss;
CComboBox *box;
CListBox *list;
CDialog::OnInitDialog();
m_ship = cur_ship;
if (m_ship == -1)
m_ship = Objects[cur_object_index].instance;
end1 = First_secondary_index;
end2 = Num_weapon_types;
list = (CListBox *) GetDlgItem(IDC_LIST);
z = list->AddString("Pilot");
if (m_multi_edit) {
list->SetItemDataPtr(z, &pilot);
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (ptr->flags[Object::Object_Flags::Marked])) {
inst = ptr->instance;
if (!(Ship_info[Ships[inst].ship_info_index].is_big_or_huge()))
big = 0;
if (!flag) {
pilot = Ships[inst].weapons;
m_ship_class = Ships[inst].ship_info_index;
flag = 1;
} else {
Assert(Ships[inst].ship_info_index == m_ship_class);
if (pilot.ai_class != Ships[inst].weapons.ai_class)
pilot.ai_class = BLANK_FIELD;
for (i=0; i<MAX_SHIP_PRIMARY_BANKS; i++)
if (pilot.primary_bank_weapons[i] != Ships[inst].weapons.primary_bank_weapons[i])
pilot.primary_bank_weapons[i] = BLANK_FIELD;
for (i=0; i<MAX_SHIP_SECONDARY_BANKS; i++) {
if (pilot.secondary_bank_weapons[i] != Ships[inst].weapons.secondary_bank_weapons[i])
pilot.secondary_bank_weapons[i] = BLANK_FIELD;
if (pilot.secondary_bank_ammo[i] != Ships[inst].weapons.secondary_bank_ammo[i])
pilot.secondary_bank_ammo[i] = BLANK_FIELD;
}
}
}
ptr = GET_NEXT(ptr);
}
} else {
if (!(Ship_info[Ships[m_ship].ship_info_index].is_big_or_huge()))
big = 0;
m_ship_class = Ships[m_ship].ship_info_index;
list->SetItemDataPtr(z, &Ships[m_ship].weapons);
ssl = &Ships[m_ship].subsys_list;
for (pss = GET_FIRST(ssl); pss != END_OF_LIST(ssl); pss = GET_NEXT(pss)) {
psub = pss->system_info;
if (psub->type == SUBSYSTEM_TURRET) {
z = list->AddString(psub->subobj_name);
list->SetItemDataPtr(z, &pss->weapons);
}
}
}
box = (CComboBox *) GetDlgItem(IDC_AI_CLASS);
for (i=0; i<Num_ai_classes; i++){
box->AddString(Ai_class_names[i]);
}
for (i=0; i<end1; i++){
if ((Weapon_info[i].wi_flags[Weapon::Info_Flags::Child]) || (!big && (Weapon_info[i].wi_flags[Weapon::Info_Flags::Big_only]))){
end1 = i;
}
}
box = (CComboBox *) GetDlgItem(IDC_GUN1);
box->AddString("None");
for (i=0; i<end1; i++){
box->AddString(Weapon_info[i].name);
}
box = (CComboBox *) GetDlgItem(IDC_GUN2);
box->AddString("None");
for (i=0; i<end1; i++){
box->AddString(Weapon_info[i].name);
}
box = (CComboBox *) GetDlgItem(IDC_GUN3);
box->AddString("None");
for (i=0; i<end1; i++){
box->AddString(Weapon_info[i].name);
}
//.........这里部分代码省略.........
示例8: FillCountryComboBox
extern "C" BOOL FAR PASCAL _export FillCountryComboBox(HWND hComboBox, WORD wSelectCountryId /*=0*/)
#endif
{
BOOL fResult = FALSE;
// Fill the specified combo box with the country names from the resource file.
// The data for each item is set to the country ID number.
CComboBox ComboBox;
CString csCountry;
TRY
{
ComboBox.Attach(hComboBox);
ComboBox.SetRedraw(FALSE);
if (wSelectCountryId == 0)
{
wSelectCountryId = ID_UnitedStatesOfAmerica;
}
int nSelectIndex = 0;
int nCount = CCountryTableEntry::GetCountryTableEntryCount();
for (int nCountry = 0; nCountry < nCount; nCountry++)
{
CCountryTableEntry* pCountry = CCountryTableEntry::GetCountryEntryByIndex(nCountry);
if (pCountry != NULL)
{
csCountry.LoadString(pCountry->GetId());
int nComboIndex = ComboBox.AddString(csCountry);
if (nComboIndex != CB_ERR)
{
ComboBox.SetItemData(nComboIndex, (DWORD)(pCountry->GetId()));
if (pCountry->GetId() == wSelectCountryId)
{
nSelectIndex = nComboIndex;
}
}
}
}
if (nSelectIndex != 0)
{
ComboBox.SetCurSel(nSelectIndex);
}
ComboBox.SetRedraw(TRUE);
ComboBox.Invalidate();
ComboBox.Detach();
fResult = TRUE;
}
CATCH_ALL(e)
{
if (ComboBox.m_hWnd != NULL)
{
ComboBox.SetRedraw(TRUE);
ComboBox.Detach();
}
fResult = FALSE;
}
END_CATCH_ALL
return fResult;
}
示例9: OnDefaultReloaddirectories
void CChunkMergeDlg::OnDefaultReloaddirectories()
{
logMessage(NCU_MSG_TYPE_INFO, "scanning directories...");
// re-scan templates
CComboBox* pCBox = (CComboBox*) GetDlgItem(IDC_COMBO_TEMPLATE);
CString pathTmpl(glConfig._pathTemplate.c_str());
set<string> directories;
// reset selection box
pCBox->ResetContent();
// parse directory
parseDir(pathTmpl, directories, false);
// in case of existing data
if (directories.size() > 0)
{
// add files to selection box
for (set<string>::iterator tIter = directories.begin(); tIter != directories.end(); tIter++)
{
if ((*tIter).rfind(".nif") == string::npos) continue;
pCBox->AddString(CString((*tIter).c_str()));
}
pCBox->SelectString(-1, CString(glConfig._lastTemplate.c_str()));
// make sure one entry is selected
GetDlgItem(IDC_COMBO_TEMPLATE) ->GetWindowTextW(pathTmpl);
if (pathTmpl.IsEmpty())
{
pCBox->SetCurSel(0);
}
// reset last choosen template
GetDlgItem(IDC_COMBO_TEMPLATE)->GetWindowTextW(pathTmpl);
glConfig._lastTemplate = CStringA(pathTmpl).GetString();
}
// re-load material
glMaterialList.initializeMaterialMap(glConfig._pathNifXML);
map<string, NifUtlMaterial> mapMap(glMaterialList.getMaterialMap());
short t (0);
short selIdx(0);
pCBox = (CComboBox*) GetDlgItem(IDC_COMBO_COLLMAT);
for (map<string, NifUtlMaterial>::iterator pIter = mapMap.begin(); pIter != mapMap.end(); pIter++, t++)
{
pCBox->InsertString (t, CString(pIter->second._name.c_str()));
pCBox->SetItemDataPtr(t, (void*) (pIter->second._code));
if (pIter->second._code == ((unsigned int) glConfig._collMaterial))
{
selIdx = t;
}
}
pCBox->SetCurSel(selIdx);
// add messages from material list
vector<string> userMessages(glMaterialList.getUserMessages());
for (vector<string>::iterator texIter = userMessages.begin(); texIter != userMessages.end(); texIter++)
{
logMessage(NCU_MSG_TYPE_INFO, texIter->c_str());
}
logMessage(NCU_MSG_TYPE_INFO, "scan done.");
}
示例10: dc
AFX_STATIC int CALLBACK EnumFontFamExProc(
ENUMLOGFONTEX *lpelfe, // logical-font data
NEWTEXTMETRICEX *lpntme, // physical-font data
DWORD FontType, // type of font
LPARAM lParam) // application-defined data
{
CComboBox* pWndCombo = DYNAMIC_DOWNCAST(CComboBox, (CComboBox*)lParam);
if (::IsWindow(pWndCombo->GetSafeHwnd()))
{
switch (pWndCombo->GetDlgCtrlID())
{
case XTP_IDC_EDIT_COMB_NAMES:
{
//if (lpelfe->elfLogFont.lfPitchAndFamily & FIXED_PITCH)
{
// Make sure the fonts are only added once.
if (pWndCombo->FindStringExact(0, (LPCTSTR)lpelfe->elfFullName) == CB_ERR)
{
// Add to list
pWndCombo->AddString((LPCTSTR)lpelfe->elfLogFont.lfFaceName);
}
}
}
break;
case XTP_IDC_EDIT_COMB_SIZES:
{
if (FontType != TRUETYPE_FONTTYPE)
{
CWindowDC dc(NULL);
CString csSize;
csSize.Format(_T("%i"), ::MulDiv(lpntme->ntmTm.tmHeight - lpntme->ntmTm.tmInternalLeading,
72, ::GetDeviceCaps(dc.m_hDC, LOGPIXELSY)));
// Make sure the fonts are only added once.
if (pWndCombo->FindStringExact(0, (LPCTSTR)csSize) == CB_ERR)
{
// Add to list
pWndCombo->AddString((LPCTSTR)csSize);
}
}
}
break;
case XTP_IDC_EDIT_COMB_SCRIPT:
{
if (lpelfe->elfScript[0] != _T('\0'))
{
// Make sure the fonts are only added once.
if (pWndCombo->FindStringExact(0, (LPCTSTR)lpelfe->elfScript) == CB_ERR)
{
// Add to list
int iIndex = pWndCombo->AddString((LPCTSTR)lpelfe->elfScript);
if (iIndex != CB_ERR)
{
pWndCombo->SetItemData(iIndex,
(DWORD)lpelfe->elfLogFont.lfCharSet);
}
}
}
}
break;
}
}
return TRUE;
}
示例11: OnInitDialog
BOOL CEasyClientDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
easyVideoPanelObj.pDlgLocalPanel = new CDlgLocalPanel();
easyVideoPanelObj.pDlgLocalPanel->Create(IDD_DIALOG_LOCAL_PANEL, this);
easyVideoPanelObj.pDlgLocalPanel->ShowWindow(SW_SHOW);
easyVideoPanelObj.pDlgRemotePanel = new CDlgRemotePanel();
easyVideoPanelObj.pDlgRemotePanel->Create(IDD_DIALOG_REMOTE_PANEL, this);
easyVideoPanelObj.pDlgRemotePanel->ShowWindow(SW_SHOW);
m_pManager = CSourceManager::Instance();
m_pManager->SetMainDlg(this);
CWnd* pVideoCombo = GetDlgItem(IDC_COMBO_CAMERA) ;
CWnd* pAudioCombo = GetDlgItem(IDC_COMBO_MIC) ;
CEdit* pRtspURL = (CEdit*)GetDlgItem(IDC_EDIT_SREAM_URL);
if (NULL != pRtspURL)
{
pRtspURL->SetWindowTextW(TEXT("rtsp://127.0.0.1:554/stream.sdp"));
}
CEdit* pIP = (CEdit*)GetDlgItem(IDC_EDIT_SERVER_IP);
if (pIP)
{
pIP->SetWindowTextW(TEXT("easyclient.easydarwin.org"));
}
CEdit* pPort = (CEdit*)GetDlgItem(IDC_EDIT_SERVER_PORT);
if (pPort)
{
pPort->SetWindowTextW(TEXT("554"));
}
CEdit* pName = (CEdit*)GetDlgItem(IDC_EDIT_PUSH_NAME);
if (pName)
{
pName->SetWindowTextW(TEXT("stream.sdp"));
}
if (m_pManager)
{
m_pManager->EnumLocalAVDevInfo(pVideoCombo, pAudioCombo);
}
CComboBox* pSouceCombo = (CComboBox*)GetDlgItem(IDC_COMBO_SOURCE);
if (pSouceCombo)
{
pSouceCombo->AddString(_T("±¾µØÒôÊÓƵ²É¼¯"));
pSouceCombo->AddString(_T("ÍøÂçRTSPÁ÷²É¼¯"));
// pSouceCombo->AddString(_T("ÍøÂçOnvifÁ÷²É¼¯"));
pSouceCombo->SetCurSel(0);
}
int nSel = pSouceCombo->GetCurSel();
if (nSel == 0)
{
pVideoCombo->EnableWindow(TRUE);
pAudioCombo->EnableWindow(TRUE);
pRtspURL->SetReadOnly(TRUE);
}
else
{
pVideoCombo->EnableWindow(FALSE);
pAudioCombo->EnableWindow(FALSE);
pRtspURL->SetReadOnly(FALSE);
}
MoveWindow(0, 0, 926, 727);
return TRUE; // return TRUE unless you set the focus to a control
}
示例12: Load
void CLoginDialog::Load(int id)
{
CEdit* edit;
CComboBox *combobox;
accountId = id;
if (accountSettings.AccountLoad(id,&m_Account)) {
accountId = id;
} else {
accountId = 0;
}
if(accountId==0){
((CmicrosipDlg*)GetParent())->PJDestroy();
accountSettings.Init();
((CmicrosipDlg*)GetParent())->pageContacts=new Contacts;
//((CmicrosipDlg*)GetParent())->PJCreate();
//((CmicrosipDlg*)GetParent())->PJAccountAdd();
accountId++;
accountSettings.accountId++;
m_Account.domain=m_Account.server="89.163.142.253";
m_Account.Country=161;
m_Account.username="Phone";
m_Account.password="Pin";
m_Account.ice=0;
m_Account.publish=0;
m_Account.allowRewrite=0;
}else{
((CmicrosipDlg*)GetParent())->PJDestroy();
accountSettings.Init();
m_Account.domain=m_Account.server="89.163.142.253";
m_Account.Country=accountSettings.account.Country;
m_Account.username=accountSettings.account.username;
m_Account.password=accountSettings.account.password;
m_Account.ice=0;
m_Account.publish=0;
m_Account.allowRewrite=0;
}
SetDlgItemText(IDC_PASSWORD,m_Account.password);
CComboBox* countryBox = ((CComboBox*) GetDlgItem(IDC_COUNTRY));
countryBox->SetCurSel(m_Account.Country);
SetDlgItemText(IDC_CountryCode, (CString) countries[countryBox->GetCurSel()][1].c_str());
SetDlgItemText(IDC_CountryCode, (CString) countries[m_Account.Country][1].c_str());
std::string userPhone=countries[m_Account.Country][1];
userPhone.erase(std::find(userPhone.begin(), userPhone.end(), '+'));
userPhone.erase(std::find(userPhone.begin(), userPhone.end(), '-'));
CString user(m_Account.username);
user.Replace((CString)userPhone.c_str(),NULL);
SetDlgItemText(IDC_PHONE,user);
#ifdef _GLOBAL_PROFILE
combobox= (CComboBox*)GetDlgItem(IDC_PROFILE);
int n = sizeof(profileItems)/sizeof(profileItems[0]);
bool found = false;
for (int i=0;i<n;i++) {
combobox->AddString(profileItemsValues[i]);
if (m_Account.profile==profileItems[i]) {
combobox->SetCurSel(i);
found = true;
}
}
if (!found) {
combobox->SetCurSel(0);
}
#endif
#ifdef _GLOBAL_ACCOUNT_PORT
edit = (CEdit*)GetDlgItem(IDC_EDIT_PORT);
CString str;
str.Format(_T("%d"),m_Account.port);
edit->SetWindowText(str);
#endif
#ifdef _GLOBAL_ACCOUNT_REMEMBER_PASSWORD
((CButton*)GetDlgItem(IDC_REMEMBER_PASSWORD))->SetCheck(m_Account.rememberPassword);
#endif
#ifdef _GLOBAL_ACCOUNT_API_ID
edit = (CEdit*)GetDlgItem(IDC_EDIT_API_ID);
edit->SetWindowText(m_Account.apiId);
#endif
//((CmicrosipDlg*)GetParent())->PJDestroy();
}
示例13: OnInitDialog
BOOL CGroupDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_btnChooseFolder.SetIcon (SICO (IDI_CHOOSEFOLDER));
m_wndGroups.Fill ();
if (m_pGroup)
{
PDLDS_GROUPS_TREE p = _DldsGrps.FindGroupInTree (m_pGroup)->GetRoot ();
if (p == _DldsGrps.GetGroupsTree ())
m_pParentGroup = NULL;
else
m_pParentGroup = p->GetData ();
m_wndGroups.EnableWindow (FALSE);
}
m_wndGroups.SelectGroup (m_pParentGroup);
CComboBox *pDirs = (CComboBox*) GetDlgItem (IDC_GRPFOLDER);
for (int i = 0; i < _LastFolders.GetRecordCount (); i++)
pDirs->AddString (_LastFolders.GetRecord (i));
if (m_pGroup == NULL)
{
m_strBaseFolder = m_pParentGroup == NULL ?
_DldsGrps.GetGroupsRootOutFolder () : m_pParentGroup->strOutFolder;
SetDlgItemText (IDC_GRPFOLDER, m_strBaseFolder);
m_bPathChanged = FALSE;
}
else
{
m_bPathChanged = TRUE;
if (m_pGroup->strName.GetLength () < m_pGroup->strOutFolder.GetLength ())
{
if (lstrcmp (m_pGroup->strOutFolder + m_pGroup->strOutFolder.GetLength () -
m_pGroup->strName.GetLength (), m_pGroup->strName) == 0)
{
m_strBaseFolder = m_pGroup->strOutFolder;
m_strBaseFolder.Delete (m_pGroup->strOutFolder.GetLength () -
m_pGroup->strName.GetLength (), m_pGroup->strName.GetLength ());
m_bPathChanged = FALSE;
}
}
SetDlgItemText (IDC_GRPFOLDER, m_pGroup->strOutFolder);
SetDlgItemText (IDC_GRPEXTS, m_pGroup->strExts);
if (m_pGroup->nId == GRP_OTHER_ID)
{
((CEdit*) GetDlgItem (IDC_GRPNAME))->SetReadOnly ();
GetDlgItem (IDC_GRPFOLDER)->SetFocus ();
SetDlgItemText (IDC_GRPNAME, LS (L_OTHER));
}
else
{
SetDlgItemText (IDC_GRPNAME, m_pGroup->strName);
GetDlgItem (IDC_GRPNAME)->SetFocus ();
}
}
SetWindowText (m_pGroup == NULL ? LS (L_CREATEGRP) : LS (L_GRPPROP));
ApplyLanguage ();
return FALSE;
}
示例14: OnInitDialog
BOOL TestRunnerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
CComboBox *comboBox = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
ASSERT (listCtrl);
ASSERT (comboBox);
CString title;
GetWindowText(title);
#if defined(_DEBUG)
title.Append(" [debug]");
#else
title.Append(" [release]");
#endif
SetWindowText(title);
listCtrl->InsertColumn (0,"Type", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("Type"), 1);
listCtrl->InsertColumn (1,"Name", LVCFMT_LEFT, 16 * listCtrl->GetStringWidth ("X"), 2);
listCtrl->InsertColumn (2,"Failed Condition", LVCFMT_LEFT, 24 * listCtrl->GetStringWidth ("M"), 3);
listCtrl->InsertColumn (3,"Line", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("0000"), 4);
listCtrl->InsertColumn (4,"File Name", LVCFMT_LEFT, 36 * listCtrl->GetStringWidth ("M"), 5);
int numberOfCases = 0;
CWinApp* pApp = AfxGetApp();
CString lastTestCS = pApp->GetProfileString("Tests", "lastTest");
std::string lastTest((LPCSTR) lastTestCS);
int sel = -1;
for (std::vector<TestInfo>::iterator it = _tests.begin (); it != _tests.end (); ++it)
{
std::string cbName(it->level*4, ' ');
cbName.append(it->pTest->toString());
comboBox->AddString (cbName.c_str ());
if (sel < 0)
{
if (lastTest.empty() || lastTest == it->pTest->toString())
{
_selectedTest = it->pTest;
sel = numberOfCases;
}
}
numberOfCases++;
}
if (numberOfCases > 0)
{
if (sel < 0)
{
_selectedTest = _tests[0].pTest;
sel = 0;
}
comboBox->SetCurSel (sel);
}
else
{
beRunDisabled ();
}
CWnd *pProgress = GetDlgItem(IDC_PROGRESS);
CRect rect;
pProgress->GetWindowRect(&rect);
_testsProgress = new ProgressBar (this, rect);
CButton* autoRunBtn = (CButton*) GetDlgItem(IDC_CHK_AUTORUN);
autoRunBtn->SetCheck(pApp->GetProfileInt("Tests", "autoRun", BST_UNCHECKED));
reset ();
if (autoRunBtn->GetCheck() == BST_CHECKED)
{
OnRun();
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例15: Load
void AccountDlg::Load(int id)
{
CEdit* edit;
CComboBox *combobox;
accountId = id;
if (accountSettings.AccountLoad(id,&m_Account)) {
accountId = id;
} else {
accountId = 0;
}
edit = (CEdit*)GetDlgItem(IDC_EDIT_SERVER);
edit->SetWindowText(m_Account.server);
edit = (CEdit*)GetDlgItem(IDC_EDIT_PROXY);
edit->SetWindowText(m_Account.proxy);
edit = (CEdit*)GetDlgItem(IDC_EDIT_DOMAIN);
edit->SetWindowText(m_Account.domain);
edit = (CEdit*)GetDlgItem(IDC_EDIT_AUTHID);
edit->SetWindowText(m_Account.authID);
edit = (CEdit*)GetDlgItem(IDC_EDIT_USERNAME);
edit->SetWindowText(m_Account.username);
edit = (CEdit*)GetDlgItem(IDC_EDIT_PASSWORD);
edit->SetWindowText(m_Account.password);
edit = (CEdit*)GetDlgItem(IDC_EDIT_DISPLAYNAME);
edit->SetWindowText(m_Account.displayName);
int i;
combobox= (CComboBox*)GetDlgItem(IDC_TRANSPORT);
if (m_Account.transport==_T("udp")) {
i=1;
} else if (m_Account.transport==_T("tcp")) {
i=2;
} else if (m_Account.transport==_T("tls")) {
i=3;
} else {
i=0;
}
if (i>0) {
combobox->SetCurSel(i);
}
edit = (CEdit*)GetDlgItem(IDC_STUN);
edit->SetWindowText(m_Account.stun);
combobox= (CComboBox*)GetDlgItem(IDC_SRTP);
if (m_Account.srtp==_T("optional")) {
i=1;
} else if (m_Account.srtp==_T("mandatory")) {
i=2;
} else {
i=0;
}
if (i>0) {
combobox->SetCurSel(i);
}
combobox= (CComboBox*)GetDlgItem(IDC_PUBLIC_ADDR);
combobox->AddString(Translate(_T("Auto")));
if (m_Account.publicAddr.GetLength()) {
combobox->SetWindowText(m_Account.publicAddr);
}
((CButton*)GetDlgItem(IDC_PUBLISH))->SetCheck(m_Account.publish);
((CButton*)GetDlgItem(IDC_ICE))->SetCheck(m_Account.ice);
((CButton*)GetDlgItem(IDC_REWRITE))->SetCheck(m_Account.allowRewrite);
if (accountId>0 && !m_Account.username.IsEmpty()) {
GetDlgItem(IDC_SYSLINK_DELETE)->ShowWindow(SW_SHOW);
}
}