[adm2-dev] enabling a button in dyntoolbar

Posted by LegacyUser on 05-Sep-2002 05:18

Hello,

I come and ask for your knowledge again.

We added a button in the toolbar following John Sadd Paper on toolbar

customization.

Here what we did :

actioncustom.p :

initaction (override) :

DEF VAR xcColumns AS CHAR INIT

"Name,Caption,Image,Type,OnChoose,Parent":U.

&SCOP dlmt + CHR(1) +

RUN SUPER.

DYNAMIC-FUNCTION ('defineAction':U IN TARGET-PROCEDURE,

"Excel":U,

xcColumns,

"Excel"

"Excel"

"exit.bmp":U

"PUBLISH":U

"exportExcel":U

"FUNCTION":U

).

toolbarcustom.p :

setbuttons (override) :

DEFINE INPUT PARAMETER pcState AS CHAR NO-UNDO.

DYNAMIC-FUNCTION

('enableActions':U IN TARGET-PROCEDURE, 'Excel':U).

/* In our case we always invoke the standard setButtons, but in

other cases the local version might not want to RUN SUPER if the

case has already been dealt with here. */

RUN SUPER(pcState).

END PROCEDURE.

When we draw the toolbar and access to instance properties, we get the new

defined action under 'Function' group.

But when we run our smartwindow, despite the unconditionnal 'enableactions'

inside SetButtons (which is effectively executed) the button is not enabled.

If you have any clue, please tell us.

Thanks in advance.

Sylvestre SEGURON

To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

For additional commands, e-mail: dev-help@adm2.possenet.org

All Replies

Posted by LegacyUser on 05-Sep-2002 09:10

Posted by LegacyUser on 10-Sep-2002 08:02

If you are running with Dynamics, 'publish' actions should be enabled by

default, so I assume you are running without. On non-Dynamics you need to

enable the action, but since setButtons is no longer called by default code,

you need to do it somewhere else.

You should be able to set this immediately, but I just looked in the code

and it seems as there is a bug in 9.1D (non-dynamics), that makes it

necessary to do this AFTER the button has been created, like in an override

of initializeObject or maybe initializeToolbar.

HÃ¥vard

-Original Message-

From: Sylvestre Seguron

Sent: Thursday, September 05, 2002 6:18 AM

To: Adm2 Dev (E-mail)

Subject: enabling a button in dyntoolbar

Hello,

I come and ask for your knowledge again.

We added a button in the toolbar following John Sadd Paper on toolbar

customization.

Here what we did :

actioncustom.p :

initaction (override) :

DEF VAR xcColumns AS CHAR INIT

"Name,Caption,Image,Type,OnChoose,Parent":U.

&SCOP dlmt + CHR(1) +

RUN SUPER.

DYNAMIC-FUNCTION ('defineAction':U IN TARGET-PROCEDURE,

"Excel":U,

xcColumns,

"Excel"

"Excel"

"exit.bmp":U

"PUBLISH":U

"exportExcel":U

"FUNCTION":U

).

toolbarcustom.p :

setbuttons (override) :

DEFINE INPUT PARAMETER pcState AS CHAR NO-UNDO.

DYNAMIC-FUNCTION

('enableActions':U IN TARGET-PROCEDURE, 'Excel':U).

/* In our case we always invoke the standard setButtons, but in

other cases the local version might not want to RUN SUPER if the

case has already been dealt with here. */

RUN SUPER(pcState).

END PROCEDURE.

When we draw the toolbar and access to instance properties, we get the new

defined action under 'Function' group.

But when we run our smartwindow, despite the unconditionnal 'enableactions'

inside SetButtons (which is effectively executed) the button is not enabled.

If you have any clue, please tell us.

Thanks in advance.

Sylvestre SEGURON

To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

For additional commands, e-mail: dev-help@adm2.possenet.org

To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

For additional commands, e-mail: dev-help@adm2.possenet.org

This thread is closed