Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-06

Grids, once more (Jesus, please read)

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Jesus,

You made a mistake in your grid fixes, EditorPos. All my demos crash !!

Your code:

  if FEditornil then begin
    // send editor position
    Msg.LclMsg.msg:=GM_SETPOS;
    Msg.Grid:=Self;
    Msg.Col:=FCol;
    Msg.Row:=FRow;
    // send editor bounds
    FEditor.Dispatch(Msg);
    Msg.CellRect:=CellRect(FCol,FRow);

This is wrong, because cellrect should be initialized prior to sending !

It should be

    // send editor position
    Msg.LclMsg.msg:=GM_SETPOS;
    Msg.Grid:=Self;
    Msg.Col:=FCol;
    Msg.Row:=FRow;
    // send editor bounds
    Msg.CellRect:=CellRect(FCol,FRow);
    FEditor.Dispatch(Msg);

After fixing this, it works again here.

Michael.

Reply by email

Jesus Reyes
to Michael Van Canneyt

--- El vie 20-jun-08, Michael Van Canneyt escribi?:

Show quoted text 38 lines
De:: Michael Van Canneyt Asunto: [Lazarus] Grids, once more (Jesus, please read) A: "Lazarus mailing list" Fecha: viernes, 20 junio, 2008, 3:10 pm Jesus, You made a mistake in your grid fixes, EditorPos. All my demos crash !! Your code: if FEditornil then begin // send editor position Msg.LclMsg.msg:=GM_SETPOS; Msg.Grid:=Self; Msg.Col:=FCol; Msg.Row:=FRow; // send editor bounds FEditor.Dispatch(Msg); Msg.CellRect:=CellRect(FCol,FRow); This is wrong, because cellrect should be initialized prior to sending ! It should be // send editor position Msg.LclMsg.msg:=GM_SETPOS; Msg.Grid:=Self; Msg.Col:=FCol; Msg.Row:=FRow; // send editor bounds Msg.CellRect:=CellRect(FCol,FRow); FEditor.Dispatch(Msg); After fixing this, it works again here. Michael.

this was done before my last patch, have many problems with it so I decided to create a message for changing editor position and once for adjusting editor bounds, maybe you should use GM_SETBOUNDS instead of GM_SETPOS?

Jesus Reyes A.

____________________________________________________________________________________ Yahoo! Deportes Beta
?No te pierdas lo ?ltimo sobre el torneo clausura 2008! Ent?rate aqu? http://deportes.yahoo.com

Reply by email

Michael Van Canneyt
to Jesus Reyes
Jesus Reyes wrote 46 lines
--- El vie 20-jun-08, Michael Van Canneyt escribi?: > De:: Michael Van Canneyt > Asunto: [Lazarus] Grids, once more (Jesus, please read) > A: "Lazarus mailing list" > Fecha: viernes, 20 junio, 2008, 3:10 pm > Jesus, > > You made a mistake in your grid fixes, EditorPos. All my > demos crash !! > > Your code: > > if FEditornil then begin > // send editor position > Msg.LclMsg.msg:=GM_SETPOS; > Msg.Grid:=Self; > Msg.Col:=FCol; > Msg.Row:=FRow; > // send editor bounds > FEditor.Dispatch(Msg); > Msg.CellRect:=CellRect(FCol,FRow); > > This is wrong, because cellrect should be initialized prior > to sending ! > > It should be > > // send editor position > Msg.LclMsg.msg:=GM_SETPOS; > Msg.Grid:=Self; > Msg.Col:=FCol; > Msg.Row:=FRow; > // send editor bounds > Msg.CellRect:=CellRect(FCol,FRow); > FEditor.Dispatch(Msg); > > After fixing this, it works again here. > > Michael. this was done before my last patch, have many problems with it so I decided to create a message for changing editor position and once for adjusting editor bounds, maybe you should use GM_SETBOUNDS instead of GM_SETPOS?

Hm. But what is the position then ? Col,Row ?

Michael.

Reply by email

Jesus Reyes
to Michael Van Canneyt
Show quoted text 7 lines
> this was done before my last patch, have many problems with it so I decided to create a message for changing editor position and once for adjusting editor bounds, maybe you should use GM_SETBOUNDS instead of GM_SETPOS? Hm. But what is the position then ? Col,Row ?

yes, editorpos set always col,row of the last time the editor was shown

Jesus Reyes A.

____________________________________________________________________________________ Yahoo! Deportes Beta
?No te pierdas lo ?ltimo sobre el torneo clausura 2008! Ent?rate aqu? http://deportes.yahoo.com

Reply by email