SELPOS / NOTIFYPOS returns 1 with no selection (OpenInsight 32-Bit)
At 19 JUN 2010 05:14:28PM Kauko Laurinolli wrote:
I am trying to determine which line position if any is selected in a four column unbound Edit Table having only single valued cells. Using the following code, is no line is selected, 1 is always returned.
I have tried all properties and all return the same error:
SEL_ROW =Get_Property(@Window[/color]:[/color]'.TABLE_1'[/color], [/color]"NOTIFYPOS"[/color])[/color][/color][/size]
At 21 JUN 2010 01:12PM Dave Harmacek wrote:
I believe ProgRef says that NOTIFYPOS returns column @fm row.
If you are only getting a return of "1", then the row is null, as expected.
Is the edit table protected? if so SELPOS always returns "1", as documented.
Dave
At 21 JUN 2010 01:56PM Kauko Laurinolli wrote:
Yes, NOTIFYPOS returns 1:@FM:1 even if no line is selected.
Yes, table must be protected so that nobody will add or delete lines by accident.
All I am looking for is to find out if line in Edittable is selected or not when clicking a push-button.
A simple issue but can't find any control to do it?
At 21 JUN 2010 02:44PM Dave Harmacek wrote:
Could you use CLICKPOS to see if the edit table had a click?
At 21 JUN 2010 06:08PM Colin Rule wrote:
Not sure if this helps, but IF the columns are protected, then adding a new unprotected column at the end, and making it zero width so you cant see it, then it allows selection of the rows.
At 22 JUN 2010 10:46AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Kauko,
Does this work for you?
.bpPre {
font-family:Consolas,Courier New,Courier,Verdana,Arial;font-size:10pt;background-color:#FEFEFE;color:#000000;border:1px solid #7389AE;padding:10px 20px;margin:0px 10px auto;}
.bpComment {
font-style:italic;color:#008000;}
.bpDirective {
color:#808000;}
.bpKeyword {
color:#0000FF;}
.bpNumber {
color:#800000;}
.bpString {
color:#008080;}
.bpSymbol {
color:#800040;}
.bpSysVar {
color:#8000FF;}
.bpDebug {
font-size:12pt;font-weight:bold;color:#FF0000;}
.bpDict {
color:#FF8000;}
.bpLabel {
font-size:11pt;font-weight:bold;}
.bpLineNo {
font-family:Courier New, Courier, monospace;color:#808080;background-color:#F5F5F5;}
0001 declare function sendMessage, get_Property 0002 equ DTM_GETCURROWSEL$ to ( DT_WM_USER$ + 91 ) 0003 equ DTPOS_INVALID$ to -3 ; * // invalid pos 0004 0005 hwnd = get_Property( @window : ".TABLE_1", "HANDLE" ) 0006 selRow = sendMessage( hwnd, DTM_GETCURROWSEL$, 0, 0 ) 0007 if ( selRow = DTPOS_INVALID$ ) then 0008 * // No rows are selected ... 0009 endWorld leaders in all things RevSoft
At 22 JUN 2010 10:48AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Sorry - missed an equate!
.bpPre {
font-family:Consolas,Courier New,Courier,Verdana,Arial;font-size:10pt;background-color:#FEFEFE;color:#000000;border:1px solid #7389AE;padding:10px 20px;margin:0px 10px auto;}
.bpComment {
font-style:italic;color:#008000;}
.bpDirective {
color:#808000;}
.bpKeyword {
color:#0000FF;}
.bpNumber {
color:#800000;}
.bpString {
color:#008080;}
.bpSymbol {
color:#800040;}
.bpSysVar {
color:#8000FF;}
.bpDebug {
font-size:12pt;font-weight:bold;color:#FF0000;}
.bpDict {
color:#FF8000;}
.bpLabel {
font-size:11pt;font-weight:bold;}
.bpLineNo {
font-family:Courier New, Courier, monospace;color:#808080;background-color:#F5F5F5;}
0001 declare function sendMessage, get_Property 0002 equ DT_WM_USER$ to 1024 0003 equ DTM_GETCURROWSEL$ to ( DT_WM_USER$ + 91 ) 0004 equ DTPOS_INVALID$ to -3 ; * // invalid pos 0005 0006 hwnd = get_Property( @window : ".TABLE_1", "HANDLE" ) 0007 selRow = sendMessage( hwnd, DTM_GETCURROWSEL$, 0, 0 ) 0008 if ( selRow = DTPOS_INVALID$ ) then 0009 * // No rows are selected ... 0010 endWorld leaders in all things RevSoft
At 23 JUN 2010 09:11AM Kauko Laurinolli wrote:
Many thanks Spezz, this worked perfectly.