Label multiline in CustomListItem

Set multiline to true in my tag is not working (there is just a single line). Is there anything else I need to do?

CustomListItem {
    dividerVisible: true
    Container {
        Label {
            text: ListItemData.title
            multiline: true
        }
        Label {
            text: ListItemData.pubDate
        }
    }
}

If you want to the first label dynamic rather than fixed height, you can set a minHeight for the container and then set the autoSize.maxLineCount.  Something like:

listItemComponents: [
    ListItemComponent {
        CustomListItem {
            Container {
                minHeight: 200.0
                Label {
                    text: ListItemData
                    multiline: true
                    autoSize.maxLineCount: 2
                 }
                 Label {
                     text: "Second line"
                 }
             }
    }
    }
]

Tags: BlackBerry Developers

Similar Questions

  • (BB10) Label multiline

    Hi all!

    I tried to return a label multiline without success.

    There were methods 'multiline' and 'wordwrap' before, but they aren't there now, so I can't force a label field to be multiline.

    When you extend there is a 'isMultiline()' method, but cannot find a way to put it.

    Any idea?

    Use:

    this.label.maxLines = 5; or what ever

  • label multiline

    Labels for my formItems are sometimes too long for a single line, and pointing to the label to display a ToolTip showing the full title is insufficient for the needs of my client. There is place on the stage of the label wrap on two lines, but according to the docs labels does not support multiline.

    I considered two solutions for this, both of which I prefer to avoid:

    1. create my own formitem custom component from scratch with a multi-line text control.

    2. the label in the formItem to color the same color as the background and absolutely positioning multiline text control where the label should be (time is short!)

    can anyone think of more simple way around this problem?
    see you soon
    Craig

    Unfortunately, the FormItem label is just that, a label. Labels not multi-line. But FormItem use actually FormItemLabel, no label directly. So, you can write your own FormItemLabel and extend it text, no label.

    1. create the mx.controls package in the path of YOUR application.
    2. create FormItemLabel.as in this package. Extend the text.
    3 override function Measure [], call super.measure (), then adjust the measuredWidth and measuredHeight.

    You have to experiment in the Measure [] function to get the correct values. The alternative is to size explicitly the FormItem which is probably your best choice for precision.

    By placing mx.controls.FormItemLabel in your path of the application, Flash Player will load your FormitemLabel first and ignores that of the frameworks.swc.

    WARNING: I have not tried myself (this should work, however). And if you break Flex, well, you have to go with plan B.

  • Different font on label multiline table size

    I feel that the answer is going to be it is not possible, but is it possible to have the text of different sizes in the same row/column label?  I want to do is to have up to three lines of text, where the first line is larger than the other two... Maybe some sequence in the string of exhaust... something like:

    SetTableRowAttribute (handle, control, 1, ATTR_LABEL_TEXT, "<\big>Line1\n<\little><\little>Line3 Line2\n");

    Hi gtoph,

    Unfortunately, there is no way to have the different fonts in a single table cell.

    Suggestion of JR is a good thing. I'll add my own, in case that you have to scroll the table, but you don't need to edit the text:

    You can create and configure a control out of the screen that has the look you want (see attachment), then empty control in an image using GetCtrlDisplayBitmap, set the type of cell in your table to VAL_CELL_PICTURE and then put your bitmap image in the cell.

    But of course, this will not work unless you want to only display the text and not modify it.

    Luis

  • Vertical center label multiline inputText

    Hi all

    I'll start by adf, I use jdevelopper 11.1.2.4 and I have a little problem with the label of a text of entry

    Capture.PNG

    I want that label description in order to be at the center of the inputext which includes attribute equal to 3 lines.

    Thank you.

    Khalil

    Try the skins...

    AF | {inputText::label}

    vertical-align: middle;

    }

  • Control/reduce the space between labels 2 StackLayout: TopToBottom

    I find that there is a huge vertical space between 2 label in a TopToBottom stack layout.

    Is there a way to reduce or control this space?

    Thank you!

    {Of container
    layout: {StackLayout}
    direction: LayoutOrientation.TopToBottom
    }
    {Label
    Multiline: false
    text: "test Label 1.
    verticalAlignment: VerticalAlignment.Center
    textStyle.fontSize: FontSize.Small
    textStyle.color: Color.DarkCyan
    textStyle {}
    Base: SystemDefaults.TextStyles.TitleText
    fontWeight: FontWeight.Normal
    size: 40
    }
    }
    {Label
    Multiline: true
    text: 'test Label 2 '.
    verticalAlignment: VerticalAlignment.Center
    textStyle {}
    Base: SystemDefaults.TextStyles.TitleText
    fontWeight: FontWeight.Normal
    size: 40
    }
    }
    }

    Put them in a container of DockLayout (one upstairs, one downstairs) and control the height of the container to control the distance between the two labels

  • Increase the width of the label of button component Radio

    Hi guys,.

    I tried to find a way to increase the width of the Radio button component label I use in my Quiz - I have some long questions which are not fully visible in the label box, and he's hiding, how to extend the width of the label, so that she can receive.

    I tried Multiline and Word Wrap in property textfield but its not getting my anywhere.

    Here is what I currently use?

    RB6. Label.Multiline = true;

    RB6. TextField.wordWrap = true;

    RB6. TextField.Width = 352;

    But nothing happens, please help

    I normally give up using the radio button label and just use a textfield that is adjacent to it, reducing to the minimum width of the component so that the area of the button.

  • Setting Web display over the entire height of the device

    Hello

    Recently, I submitted one of my BlackBerry 10 applications to built for BlackBerry, but that it must be approved, I must have the webView fill the entire page. The illustration below shows the Web view covers only about half of the page because there is not enough of content to fill an entire page.

    Here is the code that I use for my webView:

    Container {
            layout: DockLayout {
    
            }
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill
            background: Color.Black
            ScrollView {
                id: scrollView1
                scrollViewProperties.pinchToZoomEnabled: true
                scrollViewProperties.scrollMode: ScrollMode.Vertical
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
                Container {
                    layout: StackLayout {
                        orientation: LayoutOrientation.TopToBottom
                    }
                    verticalAlignment: VerticalAlignment.Fill
                    horizontalAlignment: HorizontalAlignment.Fill
                    background: Color.Black
                    WebView {
                        id: webView1
                        onLoadingChanged: {
                            if (loadRequest.status == WebLoadStatus.Started) {
    
                            } else if (loadRequest.status == WebLoadStatus.Succeeded) {
                                webLoading.stop()
                            } else if (loadRequest.status == WebLoadStatus.Failed) {
    
                            }
                        }
                        // WebView settings, initial scaling and width used by the WebView when displaying its content.
                        settings.viewport: {
                            "width": "device-width",
                            "initial-scale": 1.0
                        }
                        onMinContentScaleChanged: {
                            // Update the scroll view properties to match the content scale
                            // given by the WebView.
                            scrollView1.scrollViewProperties.minContentScale = minContentScale;
    
                            // Let's show the entire page to start with.
                            scrollView1.zoomToPoint(0, 0, minContentScale, ScrollAnimation.None)
                        }
    
                        onMaxContentScaleChanged: {
                            // Update the scroll view properties to match the content scale
                            // given by the WebView.
                            scrollView1.scrollViewProperties.maxContentScale = maxContentScale;
                        }
                        verticalAlignment: VerticalAlignment.Fill
                        horizontalAlignment: HorizontalAlignment.Fill
                    }
                    Divider {
                        id: infoTextDivider
                        visible: false
    
                    }
                    Container {
                        visible: false
                        id: infoTextContainer
    
                        verticalAlignment: VerticalAlignment.Center
                        horizontalAlignment: HorizontalAlignment.Center
                        Label {
                            multiline: true
                            id: infoText
                            textStyle.textAlign: TextAlign.Center
                        }
                    }
                }
            }
            Container {
                id: loadMask
                background: Color.Black
                layout: DockLayout {
    
                }
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
                Container {
                    leftPadding: 10.0
                    rightPadding: 10.0
                    topPadding: 10.0
                    bottomPadding: 10.0
                    horizontalAlignment: HorizontalAlignment.Center
                    verticalAlignment: VerticalAlignment.Center
                    ActivityIndicator {
                        id: webLoading
                        preferredHeight: 200.0
                        preferredWidth: 200.0
                        horizontalAlignment: HorizontalAlignment.Center
                        onStarted: {
                            loadMask.setVisible(true)
                        }
                        onStopping: {
                            loadMask.setVisible(false)
                        }
                    }
                    Label {
                        text: "Loading " + titleBar.title + "..."
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle.fontSize: FontSize.Large
                        textStyle.fontWeight: FontWeight.W100
                        textStyle.color: Color.White
                    }
                }
            }
        }
    

    If any help with what I need to add in order to show Web to fill the entire page would be great!

    Thanks in advance

    Web layout:

    set:

    preferredHeight: 1280
    preferredWidth: 768
    maxHieght: 1280
    maxWidth: 768
    minHeight: 720
    minWidth: 720
    
  • Touch will not fire for q10?

    Mr President

    I tried in qml/CPP but not able to handle the touch event? can someone give me an example for the treatment of the Q10 touch events.

    /*
     * Copyright (c) 2011-2014 BlackBerry Limited.
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     * http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    import bb.cascades 1.2
    
    Page {
        function addToLabel(text) {
            label.text = text + "\n" + label.text
        }
        Container {
            layout: DockLayout {}
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
            onTouch: {
                switch (event.touchType) {
                    case TouchType.Cancel: {
                        addToLabel("TouchType : Cancel")
                        break
                    }
                    case TouchType.Down: {
                        addToLabel("TouchType : Down")
                        break
                    }
                    case TouchType.Move: {
                        addToLabel("TouchType : Move")
                        break
                    }
                    case TouchType.Up: {
                        addToLabel("TouchType : Up")
                        addToLabel("X: " + event.windowX + " Y: " + event.windowY)
                        break
                    }
                    default : {
                        addToLabel("TouchType : Undefined")
                    }
                }
            }
            Label {
                id: label
                multiline: true
            }
        }
    }
    

    OR

    /*
     * Copyright (c) 2011-2014 BlackBerry Limited.
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     * http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    import bb.cascades 1.2
    
    Page {
        function addToLabel(text) {
            label.text = text + "\n" + label.text
        }
        Container {
            layout: DockLayout {}
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
            gestureHandlers: [
                TapHandler {
                    onTapped: {
                        addToLabel("Tapped")
                        addToLabel("X: " + event.x + " Y: " + event.y)
                    }
                }
            ]
            Label {
                id: label
                multiline: true
            }
        }
    }
    
  • Pass a variable value set to the selector to the Listview

    This was probably picked several times on the forum, but I'm going crazy with research and try to do things with my code.

    Everything I'm doing is to expose the variable rssmobileEnabled defined in the SELECTOR, so that I can go and test it in my LISTVIEW onSelectedValueChanged IF statement, according to the code below.

    I did the variable in "BOLD" below to indicate. This must be a simple solution, after all how it can be difficult to just define a global variable...

    The SELECTOR code:

     Picker {
        id: picker
        title: "Select Feed"
        dataModel: XmlDataModel {
         source: "models/blackberry.xml"
        }
    
          pickerItemComponents: [
              PickerItemComponent {
                    type: "rsslink"
                    content: Container {
                    layout: DockLayout {
                    }
                         Label {
                             multiline: false
                             text: pickerItemData.text
                             textStyle {
                                  base: SystemDefaults.TextStyles.SubtitleText
                             }
                          }
                      }
                 }
            ]
    
       onSelectedValueChanged: {
           var rsslinktext = (dataModel.data([ 0, picker.selectedIndex(0) ]).text);
           var rsslink = (dataModel.data([ 0, picker.selectedIndex(0) ]).rssSource);
           var rsslinkquery = (dataModel.data([ 0, picker.selectedIndex(0) ]).rssQuery);
           var rssmobileEnabled = (dataModel.data([ 0, picker.selectedIndex(0)]).mobileEnabled);
    
            //Load the selected feed
            dataSource.load();
       }
    } // Picker
    

    Code of the LISTVIEW:

                ListView {
                    id: myListView
    
                    // Associate the list view with the data model that's defined in the
                    // attachedObjects list
                    dataModel: dataModellist
                    layout: StackListLayout {}
                    listItemComponents: [
                        ListItemComponent {
                            id: header
                            type: "header" //"item"
    
                            //custom components used instead of standardlistitem
                            Container {
                                Label {
                                    id: emptytextheader
                                    text: ""
                                }
                            }
                        },
                        ListItemComponent {
                            id: item
                            type: "item" //"description"
    
                            Container {
                                layout: DockLayout {}
                                //custom components used instead of standardlistitem
    
                                Container {
                                    id: itemdetails
                                    Label {
                                        id: title
                                        text: ListItemData.title
                                        //textStyle.fontWeight: FontWeight.Bold
                                        multiline: true
                                        textStyle.color: Color.Cyan
                                    }
                                    Label {
                                        id: pubdate
                                        text: ListItemData.pubDate
                                        textStyle.color: Color.create("#ff00c200")
                                        textStyle.fontSize: FontSize.XSmall
                                    }
                                    Label {
                                        id: description
                                        text: ListItemData.description
                                        textStyle.fontSize: FontSize.Small
                                        multiline: true
                                        textStyle.color: Color.Yellow
                                        maxHeight: 130.0
                                    }
                                }
                            }
                        }
                    ]
    
                    onTriggered: {
                        var feedItem = dataModel.data(indexPath);
                        var page = detailsPage.createObject();
    
                        if (rssmobileEnabled == "y")
                            {
                                .....
                            }
                    }
                }
    

    Hello

    "var rssMobileEnabled" declares a local variable, is not available in onTriggered.

    Declare it as a property instead:

    TopLevelItem
    {
       property bool rssMobileEnabled
       (or 'property string' if it's a character)
    

    reference it without prefix "var":

    rssMobileEnabled =...

    You can also declare the property on another element (not necessarily higher level) and reference it by id:

    elementId.rssMobileEnabled

  • OmniDialogMaker

    I was hoping that someone can tell me where you put the OmniDialogMaker script. I was hoping that place in my way of scripts, then by restarting Photoshop can run the script for those who need this script library would be working, unfortunately, no?

    It looks like a file, you can include in a script that you write that will use the function in the included file.  All I see are a few variables and functions not code to do anything.

    Use an include statement

    @include "ominoDialogMaker.jsx".

    var D_MARGIN = 4;

    var D_CONTROLHEIGHT = 18;

    var D_BUTTONWIDTH = 96;

    var D_CONTROLLABELWIDTH = 84;

    var D_CONTROLWIDTH = 100;

    var D_DIALOG_WIDTH = 1 * D_MARGIN + D_CONTROLLABELWIDTH + D_CONTROLWIDTH;

    var S2 = 1.41421356237309504880;

    Create a rectangle for a new control, walking down.

    function _odControlShared (label, name)

    {

    OD = this;

    var y = od.curYPos;

    itemHeight var = D_CONTROLHEIGHT;

    var itemBump = itemHeight + D_MARGIN;

    If (label! = "")

    label += ":";

    var labelCtl = od.w.add ("statictext', [D_MARGIN, y, D_MARGIN + D_CONTROLLABELWIDTH, y + itemHeight], label");

    labelCtl.justify = 'right ';

    var controlBox = new Object();

    controlBox.left = D_MARGIN + D_CONTROLLABELWIDTH + D_MARGIN;

    controlBox.top = y;

    controlBox.right = controlBox.left + D_CONTROLWIDTH;

    controlBox.bottom = controlBox.top + itemHeight;

    od.curYPos = controlBox.bottom + D_MARGIN;

    return controlBox;

    }

    function _odControlSharedFinish (control, tname, valueFieldName)

    {

    oD = this;

    oD.items [tname] = control;

    oD.itemValueFieldNames [tname] = valueFieldName;

    oD.itemNames [oD.itemNames.length] = tNom;

    }

    function _odNumber (label, tname, value)

    {

    oD = this;

    controlBox var = oD._odControlShared (label, tname);

    var control = oD.w.add ('edittext', controlBox, value);

    Control.value = value;

    control.onChange = function() {this.value = (this.text) * 1.0; this.text = this.value ;};}  make accessible all the .value

    oD._odControlSharedFinish (control, tname, "text");

    Returns the control;

    }

    function _odText (label, tname, value)

    {

    oD = this;

    controlBox var = oD._odControlShared (label, tname);

    var control = oD.w.add ('edittext', controlBox, value);

    Control.value = value;

    control.onChange = function() {this.value = this.text ;};}  make accessible all the .value

    oD._odControlSharedFinish (control, tname, "text");

    Returns the control;

    }

    function _setColorFromButton (victim, button)

    {

    var g = victim.graphics;

    var n = button.value;

    var g.newBrush (g.BrushType.SOLID_COLOR, n) = myBrush;

    g.backgroundColor = myBrush;

    }

    /*

    the color values are table of three tanks, 0,0... 1.0.

    */

    function _odColor (label, tname, color)

    {

    oD = this;

    controlBox var = oD._odControlShared (label, tname);

    var swatchBox = [controlBox.left + 40, controlBox.top, controlBox.right, controlBox.bottom];

    var buttonBox = [controlBox.left, controlBox.top, + 30 controlBox.left, controlBox.bottom];

    Swatch var = oD.w.add ('group', swatchBox);

    var button = oD.w.add ('button', buttonBox);

    Button.Swatch = swatch;

    Button.Value = color;

    button.onClick = function() {}

    var n = doColorPicker (this.value);

    This.Value = n;

    _setColorFromButton (Swatch, this);

    };

    _setColorFromButton (Swatch, Button);

    oD._odControlSharedFinish (button, tname, "value");

    Back button;

    }

    /*

    Add a button and static text in the dialog box;

    the button refers to the text "nameCtl."

    and .filePrompt and .fileExtension.

    */

    function _odFileCommon(label,tname,path,prompt,extension)

    {

    controlBox var = oD._odControlShared (label, tname);

    buttonWidth var = 10;

    var buttonBox = [controlBox.left, controlBox.top, controlBox.left + buttonWidth, controlBox.bottom];

    var nameBox = [controlBox.left + buttonWidth + 10, controlBox.top, D_DIALOG_WIDTH, controlBox.bottom];

    var f = new File (path);

    var nameCtl = oD.w.add ('statictext', nameBox);

    var button = oD.w.add ('button', buttonBox, '...');

    button.nameCtl = nameCtl;

    nameCtl.text = f.name;

    Button.Value = f.fsName;

    Button.file = f;

    prompt = button.filePrompt;

    button.fileExtension = extension;

    oD._odControlSharedFinish (button, tname, "value");

    button.onChange = function()

    {

    This.file = new queue (this.value);

    this.nameCtl.text = this.file.name;

    }

    Back button;

    }

    function _odOpenFile(label,tname,path,prompt,extension)

    {

    oD = this;

    var buttonCtl is _odFileCommon(label,tname,path,prompt,extension);.

    buttonCtl.onClick = function() {}

    var f = this.file.openDlg (this.filePrompt);

    If (f)

    {

    This.file = f;

    This.Value = f.fsName;

    this.nameCtl.text = f.name;

    }

    };

    ButtonCtl return;

    }

    function _odSaveFile(label,tname,path,prompt,extension)

    {

    oD = this;

    var buttonCtl is _odFileCommon(label,tname,path,prompt,extension);.

    buttonCtl.onClick = function() {}

    var f = this.file.saveDlg (this.filePrompt);

    If (f)

    {

    This.file = f;

    This.Value = f.fsName;

    this.nameCtl.text = f.name;

    }

    };

    ButtonCtl return;

    }

    function _odSelectFolder(label,tname,path,prompt,extension)

    {

    oD = this;

    var buttonCtl is _odFileCommon(label,tname,path,prompt,extension);.

    buttonCtl.folder = new Folder (path); file, pls, no files

    buttonCtl.nameCtl.text += ' / ';.

    buttonCtl.onClick = function() {}

    var f = this.folder.selectDlg (this.filePrompt);

    If (f)

    {

    This.Folder = f;

    This.Value = f.fsName;

    f.name = this.nameCtl.text + ' / ';.

    }

    };

    ButtonCtl return;

    }

    function _odCheckbox(label,tname,value,checkboxText)

    {

    oD = this;

    controlBox var = oD._odControlShared (label, tname);

    var control = oD.w.add ('checkbox', controlBox, checkboxText);

    Control.value = value;

    control.onChange = function() {this.value = this.text ;};}

    oD._odControlSharedFinish (control, tname, "value");

    Returns the control;

    }

    function _odRadioButtons(label,tname,value,radioChoices)

    {

    var oD = this;

    controlBox = oD ._odControlShared (label, tname);

    itemHeight var = controlBox.bottom - controlBox.top;

    result = oD.w.add ('edittext', controlBox, value); field of hidden text for fight against it...

    result.onChange = function() {}

    var i;

    This.Value = this.text;

    for (i = 0; i< this.buttons.length;="">

    {

    var button = this.buttons [i];

    Button.Value = (button.theChoice == this.text);

    }

    }

    result. Hide();

    result.value = value;

    result. Buttons = new Array();

    var i;

    for (i = 0; i< radiochoices.length;="">

    {

    choice of var = radioChoices [i];

    If (i > 0)

    {

    var bump = itemHeight + D_MARGIN;

    controlBox.top += bump;

    controlBox.bottom += bump;

    oD.curYPos += bump;

    }

    each object radiobutton pokes his choice in the control of the ersatz,

    It looks like a simple value.

    ("Bundling" seems to be by adjacent additions only. Nice!)

    var rb = oD.w.add ('radiobutton', controlBox, choice);

    RB. Value = choice == value;

    rb.theChoice = choice;

    rb.theGroupErsatzControl = result;

    rb.onClick = function() {this.theGroupErsatzControl.value = this.theChoice ;};}

    result. Buttons [result. Buttons.Length] = rb;

    }

    oD._odControlSharedFinish (result, tname, "text");

    return the result;

    }

    function _odMenu(label,tname,value,menuChoices)

    {

    var oD = this;

    controlBox = oD ._odControlShared (label, tname);

    itemHeight var = controlBox.bottom - controlBox.top;

    var control = oD.w.add ('dropdownlist', controlBox, menuChoices);

    I could not discern how to get this from the "items" table, so I hide menuChoice for later. dvb08.

    control.menuChoices = menuChoices;

    Control.value = value;

    Set the index of the initial selection

    var index = 0;

    for (var i = 0; i)< menuchoices.length;="">

    {

    if(value == menuChoices[i])

    index = i;

    }

    Control.Selection = index;

    control.onChange = function() {}

    This.Value = this.selection.text;

    } / / make accessible all the .value

    oD._odControlSharedFinish (control, tname, "value");

    }

    function _odSectionLabel (label)

    {

    var oD = this;

    var B2 = new Object();

    B2. Left = D_MARGIN;

    B2. Top = oD.curYPos;

    B2. Right = b2.left + D_DIALOG_WIDTH;

    B2. Bottom = b2.top + D_CONTROLHEIGHT;

    oD.curYPos += D_CONTROLHEIGHT + D_MARGIN;

    oD.w.add ("statictext", b2, label + ':', {multiline: true});

    }

    function _odBoxedText (lines, text)

    {

    var oD = this;

    var width = D_DIALOG_WIDTH;

    var height = lines * 15;

    var B2 = new Object();

    var b = new Object();

    b.Top = oD.curYPos;

    b.Bottom = b.top + height + 2 * D_MARGIN;

    b.Left = D_MARGIN;

    b.Right = b.left + width;

    oD.curYPos = b.bottom + D_MARGIN;

    var Panel = oD.w.add ('panel', b);

    B2. Left = D_MARGIN;

    B2. Top = D_MARGIN;

    B2. Right = b2.left + width - 2 * D_MARGIN;

    B2. Bottom = b2.top + height;

    Panel.Add('statictext',B2,text,{Multiline:true});)

    }

    function _odSeparator()

    {

    var oD = this;

    var height = oD.groupGap;

    var barWidth = oD.ominoDialogWidth;

    If (barWidth)

    {

    var b = new Object();

    b.Top = oD.curYPos + height / 2;

    b.top = b.Bottom;

    b.Left = D_MARGIN;

    b.Right = b.left + barWidth;

    var Layer10value = 2;

    b.Top = Layer10value / 2;

    b.Bottom = b.top + Layer10value;

    oD.w.add ('panel', b);

    }

    oD.curYPos += height;

    }

    function _odAppendGap()

    {

    oD = this;

    oD.curYPos += oD.groupGap;

    }

    function appendOKCancel (oD)

    {

    var y = oD.curYPos;

    var cancelRect = new Object();

    var okRect = new Object();

    cancelRect.left = D_MARGIN

    cancelRect.top = y;

    cancelRect.right = cancelRect.left + D_BUTTONWIDTH;

    cancelRect.bottom = cancelRect.top + D_CONTROLHEIGHT;

    okRect.left = cancelRect.right + D_MARGIN + D_MARGIN;

    okRect.top = y;

    okRect.right = okRect.left + D_BUTTONWIDTH;

    okRect.bottom = okRect.top + D_CONTROLHEIGHT;

    Implement the button apply or OK/Cancel-button

    If (OD.isPalette)

    {

    var applyBtn = oD.w.add ('button', cancelRect, 'Apply');

    applyBtn.oD = oD;

    applyBtn.onClick = function() {}

    oD var = this.oD;

    var result = oD.get ();

    oD.paletteCallback (result, oD.paletteCallbackArg2);

    };

    }

    on the other

    {

    var cancelBtn = oD.w.add('button',cancelRect,'Cancel',{name:'cancel'});)

    var okBtn = oD.w.add('button',okRect,'OK',{name:'ok'});)

    cancelBtn.oD = oD;

    cancelBtn.onClick = function() {this.oD.w.close (0) ;};}  0 on cancel

    okBtn.theDialog = oD;

    okBtn.onClick = function() {this.theDialog.w.close (1) ;};} 1 OK

    }

    oD.curYPos = okRect.bottom + D_MARGIN;

    }

    function trimDialogBounds (oD)

    {

    var xMax = 20;

    var yMax = 20;

    var n = oD.w.children.length;

    var i;

    for (i = 0; i< n;="">

    {

    aenfant var = od.w.children [i];

    var aChildBounds = aChild.bounds;

    if(aChildBounds.Right > Xmax)

    xMax = aChildBounds.right;

    if(aChildBounds.Bottom > ymax)

    yMax = aChildBounds.bottom;

    }

    OD.w.Bounds.Right = od.w.bounds.left + xMax + D_MARGIN;

    OD.w.Bounds.Bottom = od.w.bounds.top + yMax + D_MARGIN;

    actually allow background discontinuities.

    OD.w.Bounds.Bottom = od.curYPos + od.w.bounds.top;

    }

    /**

    * The optional arguments of the 2nd, 3rd and 4th make a range instead of a modal dialog box. The reminder

    * is called whenever you click Apply (you get a button apply instead of OK/Cancel)

    */

    function newOminoDialog (tname, existingPanel, paletteCallback, paletteCallbackArg2)

    {

    If you switch to something other than a sign, none can use.

    If (!) () existingPanel instanceof Panel))

    existingPanel = null;

    var isPalette = (existingPanel | paletteCallback)? 1: 0;

    var type = isPalette? "palette": "dialogue."

    var oD = new Object();

    oD.w = existingPanel? existingPanel: New Window (kind, tname, [100,100,500,500]);

    oD.isPalette = isPalette;

    oD.paletteCallback = paletteCallback;

    oD.paletteCallbackArg2 = paletteCallbackArg2;

    oD.curYPos = D_MARGIN;

    oD.groupGap = 12;

    oD.itemNames = new Array();

    oD.item

    oD.items = new Array();

    oD.itemValueFieldNames = new Object(); to search a value in the dialog field appropriate to each control, such as 'text' or 'value '.

    oD.ominoDialogWidth = D_DIALOG_WIDTH;

    oD.gap = _odAppendGap;

    oD.number = _odNumber;

    oD.string = _odText;

    oD.radioButtons = _odRadioButtons;

    oD.checkbox = _odCheckbox;

    oD.sectionLabel = _odSectionLabel;

    oD.separator = _odSeparator;

    oD.boxedText = _odBoxedText;

    oD.color = _odColor;

    oD.openFile = _odOpenFile;

    oD.selectFolder = _odSelectFolder;

    oD.saveFile = _odSaveFile;

    oD.menu = _odMenu;

    oD.set = _odSet;

    oD.run = _odRun;

    oD.get = _odGet;

    oD._odControlShared = _odControlShared;

    oD._odControlSharedFinish = _odControlSharedFinish;

    return the oD;

    }

    function _odGet()

    {

    var values = new Object();

    tNom var;

    for (tNom in this.items)

    {

    var value = this.items [tname] .value;

    values [tname] = value;

    }

    return values;

    }

    function _odSet (values)

    {

    var oD = this;

    if(!values)

    return;

    for var p in values

    {

    var value = [p] values;

    var point = oD.items [p];

    If (!) Item)

    continue;

    var itemValueFieldName = oD.itemValueFieldNames [p];

    If (itemValueFieldName)

    {

    agenda [itemValueFieldName] = value;

    If (Item.OnChange)

    item.onChange ();

    Item.Notify ('onChange'); to get the update

    }

    }

    }

    /**

    * Can be run as a modal dialog, OR as a current palette box.

    * As a dialog box, nothing happens until OK or Cancel is selected. OK,.

    * the parameters are returned.

    * To be a palette, pass a function and an arg. The function will be

    * being called (resultParams, yourArg).

    */

    function _odRun()

    {

    var oD = this;

    If (!) OD.finishingTouches)

    {

    oD.separator (oD);

    oD.gap ();

    appendOKCancel (oD);

    oD.gap ();

    trimDialogBounds (oD);

    oD.finishingTouches = true;

    }

    If (OD.w instanceof Window)

    {

    resultCode var = oD.w.show ();

    If (resultCode! = 1) / / cancel

    Returns a null value.

    var result = oD.get ();

    return the result;

    }

    on the other

    Returns a null value.

    }

    function objectToString (o)

    {

    if(!o)

    Return ' ';

    var s = "";

    var i;

    for (tNom in o)

    s += tNom '=' + o [tname] + "\n";

    return s;

    }

    var gExampleSettings = null;

    function example (thisObj)

    {

    var host = app;

    the 2 last arguments are making modeless and give you a button APPLY instead of OK and CANCEL.

    This works in AE and Illustrator, but on Photoshop. I have not tried the rest...

    var d = newOminoDialog ("Omino sample dialogue:" + $host.name, thisObj, function (a, b) {alert ("result\n" + objectToString (a)) ;});})

    Comment on the above and use it for photoshop, to be modal:

    var d = newOminoDialog ("Omino sample dialogue:" + $host.name);

    d.boxedText (9, "It's an example of a dialogue built with ominoDialogMaker.jsx\n"

    + "host:" + $host.name + ""+ host.version + "\n";

    + "\n"

    + "© 2007-2012 [email protected]«,»»

    D_DIALOG_WIDTH);

    d.Separator ();

    d.sectionLabel ("types of controls");

    d.Number ("number:", 'h', 11.23);

    d.CheckBox ("Checkbox X", "x", true, "to check");

    d.String ("Text", "T", "Enter here");

    d.openFile ("A file", "f","","open", "" jpg");

    d.radioButtons (One","r","red", ["red","maroon","scarlet "," crimson"]) to choose";

    var result;

    d.Set (gExampleSettings);

    var result = d.run ();

    If (result! = null)

    {

    gExampleSettings = result;

    var s = "Result Values\n";

    s += objectToString (result);

    alert (s);

    }

    }

    /*

    Easy to use ExtendScript progress bar.

    Written by [email protected], 2007

    Enjoy, but this credit must stay intact.

    use:

    var pb = progressBar ("main title", "subtitle");

    pb.setValue (valueFrom0to1);

    pb.setTitle2 ("new display of subtitles!")

    If (PB.isCanceled ())

    PB. Close(); they clicked on cancel

    */

    progressBar (title1, title2) function

    {

    var result = new Object();

    result. Running = true;

    result.p = new Window ("range");

    result.p.orientation = "column";

    result.p.alignChildren = 'left ';

    result. T1 = result.p.add ("statictext", undefined, title1);

    result. T2 = result.p.add ("statictext", undefined, title2);

    result.b = result.p.add ("progressbar");

    result.c = result.p.add ("button", undefined, "Cancel");

    result.c.onClick = function() {}

    result. Running = false;

    }

    result.isRunning = function() {return this.running ;}

    result.isCanceled = function() {return! this.isRunning () ;}}

    result.setValue = Function {this.b.value = x * 100; this.p.update () ;}

    result.setTitle1 = function (t1) {this.t1.text = t1 ;}

    result.setTitle2 = function (t2) {this.t2.text = t2 ;}

    result. Close = function() {this.p.close (;})

    result.p.Show ();

    return the result;

    }

    /*

    a routine kind of stupid to show the inside of an object in alert al.

    You know, for debugging.

    */

    function alertObj (o, title)

    {

    if(!title)

    title = "";

    var s = title + "\n";

    var k;

    if(!o)

    s += "(objet null)"; "

    on the other

    s += objectToString (o);

    alert (s);

    }

  • Tag tree - verticalAlign?

    I went round and round with this component tree trying to get the labelField for verticalAlign at the middle and still I can't stop alignment to the top.

    I would like to help you to understand this so that I can use larger icons with my component of the tree.

    If someone would be this kind of sharing the css code or the declaration of the direct style for the trees label it would be greatly appreciated.

    Thank you in advance to the kind soul who chooses to help out

    Found the solution...

    Of course, an element converter has be integrated into the solution.

    You make a class that extends the TreeItemRenderer and then substitute
    protected function createChildren()
    Then you put in this function the following:

    super.createChildren ();
    Super.Label.Multiline = true;
    super.label.autoSize = TextFieldAutoSize.LEFT;

    and that's all you need to get the label to render properly with vertically align property on the component of the tree. Don't forget to put your new component as itemRenderer of the tree class.

  • Flex mobile 4.5 - Multiline labels?

    Hey, not quite sure how to make multi-line labels. Is this easy to do? Tried to give the standard labels height but that doesn't seem to work. In most other languages theres usually a multiline = true a little Delisle but im not sure how to do it in flex. Thank you!

    Should work if your label has a quite small width which requires several lines:

  • multiline for mx:label text?

    Hello

    The mx:label can only have single line text, which component supports multiline text output?

    Thank you

    M

  • ListView and the height of a CustomListItem

    I have created a ListView with a CustomListItem. The code looks like the following:

    ListView {
        dataModel: myDataModel
        listItemComponents: [
            ListItemComponent {
                type: "item"
                CustomListItem {
                     Container {
                        layout: StackLayout {}
                        TextArea {
                            text: ListItemData.data
                            multiline: true
                        }
                        TextArea {
                            text: ListItemData.data2
                            multiline: true
                        }
                    }
                }
            }
        ]
    }
    

    I came across this problem recently. I suggest to create a personalized yourself list item and do not use the CustomListItem class, I think it is buggy in that regard.

Maybe you are looking for