Old 07-30-2017, 07:46 AM   #41
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by deeb View Post
but now i had the need to use this, to make the onmouse work for many elements:
Code:
function GUI.MyMenuBox:onmouseup()
    GUI.Menubox.onmouseup(self)
end
and i have an error: "stack overflow" on the console. I still didnt find how to
You should not do recursion (functions calling themselves) unless there's some terminating condition involved. Your function probably just calls itself over and over (via the other function) until the stack overflows.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 07-30-2017, 09:28 AM   #42
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Quote:
Originally Posted by Xenakios View Post
You should not do recursion (functions calling themselves) unless there's some terminating condition involved. Your function probably just calls itself over and over (via the other function) until the stack overflows.
nice Xenakios thanks for the heads up! now it makes sense : )

Lokasenna, so i update my issue. This is what i am having problems making happening:
Code:
GUI.MyMenuBox = GUI.Menubox

function GUI.MyMenuBox:onmouseup()
   (i need to do stuff here, that is why the purpose of extending MenuBox 
   The purpose is to add an onSelect event on all MenuBox, and avoid having to click a button to 
   do some action. 
   )
end
  
GUI.New("menu","Menubox",	  1, 10, 10, 250, 30, "choose:", "A,B")
As it is the menu displays, only "A", and won't show the options.
If i copy the method from function GUI.Menuboxnmouseup() at "Class - Menubox.lua" fires: GUI.MyMenuBoxnmouseup() and the choices "A,B" become available (which seems good), but when clicking the choice it does not fire this function GUI.MyMenuBoxnmouseup() again, which is not what i want. Also it's ugly to see all code GUI.Menuboxnmouseup() at "Class - Menubox.lua" in my GUI.MyMenuBoxnmouseup().


between: stupid ""

If it's possible and makes sense i go this way (y), otherwise i'll use the same way i see in your examples which is a button for triggering this.
deeb is offline   Reply With Quote
Old 07-30-2017, 03:58 PM   #43
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

- When you write your new :onmouseup function, it still has to call the original code for the original behavior to happen - your last example just does the new stuff and nothing else.

- I think the stack overflow error is because you're referring to Menubox from one of the MyMenuBox functions. Lua gets weird sometimes with stuff like that; I don't know why.

Try:
Code:
GUI.MyMenuBox = GUI.MenuBox

-- Just copying the mouseup code so it doesn't get lost
GUI.MyMenuBox.mouse_up(self) = GUI.MyMenuBox.onmouseup

function GUI.MyMenuBox:onmouseup()

  ...your code...

  self:mouse_up

end
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 07-31-2017, 04:06 PM   #44
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Updated the Checklist and Radio classes to fix the padding/detection issue discussed above.

Also adjusted the positioning of the options a little, so clicking the empty space between them should now correctly "round" up or down instead of always rounding to the option above.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 08-14-2017, 08:11 AM   #45
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

hello lokasenna. I have updated and everything is smooth thank you!

I would like to know how you would deal if you had this situation:
Code:
GUI.MyMenubox = GUI.Menubox
GUI.MyMenubox.mouse_up= GUI.MyMenubox.onmouseup
function GUI.MyMenubox:onmouseup()	
    self:mouse_up

   -- update the visible elements
   
   
end



GUI.New("tabs", 	"Tabs", 		1, 0, 0, 64, 20, "Tab 1,Tab 2", 16)

optionValues={"A","B","C","D","E","F"} 
GUI.New("my_mnu", 	"MyMenubox", 		3, 1, 40, 64, 20, "Option:", table.concat(optionValues, ","))

for i, v in ipairs(optionValues) do
      GUI.New("my_lbl"..i, 	"Label", 		3, 1,50+ 30*i, "Label on Tab1 visible if option "..v.." selected!", true, 1)
end

I would like in this example the labels to be shown if the corresponding option is selected. I don't know if i should make a new z layer, or whatever. That is why i am asking your opinion.

1) The direct way should be on mouse_up :
Code:
foreach label 
   -> change to z to 0  if supposed to be unvisible
   ->change to z to 3 if supposed visible
end
2) a more interesting way would be to override:

Code:
GUI.New = function (name, elm, ...)
with:
Code:
GUI.New = function (zz ,name, elm, ...)
or

Code:
GUI.New = function (optionOwner ,name, elm, ...)
and then on mouse_up update GUI elements.

3) so i would like to know your thought. What would be you're way of doing this? 1, 2 or which way?

4) Also: is there a way to call the new element instead of a string to be an array?
like this:
Code:
GUI.New("slidername[0]", "MySlider", 1, 1, 1 , 150, "", 0, 100, 100, 50, "h")
or it doesnt make sense at all?

5) Also : ) is there a way to know is there is any modifier key pressed inside a function like this:

Code:
GUI.MyChecklist = GUI.Checklist
GUI.MyChecklist.mouse_up= GUI.MyChecklist.onmouseup
function GUI.MyChecklist:onmouseup()
  - Here i want to know if ctrl key is being pressed
end
edited: we can use: gfx.mouse_cap as i was told by Xenakios once

Thank you


Edit: Don't spend much time on this: for now they are just theorically question and interesting for future, but i am not even sure if i need this (1,2,3,4), but i am curious anyway and i guess good info for someone who uses this Lib.

Last edited by deeb; 08-14-2017 at 11:25 AM.
deeb is offline   Reply With Quote
Old 08-14-2017, 10:31 AM   #46
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by deeb View Post
between: stupid ""
FYI, if you put code in code tags you wont see those smileys,

[CODE]
< your code here :) >
[/CODE]


Or use the noparse tags,

[NOPARSE]
< your text here :o >
[/NOPARSE]

Edgemeal is offline   Reply With Quote
Old 08-14-2017, 10:42 AM   #47
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default


hehe nice :)
deeb is offline   Reply With Quote
Old 08-15-2017, 10:02 AM   #48
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

meanwhile i have noticed something interesting/ugly:
i am using a lib to help debug which is called: inspect
if this get's triggered once or multiple times:
Code:
function GUI.MyMenubox:onmouseup()	
    self:mouse_up()
    DBG("",true)
    DBG("Without any modification",true)
    DBG("-----------------------------------",true)
    DBG(inspect(GUI.elms_list),true)
    
   
    GUI.elms["my_lbl2"].color="magenta"
    GUI.elms["my_lbl3"].color="magenta"
    DBG("After setting element 2 and 3 to magenta",true)
    DBG("-----------------------------------",true)
    DBG(inspect(GUI.elms_list),true)   
end
this get's printed:
Code:
Without any modification
-----------------------------------
{ { "tabs" }, {}, { "my_lbl2", "my_lbl6", "my_lbl4", "my_mnu", "my_lbl3", "my_lbl1", "my_lbl5" },
  [0] = {}
}
After setting element 2 and 3 to magenta
-----------------------------------
{ { "tabs" }, {}, { "my_lbl2", "my_lbl6", "my_lbl4", "my_mnu", "my_lbl3", "my_lbl1", "my_lbl5" },
  [0] = {}
}
which seems normal, as the data structure is equal, altho i have no idea what "[0] ={}" means here...
but if i change the "z" and instead use the function like this:

Code:
function GUI.MyMenubox:onmouseup()	
    self:mouse_up()
    DBG("",true)
    DBG("Without any modification",true)
    DBG("-----------------------------------",true)
    DBG(inspect(GUI.elms_list),true)
    
    GUI.elms["my_lbl2"].z=333
    GUI.elms["my_lbl3"].z=334
    DBG("After setting a new 'z' to element 3",true)
    DBG("-----------------------------------",true)
    DBG(inspect(GUI.elms_list),true)         
end

this get's printed:

Code:
Without any modification
-----------------------------------
{ { "tabs" }, {}, { "my_lbl1", "my_mnu", "my_lbl3", "my_lbl2", "my_lbl6", "my_lbl4", "my_lbl5" },
  [0] = {}
}
After setting a new 'z' to element 3
-----------------------------------
{ { "tabs" }, {}, { "my_lbl1", "my_mnu", "my_lbl3", "my_lbl2", "my_lbl6", "my_lbl4", "my_lbl5" },
  [0] = {}
}
but second time look at what happens to the structure:

Code:
Without any modification
-----------------------------------
{ { "tabs" }, {}, { "my_lbl6", "my_lbl5", "my_lbl4", "my_mnu", "my_lbl1" },
  [0] = {},
  [333] = { "my_lbl2" },
  [334] = { "my_lbl3" }
}
After setting a new 'z' to element 3
-----------------------------------
{ { "tabs" }, {}, { "my_lbl6", "my_lbl5", "my_lbl4", "my_mnu", "my_lbl1" },
  [0] = {},
  [333] = { "my_lbl2" },
  [334] = { "my_lbl3" }
}
Notice the change to [333] = { "my_lbl2" }, [334] = { "my_lbl3" } in which [333] and [334] are the new "z" values and { "my_lbl3" } and { "my_lbl2" } are the elements with new "z".

I was not expecting when using GUI.elms["name"].z=666 to alter GUI.elms_list structure. So i wonder if this a normal behaviour?

Just in case you don't know and need inspector you can get here: https://github.com/kikito/inspect.lua and use with your req function to import . If you need me to send the files we'll figure out a way too.

Thank you

Last edited by deeb; 08-15-2017 at 11:20 AM.
deeb is offline   Reply With Quote
Old 08-16-2017, 06:33 AM   #49
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

hello! another request: i could swear i had seen in the examples but i don't find so i am afraid probably i got the wrong idea. Would be nice if there was a disable toggle for every element.
Clicking disabled and slight graphic change to help noticing elements state.

Thank you
deeb is offline   Reply With Quote
Old 08-17-2017, 03:32 PM   #50
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by deeb View Post
I would like in this example the labels to be shown if the corresponding option is selected. I don't know if i should make a new z layer, or whatever. That is why i am asking your opinion.

1) The direct way should be on mouse_up :
Code:
foreach label 
   -> change to z to 0  if supposed to be unvisible
   ->change to z to 3 if supposed visible
end
That's how I would do it, yeah. Don't use layer 0, though; that refers to all of the layers in a couple of functions, so hiding it might cause problems. For instance, GUI.redraw_z[0] redraws all of the visible layers on the next update.

Code:
GUI.elms_hide[3] = true

...

function GUI.MyMenubox:onmouseup()	
    GUI.Menubox.onmouseup(self)

   -- update the visible elements

   local vis = GUI.Val("my_mnu")

   for i = 1, #optionValues do
      
      GUI.elms["mylbl"..i].z = (i == vis) and 1 or 3

   end
      
end
Quote:
2) a more interesting way would be to override:

...

and then on mouse_up update GUI elements.
Since you have to loop through all of the labels to make sure only the correct one is visible, this wouldn't really be saving any time/effort.

Quote:
4) Also: is there a way to call the new element instead of a string to be an array?
like this:
Code:
GUI.New("slidername[0]", "MySlider", 1, 1, 1 , 150, "", 0, 100, 100, 50, "h")
or it doesnt make sense at all?
- Lua won't interpret that as an array, it's just a string that happens to have [ and ] in it.

- The elements are all part of an array already, GUI.elms{}, and each element is an array itself, so you can't really mess with the structure there without breaking things.

Your example above (name = "mylbl"..i) is the correct way to do it.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 08-19-2017, 04:02 PM   #51
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by deeb View Post
hello! another request: i could swear i had seen in the examples but i don't find so i am afraid probably i got the wrong idea. Would be nice if there was a disable toggle for every element.
Clicking disabled and slight graphic change to help noticing elements state.

Thank you
Sorry, I didn't see this post.

In my own scripts I just create a translucent frame over all of the disabled elements and place it in a lower-value z layer so it "blocks" them from receiving input - for example, Radial Menu Setup's "Menu" tab disables all of the current button options if there isn't a button selected.

You can also use GUI.elms_freeze[X] = true to disable an entire layer. It will still be visible, but the input logic completely skips every element on it.

Neat idea though, I'll add it to my "maybe" list.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate

Last edited by Lokasenna; 08-19-2017 at 04:09 PM.
Lokasenna is offline   Reply With Quote
Old 08-19-2017, 04:06 PM   #52
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

- Updated the Tabs, Radio, and Slider classes to round all mousewheel input to an integer - some systems are able to pass a decimal value, and it was crashing the UI by trying to open tab #1.05, etc.

- Updated the Menubox class to avoid a crash when scrolling the mousewheel on a menubox with no options in it.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 08-20-2017, 07:06 AM   #53
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Quote:
Originally Posted by Lokasenna View Post
- Updated the Tabs, Radio, and Slider classes to round all mousewheel input to an integer - some systems are able to pass a decimal value, and it was crashing the UI by trying to open tab #1.05, etc.

- Updated the Menubox class to avoid a crash when scrolling the mousewheel on a menubox with no options in it.
Nice!

Quote:
Originally Posted by Lokasenna View Post
Sorry, I didn't see this post.

In my own scripts I just create a translucent frame...
np ! cool will check it later! meanwhile have you see this post i wrote?

Quote:
Originally Posted by deeb View Post
meanwhile i have noticed something interesting/ugly:
i am using a lib to help debug which is called: inspect
if this get's triggered once or multiple times: (...)


Many many thanks! all good
deeb is offline   Reply With Quote
Old 08-20-2017, 02:59 PM   #54
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by deeb View Post
np ! cool will check it later! meanwhile have you see this post i wrote?
GUI.elms_list exists solely to keep track of which z-layer each element is on so they can be updated/redrawn in the correct order. Have a look at GUI.update_elms_list in Core.lua - it runs on every update loop:

- For every element in GUI.elms...
---- If z = -1, delete it from the table.
---- Otherwise, add it to the appropriate subset of the z table
---- If the script is still starting up, call the element's :init method - this is where the stock classes get their blitting buffers, etc

- Fill in the table with any empty z-layers so we can use ipairs() on it, and note the highest value - the script needs to know this when it's updating/drawing elements so it has end/start points, respectively.

The table is being printed out the way you see because (I think) of how Lua handles table indexes - 1 is the default start point, so any contiguous values starting from there don't need to be explicitly stated. [0] and [333] are outside that pattern, so they need to be named.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate

Last edited by Lokasenna; 08-21-2017 at 03:28 PM.
Lokasenna is offline   Reply With Quote
Old 08-20-2017, 06:28 PM   #55
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Quote:
Originally Posted by Lokasenna View Post
GUI.elms_list exists solely to keep track of which z-layer each element is on so they can be updated/redrawn in the correct order. Have a look at GUI.update_elms_list in Core.lua - it runs on every update loop:

- For every element in GUI.elms...
---- If z = -1, delete it from the table.
---- Otherwise, add it to the appropriate subset of the z table
---- If the script is still starting up, call the element's :init method - this is where the stock classes get their blitting buffers, etc

- Fill in the table with any empty z-layers so we can use ipairs() on it, and note the highest value - the script needs to know this when it's updating/drawing elements so it has end/start points, respectively.

The table is being printed out the way you see because (I think) of Lua handles table indexes - 1 is the default start point, so any contiguous values starting from there don't need to be explicitly stated. [0] and [333] are outside that pattern, so they need to be named.
ohh ok i see.never mind then! sorry I thought it was something interesting. Thank you for taking the time !
good music
deeb is offline   Reply With Quote
Old 08-21-2017, 03:28 PM   #56
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Update - replaced all instances of os.clock with reaper.time_precise to avoid some bugs on Mac.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 09-12-2017, 08:33 AM   #57
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Now it's much smoother on mac ! very cool update.
Also I would like to make a small request: multiple rows for Tabs would be really useful !

Thanks
deeb is offline   Reply With Quote
Old 09-26-2017, 01:04 PM   #58
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Tiny update - the Knob class was ignoring min/max values when displaying steps around the knob.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-08-2018, 02:27 PM   #59
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Update! O frabjous day!

Two new classes, since I needed them for a script idea:



Classes and an example script are on the ReaTeam Template repo under GUI, along with everything else.

Also a few minor bug fixes, redundant code, tidying, etc.

(cheers to eugen2777 for the basic text editor code in his ChunkEditor script)
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate

Last edited by Lokasenna; 04-08-2018 at 02:34 PM.
Lokasenna is offline   Reply With Quote
Old 04-08-2018, 03:18 PM   #60
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Thanks!
deeb is offline   Reply With Quote
Old 04-08-2018, 03:56 PM   #61
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Excellent !

Multiline textbos is always something I wanted to have ! Pure lua will be ore portable than my python tkinter solution.

I tested it a bit, but I found a error:
https://i.imgur.com/K4pFhyi.gifv

Pasting multiline text over multiline text selection make the script crash. :S
X-Raym is offline   Reply With Quote
Old 04-08-2018, 04:04 PM   #62
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Page down and Page up keyboard button also makes instant crash:

...mplates\GUI\Lokasenna_GUI\Classes/Class - TextEditor.lua:309: attempt to call a nil value (field '?')

(also the Insert button, though I don't really use it).
X-Raym is offline   Reply With Quote
Old 04-09-2018, 08:13 AM   #63
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Insert, Page Up, and Page Down don't do anything yet. I'll add a quick error check for that though, and I'll have a look at the other crash. Cheers.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-09-2018, 11:43 AM   #64
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Updated with Page Up/Down, Insert, and shift+click to select. Also found a much simpler and more accurate way to calculate which line/item was clicked.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-09-2018, 03:44 PM   #65
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Thanks !

Insert works but I still experience bugs with Page Up and Page Down

Code:
...mplates\GUI\Lokasenna_GUI\Classes/Class - TextEditor.lua:960: attempt to get length of a nil value (field '?')
Also, we can't enter non ascii character, only by copy pasting, but it behaves weirdly when we try to erase these characters:



Thanks for taking a look :P
X-Raym is offline   Reply With Quote
Old 04-09-2018, 09:22 PM   #66
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by X-Raym View Post
bugs with Page Up and Page Down
Fixed.

Quote:
we can't enter non ascii character
Fixed.

Quote:
it behaves weirdly when we try to erase these characters
That appears to be a Lua problem. The string functions all assume one byte per character, i.e. ASCII 32->127, so when you try to backspace a foreign character it only takes off the first byte and then reads the remaining byte(s) as another character.

I tried typing a bunch of foreign characters with Alt+0233, etc, and almost all of them behaved fine unless I copy/pasted them.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-10-2018, 02:28 AM   #67
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Non ascii characters seems to be fixed, nice !

Page Up and Down don't produce errors now, but they don't do anything :S

Also, Maj arrow up doesn't works in middle or end of first line (and the opposite is true for maj + arrow down).

You are very close to fully working text area box :P
X-Raym is offline   Reply With Quote
Old 04-10-2018, 02:35 AM   #68
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

I like the shadow before the scrollbar.

Quote:
Originally Posted by Lokasenna View Post
That appears to be a Lua problem. The string functions all assume one byte per character, i.e. ASCII 32->127, so when you try to backspace a foreign character it only takes off the first byte and then reads the remaining byte(s) as another character.
Lua 5.3+ has functions for working with multibyte UTF-8 characters: http://www.lua.org/manual/5.3/manual.html#6.5. utf8.len(str) instead of str:len().
cfillion is offline   Reply With Quote
Old 04-10-2018, 02:44 AM   #69
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

  • {}[] seems can't be enetered via keyboard :S
  • Pasting doesn't move the cursor at the end of the pasted section.
:P
X-Raym is offline   Reply With Quote
Old 04-10-2018, 05:55 AM   #70
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

cfillion - Thanks. Looks like I'll have to write my own .sub function to work with that, but it's a start.

X-Raym - I can type []{} just fine here, and PgUp/Dn both work. Not sure what could be going on there.

Shift+Up on the first line, etc, and moving the caret on paste will be along shortly.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-10-2018, 06:12 AM   #71
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by Lokasenna View Post
Shift+Up on the first line, etc, and moving the caret on paste will be along shortly.
Done.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-10-2018, 06:24 AM   #72
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Code:
X-Raym - I can type []{} just fine here, and PgUp/Dn both work. Not sure what could be going on there.
What variable state can I give you to help you on this ?

Quote:
Shift+Up on the first line, etc, and moving the caret on paste will be along shortly.
Good !!
X-Raym is offline   Reply With Quote
Old 04-10-2018, 06:29 AM   #73
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

You could try cfillion's GFX Keyboard Inspector and see what key codes it returns for them. Maybe they're different values on foreign keyboards, though I doubt it. I get:

Code:
[ 91
] 93
{ 123
} 125
Page Up 1885828464
Page Dn 1885824110
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-10-2018, 06:51 AM   #74
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Code:
[ 20 91
] 20 93
{ 20 123
} 20 125
Page Up 0 1885828464
Page Down 0 1885824110
(20 is for CTRL+ALT)

Seems the same as you which is good. But this means the bug come from somewhere else.
X-Raym is offline   Reply With Quote
Old 04-10-2018, 07:00 AM   #75
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Ah, I think I might see the issue - my typing logic is probably seeing Ctrl and going straight for the clipboard functions - English keyboards don't use Ctrl for any characters - so then it sees { and doesn't do anything with it.

I'll have a look at reorganizing things there.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-10-2018, 07:11 AM   #76
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Quote:
English keyboards don't use Ctrl for any characters
Yep, but CTRL+ALT (Alt Gr) is used :P
X-Raym is offline   Reply With Quote
Old 04-10-2018, 07:17 AM   #77
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

I meant that the existing logic goes:
Code:
if Ctrl then
  doclipboardstuff
elseif typeable character then
  insertchar
elseif navigation/delete/etc then
  do that function
end
So you can't type any characters that require Ctrl because it never gets to insertchar.

Like I said, just needs some reorganizing.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 04-10-2018, 07:42 AM   #78
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

OK !

Text input are very inspiring, I have still few ideas left (but I dont want to spam you with all of them :P)

Though, I think something which could be useful right from the start is the ability to have an horizontal bar when a line is too long (just like you have done with the vertical one).
Also for the moment, it doesn't scroll if click drag select a line longer than the view (nor to the left, nor the right). The only way to get back to the begining is to enter a new line, or click on a shorter line.



X-Raym is offline   Reply With Quote
Old 04-10-2018, 07:52 AM   #79
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
Default

wow you guys are so smart for devolopping so good programs for use in Reaper. Thanks so much for everything. I'm going to learn very slowly about ReaScripting in Lua and try to join the efforts some how
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 04-10-2018, 08:04 AM   #80
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Characters that need Ctrl+ should be typeable now.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna 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 04:02 AM.


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