PDA

View Full Version : OnNextSelection , OnNullClick


clueless
01-18-2008, 10:02 PM
Ok i realise the chances of getting these are slim but here goes..
Id like to suggest 2 extra event catagories to all current objects ;-

OnNextSelection
OnNullClick

They are both 'De-Focus' events that would only come into effect the moment a user clicks an object and would only last for 1 click.

OnNullClick - would get called if the next click from the user is on the page background.

OnNextSelection - would get called if the next click from the user is an object. + maybe some reference to which object it was.

For example: the user types something into an text input. Most of the time to aviod complicated checks on every key of the input the programmer is forced to add some type of 'ok' or 'enter' button. With either of these extra events the ok button could be eliminated.

Worm
01-18-2008, 10:10 PM
It would be nice to have a Validate event similar to VB. Using it you can keep the focus on the control until it meets criteria you specify.

RizlaUK
01-18-2008, 10:56 PM
It would be nice to see such events... ;)



but until we do, you could try this (is what i do for inputs)


-- Dummy Test Function
function MyReturnFunction(strText)
Dialog.Message("Test",strText)
end

-- Check if return key is pushed
if System.IsKeyDown(13) then MyReturnFunction(Input.GetText(this)) end

bule
01-19-2008, 08:34 AM
It would be nice to have a Validate event similar to VB. Using it you can keep the focus on the control until it meets criteria you specify.

I really need this as well, all business applications would be much easier to code with this event. I called it OnBeforeLoseFocus or something like that when I suggested this several months ago. In Delphi, this event would be OnExit.

clueless
01-19-2008, 08:53 AM
With an OnNullClick event programing things like custom popup menus would be no problem at all.

holtgrewe
01-19-2008, 09:15 AM
An action of that type would certainly be an improvment, instead of always creating work-arounds.

I may be way off-base here, or maybe I'm just getting senile, but many years ago I handled something similar to this (Imagine COBOL & CICS - OMG) by logging where the user had 'come from' on the screen/page. I used a table back then to log user screen activity, but we used the last entry to determine where the user last made an entry. The table would then be checked to make certain all fields/objects were accounted for on the screen/page.

Applying this to AMS (sans table) may look something like this:

--Place this On Focus or On Click for each editted object (depending on the object type)
-- example of Input1 On Focus
if PriorObject ~= nil then
Dialog.Message("Prior Field", ""..PriorObject)
-- do your edit on prior object [editfunct(PriorObject)]
end
PriorObject = "Input1"; -- now store this object name

For the nullclick I placed a hotspot on the page and made certain it is arranged to the BACK.

Darryl
01-21-2008, 09:23 AM
Thanks for the suggestions guys. These have been added to the list to be considered.

REF: 17140

Desolator
01-22-2008, 03:37 PM
With an OnNullClick event programing things like custom popup menus would be no problem at all.

But they're currently easy to do as well. In the page's `On Mouse Button' event do this:

local menu_id = Application.ShowPopupMenu(e_X, e_Y, popup_menu, TPM_CENTERALIGN, TPM_TOPALIGN, true, true);