Bug #2742
Bug #2677: fix drawing and functional differences between P2J GUI and 4GL GUI
Problems when using the SIZE option
100%
Related issues
History
#1 Updated by Vadim Gindin over 8 years ago
Consider we have the following var definition: def var tbbx as logical view-as toggle-box size 15 by 1.5.
That toggle-box will be displayed incorrectly: size statement will be ignored and size of the component will be computed dynamically using font-size and constants.
Test procedure is uast/toggle_box/gui/tbx_static1.p
.
Some workaround:BaseEntity
does not set fixedWidth/fixedHeight
flags and without those flags width()
and height()
methods will not use specified values and calculate height/width dynamically using font sizes. Have a look: BaseEntity.setSizeChars()
contains the following lines:
if (gfr != null && !gfr.isInsideSetup()) { config.fixedHeight = true; }
In other words it set
config.fixedHeight
only if we are not inside frame setup. Described toggle-box definition is converted to the following calls:public static class TbxStaticFDef extends WidgetList { .. public void setup(CommonFrame frame) { .. tbbx.setWidthChars(15); tbbx.setHeightChars(1.5); } }
width/height setting happen exactly inside frame setup and it means, that the flags fixedHeight/fixedWidth
will not be set.
#2 Updated by Greg Shah over 8 years ago
- Target version set to Milestone 12
- Start date deleted (
10/02/2015) - Parent task set to #2677
#3 Updated by Greg Shah over 8 years ago
- Assignee set to Eugenie Lyzenko
#4 Updated by Eugenie Lyzenko over 8 years ago
Task branch 1811s
for review updated to revision 10986
.
This is GUI button implicit/auto
resize issue fix. The new painting issue found for button is the real button differs from (width|height)-pixels by 1 pixel in both dimensions. Will be resolved in next update.
Constantin,
To verify the 4gl<->p2j
pictures exact match I need to know how to get the same font for both 4gl
and p2j
. Or how to set up p2j
in a way to use the same fonts as for 4gl default configuration on windev01
. I need to:
1. The main windows are the same in 4GL
and P2J
2. The button fonts are the absolutely the same(in text width and height) in 4GL
and P2J
.
Do you have any instructions you can share in this point.
#5 Updated by Constantin Asofiei over 8 years ago
Eugenie Lyzenko wrote:
Task branch
1811s
for review updated to revision10986
.This is GUI button
implicit/auto
resize issue fix. The new painting issue found for button is the real button differs from (width|height)-pixels by 1 pixel in both dimensions. Will be resolved in next update.Constantin,
To verify the
4gl<->p2j
pictures exact match I need to know how to get the same font for both4gl
andp2j
. Or how to set upp2j
in a way to use the same fonts as for 4gl default configuration onwindev01
. I need to:
1. The main windows are the same in4GL
andP2J
2. The button fonts are the absolutely the same(in text width and height) in4GL
andP2J
.Do you have any instructions you can share in this point.
Use the same approach as for selection-list: update your testcases project, take the custom-fonts node from here #2701-4 (or the directory.xml from testcacses/) plus the simple/server/fonts folder.
From this, change the font-table in the directory.xml to use different fonts/sizes and check the widget's dimension attributes in P2J and 4GL.
#6 Updated by Eugenie Lyzenko over 8 years ago
Task branch 1811s
for review updated to revision 10987
.
This is the GUI button fix for incorrect width/height 1 pixel calculation during button painting. Also the change restores the ability to use images for GUI button.
#7 Updated by Eugenie Lyzenko over 8 years ago
- File gui_btn_test25_p2j.jpg added
This is the screen with fixed button size calculation. Testcase uast/button/gui_btn_test25.p
from revision 1382
.
#8 Updated by Eugenie Lyzenko over 8 years ago
Task branch 1811s
for review updated to revision 10991
.
The small change to fix button text location issue in pressed and disabled state fro string draw centered function.
#9 Updated by Eugenie Lyzenko over 8 years ago
- File toggle_box_sizing_p2j_0_20151019.jpg added
- File toggle_box_sizing_p2j_1_20151019.jpg added
- File toggle_box_sizing_4gl_0.jpg added
- File toggle_box_sizing_4gl_1.jpg added
Greg, Vadim,
The analysis for primary issue.
1. The testcase to get this bug(uast/toggle_box/gui/tbx_static1.p
) is not correct or not informative. The fixed version is:
... def var tbx as logical. def var tbbx as logical view-as toggle-box size 15 by 1.5. def button exit_btn label "exit". def frame f tbbx exit_btn no-labels. display tbx view-as toggle-box /*size 10 by 1.6*/ with frame f. tbbx:bgcolor = 4. tbx:bgcolor = 5. message "name: " + tbx:name + " width-chars: " + string(tbx:width-chars) + " width-pixels: " + string(tbx:width-pixels) + " width: " + string(tbx:width). message " height-chars: " + string(tbx:height-chars) + " height-pixels: " + string(tbx:height-pixels) + " height: " + string(tbx:height). pause. /*tbx:label = ?.*/ message "name: " + tbbx:name + " width-chars: " + string(tbbx:width-chars) + " width-pixels: " + string(tbbx:width-pixels) + " width: " + string(tbbx:width). message " height-chars: " + string(tbbx:height-chars) + " height-pixels: " + string(tbbx:height-pixels) + " height: " + string(tbbx:height). enable all with frame f. wait-for choose of exit_btn ...
2. There are no SIZE related issues here. Take a look at the pictures attached. As you can see all sizes for both toggle boxes are the same in 4GL
and P2J
.
3. The only issues have seen from this test are:
- Toggle box check mark location(Y direction) in P2J
is one pixel more than expected in 4GL
.
- Toggle box label in disabled state in P2J
is incorrect. There must be actually 2 same texts with different color but one pixel XY shift, the dark over the light.
Vadim, do you have any comments?
#10 Updated by Greg Shah over 8 years ago
Eugenie, the trunk revision 10947 has some fixes to toggle box. 1811s does not yet include those (it is a pending rebase). Please check this testcase in the trunk to see if your found issues are resolved there or not.
#11 Updated by Eugenie Lyzenko over 8 years ago
Greg Shah wrote:
Eugenie, the trunk revision 10947 has some fixes to toggle box. 1811s does not yet include those (it is a pending rebase). Please check this testcase in the trunk to see if your found issues are resolved there or not.
The trunk build has no difference with current 1811s
branch for toggle-box. The toggle box size is correct there too. And the issues from point 3 can also be seen.
#12 Updated by Vadim Gindin over 8 years ago
Eugenie Lyzenko wrote:
Greg, Vadim,
The analysis for primary issue.
1. The testcase to get this bug(uast/toggle_box/gui/tbx_static1.p
) is not correct or not informative. The fixed version is:
[...]2. There are no SIZE related issues here. Take a look at the pictures attached. As you can see all sizes for both toggle boxes are the same in
4GL
andP2J
.3. The only issues have seen from this test are:
- Toggle box check mark location(Y direction) inP2J
is one pixel more than expected in4GL
.
- Toggle box label in disabled state inP2J
is incorrect. There must be actually 2 same texts with different color but one pixel XY shift, the dark over the light.Vadim, do you have any comments?
Eugeniy, I probably missed that. I'll check it and fix it Thank you.
#13 Updated by Greg Shah over 8 years ago
- Assignee changed from Eugenie Lyzenko to Vadim Gindin
Vadim: how quickly can these issues be addressed?
#14 Updated by Vadim Gindin over 8 years ago
Greg Shah wrote:
Vadim: how quickly can these issues be addressed?
During the day.
#15 Updated by Vadim Gindin over 8 years ago
- File leftBefore-rightAfter.png added
- Disabled font is fixed and check mark 1pix shift is also done.
- SIZE problem is still exists in my machine. In other words, the toggle-box with
SIZE 15 by 1.5
clause is displayed with the same size as toggle-box without it. See attached image: There are 2 screen shots of executed procedure (described in the note 9). Left shot - is before spacebar is pressed and the right one - after that.
Eugenie, please comment this situation as we've discussed.
#16 Updated by Eugenie Lyzenko over 8 years ago
This is certainly a kind of regression because in 1811s
branch version 10991(as of 20151019) everything was OK as you can see from the picture.
I have just uploaded fix for review(1811s
revision 11023
). The idea is to use width/height from config to get the size. If auto sizing required - the size is computing dynamically ans stored in config for further usage.
Vadim, the toggle-box still have drawing issues with text(both enabled and disabled states)
- XY position is wrong
- disable text behind color is wrong it must be light shadow(implemented as white in default scheme)
#17 Updated by Vadim Gindin over 8 years ago
Eugenie Lyzenko wrote:
..
- disable text behind color is wrong it must be light shadow(implemented as white in default scheme)
Eugenie, lets clarify colors. As I founded before: top-left (gray) color is 16 COLOR_3DSHADOW
and right-bottom color (white) is 20 COLOR_BTNHIGHLIGHT
. Do you mean the same colors?
#18 Updated by Eugenie Lyzenko over 8 years ago
Vadim Gindin wrote:
Eugenie Lyzenko wrote:
..
- disable text behind color is wrong it must be light shadow(implemented as white in default scheme)Eugenie, lets clarify colors. As I founded before: top-left (gray) color is
16 COLOR_3DSHADOW
and right-bottom color (white) is20 COLOR_BTNHIGHLIGHT
. Do you mean the same colors?
Yes, for disabled text the back side text color is COLOR_BTNHIGHLIGHT
the front text color is COLOR_3DSHADOW
.
#19 Updated by Vadim Gindin over 8 years ago
- File size.png added
I've updated branch to the latest revision and It seems SIZE problem is solved by on of latest commits:
#20 Updated by Vadim Gindin over 8 years ago
The last one issue is remained: location of check mark. Eugenie, how did you find, that it is wrong?
#21 Updated by Eugenie Lyzenko over 8 years ago
Vadim Gindin wrote:
The last one issue is remained: location of check mark. Eugenie, how did you find, that it is wrong?
The check mark position is no OK. Nothing to fix here.
#22 Updated by Eugenie Lyzenko over 8 years ago
- File toggle_box_text_p2j_issue_enabled_20151023.jpg added
- File toggle_box_text_p2j_issue_disabled_20151023.jpg added
There are remaining text/dotted selection rectangle issues. The attached pictures are from 4GL
with pasted some fragments from P2J
. You can see:
1. Disabled text X coordinate in P2J
2 pixels less than expected in 4GL
.
2. Enabled text X coordinate in P2J
1 pixel less than expected in 4GL
.
3. Enabled text Y coordinate in P2J
1 pixel more than expected in 4GL
.
4. Enabled text highlight width in P2J
1 pixel less than expected in 4GL
.
5. Enabled text highlight Y coordinate in P2J
1 pixel more than expected in 4GL
.
6. Enabled text highlight height in P2J
1 pixel less than expected in 4GL
.
#23 Updated by Vadim Gindin over 8 years ago
Thank you! I've fixed it just now. Branch 2677a, revno 10953.
#24 Updated by Eugenie Lyzenko over 8 years ago
- File disabled_text_4gl_correct.jpg added
- File disabled_text_p2j_incorrect_20151024.jpg added
Vadim Gindin wrote:
Thank you! I've fixed it just now. Branch 2677a, revno 10953.
The only issue still exist is incorrect drawing for the text in disabled state of the toggle-box. Consider the pictures attached for current P2J
build and 4GL
to see the difference. The dark text should be painted over the light one(to do this you must draw the light text first, then the dark text - this is the mandatory sequence).
#25 Updated by Vadim Gindin over 8 years ago
Thank you again! Fixed in rev 10955.
#26 Updated by Eugenie Lyzenko over 8 years ago
Vadim Gindin wrote:
Thank you again! Fixed in rev 10955.
OK. Confirm all issues are now fixed.
#27 Updated by Greg Shah over 8 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
#28 Updated by Greg Shah over 7 years ago
- Target version changed from Milestone 12 to GUI Support for a Complex ADM2 App