本文整理汇总了C++中TextLine::text_down方法的典型用法代码示例。如果您正苦于以下问题:C++ TextLine::text_down方法的具体用法?C++ TextLine::text_down怎么用?C++ TextLine::text_down使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextLine
的用法示例。
在下文中一共展示了TextLine::text_down方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: choiceRev
//.........这里部分代码省略.........
selectionTxt.SetPosition(0, y);
GuiText upTxt("c", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
upTxt.SetPosition(0, y -20);
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
GuiText * Entrie[number];
for(i=0; i < number && i < (signed)versions.line.size(); i++)
{
Entrie[i] = new GuiText(versions.line[i].c_str(), 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
Entrie[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
Entrie[i]->SetPosition(0, y);
y += place;
}
promptWindow.Append(&dialogBoxImg);
promptWindow.Append(&titleTxt);
promptWindow.Append(&selectionTxt);
for(int x=0; x < i; x++)
promptWindow.Append(Entrie[x]);
if((signed)versions.line.size() >= number)
{
promptWindow.Append(&upTxt);
promptWindow.Append(&downTxt);
}
promptWindow.SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_IN, 50);
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while(!stop)
{
usleep(100);
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
{
selection--;
if(selection < 0)
{
selection = 0;
int z = versions.text_up();
for(int x=0; x < i; x++)
Entrie[x]->SetText(versions.line[x + z].c_str());
}
selectionTxt.SetPosition(0, selection * place + selctionPos);
HaltResumeGui();
usleep(100000);
}
if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
{
selection++;
if(selection > number -1)
{
selection = number -1;
int z = versions.text_down(number);
for(int x=0; x < i; x++)
Entrie[x]->SetText(versions.line[x + z].c_str());
}
selectionTxt.SetPosition(0, selection * place + selctionPos);
HaltResumeGui();
usleep(100000);
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A)
{
rev = versions.line[selection + versions.textScrollPos];
stop = true;
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
stop = true;
}
promptWindow.SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_OUT, 50);
while(promptWindow.GetEffect() > 0) usleep(100);
HaltGui();
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
ResumeGui();
return rev;
}
示例2: promptWindow
//.........这里部分代码省略.........
int i = 0;
int y = 90;
int place = 25;
int number = 7;
GuiText upTxt("c", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
upTxt.SetFont(symbol_ttf, symbol_ttf_size);
upTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
upTxt.SetPosition(0, y -20);
GuiText downTxt("d", 22, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
downTxt.SetFont(symbol_ttf, symbol_ttf_size);
downTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
downTxt.SetPosition(0, y + (place * (number-1)) + 15);
GuiText * Entrie[number];
for(i=0; i < number && i < (signed)revtext.line.size(); i++)
{
Entrie[i] = new GuiText(revtext.line[i].c_str(), 20, (GXColor) {Theme.text_1, Theme.text_2, Theme.text_3, 255});
Entrie[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
Entrie[i]->SetPosition(50, y);
y += place;
}
GuiText titleTxt(tr("Info"), 26, (GXColor){Theme.text_1, Theme.text_2, Theme.text_3, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,40);
GuiText backTxt(tr("OK"), 22, (GXColor){Theme.button_small_text_1, Theme.button_small_text_2, Theme.button_small_text_3, 255});
GuiImage backImg(&btnOutline);
GuiImage backImgOver(&btnOutlineOver);
GuiButton back(btnOutline.GetWidth(), btnOutline.GetHeight());
back.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
back.SetPosition(0, -25);
back.SetLabel(&backTxt);
back.SetImage(&backImg);
back.SetImageOver(&backImgOver);
back.SetTrigger(&trigA);
back.SetState(STATE_SELECTED);
promptWindow.Append(&dialogBoxImg);
promptWindow.Append(&titleTxt);
for(int x=0; x < i; x++)
promptWindow.Append(Entrie[x]);
if((signed)revtext.line.size() >= number)
{
promptWindow.Append(&upTxt);
promptWindow.Append(&downTxt);
}
promptWindow.Append(&back);
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while(!stop)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP)
{
int z = revtext.text_up();
for(int x=0; x < i; x++)
Entrie[x]->SetText(revtext.line[x + z].c_str());
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
{
int z = revtext.text_down(number);
for(int x=0; x < i; x++)
Entrie[x]->SetText(revtext.line[x + z].c_str());
HaltResumeGui();
}
if(back.GetState() == STATE_CLICKED)
stop = true;
}
HaltGui();
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
ResumeGui();
}
示例3: in
//.........这里部分代码省略.........
for(int x=0; x < i; x++)
promptWindow.Append(Entrie[x]);
if((signed)meta.line.size() >= number)
{
promptWindow.Append(&upTxt);
promptWindow.Append(&downTxt);
}
promptWindow.Append(&back);
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while(choice == -1)
{
usleep(100);
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP)
{
startline = meta.text_up();
for(int x=0; x < i; x++)
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
HaltResumeGui();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN
|| WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN)
{
startline = meta.text_down(number);
for(int x=0; x < i; x++)
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
HaltResumeGui();
}
if(back.GetState() == STATE_CLICKED)
choice = 0;
for(int x=0; x < i; x++)
{
if(Entrie[x]->GetState() == STATE_CLICKED)
{
Entrie[x]->ResetState();
string temp = meta.line[x + startline];
while((signed)temp.find("\n") != -1)
temp.replace(temp.find("\n"), 1, "¶");
char new_text[256];
sprintf (new_text, "%s", temp.c_str());
OnScreenKeyboard(new_text, 256, true);
mainWindow->SetState(STATE_DISABLED);
promptWindow.SetState(STATE_DEFAULT);
if(strcasecmp(new_text,"NULL") != 0 )
{
changed = true;
meta.line[x + startline] = new_text;
while((signed)meta.line[x + startline].find("¶") != -1)
meta.line[x + startline].replace(meta.line[x + startline].find("¶"), 1, "\n");
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
quelltext.clear();
for(int a = 0; a < (signed)meta.line.size(); a++)
quelltext += meta.line[a];
meta.text(quelltext, 18, 440);
for(int x=0; x < i; x++)
EntrieTxt[x]->SetText(meta.line[x + startline].c_str());
}
break;
}
}
}
if(changed)
{
ofstream datei(dir.c_str());
datei << quelltext;
// for(int i = 0; i < (signed)meta.line.size(); i++)
// datei << meta.line[i];
}
HaltGui();
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
ResumeGui();
return choice;
}