本文整理汇总了C++中TSTR::printf方法的典型用法代码示例。如果您正苦于以下问题:C++ TSTR::printf方法的具体用法?C++ TSTR::printf怎么用?C++ TSTR::printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSTR
的用法示例。
在下文中一共展示了TSTR::printf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSubMtlSlotName
TSTR CompositeMat::GetSubMtlSlotName(int i) {
TSTR name;
if (i== 0)
name.printf(_T("%s"),GetString(IDS_PW_BASE));
else name.printf(_T("%s %d"),GetString(IDS_PW_MAT),i);
return name;
}
示例2: PaintNameListLabel
void WeightTableWindow::PaintNameListLabel()
{
HDC hdc;
PAINTSTRUCT ps;
BeginPaint(hNameListLabel,&ps);
EndPaint(hNameListLabel,&ps);
iNameListLabelBuf->Erase();
hdc = iNameListLabelBuf->GetDC();
HFONT hOldFont = (HFONT)SelectObject(hdc, hFixedFont);
SelectObject(hdc,pTextPen);
int x = 0;
int y = 0;
x = 0;
y = 0;
TSTR vertName;
if (GetFlipFlopUI())
{
vertName.printf("%s",GetString(IDS_PW_BONEID));
PaintCellName(hdc,x,y,buttonWidth,FALSE,TEXT_LEFT_JUSTIFIED,vertName);
}
else
{
vertName.printf("%s",GetString(IDS_PW_VERTEXID));
PaintCellName(hdc,x,y,vertNameWidth,FALSE,TEXT_LEFT_JUSTIFIED,vertName);
}
SelectObject(hdc,GetStockObject(BLACK_PEN));
SelectObject(hdc, hOldFont);
iNameListLabelBuf->Blit();
}
示例3: GetLocalName
TSTR CompositeMatPBAccessor::GetLocalName(ReferenceMaker* owner, ParamID id, int tabIndex)
{
CompositeMat* p = (CompositeMat*)owner;
TSTR out;
switch (id)
{
case compmat_amount:
{
out.printf(_T("%s %d"),GetString(IDS_PW_AMOUNT),tabIndex+1);
break;
}
case compmat_mtls:
{
TSTR name;
Mtl *sm1 = NULL;
Interval iv;
if ((p) && (p->pblock2)) p->pblock2->GetValue(compmat_mtls,0,sm1,iv,tabIndex);
name = sm1->GetFullName();
if (tabIndex == 0)
{
out.printf(_T("%s: %s"),GetString(IDS_PW_BASE),name);
}
else
{
out.printf(_T("%s %d: %s"),GetString(IDS_RB_MATERIAL2),tabIndex,name);
}
break;
}
}
return out;
}
示例4: OnInitDialog
BOOL CMorphAnimationTimePage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// set step and description text
m_stepStatic.SetWindowText(m_strStep);
CString str;
str.LoadString(m_nDescriptionID);
m_descriptionStatic.SetWindowText(str);
// set the time values
TSTR strValue;
strValue.printf(_T("%d"), m_startFrame);
m_startFrameEdit.SetWindowText(strValue);
strValue.printf(_T("%d"), m_endFrame);
m_endFrameEdit.SetWindowText(strValue);
strValue.printf(_T("%d"), m_displacement);
m_displacementEdit.SetWindowText(strValue);
strValue.printf(_T("%d"), m_fps);
m_fpsEdit.SetWindowText(strValue);
return TRUE;
}
示例5: CheckObjectIntegrity
BOOL TriObject::CheckObjectIntegrity()
{
for (int i=0; i<mesh.getNumFaces(); i++) {
for (int j=0; j<3; j++) {
if (mesh.faces[i].v[j] >= (DWORD)mesh.getNumVerts()) {
TSTR buf;
buf.printf(GetResString(IDS_DB_TRIOBJ_DESC),
i,j,mesh.faces[i].v[j],mesh.getNumVerts(), mesh.faces, mesh.getNumFaces());
MessageBox(NULL,buf,GetResString(IDS_DB_INVALID_FACE),MB_ICONEXCLAMATION|MB_TASKMODAL|MB_OK);
return FALSE;
}
}
}
if (mesh.tvFace) {
for (int i=0; i<mesh.getNumFaces(); i++) {
for (int j=0; j<3; j++) {
if (mesh.tvFace[i].t[j] >= (DWORD)mesh.numTVerts) {
TSTR buf;
buf.printf(GetResString(IDS_DB_TV_DESC), i,j,mesh.tvFace[i].t[j],mesh.numTVerts);
MessageBox(NULL,buf,GetResString(IDS_DB_INVALID_TV_FACE),MB_ICONEXCLAMATION|MB_TASKMODAL|MB_OK);
return FALSE;
}
}
}
}
return TRUE;
}
示例6: MaxMsgBox
void Unreal3DExport::ShowSummary()
{
// Progress
pInt->ProgressUpdate(Progress);
// Display Summary
if( bShowPrompts )
{
ProgressMsg.printf(GetString(IDS_INFO_SUMMARY)
, hAnim.NumFrames
, hData.NumPolys
, hData.NumVertices);
if( bMaxResolution )
{
TSTR buf;
buf.printf(GetString(IDS_INFO_DIDPRECISION)
, FileName);
ProgressMsg += buf;
}
MaxMsgBox(pInt->GetMAXHWnd(),ProgressMsg.data(),ShortDesc(),MB_OK|MB_ICONINFORMATION);
}
}
示例7: UpdateUI
void ParticleMesherObject::UpdateUI()
{
Point3 min,max;
pblock2->GetValue(particlemesher_customboundsa,0,min,FOREVER);
pblock2->GetValue(particlemesher_customboundsb,0,max,FOREVER);
Box3 box;
box.Init();
box += min;
box += max;
TSTR text;
BOOL useBounds;
pblock2->GetValue(particlemesher_usecustombounds, 0, useBounds, FOREVER);
if (useBounds)
{
if (box.IsEmpty())
text.printf(_T("%s"),GetString(IDS_EMPTY));
else
{
text.printf(_T("(%0.0f,%0.0f,%0.0f)"),min.x,min.y,min.z);
SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT),
text);
text.printf(_T("(%0.0f,%0.0f,%0.0f)"),max.x,max.y,max.z);
SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT2),
text);
}
//make sure we only enable the button in the modify panel
// bug 257747 1/30/01 watje
if (ip)
{
ICustButton *iBut = GetICustButton(GetDlgItem(hParams,IDC_PICKBB));
if (ip->GetCommandPanelTaskMode()==TASK_MODE_MODIFY)
{
if (iBut) iBut->Enable(TRUE);
}
ReleaseICustButton(iBut);
}
}
else
{
text.printf(_T(" "));
SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT),
text);
text.printf(_T(" "));
SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT2),
text);
ICustButton *iBut = GetICustButton(GetDlgItem(hParams,IDC_PICKBB));
if (iBut) iBut->Enable(FALSE);
ReleaseICustButton(iBut);
}
}
示例8: MAXException
void Unreal3DExport::WriteModel()
{
// Progress
pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_WRITE));
// Open data file
fMesh = _tfopen(ModelFileName,_T("wb"));
if( !fMesh )
{
ProgressMsg.printf(GetString(IDS_ERR_FMODEL),ModelFileName);
throw MAXException(ProgressMsg.data());
}
// Open anim file
fAnim = _tfopen(AnimFileName,_T("wb"));
if( !fAnim )
{
ProgressMsg.printf(GetString(IDS_ERR_FANIM),AnimFileName);
throw MAXException(ProgressMsg.data());
}
// data headers
hData.NumPolys = Tris.Count();
hData.NumVertices = VertsPerFrame;
// anim headers
hAnim.FrameSize = VertsPerFrame * sizeof(FMeshVert);
hAnim.NumFrames = FrameCount;
// Progress
CheckCancel();
pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_WMESH));
// Write data
fwrite(&hData,sizeof(FJSDataHeader),1,fMesh);
if( Tris.Count() > 0 )
{
fwrite(Tris.Addr(0),sizeof(FJSMeshTri),Tris.Count(),fMesh);
}
Progress += U3D_PROGRESS_WMESH;
// Progress
CheckCancel();
pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_WANIM));
// Write anim
fwrite(&hAnim,sizeof(FJSAnivHeader),1,fAnim);
if( Verts.Count() > 0 )
{
fwrite(Verts.Addr(0),sizeof(FMeshVert),Verts.Count(),fAnim);
}
Progress += U3D_PROGRESS_WANIM;
}
示例9: UpdateDialog
void EditFaceDataMod::UpdateDialog () {
TSTR buf;
int numFaces=0, whichFace=0;
float value = 1.0f;
bool valueDetermined = true;
if (!hParams) return;
ModContextList mcList;
INodeTab nodes;
ip->GetModContexts(mcList,nodes);
if (selLevel) {
for (int i = 0; i < mcList.Count(); i++) {
EditFaceDataModData *meshData = (EditFaceDataModData*)mcList[i]->localData;
if (!meshData) continue;
int numSelectedHere;
meshData->DescribeSelection (numSelectedHere, whichFace, value, valueDetermined);
numFaces += numSelectedHere;
}
}
ISpinnerControl *spin = GetISpinner (GetDlgItem (hParams, IDC_VALUE_SPIN));
ICustButton *but = GetICustButton (GetDlgItem (hParams, IDC_RESET_SELECTION));
switch (selLevel) {
case SEL_FACE:
if (numFaces==1) {
buf.printf (GetString(IDS_FACE_SELECTED), whichFace+1);
} else {
if (numFaces) buf.printf (GetString (IDS_FACES_SELECTED), numFaces);
else buf = GetString (IDS_NO_FACE_SELECTED);
}
but->Enable (numFaces);
spin->Enable (numFaces);
if (numFaces && valueDetermined) {
spin->SetIndeterminate (false);
spin->SetValue (value, FALSE);
} else {
spin->SetIndeterminate (true);
}
break;
case SEL_OBJECT:
buf = GetString (IDS_OBJECT_SELECTED);
spin->Disable();
but->Disable ();
break;
}
SetDlgItemText(hParams,IDC_FACE_SELECTED,buf);
ReleaseISpinner (spin);
ReleaseICustButton (but);
}
示例10: PopupErrorMessage
void BaseExposeControl::PopupErrorMessage()
{
if(exposeTransform) //should exist if not and this message is popping up then we're scewed.
{
INode *expNode = exposeTransform->GetExposeNode();
INode *node = exposeTransform->GetMyNode();
if(expNode&&node)
{
TSTR msg; msg.printf(GetString(IDS_ILLEGAL_SELF_REFERENCE),expNode->GetName(),node->GetName(),node->GetName());
if (GetCOREInterface()->GetQuietMode())
{
GetCOREInterface()->Log()->LogEntry(SYSLOG_WARN,NO_DIALOG,GetString(IDS_ILLEGAL_CYCLE),msg);
}
else
{
// beep or no??MessageBeep(MB_ICONEXCLAMATION);
MessageBox(GetCOREInterface()->GetMAXHWnd(),msg,GetString(IDS_ILLEGAL_CYCLE),
MB_ICONEXCLAMATION | MB_APPLMODAL | MB_OK);
}
}
//suspend the hold
BOOL resume =FALSE;
if(theHold.Holding())
{
theHold.Suspend();
resume =TRUE;
}
exposeTransform->SetExposeNode(NULL);
if(resume)
theHold.Resume();
}
}
示例11: GetParamString
void CMethodInfo::GetParamString(TSTR& str)
{
str = _T("");
int numParams = GetNumParams();
CParamInfo *pParamInfo = 0;
if (m_invkind == INVOKE_FUNC)
{
for( int iParam = 0; iParam < numParams; iParam++ )
{
pParamInfo = m_apParamInfo[iParam];
str += ((pParamInfo->m_flags & PARAMFLAG_FOUT) ? TSTR(_T(" &")) : TSTR(_T(" "))) +
pParamInfo->GetName() + _T(":") + pParamInfo->m_strType;
}
}
else
{
TSTR buf(_T(" "));
if (numParams > ((m_invkind == INVOKE_PROPERTYGET) ? 0 : 1))
{
pParamInfo = m_apParamInfo[0];
buf.printf(_T("[%s:%s] "), pParamInfo->GetName(), pParamInfo->m_strType);
}
str.printf(_T("%s: %s"), buf,
m_strReturn.isNull() ? m_apParamInfo[0]->m_strType : m_strReturn);
if (m_dispid == DISPID_VALUE) str += _T(", default");
if (m_isHidden)
str += _T(", hidden");
}
}
示例12: GetTargetPoint
void
SpotLightFalloffManipulator::UpdateShapes(TimeValue t, TSTR& toolTip)
{
GenLight* pLight = (GenLight*) mhTarget;
Matrix3 tm;
tm = mpINode->GetObjectTM(t);
Point3 pt;
float dist;
BOOL b = GetTargetPoint(t, pt);
if (!b) {
dist = pLight->GetTDist(t);
} else {
float den = FLength(tm.GetRow(2));
dist = (den!=0) ? FLength(tm.GetTrans()-pt) / den : 0.0f;
}
TSTR nodeName;
nodeName = mpINode->GetName();
toolTip.printf("%s [Falloff: %5.2f]", nodeName.data(),
(double) pLight->GetFallsize(t));
SetGizmoScale(dist / kRingScaleFactor);
ConeAngleManipulator::SetValues(Point3(0,0,0),
Point3(0,0,-1),
dist,
DegToRad(pLight->GetFallsize(t)),
pLight->GetSpotShape() == RECT_LIGHT,
pLight->GetAspect(t));
}
示例13: AddDefaultActionToBar
BOOL UnwrapMod::AddDefaultActionToBar(ICustToolbar *toolBar, int id)
{
int numOps = NumElements(spActions)/3;
UnwrapAction *wtActions = NULL;
int ct = 0;
for (int i =0; i < numOps; i++)
{
int testid, ids1, ids2;
testid = spActions[ct++];
ids1 = spActions[ct++];
ids2 = spActions[ct++];
if (testid == id)
{
TSTR name;
name.printf(_T("%s"),GetString(ids2));
int l = name.Length();
toolBar->AddTool(ToolButtonItem(CTB_PUSHBUTTON,0, 0, 0, 0, 16, 15, l*8, 22, id));
ICustButton *but = toolBar->GetICustButton(id);
but->SetHighlightColor(GREEN_WASH);
but->SetTooltip(TRUE,GetString(ids1));
but->SetImage(NULL,0,0,0,0,0,0);
but->SetText(GetString(ids2));
ReleaseICustButton(but);
i = numOps;
return TRUE;
}
}
return FALSE;
}
示例14: CreateNewMesh
bool BakeRadiosity::CreateNewMesh (INode *orgNode,
Mesh *orgMesh,
Matrix3 orgMtx)
{
if((orgNode == NULL)||(orgMesh == NULL)){
DebugPrint(_T("Mesh error\n"));
return false;
}
// Creates an instance of a registered class.
Object *newObj = (Object*)(ip->CreateInstance(
GEOMOBJECT_CLASS_ID,
Class_ID(TRIOBJ_CLASS_ID, 0)));
if(newObj == NULL){
DebugPrint(_T("CreateInstance error\n"));
return false;
}
// Creates a new node in the scene with the given object.
INode *newNode = ip->CreateObjectNode(newObj);
if(newNode == NULL){
DebugPrint(_T("CreateObjectNode error\n"));
return false;
}
// Sets the name of the node.
if(keepOrgFlag != true){
newNode->SetName(orgNode->GetName());
} else {
TSTR newName;
newName.printf(_T("%s_BAKED"), orgNode->GetName());
newNode->SetName(newName);
}
// Sets the renderer material used by the node.
newNode->SetMtl(orgNode->GetMtl());
// Returns a reference to the mesh data member of new TriObject.
TriObject *newTriObj = (TriObject *)newObj;
Mesh &newMesh = newTriObj->GetMesh();
// Returns the number of vertices from original mesh.
int nbVert = orgMesh->getNumVerts();
// Sets the number of geometric vertices in the new mesh.
newMesh.setNumVerts(nbVert);
// The loop will continue until handling all vertices...
for(int i=0; i<nbVert; i++) {
newMesh.verts[i] = orgMtx * orgMesh->verts[i];//Set new vertices
}
// Returns the number of faces in the original mesh.
int nbFace = orgMesh->getNumFaces();
// Sets the number of faces in the new mesh
// and previous faces are discarded.
newMesh.setNumFaces(nbFace, FALSE);
// The loop will continue until handling all faces...
for(int i=0; i<nbFace; i++){ // Set new faces and Material id
newMesh.faces[i] = orgMesh->faces[i];
newMesh.faces[i].setMatID(orgMesh->faces[i].getMatID());
}
// Makes a complete copy of the specified channels
// of the original Mesh object into new Mesh.
newMesh.DeepCopy(orgMesh, CNVERT_CHANNELS);
return true;
}
示例15: PaintCellAttribute
void WeightTableWindow::PaintCellAttribute(HDC hdc, int x, int y, BOOL sel, int state)
{
HBRUSH textBackground;
DWORD textColor;
DWORD textBKColor;
SIZE strSize;
if (sel)
{
textBackground = GetSysColorBrush(COLOR_HIGHLIGHT);
textColor = GetSysColor(COLOR_HIGHLIGHTTEXT) ;
textBKColor = GetSysColor(COLOR_HIGHLIGHT) ;
SelectObject(hdc, hFixedFontBold);
}
else
{
textBackground = ColorMan()->GetBrush(kWindow );
textColor = ColorMan()->GetColor(kWindowText ) ;
textBKColor = ColorMan()->GetColor(kWindow ) ;
SelectObject(hdc, hFixedFont);
}
SetTextColor(hdc, textColor);
SelectObject(hdc, textBackground);
SetBkColor(hdc, textBKColor);
SelectObject(hdc,pBackPen);
TSTR stateStr;
if (state == STATE_CHECKED)
stateStr.printf("X");
else if (state == STATE_INDETERMIANT)
stateStr.printf("-");
else stateStr.printf(" ");
int offset;
GetTextExtentPoint32(hdc, (LPCTSTR) stateStr, stateStr.Length(), (LPSIZE) &strSize );
if (GetFlipFlopUI())
offset = vertNameWidth/2 - strSize.cx/2;
else offset = textHeight/2 - strSize.cx/2;
if (GetFlipFlopUI())
Rectangle(hdc, x, y,x+vertNameWidth+1,y+textHeight+1);
else Rectangle(hdc, x, y,x+textHeight+1,y+textHeight+1);
TextOut(hdc, x+offset,y+1,stateStr,stateStr.Length());
}