Clipper On Line • Ver Tópico - Campo editavel
Mudar para estilo Clássico
Discussão sobre a biblioteca Fivewin - O Clipper para Windows.
Postar uma resposta

Campo editavel

06 Abr 2016 14:42

Olá amigos, alguém sabe me informar o comando para tirar a borda do campo editavel?
e se é possível deixar o campo arredondado q nem na imagem em anexo, se sim,qual seria o comando?

@ 85, 160 GET oGetL VAR cLogin OF senhaDlg SIZE 96, 17 PIXEL FONT oFont2
oGetL:SetColor( RGB(0,0,128), RGB(132,193,255))
Anexos
Login.jpg - Visualizador de Fotos do Windows.jpg
Login.jpg - Visualizador de Fotos do Windows.jpg (5.64 KiB) Visualizado 1825 vezes

Campo editavel

06 Abr 2016 15:56

Amiguinhos,

Daiane
Eu só uso .RCs e como vi que voce usa a forma direta de posicionamentos, verifique se no seu código voce tem algum comando estilo, SET 3DLOOK... e desative-o com OFF.

O bom sempre é mostrar o código completo pois os comandos antes da criação das WINDOWs e DIALOGos nos ajudam a entender o problema.

Campo editavel

06 Abr 2016 17:04

Tente assim:

Código:
@ 85, 160 GET oGetL VAR cLogin OF senhaDlg SIZE 96, 17 PIXEL FONT oFont2 NOBORDER UPDATE

oGetL:SetColor( RGB(0,0,128), RGB(132,193,255))

Campo editavel

06 Abr 2016 17:14

Rochinha, quem sabe... Sabe!!! kkkkkkkkkkkkkkkkk, abs.

Código:
#Include "FiveWin.ch"

function Main()

   local oDlg, cTest := "hola"+Space( 20 ), oGet, oGet2
   local obtn

   DEFINE DIALOG oDlg

   @ 1, 3 GET oGet VAR cTest OF oDlg SIZE 100, 13
   
   oget:bPainted = { ||  LightBorder( oGet, oGet:lFocused , .f. ) }
         
   @ 3, 3 GET oGet2 VAR cTest OF oDlg SIZE 100, 13
     
   oget2:bPainted = { ||  LightBorder( oGet2, oGet2:lFocused , .T. ) }

   ACTIVATE DIALOG oDlg CENTERED
   

return nil

function LightBorder( oGet, lFocus, lRounded  )

   local hDC := oGet:oWnd:GetDC()
   local hBrush, hOldBrush, n
   local aTopLeft, aBottomRight
   local oPen,hPen1
   local aRect := GetClientRect( oGet:hWnd )
   
   LOCAL aGrdBack1  := { { 0.5, oget:ownd:nClrPane, nRGB(234 ,244, 252 ) },{ 0.5, nRGB(234 ,244, 252 ), nRGB(214 ,234,249 ) } }
   LOCAL aGrdBack2  := { { 0.5, nRGB(214 ,234, 249 ), nRGB(234 ,244,252 ) }, { 0.5, nRGB(234 ,244, 252 ), oget:ownd:nClrPane} }
   local aGrdBack3  := { { 1,  oget:ownd:nClrPane,  oget:ownd:nClrPane } }
   
    DEFAULT lRounded := .f.
    DEFAULT lfocus  := .t.
   
       if lFocus
           hPen1 = CreatePen( PS_SOLID, 1,  nRGB( 102 , 175, 233 ) )
     else
           hPen1 = CreatePen( PS_SOLID, 1,  nRGB( 180 , 180, 180 ) )
     endif
     
       
      SelectObject( hDC,hPen1)
     
      aTopLeft = ClientToScreen( oGet:hWnd, { aRect[1], aRect[2] } )
      aTopLeft = ScreenToClient( oGet:oWnd:hWnd, aTopLeft )

      aBottomRight = ClientToScreen( oGet:hWnd, {aRect[3], aRect[4] } )
      aBottomRight = ScreenToClient( oGet:oWnd:hWnd, aBottomRight )
     
     SetBkMode( hDC , 1 )
           
       GRADIENTFILL( hDC, aTopLeft[1]-12, aTopLeft[2]-12, aTopLeft[1]-3, aBottomRight[ 2 ]+12 , if( lFocus, aGrdBack1, aGrdBack3 ) )
       GRADIENTFILL( hDC, aBottomRight[1]+2, aTopLeft[2]-10, aBottomRight[1]+10, aBottomRight[ 2 ]+10 , if( lFocus, aGrdBack2, aGrdBack3 ) )
       
       GRADIENTFILL( hDC, aTopLeft[1]-5, aTopLeft[2]-14, aBottomRight[1]+5, aTopLeft[ 2 ]-3 ,if( lFocus, aGrdBack1, aGrdBack3 ), .F. )
       GRADIENTFILL( hDC, aTopLeft[1]-5, aBottomRight[2]+2, aBottomRight[1]+5, aBottomRight[ 2 ]+14 , if( lFocus, aGrdBack2, aGrdBack3 ), .F. )
       
    if lRounded
            RoundRect( hDC, aTopLeft[2]-4, aTopLeft[1]-2, aBottomRight[ 2 ]+3,  aBottomRight[ 1 ]+2 , 7, 7 )
    else
            Rectangle( hDC, aTopLeft[1]-2, aTopLeft[2]-2, aBottomRight[ 1 ]+2,  aBottomRight[ 2 ]+2 )
    endif
       
   
    DeleteObject( hpen1 )

    oGet:oWnd:ReleaseDC()
   
Return nil


/*
Desde recursos tendríamos que cambiar la táctica ... dos cosas :
1.- el marco en redondo produce un efecto raro ( no se si se puede hacer redondo el original )
2.- en vez usar el bpaint tendriamos que usar ...

    //oget:bPainted = { ||  LightBorder2( oGet2, oGet2:lFocused , .T. ) }

    oget:bgotfocus = { ||  LightBorder( oGet,.t., .f. )  }
     oget:bLostFocus = { ||  LightBorder( oGet,.f., .f. ) }

   ACTIVATE DIALOG oDlg CENTERED ON Paint LightBorder ( oGet,.t., .f. )  // aqui ponemos esto si es el get el primer control que toma el foco cunado se lanza el dialogo

*/



Campo editavel

06 Abr 2016 17:23

Fonte original:

http://fivetechsupport.com/forums/viewtopic.php?f=6&t=29565&p=167357&hilit=GET+REDONDO&sid=759a33d93907e55b09f96d72b89d35f2#p167357

http://fivetechsupport.com/forums/viewtopic.php?f=6&t=16587&p=86018&hilit=GET+REDONDO&sid=759a33d93907e55b09f96d72b89d35f2#p86018

abs.

Campo editavel

06 Abr 2016 17:27

outro modelo:

Código:
#include "Fivewin.ch"

Function Test()

   Local oDlg, oFont, oBmp, cTest := Space( 20 ), oGet

   DEFINE BITMAP oBmp FILE "..\bitmaps\back.bmp"
   DEFINE FONT oFont NAME "Arial" SIZE 0,-36 BOLD NESCAPEMENT 250 //Texto 45º

   DEFINE DIALOG oDlg FROM 0,0 to 18,40 TITLE "Texto sin relleno"

   @ 2, 3 GET oGet VAR cTest OF oDlg SIZE 100, 13 ;
          COLORS CLR_HRED, CLR_WHITE

   oGet:bPainted = { || LightBorder( oGet ) }

   ACTIVATE DIALOG oDlg CENTERED ON PAINT;
     (DrawBitmap(oDlg:hDC,oBmp:hBitmap,0,0,oDlg:nWidth,oDlg:nHeight),;
      HollowText(oDlg,200,20," Texto sin relleno ",oFont,CLR_GREEN,2))

   RELEASE FONT oFont
   RELEASE BITMAP oBmp

return nil
*************************************************************************
*
* Function HollowText(oDlg,y,x,cText,oFont,nColor,nWidth,nStyle)
*
* Dibuja sólo el contorno de un texto
*  oDlg: Contenedor
*  y,x : Coordenadas
*  oFont: Fuente
*  nColor, nWidth, nStyle: Color, ancho y estilo de contorno

*  César E. Lozada          cesarlozada@hotmail.com
*  Los Teques, Venezuela    17-Abr-2003
*
*************************************************************************
Function HollowText(oDlg,y,x,cText,oFont,nColor,nWidth,nStyle)
  Local hDC:=oDlg:hDC
  Local nOldFont, hPen, hOldPen
  DEFAULT oFont:=oDlg:oFont, nColor:=oDlg:nClrText,;
          nWidth:=1, nStyle:=0 //PS_SOLID

  nOldFont:=SelectObject(hDC,oFont:hFont)
  hPen:=CreatePen(nStyle,nWidth,nColor)
  hOldPen:=SelectObject(hDC,hPen)

  BeginPath(hDC)
  TextOut(hDC,y,x,cText,Len(cText))
  EndPath(hDC)
  StrokePath(hDC)

  SelectObject(hDC,nOldFont)
  SelectObject(hDC,hOldPen)
  DeleteObject(hPen)

return nil

function LightBorder( oGet )

   local hDC := oGet:oWnd:GetDC()
   local hBrush, hOldBrush, n
   local aTopLeft, aBottomRight
   local oPen,hPen1
   local aRect := GetClientRect( oGet:hWnd )

   for n = 1 to 10

      IF n > 5
         //hPen1 = CreatePen( PS_SOLID, 1,  nRGB( 102 , 175, 233 ) )  // blue
         hPen1 = CreatePen( PS_SOLID, 1,  RGB( 255, 165, 000 ) )      // orange
      ELSE
         hPen1 = CreatePen( PS_SOLID, 1,  nRGB( Int(254 - n*3-n ), Int(254- n*2 ) , 255 ) )
      endif

      // hPen1 = CreatePen( PS_SOLID, 1,  nRGB( Int(244 - n ), Int(254- n ) , 255 ) )
      // SelectObject( hDC, oPen := TPen():New( ,, nRGB( n ^ 2, n ^ 2, 200 ) ):hPen )

      SelectObject( hDC,hPen1)
      aTopLeft = ClientToScreen( oGet:hWnd, { aRect[1], aRect[2] } )
      aTopLeft = ScreenToClient( oGet:oWnd:hWnd, aTopLeft )

      aBottomRight = ClientToScreen( oGet:hWnd, {aRect[3], aRect[4] } )
      aBottomRight = ScreenToClient( oGet:oWnd:hWnd, aBottomRight )

      SetBkMode( hDC , 1 )

      Rectangle( hDC, aTopLeft[1]-8 + n, aTopLeft[2]-8+ n, aBottomRight[ 1 ]+8 -n,  aBottomRight[ 2 ]+8-n )

      DeleteObject( hPen1 )

   next

   oGet:oWnd:ReleaseDC()

Return nil

*************************************************************************
DLL32 STATIC FUNCTION BeginPath;
      ( hdc AS LONG ) ;
   AS LONG PASCAL;
   LIB "GDI32"

DLL32 STATIC FUNCTION EndPath;
      ( hdc AS LONG ) ;
   AS LONG PASCAL;
   LIB "GDI32"

DLL32 STATIC FUNCTION StrokePath;
      ( hdc AS LONG ) ;
   AS LONG PASCAL;
   LIB "GDI32"
*************************************************************************



Campo editavel

07 Abr 2016 10:06

Obrigada gnt,me ajudaram bastante
consegui tirar a borda,mas sera q n tem como deixar as extremidades arredondada?

Campo editavel

07 Abr 2016 11:20

Daiane, leia as resposta de novo... baixe os códigos e teste para entender. abs.

Veja onde eu brinco com o meu amigo José Carlos da Rocha(Rochinha), brinque com o código que entenderás, se não funcionar, é porque sua versão do FIVEWIN the best, está obsoleta.

Campo editavel

07 Abr 2016 15:26

Kapiaba, na verdade testei com todas as soluções. mas uma tem a borda com a cor q eu defini e a outra tem uma borda diferenciada com linha branca,mas msm assim irei continuar analisando melhor o codigo para ver se encontro algo q possa fzr isso.

Muito obrigada pela ajuda ;)

Campo editavel

07 Abr 2016 15:56

Daiane, uma imagem fala por si...

abs
Anexos
BORDARED.png

Campo editavel

07 Abr 2016 16:03

Na verdade eu fiz isso de mudar o parâmetro de F para T
so q mesmo assim n ficou como eu queria. nesse exemplo q vc me deu ficou show
mas na minha aplicação não ficou.
Anexos
mFolha - Login.jpg

Campo editavel

07 Abr 2016 16:05

Outro modelo:

abs.
Anexos
RILLENO.png

Campo editavel

07 Abr 2016 16:10

Primeiro, ajustes os SIZES(tamanhos) dos GETS, estão diferentes um do outro, mantenha o padrão.
Se no teste funcionou, você esqueceu de alguma coisa que tem no teste e não incluiu nas FUNCOES.

Leia com calma... o Apressado, come crú. kkkkkkkkkkkkkkkkkkk

abs.
Postar uma resposta