trying with Lenovo Miix 320

trying with Lenovo Miix 320

Postby Silvio.Falconi » Fri Sep 08, 2017 9:26 am

from two days I have a tablet miix 320 lenovo ( nice) win 10 pro 4gb and 64 gb hd -- good very good!!!!

Image

I tried to compile fwh app and it run ok and it is too fast from my portable computer asus rog

now I must create a mode tablet application

i tried to make a scroll dialog to use it with tablet mode but it not run ok and i not understood how make it

I use a class to scrool the dialog get but it run only if there is the mouse

i not understood why on tablet mode it not run it show the dialog but then i cannot scroll the dialog

do you have a sample test to show get on mode tablet ?I tried the test win10.prg and it run ok but I not understood how imlement it on my dialogs



I make a test but it not run on mode tablet

Code: Select all  Expand view


// //search on rc  file the dialog
//

#include "FiveWin.ch"

#define D_WIDTH           4
#define D_HEIGHT          13

#ifndef TRUE
   #define TRUE              .T.
   #define FALSE             .F.
#endif


FUNCTION Main()

   LOCAL oDlg, oScrDlg
   Local nRow:= 10
   Local nCol := 10
   Local nCol2:= 95
   Local aGet:= array(30)
   local cget:= space(20)
   local oFontTablet

    DEFINE FONT oFontTablet NAME "TAHOMA" SIZE 0,-25
   DEFINE DIALOG oDlg  ;
         TITLE "Scroll dialog test for Otto"            ;
         STYLE nOR( WS_VSCROLL, WS_HSCROLL )           ;
        FONT oFontTablet

   For n= 1 to  30

       @ nRow, nCol SAY "test"+str(n) SIZE 75,18 OF oDlg       PIXEL   FONT oFontTablet
       @ nRow, nCol2 GET aGet[n] VAR cget  SIZE 250,18 OF oDlg  PIXEL  FONT oFontTablet
         nRow+=26
       next

      @ nRow+20, nCol+130 button "&Conferma" SIZE 75,18 OF oDlg       PIXEL FONT oFontTablet
       @ nRow+20, nCol+250 button "&Annulla" SIZE 75,18 OF oDlg       PIXEL FONT oFontTablet

   oDlg:bMouseWheel = { | nKey, nDelta, nXPos, nYPos | MouseWheel( nKey, nDelta, nXPos, nYPos, oScrDlg ) }

   ACTIVATE DIALOG oDlg ;
      ON INIT ( oScrDlg := TScrDlg():New( oDlg, 1, 95, 1, 2), oDlg:SetSize( 740, 500 ), oDlg:Center() )

   RETURN( NIL )

 //-----------------------------------------------------------------------------//

function MouseWheel( nKey, nDelta, nXPos, nYPos, oScrDlg )

   local oVScroll := oScrDlg:oDlg:oVScroll

   if nDelta < 0
      oVScroll:GoDown()
   else
      oVScroll:GoUp()
   endif

   oScrDlg:VScroll()

return nil
 //-----------------------------------------------------------------------------//


CLASS TScrDlg

   DATA oDlg
   DATA nVPos, nHPos

   METHOD New( oDlg,nV1,nV2,nH1,nH2 ) CONSTRUCTOR
   METHOD SetScroll( nV1,nV2,nH1,nH2 )

   //-*------------------------------------------------------------
   METHOD VScroll()
   METHOD VScrollThumb()
   METHOD VScrollTrack()
   METHOD VScrollPgDown()
   METHOD VScrollPgUp()

   //-*-----------------------------
   METHOD HScroll()
   METHOD HScrollThumb()
   METHOD HScrollTrack()
   METHOD HScrollPgDown()
   METHOD HScrollPgUp()

ENDCLASS

METHOD New( oDlg,nV1,nV2,nH1,nH2 ) CLASS TScrDlg
   ::nVPos := 0
   ::nHPos := 0
   ::oDlg  := oDlg
   ::SetScroll( nV1,nV2,nH1,nH2 )
RETURN Self

METHOD SetScroll( nV1,nV2,nH1,nH2 ) CLASS TScrDlg
LOCAL aCoors1:={},aCoors2:={}
   //--------------------------------------------------
   //-* Vertical Scroll Bar
   if ::oDlg:oVScroll != NIL
      ::oDlg:oVScroll:SetRange( nV1,nV2 )
      ::nVPos := ::oDlg:oVScroll:GetPos()
      ::oDlg:oVScroll:bGoDown   := {|| ::VScroll() }
      ::oDlg:oVScroll:bGoUp     := {|| ::VScroll() }
      ::oDlg:oVScroll:bPageUp   := {|| ::VScrollPgUp() }
      ::oDlg:oVScroll:bPageDown := {|| ::VScrollPgDown() }
      ::oDlg:oVScroll:bGoTop    := {|| ::VScroll() }
      ::oDlg:oVScroll:bGoBottom := {|| ::VScroll() }
      ::oDlg:oVScroll:nPgStep   := 10
      //::oDlg:oVScroll:lReDraw := TRUE
      ::oDlg:oVScroll:bPos      := {|nPos| ::VScrollThumb(nPos) }
      ::oDlg:oVScroll:bTrack    := {|nPos| ::VScrollTrack(nPos) }
   endif
   //--------------------------------------------------
   //-* Horizontal Scroll Bar
   if ::oDlg:oHScroll != NIL
      ::oDlg:oHScroll:SetRange( nH1,nH2 )
      ::nHPos := ::oDlg:oHScroll:GetPos()
      ::oDlg:oHScroll:bGoDown   := {|| ::HScroll() }
      ::oDlg:oHScroll:bGoUp     := {|| ::HScroll() }
      ::oDlg:oHScroll:bPageUp   := {|| ::HScrollPgUp() }
      ::oDlg:oHScroll:bPageDown := {|| ::HScrollPgDown() }
      ::oDlg:oHScroll:bGoTop    := {|| ::HScroll() }
      ::oDlg:oHScroll:bGoBottom := {|| ::HScroll() }
      ::oDlg:oHScroll:nPgStep   := 10
    //::oDlg:oHScroll:lReDraw   := TRUE
      ::oDlg:oHScroll:bPos      := {|nPos| ::HScrollThumb(nPos) }
      ::oDlg:oHScroll:bTrack    := {|nPos| ::HScrollTrack(nPos) }
   endif
*   ::oDlg:bKeyChar := {|nKey,nFlags| ScrollKey(nKey) }
   //--------------------------------------------------
RETURN( NIL )
/*
STATIC FUNCTION ScrollKey(nKey)

   MsgInfo( "Key : "+str(nKey,10) )

   //if nKey == K_ENTER
   //   goMainDlg:End()
   //   lRetVal := TRUE
   //endif
RETURN( NIL )
*/


//=================================================================
//-* Vertical Scroll Bar
METHOD VScroll() CLASS TScrDlg
LOCAL nNewPos

   if ::nVPos >= ::oDlg:oVScroll:nMin   ;
      .and. ::nVPos <= ::oDlg:oVScroll:nMax
      nNewPos := ::oDlg:oVScroll:GetPos()
      SysRefresh()

      ScrollWindow( ::oDlg:hWnd, 0,  ;
         (  ::nVPos-nNewPos )*D_HEIGHT,    ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nVPos := nNewPos
   endif
RETURN( NIL )

METHOD VScrollThumb(nNewPos) CLASS TScrDlg
   if ::nVPos >= ::oDlg:oVScroll:nMin   ;
      .and. ::nVPos <= ::oDlg:oVScroll:nMax
      ::oDlg:oVScroll:SetPos(nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd, 0,  ;
         (::nVPos - nNewPos )*D_HEIGHT,    ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nVPos := nNewPos
   endif
RETURN( NIL )

METHOD VScrollTrack(nNewPos) CLASS TScrDlg
   if ::nVPos >= ::oDlg:oVScroll:nMin   ;
      .and. ::nVPos <= ::oDlg:oVScroll:nMax
      ::oDlg:oVScroll:SetPos(nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd, 0,  ;
         (::nVPos - nNewPos )*D_HEIGHT,    ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nVPos := nNewPos
   endif
RETURN( NIL )

METHOD VScrollPgDown() CLASS TScrDlg
LOCAL nNewPos
   if ::nVPos < ::oDlg:oVScroll:nMax
      nNewPos := ::nVPos + ::oDlg:oVScroll:nPgStep
      nNewPos := iif(nNewPos > ::oDlg:oVScroll:nMax, ::oDlg:oVScroll:nMax, nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd, 0,  ;
         ( ::nVPos - nNewPos )*D_HEIGHT,    ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nVPos := nNewPos
   endif
RETURN( NIL )

METHOD VScrollPgUp() CLASS TScrDlg
LOCAL nNewPos
   if ::nVPos > ::oDlg:oVScroll:nMin
      nNewPos := ::nVPos - ::oDlg:oVScroll:nPgStep
      nNewPos := iif(nNewPos < ::oDlg:oVScroll:nMin,::oDlg:oVScroll:nMin,nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd, 0,  ;
         ( ::nVPos - nNewPos )*D_HEIGHT,    ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nVPos := nNewPos
   endif
RETURN( NIL )

//=================================================================
//-* Horizontal Scroll Bar
METHOD HScroll() CLASS TScrDlg
LOCAL nNewPos

   if ::nHPos >= ::oDlg:oHScroll:nMin   ;
      .and. ::nHPos <= ::oDlg:oHScroll:nMax
      nNewPos := ::oDlg:oHScroll:GetPos()
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd,           ;
         (::nHPos - nNewPos )*D_WIDTH,0,   ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nHPos := nNewPos
   endif
RETURN( NIL )

METHOD HScrollThumb(nNewPos) CLASS TScrDlg
   if ::nHPos >= ::oDlg:oHScroll:nMin   ;
      .and. ::nHPos <= ::oDlg:oHScroll:nMax
      ::oDlg:oHScroll:SetPos(nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd,           ;
         (::nHPos - nNewPos )*D_WIDTH,0,   ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nHPos := nNewPos
   endif
RETURN( NIL )

METHOD HScrollTrack(nNewPos) CLASS TScrDlg
   if ::nHPos >= ::oDlg:oHScroll:nMin   ;
      .and. ::nHPos <= ::oDlg:oHScroll:nMax
      ::oDlg:oHScroll:SetPos(nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd,           ;
         (::nHPos - nNewPos )*D_WIDTH,0,   ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nHPos := nNewPos
   endif
RETURN( NIL )

METHOD HScrollPgDown() CLASS TScrDlg

LOCAL nNewPos
   if ::nHPos < ::oDlg:oHScroll:nMax
      nNewPos := ::nHPos + ::oDlg:oHScroll:nPgStep
      nNewPos := iif(nNewPos > ::oDlg:oHScroll:nMax, ::oDlg:oHScroll:nMax, nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd,           ;
         ( ::nHPos - nNewPos )*D_WIDTH,0,  ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nHPos := nNewPos
   endif
RETURN( NIL )

METHOD HScrollPgUp() CLASS TScrDlg
LOCAL nNewPos
   if ::nHPos > ::oDlg:oHScroll:nMin
      nNewPos := ::nHPos - ::oDlg:oHScroll:nPgStep
      nNewPos := iif(nNewPos < ::oDlg:oHScroll:nMin,::oDlg:oHScroll:nMin,nNewPos)
      SysRefresh()
      ScrollWindow( ::oDlg:hWnd,           ;
         ( ::nHPos - nNewPos )*D_WIDTH,0,  ;
         0 , GetClientRect(::oDlg:hWnd) )
      ::nHPos := nNewPos
   endif
RETURN( NIL )

//=* End of File =================================================



 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: trying with Lenovo Miix 320

Postby nageswaragunupudi » Fri Sep 08, 2017 1:51 pm

FWH ScrollPanel works great
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: trying with Lenovo Miix 320

Postby Silvio.Falconi » Fri Sep 08, 2017 6:03 pm

is there a test sample ?

on dialog I wish not on a window
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: trying with Lenovo Miix 320

Postby nageswaragunupudi » Fri Sep 08, 2017 6:25 pm

We need to create ON INIT if it is dialog
Can you try?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: trying with Lenovo Miix 320

Postby Silvio.Falconi » Sun Sep 10, 2017 2:49 pm

Mr Rao ,

Itried it and it make me error NTOP

1 . then I not understood with font size yse

2. then I wish the possibilty to change the screen on vertical or Horizontal if the table is moved



Code: Select all  Expand view


#include "fivewin.ch"
#include "constant.ch"





Function test()
   Local nBottom   := 33
   Local nRight    := 75
   Local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local nHeight := nBottom * DLG_CHARPIX_H

   local lPortrait   := ScreenWidth() < ScreenHeight()
   local lTabletMode := FW_IsTabletMode()
   local lTouch      := FW_IsTouchScreen()



   SET CENTURY ON
   SET DATE ITALIAN

    lSave := .f.
     lAdd  :=.t.

    USE RIFORNIME  alias RIFORNIME

     IF lAdd
      RIFORNIME->(dbGoBottom())
      RIFORNIME->(dbSkip())
   ENDIF

   cRfauto     := RIFORNIME->RFAUTO
   cRfcisterna := RIFORNIME->RFCISTERNA
   dRffecrif   := RIFORNIME->RFFECRIF
   nRflitri    := RIFORNIME->RFLITRI
   nRftotale   := RIFORNIME->RFTOTALE
   lRffull     := RIFORNIME->RFFULL
   cRfkmmezzo  := RIFORNIME->RFKMMEZZO
   nRfcostolit := RIFORNIME->RFCOSTOLIT




DEFINE DIALOG oDlg  ;   //
   TITLE "edit table test"   ;
   SIZE nWidth, nHeight  TRANSPARENT PIXEL

      oPanel:=TScrollPanel():New( 0, 0,oDlg:nbottom-200 ,oDlg:nWidth-20, oDlg )


      oDlg:bResized := {||Rinfresca_oFrm() }

    oDlg:bRClicked          := { || Rinfresca_oFrm() }
    oDlg:bOnDisplayChange   := { || oDlg:Refresh(), 0 }
    oDlg:bOnSettingChange   := { |o,w,lp| WaitRefresh( oDlg,w,lp ) }

   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT (Create_Get()  )
   return nil

  static function WaitRefresh( ownd, w, l )

   static n := 0

   if oTimer == nil
      DEFINE TIMER oTimer OF oWnd INTERVAL 400 ;
         ACTION ( n++, oWnd:Refresh(), If( n > 4, (oTimer:End(), oTimer := nil, n := 0), nil ) )
      ACTIVATE TIMER oTimer
   endif

return nil
//--------------------------------------------------------------------------------------//
Function Create_Get()
   Local nRow:= 10
   Local nCol := 10
   Local nCol2:= 104
   LOCAL aGet:=array(8)
   LOCAL cRfauto
   LOCAL cRfcisterna
   LOCAL dRffecrif
   LOCAL nRflitri
   LOCAL nRftotale
   LOCAL lRffull
   LOCAL cRfkmmezzo
   LOCAL nRfcostolit
   local oFontTablet

   cRfauto     := RIFORNIME->RFAUTO
   cRfcisterna := RIFORNIME->RFCISTERNA
   dRffecrif   := RIFORNIME->RFFECRIF
   nRflitri    := RIFORNIME->RFLITRI
   nRftotale   := RIFORNIME->RFTOTALE
   lRffull     := RIFORNIME->RFFULL
   cRfkmmezzo  := RIFORNIME->RFKMMEZZO
   nRfcostolit := RIFORNIME->RFCOSTOLIT

  * DEFINE FONT oFontTablet NAME "TAHOMA" SIZE 0,-20
   DEFINE FONT oFontTablet NAME "Segoe UI" SIZE 0,-30


   @ nRow, nCol SAY "Automezzo :" OF oPanel SIZE 75, 18 PIXEL FONT oFontTablet
*   @ nRow-2, nCol2  GET aGet[1] VAR cRfauto     OF oPanel SIZE 200, 18 PIXEL FONT oFontTablet  UPDATE
   @  nRow-2, nCol2 COMBOBOX aGet[1] VAR cRfauto FONT oFontTablet ITEMS { "Automezzo 1", "Automezzo 2", "Automezzo 3" }  SIZE 200, 460 OF oPanel PIXEL HEIGHTGET 120
   nRow+= 48

    @ nRow, nCol SAY "Cisterna :" OF oDlg SIZE 75, 18 PIXEL FONT oFontTablet
   @  nRow-2, nCol2 GET aGet[2] VAR  cRfcisterna OF oDlg SIZE 200, 18 PIXEL FONT oFontTablet  UPDATE
   nRow+= 48

   @ nRow, nCol SAY "Data Rifornimento :" OF oDlg SIZE 75, 18 PIXEL FONT oFontTablet
   @ nRow-2, nCol2 GET  aGet[3] VAR  dRffecrif   OF oDlg SIZE 100, 18 PIXEL FONT oFontTablet UPDATE ;
   ACTION ( dRffecrif:= CalendarioTablet(),aGet[3]:refresh())
   nRow+= 48

   @ nRow, nCol SAY "Litri inseriti :" OF oDlg SIZE 75, 18 PIXEL FONT oFontTablet
   @ nRow-2, nCol2 GET aGet[4] VAR  nRflitri    OF oDlg SIZE 100, 18 PIXEL PICTURE  "9999" FONT oFontTablet ;
   UPDATE ACTION ( Calcolatrice(0 , aGet[4], .T., "Calcolatrice",.f. ),nRfcostolit:=nRftotale/nRflitri,aGet[8]:refresh() )
   nRow+= 48

   @nRow, nCol SAY "Totale Euro :" OF oDlg SIZE 75, 18 PIXEL FONT oFontTablet
   @ nRow-2, nCol2 GET aGet[5] VAR  nRftotale RIGHT  OF oDlg SIZE 100, 18 PIXEL PICTURE  PictEuros() FONT oFontTablet  UPDATE  ACTION (Calcolatrice(0 , aGet[5], .T., "Calcolatrice" ),nRfcostolit:=nRftotale/nRflitri,aGet[8]:refresh())
   nRow+= 48

  * @ nRow, nCol CHECKBOX  aGet[6] VAR lRffull     PROMPT "&Inserito il pieno del serbatoio:" OF oDlg SIZE 253, 25 PIXEL FONT oFontTablet

      @nRow, nCol SAY "Inserito il pieno del serbatoio :" OF oDlg SIZE 165, 18 PIXEL FONT oFontTablet
      @ nRow-2, nCol2+80 SWITCH aGet[6] VAR lRffull SIZE 100, 18  PIXEL OF oDlg UPDATE ;
      COLOR CLR_GREEN, CLR_RED  ON CHANGE oSay2:refresh()

      @ @nRow, nCol+300 SAY oSay2 PROMPT If( lRffull, 'SI', 'NO' ) SIZE 60,30 PIXEL OF oDlg UPDATE

      nRow+= 48

   @ nRow, nCol SAY "Kilometri automezzo :" OF oDlg SIZE 75, 18 PIXEL FONT oFontTablet
   @ nRow-2, nCol2 GET  aGet[7] VAR cRfkmmezzo  OF oDlg SIZE 100, 18 PIXEL FONT oFontTablet     UPDATE ACTION Calcolatrice(0 , aGet[7], .T., "Calcolatrice",.f. )
   nRow+= 48

   @ nRow, nCol SAY "Costo per litro :" OF oDlg SIZE 105, 18 PIXEL FONT oFontTablet
   @ nRow-2, nCol2 GET  aGet[8] VAR nRfcostolit OF oDlg SIZE 70, 18 PIXEL PICTURE  "999999.99" FONT oFontTablet  UPDATE  READONLY
   nRow+= 48



    @ nRow+20, nCol+130 BUTTON oBtn PROMPT "&Conferma" OF oDlg SIZE 72, 18 PIXEL FONT oFontTablet DEFAULT ACTION (oDlg:End(), lSave := .T.)
    @ nRow+20, nCol+250 BUTTON oBtn PROMPT "&Annulla" OF oDlg SIZE 72, 18 PIXEL FONT oFontTablet CANCEL ACTION (oDlg:End())



return nil
//--------------------------------------------------------------------------------------//

function Rinfresca_oFrm()

   oPanel:SetSize( oDlg:nWidth-20, oDlg:nbottom-200 )  

   return nil



   function CalendarioTablet()
    return nil

   function Calcolatrice()
    return nil

    FUNCTION PictEuros()
    RETURN( "@E 9,999,999,999.99" )





 





I need your Help I must use a dialog into a tablet window and I not understtod How I must make it
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: trying with Lenovo Miix 320

Postby nageswaragunupudi » Sun Sep 10, 2017 6:07 pm

Sylvio

Sure
Changing dialog's appearance on rotation is of interest to all of us.
Please give me a little time to complete work on hand.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: trying with Lenovo Miix 320

Postby Silvio.Falconi » Mon Sep 11, 2017 8:33 am

ok
thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests