File: u_tabpage_systeminfo.sru
Size: 4043
Date: Tue, 22 Aug 2017 17:30:58 +0200
$PBExportHeader$u_tabpage_systeminfo.sru
forward
global type u_tabpage_systeminfo from u_base_tabpage
end type
type cb_gettemppath from u_base_button within u_tabpage_systeminfo
end type
type cb_powerstatus from u_base_button within u_tabpage_systeminfo
end type
type cb_storagestatus from u_base_button within u_tabpage_systeminfo
end type
type cb_memorystatus from u_base_button within u_tabpage_systeminfo
end type
type cb_osversion from u_base_button within u_tabpage_systeminfo
end type
end forward

global type u_tabpage_systeminfo from u_base_tabpage
integer height = 1216
string text = "System Info"
cb_gettemppath cb_gettemppath
cb_powerstatus cb_powerstatus
cb_storagestatus cb_storagestatus
cb_memorystatus cb_memorystatus
cb_osversion cb_osversion
end type
global u_tabpage_systeminfo u_tabpage_systeminfo

type variables
n_rapi in_rapi

end variables

on u_tabpage_systeminfo.create
int iCurrent
call super::create
this.cb_gettemppath=create cb_gettemppath
this.cb_powerstatus=create cb_powerstatus
this.cb_storagestatus=create cb_storagestatus
this.cb_memorystatus=create cb_memorystatus
this.cb_osversion=create cb_osversion
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.cb_gettemppath
this.Control[iCurrent+2]=this.cb_powerstatus
this.Control[iCurrent+3]=this.cb_storagestatus
this.Control[iCurrent+4]=this.cb_memorystatus
this.Control[iCurrent+5]=this.cb_osversion
end on

on u_tabpage_systeminfo.destroy
call super::destroy
destroy(this.cb_gettemppath)
destroy(this.cb_powerstatus)
destroy(this.cb_storagestatus)
destroy(this.cb_memorystatus)
destroy(this.cb_osversion)
end on

type cb_gettemppath from u_base_button within u_tabpage_systeminfo
integer x = 37
integer y = 672
integer taborder = 50
integer textsize = -8
string text = "Get Temp Path"
end type

event clicked;call super::clicked;String ls_path

If in_rapi.of_Connect() Then
   ls_path = in_rapi.of_GetTempPath()
   in_rapi.of_Disconnect()
   MessageBox("Temp Path", ls_path)
End If

end event

type cb_powerstatus from u_base_button within u_tabpage_systeminfo
integer x = 37
integer y = 512
integer taborder = 40
integer textsize = -8
string text = "Power Status"
end type

event clicked;call super::clicked;Boolean lb_acpower
String ls_battery
Integer li_pct

If in_rapi.of_Connect() Then
   in_rapi.of_GetPowerStatus(lb_acpower, ls_battery, li_pct)
   in_rapi.of_Disconnect()
   If lb_acpower Then
      MessageBox( "Power Status", &
                  "On AC Power, Status: " + ls_battery )
   Else
      MessageBox( "Power Status", &
                  "On Battery Power, " + &
                  "Status: " + ls_battery + ", Pct: " + &
                  String(li_pct) + "%" )
   End If
End If

end event

type cb_storagestatus from u_base_button within u_tabpage_systeminfo
integer x = 37
integer y = 352
integer taborder = 30
integer textsize = -8
string text = "Storage Status"
end type

event clicked;call super::clicked;Decimal{4} ldec_pct
String ls_pct

If in_rapi.of_Connect() Then
   ldec_pct = in_rapi.of_GetStoreStatus()
   in_rapi.of_Disconnect()
   ls_pct = String(ldec_pct * 100, "0.0#") + "%"
   MessageBox("Free Storage Memory", ls_pct)
End If

end event

type cb_memorystatus from u_base_button within u_tabpage_systeminfo
integer x = 37
integer y = 192
integer taborder = 20
integer textsize = -8
string text = "Memory Status"
end type

event clicked;call super::clicked;Decimal{4} ldec_pct
String ls_pct

If in_rapi.of_Connect() Then
   ldec_pct = in_rapi.of_GetMemoryStatus()
   in_rapi.of_Disconnect()
   ls_pct = String(ldec_pct * 100, "0.0#") + "%"
   MessageBox("Free Program Memory", ls_pct)
End If

end event

type cb_osversion from u_base_button within u_tabpage_systeminfo
integer x = 37
integer y = 32
integer taborder = 10
integer textsize = -8
string text = "OS Version"
end type

event clicked;call super::clicked;If in_rapi.of_Connect() Then
   MessageBox("OS Version", in_rapi.of_GetVersion())
   in_rapi.of_Disconnect()
End If

end event