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. Mobile Development
  3. Mobile
  4. CListCtrl with "tap and hold" and selecting item with a "tap"

CListCtrl with "tap and hold" and selecting item with a "tap"

Scheduled Pinned Locked Moved Mobile
question
8 Posts 3 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.
  • F Offline
    F Offline
    Frank S
    wrote on last edited by
    #1

    Hi, is there the possibility to select and highlight an item in the ListCtrl only with a tap on it and how can i use "tap and hold" with a CListCtrl? And is that even possible with Win CE < 3.0? Thanks, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

    J F 2 Replies Last reply
    0
    • F Frank S

      Hi, is there the possibility to select and highlight an item in the ListCtrl only with a tap on it and how can i use "tap and hold" with a CListCtrl? And is that even possible with Win CE < 3.0? Thanks, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

      J Offline
      J Offline
      Joao Paulo Figueira
      wrote on last edited by
      #2

      Hi, Check my article on this subject: Handling tap-and-hold[^]. In this article I explain a technique that allows you to select an item using a tap while keeping the tap-and-hold capability: you have to correctly handle the NM_CLICK notification. This notification will be sent after a normal tap and after a tap-and-hold operation. When you handle the tap-and-hold (through the GN_CONTEXTMENU notification), use a flag to store this state, ans test it in the NM_CLICK handler. If the flag is TRUE, this is a tap-and-hold, otherwise it is a normal tap. I know nothing about Windows CE < 3.0... Hope this helps.

      F 1 Reply Last reply
      0
      • J Joao Paulo Figueira

        Hi, Check my article on this subject: Handling tap-and-hold[^]. In this article I explain a technique that allows you to select an item using a tap while keeping the tap-and-hold capability: you have to correctly handle the NM_CLICK notification. This notification will be sent after a normal tap and after a tap-and-hold operation. When you handle the tap-and-hold (through the GN_CONTEXTMENU notification), use a flag to store this state, ans test it in the NM_CLICK handler. If the flag is TRUE, this is a tap-and-hold, otherwise it is a normal tap. I know nothing about Windows CE < 3.0... Hope this helps.

        F Offline
        F Offline
        Frank S
        wrote on last edited by
        #3

        Hi, i have read your article ... but it doesn't work with my DialogBox Window which has a CListCtrl Window inside. That was build with the Resource Manager. So, if i tap on the CListCtrl Window nothing happens, only if i tap beside where the DialogWindow is. The message is only handled if i tap on the Dialog Window of my App. Is there the possibility to handle the messages even if i tap on a Window inside that Dialog Window? Perhaps with SetCapture() ? Greetings, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

        J 1 Reply Last reply
        0
        • F Frank S

          Hi, i have read your article ... but it doesn't work with my DialogBox Window which has a CListCtrl Window inside. That was build with the Resource Manager. So, if i tap on the CListCtrl Window nothing happens, only if i tap beside where the DialogWindow is. The message is only handled if i tap on the Dialog Window of my App. Is there the possibility to handle the messages even if i tap on a Window inside that Dialog Window? Perhaps with SetCapture() ? Greetings, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

          J Offline
          J Offline
          Joao Paulo Figueira
          wrote on last edited by
          #4

          Frank S. wrote: That was build with the Resource Manager. So this means that you have a "raw" CListCtrl in your dialog? No subclassing? Frank S. wrote: So, if i tap on the CListCtrl Window nothing happens, only if i tap beside where the DialogWindow is. You mean, the red dots do not show up when you tap-and-hold the CListCtrl? What is the platform you are working on? I'm just trying to figure out what is happening to you. My approach has worked as well for dialogs, but it was tested only under Pocket PC 2002.

          F 1 Reply Last reply
          0
          • J Joao Paulo Figueira

            Frank S. wrote: That was build with the Resource Manager. So this means that you have a "raw" CListCtrl in your dialog? No subclassing? Frank S. wrote: So, if i tap on the CListCtrl Window nothing happens, only if i tap beside where the DialogWindow is. You mean, the red dots do not show up when you tap-and-hold the CListCtrl? What is the platform you are working on? I'm just trying to figure out what is happening to you. My approach has worked as well for dialogs, but it was tested only under Pocket PC 2002.

            F Offline
            F Offline
            Frank S
            wrote on last edited by
            #5

            Well, that Dialog looks like that: http://www.siedler-net.de/WinCE/easySMS/docu/V_1-50/easySMS_FOLDERS.gif in my Dialog window are these Controls. And i have tested it with WinCE 3.0. Greetings, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

            J 1 Reply Last reply
            0
            • F Frank S

              Well, that Dialog looks like that: http://www.siedler-net.de/WinCE/easySMS/docu/V_1-50/easySMS_FOLDERS.gif in my Dialog window are these Controls. And i have tested it with WinCE 3.0. Greetings, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

              J Offline
              J Offline
              Joao Paulo Figueira
              wrote on last edited by
              #6

              I see you are using Pocket PC 2000. I still do not understand why the list control does not adequately respond to the tap-and-hold. There can be only three answers for this: 1-The PPC2K version of the control does not handle tap-and-hold natively (I doubt it). 2-You are overriding the WM_LBUTTONDOWN message and are not allowing the control's window procedure to handle it. 3-I have no idea what is happening... :~

              F 1 Reply Last reply
              0
              • J Joao Paulo Figueira

                I see you are using Pocket PC 2000. I still do not understand why the list control does not adequately respond to the tap-and-hold. There can be only three answers for this: 1-The PPC2K version of the control does not handle tap-and-hold natively (I doubt it). 2-You are overriding the WM_LBUTTONDOWN message and are not allowing the control's window procedure to handle it. 3-I have no idea what is happening... :~

                F Offline
                F Offline
                Frank S
                wrote on last edited by
                #7

                Hi, i think, the CListCtrl-Subwindow in the Dialog Window doesn't send the stylus tap-recognition to the Dialog Window, so that the notification of WM_LBUTTONDOWN doesn't work. I only can handle the Click-operation in that window (tap and release) if i tap on the ListCtrl-box the selection isn't changing, only by a click it's changing. I think that's the problem, but i don't know how to handle ... :-( Greetings, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

                1 Reply Last reply
                0
                • F Frank S

                  Hi, is there the possibility to select and highlight an item in the ListCtrl only with a tap on it and how can i use "tap and hold" with a CListCtrl? And is that even possible with Win CE < 3.0? Thanks, Frank _____ easySMS for pocket PC _____ www.Siedler-Net.de/WinCE/easySMS/

                  F Offline
                  F Offline
                  Frank Siedler
                  wrote on last edited by
                  #8

                  Is it possible to handle these input messages from the stylus with PreTranslateMessage(MSG* pMsg) ? I have figured out, that if i use that function, i can handle the WM_LBUTTONDOWN message even if i click on the ListCtrl-window, and not only on the dialog box window. But now the problem is, that i have to know, which window in the dialog box is active and should be handled! Because the other Windows should be handled normal. And is it normal, that the selected item in a listbox is only changing, if you are clicking on it? With normal windows applications, you only have to tap on it and it's quite changing. Greetings, Frank

                  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