Project

General

Profile

Feature #3811

more misc UI features

Added by Greg Shah over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Marius Gligor
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
version_reported:
version_resolved:

3811_fwd_web_client_soft_paste_issue_20190402.jpg - Nothing to PASTE (34 KB) Eugenie Lyzenko, 04/02/2019 12:15 PM

ManualHighlightOff_Image.png (181 KB) Scott Turnamian, 08/18/2019 09:43 PM

ScreenNothingSelected.png (180 KB) Scott Turnamian, 08/18/2019 09:43 PM

ManualHighlightOn_Image.png (182 KB) Scott Turnamian, 08/18/2019 09:43 PM

ManualHighlightOff_ToggleBox.png (181 KB) Scott Turnamian, 08/18/2019 09:43 PM

ManualHighlightOn_ToggleBox.png (182 KB) Scott Turnamian, 08/18/2019 09:43 PM

ManualHighlightOff_Browser.png (182 KB) Scott Turnamian, 08/18/2019 09:43 PM

ManualHighlightOn_Browser.png (183 KB) Scott Turnamian, 08/18/2019 09:43 PM

fwd-manual-highlight.png (15.6 KB) Marius Gligor, 08/27/2019 12:43 PM

fill-in-manual-highlight.png (4.53 KB) Marius Gligor, 08/27/2019 12:49 PM

w-manualhighlight.png (15.6 KB) Marius Gligor, 08/28/2019 03:07 AM

selection-list-highlight.zip (13.1 KB) Marius Gligor, 08/28/2019 11:44 AM

slider-highlight.zip (17.1 KB) Marius Gligor, 08/28/2019 11:44 AM

frame-highlight.zip (7.42 KB) Marius Gligor, 08/29/2019 08:02 AM

selection-list-fixed.zip (10 KB) Marius Gligor, 09/02/2019 11:39 AM

slider-tic-marks.zip (35.1 KB) Marius Gligor, 09/05/2019 10:12 AM

slider-vertical.png (9.21 KB) Marius Gligor, 09/05/2019 10:35 AM

test9_screens.zip (24.8 KB) Marius Gligor, 09/09/2019 10:42 AM

test9-widgets-layout.zip (17.2 KB) Marius Gligor, 09/09/2019 10:42 AM

slider-selection.zip (43.3 KB) Marius Gligor, 09/10/2019 12:07 PM

slider-mouse-area.png (9.3 KB) Marius Gligor, 09/13/2019 11:03 AM

manual-highlight-web.zip (461 KB) Marius Gligor, 10/01/2019 11:00 AM

hotel-classic.zip (1.81 MB) Marius Gligor, 10/02/2019 02:53 AM

hotel-classic-bad.zip (287 KB) Marius Gligor, 10/02/2019 03:47 AM

manual-highlight-classic.png (13.8 KB) Marius Gligor, 10/02/2019 05:17 AM

slider-bad-thumb.png (6 KB) Marius Gligor, 10/03/2019 05:30 AM

radio-set-web-manual-selection.zip (11.4 KB) Marius Gligor, 10/04/2019 10:25 AM

slider-thumb-ok.png (5.29 KB) Marius Gligor, 10/04/2019 10:31 AM

radioset-new-uast-tests-results.zip (29 KB) Marius Gligor, 10/08/2019 11:27 AM

hl-selection.zip (101 KB) Marius Gligor, 10/09/2019 07:25 AM


Related issues

Related to User Interface - Feature #3762: misc UI features Closed
Related to User Interface - Feature #2628: Non-fill-in column support in browse. WIP 07/30/2015
Related to User Interface - Feature #3908: implement browse column VIEW-AS COMBO-BOX Closed

History

#1 Updated by Greg Shah over 5 years ago

General Attributes

  • COLUMN-FGCOLOR
  • MIN-HEIGHT-CHARS
  • MANUAL-HIGHLIGHT

Editor Methods

  • EDIT-CUT
  • EDIT-COPY
  • EDIT-PASTE

Browse Attributes

  • PREV-COLUMN
  • NUM-VISIBLE-COLUMNS

Browse Options

  • DISABLE-AUTO-ZAP
  • VIEW-AS COMBO-BOX is NOT being done here, see #3908

Browse Methods

  • ADD-COLUMNS-FROM

#2 Updated by Greg Shah over 5 years ago

#3 Updated by Greg Shah over 5 years ago

The browse cell support for combo-box is discussed (briefly) in #2628-5.

#4 Updated by Greg Shah over 5 years ago

From Constantin:

the browse COMBO-BOX column might be a little tricky to add

Since combo-box has a child window for the drop-down, I can see your point. On a positive note, Stanislav already added support for toggle-box so that means the core support for non-fill-in cells is already there.

#5 Updated by Greg Shah over 5 years ago

  • Related to Feature #2628: Non-fill-in column support in browse. added

#6 Updated by Greg Shah over 5 years ago

  • Related to Feature #3908: implement browse column VIEW-AS COMBO-BOX added

#7 Updated by Greg Shah over 5 years ago

  • Assignee set to Eugenie Lyzenko

I'm going to have someone write testcases for MANUAL-HIGHLIGHT since the documentation is useless.

BROWSE ... VIEW-AS COMBO-BOX will be done in a separate task.

The other items can be worked on now.

#8 Updated by Eugenie Lyzenko over 5 years ago

  • Status changed from New to WIP

What is the branch to commit the changes for this task? Or I need to create new separate one?

Also I have a question for COLUMN-FGCOLOR attribute(browse widget specific). What is the current status, can someone clarify? I see the support is implemented for Browse Column widget, at least on conversion level. What is TODO for this attribute?

#9 Updated by Greg Shah over 5 years ago

What is the branch to commit the changes for this task?

Create a new one.

What is the current status, can someone clarify? I see the support is implemented for Browse Column widget, at least on conversion level. What is TODO for this attribute?

Stanislav: this one is for you, I think.

#10 Updated by Eugenie Lyzenko over 5 years ago

Another question for browse widget. Why we currently have the COLUMN-FGCOLOR attached to BrowseColumnWidget instead of BrowseWidget? It it planned approach? I'm asking because BrowseColumnWidget is an artificial one, no direct counterpart in 4GL code, right? Using this attribute is something like browse:COLUMN-FGCOLOR, not browse-column:COLUMN-FGCOLOR. How it should work from 4GL code conversion perspective?

#11 Updated by Eugenie Lyzenko over 5 years ago

Created task branch 3811a from trunk revision 11301.

#12 Updated by Stanislav Lomany over 5 years ago

What is the current status, can someone clarify? I see the support is implemented for Browse Column widget, at least on

COLUMN-FGCOLOR attribute is fully implemented. Other items are not.

#13 Updated by Eugenie Lyzenko over 5 years ago

Stanislav Lomany wrote:

What is the current status, can someone clarify? I see the support is implemented for Browse Column widget, at least on

COLUMN-FGCOLOR attribute is fully implemented. Other items are not.

How about #3811-10 clarification? This will significantly save my time from writing additional testcases and check the browse widget.

#14 Updated by Stanislav Lomany over 5 years ago

I'm asking because BrowseColumnWidget is an artificial one, no direct counterpart in 4GL code, right?

I would say it has direct counterpart. You can get columns by using browse:FIRST-COLUMN and column:NEXT-COLUMN attributes. Here you can find the full list of column widget attributes/methods: https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvref/browse-widget.html

The list of attributes/methods has the "Applies to" column which tells if the attributes/method is applicable to a browse, a column or a cell, e.g. BGCOLOR attribute is applicable to all three elements so we have browse:BGCOLOR attribute and column:BGCOLOR attribute. Cell, on the other hand, is not a widget and its attributes are accessed in the ROW-DISPLAY trigger through the handle to the column to which the cell belongs. E.g.

column1 = browse brws:first-column. 

on row-display of browse brws do:
  column1:bgcolor = random(6, 13).
end.

Cell methods like EDIT-COPY can be accessed for editable browse when editing is in process using the same column handle: column1:edit-copy().

Using this attribute is something like browse:COLUMN-FGCOLOR, not browse-column:COLUMN-FGCOLOR.

E.g. browse:FIRST-COLUMN:COLUMN-FGCOLOR.

#15 Updated by Eugenie Lyzenko over 5 years ago

Stanislav Lomany wrote:

...

Using this attribute is something like browse:COLUMN-FGCOLOR, not browse-column:COLUMN-FGCOLOR.

E.g. browse:FIRST-COLUMN:COLUMN-FGCOLOR.

OK. Thanks for clarification. Shouldn't the browse:COLUMN-FGCOLOR set or get the column color for all columns in a browse?

#16 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11302.

The update adds conversion support for browse widget attributes (MIN|MAX)-HEIGHT-CHARS. Also adds conversion support for MAX-WIDTH_CHARS window widget setter. The runtime support for browse widget server side has also been added. Starting to implement client side runtime support for browse widget.

Do we need to implement MAX-HEIGHT-CHARS attribute in addition to MIN-HEIGHT-CHARS?

#17 Updated by Greg Shah over 5 years ago

Do we need to implement MAX-HEIGHT-CHARS attribute in addition to MIN-HEIGHT-CHARS?

Yes, that makes sense.

#18 Updated by Stanislav Lomany over 5 years ago

OK. Thanks for clarification. Shouldn't the browse:COLUMN-FGCOLOR set or get the column color for all columns in a browse?

In 4G there is no such attribute:

COLUMN-FGCOLOR attribute          Column

You can use FGCOLOR for that.

#19 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11303.

This finalizes the implementation of the (MIN|MAX)-HEIGHT-CHARS attribute. After testing I've found the actual worker for browse widget is MIN-HEIGHT-CHARS and only for reading. The other usages of the attribute produces the following error/message box:

**MAX-HEIGHT is not a queryable attribute for BROWSE br(4052).
**MAX-HEIGHT is not a setable attribute for BROWSE br(4052).
**MIN-HEIGHT is not a setable attribute for BROWSE br(4052).

So the maxHeightChars variable was removed from BrowseConfig. We do not need to server-client exchange here. However the 4GL does allow to use the attributes for set and get. So the code should be converted without errors, the rules allow the setters to be converted. The error message is displaying at run time.

So far the (MIN|MAX)-HEIGHT-CHARS is now completed and verified to have the same reactions as 4GL. For browse and window widgets. Shifting to another attribute implementation.

#20 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11304.

This adds conversion and runtime support for browse attributes NUM-VISIBLE-COLUMNS and PREV-COLUMN. Shifting to the other methods/options.

#21 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11305.

This adds support for DISABLE-AUTO-ZAP attribute in browse widget(column). Currently the implementation works only for fill-in based cell value. Planning to check the attribute used as option in DEFINE BROWSE ... statement.

#22 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11306.

The update adds support for DISABLE-AUTO-ZAP option in DEFINE BROWSE statement. The idea is to use currently implemented use of setAutoZap() attribute on the frame set up stage. The default value for DISABLE-AUTO-ZAP is changed to false. Going to start working on remaining Editor/Browse widgets methods.

#23 Updated by Eugenie Lyzenko over 5 years ago

Greg,

I've started to work on clipboard related editor widget methods: CUT/COPY/PASTE and I have two design questions to clarify.

1. The Clipboard we will use here is the client side object, correct? For web client this is the system clipboard of the machine where the Web browser is running, correct? This way we can provide text exchange between FWD application and other text edit capable utils(like Notepad for example).

2. I'm going to add new methods to existed SelectableText interface instead of creating new special interface for clipboard methods. This integrates the clipboard usage features not only to Editor widget but Fill-In(and all classes extended from) will also be upgraded. Is it OK? Or we need only Editor be involved in this change?

#24 Updated by Eugenie Lyzenko over 5 years ago

The widgets are currently involved in point 2 changes - FillInWidget and ComboBoxWidget in addition to EditorWidget. We can just add a stub code if particular implementation is not required at this time for fill-in and combo-box.

#25 Updated by Stanislav Lomany over 5 years ago

Task branch 3811a has been updated for review to revision 11303.

Looks good.

#26 Updated by Stanislav Lomany over 5 years ago

Task branch 3811a has been updated for review to revision 11304.

Look good.

#27 Updated by Stanislav Lomany over 5 years ago

Task branch 3811a has been updated for review to revision 11305-6.

Looks good.

#28 Updated by Greg Shah over 5 years ago

1. The Clipboard we will use here is the client side object, correct?

Yes. We have existing support for integrating with the clipboard. That should be used here.

For web client this is the system clipboard of the machine where the Web browser is running, correct? This way we can provide text exchange between FWD application and other text edit capable utils(like Notepad for example).

Yes. But the low level clipboard integration is already there so you don't have to write that part.

2. I'm going to add new methods to existed SelectableText interface instead of creating new special interface for clipboard methods. This integrates the clipboard usage features not only to Editor widget but Fill-In(and all classes extended from) will also be upgraded. Is it OK?

Yes, that is great.

We can just add a stub code if particular implementation is not required at this time for fill-in and combo-box.

No, please go ahead with a full implementation for all text widgets.

#29 Updated by Greg Shah over 5 years ago

Also, please note that EDIT-UNDO was probably only stubbed in the POC (see #3762). But we need the runtime for it, so please add EDIT-UNDO to the list. If it is easy to implement EDIT-CAN-UNDO and EDIT-CAN-PASTE, then go ahead with those.

On UNDO, FILL-IN is not listed but it is supported as part of a BROWSE cell. I suspect it works in a regular FILL-IN too, but you should check.

#30 Updated by Eugenie Lyzenko over 5 years ago

Greg Shah wrote:

Also, please note that EDIT-UNDO was probably only stubbed in the POC (see #3762). But we need the runtime for it, so please add EDIT-UNDO to the list.

OK.

If it is easy to implement EDIT-CAN-UNDO and EDIT-CAN-PASTE, then go ahead with those.

OK. I'll check.

On UNDO, FILL-IN is not listed but it is supported as part of a BROWSE cell. I suspect it works in a regular FILL-IN too, but you should check.

OK.

#31 Updated by Greg Shah over 5 years ago

Don't forget to update the gap analysis rules. By the way, EDIT-CAN-UNDO is marked wrong today (the conversion is marked none but it should be full).

#32 Updated by Eugenie Lyzenko over 5 years ago

Additional attributes/methods to implement:

Browse, Combo-box, Editor Method(s)
  • EDIT-UNDO
Browse, Combo-box Attribute(s)
  • AUTO-COMPLETION

#33 Updated by Eugenie Lyzenko over 5 years ago

Greg Shah wrote:

Don't forget to update the gap analysis rules.

OK.

By the way, EDIT-CAN-UNDO is marked wrong today (the conversion is marked none but it should be full).

May be you mean EDIT-UNDO instead? I'm asking because I have not found any references for kw_edit_c_u for EDIT-CAN-UNDO inside methods_attributes.rules. Or the support for this attribute defined in other rule file?

#34 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11307.

Adding full support for EDIT-(COPY|CUT|PASTE) methods. Testcases repo updated to rev 1824 to check editor/fill-in widgets with new methods.

I have found the runtime implementation has a bugs for Fill-In with handling selected text. Adding debug here in TODO list for this task. The Web client has some strange feature for CUT/COPY/PASTE. Only text copied inside FWD Web client can be pasted. Not text from system clipboard. I'm going to investigate this too in deep.

#35 Updated by Greg Shah over 5 years ago

May be you mean EDIT-UNDO instead?

Yes, sorry.

#36 Updated by Eugenie Lyzenko over 5 years ago

Actually EDIT-CAN-UNDO implementation is easy if UNDO capability already done(as for EditorGuiImpl). So it is not an issue for editor to add EDIT-CAN-UNDO.

Another case is FillInGuiImpl. It is not UNDO capable as far as I can see. So here we need to add UNDO capability first if required, and then we can easily add EDIT-CAN-UNDO feature.

#37 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11308.

Adding support for EDIT-UNDO method, EDIT-CAN-UNDO, EDIT-CAN-PASTE attributes.

The investigation shows the UNDO operation is possible for Editor, the Fill-In is not undo aware. So far we have full support for these attributes and method. I have added EDIT-CAN-PASTE support. The idea is to try getting text from clipboard and if it is not empty we can consider the EDIT-CAN-PASTE attribute is true.

I need at least one day more to completely test how new attributes are working in real client environment especially for Web client. This must be done in addition to testing CUT/COPY/PASTE. And make fixes if issues will be discovered.

#38 Updated by Greg Shah over 5 years ago

Status update from Eugenie:

Yes, almost completed. I have left to add implementation for Browse related ADD-COLUMNS-FROM method and attribute MANUAL-HIGHLIGHT.

Also I would like to spend a day to test/fix already implemented editor related features - CUT/COPY/PASTE/UNDO if you do not mind. I have a feeling the FWD has an issues here especially in Web client and Clipboard used in this case.

So totally I'm planning to spend up to 3 days for all(1 day for Clipboard related features testing and 1-2 days fro remaining new features implementation and tests). If something will go unexpected it can take more time(or may be less if implementation will be simple).

#39 Updated by Greg Shah over 5 years ago

I'm good with the plan, except for MANUAL-HIGHLIGHT.

MANUAL-HIGHLIGHT is strange because it is not clear in which situations we need to honor this. In past applications, there was no difference when this was ON or OFF. But the feature must have some implementation, we just don't know which widgets are affected and what those effects will be. I was planning to ask a 4GL developer to write testcases so that we can know what to implement.

For now, leave MANUAL-HIGHLIGHT unfinished.

#40 Updated by Eugenie Lyzenko over 5 years ago

Greg Shah wrote:

I'm good with the plan, except for MANUAL-HIGHLIGHT.

MANUAL-HIGHLIGHT is strange because it is not clear in which situations we need to honor this. In past applications, there was no difference when this was ON or OFF. But the feature must have some implementation, we just don't know which widgets are affected and what those effects will be. I was planning to ask a 4GL developer to write testcases so that we can know what to implement.

For now, leave MANUAL-HIGHLIGHT unfinished.

OK. Understood. I thought the attribute is related to direct manipulation features. When we select some widgets and move or resize them by mouse. But certainly it is not clear how to substitute default highlight painter with custom one so let's wait for good test to see what exactly we need to do here.

#41 Updated by Eugenie Lyzenko over 5 years ago

One more attribute to implement I've missed: AUTO-COMPLETION for combo-box widget. We need this to be implemented, right?

#42 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11309.

This adds conversion support and runtime stubs for browse widget ADD-COLUMNS-FROM method.

#43 Updated by Greg Shah over 5 years ago

Eugenie Lyzenko wrote:

One more attribute to implement I've missed: AUTO-COMPLETION for combo-box widget. We need this to be implemented, right?

Yes.

#44 Updated by Eugenie Lyzenko over 5 years ago

UNDO editor feature does not properly work in FWD. The text inside the editor is not getting back to the version before last update. Need to investigate:
1. The expected behavior in 4GL.
2. What is wrong in FWD.

UNDO 4GL actions:
1. Text deleted by Del or Backspace in current line - restore text making it as selected (Swing OK)
2. Cut text - restore text, making it as selected
3. Paste text - remove text, no selection
4. New line by ENTER - remove new line, no selection

The FWD experience/issues:
1. Swing and Web clients OK.
2. Swing and Web clients not working as expected, removed text restores in wrong position, selection is incorrect
3. Swing and Web clients not working as expected, no pasted text removing, position is wrong
4. Swing and Web clients not working

Web client specific. It is not possible to paste text from external application like gedit. Web client does paste from internal buffer only if text was previously copied by Web client application COPY/CUT operation. This is an issue/bug to be fixed, correct?

#45 Updated by Constantin Asofiei over 5 years ago

Eugenie Lyzenko wrote:

Web client specific. It is not possible to paste text from external application like gedit. Web client does paste from internal buffer only if text was previously copied by Web client application COPY/CUT operation. This is an issue/bug to be fixed, correct?

PASTE works in Web client AFAIK; but there is another problem - first key is 'consumed' by the Web JS driver - I don't think it reaches the Java client. How to duplicate: switch focus from browser to another window (like gedit), and back; type a key - first time will fail, second time will appear.

#46 Updated by Eugenie Lyzenko over 5 years ago

Constantin Asofiei wrote:

Eugenie Lyzenko wrote:

Web client specific. It is not possible to paste text from external application like gedit. Web client does paste from internal buffer only if text was previously copied by Web client application COPY/CUT operation. This is an issue/bug to be fixed, correct?

PASTE works in Web client AFAIK; but there is another problem - first key is 'consumed' by the Web JS driver - I don't think it reaches the Java client. How to duplicate: switch focus from browser to another window (like gedit), and back; type a key - first time will fail, second time will appear.

Are you able to PASTE from external application like gedit int FWD editor widget?

#47 Updated by Constantin Asofiei over 5 years ago

Eugenie Lyzenko wrote:

Are you able to PASTE from external application like gedit int FWD editor widget?

Yes. But first type any other key (which is consumed by JS driver) and after that CTRL-V.

Please try to fix this.

#48 Updated by Eugenie Lyzenko over 5 years ago

Constantin Asofiei wrote:

Eugenie Lyzenko wrote:

Are you able to PASTE from external application like gedit int FWD editor widget?

Yes. But first type any other key (which is consumed by JS driver) and after that CTRL-V.

Please try to fix this.

There is an issue with EDIT-PASTE() implementation(will be fixed as part of the EDIT-PASTE implementation). But I can paste by both CTRL-V and SHIFT-INSERT without any extra key. Can you provide detailed instruction to replicate the issue you have mentioned.

#49 Updated by Constantin Asofiei over 5 years ago

Eugenie Lyzenko wrote:

There is an issue with EDIT-PASTE() implementation(will be fixed as part of the EDIT-PASTE implementation). But I can paste by both CTRL-V and SHIFT-INSERT without any extra key. Can you provide detailed instruction to replicate the issue you have mentioned.

So, using chrome, I'm doing this:
  • focus an editable widget in the Web client (FILL-IN)
  • switch focus to from Chrome to another OS window (like gedit) - use ALT-TAB for this
  • switch focus back to Chrome - type any letter/number/etc, it will not be visible in the FILL-IN; second time you will see it. Don't press the mouse buttons or anything else - just have focus back to Chrome and you will see that the first time you type a key is ignored.

#50 Updated by Eugenie Lyzenko over 5 years ago

Constantin Asofiei wrote:

Eugenie Lyzenko wrote:

There is an issue with EDIT-PASTE() implementation(will be fixed as part of the EDIT-PASTE implementation). But I can paste by both CTRL-V and SHIFT-INSERT without any extra key. Can you provide detailed instruction to replicate the issue you have mentioned.

So, using chrome, I'm doing this:
  • focus an editable widget in the Web client (FILL-IN)
  • switch focus to from Chrome to another OS window (like gedit) - use ALT-TAB for this
  • switch focus back to Chrome - type any letter/number/etc, it will not be visible in the FILL-IN; second time you will see it. Don't press the mouse buttons or anything else - just have focus back to Chrome and you will see that the first time you type a key is ignored.

What about Editor widget, not Fill-In? Do you see the issue in Editor? If not - it is another problem, not related to the EDIT-(CUT/COPY/PASTE) feature.

#51 Updated by Constantin Asofiei over 5 years ago

Eugenie Lyzenko wrote:

What about Editor widget, not Fill-In? Do you see the issue in Editor? If not - it is another problem, not related to the EDIT-(CUT/COPY/PASTE) feature.

Yes, what I describe (first key being consumed after Chrome receives focus) is another problem; and CTR-V works for both FILL-IN and EDITOR, with clipboard data from i.e. gedit.

Is your problem that EDIT-PASTE is not working if the clipboard has data from another OS window?

#52 Updated by Eugenie Lyzenko over 5 years ago

Constantin Asofiei wrote:

Eugenie Lyzenko wrote:

What about Editor widget, not Fill-In? Do you see the issue in Editor? If not - it is another problem, not related to the EDIT-(CUT/COPY/PASTE) feature.

Yes, what I describe (first key being consumed after Chrome receives focus) is another problem; and CTR-V works for both FILL-IN and EDITOR, with clipboard data from i.e. gedit.

Is the same issue for Firefox?

Is your problem that EDIT-PASTE is not working if the clipboard has data from another OS window?

No the problem is the Websock gets empty clipboard content when clipboard has the text. Until pressing paste shortcut inside Web client FWD editable widget. The CTRL-V forces the web client to return valid clipboard content instead of empty text. May be this is the Browser constraint and Web browser has it's own internal clipboard butter that become in sync with system clipboard by PASTE keys. For security reasons for example to protect from viruses and robots.

#53 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11310.

This is the set of fixes for EDITOR widget in UNDO operation processing. Including correct processing for new line insert(RETURN key), CUT and PASTE.

What is not yet fixed is PASTE operation from external application to Web client based FWD EDITOR widget. Looks like before any keyboard based operation inside browser it is problematic to access the clipboard content form JS code. Need further investigation for what we can do here.

#54 Updated by Constantin Asofiei over 5 years ago

Eugenie Lyzenko wrote:

Is the same issue for Firefox?

The issue I mentioned with the first key being lost after the browser gets back the OS focus, is only for Chrome; I can't duplicate it with Firefox.

#55 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11311.

Added runtime support for ADD-COLUMNS-FROM method. The gap rule file has also being updated to reflect current support level change.

Starting to implement AUTO-COMPLETION attribute.

#56 Updated by Eugenie Lyzenko over 5 years ago

Task branch 3811a has been updated for review to revision 11312.

Added first stage of the AUTO-COMPLETION attribute support. At this time full server side runtime implementation has been added including VIEW-AS clause. The conversion support already was ready to use. The remaining part is to implement GUI client side runtime implementation. And it is a bit complex than I have expected. The two testcases was created to investigate details of attribute usage in native 4GL(updated in repo as rev 1827).

What I've found is the attribute is active for SIMPLE and DROP-DOWN modes of combo-box widget, no matter if the list is opened or not. The item selection is performed based on string part entered in entry field. The respective item is selecting, making remaining item part as selected text inside entry field. In addition the VALUE-CHANGED trigger is firing with full item name to be set as combo-box new screen value. This is what we have to implement for client side part. Continue working.

#57 Updated by Greg Shah over 5 years ago

What is not yet fixed is PASTE operation from external application to Web client based FWD EDITOR widget. Looks like before any keyboard based operation inside browser it is problematic to access the clipboard content form JS code. Need further investigation for what we can do here.

Sergey: can you discuss with Eugenie about the technique we use for providing a real but hidden entry field for clipboard processing in a fill-in. I wonder if we miss that in an editor.

#58 Updated by Sergey Ivanovskiy over 5 years ago

Greg Shah wrote:

What is not yet fixed is PASTE operation from external application to Web client based FWD EDITOR widget. Looks like before any keyboard based operation inside browser it is problematic to access the clipboard content form JS code. Need further investigation for what we can do here.

Sergey: can you discuss with Eugenie about the technique we use for providing a real but hidden entry field for clipboard processing in a fill-in. I wonder if we miss that in an editor.

Don't understand what is the issue. PASTE should work with the web client, it was implemented and worked properly.

#59 Updated by Sergey Ivanovskiy over 5 years ago

From this thread it is not clear what is the PASTE issue? Should I check out 3811a?

#60 Updated by Constantin Asofiei over 5 years ago

Eugenie, I'm confused, too - PASTE is working via CTRL-V with both Chrome and Firefox. Please post a standalone testcase and a scenario (browser, key pressed, which widget has focus, etc), which duplicates your issue.

#61 Updated by Eugenie Lyzenko over 5 years ago

Constantin Asofiei wrote:

Eugenie, I'm confused, too - PASTE is working via CTRL-V with both Chrome and Firefox. Please post a standalone testcase and a scenario (browser, key pressed, which widget has focus, etc), which duplicates your issue.

I have updated testcases bzr repo(rev 1828). There you can find the testcases uast/gui/edit_undo.p. Run it and follow the scenario:
0. Have 3811a branch.
1. Open external application(gedit for example)
2. Select some text and copy to system clipboard.
3. Go to the FWD application. Focus to the EDITOR widget.
4. Press PASTE pushbutton(do not use CTRL-V or SHIFT-INS, it is important).
5. You will see the Web client (unlike Swing one does not paste the text because JS gets empty clipboard content)

This is an issue we need to resolve(may this is planned Browser restriction or missing correct Clipboard API in Browser).

#62 Updated by Sergey Ivanovskiy over 5 years ago

Eugenie Lyzenko wrote:

Constantin Asofiei wrote:

Eugenie, I'm confused, too - PASTE is working via CTRL-V with both Chrome and Firefox. Please post a standalone testcase and a scenario (browser, key pressed, which widget has focus, etc), which duplicates your issue.

I have updated testcases bzr repo(rev 1828). There you can find the testcases uast/gui/edit_undo.p. Run it and follow the scenario:
0. Have 3811a branch.
1. Open external application(gedit for example)
2. Select some text and copy to system clipboard.
3. Go to the FWD application. Focus to the EDITOR widget.
4. Press PASTE pushbutton(do not use CTRL-V or SHIFT-INS, it is important).
5. You will see the Web client (unlike Swing one does not paste the text because JS gets empty clipboard content)

This is an issue we need to resolve(may this is planned Browser restriction or missing correct Clipboard API in Browser).

I downloaded uast/gui/edit_undo.p. It seems that it can be implemented similar to the copy, paste, cut editor's menu popup (opened by the right mouse button).

#63 Updated by Sergey Ivanovskiy over 5 years ago

This EditorPopupGuiImpl should work properly.

#64 Updated by Eugenie Lyzenko over 5 years ago

Guys, we have some misunderstanding here. Again, Swing client works fine, while Web client does not.

The approach with editor pop up menu does not work as well, see the picture, it shows there is nothing to paste.

Nothing to PASTE

#65 Updated by Sergey Ivanovskiy over 5 years ago

Eugenie Lyzenko wrote:

Guys, we have some misunderstanding here. Again, Swing client works fine, while Web client does not.

The approach with editor pop up menu does not work as well, see the picture, it shows there is nothing to paste.

Nothing to PASTE

I just tested the trunc version and found that the Paste is disabled too. But if the Paste menu is enabled, then the data can be transmitted from the system clipboard to the application and back. This is the issue of

   private void initEditorItems(boolean textEmpty)
   {
      cutOpt.setEnabled(!textEmpty);
      copyOpt.setEnabled(!textEmpty);

      String clipboardContents = ((GuiDriver) OutputManager.getDriver()).clipboardContents();
      pasteOpt.setEnabled(clipboardContents != null && !clipboardContents.isEmpty());

      selectAllOpt.setEnabled(textEmpty);
   }

This method ((GuiDriver) OutputManager.getDriver()).clipboardContents() doesn't return the system clipboard content for the web client because the process to get this value from the browser based on the user action. It cannot be done via jscript without user's approval. It seems that this the Paste button should be enabled at the start, then you can observe that the PASTE works properly. I don't know if we can fix OutputManager.getDriver()).clipboardContents() in order to ask the user to get the clipboard.

#66 Updated by Sergey Ivanovskiy over 5 years ago

OutputManager.getDriver()).clipboardContents() cannot be done via jscript without user's approval.

#67 Updated by Sergey Ivanovskiy over 5 years ago

If we send CTRL+V like this

            Widget<?> owner = (Widget<?>) 
                     menu.screen().getRegistry().getComponent(menu.config().ownerId);

            EventManager.postOSEvent(new KeyInput(owner, EventType.KEY_PRESSED, Keyboard.KA_PASTE));


, then it initiates the web client to ask a user to do a paste action. It works properly.

#68 Updated by Eugenie Lyzenko over 5 years ago

Sergey Ivanovskiy wrote:

Eugenie Lyzenko wrote:

Guys, we have some misunderstanding here. Again, Swing client works fine, while Web client does not.

The approach with editor pop up menu does not work as well, see the picture, it shows there is nothing to paste.

Nothing to PASTE

I just tested the trunc version and found that the Paste is disabled too. But if the Paste menu is enabled, then the data can be transmitted from the system clipboard to the application and back.

Yes, I know. The problem is not the Paste is disabled. The problem is the Web client(JS code) does not see the clipboard content. That's why the Paste is disabled. And this is the main issue here.

This is the issue of
[...]
This method ((GuiDriver) OutputManager.getDriver()).clipboardContents() doesn't return the system clipboard content for the web client because the process to get this value from the browser based on the user action. It cannot be done via jscript without user's approval.

This is what I'm struggling with.

It seems that this the Paste button should be enabled at the start, then you can observe that the PASTE works properly. I don't know if we can fix OutputManager.getDriver()).clipboardContents() in order to ask the user to get the clipboard.

Just enabling Paste button does not help because the browser will not see the Clipboard content whether we enable Paste or not.

For now the only potential solution I see is to simulate paste key sequence(say CTRL-V) on the JS level as if the user presses the real keyboard. But this is big Browser security hole and I think the Browser will struggle with our attempts like this.

Or may be we need some third party browser plugin that allows to easily get access to system clipboard from Browser.

#69 Updated by Sergey Ivanovskiy over 5 years ago

I don't know the PASTE menu enabled requirements, but it seems that this menu item can be enabled forever.

#70 Updated by Sergey Ivanovskiy over 5 years ago

Eugenie, I tested this issue and found that CTRL-V should work. It seems that your conclusions are incorrect. Did you test it with another branch with the trunc version? Please enable PASTE menu and test this issue.

#71 Updated by Sergey Ivanovskiy over 5 years ago

Sergey Ivanovskiy wrote:

Eugenie, I tested this issue and found that CTRL-V should work. It seems that your conclusions are incorrect. Did you test it with another branch with the trunc version? Please enable PASTE menu and test this issue.

I mean that pasteOpt.setEnabled(true); is enough. Please apply this diff

=== modified file 'src/com/goldencode/p2j/ui/client/gui/EditorPopupGuiImpl.java'
--- src/com/goldencode/p2j/ui/client/gui/EditorPopupGuiImpl.java    2018-08-02 16:22:01 +0000
+++ src/com/goldencode/p2j/ui/client/gui/EditorPopupGuiImpl.java    2019-04-02 17:06:39 +0000
@@ -242,8 +242,7 @@
       cutOpt.setEnabled(!textEmpty);
       copyOpt.setEnabled(!textEmpty);

-      String clipboardContents = ((GuiDriver) OutputManager.getDriver()).clipboardContents();
-      pasteOpt.setEnabled(clipboardContents != null && !clipboardContents.isEmpty());
+      pasteOpt.setEnabled(true);

       selectAllOpt.setEnabled(textEmpty);
    }

and test it with the trunc version to observe that it works properly.

#72 Updated by Sergey Ivanovskiy over 5 years ago

There is a picture of the current COPY/PAST/CUT web client architecture in the original task where this issue is originated but I cannot find this task. Any case ((GuiDriver) OutputManager.getDriver()).clipboardContents(); usage for the web client and for the swing client are different due to the browser's issue.

#73 Updated by Eugenie Lyzenko over 5 years ago

Sergey Ivanovskiy wrote:

Sergey Ivanovskiy wrote:

Eugenie, I tested this issue and found that CTRL-V should work. It seems that your conclusions are incorrect. Did you test it with another branch with the trunc version? Please enable PASTE menu and test this issue.

I mean that pasteOpt.setEnabled(true); is enough. Please apply this diff
[...]
and test it with the trunc version to observe that it works properly.

Yes, this works properly requesting CTRL-V from user to confirm in a Browser window.

#74 Updated by Sergey Ivanovskiy over 5 years ago

Eugenie, please look at SystemAction in p2j.mouse.js in order to understand how PASTE is implemented.

#75 Updated by Sergey Ivanovskiy over 5 years ago

It seems that this code

      MouseHandler.registerWidgetAction(
               menuId,
               new SystemAction(menuId, MouseEvt.PASTE, null));

registers this paste system action for the web client.

#76 Updated by Eugenie Lyzenko over 5 years ago

Thank you for help. I have some background to implement solution.

The difference is I do not need event listener. Instead FWD needs one time call to JS to initiate paste from Java code. Working on the implementation.

#77 Updated by Sergey Ivanovskiy over 5 years ago

It is difficult to use this system menu for

on choose of PasteButton in frame ClipFrame
do:
  chEditor:edit-paste().
end.

It needs to trigger the paste system menu action. I thought that it could help but not sure now. chEditor:edit-paste() could register system action. OK. :)

#78 Updated by Eugenie Lyzenko about 5 years ago

Task branch 3811a has been updated for review to revision 11313.

This is complete implementation of the soft PASTE operation for EDIT-PASTE() widget method called from editor widget. Working in Web client as well. The pop up menu is not used here but idea is pretty similar. We have bi-directional relationship between Java and JS parts to sync the moment when data is ready for paste.

Because the code in EditorPopupGuiImpl is not used here I leave this file untouched, so the change mentioned in #3811-71 is not here.

Continue working with remaining AUTO-COMPLETION attribute TODO list.

#79 Updated by Eugenie Lyzenko about 5 years ago

The status updated, but I have not received the respective message to e-mail. Pushing another record.

#80 Updated by Eugenie Lyzenko about 5 years ago

Task branch 3811a has been updated for review to revision 11314.

The update adds base implementation for AUTO-COMPLETION runtime support. The SIMPLE mode was tested and confirmed as working as expected. The DROP-DOWN mode testing is now starting. The testcases used can be found in uast/combo_box, combo_box22.p and combo_box22_1.p for SIMPLE and DROP-DOWN modes respectively. I'm expecting to have some issues(deviations from 4GL) for the cases the drop-down list is opened. Need to examine in details and fix problems discovered.

#81 Updated by Eugenie Lyzenko about 5 years ago

  • Status changed from WIP to Review

Task branch 3811a has been updated for review to revision 11315.

With this update the support for AUTO-COMPLETION attribute has been completed for COMBO-BOX widget with DROP-DOWN mode. The deviations that have been found since recent update(11314) fixed in this change.

So far the misc features for this task have been implemented. Changing status of the task to Review.

#82 Updated by Eugenie Lyzenko about 5 years ago

I need to write the testcase to verify the current implementation of the ADD-COLUMNS-FROM method. I'm worry a bit and need to make sure my implementation is consistent.

#83 Updated by Eugenie Lyzenko about 5 years ago

Added testcase uast/browse/brws_add_cols_from.p to bzr testcases repo, rev 1829.

Found several bugs/issues in current implementation. Fixing.

#84 Updated by Eugenie Lyzenko about 5 years ago

The bugs found have been fixed. Now ADD-COLUMNS-FROM() works almost the same as in original 4GL.

The only deviation we have is related to Progress Document(ABL Reference) inconsistency. According to doc related to adding columns behavior(page 1412) I see:

...
If a field is found that already has a corresponding browse column created, it is ignored.
...

But testcase shows the different reaction in real 4GL environment. Adding is ignored if and only if the field was already added by previous ADD-COLUMNS-FROM(). If the field existed before first call to ADD-COLUMNS-FROM() it will really be added making fields duplication in browse.

If my understanding correct in cases when Progress Docs conflicts with 4GL reality we implement what we see on 4GL system, right? No matter how strange the reality is(I think the document describes more consistent behavior).

So I'm planning to add respective handling code if nobody objects.

#85 Updated by Eugenie Lyzenko about 5 years ago

  • % Done changed from 0 to 100

Task branch 3811a has been updated for review to revision 11316.

This change fixes the bugs found during testing the ADD-COLUMNS-FROM() implementation. The testcases updated to revision 1830 to have more informative results. When there is nothing to add because all fields already added or excluded the method returns true anyway.

Also the implementation repeats weird 4GL behavior in checking for already added fields while adding new ones. However I've left all code to easily back to original documented approach. So I'm changing done status to 100%.

#86 Updated by Eugenie Lyzenko about 5 years ago

Task branch 3811a has been updated for review to revision 11317.

Adding gap status change for AUTO-COMPLETION attribute.

#87 Updated by Greg Shah about 5 years ago

If my understanding correct in cases when Progress Docs conflicts with 4GL reality we implement what we see on 4GL system, right? No matter how strange the reality is(I think the document describes more consistent behavior).

Yes.

#88 Updated by Eugenie Lyzenko about 5 years ago

Greg Shah wrote:

If my understanding correct in cases when Progress Docs conflicts with 4GL reality we implement what we see on 4GL system, right? No matter how strange the reality is(I think the document describes more consistent behavior).

Yes.

OK. The current version 11317 does match this criteria.

#89 Updated by Stanislav Lomany about 5 years ago

Code review branch 3811a rev 11309, 11311, 11316 regarding ADD-COLUMNS-FROM I have only code style notes:
  1. queryToCheck parameter is not needed in getFieldsForBuffer and getBufferForTable.
  2. Instead of
    Buffer buffer = null;
    ...
    if (tableNameStr.isEmpty())
    {
       return buffer;
    }
    ...
    
    boolean retCode = false;
    if (srcBuffer == null)
    {
       return new logical(retCode);
    }
    

    I would prefer for better reading
    if (tableNameStr.isEmpty())
    {
       return null;
    }
    Buffer buffer = null;
    ...
    
    if (srcBuffer == null)
    {
       return new logical(false);
    }
    boolean retCode = false;
    
  3. You don't need contains check in
    if(fieldsToAdd.contains(excpt[i]))
    {
       fieldsToAdd.remove(excpt[i]);
    }
    ...
    if(addedName != null && !addedName.isEmpty() && fieldsToAdd.contains(addedName))
    {
       fieldsToAdd.remove(addedName);
    }
    
  4. colsAdded should probably renamed to colsAddedFrom and explicitly state in javadoc that in contains ONLY columns added thru ADD-COLUMNS-FROM. Also, it should be initialized on demand: it is used rarely.
  5. I don't see a point in leaving commented out the code which "was removed because does not match the real 4GL behavior".

#90 Updated by Eugenie Lyzenko about 5 years ago

Stanislav Lomany wrote:

Code review branch 3811a rev 11309, 11311, 11316 regarding ADD-COLUMNS-FROM I have only code style notes:
  1. queryToCheck parameter is not needed in getFieldsForBuffer and getBufferForTable.

Agree for getFieldsForBuffer but for getBufferForTable it is used inside the method.

All other notes have been resolved too.

Task branch 3811a has been updated for review to revision 11319.

Notes resolution.

#91 Updated by Stanislav Lomany about 5 years ago

but for getBufferForTable it is used inside the method.

It is always the browse query. Why pass it as a parameter?

#92 Updated by Eugenie Lyzenko about 5 years ago

Stanislav Lomany wrote:

but for getBufferForTable it is used inside the method.

It is always the browse query. Why pass it as a parameter?

  1. For better reading(no expenses because it is reference, not object copy)
  2. For possible further usage with other query

#93 Updated by Greg Shah about 5 years ago

See #2921-15 for the code review.

#94 Updated by Eugenie Lyzenko about 5 years ago

Task branch 3811a has been updated for review to revision 11323.

Notes resolution. EDIT-* related widget implementation are moved to new ClipboardHelper class.

#95 Updated by Constantin Asofiei about 5 years ago

In 3811a rev 11323, I see no reason for the new ClientExports APIs to return a Boolean instance instead of a boolean native value. Also, there is no NPE protection where thse APIs are used, and also I don't see how the ThinClient side can return a null value.

Eugenie: if I'm correct in the above, please change the new ClientExports APIs to return a boolean value.

#96 Updated by Eugenie Lyzenko about 5 years ago

Constantin Asofiei wrote:

In 3811a rev 11323, I see no reason for the new ClientExports APIs to return a Boolean instance instead of a boolean native value.

Task branch 3811a has been updated for review to revision 11324.

Changed return values from Boolean to boolean.

Also, there is no NPE protection where thse APIs are used, and also I don't see how the ThinClient side can return a null value.

Please clarify. I do not understand where is the missing NPE protection. The code in ThinClient:

   public boolean editCopySelection(int id, boolean cut)
   {
...      
      if (w instanceof TextSelection)

gives enough protection from NPE because null != instanceof TextSelection. Or you mean something other?

#97 Updated by Constantin Asofiei about 5 years ago

Eugenie Lyzenko wrote:

Task branch 3811a has been updated for review to revision 11324.

Changed return values from Boolean to boolean.

Changes look good.

Also, there is no NPE protection where thse APIs are used, and also I don't see how the ThinClient side can return a null value.

I meant when you used Boolean return type; but as you changed it to boolean, there's no need for NPE checks.

#98 Updated by Eugenie Lyzenko about 5 years ago

  • Status changed from Review to Test

Task branch 3811a rev 11324 passed the regression testing. So looks ready for planned rebase/merge in future.

#99 Updated by Greg Shah about 5 years ago

Code Review Task Branch 3811a Revision 11324

I'm good with the changes.

Constantin: Are you OK with the vertical positioning changes?

Hynek: Are you OK with the MIN-HEIGHT-CHARS and MAX-HEIGHT-CHARS changes? I'm surprised that more runtime support was not needed for those.

#100 Updated by Hynek Cihlar about 5 years ago

Code review MIN-HEIGHT-CHARS and MAX-HEIGHT-CHARS changes in 3811a.

  • Reference to MAX-WIDTH-CHARS in the javadoc for BrowseInterface.setMaxHeightChars() methods
  • Reference to MIN-WIDTH-CHARS in the javadoc for BrowseInterface.setMinHeightChars() methods
  • setMaxHeight(double) and setMinHeight(double) are redundant when setMaxHeight(NumberType) and setMinHeight(NumberTypes) overloads exist

In methods_attributes.rules

               <!-- MAX-HEIGHT-CHARS support for browse -->
               <rule>ftype == prog.kw_max_h_c
                  <rule>htype == prog.kw_browse
                     <action>hwrap = "Browse"</action>
                     <action on='false'>hwrap = "Window"</action>
                  </rule>
                  <action>methodText = "getMaxHeightChars"</action>
                  <rule>isAssign
                     <action>methodText = "setMaxHeightChars"</action>
                  </rule>
               </rule>

the comment is a bit misleading, as the rule also covers Window widget. Besides, for MIN-HEIGHT-CHARS the rule structure is slightly different:

               <rule>ftype == prog.kw_min_h_c and htype == prog.kw_browse
                  <action>hwrap = "Browse"</action>
                  <action>methodText = "getMinHeightChars"</action>
                  <rule>isAssign
                     <action>methodText = "setMinHeightChars"</action>
                  </rule>
               </rule>

               <rule>ftype == prog.kw_min_h_c and htype != prog.kw_browse
                  <action>hwrap = "Window"</action>
                  <action>methodText = "getMinHeightChars"</action>
                  <rule>isAssign
                     <action>methodText = "setMinHeightChars"</action>
                  </rule>
               </rule>

It would be better to use the same pattern for clarity for both MIN-HEIGHT-CHARS and MAX-HEIGHT-CHARS.

#101 Updated by Eugenie Lyzenko about 5 years ago

Hynek Cihlar wrote:

Code review MIN-HEIGHT-CHARS and MAX-HEIGHT-CHARS changes in 3811a.

  • Reference to MAX-WIDTH-CHARS in the javadoc for BrowseInterface.setMaxHeightChars() methods
  • Reference to MIN-WIDTH-CHARS in the javadoc for BrowseInterface.setMinHeightChars() methods
  • setMaxHeight(double) and setMinHeight(double) are redundant when setMaxHeight(NumberType) and setMinHeight(NumberTypes) overloads exist

In methods_attributes.rules
[...]

the comment is a bit misleading, as the rule also covers Window widget. Besides, for MIN-HEIGHT-CHARS the rule structure is slightly different:
[...]

It would be better to use the same pattern for clarity for both MIN-HEIGHT-CHARS and MAX-HEIGHT-CHARS.

Task branch 3811a has been updated for review to revision 11325.

Notes resolution.

#102 Updated by Eugenie Lyzenko about 5 years ago

Task branch 3811a has been rebased with trunk 11302, new revision is 11326.

Can I retest and if no regression - commit to the trunk?

#103 Updated by Greg Shah about 5 years ago

Yes, go ahead.

#104 Updated by Eugenie Lyzenko about 5 years ago

Greg Shah wrote:

Yes, go ahead.

OK. The conversion test has been started. Then runtime.

#105 Updated by Eugenie Lyzenko about 5 years ago

Conversion testing completed. The generated sources are identical.

Starting the runtime tests for 3811a.

#106 Updated by Eugenie Lyzenko about 5 years ago

The main regression part completed without regressions. Waiting for CTRL-C to be done.

Can I merge 3811a into trunk if everything will be OK?

#107 Updated by Greg Shah about 5 years ago

Yes, go ahead.

#108 Updated by Eugenie Lyzenko about 5 years ago

Greg Shah wrote:

Yes, go ahead.

Testing completed. The results: 3811a_11326_32748a0_20190416_evl.zip.

No regressions found. Going to merge 3811a into trunk in 5 min.

#109 Updated by Eugenie Lyzenko about 5 years ago

Branch 3811a was merged to trunk as revno 11303 then it was archived.

#110 Updated by Greg Shah about 5 years ago

Please confirm that everything is complete except for MANUAL-HIGHLIGHT, for which we need 4GL testcases.

#111 Updated by Greg Shah about 5 years ago

For the MANUAL-HIGHLIGHT 4GL testcases:

  • We understand that some widgets do not honor MANUAL-HIGHLIGHT. The idea is that for some widget types you can set MANUAL-HIGHLIGHT to TRUE, but there is no difference in how it draws or behaves. Which widgets have this result? I think BUTTON may be one of them.
  • For each other widget type (which does honor MANUAL-HIGHLIGHT), please write testcases that:
    • Demonstrate how the 4GL changes its drawing/behavior, without any 4GL code that draws manually. This should show the absence of the 4GL behavior (i.e. the behavior/drawing that is turned off by setting MANUAL-HIGHLIGHT).
    • Show example 4GL code that does manually draw a custom highlight.

#112 Updated by Eugenie Lyzenko about 5 years ago

Greg Shah wrote:

Please confirm that everything is complete except for MANUAL-HIGHLIGHT, for which we need 4GL testcases.

Yes, I think all done except this. And COMBO-BOX representation for browse widget cell which is another task I guess.

#113 Updated by Greg Shah about 5 years ago

  • Status changed from Test to Pending
  • % Done changed from 100 to 90

The rest of the implementation work is deferred until the MANUAL-HIGHLIGHT 4GL testcases are ready.

#114 Updated by Scott Turnamian almost 5 years ago

I did not find a single Progress widget that did not honor the MANUAL-HIGHLIGHT attribute behavior as documented. In order to "see" MANUAL-HIGHLIGHT work, you have to use it in conjunction with the SELECTABLE attribute. See below:

"MANUAL-HIGHLIGHT = true has no effect unless SELECTABLE = true. When a widget is made selectable,
a black box is drawn around it. This is called the 'selection highlight' and is only visible when
the widget is SELECTED. When MANUAL-HIGHLIGHT = true, the box is not drawn and so you must devise
your own method for telling the end-user that the widget is SELECTED. For example, by changing its color."

Attached is a piece of code w-manualhighlight.w and a JPEG that exercises the MANUAL-HIGHLIGHT attribute for all of the basic Progress widgets. It shows you the widgets' behavior with and without MANUAL-HIGHLIGHT.

Create the folder C:\GoldenCode and put both of these files in it. Progress finds the image using the PROPATH. Since I don't know what your PROPATH is, I hard-coded the image file reference.

LE: the testcase has been posted in the testcases project and modified to use an image in that project. See #3811-115.

Also, the IMAGE, BUTTON, FRAME, and BROWSE widgets obscure completely, their backgrounds so I used RECTANGLE widgets to demonstrate the functionality. For all other widgets, I simply change the background color.

Also, the BROWSE widget is the only widget that does not allow for setting the MANUAL-HIGHLIGHT attribute via the AppBuilder (Progress' design-time IDE) so I set it programmatically.

Illustrations:

I attached a base image with nothing highlighted. I've also attached 6 more images illustrating several Progress widgets. All behave in the same manner more or less.

Manual highlight off Image widget:
Manual highlight on Image widget:
Manual highlight off toggle-box widget:
Manual highlight on Itoggle-box widget:
Manual highlight off browser widget:
Manual highlight on browser widget:

#115 Updated by Greg Shah almost 5 years ago

The manual-highlight testcase is in the new testcases project (see ui/manual_highlight/w-manualhighlight.w and resources/fwd.png.

#116 Updated by Greg Shah almost 5 years ago

  • Assignee changed from Eugenie Lyzenko to Marius Gligor

Marius: The only remaining work is to implement the runtime behavior for MANUAL-HIGHLIGHT. See #3811-114 and #3811-115 for details on how it works (and how to find the testcase).

#117 Updated by Marius Gligor almost 5 years ago

  • Status changed from Pending to WIP

#118 Updated by Marius Gligor almost 5 years ago

SELECTABLE and MANUAL-HIGHLIGHT attributes are available only for GUI widgets.
MANUAL-HIGHLIGHT attribute is honored by the following GUI widgets:

Button, 
Combo-box, 
Editor, 
Fill-in, 
Frame, 
Image, 
Literal, 
Radio-set,
Rectangle, 
Selection-list, 
Slider, 
Text, 
Toggle-box

The effects of SELECTABLE and MANUAL-HIGHLIGHT attributes on widget behavior:

1. If SELECTABLE=FALSE for a widget:

- MANUAL-HIGHLIGHT attribute is ignored.
- No highlight indicator is draw for the widget.
- SELECTION and DESELECTION events are not fired.

2. If SELECTABLE=TRUE for a widget:

- if MANUAL-HIGHLIGHT=FALSE the standard highlight indicator is draw for widget (a rectangle around the widget).
- if MANUAL-HIGHLIGHT=TRUE no standard highlight indicator is draw for widget. User is allow to draw a custom highlight indicator.
- SELECTION and DESELECTION events are fired. Inside the triggers for these events is the location where the statements for drawing a custom highlight indicator should be placed.
- Inside ON SELECTION trigger block the custom highlight should be draw and inside ON DESELECTION trigger block the custom highlight should be clean-up.
- Drawing a custom highlight indicator is optional. If the user does not provide statements to draw a custom highlight indicator, then no highlight is draw for the widget.

Basically on this task we have to impliment only the management of standard highlight drawing, depending on SELECTABLE and MANUAL-HIGHLIGHT values, as already has been described.

#119 Updated by Marius Gligor almost 5 years ago

The conversion of provided test w-manualhighlight.w has been succeeded with some warnings:

[java] WARNING: BROWSE BROWSE-7 cannot be 'moved' from FRAME 'default-frame' to '', in stmt 'ENABLE' at line 832.
[java] WARNING: BROWSE BROWSE-8 cannot be 'moved' from FRAME 'default-frame' to '', in stmt 'ENABLE' at line 833.

[java] ## WARNING:: Unable to determine type for slider1, setTicMarks, NONE
[java] ## WARNING:: Unable to determine type for slider2, setTicMarks, NONE

Slider definition is:

DEFINE VARIABLE SLIDER-1 AS INTEGER INITIAL 0 
     VIEW-AS SLIDER MIN-VALUE 0 MAX-VALUE 100 HORIZONTAL 
     TIC-MARKS NONE 
     SIZE 14 BY 1.1 NO-UNDO.

Then, I tried to run the converted test in FWD with no success!
The provided test want to create a temporary table but the server persistence is not configured.

[08/27/2019 16:00:15 EEST] (com.goldencode.p2j.persist.trigger.DatabaseTriggerManager:SEVERE) Projects are not properly configured. Database schema triggers are disabled!
[08/27/2019 16:00:15 EEST] (StandardServer.invoke:SEVERE) {0000006D:0000014E:bogus} Abnormal end!
java.lang.IllegalStateException: An attempt to use uninitialized BufferManager. Is persistence activated?
        at com.goldencode.p2j.persist.BufferManager.get_aroundBody0(BufferManager.java:649)
        at com.goldencode.p2j.persist.BufferManager$AjcClosure1.run(BufferManager.java:1)

I tried to activate the persistence in server, but with no success!

[08/27/2019 16:47:50 EEST] (com.goldencode.p2j.persist.DatabaseManager:INFO) Database local/_temp/primary initialized in 7554 ms.
com.goldencode.p2j.cfg.ConfigurationException:  Initialization failure
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:2003)
        ...
Caused by: java.lang.RuntimeException: Error initializing persistence services
    at com.goldencode.p2j.persist.Persistence.initializeInstance_aroundBody122(Persistence.java:3879)
        ...
Caused by: org.hibernate.exception.GenericJDBCException: Invalid value "en_US_P2J" for parameter "collation"; SQL statement:

I tried different directories xml files from testcases/server/simple project with no success!
I'll appreciate if someone could help me providing some hints on how to configure the server persistence.

Next, I created another test from the provided test by eliminating the statements and widgets (BROWSE) which are using the temporary table.
I converted the new test and I succeeded to run the converted application (see attached picture).

The converted app looks pretty much the same like it running in OE environment but with some differences:
- SLIDER widgets are not properly rendered!
- In OE all widgets are read-only accepting only selection while in FWD all widgets are read/write and we are able to edit the widgets!

#120 Updated by Marius Gligor almost 5 years ago

Finally I decided to create small and simple tests for this feature. First I created a test for FILL-IN widget.
With this simple test converted and running in OE and FWD I found that selection works properly in FWD but obviously
MANUAL-HIGHLIGHT is not honored because is not yet implemented.
Simple is better. The provided test is too complex an I think that we could create other simple uast tests for each widgets type.

#121 Updated by Greg Shah almost 5 years ago

Caused by: org.hibernate.exception.GenericJDBCException: Invalid value "en_US_P2J" for parameter "collation"; SQL statement:

See Text Collator

#122 Updated by Marius Gligor almost 5 years ago

  • File fwd-manual-highlight.png added

Greg Shah wrote:

Caused by: org.hibernate.exception.GenericJDBCException: Invalid value "en_US_P2J" for parameter "collation"; SQL statement:

See Text Collator

Fixed, many thanks.

#123 Updated by Marius Gligor almost 5 years ago

  • File deleted (fwd-manual-highlight.png)

#124 Updated by Marius Gligor almost 5 years ago

Apologies, I loaded a wrong image. This one is the correct image.

#125 Updated by Marius Gligor almost 5 years ago

I provided small UAST tests in project /tescases/uast/manual-highlight (revision 1910) along with the original test.
Doing conversions and running the tests in FWD I found 2 widgets which are not working properly:

1. SELECTION-LIST widget (see the pictures from selection-list-highlight.zip file):
- SELECTABLE=TRUE is not honored (maybe not implemented) and as a consequence the standard highlight selection is not draw and SELECTION, DESELECTION events are never fired.
This bug is reproduced in both selection-list.w and w-manualhighlight.w tests.

2. SLIDER widget (see the pictures from slider-highlight.zip file):
- Is not properly rendered when TIC-MARKS or SIZE is specified, but even a simple slider is rendered different in FWD and OE, not at the same scale.
- The position of standard selection indicator is different in FWD and OE.
- SELECTABLE=TRUE is honored, SELECTION and DESELECTION events are fired, but the statement SELF:BGCOLOR = 12. from event trigger has no effect.
This bug is reproduced in both slider.w and w-manualhighlight.w tests.

At a first look over the generated Java code seems that they are runtime rather than conversion bugs.

IMPORTANT: Also according to my OE tests, I observed that when a widget has the attribute SELECTABLE=TRUE he became a read-only widget, that is, we cannot edit the widget
and whenever we click the mouse on the widget the selection is the only action that is performed, the widget is only selectable.
In FWD we don't have the same behavior, the widget is always editable regarding the value of SELECTABLE attribute!

#126 Updated by Greg Shah almost 5 years ago

These are good findings. Please do fix these bugs as part of this work.

#127 Updated by Marius Gligor almost 5 years ago

Created task branch 3811b from FWD trunk revision 11327.

#128 Updated by Marius Gligor almost 5 years ago

Running the converted frame.w test I observed a strange behavior on frames:

- The highlight selection is draw when we click on FRAME-C but is not visible on screen!
If I minimized the main window and then I restored the window, the highlight selection occurred but remain forever!

- When I clicked FRAME-A the SELECTION event is fired and the custom highlight is honored. Is the expected action.

- Clicking on FRAME-C no events are fired on FRAME-A, a DESELECTION event is expected on FRAME-A!

The same behavior I found also in the provided test w-manualhighlight.w

#129 Updated by Greg Shah almost 5 years ago

Are you describing a behavior in 4GL or FWD?

#130 Updated by Marius Gligor almost 5 years ago

Greg Shah wrote:

Are you describing a behavior in 4GL or FWD?

In FWD

#131 Updated by Greg Shah almost 5 years ago

OK, then there are more fixes needed. Thanks.

#132 Updated by Marius Gligor almost 5 years ago

I've fixed the SELECTION-LIST widget selection.
The SELECTION-LIST is implementded in FWD as an instance of SelectionListGuiImpl.java class.
The FWD selection-list widget has 2 important child widgets:
- a scrollpane, an instance of ScrollPaneGuiImpl.java
- a scrolled list widget, an instance of SelectionListBodyGuiImpl.java class, scrolled by scrollpane

Only the scrollpane widget receive and process mouse events.

The solution is to activate/deactivate the direct manipulaion for scrollpane each time selectable attribute changed.
This is done in the selection-list which is the parent widget of scrollpane.
Also the selection-list is the effective widget in MouseDirectManipulation.java handler. Basically the handler will use
the selection-list configuration to check selectable attribute and set selected value.

Changes for this fix has been committed in branch 3811b revision 11328.

#133 Updated by Marius Gligor almost 5 years ago

Today I did a lot of tests in OE for a horizontal SLIDER GUI widget (see attached pictures).
What I observed is that the slider is always layout at the bottom of his container regarding the value of TIC-MARKS
TIC-MARKS only define how tic marks and thumb are rendered relative to slider (top, bottom, both, none),
but the slider it self is always layout relative to the left-bottom of the container.
In the current FWD implementation the position of the slider in container is calculated based on TIC-MARKS which is different than in OE!

#134 Updated by Marius Gligor almost 5 years ago

For VERTICAL sliders, no surprise, the slider is always layout at the left of its container and the 0 position at bottom.
Based on that observations we could change the implementation in SliderGuiImpl making the code more simple and intuitive.

#135 Updated by Greg Shah almost 5 years ago

Please do.

#136 Updated by Greg Shah almost 5 years ago

Please do check the testcases/uast/slider/*.p programs to confirm that your findings are correct. It seems strange that we would have implemented a more complicated approach if it was unnecessary.

#137 Updated by Marius Gligor almost 5 years ago

Today I converted and ran the slider/*.p uast tests. I tested both the original code from trunk and my changes in 3811b branch.
In both environments tests are behave the same except the drawing part which differ a little bit as I'll explain bellow.
I used the slider/slider_test9.p uast test which display all kind of sliders, horizontal and vertical having different tic marks to check the drawing code.
I attached a zip file test9_screens.zip containing 3 snapshots from 4gl, fwd trunk and 3811b branch code.
Except the bug related to the layout of vertical sliders, the screens looks pretty much the same with some differences at pixel level.
At this moment the original implementation from trunk is closer to 4gl at pixel level.

Next I did an interesting test by setting different background colors to horizontal sliders.
The results are in the attached test9-widgets-layout.zip file.
As we can see 4gl has strange layout for horizontal sliders. The slider at row 2 column 1, colored in light gray
is layout a little bit up. This slider has TIC-MARKS BOTTOM but looks like the ruler and thumb button is aligned at the top,
but in reality are always aligned at the bottom!
This is probably one of the many strange quirks of 4gl.
The ruler, thumb button and highlight selection is always aligned at the bottom or left of the slider depending of slider type, horizontal or vertical.
However the position and size depend on TIC-MARKS value and the kind of slider, horizontal or vertical.
The drawing code must contains such kind of adjustments for compatibility with 4gl at pixel level.
One solution might be to define some constants values depending on TIC-MARKS and use those already defined when draw the widget.

Another observation regarding sliders uast tests:
Tests slider_test3.p and slider_test31.p which try to create a slider dynamically does not work properly.
When running in 4gl, a window alert having a warning message 453 is show then the slider is displayed.
When running in FWD the same message is displayed but the slider is not displayed!

#138 Updated by Marius Gligor almost 5 years ago

I improved the draw method of GUI slider widget providing some constants used to draw the slider components like highlight area, slider, mouse area.
Using constants allow us to draw slider components at pixel level with granularity of 1 pixel!
With those changes in place the GUI slider looks like in 4gl almost 100% (see the attached picture test9-fwd.png).
The provided test w-manualhighlight.w for selection works properly now. (see the attached pictures slider-*.png)
Also I redefined the mouse area to be 4gl compliant (see the attached picture test9-mouse-area.png).
The code changes has been committed in branch 3811b revision 11333.

#139 Updated by Marius Gligor almost 5 years ago

Last changes which adjust slider widget mouse area coordinates has been committed in branch 3811b revision 11335
The work on this task is done and the changes are ready for a code review (branch 3811b revisions 11329 to 11335).

#140 Updated by Greg Shah almost 5 years ago

Constantin/Eugenie: Please review the changes in 3811b.

#141 Updated by Eugenie Lyzenko almost 5 years ago

Greg Shah wrote:

Constantin/Eugenie: Please review the changes in 3811b.

I have no objections in general. The questions:
1. The 11330 re-enables the select/deselect events for skip widget. The reason? Did you test whether this change cause regressions for skip widget becomes selected and has selection border around? The skip widget can never be selected.
2. The slider widget has been significantly refactored(11331-11333). Have you tested it with standalone GUI slider tests, in particular for frame 3D mode in classic theme?

#142 Updated by Constantin Asofiei almost 5 years ago

Eugenie Lyzenko wrote:

1. The 11330 re-enables the select/deselect events for skip widget. The reason? Did you test whether this change cause regressions for skip widget becomes selected and has selection border around? The skip widget can never be selected.

Eugenie, is not obvious for me how this is happening - can you clarify a little?

Marius, please update the copyright year to 2019, for the files you changed. Also, have you tested with the Web client? Otherwise, beside making sure this is not breaking anything else in GUI (like direct manipulation for other widgets), I'm good with the changes.

#143 Updated by Eugenie Lyzenko almost 5 years ago

Constantin Asofiei wrote:

Eugenie Lyzenko wrote:

1. The 11330 re-enables the select/deselect events for skip widget. The reason? Did you test whether this change cause regressions for skip widget becomes selected and has selection border around? The skip widget can never be selected.

Eugenie, is not obvious for me how this is happening - can you clarify a little?

If widget selection is happening via mouse click or rectangular selection - the widget become selected and draws the selection frame around itself. The skip widget is not involved in this process, it can not be selected or deselected. Sending DESELECT message to this widget is useless(and CPU consuming) at least.

#144 Updated by Marius Gligor almost 5 years ago

Eugenie Lyzenko wrote:

Greg Shah wrote:

Constantin/Eugenie: Please review the changes in 3811b.

I have no objections in general. The questions:
1. The 11330 re-enables the select/deselect events for skip widget. The reason? Did you test whether this change cause regressions for skip widget becomes selected and has selection border around? The skip widget can never be selected.
2. The slider widget has been significantly refactored(11331-11333). Have you tested it with standalone GUI slider tests, in particular for frame 3D mode in classic theme?

1. DESELECT message is sent only to widgets which are selectable and selected. SKIP and SPACE widgets
are not selectable and never selected and they never receive a DESELECT message. I tested and SKIP widget is never selected.
BTW in 4gl it is not possible to set SKIP widget SELECTABLE attribute because the SKIP widget cannot be defined as a variable having a name.
Trying to do that:

ASSIGN SKIP:SELECTABLE in FRAME FRM-1 = TRUE.
result in an error:
  ** Unknown Field or Variable name - SKIP. (201)
  **  Could not understand line 22. (196)

2. The changes in draw method for GUI Slider widget are related to layout only, setting the location of slider components only.
Basically the selection frame position (coordinates) is set and the ruler component position relative to the selection frame.
The drawing code for slider components: ruler, thumb button, tic marks, selection frame has not been changed, I didn't touch the code.
So the widget looks like in the original implementation but now we can set the position of slider components with 1 pixel granularity.
I tested the changes using UAST test from slider/slider-*.p and I found no problems.
But those tests does not cover all scenarios. For example the original implementation does not work properly with provided UAST test
manual-highlight/w-manualhighlight.w for selection/deselection. I fixed a lot of bugs for selection/deselection widgets, among them the slider layout.
With the new changes in place all UAST tests looks good.

#145 Updated by Marius Gligor almost 5 years ago

Constantin Asofiei wrote:

Eugenie Lyzenko wrote:

1. The 11330 re-enables the select/deselect events for skip widget. The reason? Did you test whether this change cause regressions for skip widget becomes selected and has selection border around? The skip widget can never be selected.

Eugenie, is not obvious for me how this is happening - can you clarify a little?

Marius, please update the copyright year to 2019, for the files you changed. Also, have you tested with the Web client? Otherwise, beside making sure this is not breaking anything else in GUI (like direct manipulation for other widgets), I'm good with the changes.

1. I'll update the copyright year to 2019 in the changed files.

2. I tested only with Swing GUI client not with the Web GUI client. How could I do tests with Web GUI client? Where I can find instructions on how to do that?

#146 Updated by Marius Gligor almost 5 years ago

Task branch 3811b has been rebased with trunk 11330, new revision is 11338.

#147 Updated by Greg Shah almost 5 years ago

I tested only with Swing GUI client not with the Web GUI client. How could I do tests with Web GUI client? Where I can find instructions on how to do that?

Have you tried getting the Hotel GUI running? These instructions were written for external use. Instead of downloading the zip, you should check it out using bzr co ~/secure/code/p2j_repo/samples/hotel_gui. The rest of the instructions should be pretty close to right.

Once you have that working, you can look at the changes the prepare script made to the directory and make similar changes to the directory in testcases/simple/server/ to get your samples running in the web client.

We also have a Web Client Setup. It is mostly up to date, but not 100%.

#148 Updated by Marius Gligor almost 5 years ago

1. I successfully converted the Hotel GUI application on my workstation using my changes from 3811b branch.
Then, I tested both the Swing GUI and Web GUI clients and I found that works properly.

2. Next I added w-manualhighlight.w uast test and I reconverted the Hotel GUI application.
Then I changed the p2j-entry in the server directory and I started my application using both Swing and Web GUI clients.
I attached some pictures with my application running in Web GUI client using all available UI themes.
The application looks good running in both Swing and Web GUI clients using all available themes.
However I found some functionality differences perhaps due to some changes made in the trunk in the mean time.
Some widgets: Radio Set, Slider and Combo Box react to mouse and keyboard events even they are selectable.
I my implementation this was not happen, but now I have other changes from trunk. I have to check that.

3 Finally I rebased my branch to get the last changes from trunk (4124b) and I reconverted the Hotel and my application.
Testing again I found no differences except that when I choose the Classic UI Theme, the application crash with a NPE.
Seems to be a bug, but I'm not really sure that is coming from my last rebase!
A stack trace from client log show that a NPE is raise drawing a radio button widget.

UI Theme successfully changed to 'classic'
Oct 01, 2019 4:53:49 PM Dispatcher.processInbound() 
SEVERE: {main} Unexpected throwable.
java.lang.NullPointerException
    at com.goldencode.p2j.ui.client.gui.driver.BufferedImageDrawHelper.calculateImageBounds(BufferedImageDrawHelper.java:181)
    at com.goldencode.p2j.ui.client.gui.driver.BufferedImageDrawHelper.processImage(BufferedImageDrawHelper.java:116)
    at com.goldencode.p2j.ui.client.gui.driver.BufferedImageDrawHelper.processImage(BufferedImageDrawHelper.java:98)
    at com.goldencode.p2j.ui.client.gui.driver.swing.SwingEmulatedWindow.draw(SwingEmulatedWindow.java:1154)
    at com.goldencode.p2j.ui.client.gui.driver.swing.SwingEmulatedWindow.offer(SwingEmulatedWindow.java:676)
    at com.goldencode.p2j.ui.client.gui.driver.AbstractGuiDriver.drawImage(AbstractGuiDriver.java:1708)
    at com.goldencode.p2j.ui.client.gui.theme.ClassicTheme.drawRadioButton(ClassicTheme.java:1872)
    at com.goldencode.p2j.ui.client.gui.RadioButtonGuiImpl.lambda$draw$0(RadioButtonGuiImpl.java:142)
    at com.goldencode.p2j.ui.client.gui.driver.AbstractGuiDriver.draw(AbstractGuiDriver.java:3014)
    at com.goldencode.p2j.ui.client.gui.RadioButtonGuiImpl.draw(RadioButtonGuiImpl.java:142)
    at com.goldencode.p2j.ui.client.RadioSet.draw(RadioSet.java:522)

I have to check why this happen. I will try to convert and run Hotel GUI application from trunk just to check if the problems are not coming from my changes.

#149 Updated by Marius Gligor almost 5 years ago

I converted the Hotel GUI application using the current p2j trunk branch. I tested with all available UI themes and I found no problems.
Some snapshots when using Classic UI theme has been attached.

#150 Updated by Marius Gligor almost 5 years ago

I converted the Hotel GUI application using a link to my 3811b branch.
Then, I tested the Hotel GUI application and I found that it doesn't work when using Classic UI theme.
The window buttons icons are not rendered at all! Even more, when I clicked the Guest tab button, the application crash with the same stack trace like I posted at #note-148
Looking in the Guest tab page I found a Radio Set widget, which seems to cause the problem.
Definitely, it's a bug and I'm going to do further investigations.

With all other UI themes the Hotel GUI application works properly.

#151 Updated by Marius Gligor almost 5 years ago

Finally I found the cause of NPE exception using Classic UI Theme.
Basically after I build the project and I checked the resources for Classic UI Theme (*.svg images) in p2j.jar I found that they are missing!
When the application try to get a resource (a .svg file) he get a null pointer and later when he try to use the image trow a NPE.
I fixed the bug in build.xml file as follow:

At the following section:

    <!-- Copy SVG images to jar location -->
    <copy todir="${build.home}/classes${theme.home}">
      <fileset dir="${src.home}${theme.home}" includes="common/*.svg" excludes="common/treeview*.svg common/treelist*.svg"/>
      <fileset dir="${src.home}${theme.home}" includes="windows10/*.svg" />
      <fileset dir="${src.home}${theme.home}" includes="windows8/*.svg" />
    </copy>

I added the resources for Classic UI Theme to be copied as well:

    <!-- Copy SVG images to jar location -->
    <copy todir="${build.home}/classes${theme.home}">
      <fileset dir="${src.home}${theme.home}" includes="common/*.svg" excludes="common/treeview*.svg common/treelist*.svg"/>
      <fileset dir="${src.home}${theme.home}" includes="windows10/*.svg" />
      <fileset dir="${src.home}${theme.home}" includes="windows8/*.svg" />
      <fileset dir="${src.home}${theme.home}" includes="classic/*.svg" />
    </copy>

With this fix in place now the Hotel GUI works properly. Also my application work properly.

An interesting part is that the same bug is present in trunk as well at this moment.
Let me to explain why:
When we rebuild the application, ./gradlew core the old build artifacts are not deleted from project!
So the resources where in the build folder from a previous build.
But when I deleted the build and dist folders from project, and rebuild the project the bug occur in trunk as well, due to missing resources for
classic theme!

#152 Updated by Greg Shah almost 5 years ago

Nice catch!

A few weeks ago, Stanislav reported something similar. He said that the arrow buttons (e.g. on scrollbars) did not work in the classic theme in trunk. I hope this is the same problem.

Are there any remaining known issues for 3811b?

#153 Updated by Marius Gligor almost 5 years ago

Greg Shah wrote:

Nice catch!

A few weeks ago, Stanislav reported something similar. He said that the arrow buttons (e.g. on scrollbars) did not work in the classic theme in trunk. I hope this is the same problem.

Are there any remaining known issues for 3811b?

I'm working to fix the selectable widgets behavior on mouse click and keyboard events. So far I fixed the mouse click.

#154 Updated by Marius Gligor over 4 years ago

I've fixed the selectable widgets behavior on mouse click and keyboard events.
The branch has been rebased on top of the trunk. Current branch 3811b revision is 11345

Tested with Hotel GUI application using both Swing and Web clients for all available UI Themes, I found to works properly.

However, for Classic UI Theme I found a small issue regarding the drawing of slider thumb button.
When the slider is 3D and has a background color different than 3d color, the thumb background is rendered with a 3d color instead of background color.

The thumb button is a .swg (image) resource and this issue should be fixed by setting the appropriate background transparency area in the .svg image.

Branch 3811b is ready for a code review.

#155 Updated by Greg Shah over 4 years ago

Marius, Please do fix that slider background issue in 3811b.

#156 Updated by Marius Gligor over 4 years ago

I never worked with such kind of images (.svg) Which tools are you using to create such resources?

#157 Updated by Hynek Cihlar over 4 years ago

Marius Gligor wrote:

I never worked with such kind of images (.svg) Which tools are you using to create such resources?

I have good experience with Inkscape.

#158 Updated by Constantin Asofiei over 4 years ago

Marius Gligor wrote:

Branch 3811b is ready for a code review.

I'm OK with the changes. If you didn't, please do some tests with Hotel GUI in Web mode.

#159 Updated by Marius Gligor over 4 years ago

1. I've fixed the slider thumb button for Classic UI Theme when background color is not the default SysColor.COLOR_3DFACE color.

2. I tested w-manulhighlight.w with Hotel GUI application using both Swing GUI client and Web GUI client for all available UI themes.

- With Swing GUI client the test works properly using all available UI themes.
- With Web GUI client also works properly using all available UI themes in Firefox and Chrome browsers, except a strange behavior for RadioSet widget. Bellow is a description of what I found:

When a selectable widget having manual-highligt=true, is selected (mouse clicked on the widget) the selection trigger code is executed.
For example in our uast test, the RadioSet widget selection action for manual-highlight is to set the widget background color to RED. When the widget is deselected the background is restored to original value.

This works fine with Swing GUI client but not on Web GUI client. When we select the RadioSet widget on Web GUI client the background color is set to Red but the radio buttons labels are draw over, with initial background color. Clicking again on the widget at one time the entire background is painted in Red! (see attached pictures). For Classic UI theme the background is never paint in Red entirely! I experienced the same behavior in Firefox and Chrome web browsers.

#160 Updated by Greg Shah over 4 years ago

When we select the RadioSet widget on Web GUI client the background color is set to Red but the radio buttons labels are draw over, with initial background color. Clicking again on the widget at one time the entire background is painted in Red! (see attached pictures). For Classic UI theme the background is never paint in Red entirely! I experienced the same behavior in Firefox and @Chrome2 web browsers.

I guess it makes sense to fix this now, please go ahead.

#161 Updated by Marius Gligor over 4 years ago

Today I created two new simple uast tests for radio-set widget as follow:

1 uast/manual-highlight/radioset2.p is a simple test having 2 radio-set widgets in a frame, each widget
having 2 radio buttons. One of the radio-set widget has a static RED background color.
Testing this uast test I found to work properly in desktop and web clients using all UI themes,
and Firefox and Chrome browsers.

2. uast/manual-highlight/radioset3.p is similar with the previous test, but the background color
is set dynamically on triggers for ENTRY and LEAVE of the widget.
Initially widgets have no background color. When the widget 2 gain focus the
background color is set to RED and when the widget lost the focus the background color is set back to ?
Testing this uast test I found to work properly only in desktop client using all UI themes.
For web client the radio-set having dynamic background color is not rendered properly.
Using the arrows keys or the mouse to select the buttons, often one or both buttons are rendered having the initial background color but not the current RED color.
The radio-set button is rendered correct with RED background color, the problem is radio buttons.

Looking over the source code for Web GUI Client, I found that a caching mechanism is used for drawing (START_RECORDING, STOP_RECORDING, DRAW_CACHED).
I think that this mechanism is used for performances reason to minimize the amount of data sent from the web server to browser.
For testing purposes I've cut off the caching mechanism in GuiWebSocket.java class and repeating
the uast tests I found that now all are working properly also in web client, including the manual highlight uast test for radio-set!

My conclusion is that the bug is related to the caching mechanism when a widget have a dynamic background color.
Seems that the first draw of radio button is cached with initial background color.
When next draw occur, the background color became RED, but the cached draw is send to JS.
As a result the radio button is rendered with a wrong background color.
The radio-set widget is always rendered correct, with the right background color.

#162 Updated by Constantin Asofiei over 4 years ago

Marius Gligor wrote:

When next draw occur, the background color became RED, but the cached draw is send to JS.

I assume at some point AbstractGuiDriver.setColor is called? In any case, I'd like to see the stacktrace which calls the driver API to set this RED background color.

We might call this API outside of the normal driver APIs which are used for drawing (where the recording is used).

#163 Updated by Marius Gligor over 4 years ago

Constantin, using your hint I quickly fixed the bug. Many thanks!
Indeed, the AbstractGuiDriver.setColor MUST be called but this is not happen for RadioButton widget.

In p4gl RADIO-BUTTONS is an attribute for a RADIO-SET widget. In FWD, RADIO-BUTTONS attribute is implemented as a RadioButon widget in the client side.
The BGCOLOR is changed for RADIO-SET widget and the drawing is very simple, a rectangle filled with the BGCOLOR.
AbstractGuiDriver.setColor is called to set the fill color and everything works properly.

For a RadioButton widget only the button image and button label are rendered, but no call to AbstractGuiDriver.setColor!
RadioButton widget, share the same configuration as the RADIO-SET widget on which belong, and the colors are similar resolved.
RadioButton background color MUST be the same as the RADIO-SET background color.

In order to fix the bug I added a call to AbstractGuiDriver.setColor on each <ThemeName>Theme.drawRadioButton() method where
the RadioButton widget is draw:

   public void drawRadioButton(RadioButtonGuiImpl rb,
                               GuiDriver gd,
                               GuiColorResolver gc,
                               GuiFontResolver gf,
                               int x,
                               int y,
                               int width,
                               int height,
                               boolean focused,
                               boolean hover)
   {
      // set background color
      gd.setColor(gc.bgColor);

With these changes in place the bug is now fixed and all tests successfully passed.
These changes are mandatory when graphical cache is enabled, but nevertheless they works when cache is disabled as well.

My changes has been committed in branch 3811b rev 11349, 11350

#164 Updated by Greg Shah over 4 years ago

Great! Please run back through the GUI testing (Hotel GUI and your testcases).

Constantin: Any concerns with the final changes?

#165 Updated by Marius Gligor over 4 years ago

In the mean time I did a very small change which improve how highlight selection looks like (see attached pictures).
committed in branch 3811b rev 11351

#166 Updated by Constantin Asofiei over 4 years ago

Marius Gligor wrote:

Constantin, using your hint I quickly fixed the bug. Many thanks!
Indeed, the AbstractGuiDriver.setColor MUST be called but this is not happen for RadioButton widget.

I don't understand how your change works - a setColor call should be followed by a call to actually draw the background. I don't see anything like this in drawRadioButton. Did you re-enable the caching mechanism when you tested?

For example, the classic theme has code like this:

         gd.setColor(disabledTextColorBk);
         gd.drawString(label, xt + 1, yt + 1);

which sets the color before calling a primitive to draw something.

Do idea is, when setColor is called, it should be followed by a call to actually draw something with that color.

#167 Updated by Marius Gligor over 4 years ago

Constantin Asofiei wrote:

Marius Gligor wrote:

Constantin, using your hint I quickly fixed the bug. Many thanks!
Indeed, the AbstractGuiDriver.setColor MUST be called but this is not happen for RadioButton widget.

I don't understand how your change works - a setColor call should be followed by a call to actually draw the background. I don't see anything like this in drawRadioButton. Did you re-enable the caching mechanism when you tested?

For example, the classic theme has code like this:
[...]
which sets the color before calling a primitive to draw something.

Do idea is, when setColor is called, it should be followed by a call to actually draw something with that color.

After setting the background color, the radio button image and radio label are drawing. (please take a look over drawRadioButton() method)
Also a dotted rectangle is draw when the widget is selected.
As I understood the graphical cache store data per widget Id and all drawing ops on drawRadioButton() are cached.
So all graphical ops within drawRadioButton() are recorded including my changes to set the color.
When DRAW_CACHED is sent to JS means that a cached image should be draw. The cached image is an image recorded by applying graphical ops.
Is this correct or is a misunderstanding of graphical cache concept?

#168 Updated by Constantin Asofiei over 4 years ago

Marius Gligor wrote:

After setting the background color, the radio button image and radio label are drawing. (please take a look over drawRadioButton() method)
Also a dotted rectangle is draw when the widget is selected.

I'm confused because you just make the sequence of draw operations to reflect the new background color, but this isn't actually used in drawRadioButton() to draw the background. Your change makes the draw sequence to be unique in terms that it will not use an incorrectly cached image. My problem is that I don't understand who draws the background for the radio button. I found only this code in RadioSetGuiImpl:

         // fill the background
         gd.setColor(gc.bgColor);
         gd.fillRect(0, 0, d.width, d.height);

Why isn't there a similar code for individual radio-button drawing?

As I understood the graphical cache store data per widget Id and all drawing ops on drawRadioButton() are cached.
So all graphical ops within drawRadioButton() are recorded including my changes to set the color.
When DRAW_CACHED is sent to JS means that a cached image should be draw. The cached image is an image recorded by applying graphical ops.
Is this correct or is a misunderstanding of graphical cache concept?

Yes, this is correct; a small note: the cached image used is always the one 'most inclusive': i.e. if is determined that the cached image for the entire parent frame can be used, then that will be used, and not for its individual widgets.

#169 Updated by Marius Gligor over 4 years ago

On Swing and Web GUI driver the bgcolor is set when radio-set is drawing and seems to be used when draw radio-button as well.
When the radio button label is draw the bgcolor of radio-set is used.
Probably the GuiDriver instance is the same since the radio button is draw within radio-set in method drawInt()
What do you think about that?

#170 Updated by Marius Gligor over 4 years ago

I just tested. I added a simple System.out.println(gd); when RadioSetGuiImpl and RadioButtonGuiImpl widgets are created (constructor)
Then running my app with Swing GUI Client I captured from stdin:

 
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver@4b5189ac
...

This prove that the same instance of GuiDriver (SwingGuiDriver) is used by both widgets.

#171 Updated by Eugenie Lyzenko over 4 years ago

Constantin Asofiei wrote:

Marius Gligor wrote:

After setting the background color, the radio button image and radio label are drawing. (please take a look over drawRadioButton() method)
Also a dotted rectangle is draw when the widget is selected.

I'm confused because you just make the sequence of draw operations to reflect the new background color, but this isn't actually used in drawRadioButton() to draw the background. Your change makes the draw sequence to be unique in terms that it will not use an incorrectly cached image. My problem is that I don't understand who draws the background for the radio button. I found only this code in RadioSetGuiImpl:
[...]
Why isn't there a similar code for individual radio-button drawing?

Yes, the background for radio-button is painting one time inside radio-set. No code to draw BG for each radio-button. The idea was the radio-button is a part of the enclosing object(radio-set) or even if standalone - it will use the background of the object behind.

#172 Updated by Marius Gligor over 4 years ago

Eugenie Lyzenko wrote:

Constantin Asofiei wrote:

Marius Gligor wrote:

After setting the background color, the radio button image and radio label are drawing. (please take a look over drawRadioButton() method)
Also a dotted rectangle is draw when the widget is selected.

I'm confused because you just make the sequence of draw operations to reflect the new background color, but this isn't actually used in drawRadioButton() to draw the background. Your change makes the draw sequence to be unique in terms that it will not use an incorrectly cached image. My problem is that I don't understand who draws the background for the radio button. I found only this code in RadioSetGuiImpl:
[...]
Why isn't there a similar code for individual radio-button drawing?

Yes, the background for radio-button is painting one time inside radio-set. No code to draw BG for each radio-button. The idea was the radio-button is a part of the enclosing object(radio-set) or even if standalone - it will use the background of the object behind.

Indeed, without graphical cache the RadioSet widget work properly.
The BG color is set when RadioSet is draw and used also when the RadioButton is draw.
Using the graphical cache, the recorded image for RadioButton has no BG ops since this done in another widget, RadioSet.
Adding a set BG ops to RadioButton as well, the recorded image is now correct.
We can do that only when the graphical cache is enabled if you consider that, but we have to do more changes to check the value of graphicsCached in GuiWebDriver.
Maybe a better solution is to add more description to javadoc of drawRadioButton method, just to reflect all aspects discussed here regarding this topic.

#173 Updated by Constantin Asofiei over 4 years ago

Marius, OK, I understand now - the issue was that for FWD, the radio-buttons are individual widgets, and we cache the image for them, without any info related to the background color.

So the changes are OK. Please merge the branch to trunk.

#174 Updated by Constantin Asofiei over 4 years ago

Marius Gligor wrote:

Maybe a better solution is to add more description to javadoc of drawRadioButton method, just to reflect all aspects discussed here regarding this topic.

And do update the javadoc before merging.

#175 Updated by Marius Gligor over 4 years ago

In class GuiWebSocket.java I found the following method:

   /**
    * Compute an MD5 hash for the given message.
    * 
    * @param    message
    *           The message with the drawing ops.
    * 
    * @return   A 16-byte array with the MD5 hash.  If the hash could not be computed, return
    *           null.
*/
private byte[] md5Hash(byte[] message) {
try {
if (MD5 == null) {
MD5 = MessageDigest.getInstance("MD5");
} byte[] drawHash = MD5.digest(message);
for (int i = 0; i < drawHash.length; i++) {
drawHash[i] = (byte) (drawHash[i] & 0xFF);
}
return drawHash;
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} return null;
}

What I don't understand here is the for loop because drawHash is a byte array and byte in Java is 8 bits in size.
The for loop has no effect on drawHash array!

#176 Updated by Constantin Asofiei over 4 years ago

Marius Gligor wrote:

In class GuiWebSocket.java I found the following method:

[...]

What I don't understand here is the for loop because drawHash is a byte array and byte in Java is 8 bits in size.
The for loop has no effect on drawHash array!

I don't recall why I added that; but I agree, the loop is a no-op - remove it and do some tests, if caching works properly (you will see messages in the JS console).

#177 Updated by Marius Gligor over 4 years ago

  • % Done changed from 90 to 100

Branch 3811b has been merged to trunk at rev 11336 and archived as merged.

#178 Updated by Greg Shah over 4 years ago

  • Status changed from WIP to Closed

With 3811b, the last of the changes (MANUAL-HIGHLIGHT) is in trunk. This task is complete.

#179 Updated by Greg Shah over 4 years ago

FYI, the MANUAL-HIGHLIGHT entry in rules/gaps/expressions.rules was not updated:

<rule>attrs.put(prog.kw_man_high, rw.cvt_lvl_full       | rw.rt_lvl_stub)</rule>

I will make the change in 4069a (from rw.rt_lvl_stub to rw.rt_lvl_full).

Also available in: Atom PDF