A-Shell Network Post New Topic  Post A Reply
my profile | directory login | search | faq | forum home

  next oldest topic   next newest topic
» A-Shell Network » Program Development » XTREE SelChgExit

 - UBBFriend: Email this page to someone!    
Author Topic: XTREE SelChgExit
Jorge Tavares - UmZero
Senior Developer
Member # 26

Icon 1 posted      Profile for Jorge Tavares - UmZero     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi Jack,

I'm noticing an intermittent fail on detecting the row change using SelChgExit.
It seems that it always fail when clicking the first row and, almost, never work using the down-arrow key.
I know these are always complex cases that probably needs more details but, can you please try there to check if it can be something obvious ?

Thanks in advance

--------------------
Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal

From: Porto-Portugal/Rio de Janeiro-Brasil | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi Jorge,

Looking through the XTREE sample programs, there seems to be only one that actively uses SelChgExit ( XVMNU2 ), but it heavily depends on that feature, and seems to work. (Moving the arrow up and down on the main menu on the left, or clicking on it to change the current selection, uses SelChgExit to update the sub-menu options on the right.)

As an aside, I was testing this with 6.4.1555.3. There was a change in 6.4.1555.1 relating to selchgexit, but that was primarily targeted at clicking on an inactive tree.

So that suggests that the problem is interconnected with some other options. Is it the case that it seems to ignore the selchg event? Or it exits with some other exitcode? Or, if you turn on the XTREE, and possibly XDEBUG, traces, you see a lot of action but no exit?

If you don't like that sample program, another one is XTRA2 but you'll need to uncomment the statement at line 488 that defines SelChgExit=500. I tried it here and it seems to work ok with both clicking and arrows.

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jorge Tavares - UmZero
Senior Developer
Member # 26

Icon 1 posted      Profile for Jorge Tavares - UmZero     Send New Private Message       Edit/Delete Post   Reply With Quote 
Jack,
Just to let you know that this topic is still open, my fault that didn't have time to get back to it and create the proper test.

--------------------
Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal

From: Porto-Portugal/Rio de Janeiro-Brasil | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jorge Tavares - UmZero
Senior Developer
Member # 26

Icon 1 posted      Profile for Jorge Tavares - UmZero     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi Jack,

Now that I'm living in minimal but decent conditions in the new apartment, I had some time to debug this and here are my results with XTREE and XDEBUG set:

Here I click in the cell of row 1 column 3.
0 14:18:56 <TXPRODUTO:233ac> SETFOCUS
1 14:18:59 <TXPRODUTO:233ac> XTREE msg 208, id=1785
2 14:18:59 <TXPRODUTO:233ac> vkey: 0x28 validating...
3 14:18:59 <TXPRODUTO:233ac> ValidateEdit: hwnd=3008e8, inpro=0
4 14:18:59 <TXPRODUTO:233ac> XTREE: Exit Edit: hwnd=3008e8, cell=1,3; change=0 []
5 14:18:59 <TXPRODUTO:233ac> exit ValidateEdit
6 14:18:59 <TXPRODUTO:233ac> post val: hwndedit=0x0
7 14:18:59 <TXPRODUTO:233ac> StartEdit 1,2, hwd=0
8 14:18:59 <TXPRODUTO:233ac> XTREE: Start Edit: hwnd=3108e8, cell=2,3
9 14:18:59 <TXPRODUTO:233ac> exitpending: 0, lclick: 0

Here is where it stops when I hit [down arrow], from what I understand XTREE is waiting for something, is it?

In fact the cursor is not present on the cell and I have to click in it to use again the [down arrow] key but, I think this is related to the debug mode because when not debugging I'm able to use the [down arrow] key consecutively.

Don't know if it's important but, when I move the mouse out of the XTREE area, a lot of messages like those below are displayed on the debug window.
10 14:19:05 <TXPRODUTO:233ac> XTREE msg 22, id=1784
11 14:19:05 <TXPRODUTO:233ac> XTREE msg 24, id=1784
12 14:19:05 <TXPRODUTO:233ac> XTREE msg 24, id=1784
13 14:19:05 <TXPRODUTO:233ac> XTREE msg 24, id=1784
14 14:19:05 <TXPRODUTO:233ac> XTREE msg 24, id=1784
15 14:19:05 <TXPRODUTO:233ac> XTREE msg 24, id=1784
16 14:19:05 <TXPRODUTO:233ac> XTREE msg 24, id=1784
17 14:19:05 <TXPRODUTO:233ac> XTREE msg 23, id=1784
18 14:19:15 <TXPRODUTO:233ac> SETFOCUS

Let me add that, in none of the rows the SelChgExit is triggered when moving up or down except on exiting the last row going down or on the first row going up, it seems that reaching the top/end of the xtree wakes it up [Razz]

Please, let me know if this helped otherwise I will add code to XTRA2 to try to reproduce the problem.

Many thanks

--------------------
Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal

From: Porto-Portugal/Rio de Janeiro-Brasil | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
Glad to hear you've got a roof over your head. What else does a programmer need, besides WiFi, power, and access to espresso?

As for the SelChgExit, you're probably right that the XDEBUG trace is causing too much activity that interferes with the state of the control. And the "XTREE msg ##, id=####" messages are typical, even though it might seem that once outside the area of the control, it should stop getting messages. But I think the issue here is that cell editing mode is causing the mouse activity to be captured.

And I also suspect that the difference between the cases I tested, which worked, and your situation, which doesn't, is the cell editing. Apparently there is a conflict between the SelChgExit and the cell editing, such that the editing operation is taking precedence over the SelChgExit.

Maybe it should be the other way around, although in an editable tree, often it is the case that "selection", and thus "change in the selection" takes a back seat to the xrow/xcol and targetrow/col exit parameters associated with the editable cell activity. For example, if you are editing a cell which generates an exitcode for validation on changes, and you click on another cell, which exitcode code would you expect? The validation exit code or the selection change exitcode? I would probably say that the validation exitcode made more sense here, expecially given that we can detect the change in row from the difference between the xrow and the targetrow.

But perhaps I'm not quite understanding the logic of your program.

In any case, I'll try adding SelChgExit to one of the other samples that uses cell editing, hopefully revealing some clues or insights.

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jorge Tavares - UmZero
Senior Developer
Member # 26

Icon 1 posted      Profile for Jorge Tavares - UmZero     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi Jack,
You're right, besides all the confusion around here, a safe roof over my head gave me the inspiration to adjust XTRA2 and confirm the problem [Cool]

So, I've reactivated the SelChgExit and converted the ZIP Code column into an editable column.

The behavior starting inside cell 1,1:
1. Using the down arrow key never exit the XTREE with exitcode -500 [Frown]
2. Clicking in column 1 of other rows exits with exitcode -500 [Smile]
3. Click back in cell 1,1 don't exit [Frown]
4. Clicking or using down arrow key when the focus is on any other column (not editable) of the xtree, always triggers exitcode -500 [Smile]


Here are the exact changes I've done in XTRA2:

code:
 
map1 XTREE'ANSWER(MAX_ITEMS),S,5 ! XTREE data array

XTFLAGS.FLAGS = XTFLAGS.FLAGS or XTF_EDITABLE

xcall XTREE,SROW,SCOL,XTREE'ANSWER(1),XTREE'DATA(1),MAXCHOICE,COLDEF$, &
EXITCODE,EROW,ECOL,XTFLAGS,"",XTREE'MMOCLR,XTR

if EXITCODE=-500 then ! [xxx] sel chg
Trace.Print "XLOOP: EXITCODE=["+EXITCODE+"]"
XTR.OPCODE = XTROP_RESELECT
repeat
endif

uncomment the line below in Setup'Xtree'Params()
coldef$ = coldef$ + "0~0~x~H~SelChgExit=500~~"

Thank you

[ November 07, 2017, 04:24: Message edited by: Jorge Tavares - UmZero ]

--------------------
Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal

From: Porto-Portugal/Rio de Janeiro-Brasil | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
Excellent. (If demonstrated dysfunction can ever be considered as such.)

Let me reproduce this here and get to the bottom of it.

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Herman Roehm
Senior Developer
Member # 38

Icon 1 posted      Profile for Herman Roehm     Send New Private Message       Edit/Delete Post   Reply With Quote 
I'm guessing this is not related to using xtf2_down and xtf_up is it?
From: Montgomery, Alabama | Registered: Aug 2001  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
As long as he wasn't using the Ctrl key, I don't think those would affect it.

I did confirm that the SelChgExit logic was not being processed during editable cell navigation via the keyboard, nor was it working when clicking on an editable cell in the first row. I posted a beta update which I think resolves that issue (items 1 and 3 in the Jorge's list above)...

ash-6.5.1620.1-w32c-upd.zip
ash65notes.txt

I don't think it addresses the other issue related to an inactive click on an editable cell in a sorted column, but I was also not able to reproduce that in the modified XTRA2 program (after sorting the zip column.)

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Jorge Tavares - UmZero
Senior Developer
Member # 26

Icon 1 posted      Profile for Jorge Tavares - UmZero     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi Jack,
Many thanks, now the SelChgExit responds perfectly using the navigation keys as well as the mouse clicks.
This could look like a detail but in this particular case this is vital and my customer (and me) was getting crazy because there is dependent data that was not updating while changing row.
Thank you very much

PS: As you mentioned, no change on the other topic using this version

[ November 08, 2017, 02:31: Message edited by: Jorge Tavares - UmZero ]

--------------------
Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal

From: Porto-Portugal/Rio de Janeiro-Brasil | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
   

Quick Reply
Message:

HTML is not enabled.
UBB Code™ is enabled.

Instant Graemlins
   


Post New Topic  Post A Reply Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Visit our main website at www.microsabio.com

Powered by UBB.classic™ 6.7.3