Thread Rating:
  • 537 Vote(s) - 2.91 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TextFlowBox内の文字列変更について
09-08-2011, 06:20 PM, (This post was last modified: 09-08-2011, 06:24 PM by onyo.)
#6
RE: TextFlowBox内の文字列変更について
実は元々悩んでいたのは、CommandButton の改行を含むテキストラベルを
動的に変えるにあたってどうすればいいのか[Image: huh.gif]でした。

CommandButton.label 内では
text-preserve-whitespace? は有効ではないようですが
他に、簡潔な書き方がありますでしょうか?

Code:
{let hoge:String = "こっから→\nここまで"}
{define-proc public {en-n-chikan s:String}:any
    let sa:StringArray = {s.split split-chars = "\n"}
    let arg:Arguments = {Arguments}
    {for i:int = 0  below  sa.size do
        {arg.append sa[i]}
        {if sa.size == i + 1 then
            {break}
        }
        {arg.append {br}}
    }
    {return {text {splice arg}}}
}

|| 1.Labelで表示
{Label {TextFlowBox text-preserve-whitespace? = true, hoge}}

|| 2.Labelを CammndButton.label に設定
{CommandButton label = {Label {TextFlowBox text-preserve-whitespace? = true, hoge}}}

|| 3.\nの元Stringをそのまま CammndButton.label に設定
{CommandButton label = hoge}

|| 4.TextFlowBoxを CammndButton.label に設定
{CommandButton label = {TextFlowBox text-preserve-whitespace? = true, hoge}}

|| 5.{br}に置換して CammndButton.label に設定
{CommandButton label = {en-n-chikan hoge}}


Messages In This Thread
RE: TextFlowBox内の文字列変更について - by onyo - 09-08-2011, 06:20 PM
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('269')