FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem to show btnbmp with tablet
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Problem to show btnbmp with tablet
Posted: Fri Mar 09, 2018 12:54 PM

I have a dialog with a xbrowse and 6 btnbmp at bottom : New,Mod,Canc,search,Print Exit
the problem come when I show it into a tablet and the use can rotate the tablet
on Horizontal it is native and ok
when the use rotate on vertical I not see all btnbmp
how I can to insert all button and resize it ?
I try with wndbutton resize of Nages samples but I not have success
any help please ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 162
Joined: Wed Feb 22, 2017 02:19 AM
Re: Problem to show btnbmp with tablet
Posted: Sat Mar 10, 2018 03:08 AM

Silvio ya somos dos
The same thing happens to me I have designed the landscape in the screen and then when I turn it over it does not adapt to portrate, there will be some done to correct this.
Oscar Chacon.
Busmaticcr.com

Regards.
S.I.T.U.
Sistemas Inteligentes de transporte urbano
http://www.situcr.com
oscarchacon@Situcr.com
Desarrollos BA4/B4j androide
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem to show btnbmp with tablet
Posted: Sat Mar 10, 2018 07:56 AM

You need to design 2 layouts initially for landscape and portrait modes. In other words we need to store 2 sets of Row/Col values of each control for landscape and portrait modes.

ON RESIZE clause, check if you are now in landscape/portrait mode. This can be done by comparing new nWidth and nHeight. If you notice a change in the layout, then switch the row/col values of the controls to the corresponding layout and refresh the window.

Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem to show btnbmp with tablet
Posted: Sat Mar 10, 2018 08:07 AM

the problem is on vertical the button are not inserted all
soon I insert a sample test to see you

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem to show btnbmp with tablet
Posted: Sat Mar 10, 2018 08:36 AM
Horizontal




Vertical



Now You see the buttons without the prompts but only the image

it seem run ok but the customer wants move the first 4 button at left and the other at right

If I insert prompt on the button then all cannot stay on the same row



a part of sources

Code (fw): Select all Collapse
  DEFINE DIALOG oDlg SIZE Int( ScreenWidth() * 0.85 ), Int( ScreenHeight() * 0.85) PIXEL TRUEPIXEL;
          FONT oFont TITLE "RIFORNIMENTO"

         @ 0,0 XBROWSE oBrw SIZE -20,-90 PIXEL OF oDlg ;
                   DATASOURCE "RF"  NOBORDER  LINES FONT oFont


         aBrowse   := {{ { || RF->RFNUMERO }, i18n("Numero Mov."), 120, },;
                       { { || RF->RFAUTO }, i18n("Automezzo"), 120, },;
                       { { || RF->RFCISTERNA   }, i18n("Cisterna"),250, },;
                       { { || CF(RF->RFFECRIF)   }, i18n("Data "),120, },;
                       { { || RF->RFLITRI   }, i18n("Litri"),80, },;
                       { { || RF->RFTOTALE   }, i18n("Totale"),80, },;
                       { { || ""   }, i18n("Pieno"),60, },;
                       { { || RF->RFKMMEZZO   }, i18n("Kilometri"),120, },;
                       { { || RF->RFCOSTOLIT }, i18n("Costo/litro"),120, }}




  FOR i := 1 TO Len(aBrowse)
      oCol := oBrw:AddCol()
      oCol:bEditValue := aBrowse[ i, 1 ]
     * oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
       if !Empty(aBrowse[ i, 4 ])
            oCol:cEditPicture:=aBrowse[ i, 4 ]
         Endif
   NEXT

       WITH OBJECT  oBrw
                     WITH OBJECT  oBrw:aCols[7]
                              :AddResource("FLAG_GREEN")
                              :AddResource("FLAG_RED")
                              :bBmpData := { || IIF( RF->RFFULL,1,2) }
                       END
            END

  FOR i := 1 TO LEN(oBrw:aCols)
      oCol := oBrw:aCols[ i ]
      oCol:bClrSelFocus  := { || { CLR_BLACK, nRGB(202,224,252) } }
   NEXT

       oBrw:nHeaderHeight := 45
       oBrw:nRowHeight := 50
     *  oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWRC
       oBrw:l2007        := .f.
       oBrw:l2015        := .t.

   oBrw:SetRDD()
   oBrw:CreateFromCode()
   oBrw:nStretchCol  := -1  //visione ottimale per tablet?



        @ oBrw:nBottom+5, 5   BUTTONBMP aBtn[1] ;
         BITMAP   ".\bitmaps\up.ico" ;
         SIZE 60, 60 PIXEL OF oDlg ;
         ACTION ( oBrw:KeyDown(VK_UP, 0), oBrw:SetFocus() )

        @ oBrw:nBottom+15, 75   BUTTONBMP aBtn[2];
         BITMAP   ".\bitmaps\DOWN.ico" ;
         SIZE 60, 60 PIXEL OF oDlg ;
          ACTION ( oBrw:KeyDown(VK_DOWN, 0), oBrw:SetFocus() )

        @ oBrw:nBottom+5, 140 BUTTONBMP aBtn[3] ;
         BITMAP   ".\bitmaps\page_up.ico" ;
         SIZE 60, 60 PIXEL OF oDlg ;
         ACTION  ( oBrw:GoTop(), oBrw:SetFocus() )

        @ oBrw:nBottom+15, 210   BUTTONBMP aBtn[4];
         BITMAP   ".\bitmaps\page_down.ico" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION ( oBrw:GoBottom(), oBrw:SetFocus() )

         @ oBrw:nBottom+15, 280   BUTTONBMP aBtn[5];
         BITMAP   ".\BITMAPS\benzinasi.png" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION RFEdita(oBrw, 1, oDlg,,aMezzi)

          @ oBrw:nBottom+15, 350   BUTTONBMP aBtn[6];
         BITMAP   ".\BITMAPS\benzinamo.png" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION RFEdita(oBrw, 2, oDlg,,aMezzi)

          @ oBrw:nBottom+15, 420   BUTTONBMP aBtn[7];
         BITMAP   ".\BITMAPS\benzinano.png" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION RFBorra(oBrw)

          @ oBrw:nBottom+15, 490 BUTTONBMP aBtn[8];
         BITMAP   ".\BITMAPS\benzinacer.png" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION NIL

         @ oBrw:nBottom+15, 560   BUTTONBMP aBtn[9];
         BITMAP   ".\BITMAPS\benzinasta.png" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION NIL

          @ oBrw:nBottom+15, 630   BUTTONBMP aBtn[10];
         BITMAP   ".\BITMAPS\benzinaexi.png" ;
        SIZE 60, 60 PIXEL OF oDlg ;
          ACTION oDlg:end()

 oDlg:bOnDisplayChange   := { || DlgResize( oDlg,aBtn ) }

     ACTIVATE DIALOG oDlg CENTERED ON INIT DlgResize( oDlg,aBtn )
     DbCloseAll()
      oFont:End()
    return nil


  STATIC function DlgResize( oDlg,aBtn )

   local i, j, n, r, c, w, h

   WITH OBJECT oDlg
      :nWidth     := Int( ScreenWidth()  * 0.85 )
      :nHeight    := Int( ScreenHeight() * 0.85 )

      w           := ( :nWidth  - 60 ) / 4
      h           := ( :nHeight - 80 ) / 3

   END


    for n= 1 to 10
     aBtn[n]:nTop:= Int( ScreenHeight() * 0.85 ) - 100
    next

      aBtn[01]:nLeft:= Int( ScreenWidth() * 0.85 ) -676
      aBtn[02]:nLeft:= Int( ScreenWidth() * 0.85 ) -612
      aBtn[03]:nLeft:= Int( ScreenWidth() * 0.85 ) -548
      aBtn[04]:nLeft:= Int( ScreenWidth() * 0.85 ) -484
      aBtn[05]:nLeft:= Int( ScreenWidth() * 0.85 ) -420
      aBtn[06]:nLeft:= Int( ScreenWidth() * 0.85 ) -356
      aBtn[07]:nLeft:= Int( ScreenWidth() * 0.85 ) -292
      aBtn[08]:nLeft:= Int( ScreenWidth() * 0.85 ) -228
      aBtn[09]:nLeft:= Int( ScreenWidth() * 0.85 ) -164
      aBtn[10]:nLeft:= Int( ScreenWidth() * 0.85 ) -100


   oDlg:Center()
   oDlg:Refresh()

   return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 162
Joined: Wed Feb 22, 2017 02:19 AM
Re: Problem to show btnbmp with tablet
Posted: Fri Mar 16, 2018 12:03 AM

Very Good People, But
What about When you use Dialog on resource.
Thanks..

Regards.
S.I.T.U.
Sistemas Inteligentes de transporte urbano
http://www.situcr.com
oscarchacon@Situcr.com
Desarrollos BA4/B4j androide
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem to show btnbmp with tablet
Posted: Fri Mar 16, 2018 01:03 AM

My opinion: not use resources or duplicate your resources for different devices and resolutions

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Problem to show btnbmp with tablet
Posted: Fri Mar 16, 2018 09:06 AM

Hello,

For my interest.

For tablets, is it the standard FWH that we can use or is it one of the other FW products.

Regards

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem to show btnbmp with tablet
Posted: Fri Mar 16, 2018 09:36 AM

I think
If you use resources you must create two dialog on rc
one for Portrait and one for landscape

I use @x,y sources from win7 because from win7 the Microsoftwindows lose many resources, memory
If you use @x,y the app is much fast than with res

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion