Forums > MaxMSP

deselect [number] box after input

February 8, 2011 | 2:25 pm

Is there any way to deselect a number box after input is finished other then mouse-clicking into empty space?. When finishing with RETURN the number-box stays selected. With TAB it can move to the next number-box, but no way to deselect except by clicking anywhere in the empty space.



pid
February 8, 2011 | 3:19 pm

select [message]
|
thispatcher [object]


February 8, 2011 | 3:36 pm

this is pretty annoying sometimes when there are numbderboxes in a bpatcher,
you can not even deselect them by clicking somewhere else after you entered
something using the keyboard.

for entry-only numberboxes it might be wise to make your own using [lcd].


February 8, 2011 | 4:19 pm

pid: I tried to connect the number box the the thispatcher object in a bpatcher – nothing happens, number-box still selected. But may be you meant something different?

Roman Thilenius: Sorry, but I do not understand how to do that. If I open an LCD I can write something into it with message [ascii $1] but then it is stuck inside LCD and I cannot get it out. And I cannot find any description for getting it sent out to an output of the LCD. I need the number box to make an input of numbers to send them to another object, but then after the input is finished, I want it to deselect. I do not see how I can do that with LCD.

Both: Thanks for your efforts.


February 8, 2011 | 4:32 pm

@Ullstein: that’s what pid meant.

– Pasted Max Patch, click to expand. –

@roman, do you have an example? I doubt it’s still the case since Max 5.


February 8, 2011 | 5:05 pm

Thanks Emmanuel Jourdan. Yes it works, but unfortunately only outside of a bpatcher. But putting your little patch outside the bpatcher, works.

Thanks to you and pid

All the best


February 8, 2011 | 6:08 pm

@Emmanuel &c74: I would really like to see an attribute for all objects which can have focus, to free the focus after a given time. Lets call it free_focus…

Stefan


February 8, 2011 | 8:31 pm

@Ullstein: you can send a message to the main patcher to select itself.

– Pasted Max Patch, click to expand. –

February 8, 2011 | 8:49 pm

Sorry ,but I am afraid this does not work. At least not with t a bpatcher. Your earlier sugestion works very well, this one does not succeed. Still, many thanks for taking care, I really appreciate. Thank you.


February 8, 2011 | 10:05 pm

It’s really working here, with the latest Max version.


February 9, 2011 | 10:11 am

eij: right, it occurs in max4.
but :(


February 9, 2011 | 10:27 am

"but then it is stuck inside LCD and I cannot get it out."

it is of course quite some work to use lcd for things like that.

it also needs a lot of CPU, but for input elements this should not matter.

lcd has mouse drag position output, and also mouse over tracking, the
latter has to be turned on as it is off by default.
the mouse drag tracking also works when dragging outside the lcd, just
like you would exspect from a GUI element.

after you wrote something in an lcd you would do "clear", and then write the
next thing into it.
everything in background, which is overlapped by something dynamic, must
be redrawn now any time when you change something in foreground.

so if you want to have a black background, then a blue rect with white
numbers, you would initialize it by

brgb 0 0 0, clear, paintrect 25 25 75 75 0 0 200,

and then you send the "write" or ascii" stuff.

when the mousemovement now changes the number from 7 to 13,
you would have to repeat writing "paintrect 25 25 75 75 0 0 200"
in order to delete the 7 before writing the 13.

i´ve used lcd for all kind of GUI elements such as multiple sliders
in one box, XY fields limited to a circle, clickable menus, or sliders
which are bipolar, diagonal, or change color and size when moved.

it is also great for making simple little buttons or number boxes, which
is what you should start with. ^^

-110


February 10, 2011 | 2:05 pm

Thanks for all your help. I managed to make what I need with the suggestion that pid and Emmanuel made. And thank you Roman for your continuation.

All the best


Viewing 13 posts - 1 through 13 (of 13 total)