Locating clicks in the Scrollbars

This is a discussion on Locating clicks in the Scrollbars within the Windows Programming forums, part of the Platform Specific Boards category; Dear all, I'm programming an app in C++Builder, and I'd like to detect when an user clicks into a vertical ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    6

    Locating clicks in the Scrollbars

    Dear all,

    I'm programming an app in C++Builder, and I'd like to detect when an user clicks into a vertical scrollbar, the relative position inside the scrollbar.

    I mean the following:

    I'm programming a Log viewer, based in a a TStringgrid component. As I get all the data from a remote server, it can't take the entire log and then displays it (the log may has a size of Mb). So I need to display only some lines each time.

    Well, the way I want to do that is first, knowing the number of lines that the log has, say for example 1000. I assign them to the TStringgrid component as rowcount. Then, I want to detect if the user clicks in the middle of the scrollbar, so the user may want 10 lines below, and 10 lines above the line number 500. Then I take those lines from the server and that's it. But I need to know how to detect the position of the Scrollbar click, And of course how to make it relative to the number of lines.

    Any idea?

    Thanks and regards,
    Artelo.

    P.S. If there are somewhere a log viewer component, it could be interesting too.

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    132
    I am not exactly sure how to correct your problem, or give you a solution but I do have a question for you.

    Are you trying to access the log information from this remote server over a network or are you or the users of this program going to be using high speed connections? Cause if you are trying to do this method without either of the above in the equation then your program will be tirelessly slow in responding to the user's clicks. I personally would get annoyed with such a program and it's not exactly the best solution. Why not just have a messagebox or dialog popup that warns the user of the log's size (perhaps have part of the communication with this remote server, give the "client" this information so then they can relay it to the user), if they choose to proceed then download the entire thing? Or perhaps on the server side have it so then each "piece" added to this log has a date/time corresponding to when it was added. Then have the client relay to the server upon connection when it was last updated (it's own logs) and then have the server compare this date and find any pieces added to the log that have been added after the date/time give by the client? This would be a fairly fast method, even for dialup users. Meaning they only have to download what they don't have.

    Just a possibility to try to help you out, not the solution you were looking for but possibly another possibility all together.

    Hope this helps,
    Tyouk

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Balloon tip question: Trap when the user clicks on "X"
    By Joelito in forum Windows Programming
    Replies: 4
    Last Post: 11-18-2005, 10:35 PM
  2. Scrollbars in dialog
    By Frandy in forum Windows Programming
    Replies: 7
    Last Post: 02-16-2005, 01:35 AM
  3. MFC: Multiple clicks shows multiple bitmaps - how?
    By BrianK in forum Windows Programming
    Replies: 0
    Last Post: 06-20-2004, 08:25 PM
  4. Scrollbars
    By SOS in forum Windows Programming
    Replies: 2
    Last Post: 08-16-2002, 05:21 PM
  5. Replies: 6
    Last Post: 07-27-2002, 02:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21