Jump to content
Fivewin Brasil

Listbox transparent e Alterar apenas fonte de uma coluna


Wellington Vieira

Recommended Posts

Bom dia,

oBrushtelanota -> 'Carrega a imagem para fundo da dialog

1º - Tenho uma listbox dentro de uma DIALOG que esta preenchida com uma imagem ( define dialog nfeletronica title "" from 000,000 to 650,1020 pixel brush oBrushtelanota transparent ). Como posso fazer para deixar esta listbox transparent, de forma ser perceptivel a imagem carregada na dialog.

2º - Nesta listbox, tenho 07 colunas, eu gostaria de mudar a font ( Letra ) de apenas uma coluna ?

Link to comment
Share on other sites

Boa tarde Theotokos,

Eu já havia testado esta opção, mas não sei se fiz algo errado porque quando coloco a função como demonstrado neste exemplo que você citou a LISTBOX, fica realmente transparente, mas ela pega a imagem da minha WINDOW (Janela Principal) e não o fundo da minha DIALOG, onde esta a listbox.

Link to comment
Share on other sites

Algo assim?

// Placing bitmaps at standard ListBoxes in FiveWin
	#include "FiveWin.ch"
	//----------------------------------------------------------------------------//
	function Main()
	   local oDlg, oLbx, cItem := "One"
	   SET _3DLOOK ON
	   DEFINE DIALOG oDlg TITLE "Bitmaps in ListBoxes" ;
      FROM 5, 5 TO 20, 45 STYLE WS_POPUP BRUSH TBrush():New( "NULL" )
	   @ 0.5, 0.5 LISTBOX oLbx VAR cItem ;
      ITEMS { "One", "Two", "Three", "Four" } ;
      BITMAPS { "..\bitmaps\level1.bmp",;
                "..\bitmaps\level2.bmp",;
                "..\bitmaps\level3.bmp",;
                "..\bitmaps\level4.bmp" } ;
      SIZE 100, 100
	   // oLbx:nDlgCode = DLGC_WANTALLKEYS
   // oLbx:bKeyDown = { | nKey, nFlags | If( nKey == VK_RETURN,;
   //                                     MsgInfo( cItem ),), nil }
	   @ 0.5, 18 BUTTON "&Ok" ACTION oDlg:End()
	   ACTIVATE DIALOG oDlg CENTERED
	return nil
	//----------------------------------------------------------------------------//
Link to comment
Share on other sites

#include "FiveWin.ch"
#include "Customer.ch"
	#Define CLR_LGRAY        nRGB( 230, 230, 230 ) //-> Dark   - Opaco/Cinza/Cienza
#Define CLR_LGREEN       nRGB( 190, 215, 190 ) //-> Green  - Verde/Vierde
#Define CLR_AMARELO      nRGB( 255, 255, 000 ) //-> Yellow - Amarelo/Amarijo
//-> #Define CLR_BOMBOM       nRGB( 165,  42,  42 ) //-> Brown Light  - Marrom bombom
#Define CLR_BOMBOM       nRGB( 000, 000, 000 ) //-> Brown Light  - Preto(Black) 
#Define CLR_MARROM       nRGB( 135, 206, 235 ) //-> Brown Normal - Marrom Normal
#Define CLR_VERMELHO     nRGB( 255, 000, 000 ) //-> Red - Vermelho/Rojo
#Define CLR_GOLD1        nRGB( 255, 215, 000 ) //-> Gold1  - Ouro 1
#Define CLR_GOLD2        nRGB( 238, 201, 000 ) //-> Gold2  - Ouro 2
#Define CLR_GOLD3        nRGB( 205, 173, 000 ) //-> Gold3  - Ouro 3
#Define CLR_GOLD4        nRGB( 139, 117, 000 ) //-> Gold4  - Ouro 4
#Define CLR_LEMONCHIFFON nRGB( 255, 250, 205 ) //-> Lemon      - Limao
#Define CLR_AQUAMARINE   nRGB( 127, 255, 212 ) //-> Aquamarine - Agua Marinha
#Define CLR_ORANGE       nRGB( 255, 165, 000 ) //-> Orange     - Laranja
	static oWnd, oClients, oClient, oName
static cName
	//----------------------------------------------------------------------------//
	function Main()
	   local oBar
	   SET _3DLOOK ON
	   USE Customer ALIAS Clients
   USE Sales NEW
   SELECT Clients
	   DEFINE WINDOW oWnd TITLE "Reporting tools" MDI ;
      MENU BuildMenu() COLOR "N/W"
	   DEFINE BUTTONBAR oBar OF oWnd SIZE 60, 60 2007
	   DEFINE BUTTON OF oBar ACTION  BrwClients()  ;
      FILENAME "..\bitmaps\attach.bmp" PROMPT "&Clients..."
	   DEFINE BUTTON OF oBar ACTION MsgInfo( "Click" ) ;
      FILENAME "..\bitmaps\calendar.bmp" PROMPT "Calendar"
	   DEFINE BUTTON OF oBar ACTION  BrwClients()   ;
      FILENAME "..\bitmaps\people2.bmp" PROMPT "Clients"
	   DEFINE BUTTON OF oBar ACTION MsgInfo( "Click" )
	   SET MESSAGE OF oWnd TO "Testing the FiveWin Report Class" CENTERED
	   ACTIVATE WINDOW oWnd ;
      VALID MsgYesNo( "Do you want to end?" )
	return nil
	//----------------------------------------------------------------------------//
	function BuildMenu()
	   local oMenu
	   MENU oMenu
      MENUITEM "&DataBases"
      MENU
         MENUITEM "&Clients..." ACTION  BrwClients() ;
            MESSAGE "Clients management"
	         MENUITEM "&Report..." ACTION GenReport()
         SEPARATOR
         MENUITEM "&End" ACTION oWnd:End() ;
            MESSAGE "End this test"
	      ENDMENU
	      oMenu:AddMdi()              // Add standard MDI menu options
	   ENDMENU
	return oMenu
	//----------------------------------------------------------------------------//
	function BrwClients()
	   local oLbx, oIco, oBar
	   if oClients != nil
      return nil
   endif
	   DEFINE ICON oIco FILENAME "..\icons\customer.ico"
	   DEFINE WINDOW oClients TITLE "Clients management" ;
      MDICHILD ICON oIco
	   DEFINE BUTTONBAR oBar OF oClients
	   DEFINE BUTTON OF oBar ACTION ShowClient()
	   @ 2, 0 LISTBOX oLbx FIELDS OF oClients ;
      SIZE 500, 500 ;
      ON CHANGE ChangeClient()
	   oClients:SetControl( oLbx )
	   //-----------------------------------------------------------------------// 
   oLbx:nClrBackHead  := CLR_LGREEN  // Cor do Fundo do Cabecalho
   oLbx:nClrText      := CLR_BLACK   // Cor do Fundo as letras
   oLbx:nClrBackFocus := CLR_WHITE   // Cor do Cursor Em Cima do Ötem
   oLbx:nClrForeFocus := CLR_HRED    // Cor da letra da barra ativa
   oLbx:nClrForeHead  := CLR_BLACK   // Cor nos Headers - Cabecalhos
   // Cor no Pano de Fundo da Browse()
   oLbx:nClrPane      := { || IIF( ( oLbx:cAlias )->( OrdKeyNo() ) %2 == 0, ;
                              CLR_WHITE, CLR_WHITE ) }
	   oLbx:nColAct       := 4           // Onde o Cursor Vai Iniciar na coluna
   oLbx:nLineStyle    := 3           // Estilo das linhas nos dados da Browse 
   oLbx:lCellStyle    := .T.         // Somente pinta a c‚lula em que o cursor esta no momento
   // Justifica o Cabe‡alho: .F. = Esquerda .T. = Centro   
   oLbx:aJustify := { .T., .F., .F., .F., .F., .F., .F., .F., .F., .F., .F., ;
                           .F., .F., .F. } 
   oLbx:lMChange      := .F.         // Desabilita Mousemove - Movimentos do Mouse Congelam. 
   oLbx:SetFocus()                   // Refocus on The Browse - Ativa o Foco na ListBox(Browse)
   oLbx:Refresh()                    // Estabiliza o Browse/Listbox - Refresca os Dados. 
                                     // Pinta os Dados Novamente 
   //-----------------------------------------------------------------------//
	   ACTIVATE WINDOW oClients ;
      VALID( oClients := nil, .t. )        // We destroy the object
	return nil
	//----------------------------------------------------------------------------//
	function GenReport()
	   local oWnd, oIco
	   DEFINE ICON oIco FILENAME "..\icons\print.ico"
	   DEFINE WINDOW oWnd MDICHILD TITLE "Clients report" ;
      VSCROLL HSCROLL ICON oIco
	   ACTIVATE WINDOW oWnd
	return nil
	//----------------------------------------------------------------------------//
	function ShowClient()
	   local oIco
	   if oClient != nil
      return nil
   endif
	   DEFINE ICON oIco FILENAME "..\icons\Person.ico"
	   DEFINE DIALOG oClient RESOURCE "Client" ;
      ICON oIco
	   REDEFINE SAY ID 3 OF oClient   // To get the proper color
   REDEFINE SAY ID 4 OF oClient
   REDEFINE SAY ID 5 OF oClient
	   REDEFINE GET oName VAR cName ID ID_NAME OF oClient
	   REDEFINE BUTTON ID ID_NEXT OF oClient ACTION GoNext()
	   SELECT Sales     // We select Sales to properly initialize the Browse
	   REDEFINE LISTBOX FIELDS ID ID_SALES OF oClient
	   ACTIVATE DIALOG oClient CENTERED NOWAIT ;
      VALID ( oClient := nil, .t. )           // Destroy the object
	   SELECT Clients
	return nil
	//----------------------------------------------------------------------------//
	function ChangeClient()
	   if oClient != nil
      cName = AllTrim( Clients->Last ) + ", " + Clients->First
      oName:Refresh()
   endif
	return nil
	//----------------------------------------------------------------------------//
	function GoNext()
	   if oClients != nil
      oClients:oControl:GoDown()
   else
      SKIP
      if EoF()
         GO BOTTOM
      endif
   endif
	   ChangeClient()
	return nil
	//----------------------------------------------------------------------------//


 

Link to comment
Share on other sites

xBrowse:

#include "FiveWin.Ch"
#include "xbrowse.ch"
#include "hbcompat.ch"
	//----------------------------------------------------------------------------//
	Function Main()
	   local oRs, oDlg, oBrw, oCbx, oFont
   local lWildSeek   := .f.
   local nOpt        := 1
	   oRs         := GetRecSet()
   oRs:Sort    := oRs:Fields( 0 ):Name
	   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
	   DEFINE DIALOG oDlg SIZE 900,400 PIXEL ;
      TITLE FWVERSION ;
      FONT oFont
	   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS AUTOSORT ;
      CELL LINES NOBORDER
	   WITH OBJECT oBrw
      :Married:SetCheck()
      :bClrSel       := { || { CLR_BLACK,CLR_HGRAY } }
      :nStretchCol   := STRETCHCOL_WIDEST
      //
      :CreateFromCode()
   END
	   @ 10,10 COMBOBOX nOpt PROMPTS { "Starting With", "Containing" } ;
      SIZE 60,14 PIXEL OF oDlg  ;
      ON CHANGE ( oBrw:lSeekWild := ( nOpt == 2 ), ;
                  oBrw:Refresh(), oBrw:SetFocus() )
	   @ 10, 80 SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE 80,10 PIXEL OF oDlg ;
      COLOR CLR_RED,CLR_YELLOW
	   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oBrw:SetFocus(), .f. )
	   RELEASE FONT oFont
   oRs:Close()
   oRs:ActiveConnection:Close()
	Return nil
	//----------------------------------------------------------------------------//
	static function GetRecSet()
	   local oRs, oCn
   local cStr := "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + ;
                 "c:\fwh1701\samples\;Extended Properties=dBASE III;" + ;
                 "User ID=Admin;Password=;"
	   if ( oCn := FW_OpenAdoConnection( cStr ) ) == nil
      MsgStop( "Connection Fail" )
      QUIT
   elseif ( oRs := FW_OpenRecordSet( oCn, ;
      "SELECT FIRST,CITY,MARRIED,HIREDATE,SALARY FROM CUSTOMERS" ) ) == nil
      MsgStop( "CUSTOMERS can not be opened" )
      oCn:Close()
      QUIT
   endif
	return oRs
	//----------------------------------------------------------------------------//


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...