29 Ago 2019 00:51
29 Ago 2019 07:22
11 Ago 2020 16:49
11 Ago 2020 17:15
11 Ago 2020 17:39
#include "inkey.ch"
PROCEDURE Main
LOCAL cTxt, aHash
LOCAL oAparelho, nOpcAparelho := 1
LOCAL oFabricante, nOpcFabricante := 1
LOCAL oCode
SetMode(30,100)
CLS
cTxt := JasonList() // Memoread( "remote.html" )
aHash := hb_jsonDecode( cTxt )
DO WHILE .T.
@ 0, 30 CLEAR TO MaxRow(), MaxCol()
FOR EACH oAparelho IN aHash[ "devices" ]
@ oAparelho:__EnumIndex, 1 PROMPT oAparelho[ "device" ]
NEXT
MENU TO nOpcAparelho
IF Lastkey() == K_ESC
EXIT
ENDIF
DO WHILE .T.
@ 0, 60 CLEAR TO MaxRow(), MaxCol()
FOR EACH oFabricante IN aHash[ "devices" ][ nOpcAparelho ][ "brandCodes" ]
@ oFabricante:__EnumIndex, 30 PROMPT oFabricante[ "brand" ]
NEXT
MENU TO nOpcFabricante
IF LastKey() == K_ESC
EXIT
ENDIF
FOR EACH oCode IN aHash[ "devices" ][ nOpcAparelho ][ "brandCodes" ][ nOpcFabricante][ "codes" ]
@ oCode:__EnumIndex, 60 SAY oCode
NEXT
Inkey(0)
ENDDO
ENDDO
//ShowJson( aHash, "aHash" )
//Inkey(0)
RETURN
11 Ago 2020 17:45
11 Ago 2020 18:16
#include "inkey.ch"
PROCEDURE Main
LOCAL cTxt, aHash, oAparelho, oFabricante, oCode
LOCAL oMenu, oSubMenu1, oSubMenu2, oSubMenu3, nKey := 0
SetMode(30,100)
CLS
cTxt := JasonList() // Memoread( "remote.html" )
aHash := hb_jsonDecode( cTxt )
oMenu := wvgSetAppWindow():MenuBar()
oSubMenu1 := wvgMenu():New( oMenu, , .T. ):Create()
FOR EACH oAparelho IN aHash[ "devices" ]
oSubMenu2 := WvgMenu():new( oSubMenu1, , .T. ):Create()
FOR EACH oFabricante IN aHash[ "devices" ][ oAparelho:__EnumIndex ][ "brandCodes" ]
oSubMenu3 := wvgMenu():New( oSubMenu2, , .T. ):Create()
FOR EACH oCode IN aHash[ "devices" ][ oAparelho:__EnumIndex ][ "brandCodes" ][ oFabricante:__EnumIndex ][ "codes" ]
oSubMenu3:AddItem( oCode, { || NIL } )
NEXT
oSubMenu2:AddItem( oSubMenu3, oFabricante[ "brand" ] )
NEXT
oSubMenu1:AddItem( oSubMenu2, oAparelho[ "device" ] )
NEXT
oMenu:AddItem( oSubMenu1, "Selecione" )
DO WHILE nKey != K_ESC
nKey := Inkey()
ENDDO
wvgSetAppWindow():oMenu := NIL
oMenu:Destroy()
//ShowJson( aHash, "aHash" )
//Inkey(0)
RETURN
07 Set 2020 19:08
STATIC FUNCTION JasonList()
#pragma __binarystreaminclude "resource/remote.json" | RETURN %s
#include "inkey.ch"
PROCEDURE pTesRemSony
LOCAL cTxt, aHash, aList, nOpc
LOCAL oAparelho, nOpcAparelho
LOCAL oFabricante, nOpcFabricante
LOCAL oCode
cTxt := JasonList()
aHash := hb_jsonDecode( cTxt )
DO WHILE .T.
Cls()
aList := {}
FOR EACH oAparelho IN aHash[ "devices" ]
AAdd( aList, oAparelho[ "device" ] )
NEXT
wAchoiceNoClose( 1, 1, aList,@nOpcAparelho, "Device" )
IF Lastkey() == K_ESC
EXIT
ENDIF
DO WHILE .T.
@ 0, 60 CLEAR TO MaxRow(), MaxCol()
aList := {}
FOR EACH oFabricante IN aHash[ "devices" ][ nOpcAparelho ][ "brandCodes" ]
AAdd( aList, oFabricante[ "brand" ] )
NEXT
wAchoiceNoClose( 5, 30, aList, @nOpcFabricante, "brand" )
IF LastKey() == K_ESC
EXIT
ENDIF
aList := {}
FOR EACH oCode IN aHash[ "devices" ][ nOpcAparelho ][ "brandCodes" ][ nOpcFabricante][ "codes" ]
AAdd( aList, oCode )
NEXT
wAchoice( 10, 60, aList, @nOpc, "brandcodes" )
( nOpc )
Inkey(0)
wClose()
ENDDO
wClose()
ENDDO
RETURN
STATIC FUNCTION JasonList()
#pragma __binarystreaminclude "resource/remote.json" | RETURN %s
07 Set 2020 19:29