SENSITIVE SAY - EN WINDOWS XP, MAS DE 50 SAYS.

Post Reply
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

SENSITIVE SAY - EN WINDOWS XP, MAS DE 50 SAYS.

Post by karinha »

Code: Select all

// Sensitive Say control by Ramón Avendaño
// 23-02-00

//-> CLASSE SSAY.PRG

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

METHOD Paint() CLASS TSSay

   local n 
   local nColorShadow, nColorLight

   DEFAULT ::lTransparent := .f.

   if ::nClrLight = Nil
      nColorLight := GetSysColor( COLOR_BTNHIGHLIGHT )
   else
      nColorLight := ::nClrLight
   endif

   ::GetDC()

   if ::lActive
    
**INI-20/02/2005 - Linares - Só começa a valer apartir do fwh fevereiro 2006
      if ::lTransparent .and. ! Empty( ::oBrush:hBitmap ) 
         SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop ) 
         FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush ) 
      endif 
**FIM-20/02/2005 - Linares

      for n := 1 to len( ::aCaption )
          if ::lLight
              WSay( ::hWnd, ::hDC, ::nSTop + ( n - 1 ) * ::nTxtHeight + 1, ::nSLeft + 1, ::aCaption[ n ],;
                    nColorLight,, If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
          endif

          WSay( ::hWnd, ::hDC, ::nSTop + ( n - 1 ) * ::nTxtHeight, ::nSLeft, ::aCaption[ n ],;
                If( ::lOver, ::nClrOver, ::nClrText ),,;
                If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )

      next
      
      if ::lDrawBox
         ::DrawBox( ::lOver )
      endif
      
   else
      
      nColorShadow := GetSysColor( COLOR_BTNSHADOW )
      nColorLight  := GetSysColor( COLOR_BTNHIGHLIGHT ) 

      for n := 1 to len( ::aCaption )
          WSay( ::hWnd, ::hDC, ::nSTop + ( n - 1 ) * ::nTxtHeight + 1, ::nSLeft + 1, ::aCaption[ n ], nColorLight,,;
                If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
          WSay( ::hWnd, ::hDC, ::nSTop + ( n - 1 ) * ::nTxtHeight, ::nSLeft, ::aCaption[ n ], nColorShadow,,;
                If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
      next

   endif

   // 3D

   if ::lShaded
      WndInset( ::hWnd, ::hDC )   // SHADED, SHADOW
   endif

   if ::lRaised
      WndRaised( ::hWnd, ::hDC )  // RAISED
   endif

   if ::lBox
      WndBoxIn( ::hDC, 0, 0, ::nBottom-::nTop, ::nRight-::nLeft )
      WndBoxRaised( ::hDC, 1, 1, ::nBottom-::nTop-1, ::nRight-::nLeft-1 )
   endif

   ::ReleaseDC()

   if ::lTransparent
      SysRefresh()
   endif

return nil

//-> Maestro Antonio... No tienes un erro aca?? Pues, Traba el DIALOGO en un
//-> FOLDER con mas de 50 SAYS... Que puede seer?
//-> Esto ocorre solo en Windows XP, en Windows 98, Funciona Normal.

Muchas gracias.

Regards, saludos.
João Santos - São Paulo - Brasil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Joao,

Has probado a usar estandard SAYs en vez de SSAYs y comprobar si el problema viene de usar SSAYs ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Post by karinha »

Antonio Linares wrote:Joao,

Has probado a usar estandard SAYs en vez de SSAYs y comprobar si el problema viene de usar SSAYs ?

SI, MAESTRO!!

Code: Select all

    IF IsWinNT() .OR. IsWin2000()  // Para Windows XP/NT e 2000 / 2003
        //-> Problemas aqui... Nao Suporta Mas que 50 Says Usando SSAY.PRG
        //-> Por enquanto, usar Says's Normais Para Colorir. Trava no XP.
        For IDCor=401 TO 456
            REDEFINE SAY oSay ID iDcor              ;
            OF oFld:aDialogs[1]                     ;
            COLOR CLR_BLACK, CLR_AMARELO            ;
            UPDATE                                  ;
            FONT oFnt
        Next IDCor
     ELSE
        For IDCor=401 TO 456
            REDEFINE SENSITIVE SAY ID iDcor         ;
            OF oFld:aDialogs[1]                     ;
            COLOR CLR_BLACK, CLR_AMARELO            ;
            UPDATE                                  ;
            RAISED TRANSPARENT                      ;
            FONT oFnt
        Next IDCor
    ENDIF
João Santos - São Paulo - Brasil
Post Reply