Example: /MacCF/IOPowerSources

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCF/IOPowerSources


Required plugins for this example: MBS MacCF Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/IOPowerSources

This example is the version from Fri, 15th Jun 2017.

Project "IOPowerSources.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() p = new MyIOPowerSourcesMBS update End EventHandler
Sub Update() dim d as CFDictionaryMBS dim o as CFObjectMBS dim i,c as integer list.DeleteAllRows List.AddRow str(p.count)+" Power sources." List.AddRow "" for i=0 to p.Count-1 List.AddRow "Power Source "+str(i+1) d=p.Item(i) // show on the console CFShowMBS d if p<>Nil then o=d.Value(NewCFStringMBS("Current Capacity")) if o isa CFNumberMBS then List.AddRow "CurrentCapacity: "+str(CFNumberMBS(o).integerValue) end if o=d.Value(NewCFStringMBS("Name")) if o isa CFStringMBS then List.AddRow "Name: "+CFStringMBS(o).str end if o=d.Value(NewCFStringMBS("BatteryHealth")) if o isa CFStringMBS then List.AddRow "Battery Health: "+CFStringMBS(o).str end if end if List.AddRow "" next End Sub
Property p As iopowerSourcesMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class MyIOPowerSourcesMBS Inherits IOPowerSourcesMBS
EventHandler Sub Changed() MainWindow.update End EventHandler
End Class
End Project

The items on this page are in the following plugins: MBS MacCF Plugin.


💬 Ask a question or report a problem