Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
14
Erster Beitrag:
vor 1 Jahr, 3 Monaten
Letzter Beitrag:
vor 1 Jahr, 3 Monaten
Beteiligte Autoren:
Sara Joy, Peter Holemans, Arie, Al, Stefan Bentvelsen

Navigation inside Table control---WD20

Startbeitrag von Sara Joy am 02.05.2016 07:19

Hi all,

I have created a table with selection criteria as "Single cell only" ( Rows: No selection Columns :No selection)..Navigation of Table cells using Keyboard Arrow keys works perfect for left, right ,up, and down..

Whenever i made one column invisible,,the navigation get stucked with the invisible cell..No further navigation is possible as it get selected the invisible cell..

Highly appreciated if anyone knows the solution..Thanks in advance

Plz note Table is in Non Editable Mode..Read only

[attachment 1958 22.jpg]

Antworten:

Hi Sara,

have you tried to make the invisible column also state=inactive or state=grayed?

von Stefan Bentvelsen - am 02.05.2016 09:11
Hi Stefan

It makes no change ...Thanks for the reply


Regards

von Sara Joy - am 02.05.2016 11:08
Hello Sara

Is there any code in the table or in the invisible column that is being triggered by the key strokes ?
Try it with the debugger running.

Regards
Al

von Al - am 02.05.2016 17:01
Hi,,

Even not a single line of code present in the invisible column or table or form itself...

Anyone can try this without spending much time...
.
Can anybody confirm is it a problem with PC-Soft ? plz

Regards

Sara

von Sara Joy - am 03.05.2016 07:25
Hi all,

Have a nice day...Any idea to solve this problem??

It would be a great help if anyone suggests a solution..

Looking forward..

Regards ,

Sara

von Sara Joy - am 04.05.2016 05:44
Hi Sara,

I can confirm the bug. The cursor will not go beyond the invisible column in the pecific mode you have (only cell selection and table in non-edit/selection-only mode).
I also tried setting the columnwidht to 0 or even 1. Does not help.

But I this workaround.will do :rp:
Use ControlDelete on the column instead of making it invisible. Then the navigation keeps working.
I don't know your situation but maybe you will need the column back again, based on user choices?
You can do that with ControlClone and add a column and sort of getting it back, i.e. by cloning an existing column which has the same prroperties. Otherwise you have to set some properties on the column as well.

von Arie - am 04.05.2016 06:30
Hi Arie,,

Thank you for your kindness to share the tip..But unfortunately it doesn't work in my case..
When deleting a column from a Table control using ControlDelete, the content of the Table control associated with this column is deleted. And after deletion even navigation on the entire table stops working..I actually want to retain the column as such but invisible only..
If i clone the column again..the same situation of navigation failure arises..


Can any one rectify the problem??? Seems simple but no solution yet..

I just want the navigation to be moved across visible columns only..No complex code or anything in the table code or column code..

Help plzzzz

Regards,
Sara

von Sara Joy - am 04.05.2016 07:12
Sara,

cann you tell us why do you need the navigation in the first place, since you say that you use the control in read-only mode.
The user can navigate to cells and then do what? Or is it used to scroll towards cells outside the visible range, like using the scrollbars.

Just an idea: maybe the spreadsheet control will work in this case?

von Arie - am 04.05.2016 07:22
Hi Sara,

Since it seems to be a confirmed bug, I suggest you raise a ticket with tech support so it can get fixed in a future update.
Next as a solution, I'm just thinking outside of the box for a workaround:

I haven't tested it, but it should do the job as it will make the cursor jump from the invisible cell to the next cell upon entry.
In the table column add the following code upon the 'Entry event' of the row column:

IF NOT myself..visible THEN
ReturnToCapture(tablename[TableSelect(tablename),TableColumnSubscript(tablename,myself..name)+1])
END


Something like this should provide you a workaround although not ideal I have to admit.

Best regards,

Peter Holemans

von Peter Holemans - am 04.05.2016 07:48
Peter,

I don't think the on-entry event will fire while Sara uses the tabecontrol in readonly mode.
Maybe Sara will tell us after testing ;)

@Sara: bug confirmed in WD20 so you can send a tech-ticket to pcsoft. And if you are lucky you get a patch.
Maybe it is solved in WD21? I don't have that installed yet, maybe someone else can do a quick test.

von Arie - am 04.05.2016 09:07
Hi Arie,

I didn't read the initial request good enough it seems...
Here's another try out of my head that may do the same thing and would allow you to also process arrow keys together with SHFT pressed to do continous selection. I've written it out of my head so you may have to tweak it a bit to your needs and to get it compiled.

// -- Initialization code of project
// -- Include the "KeyConst.WL" and "WinConst.WL" files
EXTERN "KeyConst.WL"
EXTERN "WinConst.WL"

// -- Initialization code of the window
TableToCatchArrowKeys is string = TableName..Name
Event(LP_CatchArrowKeys, TableToCatchArrowKeys, WM_KEYDOWN)


// -- Local procedure to the window
LP_CatchArrowKeys()

IF ControlCurrent ~= TableToCatchArrowKeys THEN
//Local variables
CurrentRow is int = TableSelect(TableToCatchArrowKeys , tsCellLine)
CurrentCol is int = TableSelect(TableToCatchArrowKeys , tcCellColumn)

//Make sure a cell is currently selected
IF CurrentRow > 0 AND CurrentCol > 0 THEN
//Right Arrow
IF KeyPressed(VK_RIGHT) THEN
TableToCatchArrowKeys[CurrentRow,CurrentCol]..Selected = False
TableToCatchArrowKeys[CurrentRow,CurrentCol+1]..Selected = True
END
// Left arrow: move to the left
IF KeyPressed(VK_LEFT) THEN
TableToCatchArrowKeys[CurrentRow,CurrentCol]..Selected = False
TableToCatchArrowKeys[CurrentRow,CurrentCol-1]..Selected = True
END
// Up arrow: move to the top
IF KeyPressed(VK_UP) THEN
TableToCatchArrowKeys[CurrentRow,CurrentCol]..Selected = False
TableToCatchArrowKeys[CurrentRow-1,CurrentCol]..Selected = True
END
// Down arrow: move to the bottom
IF KeyPressed(VK_DOWN) THEN
TableToCatchArrowKeys[CurrentRow,CurrentCol]..Selected = False
TableToCatchArrowKeys[CurrentRow+1,CurrentCol]..Selected = True
END
END
END


I hope this helps...

Cheers,

Peter Holemans

von Peter Holemans - am 04.05.2016 09:43
Hi Peter ,

Thank u soo much for ur effort..I tried out your code..but something is missing..

Initialization code of the project and window done as per your instruction..

In the local procedure,Tablerow and Tablecolumn obtained by using following lines, as the supplied code makes errors in my project
CurrentRow is int =CurrentSubscript()
CurrentCol is int = TableSelect(TableToCatchArrowKeys,1,tsCellColumn)

Unfortunately i didnt get the logic of the codelines afterthat..
Actually we need to navigate, if the selction holds on the invisible column only..but your codeline seems like if current row and currentcolumn are nonzero,it triggers to navigate to next coulumn left ,right,up or down as per the keystroke by the user..

And also the following lines makes syntax error

TableToCatchArrowKeys[CurrentRow,CurrentCol]..Selected = False
TableToCatchArrowKeys[CurrentRow,CurrentCol+1]..Selected = True


Mr Peter, Can you spend liitle more time on this to figure out the problem ??
Others also welcome to contribute suggestions..

von Sara Joy - am 07.05.2016 09:08
::: wrong reply :::

von Peter Holemans - am 09.05.2016 09:59
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.