Text formatting on SegmentedControl and inside the drop-down list

Hello

I'm trying to change the color of the text on the buttons of a SegmentedControl and part of a drop-down list.

I don't want to change the skin, but only the text. With the drop down menu, I managed to change the upper part (just what you see when the drop down menu is closed) using

myDropDown.button.setTextFormatForState(myUpColor, SkinStates.UP);

etc, but with the elements inside the list and buttons SegmentedControl I can't find a property that lets me set the text format...

Any ideas?

It doesn't seem to be an easy way to do.

The only way would be to extend the SegmentedControl and then override the following method with the following code. It should do the trick. We will work on making that it puts far more easily in the future.

override protected function onButtonAdded(child : RadioButton) : void
        {
            var dpLength : int = __dataProvider.length;
            child.width = Math.round( width / dpLength );
            // change this to be percentages
            child.groupname = __groupName;
            //Set your formats to whatever you like here.
                        child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_DISABLED ), SkinStates.DISABLED );
            child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_OUT ), SkinStates.UP );
            child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_DOWN ), SkinStates.DOWN );
            child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_SELECTED ), SkinStates.SELECTED );
            child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_SELECTED_DISABLED ), SkinStates.DISABLED_SELECTED );
            child.drawNow();
            // set the button text formats here
        }

Tags: BlackBerry Developers

Similar Questions

  • Bookmarks inside the drop-down list text

    I inserted a bookmark in a drop-down list text linked and then has another topic to the bookmark. However, if you build and try clicking on this link, it takes you to the main page, where the dropdown menu, not in the open 'version' from the drop down.

    Is it possible to make automatically open down the text?

    Thank you!

    Why ask here and in another new post?

    For the other code is stripped because it is in the wrong part of the file.

  • Value selected in the drop-down list, the value border and subform border color

    OK, I'm busy to create a form that has a field drop-down list. There are five values inside the drop-down list. I have also four subforms which contain tables and fields for each option in the drop-down list except the first. Now, I want to put the border and the color of the border of the subform if you have selected the correct value.

    As part of the output, I created the code as follows:

    If (this.rawValue == '5') {}

    this.resolveNode("TextfieldName").presence = "visible"; This affects a visible text... works like a charm

    Optie1.UI.oneOfChild.border.color.value = "255,153,0"; After an example I found Niall

    Optie1.UI.oneOfChild.border.color.thickness = "0,0200" in

    }

    I've changed this in Optie1, is the name of the subform. Somehow it is not applied in the subform. I know I'm wrong, but can't find what I want on the forums. Someone at - it an idea on that?

    Well, managed to resolve myself to play around with the code.

    It should be:

    Optie1.border.edge.color.value and Optie1.border.edge.thickness.

  • from the drop-down list selection to multi-line output

    I am trying to create a pdf form with Adobe XPro, where I will have multiple delivery addresses. I want to have is that the user can select the correct recipient group in the drop-down list.

    Given that the drop-down lists pdf format are just simple lines the drop-down list selection could only display the name of the company (e.g., COMPANY A) and selecting the company wanted to, this would trigger the whole address (multiline) to appear as described below (on another text field is ok if necessary)

    THE COMPANY

    StreetAddress 1

    City of ZIP-1234

    Does anyone have an easy solution for this?

    I have created a sample form for you, please look at attachment.

    PDF form does exactly what you want.

  • Defining form fields such as required based on the entry in the drop-down list

    I'm trying to set the properties of a few form fields as required in the case of a specific value is selected from a drop-down list.

    I entered the code of the tab actions from the drop-down list properties below > mouse down > run a java script. The problem is that it works only if I come out and enter again the drop-down list. "I tried to invoke the code with"Mouse down","Mouse entry", out of the mouse ' none of them worked unless I go out and again the drop-down list.

    Any suggestions?

    Thank you!

    var devused is this.getField ("device");.

    var comptype is this.getField ("Type of complaint");.

    var proname = this.getField ("product name");

    var feels = this.getField ("sent to the sponsor");

    If (comptype.value == 'Associated Product complaint') {}

    devused. Required = true;

    proname. Required = true;

    smells. Required = true;

    }

    else {}

    devused. Required = false;

    proname. Required = false;

    smells. Required = false;

    }

    What you describe is the way documented in what forms Acrobat and Acrobat JS behave by Form Event Processing

    For your described form, we can use a custom format for the field drop-down list script:

    If (event.willCommit! = true & event.changeEx! = "")
    {
    var devused = this.getField ("device");
    var proname = this.getField ("product name");
    Envoy of var = this.getField ("sent to the sponsor");
    Switch (Event.changeEx)
    {
    case "related product": complaint
    devused. Required = true;
    proname. Required = true;
    smells. Required = true;
    break; Go at the end of the switch;
    Repeat fdor each value of the option in the drop-down list.
    by default:
    If no match for the above cases, it is found;
    devused. Required = false;
    proname. Required = false;
    smells. Required = false;
    break;
    } / / end of switch event.changeEx;
    } / / end not true willCommit;

    You must set the ' Commit selected value immediately "and as one moves upwards or downwards the options, the related fields will change and stay together when you exit the field note that the field name is not used in the script because the field is the event object until it leaves the field.

  • How to fill the drop-down list components installed?

    I have installed Eclipse and the blackberry for eclipse plugin that includes the component pack 4.5.0. I have installed all of the components listed on this page: http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp. The versions 4.2.1 and 4.3.0 are zip files that I add to Eclipse by using the software update-> add the site-> archive. Version 4.6.0 and 4.6.1 4.7.0 are exe files that settle in the location C:\Program Research In Motion\BlackBerry JDE component Package 4.x.x.

    In the folder plugins on the box, I see version 4.3.0 and listed 4.5.0 4.2.1. When I go on Blackberry JDE-> installed components and click the drop-down list box, the only pack component that I see is 4.5.0. How do the other components packs appear?

    Well it's resolved, I guess. After about 3 hours, the software updates-> add the site-> repository for the Blackberry update works. When I installed the components as a result, they appear in the drop-down list. It's a little confusing, because I already tried this at least 5 times and each time before eclipse was a java error when doing this.

  • Get the value of the drop-down list (selectedIndex) and the text field - does not

    Hi all

    I'm trying to find and change the values selected by the user using a drop-down list and text field. Here's the code.

    ChangeRevDetails();
    function ChangeRevDetails(){
    
    
              var myDialog = app.dialogs.add({name:"Enter copyright information"});
    
    
    //    var monthlist = col1.dropdowns.add('myList', undefined, myList);
    
    
              var col1 = myDialog.dialogColumns.add();
              var col2 = myDialog.dialogColumns.add();
      
        col1.staticTexts.add({staticLabel:"Month:"});
              col1.staticTexts.add({staticLabel:"Year:"});
        col1.staticTexts.add({staticLabel:"Rev. no.:"});
        
        var myList = [ "January", "February",  "March", "April", "March", "April", "May", "June", "July", "August", "Sepetember", "October", "November", "December" ];
    
    
         var myMonth = col2.dropdowns.add({stringList:myList, selectedIndex:0, minWidth:100});//{minWidth:100});
         var myYear = col2.textEditboxes.add({editContents:"2013", minWidth:100});   
         var MyRev = col2.textEditboxes.add({minWidth:100});
    
    
        var RevMonth = (myList [myMonth.selectedIndex]);
        var RevYear = myYear.editContents;
        var RevNumber = MyRev.editContents;
        var RevToReplace1 = RevMonth +", "+ RevYear;
        var RevToReplace2 = RevMonth +", "+ RevYear + " Rev. " + RevNumber;
    
    
        var myResult = myDialog.show();
    
    
            if(myYear.editContents == "") //entry is "" 
            { 
            alert("Please enter some text into the contents field."); 
            ChangeRevDetails(); 
            }
            else if(myResult == true) //user entered datas 
            { 
    
    
                alert (RevMonth);
                alert (RevYear);
                alert (RevNumber);
                alert (RevToReplace1);
                alert (RevToReplace2);
    
    
                app.findGrepPreferences = NothingEnum.nothing;
                app.changeGrepPreferences = NothingEnum.nothing;
    
    
                // grep find/change
                app.findGrepPreferences = app.changeGrepPreferences = null;       
                app.findGrepPreferences.findWhat = "[\\l\\u]+?\\s?\\d{4},?\\s+[\\l\\u]+\\.*\\s+\\d+";
                app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Back page"). paragraphStyles.item("Legal_7/9");
                app.changeGrepPreferences.changeTo = RevToReplace1;
                app.changeGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Back page"). paragraphStyles.item("Legal_7/9");
                app.activeDocument.changeGrep();
    
    
                app.findGrepPreferences = NothingEnum.nothing;
                app.changeGrepPreferences = NothingEnum.nothing;
      
        } 
        else //implies user clicked cancel 
        { 
        myDialog.destroy(); 
        }
    
    
    }
    
    

    The problem is, it does not take the value that the user selects in the drop-down list and the text field. It takes the default value as "January" and the year is '2013' as these two values are given as selectedIndex:0 and editContents: "2013". I compared the coding with a few other scripts work as well, but it does not work. I added several alert boxes to check the value we get.

    In addition, search for it and change also does not work. Please help me on this. Thank you.

    Kind regards

    Bachi. D

    Change the order of dialogresults:

    ...

    var myYear = col2.textEditboxes.add ({editContents: "2013", minWidth:100});})
    var MyRev = col2.textEditboxes.add({minWidth:100});)
    Ditto var = myDialog.show ();
        If (myYear.editContents == "") //entry is «»
        {
        Alert ("Please enter a text in the content field.");
        ChangeRevDetails();
        }
        else //user entered if(myResult == true) datas
        {
    var RevMonth = (myList [myMonth.selectedIndex]);
    var RevYear = myYear.editContents;
    var RevNumber = MyRev.editContents;
    "var RevToReplace1 = RevMonth + ', '+ RevYear;

    "var RevToReplace2 = RevMonth + ', '+ RevYear + 'Rev' + RevNumber;

    ...

    did not have a look for the problem of change to find

  • Cannot scroll inside the drop down Menus

    I just got a new laptop (Windows 7 Home Premium 64 bit) HP, installed Firefox 11 (now updated to 12) and discovered that when using the touchpad (Touchpad Synaptics v8.1. Driver provided by Synaptics, version 15.3.29.0 as of 10/13/2011), I can't scroll inside the drop down menus.

    To replicate, go to this link: http://sacramento.craigslist.org/sss/

    Click on the drop down menu to the search category. Use the touch pad to scroll through the list. Mine closed list and returns focus in the browser instead of scrolling of the list. It then scrolls the window of the browser instead. This works fine in IE. I tried the things:

    Safe mode
    Unchecking scroll smoothly
    Uncheck auto-scroll
    Uncheck the hardware acceleration

    And about all the various combinations of the above things. I also tried to restart Firefox every time I made a change. Nothing seems to solve this problem.

    Oddly enough, if there is a window of text within the page (as I write this), I can scroll than fine. Once I move my mouse out of the box, it scrolls the homepage very well. I don't think that it is a matter of the development following the mouse, there something to scrollable drop-down boxes that specifically seems.

    Also, I must point out that all the pages I have problems with work well in IE how they SHOULD work in Firefox.

    I had this exact problem, the same features of HP and the driver Synaptics. I went to synaptics site and downloaded their latest driver which is lower 15.3.29.0 for some reason any. There 15.2.20, I got this one for 64 bit since that's what I have. You must uninstall the 15.3.29.0 first because it is "newer". He now works properly in FF and IE and everything else. If for any reason any the last FF has a confrontation with the latest version of the synaptics driver and FF devs had to include a fix in the next patch.

  • Select from the drop-down list point based on text box is not empty not

    Hello. I have a javascript code to click a button and it will insert the date in a text box named "Controller_PDF_Creation_Doc_Control_Date" in my form. I also have a drop-down list called 'Release_Approval_Initials '. Everything I'm doing is when there is a date of entry in the text box, I want that the 'Release_Approval_Initials' of the menu drop-down default by selecting the option "TM". The drop-down list is filled dynamically too. How can I do this? Here is the code I have.

    < SCRIPT LANGUAGE = "JavaScript" >

    verify() {} function

    var partNumber = ";

    var ecoNumber = ";

    var pdfDate;

    var queue;

    var queueValue = ";

    var allArray = document.getElementById('listofids').value.split (",");

    var error = false;

    for (var i = 0; i < allArray.length; i ++) {}

    pdfDate = document.getElementById('Controller_PDF_Creation_Doc_Control_Date'+allArray[i]).value;

    <!-document.getElementById ('Controller_PDF_Creation_Doc_Control_Date1') .value =' 19 / 08/11 '; ->

    queue = document.getElementById ('Release_Approval_Initials' + allArray [i]);

    queueValue = tail [queue.selectedIndex] .value;

    If ((pdfDate! = '' & & queueValue == '') |) (pdfDate == '' & & queueValue! = '')) {

    error = true;

    ecoNumber = document.getElementById('ECID'+allArray[i]).value;

    partNumber = document.getElementById('Part_Number'+allArray[i]).value;

    Alert ("You must enter a date of authorization to create PDF or Doc Control files and the queue to release for ECO" + ecoNumber + "part number:" + partNumber);

    }

    }

    {if (Error)}

    Returns false;

    }

    else {}

    Returns true;

    }

    }

    < /script >

    "< cfinput type ="Text"name =" "Controller_PDF_Creation_Doc_Control_Date #ItemID #" id = "Controller_PDF_Creation_Doc_Control_Date #ItemID #" value = "#DateFormat(Controller_PDF_Creation_Doc_Control_Date,"M/D/YY")" # "size ="12"maxlength ="8"validate ="date"required ="no"message ="you must enter a valid date in the format m/d/YY in the creation of PDF files or Doc control Date">"

    < cfinput type = "hidden" name = "today_date" id = "today_date" value = "#DateFormat (now ()," D/M/YY")" # "/ >"

    < input type = "button" value = "today's Date" onclick = "document.getElementById('Controller_PDF_Creation_Doc_Control_Date#ItemID#').valu e = document.getElementById ('today_date') .value" >

    < select name = "" Release_Approval_Initials #ItemID # "id =" Release_Approval_Initials #ItemID #">"

    < option value = "" > < / option >

    < cfloop query = "ShowDataEntryInitials" >

    < option value = "" #Initials # ""

    < cfif initial EQ ReleaseInitials > selected

    < / cfif > > #Initials # < / option >

    < / cfloop >

    < / select >

    Any help would be greatly appreciated. Thank you.

    Andy

    I figured out how to make it work. I just had to add parentheses in the right places to make it work. Here's what I did:

  • Selection in the drop-down list box determines the text to display in another box - ideas?

    Hello, my name is Zac.  I spent a lot of time trying to figure this one out for myself, but I couldn't find what I needed.  A few threads looked promising, but I realized that they only apply to the LiveCycle.  Many other threads link to discussion 2006 Thom Parker on this subject, but it is very advanced and I feel that what I need is not as complex as the solution he proposes.  I've never used Adobe Acrobat until a few weeks ago, but with the help of Bernd Alheit and George Johnson I managed to create a document with fly-out help windows and scrolling lists and radio buttons which dictate the choice.  It's great and it works.  The last thing I have to do is to create a text box (or some kind of box) which will display a pre-written block of text based on the user choice in another area (a drop-down list box).  Like this:

    image for forums 2.PNG

    I wish, it is also easy to create because it draw a picture of him!  If the user selects "Algebra 1", for example, a specific description display below.  There are a lot of courses and descriptions, and the descriptions are long enough (as shown).  It is not necessary for the user to make changes to the description - in fact, which would be terrible.  But I would like to be able to copy text from it and paste the text in another area of text on the same page.

    Thank you very much, all those who have ideas please share them! Again wild guesses. I learn from all this.

    -Zac

    This involves using a script. If you want to write the code yourself read this tutorial:

    https://acrobatusers.com/tutorials/change_another_field

    If you don't feel like messing around with the code, you can use this tool that I developed to easily set up with the help of an input file:

    Scripts custom Adobe: Acrobat - fill the drop-down list

  • How to use the drop-down list box to fill in a text box

    I'm a beginner when it comes to Java Script.  I have seen a lot of different discussions, look at a lot of articles "helping" Acrobat 9 and Java Script, but only to be left confused and dazed.  I hope someone can tell me how to write a script that fills a text box that sits on my form with the value of exports of the selection in the combo box...

    Thank you

    If you want that the read-only text box, simply set with the following custom calculate script:

    Set this field to the value of the drop-down list box

    Event.Value = getField("combo1").value;

    but replace "combo1' with the actual name of the combo box field.

    If you want something else, post again with more information.

  • Value of the drop-down list instead of the text

    I want a drop-down list that includes complete definitions for the user to watch but when they choose the item they want only the abbreviation indicating on the form. For example, in my items list is said 'Illinois', but when they select "Illinois" she fills the field with the bind value of 'IT '. Is this possible?

    See the attached file... If it helps...

    I place a TextField on the top of the drop-down list and setting the rawValue selected the TextField... In the case of exit of the combo I hide list drop-down and display of the textfield object. Similarly, in the event you enter in the text field, I am displaying the drop-down list field and hide the text field.

    This way I can show 'IT' If you choose "Illinois" in the menu dropdown.

    https://Acrobat.com/#d=7Y0qDg-ld6nWNxw8G-0cNg

    Thank you

    Srini

  • JavaScript to fill the text based on the drop-down list field

    Hello

    I'm trying to write a javascript script to fill a "Textfield" based on what I select in 'Dropdownlist control' this has on a relationship between them. I tried to integrate the script on the category of 'Change' and the script was the following, but it didn't work. I would be grateful if someone can help me with the correct procedure.

    Thank you

    Vijay

    Form1. #subform [0]. DropDownList2 [0]: change - (JavaScript, both)

    function populateDescription() {}

    if (document.subform [0].) {DropDownList2 [0] .value == "BIH")}

    document.subform [0]. TextField83 [0] .value = "Burn in and PBI history."

            }

    }

    I solved this problem by using a script to switch.

    Please see my previous thread in this regard and Paul example will provide you with the right script for a script to switch.

    http://forums.Adobe.com/thread/479021

    script on the drop-down list as follows

    Switch (this.rawValue) {}

    case "dropchoice1".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    case "dropchoice2".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    }

    Good luck.

  • Why, when I type in the address bar and select from the drop-down list, I seem to "click on" on one of the toolbar buttons?

    I noticed recently that, sometimes, when I chose an entry in the drop-down list after I started typing in the address bar, I would get a different page than I wanted to. It turned out that I was actually clicking the bookmarks toolbar button that has been hidden under the list entry, I thought I was clicking.

    Hi, thanks, but disabling hardware acceleration does not fix it. However, I just swapped my mouse, and seems not to happen anymore!

  • Why don't point in the drop-down list address not remove when selected and click on remove

    on version 14.1 - to remove an item in the drop-down address, said the point the address line the right click and select delete - this clears the address line but point remains in the drop-down list and does disappear not - why point unclear when you return to fall down to check this

    the system is XP and ff 14.1

    I think that you need for the arrow down to the element, so it is highlighted, and then press DELETE.

    (I meant the keyboard delete key, you can't right click on the drop-down list).

Maybe you are looking for