OK and Cancel buttons callback

H

Hon Seng Phuah

Guest
I tried to find this newsgroup and Cadence reference softcopy
reference books but I could not find examples dealing with OK and
Cancel callback on a form.

May someone give a simple example how I can detect a user clicks OK or
Cancel button on a form?

Thanks.
-HS Phuah
 
When you call hiCreateAppForm(), you can pass the ?callback argument.
If you supply just a single symbol or string, that's the callback for the OK
only. If you supply a list, then the first entry is the OK callback, and the
second is the cancel callback. This is in the documentation (at least
I think it is - I've not checked).

So something like:

?callback list('MYokCallback 'MYcancelCallback)

where each function is written to accept a single argument - the formId.

Andrew.


On 10 Jun 2004 20:02:04 -0700, hsphuah@usa.com (Hon Seng Phuah) wrote:

I tried to find this newsgroup and Cadence reference softcopy
reference books but I could not find examples dealing with OK and
Cancel callback on a form.

May someone give a simple example how I can detect a user clicks OK or
Cancel button on a form?

Thanks.
-HS Phuah
--
Andrew Beckett
Senior Technical Leader
Custom IC Solutions
Cadence Design Systems Ltd
 
procedure( BFdisplayFeedbackForm( )

unless( boundp( 'GBfeedbackForm ) && hiIsFormDisplayed( GBfeedbackForm )
BFcreateFeedbackForm( )
) ;; close unless

hiDisplayForm( GBfeedbackForm )

) ;; close procedure BFdisplayFeedbackForm


procedure( BFcreateFeedbackForm( )
let( ( r_labelField )

r_labelField = hiCreateLabel(
?name 'r_labelField
?labelText "This is a feedbak box"
)

hiCreateAppForm(
?name 'GBfeedbackForm
?formTitle "Feedback Form"
?fields list( r_labelField )
?callback '(
"printf( \"You hit OK!\n\" )"
"printf( \"You hit Cancel!\n\" )"
)
)


) ;; close let

) ;; close procedure BFcreateFeedbackForm



See also 'Cadence User Interface SKILL Functions Reference'

Bernd


Hon Seng Phuah wrote:
I tried to find this newsgroup and Cadence reference softcopy
reference books but I could not find examples dealing with OK and
Cancel callback on a form.

May someone give a simple example how I can detect a user clicks OK or
Cancel button on a form?

Thanks.
-HS Phuah
 
hi bernd, you don't really have to worry so much about backslashing all
your strings like this... you can take advantage of th %L function
feature of printf.

?callback '(
"printf( \"You hit OK!\n\" )"
"printf( \"You hit Cancel!\n\" )"
)
?callback (list (sprintf nil "%L" '(printf "You hit OK!n"))
(sprintf nil "%L" '(printf "You hit Cancel!n") ))

obviously you can write a SKILL function to make this easier to use

(defun encap_string ( l_list)
(sprintf nil "%L" l_list))

?callback (list (encap_string '(printf "You hit OK!\n"))
(encap_string '(printf "You hit Cancel!\n")))




Bernd Fischer wrote:
procedure( BFdisplayFeedbackForm( )

unless( boundp( 'GBfeedbackForm ) && hiIsFormDisplayed( GBfeedbackForm )
BFcreateFeedbackForm( )
) ;; close unless

hiDisplayForm( GBfeedbackForm )

) ;; close procedure BFdisplayFeedbackForm


procedure( BFcreateFeedbackForm( )
let( ( r_labelField )

r_labelField = hiCreateLabel(
?name 'r_labelField
?labelText "This is a feedbak box"
)

hiCreateAppForm(
?name 'GBfeedbackForm
?formTitle "Feedback Form"
?fields list( r_labelField )
?callback '(
"printf( \"You hit OK!\n\" )"
"printf( \"You hit Cancel!\n\" )"
)
)


) ;; close let

) ;; close procedure BFcreateFeedbackForm



See also 'Cadence User Interface SKILL Functions Reference'

Bernd


Hon Seng Phuah wrote:

I tried to find this newsgroup and Cadence reference softcopy
reference books but I could not find examples dealing with OK and
Cancel callback on a form.

May someone give a simple example how I can detect a user clicks OK or
Cancel button on a form?

Thanks.
-HS Phuah
 

Welcome to EDABoard.com

Sponsor

Back
Top