#1
  1. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12

    using MouseCoord


    In BCB 6, there is a function MouseCoord(int x, int y) However, I never used it and it can't just be called in that way. How is this used? I want the MouseCoord to be in an OnClick() event in TPaintBox component. Therefore, when the user clicks the paintbox, it can return something to the area where the mouse is. Is this possible?
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,643
    Rep Power
    4248
    IIRC, the MouseCoord method is part of a Grid Object alone. If you want the mouse coordinates on a TPaintBox component, why not hook to its OnMouseDown event instead of OnClick.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12
    Yea, the help file was saying something about a TCustomGrid, but I found no such component? OnClick or OnMouseDown...not much difference is there? Other than having the even occur that split second before you release the mouse button?
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,643
    Rep Power
    4248
    >> the help file was saying something about a TCustomGrid, but I found no such component?
    It's not a component, but it is the parent class of a few components though (such as TStringGrid, TDrawGrid, TDBGrid or whatever). So those components all inherit the MouseCoord method from the parent.

    >> OnClick or OnMouseDown...not much difference is there?
    With OnMouseDown, the framework passes the mouse coordinates as arguments to the event handler function, which is exactly what you're looking for (it also passes the state of the shift/ctrl/alt keys + which mouse button was clicked). With OnClick, all you know is that a click occurred. :)
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo