Old 11-15-2018, 12:49 PM   #361
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 56
Default

Quote:
Originally Posted by Lokasenna View Post
Did you remember to include a call to the original methods inside both of yours? If you forget that, then the element literally doesn't know anymore what it's supposed to be doing.
I'm not sure, are these right? I just copy from where I declared them the first time. And "onmousedown" still worked but "ondrag" didn't

PS:I said the ondrag thing did not work, it meaned the slider was not only failed to run functionB, but also failed to drag the slider’s handle

Code:
function functionB()

 some codes

end

function functionA()

  some codes

    GUI.New("mylider", "Slider", {     --recreate the slider
        z = 11,
        x = 1096.0,
        y = 5.0,
        w = 106,
        min=0,
        max=newvalue,                  -- new value of max
        defaults=0,    
        caption = "myslider",
        font = 3,
        col_txt = "txt",
        --col_fill = "elm_frame",
        show_values=false
       
    })    

    function GUI.elms.myslider:onmousedown()      --have to declare it again

     GUI.Slider.onmousedown(self)
   
      funntionB()
      
    end
    
    function GUI.elms.myslider:ondrag()           --have to declare it again

      GUI.Slider.ondrag(self)

      functionB()

    end

  reaper.defer(functionA)

end

Last edited by dsyrock; 11-15-2018 at 06:19 PM.
dsyrock is offline   Reply With Quote
Old 11-17-2018, 10:08 PM   #362
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 390
Default

How do I , oh how do I... not the song, but how do I call a function once the text is entered in the "Textbox" ?
MusoBob is offline   Reply With Quote
Old 11-17-2018, 11:46 PM   #363
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,917
Default

Maybe Check the events in textbox class? onSomething. I am not on computer so can't help.
deeb is offline   Reply With Quote
Old Yesterday, 05:07 AM   #364
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 390
Default

Thanks, I could see onmousedown() ondoubleclick() onupdate() ontype() onwheel() ondrag()

Code:
function GUI.elms.bar1_1:onmousedown()
         reaper.SetEditCurPos(0.0, 0, 0)   
         reaper.Main_OnCommand(40616,0) --Markers: Edit region near cursor
end
to bring up Edit region near cursor.

I can't see how to get
red, green, blue = reaper.ColorFromNative(region_color)
in a frame background color
bg = ????,


..
MusoBob is offline   Reply With Quote
Old Yesterday, 09:35 AM   #365
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,917
Default

Quote:
Originally Posted by MusoBob View Post

to bring up Edit region near cursor.

I can't see how to get
red, green, blue = reaper.ColorFromNative(region_color)
in a frame background color
bg = ????,


..
maybe better to ask in another thread, as more people will be able to reply : )
deeb is offline   Reply With Quote
Old Yesterday, 12:22 PM   #366
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 390
Default

red, green, blue = reaper.ColorFromNative(region_color)
GUI.colors["region"] = {red, green, blue, 255}


GUI.New("frame_1", "Frame", {
z = 11,
x = x1+0.0,
y = y1+192.0,
w = 255,
h = 40,
shadow = false,
fill = false,
color = "elm_frame",
bg = "region",
round = 0,
text = "17",
txt_indent = 0,
txt_pad = 0,
pad = 1,
font = 4,
col_txt = "txt"
})

Last edited by MusoBob; Yesterday at 03:30 PM.
MusoBob is offline   Reply With Quote
Old Yesterday, 04:35 PM   #367
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 390
Default

I can update the textbox value
GUI.Val("bar1_1", chord_name)
I need to also to update the Frame bg color in the above post.
MusoBob is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.