本文整理汇总了C++中Paragraph类的典型用法代码示例。如果您正苦于以下问题:C++ Paragraph类的具体用法?C++ Paragraph怎么用?C++ Paragraph使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Paragraph类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetParagraph
LPDISPATCH Change::GetParagraph()
{
Paragraph *pPara = new Paragraph;
pPara->Init(m_hWnd, m_lParagraph, m_pDoc);
return pPara->GetIDispatch(FALSE);
}
示例2: updateMessageText
/*
* Update Message in Message Window
*/
void updateMessageText( const std::string text )
{
//Dialog Test
Component* root = getGameView();
if(!root) {
//happens while in menu.
std::cerr << "Root not found.\n";
return;
}
while( root->getParent() )
root = root->getParent();
Desktop* desktop = dynamic_cast<Desktop*> (root);
if(!desktop) {
std::cerr << "Root not a desktop!?!\n";
return;
}
try {
//test if message Windows is open
Component* messageTextComponent = 0;
messageTextComponent = root->findComponent( "messageText" );
if(messageTextComponent == 0) {
messageTextComponent = loadGUIFile("gui/messagearea.xml");
assert(messageTextComponent != 0);
desktop->addChildComponent(messageTextComponent);
}
Paragraph* messageText = getParagraph(*messageTextComponent, "messageText");
messageText->setText( text );
} catch(std::exception& e) {
std::cerr << "Couldn't display message '" << text << "': "
<< e.what() << "\n";
return;
}
}
示例3: updateDate
void updateDate()
{
std::ostringstream dateText;
int day = total_time % NUMOF_DAYS_IN_MONTH +1; // 1..NUMOF_DAYS_IN_MONTH
day = 1 + ( 29 * day / NUMOF_DAYS_IN_MONTH ); // 1..30
dateText << day << ". ";
dateText << current_month( total_time );
dateText << " "<< current_year( total_time );
Component* root = getGameView();
if( !root ) return;
while( root->getParent() )
root = root->getParent();
if( dateText.str() == lastDateText ){
return;
}
Component* dateParagraphComponent = 0;
dateParagraphComponent = root->findComponent( "dateParagraph" );
if( dateParagraphComponent == 0 )
{ return;}
Paragraph* dateParagraph = getParagraph( *root, "dateParagraph");
if( !dateParagraph )
{ return;}
dateParagraph->setText( dateText.str() );
lastDateText = dateText.str();
}
示例4: loadGUIFile
void Dialog::askRocket(){
if( !desktop ) {
std::cerr << "No desktop found.\n";
return;
}
try {
myDialogComponent = loadGUIFile( "gui/launch_rocket_yn.xml" );
assert( myDialogComponent != 0);
registerDialog();
blockingDialogIsOpen = true;
iAmBlocking = true;
} catch(std::exception& e) {
std::cerr << "Couldn't display message 'launch_rocket_yn': "
<< e.what() << "\n";
return;
}
Paragraph* p = getParagraph( *myDialogComponent, "DialogTitle" );
std::stringstream title;
title << _("Launchsite") << " ( " << pointX <<" , " << pointY << " )";
p->setText( title.str() );
// connect signals
Button* yesButton = getButton( *myDialogComponent, "Yes" );
yesButton->clicked.connect( makeCallback(*this, &Dialog::okayLaunchRocketButtonClicked ) );
Button* noButton = getButton( *myDialogComponent, "No" );
noButton->clicked.connect( makeCallback( *this, &Dialog::closeDialogButtonClicked ) );
Button* gotoButton = getButton( *myDialogComponent, "goto" );
gotoButton->clicked.connect( makeCallback( *this, &Dialog::gotoButtonClicked ) );
}
示例5: loadGUIFile
void Dialog::editMarket(){
if( !desktop ) {
std::cerr << "No desktop found.\n";
return;
}
try {
myDialogComponent = loadGUIFile( "gui/tradedialog.xml" );
assert( myDialogComponent != 0);
registerDialog();
blockingDialogIsOpen = true;
iAmBlocking = true;
} catch(std::exception& e) {
std::cerr << "Couldn't display dialog 'tradedialog.xml': "
<< e.what() << "\n";
return;
}
// set Dialog to Market-Data
Paragraph* p = getParagraph( *myDialogComponent, "DialogTitle" );
std::stringstream title;
title << _("Market") << " ( " << pointX <<" , " << pointY << " )";
p->setText( title.str() );
Market * market = static_cast <Market *> (world(pointX, pointY)->reportingConstruction);
CheckButton* cb;
cb = getCheckButton( *myDialogComponent, "BuyJobs" );
if( market->commodityRuleCount[Construction::STUFF_JOBS].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellJobs" );
if( market->commodityRuleCount[Construction::STUFF_JOBS].give ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "BuyFood" );
if( market->commodityRuleCount[Construction::STUFF_FOOD].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellFood" );
if( market->commodityRuleCount[Construction::STUFF_FOOD].give ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "BuyCoal" );
if( market->commodityRuleCount[Construction::STUFF_COAL].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellCoal" );
if( market->commodityRuleCount[Construction::STUFF_COAL].give ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "BuyOre" );
if( market->commodityRuleCount[Construction::STUFF_ORE].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellOre" );
if( market->commodityRuleCount[Construction::STUFF_ORE].give ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "BuyGoods" );
if( market->commodityRuleCount[Construction::STUFF_GOODS].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellGoods" );
if( market->commodityRuleCount[Construction::STUFF_GOODS].give ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "BuySteel" );
if( market->commodityRuleCount[Construction::STUFF_STEEL].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellSteel" );
if( market->commodityRuleCount[Construction::STUFF_STEEL].give) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "BuyWaste" );
if( market->commodityRuleCount[Construction::STUFF_WASTE].take ) cb->check(); else cb->uncheck();
cb = getCheckButton( *myDialogComponent, "SellWaste" );
if( market->commodityRuleCount[Construction::STUFF_WASTE].give) cb->check(); else cb->uncheck();
// connect signals
Button* applyButton = getButton( *myDialogComponent, "Apply" );
applyButton->clicked.connect( makeCallback(*this, &Dialog::applyMarketButtonClicked ) );
Button* gotoButton = getButton( *myDialogComponent, "goto" );
gotoButton->clicked.connect( makeCallback( *this, &Dialog::gotoButtonClicked ) );
}
示例6: while
Paragraph Paragraph::operator+(const Paragraph &p1){
Paragraph p = *this;
Node_S * iterator = p1.head;
while(iterator){
p.append(iterator->data);
iterator = iterator->next;
}
return p;
}
示例7: insert
void LxDcViCtl::insert(TCHAR* src, size_t count, size_t src_font, COLORREF src_color, size_t phy_pgh_index, size_t pos_global, size_t pos_inner)
{
//在cursor处执行插入操作
Paragraph* pgh = document.get_pgh(phy_pgh_index);
pgh->Insert(pos_inner, src, count);
font_tree.insert(pos_global, count, src_font);
color_tree.insert(pos_global, count, src_color);
}
示例8: Paragraph
Paragraph Paragraph::rest(){
Node_S * iterator = head->next;
Paragraph p = Paragraph();
while(iterator){
p.append(iterator->data);
iterator = iterator->next;
}
return p;
}
示例9: getParagraph
void Dialog::setParagraph( const std::string paragraphName, const std::string text ){
Paragraph* p;
try{
p = getParagraph( *myDialogComponent, paragraphName );
p->setText( text );
} catch(std::exception& e) {
std::cerr << "Couldn't set " << paragraphName << " to '" << text << "': "
<< e.what() << "\n";
}
}
示例10: copy
Paragraph Paragraph::copy() const
{
Paragraph p;
p.m_p->sPstyle = m_p->sPstyle;
for (int i=0;i<textNodeCount();i++)
p.addTextNode(textNode(i).copy());
return p;
}
示例11: read_stream_int
void Document::build_from_stream(FILE* file)
{
int pgh_cnt = read_stream_int(file);
for (int i = 0; i < pgh_cnt; i++)
{
Paragraph* pgh = new Paragraph();
add_paragraph(pgh);
pgh->build_from_stream(file);
}
}
示例12:
void
ParagraphLayout::SetParagraph(const Paragraph& paragraph)
{
fTextSpans = paragraph.TextSpans();
fParagraphStyle = paragraph.Style();
_Init();
fLayoutValid = false;
}
示例13: fTextSpans
ParagraphLayout::ParagraphLayout(const Paragraph& paragraph)
:
fTextSpans(paragraph.TextSpans()),
fParagraphStyle(paragraph.Style()),
fWidth(0.0f),
fLayoutValid(false),
fGlyphInfos(),
fLineInfos()
{
_Init();
}
示例14:
nuiTextLayout::~nuiTextLayout()
{
for (uint32 p = 0; p < mpParagraphs.size(); p++)
{
Paragraph* pParagraph = mpParagraphs[p];
for (uint32 l = 0; l < pParagraph->size(); l++)
{
nuiTextLine* pLine = (*pParagraph)[l];
delete pLine;
}
delete pParagraph;
}
}
示例15: SkipBefore
void DocReport::Put(const Paragraph& p) {
if(dortf) rtf.Put(p);
SkipBefore(p.GetBefore());
if(valrects) {
int y = ypos;
Vector<ValueRect> v;
p.GetValueRects(1024, *this, lm, y, pgsz.cx - lm, v);
AddVR(v);
}
Paragraph::PaintInfo pi;
while(p.Paint(*this, lm, ypos, pgsz.cx - lm, GetYLim(), pi))
Page();
SetYPos(pi.ypos);
SkipAfter(p.GetAfter());
}