Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how can i select a particular object using the list pointers to objects?

how can i select a particular object using the list pointers to objects?

Scheduled Pinned Locked Moved C / C++ / MFC
questioncom
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pathi
    wrote on last edited by
    #1

    I drawn multiple objects using pointers.i stored all pointers.how can i select a particular object using the pointer list?or any other simple method to serve the same purpose? Please answer in detail. thanks in advance.:) eeshwar_g@nagar.com

    C 1 Reply Last reply
    0
    • P pathi

      I drawn multiple objects using pointers.i stored all pointers.how can i select a particular object using the pointer list?or any other simple method to serve the same purpose? Please answer in detail. thanks in advance.:) eeshwar_g@nagar.com

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Could you present the question in detail ? Are these pointers to bitmaps you have drawn ? To child windows that have been drawn in the sense of creation ? I'd suggest that if you *need* this pointer list, and assuming they are all of the same object type, a map and a pile of global const int declarations would solve your problems very nicely. You could use a string, but why slow things down ? Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.

      P 1 Reply Last reply
      0
      • C Christian Graus

        Could you present the question in detail ? Are these pointers to bitmaps you have drawn ? To child windows that have been drawn in the sense of creation ? I'd suggest that if you *need* this pointer list, and assuming they are all of the same object type, a map and a pile of global const int declarations would solve your problems very nicely. You could use a string, but why slow things down ? Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.

        P Offline
        P Offline
        pathi
        wrote on last edited by
        #3

        hai Thanks for fast response. I have drawn a few lines by instantiating class and I stored the pointers to objects in a list.now I want to select a particular line using this list of pointers.If I want to select a line to resize or drag it.for that purpose how can I get the pointer to particular object?I used pointers.I have written it in vc++. Thanks again. bhikshapathi_g@semanticspace.com

        C 1 Reply Last reply
        0
        • P pathi

          hai Thanks for fast response. I have drawn a few lines by instantiating class and I stored the pointers to objects in a list.now I want to select a particular line using this list of pointers.If I want to select a line to resize or drag it.for that purpose how can I get the pointer to particular object?I used pointers.I have written it in vc++. Thanks again. bhikshapathi_g@semanticspace.com

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Now this is a little different. I presume you've got a list of pointers to objects that tell you the points you've drawn lines between ? If not, then you do not have a prayer, but I'm not sure if you do because if you do then your original question was too vague to be answerable. You need to iterate through your list of points and figure out if the point you have selected sits on one of the lines. I've had a quick scan of 'principles & practice' but cannot see an algorithm for finding if a point is in a line. ( I'm sure it's there, but it's early and I am tired ). One way to do it would be a/ find out first if the point is in the bounding box of the two points. b/ figure out the ratio between x and y. c/ apply that ratio to the x value of your point and see if the y value corresponds within an acceptable margin. I suspect something with paths is also possible. Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups