[Freeciv-Dev] Re: Xaw: common dialog model
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, 04 Dec 2004 20:56:00 -0500
Jason Dorje Short <jdorje@xxxxxxxxxxxx> wrote:
JDS> My question would be, can any of the code be moved out of
JDS> client/gui-xaw/ and into client/? And code or code segments that are
JDS> duplilicated in all the gui-xxx/ libraries are candidates for this.
Hm, don't think that any of this functions could be moved out of gui-specific
dir.
All of them use Xaw and Xt functions. popup_<dialog-name>_dialog usually is
like:
void popup_players_dialog(bool raise)
{
players_dialog_shell_is_raised = raise;
if(!players_dialog_shell)
create_players_dialog(raise);
if (raise) {
XtSetSensitive(main_form, FALSE);
}
xaw_set_relative_position(toplevel, players_dialog_shell, 5, 25);
XtPopup(players_dialog_shell, XtGrabNone);
}
I think, there is no reason to make new three (or two) functions, to move out
the one.
However, there can be such code in other dialog-specific functions. I will look
for
those while adapting dialogs for common model.
JDS> > Q: Are there any dialogs that should be only modal? What are they?
JDS>
JDS> No dialog should be modal if it can be avoided. (It's always possible
JDS> to avoid it but it may take too much work.)
So, every dialog should be not only modal (for current situation). Should all
dialogs have modal and non-modal states? (Maybe, choosed by player).
JDS> > Q: Should 'xaw_set_relative_position()' be called at every popup, or only
JDS> > at creating dialog?
JDS>
JDS> When dialogs are closed and reopened they should keep their original
JDS> positions.
So, setting positions should be moved into creating? (Because popup may be
applied to
an existing dialog.)
JDS> > Every dialog should have an action on closing it by window manager (x)
button.
JDS> > <dialog-name>_dialog_msg_close() is used for callback. (See also
'actions.c')
JDS> > In common case, it should be equal to clicking 'Cancel' button.
JDS>
JDS> OK. Why "msg"?
Maybe, tradition? :)
This name was taken from actions.c (and several files like plrdlg.c).
There is (now) four "types" of actions in actions table:
mouse - mouse move;
btn - (think) for mouse buttons;
key - for keyboard;
msg - for window messages.
(IMHO :)
Thanks, evyscr.
|
|