• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

remove the sign - edittext

Participant ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

I have a question to ask

I do not know if it's possible

I have this slider if I move to the right everything is ok

When I move to the left I get the sign - before the number

I would like to remove the sign -

someone helps me.

// script

var curr_blur = 0 

 

var box = new Window('dialog', "blur");    

 

with (box.add('panel', undefined, "Gaussian Blur")) 

    {   

    with (add('group'))   

        { 

        orientation='row';   

 

        add('statictext', undefined, "radius:");   

 

        var slider = add("slider",undefined, 0, -20, 20);  

        slider.preferredSize.width = 256; 

 

        var value = add('edittext', undefined, curr_blur);   

        value.preferredSize.width = 40; 

        } 

 

    with (add('group')) 

        {   

        orientation='row';   

        spacing = 70; 

 

        var okBtn = add('button',undefined, "ok", {name:'ok'});  

        okBtn.preferredSize.width = 100; 

 

        var closeBtn = add('button',undefined, "cancel", {name:'cancel'});   

        closeBtn.preferredSize.width = 100; 

        } 

    } 

 

var ok = false; 

 

slider.onChange = function ()  

    { 

    value.text = slider.value.toFixed(0);  

    value.onChanging(); 

    } 

 

slider.onChanging = function ()  

    {  

    value.text = slider.value.toFixed(0);  

    }  

 

value.onChanging = function ()  

    {  

    var n = Number(value.text); 

     

    if (isNaN(n)) { beep(); return; }  

 

    curr_blur = n; 

 

    slider.value = curr_blur; 

 

 

    doc.activeHistoryState = currentStatus;  

 

    blur(curr_blur);  

 

    app.refresh();  

    }  

 

 

okBtn.onClick = function() 

    {   

    ok = true; 

    box.close();  

    }  

 

closeBtn.onClick = function() 

    {  

    box.close();   

    }   

 

 

box.center();  

box.show()  

aas.png

TOPICS
Actions and scripting

Views

482

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Oct 26, 2018 Oct 26, 2018

Change lines 45 with this:

value.text = slider.value.toFixed(0).replace("-","");

Votes

Translate

Translate
Adobe
Contributor ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

Change lines 45 with this:

value.text = slider.value.toFixed(0).replace("-","");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

LATEST

simply change:

var slider = add("slider",undefined, 0, -20, 20);

to

var slider = add("slider",undefined, 20, 0, 100);

gaussian blur didn't have negative values

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines