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. Blinking item's picture Tree Control

Blinking item's picture Tree Control

Scheduled Pinned Locked Moved C / C++ / MFC
c++comlinuxdata-structuresjson
2 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.
  • G Offline
    G Offline
    GameProfessor
    wrote on last edited by
    #1

    Hi I'm doing some finishing touch for my project, mostly improving the GUI. My project is an SDI of Windows Explorer style with a tree view on the left. The items in the tree correspond to e.g computers, some active and some idle. I want to have these active nodes blinking but I don't know how to do it, more specifically how to change the image of an tree item in run time. I have think of one way: Using a timer, delete the node and reinsert it with different image when there is WM_TIMER. This way seems to work but it leads to some problems I don't want. More over, my program must run fast and stable so I don't want to use any kind of activeX, just MFC or Win API. I've just run into VC++ for 1 month (although I have programed C++ on linux for years) so my question may be a little bit silly. please help me thanks

    J 1 Reply Last reply
    0
    • G GameProfessor

      Hi I'm doing some finishing touch for my project, mostly improving the GUI. My project is an SDI of Windows Explorer style with a tree view on the left. The items in the tree correspond to e.g computers, some active and some idle. I want to have these active nodes blinking but I don't know how to do it, more specifically how to change the image of an tree item in run time. I have think of one way: Using a timer, delete the node and reinsert it with different image when there is WM_TIMER. This way seems to work but it leads to some problems I don't want. More over, my program must run fast and stable so I don't want to use any kind of activeX, just MFC or Win API. I've just run into VC++ for 1 month (although I have programed C++ on linux for years) so my question may be a little bit silly. please help me thanks

      J Offline
      J Offline
      James R Twine
      wrote on last edited by
      #2

      Instead of deleting and readding the item, simply change its icon (you ARE using icons, right?) and redraw the item each time the timer fires, alternating between two or more icons (more icons can be used to animate a particular item).    If not using icons, you can use the TVIS_DROPHILITED and/or TVIS_BOLD item states to make the item itself flash.  Look-up the TVITEM structure for more details on those states.    Peace!

      -=- James


      If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
      Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
      DeleteFXPFiles & CheckFavorites (Please rate this post!)

      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