#include "FiveWin.ch"
#include "xBrowse.ch"
#include "EXStruc.ch"
FUNCTION Main()
LOCAL oWnd, oBrw,oCol,oDef
LOCAL aNomBan:={'50mhz','144 mhz','432mhz'},aCodBan:={'6M','2M','70CM'}
LOCAL aNomMod:={'SSB','PKT','CLO','PAC2'},aCodMod:={'SSB','Packet','Clover','Pactor II'}
STRUC oDef
MEMBER dFecha AS Date INIT Date()
MEMBER cProPMode AS CHARACTER INIT 'ES'
MEMBER cOperator AS CHARACTER INIT 'EA6DD'
MEMBER cQra AS CHARACTER INIT 'JM19JK'
MEMBER cMode AS CHARACTER INIT 'SSB' SIZE 6
MEMBER cBand AS CHARACTER INIT '2M' SIZE 6
END STRUC
DEFINE WINDOW oWnd
DBCreate('Fast', {{ "BAND" , "C", 6, 0 },;
{ "CALL" , "C", 12, 0 },;
{ "COMMENT" , "C", 30, 0 },;
{ "GRIDSQUARE", "C", 6, 0 },;
{ "MODE" , "C", 6, 0 },;
{ "TIMEON" , "C", 5, 0 },;
{ "OPERATOR" , "C", 15, 0 },;
{ "PROPMODE" , "C", 2, 0 },;
{ "QSODATE" , "D", 8, 0 },;
{ "QRA" , "C", 6, 0 } })
DBUseArea(.T.,,'fast','fast',.F.,.F.)
oBrw := TxBrowse():New(oWnd)
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := 4
:nRowDividerStyle := 4
:lColDividerComplete := .T.
:nHeaderLines := 2
:nDataLines := 1
:nFreeze := 5
:lFastEdit :=.T.
:bPastEof := {||EsAddRec(oDef,oBrw,oCol)}
END
ADD TO oBrw DATA Fast->QsoDate TITLE 'Fecha'
ADD TO oBrw DATA Fast->TimeOn TITLE 'Hora'
ADD TO oBrw DATA Fast->Band TITLE 'Banda'
oCol:=ATail(oBrw:aCols)
oCol:nEditType := EDIT_LISTBOX
oCol:aEditListTxt := aNomBan
oCol:aEditListBound:= aCodBan
oCol:bOnPostEdit := {|o,v,n| Fast->Band:=v }
ADD TO oBrw DATA Fast->Mode TITLE 'Modo'
oCol:=ATail(oBrw:aCols)
oCol:nEditType := EDIT_LISTBOX
oCol:aEditListTxt := aNomMod
oCol:aEditListBound:= aCodMod
oCol:bOnPostEdit := {|o,v,n| Fast->Mode:=v }
ADD TO oBrw DATA Fast->Call TITLE 'Indicativo' EDITABLE ON EDIT {|o,v,n| Fast->Call:=v } PICTURE "@!"
oCol:=ATail(oBrw:aCols)
ADD TO oBrw DATA Fast->GridSquare TITLE 'Locator' EDITABLE ON EDIT {|o,v,n| Fast->GridSquare:=v } PICTURE "!!99!!"
ADD TO oBrw DATA Fast->Comment TITLE 'Notas' EDITABLE ON EDIT {|o,v,n| Fast->Comment:=v }
//--
oBrw:SetRdd()
oBrw:CreateFromCode()
oWnd:oClient:=oBrw
ACTIVATE WINDOW oWnd ON INIT EsAddRec(oDef,oBrw,oCol)
RETURN NIL
//---------------------------------------
STATIC FUNCTION EsAddRec(oDef,oBrw,oCol)
IF Empty(Fast->TimeOn)
Fast->TimeOn:=Time()
ENDIF
Fast->(DBAppend())
Fast->QsoDate :=oDef:dFecha
Fast->Operator:=oDef:cOperator
Fast->Qra :=oDef:cQra
Fast->PropMode:=oDef:cPropMode
Fast->Band :=oDef:cBand
Fast->Mode :=oDef:cMode
oBrw:Refresh()
oBrw:SetPos(,oBrw:ColPos(oCol))
* oBrw:nColSel:=5 //Tambien funciona
RETURN NIL