本文整理汇总了C++中TextArea::appendText方法的典型用法代码示例。如果您正苦于以下问题:C++ TextArea::appendText方法的具体用法?C++ TextArea::appendText怎么用?C++ TextArea::appendText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextArea
的用法示例。
在下文中一共展示了TextArea::appendText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char * argv[])
{
Font *font(FontFactory::create(
(unsigned char*)_binary_sans_set_bin_start,
(unsigned char*)_binary_sans_map_bin_start));
TextAreaFactory::setFont(font);
//TextAreaFactory::usePaletteData((const char*)_binary_vera_pal_bin_start, 32);
Keyboard * keyBoard = new Keyboard();
ScrollPane scrollPane;
keyBoard->setTopLevel(&scrollPane);
#if 1
TextField * tf = new TextField("Enter the value here. This line is too big to fit in");
TextField * passwd = new TextField(std::string());
RichTextArea * rich = (RichTextArea*)TextAreaFactory::create(TextAreaFactory::TXT_RICH);
Button * goBtn = new Button("Go");
rich->appendText("This is some long text ");
passwd->setSize(60,18);
scrollPane.setTopLevel();
scrollPane.add(rich);
scrollPane.add(passwd);
scrollPane.add(goBtn);
scrollPane.setSize(Canvas::instance().width(),Canvas::instance().height());
scrollPane.add(tf);
scrollPane.setScrollIncrement(13);
#else
RichTextArea * rich = (RichTextArea*)TextAreaFactory::create(TextAreaFactory::TXT_RICH);
TextArea * t = TextAreaFactory::create();
EditableTextArea * t2 = (EditableTextArea*)TextAreaFactory::create(TextAreaFactory::TXT_EDIT);
// t2->setBackgroundColor(Color(31,31,0));
ScrollPane * subPane = new ScrollPane;
subPane->add(t2);
subPane->setTopLevel(false);
subPane->setSize(Canvas::instance().width(),Canvas::instance().height());
subPane->setScrollIncrement(t2->font().height());
subPane->setStretchChildren(true);
ComboBox * emptyCombo = new ComboBox();
ComboBox * oneValCombo = new ComboBox();
ComboBox * combo = new ComboBox();
combo->setSize(60, 18);
ComboBox * combo2 = new ComboBox();
combo2->setSize(90, 18);
std::string str("Hello World");
Button * b1 = new Button(str);
str = "Combo box!";
oneValCombo->addItem(str);
combo->addItem(str);
combo2->addItem(str);
combo2->addItem(str);
str = "Another One - with very wide text";
Button * b2 = new Button(str);
combo->addItem(str);
combo2->addItem(str);
combo2->addItem(str);
str = "Three- wide, but fixed width";
Button * b3 = new Button(str);
b3->setSize(60, 18);
combo2->addItem(str);
combo2->addItem(str);
str = "Go";
Button * b4 = new Button(str);
//b4->setSize(6*13, 10);
str = "Last one!";
Button * b5 = new Button(str);
combo->addItem(str);
combo2->addItem(str);
combo2->addItem(str);
t2->setListener(keyBoard);
str = "A text field that has a very, very long and pointless string";
TextField * tf1 = new TextField(str);
tf1->setSize(160, 18);
tf1->setListener(keyBoard);
combo2->addItem(str);
TextArea * rbLabel = TextAreaFactory::create();
str = "Radio button label.";
rbLabel->appendText(str);
TextArea * cbLabel = TextAreaFactory::create();
str = "CheckBox label.";
cbLabel->appendText(str);
RadioButton * rb = new RadioButton();
RadioButton * rb2 = new RadioButton();
RadioButton * rb3 = new RadioButton();
CheckBox * cb = new CheckBox();
ButtonGroup bg;
bg.add(rb);
bg.add(rb2);
bg.add(rb3);
keyBoard->setTopLevel(&scrollPane);
//.........这里部分代码省略.........