MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

KnownTimeZoneNamesAsCFArrayMBS as CFArrayMBS
global method, CoreFoundation, MBS MacOSXCF Plugin (CFDate),
Plugin version: 3.2, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: An array of all known time zone names.
Notes: Returns nil on any error.
MacShowAboutBoxMBS(options as CFDictionaryMBS) as Integer
global method, CoreFoundation, MBS MacOSXCF Plugin (CFDictionaryArray),
Plugin version: 9.3, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Displays an HI-conformant about box.
Example:
dim kHIAboutBoxNameKey as CFStringMBS = NewCFStringMBS("HIAboutBoxName")
dim kHIAboutBoxVersionKey as CFStringMBS = NewCFStringMBS("HIAboutBoxVersion")
dim kHIAboutBoxCopyrightKey as CFStringMBS = NewCFStringMBS("HIAboutBoxCopyright")
dim kHIAboutBoxDescriptionKey as CFStringMBS = NewCFStringMBS("HIAboutBoxDescription")
dim kHIAboutBoxStringFileKey as CFStringMBS = NewCFStringMBS("HIAboutBoxStringFile")

dim d as CFMutableDictionaryMBS

d=NewCFMutableDictionaryMBS

// name, version and copyright are optional:
d.add(kHIAboutBoxNameKey, NewCFStringMBS("MyApp"))
d.add(kHIAboutBoxVersionKey, NewCFStringMBS("1.0"))
d.add(kHIAboutBoxCopyrightKey, NewCFStringMBS("© 2009 by Christian Schmitz"))

// description is needed
d.add(kHIAboutBoxDescriptionKey, NewCFStringMBS("The best application I ever made!"))

// optional
'd.add(kHIAboutBoxStringFileKey, NewCFStringMBS("somefile"))

MsgBox Str(MacShowAboutBoxMBS(d))
Notes:
This about box is a generic about box that automatically can display your application name, version string, and copyright string. It peeks into either the Info.plist (for the CFBundleName, CFBundleVersion, and CFBundleGetInfoString keys) or your bundle resource (not recommended) to get the information by default. You can customize what it displays by passing in various options in the input dictionary. Note that currently the description string can only be specified in the options dictionary; this function does not check your Info.plist for a descriptions string.

There are three basic ways to call this function. First, you can pass nil for inOptions. As mentioned, default information will be displayed. Second, you can pass the actual values for the strings displayed by passing the strings in the inOptions dictionary using the keys provided, such as kHIAboutBoxNameKey. If a replacement string is not passed, the default behavior kicks in. For example, you could pass some variant of your application name in the dictionary, but not pass a replacement version or copyright strings. The Toolbox would display your replacement string, and fall back to looking in the Info.plist for the other strings. The third way to call this is to pass the name of a string file in the dictionary with the key kHIAboutBoxStringFileKey. We will automatically use that file to find the strings for the about box. The keys in the string file should be the same value as the keys you would use to pass into the inOptions dictionary. Again, if a string is not found in that file, we would fall back to looking for a string in the dictionary, and then finally the Info.plist. Certainly this is not the be-all-end-all of about boxes, but it does provide a simple no-work about box for your application. The standard Toolbox application handler now responds to the kHICommandAbout command ID by calling HIAboutBox for you. This means that any Carbon Event-based application will get this behavior for free right out of the box. If you wish for the window to respond to cmd-W in the menu bar, you should make sure that menu item has the kHICommandClose commandID.

Options: A dictionary of replacement strings, or the name of a string file to retrieve the strings from, or nil. See the discussion for how this is used.

Returns a Mac OS error code or -1 if function is not available.
Not supported on 64 bit targets.
SetDefaultCFTimeZoneMBS(timezone as CFTimeZoneMBS)
global method, CoreFoundation, MBS MacOSXCF Plugin (CFDate),
Plugin version: 3.2, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: The default time zone.
Example:
msgBox str(GetDefaultCFTimeZoneMBS.SecondsFromGMT(nil).Value)
Notes: Returns nil on any error.
SystemCFTimeZoneMBS as CFTimeZoneMBS
global method, CoreFoundation, MBS MacOSXCF Plugin (CFDate),
Plugin version: 3.2, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: The current system time zone.
Example:
dim s as CFTimeZoneMBS
s=SystemCFTimeZoneMBS
MsgBox s.Name.str
Notes: Returns nil on any error.

Some examples using this method:

Some FAQ entries about this method:

TypeIDDescriptionMBS(TypeID as Integer) as CFStringMBS
global method, CoreFoundation, MBS MacOSXCF Plugin (CF),
Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Returns a string with the name for the CoreFoundation data type.
Notes: e.g. "CFStringMBS" for a CFStringMBS.

Previous items

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




Links
MBS Xojo Chart Plugins