Tablet and form style for Windows 8 (desktop ver.)

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Mar 15, 2013 4:33 pm

Antonio y friends,

Here you are Windows 8 messages for touch devices:

Code: Select all  Expand view
#Define WM_NCPOINTERDOWN           578
#Define WM_NCPOINTERUP             579
#Define WM_NCPOINTERUPDATE         577
#Define WM_PARENTNOTIFY            528
#Define WM_POINTERACTIVATE         587
#Define WM_POINTERCAPTURECHANGED   588
#Define WM_POINTERDEVICECHANGE     568
#Define WM_POINTERDEVICEINRANGE    569
#Define WM_POINTERDEVICEOUTOFRANGE 570
#Define WM_POINTERDOWN             582
#Define WM_POINTERENTER            585
#Define WM_POINTERLEAVE            586
#Define WM_POINTERUP               583
#Define WM_POINTERUPDATE           581
#Define WM_POINTERWHEEL            590
#Define WM_POINTERHWHEEL           591
#Define WM_TOUCHHITTESTING         589



Regards
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Mar 15, 2013 5:25 pm

Of all the events (seventeen), I've only managed to "catch" in the handleEvent these (ten):

Code: Select all  Expand view
WM_NCPOINTERDOWN  
WM_NCPOINTERUP    
WM_NCPOINTERUPDATE
WM_PARENTNOTIFY  
WM_POINTERACTIVATE
WM_POINTERDOWN  
WM_POINTERUP  
WM_POINTERENTER  
WM_POINTERLEAVE  
WM_POINTERUPDATE  
 


Does anyone have any idea why the rest are not detected?

Saludos
Last edited by Antonio Mart. on Fri Mar 15, 2013 6:47 pm, edited 2 times in total.
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Mar 15, 2013 6:42 pm

About ten events that are only treated. It must not be coincidence that http://social.msdn.microsoft.com/Forums ... e169bac0a5


Code: Select all  Expand view
switch (Msg)
{
case WM_POINTERENTER:
case WM_NCPOINTERDOWN:
case WM_NCPOINTERUP:
case WM_NCPOINTERUPDATE:
case WM_POINTERACTIVATE:
case WM_POINTERCAPTURECHANGED:
case WM_POINTERDOWN:
case WM_POINTERLEAVE:
case WM_POINTERUP:
case WM_POINTERUPDATE:
     ...
     if (pointertype == PT_TOUCH)
     {
POINTER_TOUCH_INFO touchInfo;
if (GetPointerTouchInfo (pointerId, & touchInfo))
{
    POINT point;
    Point.X = touchInfo.pointerInfo.ptPixelLocationRaw.x;
    point.y = touchInfo.pointerInfo.ptPixelLocationRaw.y;
    AccNotifyTouchInteraction (hwnd, GetForegroundWindow (), point);
}
     }
     ...
     break;
}
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Mar 15, 2013 7:55 pm

Hi again,


Handling pointer messages on TGet Class. Pointer messages are redirected to Window parent object. Operating successfully !!!! :-)
Code: Select all  Expand view
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TGet

local oClp, cText, n


#Define uWINDOW_HANDLE(cMsg) (;
  ::oWnd:HandleEvent(nMsg, nWParam, nLParam);
                            )

#Translate lPOINTER_MSG(<n>) => ;
  If(<n> == nMsg, (uWINDOW_HANDLE(<c>), .t.), .f.)


do case
   case lPOINTER_MSG(WM_NCPOINTERDOWN           )             // 578
   case lPOINTER_MSG(WM_NCPOINTERUP             )             // 579
   case lPOINTER_MSG(WM_NCPOINTERUPDATE         )             // 577
   case lPOINTER_MSG(WM_PARENTNOTIFY            )             // 528
   case lPOINTER_MSG(WM_POINTERACTIVATE         )             // 587
   case lPOINTER_MSG(WM_POINTERCAPTURECHANGED   )             // 588
   case lPOINTER_MSG(WM_POINTERDEVICECHANGE     )             // 568
   case lPOINTER_MSG(WM_POINTERDEVICEINRANGE    )             // 569
   case lPOINTER_MSG(WM_POINTERDEVICEOUTOFRANGE )             // 570
   case lPOINTER_MSG(WM_POINTERUPDATE           )             // 581
   case lPOINTER_MSG(WM_POINTERDOWN             )             // 582
   case lPOINTER_MSG(WM_POINTERENTER            )             // 585
   case lPOINTER_MSG(WM_POINTERLEAVE            )             // 586
   case lPOINTER_MSG(WM_POINTERUP               )             // 583
   case lPOINTER_MSG(WM_POINTERWHEEL            )             // 590
   case lPOINTER_MSG(WM_POINTERHWHEEL           )             // 591
   case lPOINTER_MSG(WM_TOUCHHITTESTING         )             // 589
   ...................................


Regards
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Linares » Fri Mar 15, 2013 8:51 pm

Antonio,

Many thanks for sharing this info. I wasn't aware of these WM_POINTER... new messages.

What I don't see is whats the difference with standard mouse events.

How did you notice that you needed them ? What was not working ? :-)

Are you using your FWH apps on a Windows tablet ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Mar 15, 2013 9:54 pm

Antonio,

Yes, I use a Asus Vivo Tab Tablet with Windows 8 desktop.

I need these WM messages to scrolling in dialogs with the finger "pointer". The pointer finger WM messages are *NOT* similar to mouse messages WM: are different. Looks like this was already the case in Windows 7.

WM_POINTER messages have appeared with Windows 8. The WM touch in Windows 7 messages are legacy.

Thanks for your interest.
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Linares » Fri Mar 15, 2013 10:16 pm

Antonio,

I don't have a Windows 8 tablet yet :-(

Where did you buy it ? How much is it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Sat Mar 16, 2013 9:59 am

Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Sun Mar 17, 2013 4:13 pm

Hi,

Wow!
Clicking get control, it will scroll automatically if you are *NOT* running a drag touch.

regards

Code: Select all  Expand view

//--------------------------------------------------------------------------//
METHOD HandleEvent( nMsg, nWParam, nLParam, nLastMsg ) CLASS TGet

STATIC lRunScroll

local oClp, cText, n

Local oTime


#Define uWINDOW_HANDLING(cMsg) (;
        ;
; // Log("WM.Txt", cMsg),;
        ;
        ::oWnd:HandleEvent(nMsg, nWParam, nLParam);
                              )

#Define lEVENT_(n, c) => If(n == nMsg, (uWINDOW_HANDLING(c), .t.), .f.)


DO CASE
   CASE lEVENT_(WM_NCPOINTERDOWN           , "WM_NCPOINTERDOWN")           // 578
      lRunScroll:= .f.
   CASE lEVENT_(WM_NCPOINTERUP             , "WM_NCPOINTERUP")             // 579
      lRunScroll:= .f.
   CASE lEVENT_(WM_NCPOINTERUPDATE         , "WM_NCPOINTERUPDATE")         // 577
   CASE lEVENT_(WM_PARENTNOTIFY            , "WM_PARENTNOTIFY")            // 528
   CASE lEVENT_(WM_POINTERACTIVATE         , "WM_POINTERACTIVATE")         // 587
   CASE lEVENT_(WM_POINTERCAPTURECHANGED   , "WM_POINTERCAPTURECHANGED")   // 588
   CASE lEVENT_(WM_POINTERDEVICECHANGE     , "WM_POINTERDEVICECHANGE")     // 568
   CASE lEVENT_(WM_POINTERDEVICEINRANGE    , "WM_POINTERDEVICEINRANGE")    // 569
   CASE lEVENT_(WM_POINTERDEVICEOUTOFRANGE , "WM_POINTERDEVICEOUTOFRANGE") // 570
   CASE lEVENT_(WM_POINTERUPDATE           , "WM_POINTERUPDATE")           // 581
      lRunScroll:= .f.
   CASE lEVENT_(WM_POINTERDOWN             , "WM_POINTERDOWN")             // 582
   CASE lEVENT_(WM_POINTERENTER            , "WM_POINTERENTER")            // 585
   CASE lEVENT_(WM_POINTERLEAVE            , "WM_POINTERLEAVE")            // 586
   CASE lEVENT_(WM_POINTERUP               , "WM_POINTERUP")               // 583
   CASE lEVENT_(WM_POINTERWHEEL            , "WM_POINTERWHEEL")            // 590
   CASE lEVENT_(WM_POINTERHWHEEL           , "WM_POINTERHWHEEL")           // 591
   CASE lEVENT_(WM_TOUCHHITTESTING         , "WM_TOUCHHITTESTING")         // 589

// .........................................................
// .........................................................
// .........................................................
   CASE nMsg == WM_SETFOCUS .AND. !lUSAR_TIMER .AND. lONFOCUS_MOSTRAR_TECLADO

      // Automatic Scroll Dialog scroll oGet controll most top than TabTip keyboard
      lRunScroll:= .t.

      ::GotFocus( GetFocus())

      DEFINE TIMER oTime INTERVAL 10 OF Self:oWnd ;
         ACTION (If(lRunScroll, AutomaticScrollDlg(Self), nil), oTime:Deactivate())

      ACTIVATE TIMER oTime


ENDCASE

return ::Super:HandleEvent( nMsg, nWParam, nLParam )

 
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Mar 22, 2013 5:24 pm

Hi again,

Code: Select all  Expand view
//-------------------------------------------------------------------------//
// For Windows 8.
FUNCTION ShowInputPanel()
*
ShellExecute(, "open", "tabtip.exe")
*
RETURN NIL
*
//-------------------------------------------------------------------------//
// For Windows 8.
FUNCTION HideInputPanel()
Local hWndInputPanel
*
hWndInputPanel:= FindWindow("IPTip_Main_Window")
PostMessage(hWndInputPanel, WM_SYSCOMMAND, SC_CLOSE, 0)
* (¿ SysRefresh() ? )
RETURN NIL
 


Regards
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Chapman » Thu Mar 28, 2013 5:35 pm

Antonio Linares wrote:Antonio,

I don't have a Windows 8 tablet yet :-(

Where did you buy it ? How much is it ?


You can get it online.. You have to good balance in your account for getting a best tablet.
Chapman
 
Posts: 1
Joined: Thu Mar 28, 2013 1:10 pm

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Otto » Sun Apr 14, 2013 7:57 am

Hello Antonio Mart.,
this is a powershell script to change 'ScrollWidth' and 'ScrollHeight' which is working for me.
You read the different ntuser.dat files into a temp User in registry set the values and save back.

Best regards,
Otto


Code: Select all  Expand view

clear host

$null = New-PSDrive -Name HKU   -PSProvider Registry -Root Registry::HKEY_USERS
Get-PSDrive -PSProvider Registry

Push-Location

$array = @("UserName1", "UserName2", "UserName3", "UserName4" )

foreach ($element in $array) {

$element

$cQuelle = ' c:\users' + $element + '\ntuser.dat'
$pfad = '
HKU:\Testuser\Control Panel\Desktop\WindowMetrics'

reg LOAD HKU\Testuser  $cQuelle

Write-Host $cQuelle
Write-Host $pfad

Set-ItemProperty -Path $pfad -Name '
ScrollHeight' -Value -547
Set-ItemProperty -Path $pfad -Name '
ScrollWidth' -Value -547

Set-Location $pfad

reg UNLOAD HKU\Testuser

}

Pop-Location




********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Mon Apr 15, 2013 2:07 pm

Hello Otto,

Thanks for your input. I'll try.
For me the problems were reduced with the scrollbar.
I wanted to remove the scrollbar of the dialogues. Because you can not delete them then I thought of greater width.

But then I did something: hide! How to hide, if Windows does not allow it?

My forms (on tablet) consist of a title and a folder, without borders, below. Each folder has a scrollable dialog with controls that interact with the Tablet Input Panel (virtual keyboard). What I do is size the size of the dialogue out of the folder and so the scrollbars are not shown. Of course, the user can navigate within the dialogue touching style. Is like a Windows 8 style, forms and navigation;-)

Regards
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Fri Apr 26, 2013 7:24 pm

Hi,

Code shows how to hide a dialog when it loses focus. The function must be placed in the Init event.
Below pictures of a form with scrolling style touch with touch movement and without scroll bars and with automatic deployment TabTip.

Image
Image

Code: Select all  Expand view
//-------------------------------------------------------------------------//
STATIC FUNCTION DlgEndOnLostFocus(oDlg)
Local nI, o
Local bLost, aAllControls:= {}

CollectControls(oDlg, @aAllControls)

#Define lFOCUS_APPLICATION ( oWndFromHwnd(GetFocus()) != NIL )
#Define lFOCUS_NOT_DIALOG  ( AScan(aAllControls, {|o| o:hWnd == GetFocus()}) == 0 )
#Define ON_FOCUS_LOST      If(lFOCUS_APPLICATION .AND. lFOCUS_NOT_DIALOG, oDlg:End(), NIL)

FOR nI:= 1 to len(aAllControls)
   o:= aAllControls[nI]
   IF O:bLostFocus != NIL
      bLost:= o:bLostFocus
      o:bLostFocus:= {|x1, x2, x3, x| x:= Eval(bLost, x1, x2, x3),;
                                      ON_FOCUS_LOST,;
                                      x}
   ELSE
      o:bLostFocus:= {|x1, x2, x3, x| x:= NIL,;
                                      ON_FOCUS_LOST,;
                                      x}

   ENDIF

NEXT
RETURN NIL

*
//-------------------------------------------------------------------------//
FUNCTION CollectControls(oDlg , aAllControls)
LOCAL nI, nJ, Obj1 , Obj2

Aadd(aAllControls, ODLG)

FOR nI:= 1 TO Len(oDlg:aControls)
   Obj1:= oDlg:aControls[nI]
   Aadd(aAllControls, Obj1)
   IF Obj1:ClassName == "TFOLDER"
      FOR nJ:= 1 TO Len(Obj1:aDialogs)
         Obj2:= Obj1:aDialogs[nJ]
         CollectControls(Obj2 , @aAllControls)
      NEXT
   ENDIF
NEXT
RETURN
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tablet and form style for Windows 8 (desktop ver.)

Postby Antonio Mart. » Sat Apr 27, 2013 2:49 pm

A bit more beautiful

Image
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests