PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Which column?
Which column?
Started by DT, Feb., 20 2004 2:37 AM - 5 replies
Posted on February, 20 2004 - 2:37 AM
Guys
Is there any way of determining where a mouse click occured within a column?
What I require is row number + column name (similar to a spreadsheet)
I cannot find a way of doing this but assuming it is possible is there then any way to change the brushcolor of the selected cell?
Regards
DerekT
Posted on February, 20 2004 - 3:59 AM
Guys
Is there any way of determining where a mouse click occured within a column?
What I require is row number + column name (similar to a spreadsheet)
I cannot find a way of doing this but assuming it is possible is there then any way to change the brushcolor of the selected cell?
Regards
DerekT

Hi DT,
Look at CurrentSubscript, TableEnumColumn, TableColumnSubscript, and TableSelect.

HTH,
Art


http://www.windevusa.com
Posted on February, 20 2004 - 6:27 AM
DT,
While I am not aware of an easy way to determine a click in a cell (though someone else may well be), this code in the row selection of the table will allow that functionality:
if 10 table[table][3]..brushcolor=iLightRed
Where 10 and 50 above are the horizontal borders of the 3rd column (or any column you wish).
This will change the brushcolor for the selected cell in the selected row to red.

HTH,
Marc
Guys
Is there any way of determining where a mouse click occured within a column?
What I require is row number + column name (similar to a spreadsheet)
I cannot find a way of doing this but assuming it is possible is there then any way to change the brushcolor of the selected cell?
Regards
DerekT
Posted on February, 20 2004 - 9:10 AM
Guys
Is there any way of determining where a mouse click occured within a column?
What I require is row number + column name (similar to a spreadsheet)
I cannot find a way of doing this but assuming it is possible is there then any way to change the brushcolor of the selected cell?
Regards
DerekT

Hi,
Already since WD55 I use the following generic mechanism to determine a mouse-click in any column of a table. I keeps working with WD75 also.
First I declare a variable COLUMN as an integer witch I load with the column number (first column = 1, second column = 2, etc.) in the 'on entry' event of the table-column.
In the window 'start up' I start an event to capture a mouse-click. This events calls a procedure that interpretes the value of the COLUMN variable. If this is a column where there is something to do upon a mouse-click the approriate action is stated; if not nothing happens.
Regards.
Posted on February, 21 2004 - 10:51 PM
Hi Derekt,
I presume you work in WD75?
I could send you a very small Windev-window-file with a small table in it,
showing you how to code this...
But maybe this will help too, and is enough:
The most important code is this one:
To be put in the entry of a "left mouse-click on the table"...
++++++++++++++++++++++++++
col, line, x, y is int
x = LoWord(CursorPos())
y = HiWord(CursorPos())
line = TableInfoXY(Table1, tiLineNumber + tiOriginScreen, x, y)
col = TableInfoXY(Table1, tiColNumber + tiOriginScreen, x, y)
Trace("You are on cel ("+ line +","+ col +")")
IF line <> -1 AND col <> -1 THEN MySelf[line][col]..BrushColor = iLightRed
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This will figure out where, on which cell the user clicked.
It will put in the trace the col/line numbers and
then put the clicked cell in red.
Important make sure your table is WITHOUT any selection otherwise the "line-selection-colors" colors "masks" the "red" on the cell you want to put....
Have fun.
Lieven De Nys,
Member of the Dutch speaking Benelux Windev-developergroup.
Posted on February, 22 2004 - 7:19 PM
Guys
Firstly thanks to all who answered with a number of solutions/suggestion for this issue - much appreciated.......
Lieven, good man, your solution (provided code) worked straight out of the box and does exactly what I was looking for
What I now need to do is investigate the code as it is using keywords that I did not know existed
How people in the group seem to know about these is an understand there use, for me, a source of wonderment --- I must put aside a couple of days aside to read through all of the W-Language section of the help
Thanks again
Regards
DerekT