[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

Custom Dialog boxes in Frame

Title: Custom Dialog boxes in Frame


I have another API question...

I am attempting to open a multi-interaction modal dialog box but for some reason my F_ApiDialogEvent() function is never being called. I have read all the stuff in the fdk and I am doing exactly as it says (I think) but still no luck... According to the documentation if you set dlg_num to a non-zero number in the F_ApiModalDialog() function then Frame will call your client's F_ApiDialogEvent() function. The dialog box shows up fine but everytime I click one of the buttons it closes and nothing happens. I tried putting an F_ApiAlert() in the body of the F_ApiDialogEvent() function but it never showed up, indcating that the function is not even being called.

If I don't use the F_ApiDialogEvent and simply test the values of the dialog box after it closes in the main part of my code all is fine, but now that I have added a 'select all' and 'select none' button I decided to use the multi-interact modal box. I can go back to the other and do a loop but this SHOULD work according to the API. Snippets of my code as follows:

#define DLG_NUM 1
#define EVENPAGES 2
#define GRAPHICS 3
#define TABLES 4
#define CHANGEBARS 7
#define RUNAROUND 9
#define BOLDITALICS 11
#define OK 12
#define CANCEL 13
#define SELECTALL 15
#define SELECTNONE 16

//Global variables
F_ObjHandleT dlgId;

VoidT F_ApiInitialize(initialization)
IntT initialization;        /* Code for initialization type */
        // Setup the menu for the application
        F_ObjHandleT bookmainMenuId, cognosMenuId;

        /* Get ID of main book menu. */
        bookmainMenuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu, "!BookMainMenu");
        /* Add menu to main book menu */
        cognosMenuId = F_ApiDefineAndAddMenu( bookmainMenuId, (StringT)"CognosMenu", (StringT)"Cognos" );
        /* Add item to menu. */
        F_ApiDefineAndAddCommand(ProductionCheck, cognosMenuId, "ProductionCheck", "Book Production Check","");
        /* Re-order Cognos menu. */
        F_ApiSetId( bookmainMenuId, cognosMenuId, FP_NextMenuItemInMenu, 0 );


VoidT F_ApiCommand(command)
IntT command;


        /// Open the dialog box and make it modal
        dlgId = F_ApiOpenResource(FO_DialogResource, "dialog");
                F_ApiAlert((StringT) "Unable to open dialog resource", FF_ALERT_CONTINUE_WARN);
        else {
                F_ApiModalDialog(DLG_NUM, dlgId);


VoidT F_ApiDialogEvent(dlgNum, itemNum, modifiers)
        IntT dlgNum;
        IntT itemNum;
        IntT modifiers;

//For testing purposes....
F_ApiAlert("Testing whether I got here or not", FF_ALERT_CONTINUE_NOTE);

        if (itemNum == CANCEL)  {
        if (itemNum == SELECTALL)  {

                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, EVENPAGES), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, GRAPHICS), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, TABLES), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, SMARTQUOTES), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, USERVARIABLES), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, CHANGEBARS), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, RUNAROUND), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, PARAGRAPHTAGS), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, ANCHOREDFRAMES), FP_State,  1);
                F_ApiSetInt(dlgId, F_ApiDialogItemId(dlgId, BOLDITALICS), FP_State,  1);


Any ideas??? I tried defining F_ApiDialogEvent at the beginning of my program but that didn't work either.

PS Thank you for your help in the past.

Sue Mitchell
Writing Support Specialist
Cognos Inc
613-738-1338 x5461

This message may contain privileged and/or confidential information.  If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate, or distribute it; do not open any attachments, delete it immediately from your system and notify the sender by e-mail promptly that you have done so.  Thank You.