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

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

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

Post by Antonio Mart. »

Antonio y friends,

Here you are Windows 8 messages for touch devices:

Code: Select all | Expand

#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.)

Post by Antonio Mart. »

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

Code: Select all | Expand

WM_NCPOINTERDOWN  WM_NCPOINTERUP    WM_NCPOINTERUPDATEWM_PARENTNOTIFY   WM_POINTERACTIVATEWM_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.)

Post by Antonio Mart. »

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


Code: Select all | Expand

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.)

Post by Antonio Mart. »

Hi again,


Handling pointer messages on TGet Class. Pointer messages are redirected to Window parent object. Operating successfully !!!! :-)

Code: Select all | Expand

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TGetlocal 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
User avatar
Antonio Linares
Site Admin
Posts: 42739
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 105 times
Been thanked: 108 times
Contact:

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

Post by Antonio Linares »

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
Antonio Mart.
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

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

Post by Antonio Mart. »

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.
User avatar
Antonio Linares
Site Admin
Posts: 42739
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 105 times
Been thanked: 108 times
Contact:

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

Post by Antonio Linares »

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
Antonio Mart.
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

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

Post by Antonio Mart. »

Hi,

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

regards

Code: Select all | Expand

//--------------------------------------------------------------------------//METHOD HandleEvent( nMsg, nWParam, nLParam, nLastMsg ) CLASS TGetSTATIC lRunScrolllocal oClp, cText, nLocal 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 oTimeENDCASEreturn ::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.)

Post by Antonio Mart. »

Hi again,

Code: Select all | Expand

//-------------------------------------------------------------------------//// 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
Chapman
Posts: 1
Joined: Thu Mar 28, 2013 1:10 pm

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

Post by Chapman »

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.
User avatar
Otto
Posts: 6419
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 43 times
Been thanked: 3 times
Contact:

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

Post by Otto »

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

clear host$null = New-PSDrive -Name HKU   -PSProvider Registry -Root Registry::HKEY_USERSGet-PSDrive -PSProvider RegistryPush-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  $cQuelleWrite-Host $cQuelleWrite-Host $pfadSet-ItemProperty -Path $pfad -Name 'ScrollHeight' -Value -547Set-ItemProperty -Path $pfad -Name 'ScrollWidth' -Value -547Set-Location $pfadreg UNLOAD HKU\Testuser}Pop-Location
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Antonio Mart.
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

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

Post by Antonio Mart. »

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.)

Post by Antonio Mart. »

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

//-------------------------------------------------------------------------//STATIC FUNCTION DlgEndOnLostFocus(oDlg)Local nI, oLocal 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}   ENDIFNEXTRETURN NIL*//-------------------------------------------------------------------------//FUNCTION CollectControls(oDlg , aAllControls)LOCAL nI, nJ, Obj1 , Obj2Aadd(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   ENDIFNEXTRETURN
Antonio Mart.
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

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

Post by Antonio Mart. »

A bit more beautiful

Image
Post Reply