xBrowse and images - Flags - A simple example

xBrowse and images - Flags - A simple example

Postby Baxajaun » Thu Feb 09, 2017 10:13 am

Good morning,

here you are a simple simple of xBrowse and images.

Image

Code: Select all  Expand view

#include "fivewin.ch"


Function Main()
   CountryTable()
Return nil

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

Function CountryTable()

   local oDlgXls, oBrw, oFont
   local aArray:= {}
   
   aadd( aArray, { "", "AD", "ANDORRA" } )
   aadd( aArray, { "", "AT", "AUSTRIA" } )
   aadd( aArray, { "", "BE", "BELGICA" } )
   aadd( aArray, { "", "BG", "BULGARIA" } )
   aadd( aArray, { "", "CZ", "REPUBLICA CHECA" } )
   aadd( aArray, { "", "DE", "ALEMANIA" } )
   aadd( aArray, { "", "DK", "DINAMARCA" } )
   aadd( aArray, { "", "EE", "ESTONIA" } )
   aadd( aArray, { "", "ES", "ESPAÑA" } )
   aadd( aArray, { "", "FI", "FINLANDIA" } )
   aadd( aArray, { "", "FR", "FRANCIA" } )
   aadd( aArray, { "", "GR", "GRECIA" } )
   aadd( aArray, { "", "HR", "CROACIA" } )
   aadd( aArray, { "", "HU", "HUNGRIA" } )
   aadd( aArray, { "", "IE", "IRLANDA" } )
   aadd( aArray, { "", "IT", "ITALIA" } )
   aadd( aArray, { "", "LT", "LITUANIA" } )
   aadd( aArray, { "", "LU", "LUXEMBURGO" } )
   aadd( aArray, { "", "LV", "LETONIA" } )
   aadd( aArray, { "", "MT", "MALTA" } )
   aadd( aArray, { "", "NL", "HOLANDA" } )
   aadd( aArray, { "", "NO", "NORUEGA" } )
   aadd( aArray, { "", "PL", "POLONIA" } )
   aadd( aArray, { "", "PT", "PORTUGAL" } )
   aadd( aArray, { "", "RO", "RUMANIA" } )
   aadd( aArray, { "", "RS", "SERBIA" } )
   aadd( aArray, { "", "RU", "RUSIA" } )
   aadd( aArray, { "", "SE", "SUECIA" } )
   aadd( aArray, { "", "SI", "ESLOVENIA" } )
   aadd( aArray, { "", "SK", "ESLOVAQUIA" } )
   aadd( aArray, { "", "UA", "UCRANIA" } )
   aadd( aArray, { "", "UK", "REINO UNIDO" } )
   
   DEFINE FONT oFont NAME 'Arial' SIZE 0,-12 BOLD
   DEFINE DIALOG oDlgXls SIZE 300,600 PIXEL FONT oFont TITLE 'Tabla paises'  
     
   @ 0,0 XBROWSE oBrw OF oDlgXls columns {1,2,3} Array aArray sizes {100,50,200} HEADERS {"BANDERA","SIM","PAIS"} LINES CELL NOBORDER AUTOCOLS AUTOSORT
   
   oBrw:nMarqueeStyle              := 1
   oBrw:nRowHeight                 := 40
   
   WITH OBJECT oBrw
      :nRowDividerStyle = LINESTYLE_BLACK
      :nColDividerStyle = LINESTYLE_BLACK
      :nMarqueeStyle = MARQSTYLE_HIGHLROW
    END
   oBrw:aCols[ 1 ]:nEditType       := TYPE_IMAGE
   oBrw:aCols[ 1 ]:lBmpStretch     := .F.
   oBrw:aCols[ 1 ]:lBmpTransparent := .F.
   oBrw:aCols[ 1 ]:bStrImage       := {|oCol, oBrw| oBrw:aRow[ 2 ] }
   oBrw:aCols[ 1 ]:nDataBmpAlign   := AL_CENTER
   oBrw:aCols[ 1 ]:bAlphaLevel     := { | o | o:oBrw:aRow[ 3 ] }
     
   oDlgXls:oClient                    := oBrw
   oBrw:CreateFromCode()
     
   ACTIVATE DIALOG oDlgXls CENTERED ON INIT oDlgXls:Resize()
Return NIL

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


Source code and resource file at

https://bitbucket.org/fivetech/fivewin- ... /Flags.zip

It's a very simple simple.

Regards
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests