Althouth this is not an actual programme, it is code that can be useful within bluegui, just add the following code snippets into you Gui.dba Include File
Windows Media Center, (WMC) Remote Constants for use with Blue Gui Events
` Windows Media Center, (WMC) Remote Constants for use with Blue Gui Events
` ===========================================================================================================================
` EventType() Constants
` WMC_REMOTE_PRESS Indicates that a Button on the WMC Remote is currently being Pressed
` WMC_REMOTE Indicates that a Button on the WMC Remote has just been released
#Constant WMC_REMOTE 257
#Constant WMC_REMOTE_PRESS 256
` EventData() Constants
` Theres are values returned by EventData() to specify which button was/is pressed on the WMC Remote
#Constant WMC_ENTER 13
#Constant WMC_OK 13
#Constant WMC_STAR 16
#Constant WMC_HASH 16
#Constant WMC_CLEAR 27
#Constant WMC_LEFT 37
#Constant WMC_UP 38
#Constant WMC_RIGHT 39
#Constant WMC_DOWN 40
#Constant WMC_0 48
#Constant WMC_1 49
#Constant WMC_2 50
#Constant WMC_3 51
#Constant WMC_4 52
#Constant WMC_5 53
#Constant WMC_6 54
#Constant WMC_7 55
#Constant WMC_8 56
#Constant WMC_9 57
#Constant WMC_BACK 166
#Constant WMC_MUTE 173
#Constant WMC_VOLUMEDOWN 174
#Constant WMC_VOLUMEUP 175
#Constant WMC_SKIPFORWARD 176
#Constant WMC_SKIPBACK 177
#Constant WMC_STOP 178
Read Key Entry - EventData() Constants for use with KEYDOWN Type
` EventData() Constants for use with KEYDOWN Type
` ===========================================================================================================================
#Constant KEY_ENTER 13
#Constant KEY_ESCAPE 27
#Constant KEY_LEFT 37
#Constant KEY_RIGHT 38
#Constant KEY_UP 39
#Constant KEY_DOWN 40
#Constant KEY_0 48
#Constant KEY_1 49
#Constant KEY_2 50
#Constant KEY_3 51
#Constant KEY_4 52
#Constant KEY_5 53
#Constant KEY_6 54
#Constant KEY_7 55
#Constant KEY_8 56
#Constant KEY_9 57
#Constant KEY_A 65
#Constant KEY_B 66
#Constant KEY_C 67
#Constant KEY_D 68
#Constant KEY_E 69
#Constant KEY_F 70
#Constant KEY_G 71
#Constant KEY_H 72
#Constant KEY_I 73
#Constant KEY_J 74
#Constant KEY_K 75
#Constant KEY_L 76
#Constant KEY_M 77
#Constant KEY_N 78
#Constant KEY_O 79
#Constant KEY_P 80
#Constant KEY_Q 81
#Constant KEY_R 82
#Constant KEY_S 83
#Constant KEY_T 84
#Constant KEY_U 85
#Constant KEY_V 86
#Constant KEY_W 87
#Constant KEY_X 88
#Constant KEY_Y 89
#Constant KEY_Z 90
#Constant KEY_START 91
#Constant KEY_NUM_0 96
#Constant KEY_NUM_1 97
#Constant KEY_NUM_2 98
#Constant KEY_NUM_3 99
#Constant KEY_NUM_4 100
#Constant KEY_NUM_5 101
#Constant KEY_NUM_6 102
#Constant KEY_NUM_7 103
#Constant KEY_NUM_8 104
#Constant KEY_NUM_9 105
#Constant KEY_NUM_STAR 106
#Constant KEY_NUM_PLUS 109
#Constant KEY_NUM_MINUS 107
#Constant KEY_NUM_DEVIDE 111
#Constant KEY_F1 112
#Constant KEY_F2 113
#Constant KEY_F3 114
#Constant KEY_F4 115
#Constant KEY_F5 116
#Constant KEY_F6 117
#Constant KEY_F7 118
#Constant KEY_F8 119
#Constant KEY_F9 120
#Constant KEY_F10 121
#Constant KEY_F11 122
#Constant KEY_F12 123
#Constant KEY_MINUS 189
#Constant KEY_PLUS 187
CreateTransparantLabel(x,y,w,h,S$,P)
Create a Label with a Transparant Background, somethink blue cant do
Function CreateTransparantLabel(x,y,w,h,S$,P)
` This create a Panel in the style of a label, But with a fully transparant background
Ink 0,0 : Box 0,0,w,h
Ink -1,-1 : Text 0,0,S$
g = CreatePanel(x,y,w,h,P)
i = Find Free Image()
Get Image i,0,0,w,h,1
Save Image AppPath$+"TempTemp.bmp",i
SetGadgetShape g,AppPath$+"TempTemp.bmp"
SetPanelImage g,AppPath$+"TempTemp.bmp"
Delete File AppPath$+"TempTemp.bmp"
` PaintGadget g
EndFunction g
CreateMarquee(Contents$,Parent)
Creates a Horizontal Scrolling Text Gadget
Function CreateMarquee(Contents$,Parent) : ` Creates a Horizontal Scrolling Text Gadget
If w <= 0 Then ErrorMessage "You have Specified an Invalid Width for the Marquee of "+Str$(w) : ExitFunction 0
If h <= 0 Then ErrorMessage "You have Specified an Invalid Height for the Marquee of "+Str$(h) : ExitFunction 0
Gadget = CreateWebBrowser(x,y,w,h,Parent)
TempFile$ = AppPath$+NextTempFile$(AppPath$+"Temp")
Open To Write 1,TempFile$
Write String 1,"<!DOCTYPE html PUBLIC "+Chr$(34)+"-//W3C//DTD XHTML 1.0 Transitional//EN"+Chr$(34)+" "+Chr$(34)+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"+Chr$(34)+">"
Write String 1,"<html xmlns="+Chr$(34)+"http://www.w3.org/1999/xhtml"+Chr$(34)+">"
Write String 1,"<head>"
Write String 1,"<meta http-equiv="+Chr$(34)+"Content-Type"+Chr$(34)+" content="+Chr$(34)+"text/html; charset=iso-8859-1"+Chr$(34)+" />"
Write String 1,"<title>Untitled Document</title>"
Write String 1,"<style type="+Chr$(34)+"text/css"+Chr$(34)+">"
Write String 1,"<!--"
Write String 1,"body {"
Write String 1," margin-left: 0px;"
Write String 1," margin-top: 0px;"
Write String 1," margin-right: 0px;"
Write String 1," margin-bottom: 0px;"
Write String 1,"}"
Write String 1,"</style></head>"
Write String 1,"<body>"
Write String 1,"<MARQUEE>"
Write String 1,Contents$
Write String 1,"</MARQUEE>"
Write String 1,"</body>"
Write String 1,"</html>"
Close File 1 : WebBrowserNavigate Gadget,TempFile$
EndFunction Gadget
Function NextTempFile$(Path$) : ` Get the Next Free Temp File Name, Its best to use a Temp Directory for this so you can delete all the old temp files
If Right$(Path$,1) <> "" Then Path$ = Path$+""
Repeat : Inc n,1
Until File Exist(Path$+"Temp "+Str$(n)+".temp") = 0
File$ = "Temp "+Str$(n)+".temp"
EndFunction File$
CreateFileExplorer(x,y,w,h,Drive$,Path$,Parent)
Function CreateFileExplorer(x,y,w,h,Drive$,Path$,Parent) : ` Create a File Explorer Gadget - Returns the Gadget Number
If Len(Drive$) <> 1 Then ErrorMessage "'"+Drive$+"' is an invalid Drive Letter, Pleae enter a SINGLE CHR ONLY..." : ExitFunction 0
If w <= 0 Then ErrorMessage "You have Specified an Invalid Width for the File Explorer of "+Str$(w) : ExitFunction 0
If h <= 0 Then ErrorMessage "You have Specified an Invalid Height for the File Explorer of "+Str$(h) : ExitFunction 0
g = CreateWebBrowser(x,y,w,h,Parent)
WebBrowserNavigate g,"file:///"+Drive$+"|/"+Path$
EndFunction g
CreateMediaStream(x,y,w,h,_ShowControls,_ShowDisplay,_ShowStatusbar,_MediaURL$,Parent)
Create a Media Stream Gadget using Windows Media Player - Returns the Gadget Number
Function CreateMediaStream(x,y,w,h,_ShowControls,_ShowDisplay,_ShowStatusbar,_MediaURL$,Parent) : ` Create a Media Stream Gadget using Windows Media Player - Returns the Gadget Number
If w <= 0 Then ErrorMessage "You have Specified an Invalid Width for the WMP Stream of "+Str$(w) : ExitFunction 0
If h <= 0 Then ErrorMessage "You have Specified an Invalid Height for the WMP Stream of "+Str$(h) : ExitFunction 0
Gadget = CreateWebBrowser(x,y,w,h,Parent)
TempFile$ = AppPath$+NextTempFile$(AppPath$+"Temp")
If File Exist(TempFile$) = 1 Then Delete File TempFile$
Open To Write 1,TempFile$
Write String 1,"<HTML>"
Write String 1,"<HEAD>"
Write String 1,"<TITLE></TITLE>"
Write String 1,"<meta http-equiv="+Chr$(34)+"Content-Type"+Chr$(34)+" content="+Chr$(34)+"text/html; charset=iso-8859-1"+Chr$(34)+"><style type="+Chr$(34)+"text/css"+Chr$(34)+">"
Write String 1,"<!--"
Write String 1,"body {"
Write String 1," margin-left: 0px;"
Write String 1," margin-top: 0px;"
Write String 1," margin-right: 0px;"
Write String 1," margin-bottom: 0px;"
Write String 1,"}"
Write String 1,"-->"
Write String 1,"</style>"
Write String 1,"</HEAD>"
Write String 1,"<BODY>"
Write String 1,"<script language="+Chr$(34)+"JavaScript"+Chr$(34)+">"
Write String 1,"<!-- Disablee the ScrollBars -->"
Write String 1,"document.body.style.overflow = 'hidden';"
Write String 1,"<!--"
Write String 1," if ( navigator.appName == "+Chr$(34)+"Netscape"+Chr$(34)+" )"
Write String 1," {"
Write String 1," //-- This next line ensures that any plug-ins just installed are updated in the browser"
Write String 1," //-- without quitting the browser."
Write String 1," navigator.plug-ins.refresh();"
Write String 1," // We don't need the APPLET within IE"
Write String 1," // ***Please note that if you do not need to script events, you can safely remove the next two lines"
Write String 1," document.write("+Chr$(34)+"x3C"+Chr$(34)+" + "+Chr$(34)+"applet MAYSCRIPT Code=NPDS.npDSEvtObsProxy.class"+Chr$(34)+")"
Write String 1," document.writeln("+Chr$(34)+" width=5 height=5 name=appObsx3E x3C/appletx3E"+Chr$(34)+")"
Write String 1," }"
Write String 1,"//-->"
Write String 1,"</script>"
Write String 1,"<!-- Set ShowControls, ShowDisplay, ShowStatusBar to value 0 to not display the corresponding thing under the video window -->"
Write String 1,"<OBJECT ID="+Chr$(34)+"MediaPlayer WIDTH="+Str$(w)+" HEIGHT="+Str$(h)+" classid="+Chr$(34)+"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"+Chr$(34)
Write String 1,"codebase="+Chr$(34)+"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"+Chr$(34)
Write String 1,"standby="+Chr$(34)+"Loading Microsoft Windows Media Player components..."+Chr$(34)
Write String 1,"type="+Chr$(34)+"application/x-oleobject"+Chr$(34)+">"
Write String 1," <PARAM NAME="+Chr$(34)+"FileName"+Chr$(34)+" VALUE="+Chr$(34)+MediaURL$+Chr$(34)+">"
Write String 1," <PARAM NAME="+Chr$(34)+"ShowControls" +Chr$(34)+" VALUE="+Chr$(34)+Str$(_ShowControls )+Chr$(34)+">"
Write String 1," <PARAM NAME="+Chr$(34)+"ShowDisplay" +Chr$(34)+" VALUE="+Chr$(34)+Str$(_ShowDisplay )+Chr$(34)+">"
Write String 1," <PARAM NAME="+Chr$(34)+"ShowStatusBar"+Chr$(34)+" VALUE="+Chr$(34)+Str$(_ShowStatusBar)+Chr$(34)+">"
Write String 1," <PARAM NAME="+Chr$(34)+"AutoSize"+Chr$(34)+" VALUE="+Chr$(34)+"0"+Chr$(34)+">"
Write String 1," <Embed type="+Chr$(34)+"application/x-mplayer2"+Chr$(34)
Write String 1," pluginspage=" +Chr$(34)+"http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx/"+Chr$(34)
Write String 1," filename=" +Chr$(34)+_MediaURL$+Chr$(34)
Write String 1," src=" +Chr$(34)+_MediaURL$+Chr$(34)
Write String 1," ShowControls=" +Str$(_ShowControls )
Write String 1," ShowDisplay=" +Str$(_ShowDisplay )
Write String 1," ShowStatusBar="+Str$(_ShowStatusBar)
Write String 1," width=" +Str$(w)
Write String 1," height="+Str$(h)+">"
Write String 1," </embed>"
Write String 1,"</OBJECT>"
Write String 1,"</BODY>"
Write String 1,"</HTML>"
Close File 1 : WebBrowserNavigate Gadget,TempFile$
EndFunction Gadget
Function NextTempFile$(Path$) : ` Get the Next Free Temp File Name, Its best to use a Temp Directory for this so you can delete all the old temp files
If Right$(Path$,1) <> "" Then Path$ = Path$+""
Repeat : Inc n,1
Until File Exist(Path$+"Temp "+Str$(n)+".temp") = 0
File$ = "Temp "+Str$(n)+".temp"
EndFunction File$
CreateApplet(CodeFile$,TextValue$,w,h,Parent)
Add an Applet to your Project
Function CreateApplet(CodeFile$,TextValue$,w,h,Parent) : ` Add an Applet to your Project
If File Exist(CodeFile$) = 0 Then ErrorMessage "The Specified Applet code file does NOT Exist"+Str$(w) : ExitFunction 0
If w <= 0 Then ErrorMessage "You have Specified an Invalid Width for the Applet of "+Str$(w) : ExitFunction 0
If h <= 0 Then ErrorMessage "You have Specified an Invalid Height for the Applet of "+Str$(h) : ExitFunction 0
Gadget = CreateWebBrowser(x,y,w,h,Parent)
TempFile$ = AppPath$+NextTempFile$(AppPath$+"Temp")
Open To Write 1,TempFile$
Write String 1,"<!DOCTYPE html PUBLIC "+Chr$(34)+"-//W3C//DTD XHTML 1.0 Transitional//EN"+Chr$(34)+" "+Chr$(34)+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"+Chr$(34)+">"
Write String 1,"<html xmlns="+Chr$(34)+"http://www.w3.org/1999/xhtml"+Chr$(34)+">"
Write String 1,"<head>"
Write String 1,"<meta http-equiv="+Chr$(34)+"Content-Type"+Chr$(34)+" content="+Chr$(34)+"text/html; charset=iso-8859-1"+Chr$(34)+" />"
Write String 1,"<title>Untitled Document</title>"
Write String 1,"<style type="+Chr$(34)+"text/css"+Chr$(34)+">"
Write String 1,"<!--"
Write String 1,"body {"
Write String 1," margin-left: 0px;"
Write String 1," margin-top: 0px;"
Write String 1," margin-right: 0px;"
Write String 1," margin-bottom: 0px;"
Write String 1,"}"
Write String 1,"</style></head>"
Write String 1,"<body>"
Write String 1,"<APPLET CODE="+Chr$(34)+CodeFile$+Chr$(34)+" WIDTH="+Str$(w)+" HEIGHT="+Str$(h)+"><PARAM NAME=TEXT VALUE="+Chr$(34)+TextValue$+Chr$(34)+"></APPLET>"
Write String 1,"</body>"
Write String 1,"</html>"
Close File 1 : WebBrowserNavigate Gadget,TempFile$
EndFunction Gadget
Function
NextTempFile$(Path$) : ` Get the Next Free Temp File Name, Its best to use a Temp Directory for this so you can delete all the old temp files
If Right$(Path$,1) <> "" Then Path$ = Path$+""
Repeat : Inc n,1
Until File Exist(Path$+"Temp "+Str$(n)+".temp") = 0
File$ = "Temp "+Str$(n)+".temp"
EndFunction File$
MoveListViewItemTo$(Gadget1,Item$,Gadget2)
Move an item from 1 listview gadget to another by Item Text
Function MoveListViewItemTo$(Gadget1,Item$,Gadget2) : ` Move an item from 1 listview gadget to another
For n = 0 to GetListViewItemCount(Gadget1)
If GetListViewItemText(Gadget1,n,0) = Item$ Then MoveListViewItemTo(Gadget1,n,Gadget2) : ExitFunction
Next n
EndFunction
MoveListViewItemTo(Gadget,Item,Gadget2)
Function MoveListViewItemTo(Gadget,Item,Gadget2)
If Item < 0 or Item > GetListViewItemCount(Gadget)-1 Then ExitFunction
Count = GetListViewItemCount(Gadget2)
AddListViewItem Gadget2,GetListViewItemText(Gadget,Item,0),0
SetListViewItemText Gadget2,Count,1,GetListViewItemText(Gadget,Item,1)
SetListViewItemText Gadget2,Count,2,GetListViewItemText(Gadget,Item,2)
SetListViewItemText Gadget2,Count,3,GetListViewItemText(Gadget,Item,3)
RemoveListViewItem Gadget,Item
EndFunction
MoveListViewItemUp(Gadget,Item)
Function MoveListViewItemUp(Gadget,Item)
If Item <= 0 or Item > GetListViewItemCount(Gadget)-1 Then ExitFunction
For n = 0 to 5
n1$ = GetListViewItemText(Gadget,Item ,n)
n2$ = GetListViewItemText(Gadget,Item-1,n)
SetListViewItemText Gadget,Item ,n,n2$
SetListViewItemText Gadget,Item-1,n,n1$
Next n
EndFunction
MoveListViewItemDown(Gadget,Item)
Function MoveListViewItemDown(Gadget,Item)
If Item < 0 or Item => GetListViewItemCount(Gadget)-1 Then ExitFunction
For n = 0 to 5
n1$ = GetListViewItemText(Gadget,Item ,n)
n2$ = GetListViewItemText(Gadget,Item+1,n)
SetListViewItemText Gadget,Item ,n,n2$
SetListViewItemText Gadget,Item+1,n,n1$
Next n
EndFunction
EmptyListView(Gadget)
Function EmptyListView(Gadget)
While GetListViewItemCount(Gadget) > 0
RemoveListViewItem Gadget,0
EndWhile
EndFunction
This information is not included with blue so adding this will give full keybord reading control, (Like Inkey$()) and the ability to use a windows media center remote.
If you manage to make anythink with this, then can you yet me know
Edit: Just added some blue functions for added commands/Gadgets, I'll try and extract some other useful blue functions
WATCH THIS SPACE
Everyone Be Cool, You, Be Cool.