Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacOSX/Input Sources
Required plugins for this example: MBS MacOSX Plugin, MBS Picture Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Input Sources
This example is the version from Fri, 8th Nov 2012.
Project "Input Sources.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() test1 test2 End EventHandler
Sub Fill(w as window1, a() as TextInputSourceMBS) dim list as listbox = w.List for each t as TextInputSourceMBS in a dim s,e as string if t.IsEnabled then e = "yes" else e = "no" end if if t.IsSelected then s = "yes" else s = "no" end if dim c as string Select case t.Category case t.kTISCategoryInkInputSource c = "Ink" case t.kTISCategoryKeyboardInputSource c = "Keyboard" case t.kTISCategoryPaletteInputSource c = "Palette" else // unknown c = t.Category end Select dim lang as string = join(t.SourceLanguages, ", ") list.AddRow "", t.LocalizedName, c, e, s, lang dim icon as IconMBS = t.Icon dim ee as Integer = t.Lasterror if icon<>Nil then // icon object dim f as IconFamilyMBS = icon.IconFamily dim pic, mask as Picture call f.GetIconImage(16, pic, mask) if pic<>Nil then pic.mask.Graphics.DrawPicture mask,0,0 list.RowPicture(list.LastIndex) = pic end if else // icon file dim f as FolderItem = t.IconImageFile if f<>Nil then dim p as Picture = Picture.Open(f) if p<>Nil then list.RowPicture(list.LastIndex) = p end if end if end if next End Sub
Sub test1() dim a() as TextInputSourceMBS = TextInputSourceMBS.CreateASCIICapableInputSourceList dim w as new window1 w.Title = "Input List" fill w, a End Sub
Sub test2() dim a() as TextInputSourceMBS = TextInputSourceMBS.CreateInputSourceList(nil, true) dim w as new window1 w.Title = "All" fill w, a End Sub
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

Feedback, Comments & Corrections

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

MBS Xojo Plugins