Power Cobol Function Key 
Author Message
 Power Cobol Function Key

Hi, folks

Does anynody knows  How to use Function key in a Forms ?

Using in a field  works fine  I use PreKeyUp, and I check the key that
was pressed by the user in a specific field.

I really need is in a Forms  with several  fields, in any position on
the Forms
if the user  Press F1 (for instance)  I would like to call a Help

tks

Carlos Lages

ps. I have already trying  KeyPress Event, and PreKeyPress and till now
nothing happens.



Thu, 10 Mar 2005 02:51:11 GMT  
 Power Cobol Function Key
even better is to define a prekeyup event on the form. this event is
generated before a control has the focus, and while a control has the focus
but doesn't respond to a keyup event. write your code using pow-key-f1


Quote:



> > Hi, folks

> > Does anynody knows  How to use Function key in a Forms ?

> > Using in a field  works fine  I use PreKeyUp, and I check the key that
> > was pressed by the user in a specific field.

> > I really need is in a Forms  with several  fields, in any position on
> > the Forms
> > if the user  Press F1 (for instance)  I would like to call a Help

> > tks

> > Carlos Lages

> There are two easy ways:

> 1. Define a KeyUp event for each field, checking for the F-Key in
question.
> I've attached a text file that goes through that drill.

> 2. The easiest way, however, is to define the F1 key in the menu of the
> form. As such, it is form-wide in its use.  We usually have an "About"
> choice on the main menu. Beneath that is a sub-menu containing "Help" Help
> has a shortcut key assigned, "F1" Then the "Help" click-event calls the
Help
> System. So, tapping F1 anywhere on the form is equivalent to picking
> About/Help from the main menu (because F1 is a shortcut key to the
> About/Help/Click event).

> Hope this helps.



Fri, 11 Mar 2005 20:07:46 GMT  
 Power Cobol Function Key

Hi Carlos

Did you tried to put the correct statements in the KeyPress event in the
Mainform?
The mainform has the same events that you find in the controls.

You can do a sort of:

 EVALUATE POW-KEYCODE
 WHEN POW-F1KEY
 ....do something
 WHEN  POW-F2KEY
 ... other things

                                etc etc
                             END-EVALUATE.

Gianni Spano

--
Posted via http://dbforums.com



Mon, 14 Mar 2005 04:20:14 GMT  
 Power Cobol Function Key

gmspano

the main questions is .

If i Use a example  F7  key in a field, and  use F7  in Forms
doing  diferent  thing , how can i know in Forms event, with Funcion key i
have do use ?

In other Words, the Pow-keycode will get  the same funcion key.
what I really need is, in any moment at the Forms, if the use Hit a Function
Key
(F1) for instance , I will do something, the problem is , if i have already
used
a F1 key is a field in this Forms, which one will be run ?

Tks

Carlos lages

Quote:
> Hi Carlos

> Did you tried to put the correct statements in the KeyPress event in the
> Mainform?
> The mainform has the same events that you find in the controls.

> You can do a sort of:

>  EVALUATE POW-KEYCODE
>  WHEN POW-F1KEY
>  ....do something
>  WHEN  POW-F2KEY
>  ... other things

>                                 etc etc
>                              END-EVALUATE.

> Gianni Spano

> --
> Posted via http://dbforums.com



Fri, 18 Mar 2005 23:40:50 GMT  
 Power Cobol Function Key
Carlos,

comments below...

Pete.


Quote:

> gmspano

> the main questions is .

> If i Use a example  F7  key in a field, and  use F7  in Forms
> doing  diferent  thing , how can i know in Forms event, with Funcion key i
> have do use ?

You will know by the event that is triggered. If the field with the key has
the focus, it will trigger the field event. Otherwise it will trigger the
form event.

Why would you want to apply the same key to more than one event? It's not
like there's a shortage of keys...

In fact, you CAN arrange for the key to be passed down the event chain if
you really want to have BOTH (or any number) of events processed when the
key is pressed, but this is a bit beyond COBOL (at least, I think it
is...there may be new functions in PowerCOBOL that will allow this, that I
haven't picked up yet. It isn't something I'd be racing to do...<G>)

Quote:
> In other Words, the Pow-keycode will get  the same funcion key.
> what I really need is, in any moment at the Forms, if the use Hit a
Function
> Key
> (F1) for instance , I will do something, the problem is , if i have
already
> used
> a F1 key is a field in this Forms, which one will be run ?

Like I said before, if the focus is on the field with the F1 event, then
that event will be activated. If a global (Form wide) event is defined for
F1 and there is no prior interrupt, then the form level event will be
activated. If what you have doesn't work that way, then change the priority
and order of controls on the form.

Pete.

Quote:

> > Hi Carlos

> > Did you tried to put the correct statements in the KeyPress event in the
> > Mainform?
> > The mainform has the same events that you find in the controls.

> > You can do a sort of:

> >  EVALUATE POW-KEYCODE
> >  WHEN POW-F1KEY
> >  ....do something
> >  WHEN  POW-F2KEY
> >  ... other things

> >                                 etc etc
> >                              END-EVALUATE.

> > Gianni Spano

> > --
> > Posted via http://dbforums.com

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


Sat, 19 Mar 2005 02:35:25 GMT  
 Power Cobol Function Key

Hi Carlos

I think it is depending only which control have the focus.

If the user has the focus on a textbox control and a F7 key is declared
as an event in this control, the textbox statements are executed.
If the user click on the mainform and a F7 key is declared
the F7 event of mainform is executed...

I suggest you to use  SHIFT + F??-KEY for mainform events and the normal
F??-KEY for the controls events.

Hope in this help

Gianni

--
Posted via http://dbforums.com



Sat, 19 Mar 2005 01:46:47 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. ACU Cobol function keys

2. MF COBOL animator function keys in an XTERM

3. MAPPING OF FUNCTION KEYS in cobol fujitsu

4. Function Key F11,F12 on ACU COBOL

5. HELP! Function Keys and Mouse in MF COBOL

6. Search in Fujitsu Cobol Power Cobol

7. Help with power function in SE

8. Power function

9. Power Function

10. System power-off function

11. Power function for floating point in assembler

12. Assembler Power function?

 

 
Powered by phpBB® Forum Software