Jump to content


Photo

OnDblClick


  • Please log in to reply
3 replies to this topic

#1 steki

steki
  • Members
  • 10 posts

Posted 04 August 2006 - 06:00 PM

Hi,

OnDblClick Event will be raised if i double click the header, but it should only be raised if i doubleclick data rows. Or am i doing something wrong?

regards
stefan

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 04 August 2006 - 06:25 PM

Hello,

You may use next code in OnDblClick event:

CODE
var
  CursorPoint: TPoint;
begin
  inherited;
  GetCursorPos(CursorPoint);
  CursorPoint := MyGrid.ScreenToClient(CursorPoint);
  if PtInRect(CursorPoint, MyGrid.GetBodyRect) then
  begin
    // <insert code here>
  end;
end;


regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 steki

steki
  • Members
  • 10 posts

Posted 04 August 2006 - 11:17 PM

thanks for the code boki,

but does double-clicking the header realy make sense?
If not, and i dont know any app using double click on headers (but may be anyone else), you should add this code to you own libs, so that onDblClick is only triggered if cursor is in data rows.

regards
stefan

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 05 August 2006 - 12:12 AM

Hello Stefan,

I may add it easy, but maybe in some situation this may be usefull. For example, when user want to customize headers or something else.

I will think about adding some flag property for controling this.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users