本文整理汇总了C++中String_256::MakeMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ String_256::MakeMsg方法的具体用法?C++ String_256::MakeMsg怎么用?C++ String_256::MakeMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String_256
的用法示例。
在下文中一共展示了String_256::MakeMsg方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateUniqueLayerID
String_256 LayerManager::CreateUniqueLayerID()
{
// We can't generate a unique id if there is no current spread
ENSURE(CurrentSpread != NULL, "There is no current spread");
String_256 UniqueLayerID;
INT32 NumLayers = 0;
ListItem* Lyr = LyrDetList.GetHead();
// Calculate how many layers are on the current spread, we must ignore layers
// which have been deleted.
while (Lyr != NULL)
{
if (!((LyrDetails*)Lyr)->Deleted) // Don't count deleted layers
{
NumLayers++;
}
Lyr = LyrDetList.GetNext(Lyr);
}
ENSURE(NumLayers != 0, "The current spread has no layers");
INT32 NewLayerNum = NumLayers+1;
BOOL Unique; // Flag used to indicate if the id generated is unique or not
do
{
// Construct a first attempt at a unique layer id 'Layer n'
// where n = the number of layers on the current spread + 1
UniqueLayerID.MakeMsg(_R(IDS_LAYERMGR_LAYERNAME),NewLayerNum);
// Check that UniqueLayerID is indeed unique
Unique = TRUE; // Until we know better
Lyr = LyrDetList.GetHead();
while (Lyr != NULL)
{
if (!((LyrDetails*)Lyr)->Deleted) // Ignore deleted layers
{
if (UniqueLayerID == ((LyrDetails*)Lyr)->Status.StringLayerID)
{
Unique = FALSE;
// UniqueLayerID is not unique so increment NewLayerNum and try again
NewLayerNum++;
break;
}
}
Lyr = LyrDetList.GetNext(Lyr); // Get the next layer
}
} while (!Unique);
return(UniqueLayerID);
}
示例2: Write
/********************************************************************************************
> INT32 HTMLExportFilter::Write(DocCoord dcToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)
Author: Graham_Walmsley (Xara Group Ltd) <[email protected]>
Created: 9/4/97
Inputs: pcToWrite The coordinate to write
pfileToWrite The file to write to (may be NULL)
pcBuffer The text buffer to write to (may be NULL)
Returns: The number of TCHARs written
Purpose: Writes the coordinate to the file, separated by
a comma:
200,100
********************************************************************************************/
INT32 HTMLExportFilter::Write(DocCoord dcToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)
{
//Format our coords
String_256 strFormat;
strFormat.MakeMsg(_R(IDS_HTMLEXPORT_COORDFORMAT), dcToWrite.x, dcToWrite.y);
//And write it out
return Write(strFormat, pfileToWrite, pcBuffer);
}
示例3: WriteNumber
/********************************************************************************************
> INT32 HTMLExportFilter::Write(INT32 lToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)
Author: Graham_Walmsley (Xara Group Ltd) <[email protected]>
Created: 9/4/97
Inputs: lToWrite The number to write
pfileToWrite The file to write to (may be NULL)
pcBuffer The text buffer to write to (may be NULL)
Returns: The number of TCHARs written
Purpose: Writes the number to the file
********************************************************************************************/
INT32 HTMLExportFilter::WriteNumber(INT32 lToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)
{
//Format our number
String_256 strFormat;
strFormat.MakeMsg(_R(IDS_HTMLEXPORT_NUMBERFORMAT), lToWrite);
//And write it out
return Write(strFormat, pfileToWrite, pcBuffer);
}
示例4: OnDownloadFail
void OpGenericDownload::OnDownloadFail()
{
//First get a pointer to the parameters
GenericDownloadParam* pGenParam = (GenericDownloadParam*) pParam;
if (pGenParam==NULL)
{
ERROR2RAW("OpBitmapDownload::OnDownloadFail - no download parameters");
return;
}
//Get the URL which the user typed
String_256 strURL=pGenParam->strURL;
//And put it up as a message
String_256 strMessage;
strMessage.MakeMsg(_R(IDS_HTML_DOWNLOADFAILED), &strURL);
Error::SetError(0, strMessage, 0);
InformError();
}
示例5: CheckForSubIndexes
BOOL LibraryFile::CheckForSubIndexes(SuperGallery *ParentGal, PathName *Path, SGLibType Type, BOOL Updated)
{
// The directory given had no XaraInfo\index.txt file, maybe it's a sublib, check
// For defaults...
String_256 DefaultIndex;
String_256 IndexDesc;
BOOL CanGenerate;
BOOL ok = TRUE;
// Need to reset the Quiet status before a stream of Library::Init calls
ParentLibraryGallery->SetQuietStatus(FALSE);
if(GetSubIndexDetails(ParentLibraryGallery, &DefaultIndex, &IndexDesc, &CanGenerate))
{
String_256 SubP(Path->GetPath(TRUE)); // "%s\\XaraInfo\\%s"
SubP += String_16(_R(IDS_LIBRARIES_XARAINFO_DIRNAME));
SubP += TEXT("\\") + DefaultIndex;
PathName SubPath(SubP);
if(!SubPath.IsValid())
{
ERROR3("LibraryFile::CheckForSubIndexes invalid subpath");
return FALSE;
}
BOOL Generate = FALSE;
BOOL Found = FALSE;
// Is there a default sub index ?
Found = SGLibOil::FileExists(&SubPath);
if(!Found && CanGenerate)
{
if(Library::RemoteIndexes && GenerateIndexFile::IsDirectoryReadOnly(Path))
{
// Check whether there's a 'temporary' index for this directory, and
// possibly use that instead of the read only directory...
String_256 RemoteLocationOfIndex;
BOOL Existing = GenerateIndexFile::CheckForRemote(Path, &RemoteLocationOfIndex);
if(Existing)
{
String_256 SubP(RemoteLocationOfIndex); // %s\\XaraInfo\\%s
SGLibOil::AppendSlashIfNotPresent(&SubP);
SubP += String_16(_R(IDS_LIBRARIES_XARAINFO_DIRNAME));
SubP += TEXT("\\") + DefaultIndex;
PathName TmpSubPath(SubP);
Found = SGLibOil::FileExists(&TmpSubPath);
// OK, so there's a remote index sitting pretty in the user's temporary
// location... Use that and don't bother generating a new one...
if(Found)
{
SubPath.SetPathName(SubP);
Path->SetPathName(RemoteLocationOfIndex);
}
}
}
if(!Found)
{
// tell the user that there is no index file, and ask if they want one generating
String_256 WarnMsg;
String_256 TmpPath(SubPath.GetLocation(FALSE));
LibraryFile::TidyUpSubPath(&TmpPath);
WarnMsg.MakeMsg(_R(IDS_LIBRARY_NO_INDEX_FILE_GEN), (TCHAR *)IndexDesc, (TCHAR *)TmpPath);
Error::SetError(0, WarnMsg, 0);
//INT32 ButtonPressed = InformMessage(0, _R(IDS_NOTHUMBNAILS), _R(IDS_THUMBNAILS), _R(IDS_CANCEL)/*, _R(IDS_HELP)*/);
INT32 ButtonPressed = InformMessage(0, _R(IDS_CREATE), _R(IDS_CANCEL));
Error::ClearError();
if(ButtonPressed < 2)
{
// Generate an index...
String_64 Author(PRODUCT_NAME);
Generate = GenerateDefaultIndex(&SubPath, Path, &Author, Type, TRUE);
ok = TRUE;
}
else
{
// Cancel or help clicked
ok = FALSE;
}
}
}
if(!Found && !CanGenerate)
{
// tell the user that there is no index file, and give them a cancel...
String_256 WarnMsg;
String_256 TmpPath(SubPath.GetLocation(FALSE));
LibraryFile::TidyUpSubPath(&TmpPath);
WarnMsg.MakeMsg(_R(IDS_LIBRARY_NO_INDEX_FILE), (TCHAR *)IndexDesc, (TCHAR *)TmpPath);
Error::SetError(0, WarnMsg, 0);
INT32 ButtonPressed = InformWarning(0, _R(IDS_CANCEL), NULL);
Error::ClearError();
ok = FALSE;
}
//.........这里部分代码省略.........
示例6: Init
INT32 LibraryFile::Init(SuperGallery *ParentGal, PathName *APath, SGLibType Type, BOOL Updated, BOOL DoScroll)
{
#ifndef EXCLUDE_GALS
if(ParentGal == NULL || APath == NULL || !Libraries.IsEmpty())
{
ERROR3("LibraryFile::Init - NULL parameters are illegal OR Init called > 1 times");
if(!Libraries.IsEmpty())
return(Libraries.GetCount());
else
return 0;
}
BOOL ok = TRUE;
// Tidy up Path a bit
String_256 OurPath(APath->GetPath());
LibraryFile::TidyUpSubPath(&OurPath);
// Now point Path to the new pathname
PathName ModifiedPath(OurPath);
PathName *Path = &ModifiedPath;
if(!ModifiedPath.IsValid())
{
ERROR3("LibraryFile::Init -> Modified library path is invalid");
return 0;
}
// Remember the pathname and type
MyPath = *Path;
MyType = Type;
ParentGallery = ParentGal;
if(ParentGallery->IsKindOf(CC_RUNTIME_CLASS(LibraryGallery)))
ParentLibraryGallery = (LibraryGallery *)ParentGal;
else
{
ERROR3("LibraryFile::Init passed a non-library gallery - yikes...");
return 0;
}
// Need to reset the Quiet status before a stream of Library::Init calls
ParentLibraryGallery->SetQuietStatus(FALSE);
BOOL Retry = TRUE;
while(Retry)
{
Retry = FALSE;
// Would be nice to have a way of adding a file to a path in PathName... Is there one ?
if(!SGLibOil::FileExists(Path))
{
// We're opening the font gallery, but can't find the font library path - don't warn
if(Type == SGLib_Font)
return 0;
// tell the user that the directory doesn't exist
String_256 WarnMsg;
String_256 DefaultIndex;
String_256 IndexDesc;
BOOL CanGenerate;
ok = LibraryFile::GetSubIndexDetails(ParentLibraryGallery, &DefaultIndex, &IndexDesc, &CanGenerate);
String_256 TmpPath(Path->GetLocation(FALSE));
LibraryFile::TidyUpSubPath(&TmpPath);
// Taken out by Graham 30/10/97: If the gallery had no directory specified,
//we used to throw a warning which said "do you want to specify another folder?"
//We don't do this any more, because the default is to open all galleries empty and
//then download stuff from the Xara web site
#if 0
WarnMsg.MakeMsg(_R(IDS_BROWSE_OR_SCAN), (TCHAR *)IndexDesc, (TCHAR *)TmpPath);
Error::SetError(0, WarnMsg, 0);
INT32 ButtonPressed = InformWarning(0, _R(IDS_BROWSE), _R(IDS_RETRY), _R(IDS_CANCEL)/*, _R(IDS_HELP)*/);
#else // WEBSTER
INT32 ButtonPressed = 3;
#endif // WEBSTER
TRACEUSER( "Richard", _T("ButtonPressed: %d\n"), ButtonPressed);
Error::ClearError();
switch(ButtonPressed)
{
case 1:
{
// Open the Browse dialog (or the Add.. dialog as it seems to be called now)
PathName ThePath(*Path);
// This returns FALSE if Cancel was hit, or an error occurred.
if(!SGLibOil::GetLibPath(ParentLibraryGallery, &ThePath, CanGenerate, Type))
{
ERROR3("GetLibPath returned FALSE in LF::Init");
return 0;
}
else
{
ModifiedPath = ThePath;
if(!ModifiedPath.IsValid())
{
ERROR3("LibraryFile::Init -> scanned library path is invalid");
return 0;
//.........这里部分代码省略.........
示例7: SetBackgroundFromPage
BOOL BitmapPreviewData::SetBackgroundFromPage(CCDiskFile &DiskFile, Spread * pSpread)
{
String_256 s; // to contain the generated html strings
// If the user has not specified a spead then assume the selected spread in the current doc
if (pSpread == NULL)
{
// get the current doc
Document *pDoc = Document::GetCurrent();
ERROR3IF(pDoc == NULL, "No Current Document");
if (pDoc == NULL)
return FALSE;
pSpread = pDoc->GetSelectedSpread();
}
// get the page colour, or bitmap fill
KernelBitmap *pPageBmp = NULL;
DocColour *pPageColour = NULL;
OpBackground::GetPageColour(pSpread, &pPageBmp, &pPageColour);
BOOL Ok = TRUE;
// check for a bitmap page background first
if (pPageBmp != NULL) // the page background was a bitmap
{
// check if we haven't exported that bitmap before
if (pPagePath == NULL)
{
// alocate the path name
pPagePath = new PathName;
if (pPagePath)
{
// create a new temporary file
Ok = FileUtil::GetTemporaryPathName( _T("gif"), pPagePath);
}
else
Ok = FALSE;
}
// check if we have a valid path
if (Ok) Ok = pPagePath->IsValid();
// export the background bitmap into the a file
if (Ok && ExportBrowserTypeBitmap(pPageBmp, pPagePath))
{
// everything went ok, so add the link in the html file
s.MakeMsg(_R(IDS_HTML_BGIMAGE), (const TCHAR *)pPagePath->GetFileName());
DiskFile.write(s);
}
return Ok;
}
// If we recovered a page background colour then use that
// otherwise Page is by default white so set this as a background
BOOL AllocatedColour = FALSE;
if (pPageColour == NULL)
{
// Neither colour nor bitmap.
AllocatedColour = TRUE;
pPageColour = new DocColour(COLOUR_WHITE); // default colour of a page (white)
}
// convert to a browser colour
String_32 col;
if (ComposeHTMLColour(pPageColour,col))
{
// output the background colour
s.MakeMsg(_R(IDS_HTML_BGCOLOUR), (TCHAR *)col);
DiskFile.write(s);
}
else
Ok = FALSE;
if (AllocatedColour && pPageColour != NULL)
delete pPageColour;
return Ok;
}
示例8: OnMouseMove
void PushTool::OnMouseMove(DocCoord dcPoint, Spread* pSpread, ClickModifiers mods)
{
#ifdef RALPH
//Graham 20/9/96.
//We need to check if the zoom tool's over a Hot Link. If it is, the cursor changes
//to a pointing hand.
//The one exception is if CTRL is pressed, in which case the cursor is the
//normal Push tool cursor (Disabled at the moment)
//First, try and find a node with a Hot Link
AttrUser* pHotLinkNode= (AttrUser*) DocView::FindHotLinkNode(dcPoint);
if (pHotLinkNode && !(mods.Constrain))
{
//Yes. So change the cursor to a pointing hand
ChangeCursor(Cursor::PointingHand);
//And now to update the status bar of the browser
//So first get a pointer to the document
//And a pointer to the Ralph document...
Document* ThisDoc=Document::GetSelected();
RalphDocument* ThisRalphDoc=ThisDoc->GetRalphDoc();
ERROR3IF(ThisRalphDoc==NULL, "DocView::OnMouseMoveWithNoTool has no Ralph Doc");
//Then get the base URL of this Ralph document as a Web Address
WebAddress wBase(ThisRalphDoc->GetBaseURL());
//And get the URL of this node as a Web Address
WebAddress wEmbedded(pHotLinkNode->GetWebAddress());
//This function makes wEmbedded into an absolute URL (if necessary)
wEmbedded.Combine(wBase);
//Make the Web Address into a normal string
String_256 strEmbedded=wEmbedded.GetWebAddress();
//And put that URL into the status bar string
String_256 sPushTool;
sPushTool.MakeMsg(_R(IDS_PUSHTOOL_HOTLINK), (TCHAR*) strEmbedded);
//And tell the Ralph document to show the string in the browser's status
//bar
ThisRalphDoc->SetStatusBar(&sPushTool);
}
else
{
//No, the cursor is not over a Hot Link or CTRL is pressed
//Change the cursor to the standard Push tool cursor
//and display a standard message in the browser status bar
ChangeCursor(pcPushCursor);
String_256 StringToPass(_R(IDS_RALPH_PUSHTOOLSTR));
DocView::SetBrowserStatusBar(&StringToPass);
}
#endif //RALPH
#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
if (this!=NULL)
{
String_256 text("");
if (text.Load(_R(IDS_PUSHTOOL_STATUSHELP)))
GetApplication()->UpdateStatusBarText(&text);
}
else
ERROR3("PushTool::OnMouseMove() - this==NULL");
#endif
}