本文整理汇总了C++中CField::Replace方法的典型用法代码示例。如果您正苦于以下问题:C++ CField::Replace方法的具体用法?C++ CField::Replace怎么用?C++ CField::Replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CField
的用法示例。
在下文中一共展示了CField::Replace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitScreen
void CGameForm::InitScreen() {
UInt16 player_names[] = {MainP0NameField,
MainP1NameField,
MainP2NameField,
MainP3NameField};
if ( gManager->CutThroat() == true ) {
player_names[2] = player_names[3];
}
for ( Int16 i = 0; i < gManager->numPlayers; i++ ) {
names[i].Attach(this, player_names[i]);
names[i].Replace((const char *)gManager->players[i]->getName() );
if ( gManager->CutThroat() == true ) {
CString foo;
foo.Format("%d pts", gManager->scores[i]);
if ( i == 1 || i == 2 ) {
CField tmpscore;
if ( i == 1 ) {
tmpscore.Attach(this, MainP1ScoreField);
}
else {
tmpscore.Attach(this, MainP3ScoreField);
}
tmpscore.Replace(foo);
}
else {
CString tmp = gManager->players[i]->getName() + ": " + foo;
names[i].Replace( tmp );
}
}
}
bidder_name.Attach(this, MainBidderField);
bidder_name.Replace( (const char *)(*gManager->tbl->winning_bidder)->getName() );
if ( gManager->CutThroat() == false ) {
ns_score.Attach(this, MainNSScoreField);
ew_score.Attach(this, MainEWScoreField);
char score0str[4];
char score1str[4];
StrPrintF(score0str, "%d", gManager->scores[0] );
StrPrintF(score1str, "%d", gManager->scores[1] );
ns_score.Replace( score0str );
ew_score.Replace( score1str );
}
else {
FrmHideObject( FrmGetActiveForm(), FrmGetObjectIndex( FrmGetActiveForm(), NSScoreLabel ) );
FrmHideObject( FrmGetActiveForm(), FrmGetObjectIndex( FrmGetActiveForm(), EWScoreLabel ) );
}
played_cards.Attach(this, MainPlayedCardsGadget );
played_cards.CurrentTrick(gManager->trk);
player_hand.Attach(this, MainPlayerHandGadget );
player_hand.CurrentTrick(gManager->trk);
player_hand.CurrentPlayer(gManager->players[gManager->humanIndex]);
}