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. Preventing OnLButtonUp handler beign called in the CFormView in certain conditions.

Preventing OnLButtonUp handler beign called in the CFormView in certain conditions.

Scheduled Pinned Locked Moved C / C++ / MFC
help
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.
  • L Offline
    L Offline
    ledallam
    wrote on last edited by
    #1

    Hi, I have a form view derived from CFormView on which I have placed several buttons,and onclick of the button i.e in LButtonUp handler, it takes the user to a different screen. It takes some time to show up the new screen as some thread processing has to take place for showing up the new screen. After the user clicks on a button and while the processing is going on, if the user clicks on another button my program is asserting. Hence I want to prevent the clicks on other buttons when the processing is going on. The buttons on my view are CBitmap buttons and totally there are 30 buttons. So when the user clicks on one button, I want to prevent him from clcking on all other 29 buttons, in other words I want to prevent the handlers in LButtonDown and LButtonUp from getting called. I want to revert back to normal state when the for view is shown initially and if for any reason the handler function returns and the user has to stay in the current view itself. Can anyone please help me to do this. Thanks Madhavi.

    C 1 Reply Last reply
    0
    • L ledallam

      Hi, I have a form view derived from CFormView on which I have placed several buttons,and onclick of the button i.e in LButtonUp handler, it takes the user to a different screen. It takes some time to show up the new screen as some thread processing has to take place for showing up the new screen. After the user clicks on a button and while the processing is going on, if the user clicks on another button my program is asserting. Hence I want to prevent the clicks on other buttons when the processing is going on. The buttons on my view are CBitmap buttons and totally there are 30 buttons. So when the user clicks on one button, I want to prevent him from clcking on all other 29 buttons, in other words I want to prevent the handlers in LButtonDown and LButtonUp from getting called. I want to revert back to normal state when the for view is shown initially and if for any reason the handler function returns and the user has to stay in the current view itself. Can anyone please help me to do this. Thanks Madhavi.

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

      Just disable the buttons when the user is not allowed to use them. Christian Graus - Microsoft MVP - C++

      L 1 Reply Last reply
      0
      • C Christian Graus

        Just disable the buttons when the user is not allowed to use them. Christian Graus - Microsoft MVP - C++

        L Offline
        L Offline
        ledallam
        wrote on last edited by
        #3

        Hi, Thanks for ur inputs. But it's not a CButton. It is CBitmap which is drawn on the view using BitBlt. I am handling LButtonDown and LButtonUp on these bitmaps by finding whether the point of click is inside the bitmap rectangle or not. Please let me know how I can disable a CBitmap? Thanks Madhavi

        C 1 Reply Last reply
        0
        • L ledallam

          Hi, Thanks for ur inputs. But it's not a CButton. It is CBitmap which is drawn on the view using BitBlt. I am handling LButtonDown and LButtonUp on these bitmaps by finding whether the point of click is inside the bitmap rectangle or not. Please let me know how I can disable a CBitmap? Thanks Madhavi

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

          Well, if you handle the click, then deciding not to handle it is trivial, surely ? You can't 'disable a bitmap', that is, you can't stop your code from handling the click, nor can you automatically make it look disabled. You need to draw a different bitmap if you want to show it's disabled, and then just ignore the click in your own code. Christian Graus - Microsoft MVP - C++

          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