Function CalendList()
local oCalendList
local lSw := .F.
oCalendList := TGCalendarList():New()
lSw := oCalendList:Activate()
if lSw
? "Activado"
oCalendList:ListCalendars()
XBrowse( oCalendList:aCalendList )
else
? oCalend:cError
endif
Return nil
//----------------------------------------------------------------------------//
Silvio.Falconi wrote:tried gmail I see nothing ( only xbrowse and criptated strings) I allready abilitate the service
//----------------------------------------------------------------------------//
//
// GGMAIL.PRG: sample use Class TGMail from TGGoogle
// Author: Cristobal Navarro ( C ) 20/11/2017 - 16/02/2018
//
//----------------------------------------------------------------------------//
#include "Fivewin.ch"
#include "Splitter.ch"
#include "colores.ch"
REQUEST HB_CODEPAGE_ESWIN
Static nLeftPos
Static oMail
Function Main()
local aMessages := Main1()
if !Empty( aMessages )
XbrwMail(,,,,, aMessages )
endif
Return nil
//----------------------------------------------------------------------------//
Function Main1()
local lSw := .F.
local aList := {}
HB_CDPSELECT( "ESWIN" )
oMail := TGMail():New()
// you can configure the name and path of the json file between New and Activate methods
// oMail:cJSonFile := ".\client_id.json"
lSw := oMail:Activate()
if lSw
//
oMail:SentMessages()
aList := AClone( oMail:aMessages )
//XBrowse( oMail:aMessages )
endif
Return aList //oMail:aMessages
//----------------------------------------------------------------------------//
Function XbrwMail( oWnd, nT, nL, nB, nR, aSource )
local lWnd := .F.
local oVSplitL
local oBrw
local oPnel1
local nTop
local nHeight
local aMsgs := {}
AEVal( aSource, { | a | AAdd( aMsgs, { a[ 1 ], a[ 2 ], "" } ) } )
oMail:GetMessage( aMsgs[ 1 ][ 1 ] )
nLeftPos := Min( 300, Int( GetSysMetrics( 0 ) / 5 ) )
if Empty( oWnd )
lWnd := .T.
DEFINE WINDOW oWnd ;
TITLE " - Google Mail - " + FWVERSION + " - " + hb_Compiler() ;
PIXEL COLOR CLR_BLUE, CLR_WHITE //STYLE WS_POPUP
endif
nTop := if( Empty( oWnd:oBar ), 0, oWnd:oBar:nBottom ) + 2
nHeight := if( Empty( oWnd:oMsgBar ), 32, oWnd:oMsgBar:nTop - 2 )
@ nTop, nLeftPos + 2 XBROWSE oBrw DATASOURCE aMsgs OF oWnd ;
SIZE GetSysMetrics( 0 ) - nLeftPos - 4, GetSysMetrics( 1 ) - nHeight ;
HEADERS "Thread", "Id", "Message" ;
COLUMNS 2, 1, 3 ;
PIXEL CELL LINES NOBORDER
WITH OBJECT oBrw
:l2007 := .F.
//:nMarqueeStyle := MARQSTYLE_DOTEDCELL
:nStretchCol := 3
:bClrHeader := { || { CLR_WHITE, CLR_GRAY } }
:bClrSelFocus := ;
:bClrSel := { || { CLR_BLACK, CLR_HGRAY } }
:lRecordSelector := .F.
:lHScroll := .F.
:nColDividerStyle := ;
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nRowHeight := 87
WITH OBJECT :aCols[ 3 ]
:bClrStd := { || { CLR_BLUE, CLR_WHITE } }
:nDataStrAlign := 0
:bEditValue := { || oMail:GetMessage( oBrw:aRow[ 1 ] ), oMail:cMessage }
END
:CreateFromCode()
END
if lWnd
oPnel1 := TPanel():New( nTop + 2, 2, GetSysMetrics( 1 ) - nHeight, nLeftPos - 2, oWnd )
oPnel1:SetColor( CLR_WHITE, METRO_GRIS7 )
@ nTop, nLeftPos SPLITTER oVSplitL ;
VERTICAL ;
PREVIOUS CONTROLS oPnel1 ;
HINDS CONTROLS oBrw ;
LEFT MARGIN 0 ;
RIGHT MARGIN 80 ;
SIZE 1, GetSysMetrics( 1 ) - nHeight + 2 ;
COLOR CLR_HGRAY ; //oWnd:nClrPane ;
PIXEL OF oWnd
oVSplitL:lStatic := .T.
ACTIVATE WINDOW oWnd MAXIMIZED
endif
Return nil
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Otto and 13 guests