git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
weblib: metadata url change
[fanfix.git]
/
src
/
jexer
/
TMessageBox.java
diff --git
a/src/jexer/TMessageBox.java
b/src/jexer/TMessageBox.java
index 1eff8a7613ef120ef1b88428931d60fa18d7fc48..6f1e8a69486b05141b085bda4b841ba474aef347 100644
(file)
--- a/
src/jexer/TMessageBox.java
+++ b/
src/jexer/TMessageBox.java
@@
-32,6
+32,7
@@
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import java.util.List;
import java.util.ResourceBundle;
+import jexer.bits.StringUtils;
import jexer.event.TKeypressEvent;
import static jexer.TKeypress.*;
import jexer.event.TKeypressEvent;
import static jexer.TKeypress.*;
@@
-41,7
+42,7
@@
import static jexer.TKeypress.*;
*
* <pre>
* {@code
*
* <pre>
* {@code
- * box =
application.
messageBox(title, caption,
+ * box = messageBox(title, caption,
* TMessageBox.Type.OK | TMessageBox.Type.CANCEL);
*
* if (box.getResult() == TMessageBox.OK) {
* TMessageBox.Type.OK | TMessageBox.Type.CANCEL);
*
* if (box.getResult() == TMessageBox.OK) {
@@
-187,11
+188,11
@@
public class TMessageBox extends TWindow {
// Determine width and height
String [] lines = caption.split("\n");
// Determine width and height
String [] lines = caption.split("\n");
- int width =
title.length(
) + 12;
+ int width =
StringUtils.width(title
) + 12;
setHeight(6 + lines.length);
for (String line: lines) {
setHeight(6 + lines.length);
for (String line: lines) {
- if (
line.length(
) + 4 > width) {
- width =
line.length(
) + 4;
+ if (
StringUtils.width(line
) + 4 > width) {
+ width =
StringUtils.width(line
) + 4;
}
}
setWidth(width);
}
}
setWidth(width);