A vfp grid working with the web

Published on by Yousfi Benameur

Click on code to select [then copy] -click outside to deselect

   

this code builds a vfp grid working with web objects as images,html,...
the countries flags are linked to their web locations and transformed in image control pictureVal (as seen in my previous posts).
the power of grid dynamicFontbold does the job.
can rightclick on any row of the grid (any column) to fire a contextuel menu with some utilities as:
  -country selected informations
  -google map for this selected country
  -change grildlines
  -make html report of the grid
  -change fontsize
  -Summary help
  -change any column backcolor dynamically.
  can add other as needed...

all the data are gathered in a cursor in form.load (i may forget someones..to complete).
data are gathered from the free site http://flagpedia.net/   (can also download the free flags pack for local use..its preferable to avoid breaking url).
i used IE11 (cosmetised as vfp window) to show these informations.
*infortunatly google maps cannot work on the olecontrol browser (not supported) then i used the ie application.
internet of course must be connected and some fast.

[post 258]


Click on code to select [then copy] -click outside to deselect


*1* created on tuesday 30 of january 2018
*a grid working with the web and countries flags.
*read summary help in code

 Publi m.yrep
    m.yrep=Addbs(justpath(sys(16,1)))
    Set Defa To (yrep)

Public oform
oform=Newobject("ygrid_flags")
oform.Show
Read Events
Return
*
Define Class ygrid_flags As Form
  BorderStyle = 3
  Height = 595
  Width = 948
  ShowWindow = 2
  ShowTips = .T.
  AutoCenter = .T.
  Caption = "Form1"
  Name = "Form1"

  Add Object grid1 As Grid With ;
    FontName = "Tahoma", ;
    Height = 595, ;
    Left = 3, ;
    ScrollBars = 2, ;
    Top = 2, ;
    Width = 945, ;
    Name = "Grid1"

  Procedure showpicture
    Lparameters toImage, tcImage
    Try
      Local loRequest
      m.loRequest = Createobject('MsXml2.XmlHttp')
      m.loRequest.Open("GET",tcImage,.F.)
      m.loRequest.Send()
      If !Empty(m.loRequest.ResponseBody)
        toImage.PictureVal =m.loRequest.ResponseBody
        toImage.ToolTipText=tcImage
      Else
        toImage.Visible=.F.
      Endi
      m.loRequest=Null
    Catch
    Endtry
    Retu
  Endproc

  Procedure my
    *Lparameters nButton, nShift, nXCoord, nYCoord
    *--- aevent create an array laEvents
    Aevents( myArray, 0)
    *--- reference the calling object
    loObject = myArray[1]
    DoDefault()
    Sele ycurs
    Messagebox(Allt(FullName)+Chr(13)+Allt(capital),0+32+4096,1200)

    Local m.lcUrl
    m.lcUrl="http://flagpedia.net/"+Allt(country)
    Local loRequest
    m.loRequest = Createobject('MsXml2.XmlHttp')
    m.loRequest.Open("GET",lcUrl,.F.)
    m.loRequest.Send()
    m.xtext=m.loRequest.ResponseBody
    m.loRequest=Null

    Local m.myvar,m.delim
    m.delim=[<h2 class="next-element-toggle" onclick="ga('send', 'event', 'button', 'click', 'country-toggle-languages');">Name of country in other languages</h2>]
    m.myvar=Strextract(m.xtext,'<article id="content">',m.delim)
    m.myvar=Strtran(m.myvar,'="//','="http://')
    m.myvar=Strtran(m.myvar,"a href","aa href")  &&disable all links

    If !Empty(m.myvar)
      TEXT to m.myvar textmerge noshow
			<meta charset="utf-8" />
			  <meta http-equiv="X-UA-Compatible" content="IE=edge">
			<link rel="stylesheet" type="text/css" href="http://flags.fmcdn.net/style/css-ed8db08fccc5.css?1489679280" />
			<style>body{padding:10px;}</style>
			<<m.myvar>>
      ENDTEXT

      Local apie
      apie=Newobject("internetexplorer.application")
      With apie
        .Navigate("about:blank")
        .Toolbar=0
        .menubar=0
        .StatusBar=0
        .Width=800
        .Height=750
        Inke(1)
        .Document.Open()
        .Document.Write(m.myvar)
        .Document.Close()
        Inke(1)
        bringWindowToTop(.HWnd)

        *Constants for SendMessage second parameter
        #Define WM_GETICON 0x7F
        #Define WM_SETICON 0x80
        *Constants for SendMessage third parameter
        #Define ICON_SMALL 0
        #Define ICON_BIG 1
        Local lnIcon
        lnIcon = ExtractIcon (0,Home(1)+"vfp9.exe",0)
        SendMessage(.HWnd, WM_SETICON, ICON_SMALL, lnIcon)
        setWindowText(.HWnd,"Country informations of "+Allt(country)+" - ["+Allt(FullName)+"]")
        .Visible=.T.
      Endwith
    Else
      Messagebox("not found!",16+4096,"",1300)
    Endi

  Endproc

  Procedure ymap
    Sele ycurs
    If Empty(country)
      Return .F.
    Endi
    Local apie
    apie=Newobject("internetexplorer.application")
    With apie
      .Navigate("https://maps.google.com/maps?&z=12&t=k&q=loc:"+Allt(country))
      .menubar=0
      .Toolbar=0
      .StatusBar=0
      .Resizable=0
      bringWindowToTop(.HWnd)      
      inke(3)
       .Visible=.T.
      *Constants for SendMessage second parameter
        #Define WM_GETICON 0x7F
        #Define WM_SETICON 0x80
        *Constants for SendMessage third parameter
        #Define ICON_SMALL 0
        #Define ICON_BIG 1
        Local lnIcon
        lnIcon = ExtractIcon (0,Home(1)+"vfp9.exe",0)
        SendMessage(.HWnd, WM_SETICON, ICON_SMALL, lnIcon)
        setWindowText(.HWnd,"Country : "+Allt(country) )
     
    Endwith
    *!*	http://maps.google.com/maps?z=12&t=k&q=loc:algeria
    *!*	    z is the zoom level (1-20)
    *!*	    t is the map type ("m" map, "k" satellite, "h" hybrid, "p" terrain, "e" GoogleEarth)
    *!*	    q is the search query, if it is prefixed by loc: then google assumes it is a lat lon separated by a +
  Endproc

  Procedure my0
    Define Popup raccourci SHORTCUT Relative From Mrow(),Mcol()
    Define Bar 1 Of raccourci Prompt "1. informations"
    Define Bar 2 Of raccourci Prompt "2. google map"
    Define Bar 3 Of raccourci Prompt "3. Cycle in gridlines"
    Define Bar 4 Of raccourci Prompt "4. Export to html"
    Define Bar 5 Of raccourci Prompt "5. Fontsize"
    Define Bar 6 Of raccourci Prompt "6. Summary help"
    Define Bar 7 Of raccourci Prompt "7. Change any column backcolor"

    On Selection Bar 1 Of raccourci _Screen.ActiveForm.my
    On Selection Bar 2 Of raccourci _Screen.ActiveForm.ymap
    On Selection Bar 3 Of raccourci _Screen.ActiveForm.ygridlines
    On Selection Bar 4 Of raccourci _Screen.ActiveForm.yrhtml
    On Selection Bar 5 Of raccourci _Screen.ActiveForm.yfsize
    On Selection Bar 6 Of raccourci _Screen.ActiveForm.yhelp()
    On Selection Bar 7 Of raccourci _Screen.ActiveForm.ycolbkg()
    Activate Popup raccourci
  Endproc

  procedure yhelp
  local m.myvar
  text to m.myvar pretext 7 noshow
  this code builds a vfp grid working with web objects as images,html,...
the countries flags are linked to their web locations and transformed in image control pictureVal (as seen in my previous posts).
the power of grid dynamicFontbold does the job.
can rightclick on any row of the grid (any column) to fire a contextuel menu with some utilities as:
  -country selected informations
  -google map for this selected country
  -change grildlines
  -make html report of the grid
  -change fontsize
  -summary help
  -can change any column (2-7) backcolor
  can add other as needed...
 
all the data are gathered in a cursor in form.load (i may forget someones..to complete).
data are gathered from the free site http://flagpedia.net/   (can also download the free flags pack for local use..its preferable to avoid breaking url).
i used IE11 (cosmetised as vfp window) to show these informations.
*infortunatly google maps cannot work on the olecontrol browser (not supported) then i used the ie application.
*internet of course must be connected and some fast.
endtext

local oshell
oshell = Newobject('WScript.Shell')
oshell.Popup(m.myvar,0, ' Summary help', 0+32+4096)
oshell=null
endproc

 Procedure ygridlines
    With Thisform.grid1
      Try
        .GridLines=.GridLines+1
      Catch
        .GridLines=0
      Endtry
    Endwith
  Endproc

  Procedure yrhtml
    Sele ycurs
    If Reccount()=0
      Return .F.
    Endi
    Sele  country ,FullName,capital,phone ,Code ,continent From ycurs Into Cursor ocurs
    Do (_Genhtml) With (m.yrep+'yreporthtml.html'),'ocurs',4  &&simple,no css here to beautify html table
    Use In Select("ocurs")

    Sele ycurs
    Inke(3)
    Local apie
    apie=Newobject("internetexplorer.application")
    With apie
      .Navigate(m.yrep+"yreporthtml.html")
      .menubar=0
      .Toolbar=0
      .StatusBar=0
      .Width=1024
      .Height=600
      bringWindowToTop(.HWnd)
      Inke(1)
      Rand(-1)
      Local m.nr
      m.nr= Int(3*Rand()+1)
      Do Case
        Case m.nr=1
          .Document.body.bgcolor=Rgb(254,250,197)
        Case m.nr=2
          .Document.body.bgcolor=Rgb(206,255,255)
        Case m.nr=3
          .Document.body.bgcolor=Rgb(255,230,217)
      Endcase

      *Constants for SendMessage second parameter
      #Define WM_GETICON 0x7F
      #Define WM_SETICON 0x80
      *Constants for SendMessage third parameter
      #Define ICON_SMALL 0
      #Define ICON_BIG 1
      Local lnIcon
      lnIcon = ExtractIcon (0,Home(1)+"vfp9.exe",0)
      SendMessage(.HWnd, WM_SETICON, ICON_SMALL, lnIcon)
      setWindowText(.HWnd,"Html Countries informations  ")

      .Visible=.T.
    Endwith
  Endproc


  Procedure yfsize
    Local m.x
    m.x=Int(Val(Inputbox("Fontsize to set","",Trans(Thisform.grid1.FontSize+1))) )
    If m.x>=8
      With Thisform.grid1
        For i=2 To .ColumnCount
          .Columns(i).FontSize=m.x
        Endfor
        .Refresh
      Endwith
    Endi
  Endproc
  
 procedure ycolBkg  && change any comlumn backcolor (2-7)
   local m.x
   m.x=inputbox("change backcolor to Column N° (2-7)","","5")
   if !inlist(m.x,"2","3","4","5","6","7")
   return .f.
   endi
    local m.xcolor
    m.xcolor=getcolor()
    if m.xcolor=-1
    return .f.
    endi
    with eval("thisform.grid1.column"+m.x)
    .dynamicBackcolor=eval('"'+trans(m.xcolor)+'"')
    .refresh
    endwith
    wait clea       
  endproc

  Procedure Resize
    Local m.w
    m.w=Thisform.Width
    With Thisform.grid1
      .column1.Width=0.035*w
      .column2.Width=0.3*w
      .column3.Width=0.3*w
      .column4.Width=0.1*w
      .column5.Width=0.1*w
      .column6.Width=0.04*w
      .column7.Width=0.08*w
    Endwith
  Endproc

  Procedure Destroy
    Close Data All
    Clea Dlls
    Clea Events
  Endproc

  Procedure Load
    Close Data All
    Clea Dlls
    Declare Integer BringWindowToTop In user32 Integer HWnd
    Declare Integer SetWindowText In user32;
      INTEGER HWnd,;
      STRING  lpString
    Declare Integer ExtractIcon In shell32 Integer hInst, String  lpszExeFileName, Integer lpiIcon
    Declare Integer SendMessage In user32 Integer HWnd, Integer Msg, Integer wParam, Integer Lparam

    _Screen.WindowState=1
    Close Data All
    Set Memowidth To 8192
    Local m.myv
    TEXT to m.myv pretext 7 noshow
		http://img.freeflagicons.com/preview/afghanistan.png ,Afghanistan ,Islamic Republic of Afghanistan ,Kabul ,+93 ,.af ,Asia
		http://img.freeflagicons.com/preview/aland_islands.png, Islands ,Aland Islands ,Aland Islands ,Mariehamn ,+358 ,.ax ,Europe
		http://img.freeflagicons.com/preview/albania.png ,Albania ,Republic of Albania ,Tirana ,+355 ,.al ,Europe
		http://img.freeflagicons.com/preview/algeria.png ,Algeria ,People's Democratic Republic of Algeria ,Algiers ,+213 ,.dz ,Africa
		http://img.freeflagicons.com/preview/american_samoa.png ,Samoa ,American Samoa ,American Samoa ,Pago Pago ,+1-684 ,.as ,Oceania
		http://img.freeflagicons.com/preview/andorra.png ,Andorra ,Principality of Andorra ,Andorra la Vella ,+376 ,.ad ,Europe
		http://img.freeflagicons.com/preview/angola.png ,Angola ,Republic of Angola ,Luanda ,+244 ,.ao ,Africa
		http://img.freeflagicons.com/preview/anguilla.png ,Anguilla ,Anguilla ,The Valley ,+1-264 ,.ai ,America
		http://img.freeflagicons.com/preview/antarctica.png ,Antarctica ,Antarctica ,,— ,.aq ,Antarctic
		http://img.freeflagicons.com/preview/antigua_and_barbuda.png  ,Antigua and Barbuda ,Antigua and Barbuda ,Saint John's ,+1-268 ,.ag ,America
		http://img.freeflagicons.com/preview/argentina.png ,Argentina ,Argentine Republic ,Buenos Aires ,+54 ,.ar ,America
		http://img.freeflagicons.com/preview/armenia.png ,Armenia ,Republic of Armenia ,Yerevan ,+374 ,.am ,Asia
		http://img.freeflagicons.com/preview/aruba.png ,Aruba ,Aruba ,Oranjestad ,+297 ,.aw ,America
		http://img.freeflagicons.com/preview/australia.png ,Australia ,Commonwealth of Australia ,Canberra ,+61 ,.au ,Oceania
		http://img.freeflagicons.com/preview/austria.png ,Austria ,Republic of Austria ,Vienna ,+43 ,.at ,Europe
		http://img.freeflagicons.com/preview/azerbaijan.png ,Azerbaijan ,Republic of Azerbaijan ,Baku ,+994 ,.az ,Asia
		http://img.freeflagicons.com/preview/bahamas.png ,Bahamas ,Commonwealth of the Bahamas ,Nassau ,+1-242 ,.bs ,America
		http://img.freeflagicons.com/preview/bahrain.png ,Bahrain ,Kingdom of Bahrain ,Manama ,+973 ,.bx ,Asia
		http://img.freeflagicons.com/preview/bangladesh.png ,Bangladesh ,People's Republic of Bangladesh ,Dhaka ,+880 ,.bd ,Asia
		http://img.freeflagicons.com/preview/barbados.png ,Barbados ,Barbados ,Bridgetown ,+1 ,.bb ,America
		http://img.freeflagicons.com/preview/belarus.png ,Belarus ,Republic of Belarus ,Minsk ,+375 ,.by ,Europe
		http://img.freeflagicons.com/preview/belgium.png ,Belgium ,Kingdom of Belgium ,Brussels ,+32 ,.be ,Europe
		http://img.freeflagicons.com/preview/belize.png ,Belize ,Belize ,Belmopan ,+501 ,.bz ,America
		http://img.freeflagicons.com/preview/benin.png ,Benin ,Republic of Benin ,Porto-Novo ,+229 ,.bj ,Africa
		http://img.freeflagicons.com/preview/bermuda.png ,Bermuda ,Somers Isles ,Hamilton ,+1-441 ,.bm ,America
		http://img.freeflagicons.com/preview/bhutan.png ,Bhutan ,Kingdom of Bhutan ,Thimphu ,+975 ,.bt ,Asia
		http://img.freeflagicons.com/preview/bolivia.png ,Bolivia ,Plurinational State of Bolivia ,Sucre ,+591 ,.bo ,America
		http://img.freeflagicons.com/preview/bonaire.png ,Bonaire ,Caribbean Netherlands ,Kralendijk ,+599 ,.nl ,America
		http://img.freeflagicons.com/preview/bosnia_and_herzegovina.png , Bosnia and Herzegovina ,Bosnia and Herzegovina ,Sarajevo ,+387 ,.ba ,Europe
		http://img.freeflagicons.com/preview/botswana.png ,Botswana ,Republic of Botswana ,Gaborone ,+267 ,.bw ,Africa
		http://img.freeflagicons.com/preview/bouvet_island.png ,Island ,Bouvet Island ,Bouvet Island ,,— ,.bv ,America
		http://img.freeflagicons.com/preview/brazil.png ,Brazil ,Federative Republic of Brazil ,Brasília ,+55 ,.br ,America
		http://img.freeflagicons.com/preview/british_indian_ocean_territory.png, Indian Ocean Territory ,British Indian Ocean Territory ,British Indian Ocean Territory ,Diego Garcia ,+246 ,.io ,Asia
		http://img.freeflagicons.com/preview/brunei.png ,Brunei ,State of Brunei, the Abode of Peace ,Bandar Seri Begawan ,+673 ,.bn ,Asia
		http://img.freeflagicons.com/preview/bulgaria.png ,Bulgaria ,Republic of Bulgaria ,Sofia ,+359 ,.bg ,Europe
		http://img.freeflagicons.com/preview/burkina_faso.png ,Burkina Faso ,Burkina Faso ,Ouagadougou ,+226 ,.bf ,Africa
		http://img.freeflagicons.com/preview/burundi.png ,Burundi ,Republic of Burundi ,Bujumbura ,+257 ,.bi ,Africa
		http://img.freeflagicons.com/preview/cambodia.png ,Cambodia ,Kingdom of Cambodia ,Phnom Penh ,+855 ,.kh ,Asia
		http://img.freeflagicons.com/preview/cameroon.png ,Cameroon ,Republic of Cameroon ,Yaounde ,+237 ,.cm ,Africa
		http://img.freeflagicons.com/preview/canada.png ,Canada ,Canada ,Ottawa ,+1 ,.ca ,America
		http://img.freeflagicons.com/preview/cape_verde.png  ,Cape Verde ,Republic of Cape Verde ,Praia ,+238 ,.cv ,Africa
		http://img.freeflagicons.com/preview/cayman_islands.png  ,Cayman Islands ,Cayman Islands ,George Town ,+1-345 ,.ky ,America
		http://img.freeflagicons.com/preview/central_african_republic.png, African Republic ,Central African Republic ,Central African Republic ,Bangui ,+236 ,.cf ,Africa
		http://img.freeflagicons.com/preview/chad.png ,Chad ,Republic of Chad ,N'Djamena ,+235 ,.td ,Africa
		http://img.freeflagicons.com/preview/chile.png ,Chile ,Republic of Chile ,Santiago ,+56 ,.cl ,America
		http://img.freeflagicons.com/preview/china.png ,China ,People's Republic of China ,Beijing ,+86 ,.cn ,Asia
		http://img.freeflagicons.com/preview/christmas_island.png  ,Christmas Island ,Christmas Island ,Flying Fish Cove ,+61 ,.cx ,Oceania
		http://img.freeflagicons.com/preview/cocos_islands.png  ,Cocos Islands ,Territory of the Cocos (Keeling) Islands ,West Island ,+61 891 ,.cc ,Oceania
		http://img.freeflagicons.com/preview/colombia.png ,Colombia ,Republic of Colombia ,Bogota ,+57 ,.co ,America
		http://img.freeflagicons.com/preview/comoros.png ,Comoros ,Union of the Comoros ,Moroni ,+269 ,.km ,Africa
		http://img.freeflagicons.com/preview/cook_islands.png ,Cook Islands ,Cook Islands ,Avarua ,+682 ,.ck ,Oceania
		http://img.freeflagicons.com/preview/costa_rica.png  ,Costa Rica ,Republic of Costa Rica ,San Jose ,+506 ,.cr ,America
		http://img.freeflagicons.com/preview/cote_d_Ivoire.png  ,Cote d'Ivoire ,Republic of Cote d'Ivoire ,Yamoussoukro ,+225 ,.ci ,Africa
		http://img.freeflagicons.com/preview/croatia.png ,Croatia ,Republic of Croatia ,Zagreb ,+385 ,.hr ,Europe
		http://img.freeflagicons.com/preview/cuba.png ,Cuba ,Republic of Cuba ,Havana ,+53 ,.cu ,America
		http://img.freeflagicons.com/preview/curacao.png ,Curacao ,Country of Curacao ,Willemstad ,+599-9 ,.cw ,America
		http://img.freeflagicons.com/preview/cyprus.png ,Cyprus ,Republic of Cyprus ,Nicosia ,+357 ,.cy ,Europe
		http://img.freeflagicons.com/preview/czech_republic.png ,Czech Republic ,Czech Republic ,Prague ,+420 ,.cz ,Europe
		http://img.freeflagicons.com/preview/democratic_republic_of_the_congo.png  ,Democratic Republic of the Congo ,Democratic Republic of the Congo ,Kinshasa ,+243 ,.cd ,Africa
		http://img.freeflagicons.com/preview/denmark.png ,Denmark ,Denmark ,Copenhagen ,+45 ,.dk ,Europe
		http://img.freeflagicons.com/preview/djibouti.png ,Djibouti ,Republic of Djibouti ,Djibouti ,+253 ,.dj ,Africa
		http://img.freeflagicons.com/preview/dominica.png ,Dominica ,Commonwealth of Dominica ,Roseau ,+1-767 ,.dm ,America
		http://img.freeflagicons.com/preview/dominican_republic.png ,Dominican Republic ,Dominican Republic ,Santo Domingo ,+1-809, +1-829, +1-849 ,.do ,America
		http://img.freeflagicons.com/preview/east_timor.png ,Timor East Timor ,Democratic Republic of Timor-Leste ,Dili ,+670 ,.tl ,Asia
		http://img.freeflagicons.com/preview/ecuador.png ,Ecuador ,Republic of Ecuador ,Quito ,+593 ,.ec ,America
		http://img.freeflagicons.com/preview/egypt.png ,Egypt ,Arab Republic of Egypt ,Cairo ,+20 ,.eg ,Africa
		http://img.freeflagicons.com/preview/el_salvador.png  ,El Salvador ,Republic of El Salvador ,San Salvador ,+503 ,.sv ,America
		http://img.freeflagicons.com/preview/england.png ,England ,England ,London ,+44 ,.uk ,Europe
		http://img.freeflagicons.com/preview/equatorial_guinea.png ,Equatorial Guinea ,Republic of Equatorial Guinea ,Malabo ,+240 ,.gq ,Africa
		http://img.freeflagicons.com/preview/eritrea.png ,Eritrea ,State of Eritrea ,Asmara ,+291 ,.er ,Africa
		http://img.freeflagicons.com/preview/estonia.png ,Estonia ,Republic of Estonia ,Tallinn ,+372 ,.ee ,Europe
		http://img.freeflagicons.com/preview/ethiopia.png ,Ethiopia ,Federal Democratic Republic of Ethiopia ,Addis Ababa ,+251 ,.et ,Africa
		http://img.freeflagicons.com/preview/european_union.png  ,European Union ,European Union ,,— ,.eu ,Europe
		http://img.freeflagicons.com/preview/falkland_islands.png  ,Falkland Islands ,Falkland Islands ,Stanley ,+500 ,.fk ,America
		http://img.freeflagicons.com/preview/faroe_islands.png ,Faroe Islands ,Faroe Islands ,Torshavn ,+298 ,.fo ,Europe
		http://img.freeflagicons.com/preview/fiji.png ,Fiji ,Republic of Fiji ,Suva ,+697 ,.fj ,Oceania
		http://img.freeflagicons.com/preview/finland.png ,Finland ,Republic of Finland ,Helsinki ,+358 ,.fi ,Europe
		http://img.freeflagicons.com/preview/france.png ,France ,French Republic ,Paris ,+33 ,.fr ,Europe
		http://img.freeflagicons.com/preview/french_guiana.png  ,French Guiana ,French Guiana ,Cayenne ,+594 ,.gf ,America
		http://img.freeflagicons.com/preview/french_polynesia.png  ,French Polynesia ,French Polynesia ,Papeete ,+689 ,.pf ,Oceania
		http://img.freeflagicons.com/preview/french_southern_territories.png  ,French Southern and Antarctic Lands ,Territory of the French Southern and Antarctic Lands ,Port-aux-Francais ,— ,.tf ,Antarctic
		http://img.freeflagicons.com/preview/gabon.png ,Gabon ,Gabonese Republic ,Libreville ,+241 ,.ga ,Africa
		http://img.freeflagicons.com/preview/gambia.png ,Gambia ,Republic of The Gambia ,Banjul ,+220 ,.gm ,Africa
		http://img.freeflagicons.com/preview/georgia.png ,Georgia ,Georgia ,Tbilisi ,+995 ,.ge ,Asia
		http://img.freeflagicons.com/preview/germany.png ,Germany ,Federal Republic of Germany ,Berlin ,+49 ,.de ,Europe
		http://img.freeflagicons.com/preview/ghana.png ,Ghana ,Republic of Ghana ,Accra ,+233 ,.gh ,Africa
		http://img.freeflagicons.com/preview/gibraltar.png ,Gibraltar ,Gibraltar ,Gibraltar ,+350 ,.gi ,Europe
		http://img.freeflagicons.com/preview/greece.png ,Greece ,Hellenic Republic ,Athens ,+30 ,.gr ,Europe
		http://img.freeflagicons.com/preview/greenland.png ,Greenland ,Greenland ,Nuuk ,+299 ,.gl ,Europe
		http://img.freeflagicons.com/preview/grenada.png ,Grenada ,Grenada ,St. George's ,+1-473 ,.gd ,America
		http://img.freeflagicons.com/preview/guadeloupe.png ,Guadeloupe ,Guadeloupe ,Basse-Terre ,— ,— ,America
		http://img.freeflagicons.com/preview/guam.png ,Guam ,Guam ,Hagatna ,+1-671 ,.gu ,Asia
		http://img.freeflagicons.com/preview/guatemala.png ,Guatemala ,Republic of Guatemala ,Guatemala City ,+502 ,.gt ,America
		http://img.freeflagicons.com/preview/guernsey.png ,Guernsey ,Bailiwick of Guernsey ,Saint Peter Port ,+44-1481 ,.gg ,Europe
		http://img.freeflagicons.com/preview/guinea.png ,Guinea ,Republic of Guinea ,Conakry ,+224 ,.gn ,Africa
		http://img.freeflagicons.com/preview/guinea_bissau.png ,Guinea-Bissau ,Republic of Guinea-Bissau ,Bissau ,+245 ,.gw ,Africa
		http://img.freeflagicons.com/preview/guyana.png ,Guyana ,Co-operative Republic of Guyana ,Georgetown ,+592 ,.gy ,America
		http://img.freeflagicons.com/preview/haiti.png ,Haiti ,Republic of Haiti ,Port-au-Prince ,+509 ,.ht ,America
		http://img.freeflagicons.com/preview/heard_island_and_mcdonald_islands.png ,Heard Island ,Heard Island and McDonald Islands ,,— ,.hm ,Antarctic
		http://img.freeflagicons.com/preview/honduras.png ,Honduras ,Republic of Honduras ,Tegucigalpa ,+504 ,.hn ,America
		http://img.freeflagicons.com/preview/hong_kong.png  ,Hong Kong ,Hong Kong ,Hong Kong ,+852 ,.hk ,Asia
		http://img.freeflagicons.com/preview/hungary.png ,Hungary ,Hungary ,Budapest ,+36 ,.hu ,Europe
		http://img.freeflagicons.com/preview/iceland.png ,Iceland ,Republic of Iceland ,Reykjavík ,+354 ,.is ,Europe
		http://img.freeflagicons.com/preview/india.png ,India ,Republic of India ,New Delhi ,+91 ,.in ,Asia
		http://img.freeflagicons.com/preview/indonesia.png ,Indonesia ,Republic of Indonesia ,Jakarta ,+62 ,.id ,Asia
		http://img.freeflagicons.com/preview/iran.png ,Iran ,Islamic Republic of Iran ,Tehran ,+98 ,.ir ,Asia
		http://img.freeflagicons.com/preview/iraq.png ,Iraq ,Republic of Iraq ,Baghdad ,+964 ,.iq ,Asia
		http://img.freeflagicons.com/preview/ireland.png ,Ireland ,Republic of Ireland ,Dublin ,+353 ,.ie ,Europe
		http://img.freeflagicons.com/preview/isle_of_man.png  ,Isle of Man ,Isle of Man ,Douglas ,+44-1624 ,.im ,Europe
		http://img.freeflagicons.com/preview/italy.png ,Italy ,Italian Republic ,Rome ,+39 ,.it ,Europe
		http://img.freeflagicons.com/preview/jamaica.png ,Jamaica ,Jamaica ,Kingston ,+1-876 ,.jm ,America
		http://img.freeflagicons.com/preview/japan.png ,Japan ,Japan ,Tokyo ,+81 ,.jp ,Asia
		http://img.freeflagicons.com/preview/jersey.png ,Jersey ,Bailiwick of Jersey ,Saint Helier ,+44 ,.je ,Europe
		http://img.freeflagicons.com/preview/jordan.png ,Jordan ,Hashemite Kingdom of Jordan ,Amman ,+962 ,.jo ,Asia
		http://img.freeflagicons.com/preview/kazakhstan.png ,Kazakhstan ,Republic of Kazakhstan ,Astana ,+7 ,.kz ,Asia
		http://img.freeflagicons.com/preview/kenya.png ,Kenya ,Republic of Kenya ,Nairobi ,+254 ,.ke ,Africa
		http://img.freeflagicons.com/preview/kiribati.png ,Kiribati ,Republic of Kiribati ,Tarawa ,+686 ,.ki ,Oceania
		http://img.freeflagicons.com/preview/kosovo.png ,Kosovo ,Kosovo ,Pristina ,+381 ,— ,Europe
		http://img.freeflagicons.com/preview/kuwait.png ,Kuwait ,State of Kuwait ,Kuwait City ,+965 ,.kw ,Asia
		http://img.freeflagicons.com/preview/kyrgyzstan.png ,Kyrgyzstan ,Kyrgyz Republic ,Bishkek ,+996 ,.kg ,Asia
		http://img.freeflagicons.com/preview/laos.png ,Laos ,Lao People's Democratic Republic ,Vientiane ,+856 ,.la ,Asia
		http://img.freeflagicons.com/preview/latvia.png ,Latvia ,Republic of Latvia ,Riga ,+371 ,.lv ,Europe
		http://img.freeflagicons.com/preview/lebanon.png ,Lebanon ,The Republic of Lebanon ,Beirut ,+961 ,.lb ,Asia
		http://img.freeflagicons.com/preview/lesotho.png ,Lesotho ,Kingdom of Lesotho ,Maseru ,+266 ,.ls ,Africa
		http://img.freeflagicons.com/preview/liberia.png ,Liberia ,Republic of Liberia ,Monrovia ,+231 ,.lr ,Africa
		http://img.freeflagicons.com/preview/libya.png ,Libya ,Libya ,Tripoli ,+218 ,.ly ,Africa
		http://img.freeflagicons.com/preview/liechtenstein.png ,Liechtenstein ,Principality of Liechtenstein ,Vaduz ,+423 ,.li ,Europe
		http://img.freeflagicons.com/preview/lithuania.png ,Lithuania ,Republic of Lithuania ,Vilnius ,+370 ,.lt ,Europe
		http://img.freeflagicons.com/preview/luxembourg.png ,Luxembourg ,Grand Duchy of Luxembourg ,Luxembourg ,+352 ,.lu ,Europe
		http://img.freeflagicons.com/preview/macao.png ,Macao ,Macao Special Administrative Region ,,+853 ,.mo ,Asia
		http://img.freeflagicons.com/preview/macedonia.png ,Macedonia ,Republic of Macedonia ,Skopje ,+389 ,.mk ,Europe
		http://img.freeflagicons.com/preview/madagascar.png ,Madagascar ,Republic of Madagascar ,Antananarivo ,+261 ,.mg ,Africa
		http://img.freeflagicons.com/preview/malawi.png ,Malawi ,Republic of Malawi ,Lilongwe ,+265 ,.mw ,Africa
		http://img.freeflagicons.com/preview/malaysia.png ,Malaysia ,Malaysia ,Kuala Lumpur ,+60 ,.my ,Asia
		http://img.freeflagicons.com/preview/maldives.png ,Maldives ,Republic of Maldives ,Male ,+960 ,.mv ,Asia
		http://img.freeflagicons.com/preview/mali.png ,Mali ,Republic of Mali ,Bamako ,+223 ,.ml ,Africa
		http://img.freeflagicons.com/preview/malta.png ,Malta ,Republic of Malta ,Valletta ,+356 ,.mt ,Europe
		http://img.freeflagicons.com/preview/marshall_islands.png  ,Marshall Islands ,Republic of the Marshall Islands ,Majuro ,+692 ,.mh ,Oceania
		http://img.freeflagicons.com/preview/martinique.png ,Martinique ,Martinique ,Fort-de-France ,— ,— ,America
		http://img.freeflagicons.com/preview/mauritania.png ,Mauritania ,Islamic Republic of Mauritania ,Nouakchott ,+222 ,.mr ,Africa
		http://img.freeflagicons.com/preview/mauritius.png ,Mauritius ,Republic of Mauritius ,Port Louis ,+230 ,.mu ,Africa
		http://img.freeflagicons.com/preview/mayotte.png ,Mayotte ,Department of Mayotte ,Mamoudzou ,+262 ,.yt ,Africa
		http://img.freeflagicons.com/preview/mexico.png ,Mexico ,United Mexican States ,Mexico City ,+52 ,.mx ,America
		http://img.freeflagicons.com/preview/micronesia.png ,Micronesia ,Federated States of Micronesia ,Palikir ,+691 ,.fm ,Oceania
		http://img.freeflagicons.com/preview/moldova.png ,Moldova ,Republic of Moldova ,Kishinev ,+373 ,.md ,Europe
		http://img.freeflagicons.com/preview/monaco.png ,Monaco ,Principality of Monaco ,Monte Carlo ,+377 ,.mc ,Europe
		http://img.freeflagicons.com/preview/mongolia.png ,Mongolia ,Mongolia ,Ulan Bator ,+976 ,.mn ,Asia
		http://img.freeflagicons.com/preview/montenegro.png ,Montenegro ,Montenegro ,Podgorica ,+382 ,.me ,Europe
		http://img.freeflagicons.com/preview/montserrat.png ,Montserrat ,Montserrat ,Plymouth ,+1-664 ,.ms ,America
		http://img.freeflagicons.com/preview/morocco.png ,Morocco ,Kingdom of Morocco ,Rabat ,+212 ,.ma ,Africa
		http://img.freeflagicons.com/preview/mozambique.png ,Mozambique ,Republic of Mozambique ,Maputo ,+258 ,.mz ,Africa
		http://img.freeflagicons.com/preview/myanmar.png ,Myanmar ,Republic of the Union of Myanmar ,Naypyidaw ,+95 ,.mm ,Asia
		http://img.freeflagicons.com/preview/namibia.png ,Namibia ,Republic of Namibia ,Windhoek ,+264 ,.na ,Africa
		http://img.freeflagicons.com/preview/nauru.png ,Nauru ,Republic of Nauru ,Yaren ,+674 ,.nr ,Oceania
		http://img.freeflagicons.com/preview/nepal.png ,Nepal ,Federal Democratic Republic of Nepal ,Kathmandu ,+977 ,.np ,Asia
		http://img.freeflagicons.com/preview/netherlands.png ,Netherlands ,Netherlands ,Amsterdam ,+31 ,.nl ,Europe
		http://img.freeflagicons.com/preview/new_caledonia.png  ,New Caledonia ,New Caledonia ,Noumea ,+687 ,.nc ,Oceania
		http://img.freeflagicons.com/preview/new_zealand.png  ,New Zealand ,New Zealand ,Wellington ,+64 ,.nz ,Oceania
		http://img.freeflagicons.com/preview/nicaragua.png ,Nicaragua ,Republic of Nicaragua ,Managua ,+505 ,.ni ,America
		http://img.freeflagicons.com/preview/niger.png ,Niger ,Republic of Niger ,Niamey ,+227 ,.ne ,Africa
		http://img.freeflagicons.com/preview/nigeria.png ,Nigeria ,Federal Republic of Nigeria ,Abuja ,+234 ,.ng ,Africa
		http://img.freeflagicons.com/preview/niue.png ,Niue ,Niue ,Alofi ,+683 ,.nu ,Oceania
		http://img.freeflagicons.com/preview/norfolk_island.png  ,Norfolk Island ,Territory of Norfolk Island ,Kingston ,+672 ,.nf ,Oceania
		http://img.freeflagicons.com/preview/korea_north.png  ,North Korea ,Democratic People's Republic of Korea ,Pyongyang ,+850 ,.kp ,Asia
		http://img.freeflagicons.com/preview/northern_mariana_islands.png  ,Northern Mariana Islands ,Commonwealth of the Northern Mariana Islands ,Capital Hill ,+1-670 ,.mp ,Oceania
		http://img.freeflagicons.com/preview/norway.png ,Norway ,Kingdom of Norway ,Oslo ,+47 ,.no ,Europe
		http://img.freeflagicons.com/preview/oman.png ,Oman ,Sultanate of Oman ,Muscat ,+968 ,.om ,Asia
		http://img.freeflagicons.com/preview/pakistan.png ,Pakistan ,Islamic Republic of Pakistan ,Islamabad ,+92 ,.pk ,Asia
		http://img.freeflagicons.com/preview/palau.png ,Palau ,Republic of Palau ,Melekeok ,+680 ,.pw ,Oceania
		http://img.freeflagicons.com/preview/palestinian_territory.png ,Palestinian territories ,Palestinian territories ,Ramallah ,+970 ,.ps ,Asia
		http://img.freeflagicons.com/preview/panama.png ,Panama ,Republic of Panama ,Panama ,+507 ,.pa ,America
		http://img.freeflagicons.com/preview/papua_new_guinea.png  ,Papua New Guinea ,Independent State of Papua New Guinea ,Port Moresby ,+675 ,.pg ,Oceania
		http://img.freeflagicons.com/preview/paraguay.png ,Paraguay ,Republic of Paraguay ,Asuncion ,+595 ,.py ,America
		http://img.freeflagicons.com/preview/peru.png ,Peru ,Republic of Peru ,Lima ,+51 ,.pe ,America
		http://img.freeflagicons.com/preview/philippines.png ,Philippines ,Republic of the Philippines ,Manila ,+63 ,.ph ,Asia
		http://img.freeflagicons.com/preview/pitcairn_islands.png  ,Pitcairn Islands ,Pitcairn, Henderson, Ducie and Oeno Islands ,Adamstown ,+64 ,.pn ,Oceania
		http://img.freeflagicons.com/preview/poland.png ,Poland ,Republic of Poland ,Warsaw ,+48 ,.pl ,Europe
		http://img.freeflagicons.com/preview/portugal.png ,Portugal ,Portuguese Republic ,Lisbon ,+351 ,.pt ,Europe
		http://img.freeflagicons.com/preview/puerto_rico.png Rico ,Puerto Rico ,Commonwealth of Puerto Rico ,San Juan ,+1 ,.pr ,America
		http://img.freeflagicons.com/preview/qatar.png ,Qatar ,State of Qatar ,Doha ,+974 ,.qa ,Asia
		http://img.freeflagicons.com/preview/republic_of_the_congo.png  ,Republic of the Congo ,Republic of the Congo ,Brazzaville ,+242 ,.cg ,Africa
		http://img.freeflagicons.com/preview/reunion.png ,Reunion ,Reunion ,Saint-Denis ,— ,— ,Africa
		http://img.freeflagicons.com/preview/romania.png ,Romania ,Romania ,Bucharest ,+40 ,.ro ,Europe
		http://img.freeflagicons.com/preview/russia.png ,Russia ,Russian Federation ,Moscow ,+7 ,.ru ,Europe
		http://img.freeflagicons.com/preview/rwanda.png ,Rwanda ,Republic of Rwanda ,Kigali ,+250 ,.rw ,Africa
		http://img.freeflagicons.com/preview/saint_barthelemy.png  ,Saint Barthelemy ,Collectivity of Saint Barthelemy ,Gustavia ,+590 ,.bl ,America
		http://img.freeflagicons.com/preview/saint_helena.png  ,Saint Helena ,Saint Helena, Ascension and Tristan da Cunha ,Jamestown ,+290 ,.sh ,Africa
		http://img.freeflagicons.com/preview/saint_kitts_and_nevis.png  ,Saint Kitts and Nevis ,Federation of Saint Kitts and Nevis ,Basseterre ,+1-869 ,.kn ,America
		http://img.freeflagicons.com/preview/saint_lucia.png  ,Saint Lucia ,Saint Lucia ,Castries ,+1-758 ,.lc ,America
		http://img.freeflagicons.com/preview/saint_martin.png  ,Saint Martin ,Collectivity of Saint Martin ,Marigot ,+590 ,.mf ,America
		http://img.freeflagicons.com/preview/saint_pierre_and_miquelon.png  ,Saint Pierre and Miquelon ,Saint Pierre and Miquelon ,Saint-Pierre ,+508 ,.pm ,America
		http://img.freeflagicons.com/preview/saint_vincent_and_the_grenadines.png  ,Saint Vincent and the Grenadines ,Saint Vincent and the Grenadines ,Kingstown ,+1-784 ,.vc ,America
		http://img.freeflagicons.com/preview/samoa.png ,Samoa ,Independent State of Samoa ,Apia ,+685 ,.ws ,Oceania
		http://img.freeflagicons.com/preview/san_marino.png  ,San Marino ,Republic of San Marino ,City of San Marino ,+378 ,.sm ,Europe
		http://img.freeflagicons.com/preview/sao_tome_and_principe.png ,Sao Tome and Principe ,Democratic Republic of Sao Tome and Principe ,Sao Tome ,+239 ,.st ,Africa
		http://img.freeflagicons.com/preview/saudi_arabia.png  ,Saudi Arabia ,Kingdom of Saudi Arabia ,Riyadh ,+966 ,.sa ,Asia
		http://img.freeflagicons.com/preview/scotland.png ,Scotland ,Scotland ,Edinburgh ,+44 ,.uk ,Europe
		http://img.freeflagicons.com/preview/senegal.png ,Senegal ,Republic of Senegal ,Dakar ,+221 ,.sn ,Africa
		http://img.freeflagicons.com/preview/serbia.png ,Serbia ,Republic of Serbia ,Belgrade ,+381 ,.rs ,Europe
		http://img.freeflagicons.com/preview/seychelles.png ,Seychelles ,Republic of Seychelles ,Victoria ,+248 ,.sc ,Africa
		http://img.freeflagicons.com/preview/sierra_leone.png  ,Sierra Leone ,Republic of Sierra Leone ,Freetown ,+232 ,.sl ,Africa
		http://img.freeflagicons.com/preview/singapore.png ,Singapore ,Republic of Singapore ,Singapore ,+65 ,.sg ,Asia
		http://img.freeflagicons.com/preview/sint_maarten.png  ,Sint Maarten ,Sint Maarten ,Philipsburg ,+1-721 ,.sx ,America
		http://img.freeflagicons.com/preview/slovakia.png ,Slovakia ,Slovak Republic ,Bratislava ,+421 ,.sk ,Europe
		http://img.freeflagicons.com/preview/slovenia.png ,Slovenia ,Republic of Slovenia ,Ljubljana ,+386 ,.si ,Europe
		http://img.freeflagicons.com/preview/solomon_islands.png  ,Solomon Islands ,Solomon Islands ,Honiara ,+677 ,.sb ,Oceania
		http://img.freeflagicons.com/preview/somalia.png ,Somalia ,Somali Republic ,Mogadishu ,+252 ,.so ,Africa
		http://img.freeflagicons.com/preview/south_africa.png  ,South Africa ,Republic of South Africa ,Cape Town ,+27 ,.za ,Africa
		http://img.freeflagicons.com/preview/south_georgia_and_the_south_sandwich_islands.png  ,South Georgia and the South Sandwich Islands ,South Georgia and the South Sandwich Islands ,Grytviken ,— ,.gs ,America
		http://img.freeflagicons.com/preview/korea_south.png  ,South Korea ,Republic of Korea ,Seoul ,+82 ,.kr ,Asia
		http://img.freeflagicons.com/preview/south_sudan.png  ,South Sudan ,Republic of South Sudan ,Juba ,+211 ,.ss ,Africa
		http://img.freeflagicons.com/preview/ussr.png ,Soviet Union ,Union of Soviet Socialist Republics ,Moscow ,+7 ,.su ,Europe
		http://img.freeflagicons.com/preview/spain.png ,Spain ,Kingdom of Spain ,Madrid ,+34 ,.es ,Europe
		http://img.freeflagicons.com/preview/sri_lanka.png ,Sri Lanka ,Democratic Socialist Republic of Sri Lanka ,Sri Jayawardenapura-Kotte ,+94 ,.lk ,Asia
		http://img.freeflagicons.com/preview/sudan.png ,Sudan ,Republic of the Sudan ,Khartoum ,+249 ,.sd ,Africa
		http://img.freeflagicons.com/preview/suriname.png ,Suriname ,Republic of Suriname ,Paramaribo ,+597 ,.sr ,America
		http://img.freeflagicons.com/preview/svalbard_and_jan_mayen.png  ,Svalbard and Jan Mayen ,Svalbard and Jan Mayen ,,— ,.sj ,Europe
		http://img.freeflagicons.com/preview/swaziland.png ,Swaziland ,Kingdom of Swaziland ,Mbabane ,+268 ,.sz ,Africa
		http://img.freeflagicons.com/preview/sweden.png ,Sweden ,Kingdom of Sweden ,Stockholm ,+46 ,.se ,Europe
		http://img.freeflagicons.com/preview/switzerland.png ,Switzerland ,Swiss Confederation ,Bern ,+41 ,.ch ,Europe
		http://img.freeflagicons.com/preview/syria.png ,Syria ,Syrian Arab Republic ,Damascus ,+963 ,.sy ,Asia
		http://img.freeflagicons.com/preview/republic_of_china.png ,Taiwan ,Republic of China ,Taipei City ,+886 ,.tw ,Asia
		http://img.freeflagicons.com/preview/tajikistan.png ,Tajikistan ,Republic of Tajikistan ,Dushanbe ,+992 ,.tj ,Asia
		http://img.freeflagicons.com/preview/tanzania.png ,Tanzania ,United Republic of Tanzania ,Dodoma ,+255 ,.tz ,Africa
		http://img.freeflagicons.com/preview/thailand.png ,Thailand ,Kingdom of Thailand ,Bangkok ,+66 ,.th ,Asia
		http://img.freeflagicons.com/preview/togo.png ,Togo ,Togolese Republic ,Lome ,+228 ,.tg ,Africa
		http://img.freeflagicons.com/preview/tokelau.png ,Tokelau ,Tokelau ,Nukunonu ,+690 ,.tk ,Oceania
		http://img.freeflagicons.com/preview/tonga.png ,Tonga ,Kingdom of Tonga ,Nukualofa ,+676 ,.to ,Oceania
		http://img.freeflagicons.com/preview/trinidad_and_tobago.png  ,Trinidad and Tobago ,Republic of Trinidad and Tobago ,Port of Spain ,+1-868 ,.tt ,America
		http://img.freeflagicons.com/preview/tunisia.png ,Tunisia ,Tunisian Republic ,Tunis ,+216 ,.tn ,Africa
		http://img.freeflagicons.com/preview/turkey.png ,Turkey ,Republic of Turkey ,Ankara ,+90 ,.tr ,Asia
		http://img.freeflagicons.com/preview/turkmenistan.png ,Turkmenistan ,Turkmenistan ,Ashgabat ,+993 ,.tm ,Asia
		http://img.freeflagicons.com/preview/turks_and_caicos_islands.png  ,Turks and Caicos Islands ,Turks and Caicos Islands ,Cockburn Town ,+1-649 ,.tc ,America
		http://img.freeflagicons.com/preview/tuvalu.png ,Tuvalu ,Tuvalu ,Funafuti ,+688 ,.tv ,Oceania
		http://img.freeflagicons.com/preview/uganda.png ,Uganda ,Republic of Uganda ,Kampala ,+256 ,.ug ,Africa
		http://img.freeflagicons.com/preview/ukraine.png ,Ukraine ,Ukraine ,Kiev ,+380 ,.ua ,Europe
		http://img.freeflagicons.com/preview/united_arab_emirates.png ,United Arab Emirates ,United Arab Emirates ,Abu Dhabi ,+971 ,.ae ,Asia
		http://img.freeflagicons.com/preview/united_kingdom.png  ,United Kingdom ,United Kingdom of Great Britain and Northern Ireland ,London ,+44 ,.uk ,Europe
		http://img.freeflagicons.com/preview/united_states_of_america.png  ,United States of America ,United States of America ,Washington, D.C. ,+1 ,.us ,America
		http://img.freeflagicons.com/preview/uruguay.png ,Uruguay ,Oriental Republic of Uruguay ,Montevideo ,+598 ,.uy ,America
		http://img.freeflagicons.com/preview/uzbekistan.png ,Uzbekistan ,Republic of Uzbekistan ,Tashkent ,+998 ,.uz ,Asia
		http://img.freeflagicons.com/preview/vanuatu.png ,Vanuatu ,Republic of Vanuatu ,Port Vila ,+678 ,.vu ,Oceania
		http://img.freeflagicons.com/preview/vatican_city.png  ,Vatican City ,Vatican City ,Vatican City ,+379 ,.va ,Europe
		http://img.freeflagicons.com/preview/venezuela.png ,Venezuela ,Bolivarian Republic of Venezuela ,Caracas ,+58 ,.ve ,America
		http://img.freeflagicons.com/preview/vietnam.png ,Vietnam ,Socialist Republic of Vietnam ,Hanoi ,+84 ,.vn ,Asia
		http://img.freeflagicons.com/preview/virgin_islands_british.png  ,Virgin Islands ,British Virgin Islands ,Road Town ,+1-284 ,.vg ,America
		http://img.freeflagicons.com/preview/virgin_islands_us.png  ,Virgin Islands of the United States ,Virgin Islands of the United States ,Charlotte Amalie ,+1 ,.vi ,America
		http://img.freeflagicons.com/preview/wales.png ,Wales ,Wales ,Cardiff ,+44 ,.uk ,Europe
		http://img.freeflagicons.com/preview/wallis_and_futuna.png  ,Wallis and Futuna ,Territory of the Wallis and Futuna Islands ,Mata-Utu ,+681 ,.wf ,Oceania
		http://img.freeflagicons.com/preview/western_sahara.png  ,Western Sahara ,Western Sahara ,El Aaiun ,+212 ,.eh ,Africa
		http://img.freeflagicons.com/preview/yemen.png ,Yemen ,Republic of Yemen ,Sanaa ,+967 ,.ye ,Asia
		http://img.freeflagicons.com/preview/zambia.png ,Zambia ,Republic of Zambia ,Lusaka ,+260 ,.zm ,Africa
		http://img.freeflagicons.com/preview/zimbabwe.png ,Zimbabwe ,Republic of Zimbabwe ,Harare ,+263 ,.zv ,Africa
    ENDTEXT
    Create Cursor ycurs(xflag c(120), country c(120),FullName c(120),capital c(20),phone c(5),Code c(5),continent c(15))

    Local x1,x2,x2,x3,x4,x5,x6,x7
    For i=1 To Memlines(m.myv)
      m.x1=Allt(Getwordnum(Mline(m.myv,i),1,','))
      m.x2=Allt(Getwordnum(Mline(m.myv,i),2,','))
      m.x3=Allt(Getwordnum(Mline(m.myv,i),3,','))
      m.x4=Allt(Getwordnum(Mline(m.myv,i),4,','))
      m.x5=Allt(Getwordnum(Mline(m.myv,i),5,','))
      m.x6=Allt(Getwordnum(Mline(m.myv,i),6,','))
      m.x7=Allt(Getwordnum(Mline(m.myv,i),7,','))
      Insert Into ycurs Values(m.x1,m.x2,m.x3,m.x4,m.x5,m.x6,m.x7)
    Endfor
    Sele ycurs

    Repl All country With Spac(2)+Allt(country)
    Locate
    *copy to ycountries  &&if want to have a physical dbf support
    *brow
  Endproc

  Procedure Init
    Set Safe Off
    Thisform.Caption=Trans(Reccount()) +" world countries   -  right click on any cell to fire a contextuel menu."
    Thisform.Resize
  Endproc

  Procedure grid1.Init
    With Thisform.grid1
      .Anchor=15
      .RecordSource="ycurs"
      .RecordSourceType=1
      .GridLines=0
      .DeleteMark=.F.
      .RowHeight=30
      .ReadOnly=.T.
      .HighlightStyle=2

      Local m.w
      m.w=Thisform.Width
      .column1.Width=0.035*w
      .column2.Width=0.3*w
      .column3.Width=0.3*w
      .column4.Width=0.1*w
      .column5.Width=0.1*w
      .column6.Width=0.04*w
      .column7.Width=0.08*w

      .column2.FontBold=.T.
      .column3.FontBold=.T.
      .SetAll("fontbold",.T.,"header")
      .SetAll("fontsize",10,"header")
      .column2.FontSize=10
      With .column1
        *.removeObject("text1")
        .AddObject("img","image")
        With .img
          .Stretch=2
          .Left=2
          .Top=2
          .Width=30-4
          .Height=30-4
          .Picture=""
          .BorderStyle=1
          .MousePointer=15
          .Name="img"
          .Visible=.T.
        Endwith
        .CurrentControl="img"
        .Sparse=.F.
        .DynamicFontBold = 'thisform.ShowPicture(thisform.grid1.column1.img,ycurs.xflag)'
      Endwith
      .SetAll("dynamicbackcolor","iif(mod(recno(),2)=0,rgb(226,226,226),rgb(234,255,213))","column")
      .column3.DynamicForeColor="rgb(255,0,0)"
      .column4.DynamicForeColor="rgb(0,0,128)"
      For i=1 To .ColumnCount
        If i=1
          Bindevent(.Columns(i).img,"rightclick",Thisform,"my0")
        Else
          Bindevent(.Columns(i).text1,"rightclick",Thisform,"my0")
        Endi
      Endfor
      Locate
      .SetFocus
      .Refresh
    Endwith
  Endproc

Enddefine
*
*-- EndDefine: ygrid_flags


A vfp grid working with the web
A vfp grid working with the web
A vfp grid working with the web
A vfp grid working with the web
A vfp grid working with the web
A vfp grid working with the web
A vfp grid working with the web

                     

Yousfi Benameur


Important:All Codes above are tested on VFP9SP2 & windows 10 pro 64 bits version 1709(fall creator) & IE11 emulation.

To be informed of the latest articles, subscribe:
Comment on this post
V
Is super, thanks!
Reply
M
Thanks!! .. wonderfull
Reply