Ambiente Metro.

Ambiente Metro.

Postby SAOliveira » Sat Apr 05, 2014 11:55 pm

No ambiente metro, existe a possibilidade de não mostrar a barra de scroll horizontal na parte de baixo da window ?

In the metro environment, there is the possibility of not showing the horizontal scroll bar at the bottom of the window? (google translator)
SAOliveira
Lins/SP - Brasil
User avatar
SAOliveira
 
Posts: 17
Joined: Sat Nov 05, 2011 8:56 am

Re: Ambiente Metro.

Postby Antonio Linares » Sun Apr 06, 2014 6:30 am

In the Class TMetroPanel (used from FWH samples/touch.prg) we simulate an horizontal scrollbar.

Where do you need to use it ? Just a standalone horizontal scrollbar ?
regards, saludos

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

Re: Ambiente Metro.

Postby SAOliveira » Mon Apr 07, 2014 9:44 am

Antonio,

Grateful for your answer.

What I really want to do is not show the horizontal scroll bar in the main window.

Image

.
SAOliveira
Lins/SP - Brasil
User avatar
SAOliveira
 
Posts: 17
Joined: Sat Nov 05, 2011 8:56 am

Re: Ambiente Metro.

Postby SAOliveira » Sun Apr 13, 2014 10:02 am

Antônio.

Did unable to explain?
SAOliveira
Lins/SP - Brasil
User avatar
SAOliveira
 
Posts: 17
Joined: Sat Nov 05, 2011 8:56 am

Re: Ambiente Metro.

Postby cnavarro » Sun Apr 13, 2014 11:24 am

SAOliveira

MetroPnel, por defecto, pone el Scroll Horizontal si el número de botones ocupa más espacio que el ancho de pantalla
MetroPnel, by default, puts the Horizontal Scroll if the number of buttons occupies more space than the screen width

Usando el ejemplo de ..\Samples\metrptst.prg
Using the example .. \ Samples \ metrptst.prg

Yo lo he conseguido modificando la clase MetroPnel de la siguiente forma:
I've gotten modifying MetroPnel class as follows:

Crear una nueva DATA
Create a new DATA
Code: Select all  Expand view

DATA  lMHScroll  INIT .T.
 


In the Paint METHOD, modify

Code: Select all  Expand view

METHOD Paint() CLASS TMetroPanel

   local aInfo
   local oRect    := ::GetCliRect()
   local hScrollBrush, hThumbBrush
   local nBarTotal

   aInfo := ::DispBegin()

   FillRect( ::hDC, oRect:aRect, ::oBrush:hBrush )
   ::Say( ( ::nBtnSize - ::oFont:nHeight ) / 2, ::nMetroTop, ::cTitle,,, ::oFont, .t., .t. )

   if !::lMHScroll                                   // Aqui
      ::nScrollRange := 0
   endif

   if ::nScrollRange > 0
      hScrollBrush      := CreateSolidBrush( ::nClrScroll )
      hThumbBrush       := CreateSolidBrush( ::nClrThumb  )
      ::nThumbWidth     := Int( ::nThumbSize * ( oRect:nWidth - 120 ) )
      nBarTotal         := oRect:nWidth - 120 - ::nThumbWidth
      ::nThumbPos       := Int( Abs( ::nOffSet / ::nScrollRange ) * nBarTotal ) + 60
      oRect:nTop        := oRect:nBottom - SCRLB_HEIGHT
      oRect:nHeight     := SCRLB_HEIGHT
      ::nScrollBarTop   := oRect:nTop
      ::nScrollRatio    := ( ::nScrollRange / nBarTotal )

      FillRect( ::hDC, oRect:aRect, hScrollBrush )
      FillRect( ::hDC, { oRect:nTop, oRect:nLeft + ::nThumbPos, oRect:nBottom, ;
            oRect:nLeft + ::nThumbPos + ::nThumbWidth }, hThumbBrush )
      DeleteObject( hScrollBrush )
      DeleteObject( hThumbBrush )

      MoveTo( ::hDC, oRect:nLeft + 32, oRect:nTop +  4 )
      LineTo( ::hDC, oRect:nLeft + 24, oRect:nTop + 10, ::hPen )
      LineTo( ::hDC, oRect:nLeft + 32, oRect:nTop + 16, ::hPen )

      MoveTo( ::hDC, oRect:nRight - 32, oRect:nTop +  4 )
      LineTo( ::hDC, oRect:nRight - 24, oRect:nTop + 10, ::hPen )
      LineTo( ::hDC, oRect:nRight - 32, oRect:nTop + 16, ::hPen )

   else
      if ::lMHScroll                                                  // Aqui
         ::nScrollBarTop   := oRect:nBottom + 2
      endif
   endif

.../...
 
 


and the METHOD Arrange, modify

Code: Select all  Expand view


.../...

   next nGroup

   ::nMetroWidth     := nGrpRight - ::nOffSet

   if ::lMHScroll                                               // Aqui
      ::nScrollRange    := Max(( ::nMetroWidth - ScreenWidth() ), ::nScrollRange )
      ::nScrollRange    := Max( 0, ::nScrollRange )
   endif

   ::nThumbSize      := 1 - ( ::nScrollRange / ::nMetroWidth )
   ::lArranged := .t.

return Self

 


Instructions for use ( Using the example .. \ Samples \ metrptst.prg )

Code: Select all  Expand view


function Main( cParam )

   local oWnd, oBar, oMetro, oBrush
   local cTitle := "Start"

   SET DATE ITALIAN
   SET CENTURY ON

   DEFINE WINDOW oWnd TITLE cTitle STYLE nOr( WS_POPUP, WS_MAXIMIZE );
      COLOR CLR_WHITE, CLR_GREEN

   oMetro   := MakeMetroPanel( oWnd )

   oMetro:lMHScroll := .F.         // Aqui

   .../....

 
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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Ambiente Metro.

Postby SAOliveira » Mon Apr 14, 2014 1:40 pm

Very good.

Tanks
SAOliveira
Lins/SP - Brasil
User avatar
SAOliveira
 
Posts: 17
Joined: Sat Nov 05, 2011 8:56 am

Re: Ambiente Metro.

Postby Antonio Linares » Mon Apr 14, 2014 5:01 pm

Cristobal,

many thanks for your help as usual :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 29 guests