Page 1 of 1

bug en FW 12.03

Posted: Wed Apr 25, 2012 9:17 am
by lucasdebeltran
Hola,

Me sucede esto:
Image

Con FW 11.11 funcionaba OK.

Este es el código:

Code: Select all | Expand

// PDF
     @ 7, 278 SAY oSay2 PROMPT "Factor:" ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont


     @ 3, 325 COMBOBOX oFactor VAR nZFactor ;
          ITEMS {"1","2","3","4","5","6","7","8","9"} ;
          OF oBar FONT oFont PIXEL SIZE 35,200 ;
          ON CHANGE SetFactor( nZFactor )

     if Len( aFiles ) > 1
        @ 7, 370 SAY oPAGE PROMPT TXT_PAGENUM+ltrim(str(nPage,4,0)) + " / " + ;
          ltrim(str(len(aFiles))) ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont
     else
        @ 7, 370 SAY oPAGE PROMPT TXT_PAGENUM+ltrim(str(nPage,4,0)) ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont
     endif



     // modi mcn  para seleccionar impresora desde el preview
     @ 7, 540 SAY oSay2 PROMPT "Impresora:" ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont

 



Se debe a los cambios del SAY realizados últimamente.

Muchas gracias.

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 6:50 pm
by Antonio Linares
Lucas,

Este ejemplo se visualiza bien aqui:

test.prg

Code: Select all | Expand

// Sample showing how to manage the printer object

#include "FiveWin.ch"

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

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd
   
   ACTIVATE WINDOW oWnd ;
      ON CLICK Print()
     
return nil      

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

function Print()

   local oPrn, oFont
   local nRowStep, nColStep
   local nRow := 0, nCol := 0, n, m

   // PrnSetSize( 2100, 1200 )     To adjust a different printer paper size!

   PRINT oPrn NAME "Testing the printer object from FiveWin" PREVIEW

      if Empty( oPrn:hDC )
         return nil          // Printer was not installed or ready
      endif

      DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -12 OF oPrn

      nRowStep = oPrn:nVertRes() / 20   // We want 20 rows
      nColStep = oPrn:nHorzRes() / 15   // We want 15 cols

      PAGE
         oPrn:SayBitmap( 1, 1, "..\bitmaps\fivewin.bmp" )
         for n = 1 to 20  // rows
             nCol = 0
             oPrn:Say( nRow, nCol, Str( n, 2 ), oFont )
             nCol += nColStep
             for m = 1 to 15
                oPrn:Say( nRow, nCol, "+", oFont )
                nCol += nColStep
             next
             nRow += nRowStep
         next
         oPrn:Line( 0, 0, nRow, nCol )
      ENDPAGE

      PAGE
         nRow = 0
         oPrn:SayBitmap( 1, 1, "..\bitmaps\fivewin.bmp" )
         for n = 1 to 20  // rows
             nCol = 0
             oPrn:Say( nRow, nCol, Str( n + 20, 2 ), oFont )
             nCol += nColStep
             for m = 1 to 15
                oPrn:Say( nRow, nCol, "+", oFont )
                nCol += nColStep
             next
             nRow += nRowStep
         next
         oPrn:Line( 0, 0, nRow, nCol )
      ENDPAGE

   ENDPRINT

   oFont:End()      // Destroy the font object

return nil

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


Image

Has modificado alguna clase ? Puedes proporcionar un ejemplo para reproducirlo ? gracias

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:06 pm
by lucasdebeltran
Antonio,

Muchas gracias como siempre por el excelente soporte de Fivetech team.

En ese ejemplo no hay una barra.

Aquí se reproduce el problema:

Code: Select all | Expand

#include "FiveWin.ch"
#include "Mail.ch"

#define DEVICE      oWnd:cargo

#define GO_POS      0
#define GO_UP       1
#define GO_DOWN     2
#define GO_LEFT     1
#define GO_RIGHT    2
#define GO_PAGE    .T.

#define VSCROLL_RANGE  20*nZFactor
#define HSCROLL_RANGE  20*nZFactor

#define TXT_FIRST    LoadString( GetResources(), 07 )
#define TXT_PREVIOUS LoadString( GetResources(), 08 )
#define TXT_NEXT     LoadString( GetResources(), 09 )
#define TXT_LAST     LoadString( GetResources(), 10 )
#define TXT_ZOOM     LoadString( GetResources(), 11 )
#define TXT_UNZOOM   LoadString( GetResources(), 12 )
#define TXT_TWOPAGES LoadString( GetResources(), 13 )
#define TXT_ONEPAGE  LoadString( GetResources(), 14 )
#define TXT_PRINT    LoadString( GetResources(), 15 )
#define TXT_EXIT     LoadString( GetResources(), 16 )
#define TXT_FILE     LoadString( GetResources(), 17 )
#define TXT_PAGE     LoadString( GetResources(), 18 )
#define TXT_PREVIEW  LoadString( GetResources(), 03 )
#define TXT_PAGENUM  LoadString( GetResources(), 19 )

#define TXT_A_WINDOW_PREVIEW_IS_ALLREADY_RUNNING ;
        LoadString( GetResources(), 20 )
#define TXT_GOTO_FIRST_PAGE ;
        LoadString( GetResources(), 21 )
#define TXT_GOTO_PREVIOUS_PAGE ;
        LoadString( GetResources(), 22 )
#define TXT_GOTO_NEXT_PAGE ;
        LoadString( GetResources(), 23 )
#define TXT_GOTO_LAST_PAGE ;
        LoadString( GetResources(), 24 )
#define TXT_ZOOM_THE_PREVIEW ;
        LoadString( GetResources(), 25 )
#define TXT_UNZOOM_THE_PREVIEW ;
        LoadString( GetResources(), 26 )
#define TXT_PREVIEW_ON_TWO_PAGES ;
        LoadString( GetResources(), 27 )
#define TXT_PREVIEW_ON_ONE_PAGE ;
        LoadString( GetResources(), 28 )
#define TXT_PRINT_CURRENT_PAGE ;
        LoadString( GetResources(), 29 )
#define TXT_EXIT_PREVIEW ;
        LoadString( GetResources(), 30 )
#define TXT_FACTOR ;
        LoadString( GetResources(), 31 )
#define TXT_ZOOM_FACTOR ;
        LoadString( GetResources(), 32 )

#define MK_MBUTTON            16

static hLib // pdf


static oWnd, oBar, oMeta1, oMeta2,;
       oPage, oTwoPages, oZoom, oMenuZoom, oMenuTwoPages,;
       oMenuUnZoom, oMenuOnePage, oFactor, cResFile

static aFactor

static nPage, nZFactor

static lTwoPages, lZoom

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

function main( oDevice, oReport )

     local aFiles := {""}
     local hOldRes := GetResources()
     local oSay
     local nFor
     local oWndMain := WndMain(), oIcon, oCursor, oMenu, oBrush, oFont
     local l97Look  := oWndMain != nil .and. oWndMain:oBar != nil .and. ;
                       Len( oWndMain:oBar:aControls ) > 0 .and. ;
                       oWndMain:oBar:aControls[ 1 ]:l97Look
     local lExit := .F.
     local oHand, oImageList, oReBar, oSay2

     //local aImpre := aGetPrinters(), oCbx, cCbx:=PrnGetName(), cImpre := cCbx // mcn
     // para seleccionar impresora  (mcn)
     local aImpre := {"Impresora HP"}, cCbx, cImpre := cCbx // mcn


     #ifdef __CLIPPER__
        cResFile := "Preview.dll"
     #else
        if ! IsWin64()
           cResFile := "Prev32.dll"
        else
           cResFile = "Prev64.dll"
        endif
     #endif

     if SetResources(cResFile) < 32
          MsgStop(cResFile + " no encontrado, imposible continuar.",;
                  " E R R O R ")
          RETU nil
     endif

     if oWnd != nil
          MsgStop(TXT_A_WINDOW_PREVIEW_IS_ALLREADY_RUNNING)
          SetResources(hOldRes)
          RETU nil
     endif

     if oWndMain != nil
        oIcon = oWndMain:oIcon
     else
        DEFINE ICON oIcon RESOURCE "Print"
     endif

     //lExit := .T.

     DEFINE FONT oFont NAME GetSysFont() SIZE 0,-12

     DEFINE CURSOR oCursor RESOURCE "Lupa"




     DEFINE WINDOW oWnd FROM 0, 0 TO 24, 80  ;
          TITLE "oDevice:cDocument "+FWVERSION            ;
          COLOR CLR_BLACK,CLR_LIGHTGRAY      ;
          ICON  oIcon                        ;
          VSCROLL HSCROLL

     // So IsAppThemed_ed() is properly detected as the window is already built
     // PDF
     //oWnd:SetMenu( BuildMenu( oDevice:aMeta, oReport ) )

     oWnd:SetFont(oFont)

     oWnd:oVScroll:SetRange(0,0)
     oWnd:oHScroll:SetRange(0,0)

     DEFINE CURSOR oHand HAND

     if IsAppThemed_ed()    // PDF
        DEFINE IMAGELIST oImageList SIZE 16, 16

        oImageList:AddMasked( TBitmap():Define( "top2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "previous2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "next2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "bottom2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "zoom2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "two_pages2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "printer2",, oWnd ), nRGB( 255, 0, 255 ) )

        // pdf
        // Actualizar change bitmaps
        oImageList:AddMasked( TBitmap():Define( "save",, oWnd ), nRGB( 255, 0, 255 ) )
        oImageList:AddMasked( TBitmap():Define( "mail",, oWnd ), nRGB( 255, 255, 255 ) )
        oImageList:AddMasked( TBitmap():Define( "exit2",, oWnd ), nRGB( 192, 192, 192 ) )

        oImageList:AddMasked( TBitmap():Define( "unzoom2",, oWnd ), nRGB( 192, 192, 192 ) )
        oImageList:AddMasked( TBitmap():Define( "one_page2",, oWnd ), nRGB( 192, 192, 192 ) )

        oReBar = TReBar():New( oWnd )

        DEFINE TOOLBAR oBar OF oReBar SIZE 25, 25 IMAGELIST oImageList

        oReBar:InsertBand( oBar )

        oBar:nHeight -= 2

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP Strtran(TXT_FIRST,"&","") ;
           MESSAGE TXT_GOTO_FIRST_PAGE

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP Strtran(TXT_PREVIOUS,"&","") ;
           MESSAGE TXT_GOTO_PREVIOUS_PAGE

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP Strtran(TXT_NEXT,"&","") ;
           MESSAGE TXT_GOTO_NEXT_PAGE

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP Strtran(TXT_LAST,"&","") ;
           MESSAGE TXT_GOTO_LAST_PAGE

        DEFINE TBSEPARATOR OF oBar

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP Strtran(TXT_ZOOM,"&","") ;
           MESSAGE TXT_ZOOM_THE_PREVIEW

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP StrTran( Strtran(TXT_TWOPAGES,"&",""), "á", "a" ) ;
           MESSAGE TXT_PREVIEW_ON_TWO_PAGES

        DEFINE TBSEPARATOR OF oBar

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP Strtran(TXT_PRINT,"&","") ;
           MESSAGE TXT_PRINT_CURRENT_PAGE

        // PDF
        DEFINE TBBUTTON OF oBar ;
           TOOLTIP "Exportar a PDF" ;
           MESSAGE "Exporta a formato PDF"

        DEFINE TBBUTTON OF oBar ;
           TOOLTIP "Enviar Correo Electr¢nico" ;
           MESSAGE "Enviar por Correo Electrónico"


        DEFINE TBSEPARATOR OF oBar

        DEFINE TBBUTTON OF oBar ;
           ACTION  oWnd:End() ;
           TOOLTIP Strtran(TXT_EXIT,"&","") ;
           MESSAGE TXT_EXIT_PREVIEW

     else

        DEFINE BUTTONBAR oBar _3D SIZE 26, If( LargeFonts(), 30, 26 ) OF oWnd

        oBar:bRClicked := {|| nil }

     if l97Look
        DEFINE BUTTON RESOURCE "Top" OF oBar ;
             MESSAGE TXT_GOTO_FIRST_PAGE     ;
             TOOLTIP Strtran(TXT_FIRST,"&","") NOBORDER

        DEFINE BUTTON RESOURCE "Previous" OF oBar ;
             MESSAGE TXT_GOTO_PREVIOUS_PAGE       ;
             TOOLTIP Strtran(TXT_PREVIOUS,"&","") NOBORDER

        DEFINE BUTTON RESOURCE "Next" OF oBar ;
             MESSAGE TXT_GOTO_NEXT_PAGE       ;
             TOOLTIP Strtran(TXT_NEXT,"&","") NOBORDER

        DEFINE BUTTON RESOURCE "Bottom" OF oBar ;
             MESSAGE TXT_GOTO_LAST_PAGE         ;
             TOOLTIP Strtran(TXT_LAST,"&","") NOBORDER

        DEFINE BUTTON oZoom RESOURCE "Zoom" OF oBar GROUP ;
             MESSAGE TXT_ZOOM_THE_PREVIEW                 ;
             TOOLTIP Strtran(TXT_ZOOM,"&","") NOBORDER

        DEFINE BUTTON oTwoPages RESOURCE "Two_Pages" OF oBar  ;
             MESSAGE TXT_PREVIEW_ON_TWO_PAGES       ;
             TOOLTIP Strtran(TXT_TWOPAGES,"&","") NOBORDER

        DEFINE BUTTON RESOURCE "Printer" OF oBar GROUP ;
             MESSAGE TXT_PRINT_CURRENT_PAGE            ;
             TOOLTIP Strtran(TXT_PRINT,"&","") NOBORDER

        DEFINE BUTTON RESOURCE "Exit" OF oBar GROUP ;
             MESSAGE TXT_EXIT_PREVIEW               ;
             ACTION oWnd:End()                      ;
             TOOLTIP Strtran(TXT_EXIT,"&","") NOBORDER
    else
        DEFINE BUTTON RESOURCE "Top" OF oBar ;
             MESSAGE TXT_GOTO_FIRST_PAGE     ;
             TOOLTIP Strtran(TXT_FIRST,"&","")

        DEFINE BUTTON RESOURCE "Previous" OF oBar ;
             MESSAGE TXT_GOTO_PREVIOUS_PAGE       ;
             TOOLTIP Strtran(TXT_PREVIOUS,"&","")

        DEFINE BUTTON RESOURCE "Next" OF oBar ;
             MESSAGE TXT_GOTO_NEXT_PAGE       ;
             TOOLTIP Strtran(TXT_NEXT,"&","")

        DEFINE BUTTON RESOURCE "Bottom" OF oBar ;
             MESSAGE TXT_GOTO_LAST_PAGE         ;
             TOOLTIP Strtran(TXT_LAST,"&","")

        DEFINE BUTTON oZoom RESOURCE "Zoom" OF oBar GROUP ;
             MESSAGE TXT_ZOOM_THE_PREVIEW                 ;
             TOOLTIP Strtran(TXT_ZOOM,"&","")

        DEFINE BUTTON oTwoPages RESOURCE "Two_Pages" OF oBar  ;
             MESSAGE TXT_PREVIEW_ON_TWO_PAGES       ;
             TOOLTIP Strtran(TXT_TWOPAGES,"&","")

        DEFINE BUTTON RESOURCE "Printer" OF oBar GROUP ;
             MESSAGE TXT_PRINT_CURRENT_PAGE            ;
             TOOLTIP Strtran(TXT_PRINT,"&","")

        DEFINE BUTTON RESOURCE "Exit" OF oBar GROUP ;
             MESSAGE TXT_EXIT_PREVIEW               ;
             ACTION oWnd:End()                      ;
             TOOLTIP Strtran(TXT_EXIT,"&","")
     endif

     AEval( oBar:aControls, { | o | o:oCursor := oHand } )

     endif

     #ifdef __CLIPPER__
        SET MESSAGE OF oWnd TO TXT_PREVIEW CENTERED ;
           NOINSET CLOCK DATE KEYBOARD
     #else
        DEFINE STATUSBAR OF oWnd PROMPT "  " + TXT_PREVIEW // CLOCK
     #endif

     oMeta1 := TMetaFile():New( 0, 0, 0, 0,;
                                aFiles[ 1 ],;
                                oWnd,;
                                CLR_BLACK,;
                                CLR_WHITE,;
                                 )

     oMeta1:oCursor := oCursor




     nPage     := 1
     nZFactor  := 1
     lTwoPages := .F.
     lZoom     := .F.

     @ 7, 275 SAY oSay PROMPT TXT_FACTOR ;
          SIZE 60, 15 PIXEL OF oBar FONT oFont

     if IsAppThemed_ed()
        oSay:SetBrush( TBrush():New( "NULL" ) )
     endif


     // PDF
     @ 7, 278 SAY oSay2 PROMPT "Factor:" ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont


     @ 3, 325 COMBOBOX oFactor VAR nZFactor ;
          ITEMS {"1","2","3","4","5","6","7","8","9"} ;
          OF oBar FONT oFont PIXEL SIZE 35,200


     if Len( aFiles ) > 1
        @ 7, 370 SAY oPAGE PROMPT TXT_PAGENUM+ltrim(str(nPage,4,0)) + " / " + ;
          ltrim(str(len(aFiles))) ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont
     else
        @ 7, 370 SAY oPAGE PROMPT TXT_PAGENUM+ltrim(str(nPage,4,0)) ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont
     endif



     // modi mcn  para seleccionar impresora desde el preview
     @ 7, 540 SAY oSay2 PROMPT "Impresora:" ;
          SIZE 180, 15 PIXEL OF oBar FONT oFont


     @ 3, 610 COMBOBOX oCbx VAR cCbx ;
            PROMPTS aImpre ;
            OF oBar FONT oFont PIXEL SIZE 150,350


     if IsAppThemed_ed()
        FixSays( oBar:hWnd )
     endif

     #ifndef __XPP__
        oFactor:Set3dLook()
     #endif

     oWnd:cargo := oDevice

     WndCenter( oWnd:hWnd )

     SysRefresh()
     SetResources(hOldRes)



     ACTIVATE WINDOW   oWnd                      ;
          MAXIMIZED
          /*                              ;
          VALID        (oWnd:oIcon := nil       ,;
                        oFont:End()             ,;
                        oMeta1:End()            ,;
                        oMeta2:End()            ,;
                        oDevice:End()           ,;
                        oHand:End()             ,;
                        oWnd := nil             ,;
                        If( IsAppThemed_ed(), oImageList:End(),),;
                        lExit := .T.            ,;
                        .T.)

     StopUntil( {|| lExit} )
*/

     if oDevice:lPrvModal  .and. oWndMain != nil
          oWndMain:Show()
     endif

return (nil)

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


function IsAppThemed_ed()

return .t.

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:17 pm
by Antonio Linares
Lucas,

En tu ejemplo no llames a FixSays():

Code: Select all | Expand

    if IsAppThemed_ed()
        // FixSays( oBar:hWnd )
     endif
 

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:37 pm
by lucasdebeltran
Antonio,

Muchas gracias pero sigue sin funcionar:

Image

Ahora el color es diferente.

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:40 pm
by Antonio Linares
Estas usando un fichero manifest ?

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:45 pm
by lucasdebeltran
No, ahora mismo no.

Y añadíendolo en el .rc sigue igual:

// Includes varios
#include "c:\fwh\include\WinApi.ch"
#ifdef __FLAT__
1 24 "c:\fwh\samples\WinXP\WindowsXP.Manifest"
#endif

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:48 pm
by Antonio Linares
Lucas,

En el primer ejemplo que te he mostrado si se usa una barra superior. Si te fijas en el código fuente de FWH actual del preview, ahora se hace asi:

Code: Select all | Expand

     oBar:bPainted = { || oBar:Say( nRow, nCol, "Factor:",,, ::oFont, .T., .T. ),;
                           If( Len( ::oDevice:aMeta ) > 1,;
                           oBar:Say( nRow, nCol+100, ::cPageNum + LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ;
                           LTrim( Str( Len( ::oDevice:aMeta ) ) ),,, ::oFont, .T., .T. ),;
                           oBar:Say( nRow, nCol+100, ::cPageNum + LTrim( Str( ::nPage, 4, 0 ) ),;
                           ,,, ::oFont, .T., .T. ) ) }
 

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:48 pm
by lucasdebeltran
Y también probé oSay2:lTransparent = .T. sin éxito.

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 7:49 pm
by lucasdebeltran
Antonio,

¿Y cuál es la razón que mi código funciona con FW 11.11 y no con 12.03?.

Muchísimas gracias de verdad.

Re: bug en FW 12.03

Posted: Wed Apr 25, 2012 9:00 pm
by Antonio Linares
Lucas,

Buena pregunta :-)

Tiene que estar relacionado con los brushes y con la implementación de transparencia actual. Estoy revisandolo... :-)