MTable Focus Question

forum.3rdparty.tools (2005-2010)
michael
Germany
Posts: 300
Joined: 07 Jun 2018, 15:13
Location: Stuttgart, GER

MTable Focus Question

Post by michael » 27 Jun 2007, 15:21

 Posted by:  Michael Hummel 

i have a table with 5 columns, 2 columns should be editable.

The Problem: Column C (see jpg) should always!! get the focus when pressing
the TAB or ENTER Key (SalMapTab....)
Column D should only be "accessible" by mouseclick

The problem is, when both columns are editable the focus is C, D, C, D, ...

I tried to set column D to "not editable" and do this code

ON MTM_AreaLBtnUp
If wParam = SalWindowHandleToNumber( colD )
call SalEnableWindow( colD )
call SalSetFocus ( colD ) ! does not work

and ON SAM_KillFocus -> Call SalDisableWindow(colD)

but the focus is not set. you have to click twice.
does anyone know a better solution
thank you
michael

Attachment: hardcopy.JPG

Krzysztof Dorko

MTable Focus Question

Post by Krzysztof Dorko » 27 Jun 2007, 16:02

 Posted by:  Krzysztof Dorko 

Hi
Try use SalTblSetFocusCell() instead of SalSetFocus

hth
Kris

michael
Germany
Posts: 300
Joined: 07 Jun 2018, 15:13
Location: Stuttgart, GER

MTable Focus Question

Post by michael » 27 Jun 2007, 18:48

 Posted by:  Michael Hummel 

thank you Kris,

but SalTblSetFocusCell() needs a rownr.
MTM_AreaLBbtnUp does not support rownr (lparam is null)

michael

Niels Allerheiligen

MTable Focus Question

Post by Niels Allerheiligen » 29 Jun 2007, 10:01

 Posted by:  Niels Allerheiligen 

Can't you use SalTblQueryContext(hWndTbl) instead of lParam? Or is the
context still on the old row when MTM_AreaBtnUp is processed?

michael
Germany
Posts: 300
Joined: 07 Jun 2018, 15:13
Location: Stuttgart, GER

MTable Focus Question

Post by michael » 29 Jun 2007, 12:14

 Posted by:  Michael Hummel 

Old row,

perhaps i have to use other MTM Events, i dont now
perhaps completly other approach...

michael

Krzysztof Dorko

MTable Focus Question

Post by Krzysztof Dorko » 29 Jun 2007, 15:39

 Posted by:  Krzysztof Dorko 

Hi
I have a table with several columns but user type only (in 99%) in one of
them
And after he/she press TAB I go directly to the next row and set focus to
this one column ans so on but using mouse user can edit other columns
If this sounds familiar you can use this code in column message action:

On WM_KEYDOWN
If wParam = VK_Tab
Set nRow = SalTblQueryContext( twParams )
Loop
If SalTblFindNextRow( twParams, nRow, 0, 0 )
Call SalTblSetFocusCell( twParams, nRow, colValue, 0, -1 )
Break
Else
Set nRow = TBL_MinRow
Return FALSE
If SalTblFindNextRow( twParams, nRow, 0, 0 )
Call SalTblSetFocusCell( twParams, nRow, colValue, 0, -1 )
Return FALSE

hth
Kris

michael
Germany
Posts: 300
Joined: 07 Jun 2018, 15:13
Location: Stuttgart, GER

MTable Focus Question

Post by michael » 29 Jun 2007, 15:54

 Posted by:  Michael Hummel 

thank you kris,

i will try this solution and give feedback

michael

micsto
Germany
Posts: 748
Joined: 07 Mar 2017, 16:07
Location: Germany

MTable Focus Question

Post by micsto » 16 Jul 2007, 12:45

 Posted by:  Michael Stoll \(MICSTO\) 

lParam should contain the row number if the mouse is over a valid row.

Michael

michael
Germany
Posts: 300
Joined: 07 Jun 2018, 15:13
Location: Stuttgart, GER

MTable Focus Question

Post by michael » 27 Jul 2007, 14:30

 Posted by:  Michael Hummel 

thank you michael,
now it runs perfectly.
michael

Return to “3rdparty.tools”

Who is online

Users browsing this forum: [Ccbot] and 0 guests