Skip to main content
Inspiring
December 13, 2021
Answered

closing one custom dialog box while keeping another one open - FDK

  • December 13, 2021
  • 1 reply
  • 325 views

Hi,

In my FDK client, I have a costume dialog box (main dialog box) that clicking one of its buttons opens another custom dialog box (second dialog box) while the main dialog box is still open. What I want is that when the user clicks OK in the second dialog box, it closes just the second dialog box. But when the user clicks the OK button in the second dialog box, FrameMaker closes both dialog boxes. In my "F_ApiDialogEvent" function, I used the "F_ApiClose" function and passed it to the second dialog box's ID. But, the result was the same; pressing the close button closes both dialog boxes immediately. 

Any help regarding this issue will be appreciated.

Sanam 

This topic has been closed for replies.
Correct answer Russ Ward

Hi Sanam, you may need the following statement in the dialog event for the first dialog box that opens the second dialog box:

 

F_ApiReturnValue(FR_ModalStayUp); //keep dialog box from closing

 

Here is an example. The function names will not mean anything to you... the important part is that this is in the dialog event for a "first" dialog box, where the ssp_RenameItem_SchemeEditor() function opens a second dialog box. The F_ApiReturnValue(FR_ModalStayUp) statement forces the first dialog box to stay open after the user closes the second one and that function exits.

 

VoidT F_ApiDialogEvent(dlgNum, itemNum, modifiers)

. . .

      else if(itemNum == ssp_DLG_1_VALUES_LIST_SCR_BOX)
      {
        if(doubleClick == True)
          ssp_RenameItem_SchemeEditor(ssp_VALUE, "Revised value?");

        ssp_RefreshSchemeEditor(ssp_AS_IS, ssp_AS_IS, ssp_AS_IS, ssp_AS_IS, False);
        F_ApiReturnValue(FR_ModalStayUp); //keep dialog box from closing
      }

 

I hope this helps.

Russ

1 reply

Russ WardCorrect answer
Legend
December 13, 2021

Hi Sanam, you may need the following statement in the dialog event for the first dialog box that opens the second dialog box:

 

F_ApiReturnValue(FR_ModalStayUp); //keep dialog box from closing

 

Here is an example. The function names will not mean anything to you... the important part is that this is in the dialog event for a "first" dialog box, where the ssp_RenameItem_SchemeEditor() function opens a second dialog box. The F_ApiReturnValue(FR_ModalStayUp) statement forces the first dialog box to stay open after the user closes the second one and that function exits.

 

VoidT F_ApiDialogEvent(dlgNum, itemNum, modifiers)

. . .

      else if(itemNum == ssp_DLG_1_VALUES_LIST_SCR_BOX)
      {
        if(doubleClick == True)
          ssp_RenameItem_SchemeEditor(ssp_VALUE, "Revised value?");

        ssp_RefreshSchemeEditor(ssp_AS_IS, ssp_AS_IS, ssp_AS_IS, ssp_AS_IS, False);
        F_ApiReturnValue(FR_ModalStayUp); //keep dialog box from closing
      }

 

I hope this helps.

Russ

sanam.dehAuthor
Inspiring
December 14, 2021

Thanks for your help, Russ. I used F_ApiReturnValue, but I was using it in the wrong order.