Skip to main content
Inspiring
November 11, 2011
Answered

How to show close icon on dialog title bar in modal dialog on Mac?

  • November 11, 2011
  • 1 reply
  • 1610 views

Hi everyone..!!

I have a question.. When we display a modal dialog on mac, it does not contain a close icon at the top left corner. If the dialog type is panel then the close icon appears. What should be done so that the close icon shows on the dialog when its type is modal... for eg, kADMSystemAlertDialogStyle..?? Does something need to be changed in the resource file in the section that defines the dialog specifications mentioned below..?

resource 'DLOG' (kMyDialog, "My Dialog", purgeable) {

          {0, 0, 580, 570},       // top, left, bottom, right

          5,                           // movableDBoxProc

          0x0,                       // not visible initially

          0x0,                       // no close button

          0x0,                       // application options

          18504,                   // resource ID

          "My Dialog",          // dialog title

          0x0                       // dialog positioning noAutoCenter

};

I tried changing values for the "no close button", but as there is no document that describes what the valid values for that field are, so I had no success..

Please help..

Thanks!

This topic has been closed for replies.
Correct answer Chris Cox

ADM has been deprecated for quite some time. You really shouldn't be using it.

1 reply

poortip87Author
Inspiring
November 14, 2011

Hey folks, please reply sooooooon... Is there no way for the close icon to appear in the title bar of a modal dialog on Mac?

Thanks!

poortip87Author
Inspiring
November 16, 2011

Hi...

I got a further lead in this problem... In the class ADMDialog.h, in the comments described for Create & Modal functions for creating ADM Dialogs, there are some options described for the last parameter of these functions:

ADMInt32 ADMAPI (*Modal)(SPPluginRef inPluginRef, const char* inName,

                                        ADMInt32 inDialogID, ADMDialogStyle inDialogStyle,

                                        ADMDialogInitProc inInitProc, ADMUserData inUserData, ADMInt32 inOptions);

Now, there are some values that can be given in that last parameter which define our creation options for the dialog. One of them is  kADMModalDialogHasPaletteSystemControlsOption, which too is defined in the same class (ADMDialog.h) & which, as the comments say, shows a close box at the top right corner of modal dialogs.

So, I implemented this as,

sADMDialog->Modal(fPluginRef, "My Dialog", kMyDialog, kADMModalDialogStyle, NULL, NULL, kADMModalDialogHasPaletteSystemControlsOption);

This compiled just fine, but the dialog appeared without any close icon. Now, what to do?

Please guide me on this...

Thanks!

Chris Cox
Chris CoxCorrect answer
Legend
November 17, 2011

ADM has been deprecated for quite some time. You really shouldn't be using it.