Improve NS dialogs. Add close button, remove ugly casts.
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 28 Aug 2012 16:05:17 +0000 (18:05 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 28 Aug 2012 16:05:17 +0000 (18:05 +0200)
commit7f8941d8b26f373a3fc614edd29166a726bc9d53
tree97cb4050adb0c2187c0d89bf64bb638f05562773
parenteada086196ccb005ded188ac2e58d41f3682a125
Improve NS dialogs.  Add close button, remove ugly casts.

* nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
button_values to NULL. Call setStykeMask so dialogs get a close button.
(windowShouldClose:): Set window_closed.
(dealloc): New member, free button_values.
(process_dialog:): Make member function. Remove window argument,
replace window with self. Count buttons and allocate and store values
in button_values.
(addButton:value:row:): value is int with the name tag.  Call setTag
with tag. Remove return self, declare return value as void.
(addString:row:): Remove return self, declare return value as void.
(addSplit): Remove return self, declare return value as void.
(clicked:): Remove return self, declare return value as void.
Set dialog_return to button_values[seltag]. Code formatting change.
(initFromContents:isQuestion:): Adjust call to process_dialog.
Code formatting change.
(timeout_handler:): Set timer_fired to YES.
(runDialogAt:): Set timer_fired to NO.
Handle click on close button as quit.

* nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
Add window_closed and button_values.  Add void as return value for
add(Button|String|Split).  addButton takes int instead of Lisp_Object.
Add process_dialog as new member.
src/ChangeLog
src/nsmenu.m
src/nsterm.h