Changing MESSAGE when redefining buttons PROMPT

Changing MESSAGE when redefining buttons PROMPT

Post by Steven Brag » Tue, 15 Aug 1995 04:00:00



  Was wondering if it was possible to change a buttons MESSAGE when you
redefine the prompt using SHOW GET etc.  The Wizards I've seen from
FPW2.6 don't do it.  Two buttons, Edit and Delete, are redefined to be
Save and Cancel respectively.  However, if the user makes Cancel the
active GET field, the user message still reads 'Delete current record.'  
Seems if you are able to change a buttons prompt, and therefore the
buttons purpose, that you should also be able to redefine the message
value for that button.  Any ideas?

Steven Brague

 
 
 

Changing MESSAGE when redefining buttons PROMPT

Post by Joe Ha » Tue, 15 Aug 1995 04:00:00


Not sure if you want to change the prompt on a button, or the message
on the status bar.

chg button prompt:  show get mbutton,1 prompt 'new prompt'
 (you can do this in screen show gets, or in a field-valid)

chg status bar msg:  set message to 'the new message'

hope this helps.    Joe

Quote:>  Was wondering if it was possible to change a buttons MESSAGE when you
>redefine the prompt using SHOW GET etc.  The Wizards I've seen from
>FPW2.6 don't do it.  Two buttons, Edit and Delete, are redefined to be
>Save and Cancel respectively.  However, if the user makes Cancel the
>active GET field, the user message still reads 'Delete current record.'  
>Seems if you are able to change a buttons prompt, and therefore the
>buttons purpose, that you should also be able to redefine the message
>value for that button.  Any ideas?



 
 
 

Changing MESSAGE when redefining buttons PROMPT

Post by Steven Brag » Thu, 17 Aug 1995 04:00:00


Ok, what I was really shooting for is this...I have one button that
enables the user to delete a record.  However, if the current record *IS*
deleted then the prompt on the button changes to 'Recall' via show get
del_btn,1 prompt '\<Recall' etc etc.  Then code inside the screen
prog determines whether the record is to be deleted or recalled.  Problem
is that the message attributed to this button is always (as far as I can
see anyway) going to be 'Delete current record' or whatever it was
initially set to.  Be nice to be able to redefine the message after I
redefine the prompt.

Steve Brague

 
 
 

Changing MESSAGE when redefining buttons PROMPT

Post by Bruce Sheffe » Thu, 17 Aug 1995 04:00:00


The only way I know to do this is to make all your buttons single
buttons.  Then you can use an invisible button to represent your actions
in that location.  You will have to draw a button there with the
appropriate label and update it but it will be the invisible button that
is actually activated by enter or mouse.
 
 
 

Changing MESSAGE when redefining buttons PROMPT

Post by Joe Ha » Fri, 18 Aug 1995 04:00:00


(snip)

Steve - I do not use the message snippet for a field.  Where you are
setting the prompt, why not put:
set message to 'Delete current record?'   or   'Recall?'
directly after it?  Don't use the message snippet at all.

Otherwise, you will need a memvar that says deleting or recall, then
in  the message snippet (as an expression, not procedure), use
iif(m.delete,"Delete current record","Recall").  
I guess this would work.  Again, I use set message in the valid.

I hope this is what you are looking for.    Joe

 
 
 

Changing MESSAGE when redefining buttons PROMPT

Post by Steven Brag » Sat, 19 Aug 1995 04:00:00


Thanks, Joe.  IFF snippet did the trick.  Still learning my way around
Foxpro.  Haven't quite mastered all the little tricks o' the trade yet.

Thanks again,
Steve

 
 
 

Changing MESSAGE when redefining buttons PROMPT

Post by Brian Copela » Wed, 23 Aug 1995 04:00:00


B>Ok, what I was really shooting for is this...I have one button that
B>enables the user to delete a record.  However, if the current record
B>*IS*  deleted then the prompt on the button changes to 'Recall' via
B>show get  del_btn,1 prompt '\<Recall' etc etc.  Then code inside the
B>screen  prog determines whether the record is to be deleted or
B>recalled.  Problem  is that the message attributed to this button is
B>always (as far as I can  see anyway) going to be 'Delete current
B>record' or whatever it was  initially set to.  Be nice to be able to
B>redefine the message after I  redefine the prompt.

B>Steve Brague

In the message clause of the button use a named expression such as
(m.mess).  You can then redefine m.mess each time you recall or delete a
record.  I would also add the following snippet to the code after the
SCATTER MEMVAR command.

    if deleted()
        m.mess='Recall Record'
    else
        m.mess='Delete Record'
    endif


 
 
 

1. Change Button Prompts

I'd like to change the prompt on a pushbutton, depending on the status of a
variable.

I've got a regular pushbutton with the variable "m.button". I have another
variable named "m.prompt" that will change depending on what the user
wants.

When m.prompt = 1, I want the button's prompt to be "Blue".
When m.prompt = 2, I want the button's prompt to be "Red".
When m.prompt = 3, I want the button's prompt to be "Green", and so on.

I'm assuming I'll need a CASE statement such as:

=====
DO CASE
        CASE  m.button = 1
                .
                .
                .
        CASE  m.button = 2
                .
                .
                .
        CASE  m.button = 3
                .
                .
                .
ENDCASE
SHOW GETS
=====

Anyone know what I should be putting in the CASEs?

Thanks

--
============================================================

Burnaby, B.C.       CompuServe: 72550,2271
============================================================

2. VB3 to VB5 C/S feasibility

3. Mac Push Buttons - Changing Colors When Buttons Pushed

4. Upgrading SQL, Win Box questions -- any suggestions welcomed

5. Interrupt button on PROMPT statement in Dynamic-4GL

6. Importing text into a temp table... Progress 8.3C on Solaris Unix.

7. Flexible radio button prompt

8. Inefficient IN clause?

9. Message Access denied starting command prompt replication

10. How to delete record without prompt message?

11. Prompt message...

12. psql: Prompt change

13. Cached updates--Automatic save changes prompt