If the screenshot is illustrating the problem, then I see three things which
are wrong: (1) There is stretch in the dialog below the buttons. (2) The
tab pane doesn’t suck up all extra available height. (3) The buttons are
centered instead of being right-justified.
I think a better fix would be to change this dialog over to use MigLayout.
No worries Joel; I just googled MigLayout, it looks like a piece of cake. I’ll start with the Notes window and go from there. No need for personal tutelage, plenty of resources and examples floating around!
If you’d like an example, have a look at VASSAL.tools.swing.DetailsDialog
and VASSAL.preferences.PrefsDialog.
DetailsDialog is a very complex one because it has to accomodate a
component which is sometimes hidden. I used explicit cell references
for DetailsDialog because in this case that made it easier to see
where things would go.
PrefsDialog has basically what you need for a simple dialog:
The option given to the layout ctor ensures that we get the right insets
around the dialog contents. The options for the contents (in this case,
a JTabbedPane) ensure that they take up the right amount of space, grow
appropriately as the dialog is resized, and that there’s the right amount
of gap between the row it’s in and the next row. The buttons should be
tagged so that they’re laid out in platform-specific order.
If you have any questions about this, don’t hesitate to ask. The more
dialogs which get converted this way, the better VASSAL looks.
Is there any reason I can’t make the Notes window a JFrame? That way it’ll have min/max buttons etc. In the games I’m playing (CWB), the notes are used often enough that it warrants having the window always open.
Also, is there any reason Charts can’t be a JFrame? Of course, unlike Notes, it’ll need the always-on-top attribute so people can drag pieces to it. (ideally a Pin/Unpin icon would be nice)
Since we’re talking about mods to Notes dialog, can someone make it so if you click the “x” button, it reminds you with a dialog to SAVE if you’ve made changes?
I just “lost” a bunch of notes while playtesting a module because I exited the [edit] Notes dialog this way.
My request is to either put up a dialog to remind the user, or make the default behavior to save the notes - the other option is to remove the “x”.
Yep, I’m right onto that Fuhr. My modifications look for changes in Notes and pop-up a warning dialog if you close it without saving. Been there and been burned by that myself.
Yeah, my head is hurting thinking about it; There would still need to be a way to intuitively undo changes, which may bring us back to square one.
My problem with only having a Close button is it’s not obvious what’s going to happen when you do close the window. With separate Save & Close, Save, Cancel buttons, the user knows exactly what’s happening. They know nothing will be saved until they tell it, they know they may lose their work if they blow away the window; There’s no guess work. You’re right that not having Save is probably better logically (for us), but it’s not necessarily as comfortable for users.
This makes sense to me. Notes could be treated like a Property Sheet of a figure, for example.
If “save” is not an explicit step, then is “undo” tricky?
The obvious use-case is a text-editing undo (CTRL-Z) in the notes. This is straightforward to support.
But, and I’m not a VASSAL expert, I am imagining another use-case where a player accomplishes a goal in the game, makes a private note of some treasure he obtained, then all the players as a whole decide for a reason to “undo” the actions of round. Should the notes (including the hidden one) revert as well? Maybe that already is sorted out and works well.
It’s just the Notes window. I started out fixing a bug, but now we’re moving full-steam ahead into enhancements! hehe
It’s not worth any further development, there are other interface issues to sort out first. Just a simple fix is fine. Unless someone else wants to take it on?
I had more of a think about this.
Right now there are two buttons, Save and Cancel. What if I change the first button text to read “Save & Close” and keep the Cancel button. When the window is closed for whatever reason, it detects any unsaved changes and pops up a Warning.
I’ll try to have a look at these by the weekend. I’m presently doing the
last work on my dissertation before it goes to the committee on Tuesday
or Wednesday; thinking about these changes requires more brain power than
I can spare at the moment.
Hey Joel, I’m responding in the old thread to keep the topic relevant.
In short, it’s bad UI design to force users to use the Close “X” decoration at the top right of windows.
The usual area of a user’s mouse is center, bottom, left. Going to top-right is much further to travel.
The Charts window is used a lot, the normal close button is small and hard to navigate to.
It’s non-standard UI behavior.
It’s possible a user may think the “X” will close all of VASSAL. Or they may think they need to click the chart to close it. In short “How am I supposed to close only this dialog? I can’t be 100% certain.”