6038-20220209.patch
new/src/com/goldencode/p2j/ui/BaseEntity.java 2022-02-09 11:52:13 +0000 | ||
---|---|---|
186 | 186 |
** The setHeightImpl() method introduced to do the stuff after the input is properly validated |
187 | 187 |
** and converted to integer. See #5345. |
188 | 188 |
** VVT 20211118 Fixed: incorrect coordinate conversion when setting size atributes. See #5034-1422. |
189 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
189 | 190 |
*/ |
190 | 191 |
/* |
191 | 192 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
2514 | 2515 |
// config stores 0-based value |
2515 | 2516 |
value = value < 0 ? value + 1 : value - 1; |
2516 | 2517 |
|
2517 |
if (!getAttr("realized", () -> config.realized, true) || isInsideSetup)
|
|
2518 |
if (!_isRealized() || isInsideSetup)
|
|
2518 | 2519 |
{ |
2519 | 2520 |
config.initRow = value; |
2520 | 2521 |
config.initY = y; |
... | ... | |
2591 | 2592 |
// config stores 0-based value |
2592 | 2593 |
value = value < 0 ? value + 1 : value - 1; |
2593 | 2594 |
|
2594 |
if (!getAttr("realized", () -> config.realized, true) || isInsideSetup)
|
|
2595 |
if (!_isRealized() || isInsideSetup)
|
|
2595 | 2596 |
{ |
2596 | 2597 |
config.initColumn = value; |
2597 | 2598 |
config.initX = x; |
... | ... | |
2714 | 2715 |
chValue = Coordinate.adjustMinMaxGuiChar(chValue); |
2715 | 2716 |
} |
2716 | 2717 |
|
2717 |
if (!getAttr("realized", () -> config.realized, true) || isInsideSetup)
|
|
2718 |
if (!_isRealized() || isInsideSetup)
|
|
2718 | 2719 |
{ |
2719 | 2720 |
config.initX = value; |
2720 | 2721 |
config.initColumn = chValue; |
... | ... | |
2745 | 2746 |
chValue = Coordinate.adjustMinMaxGuiChar(chValue); |
2746 | 2747 |
} |
2747 | 2748 |
|
2748 |
if (!getAttr("realized", () -> config.realized, true) || isInsideSetup)
|
|
2749 |
if (!_isRealized() || isInsideSetup)
|
|
2749 | 2750 |
{ |
2750 | 2751 |
config.initY = value; |
2751 | 2752 |
config.initRow = chValue; |
... | ... | |
2874 | 2875 |
// TO-DO: |
2875 | 2876 |
// value > screen-width - frame-width should produce PROGRESS error 4054 |
2876 | 2877 |
// "**Unable to set COL. FRAME f does not fit in WINDOW widget. (4054)" |
2877 |
if (!validColumnOrRow(isUnknown, value, row) && getAttr("realized", () -> config.realized, true))
|
|
2878 |
if (!validColumnOrRow(isUnknown, value, row) && _isRealized())
|
|
2878 | 2879 |
{ |
2879 | 2880 |
// if the widget was already realized and this is not a valid coordinate, do nothing |
2880 | 2881 |
return; |
new/src/com/goldencode/p2j/ui/BrowseColumnWidget.java 2022-02-09 11:52:55 +0000 | ||
---|---|---|
154 | 154 |
** CA 20220106 PUBLISH arguments must be evaluated only if the subscription is found. |
155 | 155 |
** SBI 20220118 Fixed NPE when adding new dynamic column. |
156 | 156 |
** AL2 20220124 Consider any screen-value as valid in regard to ControlSetEntity.setScreenValue |
157 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
157 | 158 |
*/ |
158 | 159 | |
159 | 160 |
/* |
... | ... | |
2891 | 2892 |
// check if we need to freeze the width of the current column |
2892 | 2893 |
BrowseWidget bw = getBrowse(); |
2893 | 2894 |
boolean fixedWidth = bw != null && |
2894 |
getAttr("realized", () -> config.realized) &&
|
|
2895 |
_isRealized() &&
|
|
2895 | 2896 |
getAttr("fitLastColumn", () -> bw.config.fitLastColumn) && |
2896 | 2897 |
isLastVisibleColumn(); |
2897 | 2898 |
if (fixedWidth) |
new/src/com/goldencode/p2j/ui/BrowseWidget.java 2022-02-09 11:53:50 +0000 | ||
---|---|---|
363 | 363 |
** VVT 20220115 System-wide warningAlreadyRealized() method is now used to handle attempts to |
364 | 364 |
** set attribute of a realized widget. See also #5937-32. |
365 | 365 |
** OM 20220118 Do not count skipped rows with unavailable records. |
366 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
366 | 367 |
*/ |
367 | 368 | |
368 | 369 |
/* |
... | ... | |
1014 | 1015 |
@Override |
1015 | 1016 |
public void setLabels(boolean labels) |
1016 | 1017 |
{ |
1017 |
if (getAttr("realized", () -> config.realized, true) && LogicalTerminal.isChui())
|
|
1018 |
if (_isRealized() && LogicalTerminal.isChui())
|
|
1018 | 1019 |
{ |
1019 | 1020 |
warningAlreadyRealized("LABELS"); |
1020 | 1021 |
return; |
... | ... | |
2322 | 2323 |
@Override |
2323 | 2324 |
public integer visibleIterations() |
2324 | 2325 |
{ |
2325 |
boolean realized = getAttr("realized", () -> config.realized, true); |
|
2326 |
if (!realized) |
|
2326 |
if (!_isRealized()) |
|
2327 | 2327 |
{ |
2328 | 2328 |
return new integer(); |
2329 | 2329 |
} |
... | ... | |
4471 | 4471 |
} |
4472 | 4472 |
else // ChUI behavior depends on whether realized or not |
4473 | 4473 |
{ |
4474 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized, always ? (unknown)
|
|
4474 |
if (!_isRealized()) // Unrealized, always ? (unknown)
|
|
4475 | 4475 |
{ |
4476 | 4476 |
return new integer(); |
4477 | 4477 |
} |
... | ... | |
4587 | 4587 |
} |
4588 | 4588 |
else // ChUI, 0 before being realized, ? (unknown) after |
4589 | 4589 |
{ |
4590 |
return (!getAttr("realized", () -> config.realized, true)) ? new integer(0) : new integer();
|
|
4590 |
return (!_isRealized()) ? new integer(0) : new integer();
|
|
4591 | 4591 |
} |
4592 | 4592 |
} |
4593 | 4593 | |
... | ... | |
8697 | 8697 |
return false; |
8698 | 8698 |
} |
8699 | 8699 | |
8700 |
if (getAttr("realized", () -> config.realized, true) && LogicalTerminal.isChui())
|
|
8700 |
if (_isRealized() && LogicalTerminal.isChui())
|
|
8701 | 8701 |
{ |
8702 | 8702 |
warningAlreadyRealized("WIDTH"); |
8703 | 8703 |
return false; |
... | ... | |
8727 | 8727 |
return false; |
8728 | 8728 |
} |
8729 | 8729 | |
8730 |
if (getAttr("realized", () -> config.realized, true) && LogicalTerminal.isChui())
|
|
8730 |
if (_isRealized() && LogicalTerminal.isChui())
|
|
8731 | 8731 |
{ |
8732 | 8732 |
warningAlreadyRealized(pixels ? "HEIGHT-PIXELS" : "HEIGHT"); |
8733 | 8733 |
return false; |
new/src/com/goldencode/p2j/ui/ComboBoxWidget.java 2022-02-09 11:55:22 +0000 | ||
---|---|---|
91 | 91 |
** AL2 20220122 Allow set of unknown value to simple and drop-down modes. |
92 | 92 |
** 20220124 Moved screen-value validity check in ControlSetEntity. |
93 | 93 |
** 20220204 Extend screen-value validation to update the value same as in 4GL. |
94 |
** ME 20220209 Screen-value validation, replace getAttr for "realized" with isRealized method. |
|
94 | 95 |
*/ |
95 | 96 |
/* |
96 | 97 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
638 | 639 |
@Override |
639 | 640 |
public integer getInnerLines() |
640 | 641 |
{ |
641 |
if (!getAttr("realized", () -> config.realized, true))
|
|
642 |
if (!_isRealized())
|
|
642 | 643 |
{ |
643 | 644 |
return new integer(0); |
644 | 645 |
} |
... | ... | |
1346 | 1347 |
// 2. in case of list-items, the 'label' must be the formatted value |
1347 | 1348 |
|
1348 | 1349 |
Class<?> cls = BaseDataType.fromTypeName(config.dataType); |
1350 |
ComboBoxConfig.Mode mode = getAttr("mode", () -> config.mode); |
|
1349 | 1351 |
|
1350 | 1352 |
String fmt = resolveFormat(); |
1351 | 1353 |
for (ControlSetItem item : items) |
... | ... | |
1354 | 1356 |
|
1355 | 1357 |
BaseDataType value = item.getValue(); |
1356 | 1358 |
|
1357 |
BaseDataType newValue = BaseDataType.generateDefault(cls); |
|
1358 |
newValue.assign(value); |
|
1359 | ||
1360 |
if (value.getTypeName().equals(config.dataType)) |
|
1359 |
if (!value.getClass().equals(cls)) |
|
1361 | 1360 |
{ |
1362 |
continue; |
|
1361 |
BaseDataType newValue = BaseDataType.generateDefault(cls); |
|
1362 |
newValue.assign(value); |
|
1363 |
|
|
1364 |
item.setValue(newValue); |
|
1363 | 1365 |
} |
1364 | 1366 |
|
1365 |
item.setValue(newValue); |
|
1367 |
// drop-down-list trims trailing spaces and |
|
1368 |
if (character.class.equals(cls) && mode == DROP_DOWN_LIST) |
|
1369 |
{ |
|
1370 |
item.setValue(TextOps.rightTrim(new character(item.getValue().toString(fmt)))); |
|
1371 |
} |
|
1366 | 1372 |
|
1367 | 1373 |
if (pairs == null || !pairs) |
1368 | 1374 |
{ |
1369 |
item.setLabel(new character(newValue.toString(fmt)));
|
|
1375 |
item.setLabel(item.getCharacterValue());
|
|
1370 | 1376 |
} |
1371 | 1377 |
} |
1372 | 1378 | |
... | ... | |
1675 | 1681 |
{ |
1676 | 1682 |
if (super.validateScreenValue(value)) |
1677 | 1683 |
{ |
1678 |
// if valid update the screen-value |
|
1679 |
if (value.isUnknown()) |
|
1680 |
{ |
|
1681 |
// looks like when unknown it tries to find an empty item first |
|
1682 |
value.assign(""); |
|
1683 |
} |
|
1684 |
// looks like when unknown it tries to find an empty item first |
|
1685 |
character lookup = value.isUnknown() ? new character("") : value; |
|
1684 | 1686 |
|
1685 | 1687 |
ControlSetItem[] items = getAttr("items", () -> config.items); |
1686 | 1688 |
|
1687 | 1689 |
for (ControlSetItem item : items) |
1688 | 1690 |
{ |
1689 | 1691 |
// item found, update value if different case |
1690 |
if (CompareOps._isEqual(value, item.getCharacterValue()))
|
|
1692 |
if (CompareOps._isEqual(lookup, item.getValue()))
|
|
1691 | 1693 |
{ |
1692 |
value.assign(item.getCharacterValue());
|
|
1693 |
return true;
|
|
1694 |
value.assign(item.getValue()); |
|
1695 |
break;
|
|
1694 | 1696 |
} |
1695 | 1697 |
} |
1696 | 1698 |
|
1697 |
// if value is empty and no matching item found reset to unknown
|
|
1698 |
if (TextOps.isEmpty(value))
|
|
1699 |
// always right-trim unless unknown
|
|
1700 |
if (!value.isUnknown())
|
|
1699 | 1701 |
{ |
1700 |
value.setUnknown();
|
|
1702 |
value.assign(TextOps.rightTrim(value));
|
|
1701 | 1703 |
} |
1702 | 1704 |
|
1703 | 1705 |
return true; |
new/src/com/goldencode/p2j/ui/ControlSetEntity.java 2022-02-09 11:56:00 +0000 | ||
---|---|---|
97 | 97 |
** AL2 20220124 Make all control set entities to check for screen-value validity. |
98 | 98 |
** ME 20220201 Allow for multiple values list when setting screen-value (delimiter is used). |
99 | 99 |
** ME 20220202 Do not split value using delimiter on validateScreenValue - only selection-list |
100 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
100 | 101 |
*/ |
101 | 102 |
/* |
102 | 103 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
1575 | 1576 |
return; |
1576 | 1577 |
} |
1577 | 1578 | |
1578 |
setListItemPairsWorker(list, getAttr("realized", () -> config.realized, true));
|
|
1579 |
setListItemPairsWorker(list, _isRealized());
|
|
1579 | 1580 |
} |
1580 | 1581 |
|
1581 | 1582 |
/** |
... | ... | |
2959 | 2960 | |
2960 | 2961 |
return Boolean.TRUE.equals(pairs) ? Boolean.TRUE : |
2961 | 2962 |
!getAttr("itemsSetWhenRealized", () -> config.itemsSetWhenRealized) && |
2962 |
!getAttr("realized", () -> config.realized, true) &&
|
|
2963 |
!_isRealized() &&
|
|
2963 | 2964 |
items != null && items.length > 0 ? pairs : null; |
2964 | 2965 |
} |
2965 | 2966 |
new/src/com/goldencode/p2j/ui/FrameWidget.java 2022-02-09 11:56:45 +0000 | ||
---|---|---|
187 | 187 |
** CA 20221112 Fixed width/height-chars in ChUI mode - these must not be translated from pixels. |
188 | 188 |
** VVT 20220115 System-wide warningAlreadyRealized() method is now used to handle attempts to |
189 | 189 |
** set attribute of a realized widget. See also #5937-32. |
190 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
190 | 191 |
*/ |
191 | 192 |
/* |
192 | 193 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
663 | 664 |
return; |
664 | 665 |
} |
665 | 666 | |
666 |
if (getAttr("realized", () -> config.realized, true) &&
|
|
667 |
if (_isRealized() &&
|
|
667 | 668 |
btn.getAttr("frameId", () -> btn.config.frameId) == -1) |
668 | 669 |
{ |
669 | 670 |
ErrorManager.recordOrShowError(4040, |
... | ... | |
758 | 759 |
return; |
759 | 760 |
} |
760 | 761 | |
761 |
if (getAttr("realized", () -> config.realized, true)
|
|
762 |
if (_isRealized()
|
|
762 | 763 |
&& btn.getAttr("frameId", () -> btn.config.frameId) == -1) |
763 | 764 |
{ |
764 | 765 |
ErrorManager.recordOrShowError(4040, |
... | ... | |
1406 | 1407 |
// save this, as it will be overwritten by the super call |
1407 | 1408 |
GenericFrame owner = this.frame; |
1408 | 1409 | |
1409 |
if (owner != null && getAttr("realized", () -> config.realized, true))
|
|
1410 |
if (owner != null && _isRealized())
|
|
1410 | 1411 |
{ |
1411 | 1412 |
ErrorManager.recordOrShowError(4078, |
1412 | 1413 |
String.format( |
... | ... | |
1976 | 1977 |
// remove the frame, etc |
1977 | 1978 |
frame.frameCleanup(); |
1978 | 1979 |
|
1979 |
if (dynamic || !getAttr("realized", () -> config.realized, true))
|
|
1980 |
if (dynamic || !_isRealized())
|
|
1980 | 1981 |
{ |
1981 | 1982 |
LogicalTerminal.deregisterFrame(getId()); |
1982 | 1983 |
} |
... | ... | |
2296 | 2297 |
{ |
2297 | 2298 |
if (!LogicalTerminal.isChui()) // GUI behavior depends on whether realized or not |
2298 | 2299 |
{ |
2299 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog, always 0
|
|
2300 |
if (!_isRealized()) // Unrealized frame/dialog, always 0
|
|
2300 | 2301 |
{ |
2301 | 2302 |
return new integer(0); |
2302 | 2303 |
} |
... | ... | |
2338 | 2339 |
} |
2339 | 2340 |
else // ChUI behavior depends on whether realized or not |
2340 | 2341 |
{ |
2341 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog, NOP
|
|
2342 |
if (!_isRealized()) // Unrealized frame/dialog, NOP
|
|
2342 | 2343 |
{ |
2343 | 2344 |
return; |
2344 | 2345 |
} |
... | ... | |
2367 | 2368 |
} |
2368 | 2369 |
else // ChUI behavior depends on whether realized or not |
2369 | 2370 |
{ |
2370 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog
|
|
2371 |
if (!_isRealized()) // Unrealized frame/dialog
|
|
2371 | 2372 |
{ |
2372 | 2373 |
return new integer(0); // Always 0 |
2373 | 2374 |
} |
... | ... | |
2409 | 2410 |
} |
2410 | 2411 |
else // ChUI behavior depends on whether realized or not |
2411 | 2412 |
{ |
2412 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog
|
|
2413 |
if (!_isRealized()) // Unrealized frame/dialog
|
|
2413 | 2414 |
{ |
2414 | 2415 |
if (!isDialogBox()) // Frame, NOP |
2415 | 2416 |
{ |
... | ... | |
2437 | 2438 |
{ |
2438 | 2439 |
if (!LogicalTerminal.isChui()) // GUI behavior depends on whether realized or not |
2439 | 2440 |
{ |
2440 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog, always 0
|
|
2441 |
if (!_isRealized()) // Unrealized frame/dialog, always 0
|
|
2441 | 2442 |
{ |
2442 | 2443 |
return new integer(0); |
2443 | 2444 |
} |
... | ... | |
2479 | 2480 |
} |
2480 | 2481 |
else // ChUI behavior depends on whether realized or not |
2481 | 2482 |
{ |
2482 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog
|
|
2483 |
if (!_isRealized()) // Unrealized frame/dialog
|
|
2483 | 2484 |
{ |
2484 | 2485 |
return; |
2485 | 2486 |
} |
... | ... | |
2504 | 2505 |
} |
2505 | 2506 |
else // ChUI behavior depends on whether realized or not |
2506 | 2507 |
{ |
2507 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog
|
|
2508 |
if (!_isRealized()) // Unrealized frame/dialog
|
|
2508 | 2509 |
{ |
2509 | 2510 |
// 0 unless 4GL is earlier than 11.x, then ? (unknown) |
2510 | 2511 |
boolean useZero = EnvironmentOps.versionNumber() >= 11.0f; |
... | ... | |
2548 | 2549 |
} |
2549 | 2550 |
else // ChUI behavior depends on whether realized or not |
2550 | 2551 |
{ |
2551 |
if (!getAttr("realized", () -> config.realized, true)) // Unrealized frame/dialog, NOP
|
|
2552 |
if (!_isRealized()) // Unrealized frame/dialog, NOP
|
|
2552 | 2553 |
{ |
2553 | 2554 |
return; |
2554 | 2555 |
} |
... | ... | |
3108 | 3109 |
// by the runtime |
3109 | 3110 |
// - frame is realized: the new value is ignored |
3110 | 3111 |
|
3111 |
if (getAttr("realized", () -> config.realized, true))
|
|
3112 |
if (_isRealized())
|
|
3112 | 3113 |
{ |
3113 | 3114 |
return; |
3114 | 3115 |
} |
new/src/com/goldencode/p2j/ui/GenericFrame.java 2022-02-09 11:57:33 +0000 | ||
---|---|---|
943 | 943 |
** SVL 20220107 Partially reverted previous entry. |
944 | 944 |
** ME 20220110 Screen value is unknown only for combo/selection list if not in list. |
945 | 945 |
** AL2 20220121 Moved combo/selsection screen-value conditional after core frame buffer checking |
946 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
946 | 947 |
*/ |
947 | 948 | |
948 | 949 |
/* |
... | ... | |
1472 | 1473 |
*/ |
1473 | 1474 |
public logical validateFields(boolean enabledOnly) |
1474 | 1475 |
{ |
1475 |
if (!frame.getAttr("realized", () -> frame.config.realized, true))
|
|
1476 |
if (!frame._isRealized())
|
|
1476 | 1477 |
{ |
1477 | 1478 |
return new logical(true); |
1478 | 1479 |
} |
... | ... | |
6233 | 6234 |
@Override |
6234 | 6235 |
public void setDown(Resolvable down) |
6235 | 6236 |
{ |
6236 |
if (frame.getAttr("realized", () -> frame.config.realized, true))
|
|
6237 |
if (frame._isRealized())
|
|
6237 | 6238 |
{ |
6238 | 6239 |
// this is a no-op in case of shared frames - the DOWN value is inherited from the source |
6239 | 6240 |
// frame. DOWN can only be overridden by explicitly setting the FRAME's DOWN attribute |
new/src/com/goldencode/p2j/ui/GenericWidget.java 2022-02-09 11:17:15 +0000 | ||
---|---|---|
333 | 333 |
** VVT 20211215 New methods added: setX(int), setY(int). See #5899. |
334 | 334 |
** VVT 20220115 System-wide warningAlreadyRealized(String) method was added to handle attempts to |
335 | 335 |
** set attribute of a realized widget. See also #5937-32. |
336 |
** ME 20220208 Use 'realized' instead of temporary 'wasRealized' configuration flag. |
|
336 | 337 |
*/ |
337 | 338 | |
338 | 339 |
/* |
... | ... | |
1474 | 1475 |
} |
1475 | 1476 | |
1476 | 1477 |
// check if the parent frame is set and not visible |
1477 |
if (!getAttr("realized", () -> config.realized, true) &&
|
|
1478 |
if (!_isRealized() &&
|
|
1478 | 1479 |
(frame == null || !frame.getFrameWidget()._isVisible())) |
1479 | 1480 |
{ |
1480 | 1481 |
config.hidden = hidden; |
... | ... | |
5990 | 5991 |
@Override |
5991 | 5992 |
public void realize() |
5992 | 5993 |
{ |
5993 |
if (getAttr("wasRealized", () -> config.wasRealized, true))
|
|
5994 |
if (_isRealized())
|
|
5994 | 5995 |
{ |
5995 | 5996 |
return; |
5996 | 5997 |
} |
... | ... | |
6007 | 6008 |
* A temporary solution. Most likely should be revised |
6008 | 6009 |
* after a proper realization of the realize() method, |
6009 | 6010 |
*/ |
6010 |
config.wasRealized = true;
|
|
6011 |
config.realized = true;
|
|
6011 | 6012 |
// TODO: implement |
6012 | 6013 |
} |
6013 | 6014 |
|
... | ... | |
6115 | 6116 |
{ |
6116 | 6117 |
return true; |
6117 | 6118 |
} |
6118 |
if (!getAttr("wasRealized", () -> config.wasRealized, true))
|
|
6119 |
if (!_isRealized())
|
|
6119 | 6120 |
{ |
6120 | 6121 |
ErrorManager.recordOrShowError(4104, |
6121 | 6122 |
String.format( |
new/src/com/goldencode/p2j/ui/SelectionListWidget.java 2022-02-09 11:58:57 +0000 | ||
---|---|---|
58 | 58 |
** AL2 20220124 Check screen-value validity through ControlSetEntity. |
59 | 59 |
** ME 20220201 Handle multiple values list in set screen-value. |
60 | 60 |
** ME 20220202 Split value using delimiter on validateScreenValue. |
61 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
61 | 62 |
*/ |
62 | 63 |
/* |
63 | 64 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
752 | 753 |
@Override |
753 | 754 |
public void setListItemPairs(character list) |
754 | 755 |
{ |
755 |
if (!getAttr("realized", () -> config.realized, true))
|
|
756 |
if (!_isRealized())
|
|
756 | 757 |
{ |
757 | 758 |
super.setListItemPairs(list); |
758 | 759 |
} |
new/src/com/goldencode/p2j/ui/TextBasedWidget.java 2022-02-09 11:59:30 +0000 | ||
---|---|---|
14 | 14 |
** CA 20210709 Dynamic side-labels are part of the FIELD-GROUP in FWD, too - so they must not be walked |
15 | 15 |
** explicitly. |
16 | 16 |
** CA 20210917 Javadoc fixes. |
17 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
17 | 18 |
*/ |
18 | 19 |
/* |
19 | 20 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
393 | 394 |
String name = getAttr("name", () -> config.name); |
394 | 395 | |
395 | 396 |
// if the literal is not yet realized, compute its width |
396 |
if (!getAttr("realized", () -> config.realized) && name != null && getAttr("align", () -> config.align) == ControlEntity.ALIGN_RIGHT)
|
|
397 |
if (!_isRealized() && name != null && getAttr("align", () -> config.align) == ControlEntity.ALIGN_RIGHT)
|
|
397 | 398 |
{ |
398 | 399 |
if (name.length() > col - 1) |
399 | 400 |
{ |
new/src/com/goldencode/p2j/ui/ToggleBoxWidget.java 2022-02-09 12:00:06 +0000 | ||
---|---|---|
39 | 39 |
** within FWD code (see COMBO-BOX:LIST-ITEM-PAIRS behavior). |
40 | 40 |
** CA 20210217 DATA-TYPE attribute is not settable for this widget. |
41 | 41 |
** 020 HC 20211201 Implemented TREENODE:CHECKED attribute. |
42 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
42 | 43 |
*/ |
43 | 44 |
/* |
44 | 45 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
196 | 197 |
@Override |
197 | 198 |
public logical isChecked() |
198 | 199 |
{ |
199 |
if (!getAttr("realized", () -> config.realized, true))
|
|
200 |
if (!_isRealized())
|
|
200 | 201 |
{ |
201 | 202 |
// the toggle box can be checked even if not realized |
202 | 203 |
return new logical(getAttr("checked", () -> config.checked)); |
... | ... | |
258 | 259 |
return; |
259 | 260 |
} |
260 | 261 |
|
261 |
if (getAttr("realized", () -> config.realized, true))
|
|
262 |
if (_isRealized())
|
|
262 | 263 |
{ |
263 | 264 |
if (config.checked == checked.booleanValue()) |
264 | 265 |
{ |
new/src/com/goldencode/p2j/ui/WidgetConfig.java 2022-02-08 14:17:34 +0000 | ||
---|---|---|
28 | 28 |
** 017 IAS 20200901 Rework (de)serialization. |
29 | 29 |
** EVL 20200925 Pack all boolean attributes into single 32-bit integer for socket read/write. |
30 | 30 |
** 018 HC 20211102 Implemented i18n support. |
31 |
** 019 ME 20220208 Drop temporary 'wasRealized' flag. |
|
31 | 32 |
*/ |
32 | 33 |
/* |
33 | 34 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
156 | 157 |
/** Flag to indicate whether the widget has been realized. **/ |
157 | 158 |
public boolean realized = false; |
158 | 159 |
|
159 |
/** Flag to indicate whether the widget's has been realized. |
|
160 |
* A temporary solution. Most likely should be revised |
|
161 |
* after a proper realization of the realize() method, |
|
162 |
* */ |
|
163 |
public boolean wasRealized = false; |
|
164 |
|
|
165 | 160 |
/** The HIDDEN attribute, which stops widgets from displaying. */ |
166 | 161 |
public boolean hidden = false; |
167 | 162 |
|
... | ... | |
243 | 238 |
/** Bitwise mask to mark DISABLE REDRAW atribute usage. */ |
244 | 239 |
private static final int ATTR_MASK_DIS_REDRAW = 0x00000100; |
245 | 240 |
|
246 |
/** Bitwise mask to mark WAS REALIZED atribute usage. */ |
|
247 |
private static final int ATTR_MASK_WAS_REALIZED = 0x00000200; |
|
248 |
|
|
249 | 241 |
/** |
250 | 242 |
* Default constructor (only used in deserialization). |
251 | 243 |
*/ |
... | ... | |
455 | 447 |
if (manualHightlight) booleanAttrs |= ATTR_MASK_MANUAL_HIGHLIGHT; |
456 | 448 |
if (selectable) booleanAttrs |= ATTR_MASK_SELECTABLE; |
457 | 449 |
if (disableRedraw) booleanAttrs |= ATTR_MASK_DIS_REDRAW; |
458 |
if (wasRealized) booleanAttrs |= ATTR_MASK_WAS_REALIZED; |
|
459 | 450 |
out.writeInt(booleanAttrs); |
460 | 451 | |
461 | 452 |
// System.err.printf("WidgetConfig.writeExternal: %s; %s: %s, %s, %s, %s, %s, %s, %s, %s\n", |
... | ... | |
500 | 491 |
manualHightlight = (booleanAttrs & ATTR_MASK_MANUAL_HIGHLIGHT) == ATTR_MASK_MANUAL_HIGHLIGHT; |
501 | 492 |
selectable = (booleanAttrs & ATTR_MASK_SELECTABLE) == ATTR_MASK_SELECTABLE; |
502 | 493 |
disableRedraw = (booleanAttrs & ATTR_MASK_DIS_REDRAW) == ATTR_MASK_DIS_REDRAW; |
503 |
wasRealized = (booleanAttrs & ATTR_MASK_WAS_REALIZED) == ATTR_MASK_WAS_REALIZED; |
|
504 | 494 | |
505 | 495 |
// System.err.printf("WidgetConfig.readExternal: %s; %s: %s, %s, %s, %s, %s, %s, %s, %s\n", |
506 | 496 |
// this, id, frameId, popupMenuId, enabled, visible, realized, header, hidden, modified); |
... | ... | |
548 | 538 |
menuKey = config.menuKey; |
549 | 539 |
menuMouse = config.menuMouse; |
550 | 540 |
disableRedraw = config.disableRedraw; |
551 |
wasRealized = config.wasRealized; |
|
552 | 541 |
} |
553 | 542 |
|
554 | 543 |
/** |
new/src/com/goldencode/p2j/ui/WindowWidget.java 2022-02-09 12:00:51 +0000 | ||
---|---|---|
123 | 123 |
** set attribute of a realized widget. See also #5937-32. |
124 | 124 |
** RFB 20220119 The return from getIcon should be empty string if there isn't one set, instead of |
125 | 125 |
** unknown. Refactored after review. Ref #4986. |
126 |
** ME 20220209 Replace getAttr for "realized" with isRealized method. |
|
126 | 127 |
*/ |
127 | 128 |
/* |
128 | 129 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
1873 | 1874 |
{ |
1874 | 1875 |
boolean prevDelayedMinimize = getAttr("delayedMinimize", () -> config.delayedMinimize); |
1875 | 1876 |
int prevState = getAttr("windowState", () -> config.windowState); |
1876 |
boolean realized = getAttr("realized", () -> config.realized, true);
|
|
1877 |
boolean realized = _isRealized();
|
|
1877 | 1878 | |
1878 | 1879 |
// the delayed minimized behavior comes in effect only when the window has been |
1879 | 1880 |
// realized; also note that in this case the WINDOW-STATE attribute value is not affected! |
new/src/com/goldencode/p2j/ui/chui/FramePlacementManager.java 2022-02-08 15:01:33 +0000 | ||
---|---|---|
344 | 344 |
** do not follow the placement logic for root frames. |
345 | 345 |
** EVL 20210726 Fix for issue with setting up child frame location before frame is realized. If |
346 | 346 |
** init(Column|Row) is valid it should be used instead of 0. |
347 |
** ME 20220208 Use 'isRealised' frame method instead of 'wasRealised' configuration. |
|
347 | 348 |
*/ |
348 | 349 |
/* |
349 | 350 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
460 | 461 |
*/ |
461 | 462 |
public void placeFrame(Frame<?> frame, boolean hideOthers) |
462 | 463 |
{ |
464 |
FrameConfig cfg = frame.config(); |
|
465 |
|
|
463 | 466 |
if (!frame.isRootFrame()) |
464 | 467 |
{ |
465 |
FrameConfig fcfg = frame.config(); |
|
466 |
if (!fcfg.wasRealized) |
|
468 |
if (!frame.isRealized()) |
|
467 | 469 |
{ |
468 |
frame.setLocation(fcfg.initColumn != BaseConfig.INV_COORD ? fcfg.initColumn : 0,
|
|
469 |
fcfg.initRow != BaseConfig.INV_COORD ? fcfg.initRow : 0);
|
|
470 |
frame.setLocation(cfg.initColumn != BaseConfig.INV_COORD ? cfg.initColumn : 0,
|
|
471 |
cfg.initRow != BaseConfig.INV_COORD ? cfg.initRow : 0);
|
|
470 | 472 |
} |
471 | 473 |
|
472 | 474 |
return; |
... | ... | |
474 | 476 |
|
475 | 477 |
boolean redirected = frame.isRedirected(); |
476 | 478 | |
477 |
FrameConfig cfg = frame.config(); |
|
478 | 479 |
cfg.framePlaced = true; |
479 | 480 |
ArrayList<Frame<?>> list = new ArrayList<Frame<?>>(); |
480 | 481 |
|
new/src/com/goldencode/p2j/ui/client/widget/AbstractWidget.java 2022-02-08 15:05:29 +0000 | ||
---|---|---|
190 | 190 |
** CA 20211025 Fixed tooltip issues when the widgets are stacked, in web mode. |
191 | 191 |
** MP 20211207 Improve highlighted behavior by trigger repaint if needed |
192 | 192 |
** AL2 20220127 Register or deregister a freshly selected or deselected widget. |
193 |
** ME 20220208 Drop use of temporary 'wasRealized' flag. |
|
193 | 194 |
*/ |
194 | 195 | |
195 | 196 |
/* |
... | ... | |
2653 | 2654 |
if (visible && !config.realized) |
2654 | 2655 |
{ |
2655 | 2656 |
config.realized = true; |
2656 |
config.wasRealized = true; |
|
2657 | 2657 |
Frame container = parent(Frame.class); |
2658 | 2658 |
if (container != null) |
2659 | 2659 |
{ |
... | ... | |
3743 | 3743 |
} |
3744 | 3744 |
|
3745 | 3745 |
cfg.realized = false; |
3746 |
cfg.wasRealized = false; |
|
3747 | 3746 |
cfg.visible = false; |
3748 | 3747 |
cfg.hidden = false; |
3749 | 3748 |
|