本文整理汇总了C++中LLTextEditor::setWordWrap方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextEditor::setWordWrap方法的具体用法?C++ LLTextEditor::setWordWrap怎么用?C++ LLTextEditor::setWordWrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextEditor
的用法示例。
在下文中一共展示了LLTextEditor::setWordWrap方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postBuild
BOOL LLFloaterTOS::postBuild()
{
childSetAction("Continue", onContinue, this);
childSetAction("Cancel", onCancel, this);
childSetCommitCallback("agree_chk", updateAgree, this);
if ( mType != TOS_TOS )
{
// this displays the critical message
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
editor->setHandleEditKeysDirectly( TRUE );
editor->setEnabled( FALSE );
editor->setWordWrap(TRUE);
editor->setFocus(TRUE);
editor->setValue(LLSD(mMessage));
return TRUE;
}
// disable Agree to TOS radio button until the page has fully loaded
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
tos_agreement->setEnabled( false );
// hide the SL text widget if we're displaying TOS with using a browser widget.
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
editor->setVisible( FALSE );
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
bool use_web_browser = false;
//Check to see if the message is a link to display
std::string token = "http://";
std::string::size_type iIndex = mMessage.rfind(token);
//IF it has http:// in it, we use the web browser
if(iIndex != std::string::npos && mMessage.length() >= 2)
{
// it exists
use_web_browser = true;
}
else if (gHippoGridManager->getConnectedGrid()->isSecondLife())
{
//Its SL, use the browser for it as thats what it should do
use_web_browser = true;
}
if ( web_browser && use_web_browser)
{
web_browser->addObserver(this);
gResponsePtr = LLIamHere::build( this );
LLHTTPClient::get( getString( "real_url" ), gResponsePtr );
}
return TRUE;
}
示例2: postBuild
BOOL LLFloaterTOS::postBuild()
{
childSetAction("Continue", onContinue, this);
childSetAction("Cancel", onCancel, this);
childSetCommitCallback("agree_chk", updateAgree, this);
if ( mType != TOS_TOS )
{
llinfos << "tos_type != TOS_TOS" << llendl;
// this displays the critical message
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
editor->setHandleEditKeysDirectly( TRUE );
editor->setEnabled( FALSE );
editor->setWordWrap(TRUE);
editor->setFocus(TRUE);
// editor->setValue(LLSD(mMessage));
editor->setValue(mMessage);
return TRUE;
}
// disable Agree to TOS radio button until the page has fully loaded
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
tos_agreement->setEnabled( false );
// hide the SL text widget if we're displaying TOS with using a browser widget.
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
editor->setVisible(FALSE);
LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
if ( web_browser )
{
// start to observe it so we see navigate complete events
web_browser->addObserver( this );
gResponsePtr = LLIamHereTOS::build( this );
LLHTTPClient::head( getString( "real_url" ), gResponsePtr );
}
return TRUE;
}
示例3: postBuild
BOOL LLFloaterPostcard::postBuild()
{
childSetAction("cancel_btn", onClickCancel, this);
childSetAction("send_btn", onClickSend, this);
childDisable("from_form");
childSetAction("publish_help_btn", onClickPublishHelp, this);
if (gAgent.isTeen())
{
// Disable these buttons if they are PG (Teen) users
childDisable("allow_publish_check");
childHide("allow_publish_check");
childDisable("publish_help_btn");
childHide("publish_help_btn");
childDisable("mature_check");
childHide("mature_check");
}
LLString name_string;
gAgent.buildFullname(name_string);
childSetValue("name_form", LLSD(name_string));
LLTextEditor *MsgField = LLUICtrlFactory::getTextEditorByName(this, "msg_form");
if (MsgField)
{
MsgField->setWordWrap(TRUE);
// For the first time a user focusess to .the msg box, all text will be selected.
MsgField->setFocusChangedCallback(onMsgFormFocusRecieved, this);
}
childSetFocus("to_form", TRUE);
return TRUE;
}
示例4: postBuild
BOOL LLFloaterPostcard::postBuild()
{
childSetAction("cancel_btn", onClickCancel, this);
childSetAction("send_btn", onClickSend, this);
childDisable("from_form");
std::string name_string;
gAgent.buildFullname(name_string);
childSetValue("name_form", LLSD(name_string));
LLTextEditor* MsgField = getChild<LLTextEditor>("msg_form");
if (MsgField)
{
MsgField->setWordWrap(TRUE);
// For the first time a user focusess to .the msg box, all text will be selected.
MsgField->setFocusChangedCallback(onMsgFormFocusRecieved, this);
}
childSetFocus("to_form", TRUE);
return TRUE;
}
示例5: form
//.........这里部分代码省略.........
LLTextBox* caution_box = NULL;
if (mIsCaution && !mIsTip)
{
S32 caution_height = ((S32)sFont->getLineHeight() * 2) + VPAD;
caution_box = new LLTextBox(
std::string("caution_box"),
LLRect(x, y, getRect().getWidth() - 2, caution_height),
LLStringUtil::null,
sFont,
FALSE);
caution_box->setFontStyle(LLFontGL::BOLD);
caution_box->setColor(gColors.getColor("NotifyCautionWarnColor"));
caution_box->setBackgroundColor(gColors.getColor("NotifyCautionBoxColor"));
caution_box->setBorderVisible(FALSE);
caution_box->setWrappedText(notification->getMessage());
addChild(caution_box);
// adjust the vertical position of the next control so that
// it appears below the caution textbox
y = y - caution_height;
}
else if (mIsCaution && mIsTip)
{
const S32 BTN_TOP = BOTTOM_PAD + (((mNumOptions-1+2)/3)) * (BTN_HEIGHT+VPAD);
// Tokenization on \n is handled by LLTextBox
const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE + DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title.
text = new LLTextEditor(std::string("box"), LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16), MAX_LENGTH, message, sFont, FALSE);
text->setWordWrap(TRUE);
text->setTabStop(FALSE);
text->setMouseOpaque(FALSE);
text->setBorderVisible(FALSE);
text->setTakesNonScrollClicks(FALSE);
text->setHideScrollbarForShortDocs(TRUE);
text->setReadOnlyBgColor ( LLColor4::transparent ); // the background color of the box is manually
// rendered under the text box, therefore we want
// the actual text box to be transparent
text->setReadOnlyFgColor ( gColors.getColor("NotifyCautionWarnColor") ); //sets caution text color for tip notifications
text->setEnabled(FALSE); // makes it read-only
text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard)
addChild(text);
}
else
{
const S32 BTN_TOP = BOTTOM_PAD + (((mNumOptions-1+2)/3)) * (BTN_HEIGHT+VPAD);
// Tokenization on \n is handled by LLTextBox
const S32 MAX_LENGTH = 512 + 20 +
DB_FIRST_NAME_BUF_SIZE +
DB_LAST_NAME_BUF_SIZE +
DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title.
text = new LLTextEditor(std::string("box"),
LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16),
MAX_LENGTH,
message,
sFont,
FALSE);
text->setWordWrap(TRUE);
text->setTabStop(FALSE);
text->setMouseOpaque(FALSE);
示例6: semi_transparent
//.........这里部分代码省略.........
{
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
std::string("notify_box_icon.tga"));
}
icon->setMouseOpaque(FALSE);
addChild(icon);
x += HPAD + HPAD + ICON_WIDTH;
// If we have inventory with this message, leave room for the name.
S32 box_bottom = BTN_TOP + (mHasInventory ? (LINE_HEIGHT + 2*VPAD) : 0);
text = new LLViewerTextEditor(std::string("box"),
LLRect(x, y, RIGHT, box_bottom),
DB_GROUP_NOTICE_MSG_STR_LEN,
LLStringUtil::null,
LLFontGL::sSansSerif,
FALSE);
static const LLStyleSP headerstyle(new LLStyle(true,LLColor4::black,"SansSerifBig"));
static const LLStyleSP datestyle(new LLStyle(true,LLColor4::black,"serif"));
text->appendStyledText(subject,false,false,&headerstyle);
text->appendStyledText(time_buf,false,false,&datestyle);
// Sadly, our LLTextEditor can't handle both styled and unstyled text
// at the same time. Hence this space must be styled. JC
text->appendColoredText(std::string(" "),false,false,LLColor4::grey4);
text->appendColoredText(message,false,false,LLColor4::grey4);
LLColor4 semi_transparent(1.0f,1.0f,1.0f,0.8f);
text->setCursor(0,0);
text->setEnabled(FALSE);
text->setWordWrap(TRUE);
//text->setTabStop(FALSE); // was interfering with copy-and-paste
text->setTabsToNextField(TRUE);
text->setMouseOpaque(TRUE);
text->setBorderVisible(TRUE);
text->setTakesNonScrollClicks(TRUE);
text->setHideScrollbarForShortDocs(TRUE);
text->setReadOnlyBgColor ( semi_transparent );
text->setWriteableBgColor ( semi_transparent );
addChild(text);
y = box_bottom - VPAD;
if (mHasInventory)
{
addChild(new NoticeText(std::string("subjecttitle"),LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),std::string("Attached: "),LLFontGL::sSansSerif));
LLUIImagePtr item_icon = get_item_icon(mInventoryOffer->mType,
LLInventoryType::IT_TEXTURE,
0, FALSE);
x += LABEL_WIDTH + HPAD;
std::stringstream ss;
ss << " " << inventory_name;
LLTextBox *line = new LLTextBox(std::string("object_name"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),ss.str(),LLFontGL::sSansSerif);
line->setEnabled(FALSE);
line->setBorderVisible(TRUE);
line->setDisabledColor(LLColor4::blue4);
line->setFontStyle(LLFontGL::NORMAL);
line->setBackgroundVisible(true);
示例7: form
//.........这里部分代码省略.........
sFont,
FALSE);
caution_box->setFontStyle(LLFontGL::BOLD);
caution_box->setColor(gColors.getColor("NotifyCautionWarnColor"));
caution_box->setBackgroundColor(gColors.getColor("NotifyCautionBoxColor"));
caution_box->setBorderVisible(FALSE);
caution_box->setWrappedText(notification->getMessage());
addChild(caution_box);
// adjust the vertical position of the next control so that
// it appears below the caution textbox
y = y - caution_height;
}
else
{
const S32 BTN_TOP = BOTTOM_PAD + (((mNumOptions-1+2)/3)) * (BTN_HEIGHT+VPAD);
// Tokenization on \n is handled by LLTextBox
const S32 MAX_LENGTH = 512 + 20 +
DB_FIRST_NAME_BUF_SIZE +
DB_LAST_NAME_BUF_SIZE +
DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title.
text = new LLTextEditor(std::string("box"),
LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16),
MAX_LENGTH,
mMessage,
sFont,
FALSE);
text->setWordWrap(TRUE);
text->setTabStop(FALSE);
text->setMouseOpaque(FALSE);
text->setBorderVisible(FALSE);
text->setTakesNonScrollClicks(FALSE);
text->setHideScrollbarForShortDocs(TRUE);
text->setReadOnlyBgColor ( LLColor4::transparent ); // the background color of the box is manually
// rendered under the text box, therefore we want
// the actual text box to be transparent
text->setReadOnlyFgColor ( gColors.getColor("NotifyTextColor") );
text->setEnabled(FALSE); // makes it read-only
text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard)
addChild(text);
}
if (mIsTip)
{
// TODO: Make a separate archive for these.
LLChat chat(mMessage);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLFloaterChat::getInstance(LLSD())->addChatHistory(chat);
}
else
{
LLButton* btn;
btn = new LLButton(std::string("next"),
LLRect(getRect().getWidth()-26, BOTTOM_PAD + 20, getRect().getWidth()-2, BOTTOM_PAD),
std::string("notify_next.png"),
std::string("notify_next.png"),
LLStringUtil::null,
onClickNext,
this,
sFont);
示例8: if
//.........这里部分代码省略.........
LLStringUtil::null,
sFont,
FALSE);
caution_box->setFontStyle(LLFontGL::BOLD);
caution_box->setColor(gColors.getColor("NotifyCautionWarnColor"));
caution_box->setBackgroundColor(gColors.getColor("NotifyCautionBoxColor"));
caution_box->setBorderVisible(FALSE);
caution_box->setWrappedText(LLNotifyBox::getTemplateMessage("ScriptQuestionCautionWarn"));
addChild(caution_box);
// adjust the vertical position of the next control so that
// it appears below the caution textbox
y = y - caution_height;
}
const S32 BOTTOM_PAD = VPAD * 3;
const S32 BTN_TOP = BOTTOM_PAD + (((mNumOptions-1+2)/3)) * (BTN_HEIGHT+VPAD);
// Tokenization on \n is handled by LLTextBox
const S32 MAX_LENGTH = 512 + 20 +
DB_FIRST_NAME_BUF_SIZE +
DB_LAST_NAME_BUF_SIZE +
DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title.
text = new LLTextEditor(std::string("box"),
LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16),
MAX_LENGTH,
mMessage,
sFont,
FALSE);
text->setWordWrap(TRUE);
text->setTabStop(FALSE);
text->setMouseOpaque(FALSE);
text->setBorderVisible(FALSE);
text->setTakesNonScrollClicks(FALSE);
text->setHideScrollbarForShortDocs(TRUE);
text->setReadOnlyBgColor ( LLColor4::transparent ); // the background color of the box is manually
// rendered under the text box, therefore we want
// the actual text box to be transparent
text->setReadOnlyFgColor ( gColors.getColor("NotifyTextColor") );
text->setEnabled(FALSE); // makes it read-only
text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard)
addChild(text);
if (mIsTip)
{
if (!gSavedSettings.getBOOL("HideNotificationsInChat")) {
// TODO: Make a separate archive for these.
LLChat chat(mMessage);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLFloaterChat::getInstance(LLSD())->addChatHistory(chat);
}
}
else
{
LLButton* btn;
btn = new LLButton(std::string("next"),
LLRect(getRect().getWidth()-26, BOTTOM_PAD + 20, getRect().getWidth()-2, BOTTOM_PAD),
std::string("notify_next.png"),
std::string("notify_next.png"),
LLStringUtil::null,
onClickNext,
this,