Page 2 of 16

Re: La nueva apariencia de EasyReport

PostPosted: Wed Aug 27, 2014 2:59 pm
by Antonio Linares
Manuel,

La Clase TBtnBmp ya tiene soporte para bitmaps "deshabilitados" :-)

Es la DATA cBmpFile3 y opcionalmente la cBmpFile4 (al pasar el ratón por encima del deshabilitado).

El método GetBmp() de la Clase TBtnBmp selecciona el bitmap correcto a pintar :-)

Re: La nueva apariencia de EasyReport

PostPosted: Wed Aug 27, 2014 2:59 pm
by Antonio Linares
Manuel,

La Clase TBtnBmp ya tiene soporte para bitmaps "deshabilitados" :-)

Es la DATA cBmpFile3 y opcionalmente la cBmpFile4 (al pasar el ratón por encima del deshabilitado).

El método GetBmp() de la Clase TBtnBmp selecciona el bitmap correcto a pintar :-)

Re: La nueva apariencia de EasyReport

PostPosted: Wed Aug 27, 2014 2:59 pm
by Antonio Linares
Manuel,

La Clase TBtnBmp ya tiene soporte para bitmaps "deshabilitados" :-)

Es la DATA cBmpFile3 y opcionalmente la cBmpFile4 (al pasar el ratón por encima del deshabilitado).

El método GetBmp() de la Clase TBtnBmp selecciona el bitmap correcto a pintar :-)

Re: La nueva apariencia de EasyReport

PostPosted: Wed Aug 27, 2014 3:56 pm
by mastintin
Antonio Linares wrote:Manuel,

La Clase TBtnBmp ya tiene soporte para bitmaps "deshabilitados" :-)

Es la DATA cBmpFile3 y opcionalmente la cBmpFile4 (al pasar el ratón por encima del deshabilitado).

El método GetBmp() de la Clase TBtnBmp selecciona el bitmap correcto a pintar :-)


Si , lo que cambiamos aquí es que si el botón se deshabita y no se especifica el cBmpFile3 lo que hace es coger el cBmpFile1 y lo pasa a escala de grises , de esta forma evitamos tener que crear una version gris de un bitmap ya que la creamos mediante código y evitamos también tener que incluirla en el rc y por tanto en el programa .

Re: La nueva apariencia de EasyReport

PostPosted: Thu Aug 28, 2014 10:48 am
by Biel EA6DD
Buen trabajo Manuel,
me gusta tu implementación en la clase tBtnBmp, con el Data queda mas fino y permite deshabilitar la funcionalidad de una forma sencilla.
Espero que se incluya en la próxima versión de FW.

De todas formas, me gusta más todo gris que no escala de grises, pero eso es un tema de gustos personales, :wink: y dependiente del bmp convertido.

Image Gris
Image Escala de grises

Re: La nueva apariencia de EasyReport

PostPosted: Sun Sep 07, 2014 7:17 pm
by cnavarro
Solicito opiniones
Esta imagen es en una pantalla de 1366 x 768

Image

Re: La nueva apariencia de EasyReport

PostPosted: Sun Sep 07, 2014 7:22 pm
by cnavarro
Y

Image

Re: La nueva apariencia de EasyReport

PostPosted: Sun Sep 07, 2014 7:51 pm
by mastintin
Me gusta , me gusta mucho ... cada día se trabaja mas en pantalla apaisadas por lo que no seria problema el tener continuamente desplegado el tree de los elementos .
Una opción factible es crear una data de Teasyreport llamada l800 o algo así , detectamos que la pantalla tiene resolución de 800* 600 ( o la que veamos que es adecuada ) si tiene eso o menos mantenemos el formato actual sino activamos este nuevo formato .
Otra opción y quizás mejor es añadir al INI general un nuevo valor donde activemos o no el formato se guarda en una data lNewFormato y según el valor activamos una forma u otra ....así el usuario decide...
Fantastico ....

Re: La nueva apariencia de EasyReport

PostPosted: Sun Sep 07, 2014 8:05 pm
by cnavarro
Manuel
Cualquiera de las dos opciones me parece bien. Por mi parte, haz lo que consideres mejor, aunque de momento podríamos considerar simplemente valorar la resolución en la entrada de la aplicación, y preguntar simplemente si se desea ver el Tree, y mediante una variable estática configurar la aplicacion (esto teniendo en cuenta que cada dia hay menos monitores con resoluciones inferiores a 1366). Pero la configuracion en el INI y una DATA en la clase me parece lo más correcto.
Si todos los cambios que pongo en el foro, y los que tengo hechos, no los subo directamente es para no interferir en tu trabajo (aún no domino bien el Git)
Lo has probado en una pantalla de resolución superior ( 1600 ó 1920 )?

Re: La nueva apariencia de EasyReport

PostPosted: Sun Sep 07, 2014 11:46 pm
by mastintin
¿ son muchos los cambios para poner esa apariencia ?
si son pocos ,coloca aquí el código y ya lo inserto ... si son muchos los cambios mandamelos al correo ....
Saludos.

Re: La nueva apariencia de EasyReport

PostPosted: Mon Sep 08, 2014 12:42 am
by cnavarro
Lo he simplificado al máximo
No son muchos, aunque te pongo las funciones completas
Creo que no se me olvida nada

Code: Select all  Expand view

Static aPnels

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

function Main( P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15 )

   local i, oBrush, oIni, aTest, nTime1, nTime2, cTest, oIcon, cDateFormat
   local cOldDir  := hb_CurDrive() + ":\" + GetCurDir()
   local cDefFile := "
"
   local oSpl
   local nAltoSpl := 680
   local cControl := "
TPanel"
   
   aPnels   := {}

   lChDir( cFilePath( GetModuleFileName( GetInstance() ) ) )

   if P1  <> nil ; cDefFile += P1  + "
" ; endif
   if P2  <> nil ; cDefFile += P2  + "
" ; endif
   if P3  <> nil ; cDefFile += P3  + "
" ; endif
   if P4  <> nil ; cDefFile += P4  + "
" ; endif
   if P5  <> nil ; cDefFile += P5  + "
" ; endif
   if P6  <> nil ; cDefFile += P6  + "
" ; endif
   if P7  <> nil ; cDefFile += P7  + "
" ; endif
   if P8  <> nil ; cDefFile += P8  + "
" ; endif
   if P9  <> nil ; cDefFile += P9  + "
" ; endif
   if P10 <> nil ; cDefFile += P10 + "
" ; endif
   if P11 <> nil ; cDefFile += P11 + "
" ; endif
   if P12 <> nil ; cDefFile += P12 + "
" ; endif
   if P13 <> nil ; cDefFile += P13 + "
" ; endif
   if P14 <> nil ; cDefFile += P14 + "
" ; endif
   if P15 <> nil ; cDefFile += P15 + "
" ; endif

   cDefFile := STRTRAN( AllTrim( cDefFile ), '"
' )

   EP_TidyUp()
   EP_LinkedToApp()
   EP_SetPath( ".\" )

   //Einf�ge-Modus einschalten
   ReadInsert( .T. )

   PUBLIC oER := TEasyReport():new()

   //Publics deklarieren
   DeclarePublics( cDefFile )

   SET DELETED ON
   SET CONFIRM ON
   SET 3DLOOK ON
   SET MULTIPLE OFF
   SET DATE FORMAT to "dd.mm.yyyy"

   cDateFormat := LOWER(AllTrim( oEr:GetGeneralIni( "General", "DateFormat", "")) )

   SET DATE FORMAT IIF( Empty( cDateFormat ), "dd.mm.yyyy", cDateFormat )

     //Open Undo database
   OpenUndo()

   SET HELPFILE to "VRD.HLP"

   DEFINE ICON oIcon FILE ".\vrd.ico"

   DEFINE BRUSH oBrush RESOURCE "background"

   SetDlgGradient( oER:aClrDialogs )


   DEFINE WINDOW oEr:oMainWnd VSCROLL ; //FROM 0, 0 to 50, 200 VSCROLL ;
      TITLE MainCaption() ;
      BRUSH oBrush MDI ;
      ICON oIcon ;
      MENU BuildMenu()
     

   SET MESSAGE OF oEr:oMainWnd  CENTERED 2010

   DEFINE MSGITEM oMsgInfo OF oEr:oMainWnd:oMsgBar SIZE 280

   oEr:oMainWnd:oMsgBar:KeybOn()
   oEr:oMainWnd:oWndClient:bMouseWheel = { | nKey, nDelta, nXPos, nYPos | ;
                                  ER_MouseWheel( nKey, nDelta, nXPos, nYPos ) }

   BarMenu()

   AAdd( aPnels, nil )                                 // Esto
   aPnels[Len(aPnels)] := TPanel():New( 34, 0, nAltoSpl, 262, oEr:oMainWnd )
   oEr:oMainWnd:oLeft  := aPnels[Len(aPnels)]


   @ 34, 262 SPLITTER oSpl ;
             VERTICAL ;  //  PREVIOUS CONTROLS aPnels[1];
             SIZE 0, nAltoSpl ;
             PIXEL ;
             OF oEr:oMainWnd


   ACTIVATE WINDOW oEr:oMainWnd ;
      MAXIMIZED ;
      ON INIT ( SetMainWnd(), IniMainWindow(), ;
                IIF( Empty( oER:cDefIni ), OpenFile(), SetScrollBar() ), ;
                StartMessage(), SetSave( .T. ), ClearUndoRedo() ) ;
      VALID ( AEVal( aWnd, { |o| if( o <> nil, o:End(), ) } ), AskSaveFiles() )

   oEr:oAppFont:End()
   oBrush:End()
   oGenVar:oAreaBrush:End()
   oGenVar:oBarBrush:End()

   AEval( oGenVar:aAppFonts, {|x| x:End() } )
   AEval( aFonts, {|x| IIF( x <> nil, x:End(), ) } )

   CloseUndo()

   lChDir( cOldDir )

return nil

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



Code: Select all  Expand view

function ClientWindows()

   local i, nWnd, cItemDef, cTitle, nWidth, nHeight, nDemoWidth
   local lFirstWnd     := .F.
   local nTop          := 0
   local nWindowNr     := 0
   local aIniEntries   := GetIniSection( "Areas", oER:cDefIni )
   local cAreaFilesDir := CheckPath( oEr:GetDefIni( "General", "AreaFilesDir", "" ) )
   local lReticule

   nDemoWidth := 0

   //Sichern
   aVRDSave := ARRAY( 102, 2 )
   aVRDSave[101, 1 ] := oER:cDefIni
   aVRDSave[101, 2 ] := MEMOREAD( oER:cDefIni )
   aVRDSave[102, 1 ] := oER:cGeneralIni
   aVRDSave[102, 2 ] := MEMOREAD( oER:cGeneralIni )

   //? oEr:oMainWnd:oWndClient:nHeight

   for i := 1 to LEN( aIniEntries )

      nWnd := EntryNr( aIniEntries[ i ] )
      cItemDef := GetIniEntry( aIniEntries,, "",, i )

      if nWnd <> 0 .and. !Empty( cItemDef )

         if lFirstWnd = .F.
            nAktArea := nWnd
            lFirstWnd := .T.
         endif

         if Empty( cAreaFilesDir )
            cAreaFilesDir := cDefaultPath
         endif
         if Empty( cAreaFilesDir )
            cAreaFilesDir := cDefIniPath
         endif

         cItemDef := VRD_LF2SF( AllTrim( cAreaFilesDir + cItemDef ) )

         aVRDSave[nWnd, 1 ] := cItemDef
         aVRDSave[nWnd, 2 ] := MEMOREAD( cItemDef )

         nWindowNr += 1
         aAreaIni[nWnd] := IIF( AT( "\", cItemDef ) = 0, ".\", "" ) + cItemDef

         cTitle  := AllTrim( GetPvProfString( "
General", "Title" , "", aAreaIni[nWnd] ) )

         oGenVar:aAreaSizes[nWnd] := ;
            { Val( GetPvProfString( "
General", "Width", "600", aAreaIni[nWnd] ) ), ;
              Val( GetPvProfString( "
General", "Height", "300", aAreaIni[nWnd] ) ) }

         nWidth  := ER_GetPixel( oGenVar:aAreaSizes[nWnd, 1 ] )
         nHeight := ER_GetPixel( oGenVar:aAreaSizes[nWnd, 2 ] )

         //nDemoWidth := nWidth

         //if oGenVar:lFixedAreaWidth = .T.
         //   nWidth := 1200
         //else
            nWidth += oEr:nRuler + nAreaZugabe2
         //endif
         nDemoWidth := Max( nDemoWidth, nWidth )

                                                                               
         aWnd[ nWnd ] = ER_MdiChild():New( nTop, oEr:oMainWnd:oWndClient:nLeft  + 2 , nHeight + nAreaZugabe,;
                            nDemoWidth, cTitle, nOr( WS_BORDER ),, oEr:oMainWnd,, .F.,,,,;
                            oGenVar:oAreaBrush, .T., .F. ,,, , , , , 1 )                                          // Esto

         aWnd[ nWnd ]:nArea = nWnd

         aWndTitle[ nWnd ] = cTitle

         lReticule = oGenVar:lShowReticule
         oGenVar:lShowReticule = .F.

         FillWindow( nWnd, aAreaIni[nWnd] )
         
         ACTIVATE WINDOW aWnd[ nWnd ] ;
         VALID !GETKEYSTATE( VK_ESCAPE )

         oGenVar:lShowReticule := lReticule

         nTop += nHeight + nAreaZugabe

      endif


   next

   nTotalHeight := nTop
   nTotalWidth  := nWidth

   ItemList( aPnels[1] )           // Esto

return .T.

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



y

Code: Select all  Expand view


function ItemList( oDlg )

   //local oDlg
   local oTree
   local oImageList, oBmp1, oBmp2
   local lDlg   := .T.

   if empty( oDlg )
   DEFINE DIALOG oDlg RESOURCE "Itemlist" TITLE GL("Item List")

   oTree := TTreeView():ReDefine( 201, oDlg, 0, , .F. ,"" )

   oTree:bLDblClick  = { | nRow, nCol, nKeyFlags | ClickListTree( oTree ) }
   oTree:bEraseBkGnd = { || nil }  // to properly erase the tree background


   REDEFINE BUTTON PROMPT GL("&OK") ID 101 OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED ON INIT FillTree( oTree, oDlg )  //ListTrees( oTree )
   else

   oTree := TTreeView():New( 0, 0, oDlg, 0, , .T., .F., 262, 680 ,"",, )

   oTree:bLDblClick  = { | nRow, nCol, nKeyFlags | ClickListTree( oTree ) }
   oTree:bEraseBkGnd = { || nil }  // to properly erase the tree background
   
   FillTree( oTree, oDlg )

   endif
 return nil

 

Re: La nueva apariencia de EasyReport

PostPosted: Mon Sep 08, 2014 7:32 am
by mastintin
Subido al repositorio ...
He ajustado un poco el código para poder implementar el uso o no del spliter , he puesto el auto ajuste del spliter pero lo que no hace es el redimensionado del panel ... yo hoy no tocare código así que si sincronizas con el repositorio puedes subir directo los cambios .

Re: La nueva apariencia de EasyReport

PostPosted: Mon Sep 08, 2014 9:21 am
by Silvio.Falconi
Only an Idea....

why not divide in sub windows as FastReport

a wndchild ( as Reportname1)

and in this wndchild a folder
TAb1 "Designer " where we can insert the designer
Tab2 "Object" where we can insert the tree object
Tab3 "Scripts" where we can see the Vrd files
Tab4 "Data" where we can show or open the fields of data we need (a tree with fields)
tab5 "Preview" where we can show the preview of the report

this for the future when we could copy and paste a part or a object from a report to another (reportname2)

only an idea ....

Re: La nueva apariencia de EasyReport

PostPosted: Mon Sep 08, 2014 11:14 am
by cnavarro
Silvio, gracias
Ya habia pensado en hacer una simulacion mas o menos como tu dices

Silvio, thanks
He had already thought of doing a simulation more or less as you say

Re: La nueva apariencia de EasyReport

PostPosted: Wed Sep 10, 2014 10:49 am
by mastintin
Seria interesante colocar codigo al treeview para que tenga bordes ...