process enter key using wx_erlang (erlang port wxwidgets) - erlang

I am building a simple browser in erlang, using wx. This simple browser has a text box for entering a url. I want to execute a callback when the user presses the enter key while in the text box.
I can see several potential ways of doing this, one option would be to process each keypress event, and execute its default action unless it is an enter key, in which case the custom processing occurs.
I was hoping there might be a higher level event I could use, like control lost focus. I am new to wx, and do not mind if programmers using other tools comment as the question (at this stage) is more about using wx that a particular language binding.

Not sure how is it called in wx_erlang, but there is wxEVT_TEXT_ENTER event to which you should bind. Note that you must create the control with wxTE_PROCESS_ENTER style to get this event.

Related

How to listen to all content changes in tinyMCE

I am setting up an tinyMCE version 4.x editor to run on mobile in a WebView. I need to know about all content changes i.e. when I type new text etc. I have added listeners for NodeChange and Change but I am not getting notifications for all changes. An example is the case when I have a list item and i type text in it. All I get is the notification on the first char typed, then the notification stop until I hit return to create a new list item, then the same scenario repeats...
Is there any other way I can hook up a listener to get all content change notifications?
There are a whole bunch of events you can hook into:
https://www.tinymce.com/docs/advanced/events/#editorevents
It would seem that the one you have chosen is not granular enough for your needs so I would look for a different one (or ones) that provide you the granularity you need. Worst case you could get notified on each keypress if need be.

How to disable textbox dropdown suggestions on certain websites?

I am trying to make my job easier by creating simple AHK scrips to auto-fill certain forms online.
Im not really good at explaining, but hopefully someone will understand what Im saying. The problem is that this website has certain textboxes with dropdown auto-suggestions turned on, and it has a delay when selecting those textboxes. I assume when selecting textbox it is pulling data from some database which is causing delay. Now my question is. Is it possible to turn off dropdown menu on websites or even in entire browser if necessary? I really want to my script to tab-in, wright down whats needed, tab-out without delay.
Autocomplete dropdown lists are just JS scripts. So there is no way, I think, to disable them by clicking checkbox in browser settings.
First, try to disable JS completely.
Also, if only few sites are involved, you could try to find out what JS libraries are used and disable them in browser JS console.
Are you planning to do this via keypresses or via COM?
I imagine that via keypresses you could not avoid focusing the elements and triggering the information lookup.
AutoHotkey can interact with webpages on Internet Explorer using COM (Component Object Model).
COM can launch/latch onto an IE instance, detect if the page is loading/has loaded, navigate to a particular url, and set the text of web elements,
quite possibly without triggering the drop-down lists. I haven't tested if COM can disable elements, it's possible.
Also, Acc.ahk may be able to set the text of elements.

How to open a vaadin combobox programmatically

I have implemented a poor-mans-searchbox using a combobox. The search expression is typed into the textfield and the user press enter. Then the search expression is added to the combo model, this is caught in the eventhandler which then runs the search, empties the combo list and populates it with the searchresults instead. However, the user then need to open the combo list manually (by pressing the little down-arrow) to see the result. It'd be nice to open the list automatically, but I haven't found out how to do that. Does anyone know?
Also the search should be performed each time the user presses a key, and not only after enter is pressed.
Not as the poor man's solution, but you may extend the client side to do that. Tipically, the client side widget would have some method like "openResultsBox" or something similar. You could call that to open up the box. Vaadin 7 also allows you to write extensions which basically lets you extend the client side for exactly doing the very same slight changes. I am not sure why you have chosen the combobox for that though.
the vaadin-combo-box component offers a method called "open" so simply call
reference-to-element.open();
Should do the trick.
Relevant official docs here:
https://www.webcomponents.org/element/vaadin/vaadin-combo-box/elements/vaadin-combo-box#method-open

How to run a command when clicking submit button (lua)?

i want to use lua to generate cgi-webpages with uhttpd. What's the correct way to execute a shell command when a button (submit form), or a link is clicked?
Thanks
If you are asking for the specifics of what form the HTML would take and the server side scripts in order to do what you want, then your question is way too broad. If you're just wondering about the Lua side of running shell command:
The HTTP GET (link click) or POST (form) would cause one of your Lua functions to get called, wherein you would call os.execute('your-command'). However, due to the obvious security risk associated with calling os.execute, some environments that embed Lua disable certain calls. I don't know anything about the Lua modules allowed by uhttpd. With some luck, it supports the call, and it's up to you to make the proper checks if you want to use it.

Assigning Fogbugz cases programmatically

I want to write an application that assigns Fogbugz cases programmatically, how would I accomplish this? Is it possible to achieve this given any of the following scenarios:
The user enters text in my
application's input field and the
Fogbugz report is opened in the
browser where the "note" field is
populated with the text from the user
input
The fogbugz report is assigned to the
specified user in the application
without the browser even being opened
i.e. the report is stored directly in
the DB.
I'm planning to add default values to the other fields as well so I would assume the process would be the same for adding text to the "note" field.
You can do this with the Fogbugz API. See the heading "Editing Cases" for the specifics on how to edit a case (which includes creating a new one). It's a little complicated (or perhaps just oddly designed) but, as I remember, you basically have to call cmd=new if you want to create a new case, supply your text in the 's' parameter and set the ixPersonAssignedTo to the correct person. For an existing case, use cmd=edit.
This is possible both with a regular form posted to your Fogbugz installation and some server side code that calls the API.
You might want to write a plugin for FB and allow others to use it. (share it or sell it)

Resources