Thank you for your answer.

I was not clearly.

First, the code written below is a simple version. Of course I figure out
for myself what kind of change occurs.
Concretely, I store the object's coordinates and rowid's into arrays when
they are created, then into SelChangedHandler I store the rowid of selected
object into sel_rowid, then into WinChangedHandler I search with a loop if
sel_rowid is one of the stored rowids. If yes, I compare the new object
coordinates with those stored into array. If they are different, that means
that object has been moved by user !
Then upadte array with new coordinates, etc...

At the beginning of WinChangedHandler, I Exit Sub if Selection is empty.

I know that it will work only if ONE object is selected at same time.
Works fine, when all the objects are drawed into Cosmetic Layer with Insert
statement
(       Insert Into CosmeticN (Obj) Values(my_obj)      ) etc...

NOW, if the graphic objects ARE NOT drawed by this way, but mapped with a
.TAB file :

Open Table mytable.tab As TTT
Obj1 = Create Point .....
Update TTT Set Obj = Obj1 Where Rowid=RowN
Obj2 = Create Point .....
Update TTT Set Obj = Obj2 Where Rowid=RowN
Map mytable.tab .....

When I move one of these objects with the mouse, the same mechanism could be
used, but the only thing I can retrieve into SelChangedHandler is the rowid
of the selected object. Then into WinChangedHandler, I must figure out the
name of the table associated with this object, and the rowid INTO the TAB
file where this object has been Updated before (ie RowN). Ii should be
similar to the mecasism used inside ToolButton procedures.

Have any idea ?

Christophe.

-----Message d'origine-----
De : Lars V. Nielsen (GisPro) [mailto:[EMAIL PROTECTED] 
Envoy� : jeudi 9 juin 2005 14:39
� : Christophe Brabant
Cc : [email protected]
Objet : Re: MI-L need help for handlers


Hi Christophe,

Two problems with your code:

1. SelChangedHandler is called whenever a selection CHANGES, i.e. also when
a selection is cleared (and thus not present). And a selection can consist
of several records, not just one, so you need to build a loop around your
call to CommandInfo()

2. The "table" of a mapper window is always the cosmetic layer, named
"Cosmetic#". The cosmetic layer is also defined for layout windows, but not
for browsers and graphs, so you need to make sure it's called as a result of
a change in a valid window.

Furthermore, WinChangedHandler is called if the content of the window is
changed. It's not an intelligent event, it doesn't tell you why the content
changed. That you'll need to figure out for yourself.

But if the changes are prompted by yourself (update ...), why do you need a
change event ?

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/

----- Original Message ----- 
From: "Christophe Brabant" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, June 09, 2005 12:04 PM
Subject: MI-L need help for handlers


Hi

Here is the code I use :

===========================================================================

Dim    sel_rowid
As Integer

Sub SelChangedHandler

    sel_rowid = CommandInfo(CMD_INFO_ROWID)

End Sub

Sub WinChangedHandler

    Dim    win_id
    As Integer

    ' window id of the changed window
    win_id = CommandInfo(CMD_INFO_WIN)

    Print WindowInfo(win_id, WIN_INFO_TABLE)

End Sub
============================================================================

When I move an object in any layer, Cosmetic1 is always printed, even if the
object has been mapped with a table ( for example c:\temp\mytable.tab) with
an Update statement (Update mytable Set Obj=object .....)

What I need is printing the table name (.TAB) mapped with the moved object,
and know at which line the object is stored into .TAB file.

Thank you - Christophe


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16751


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16757

Reply via email to