Class

iOSToolButton


Warning

This item was deprecated in version 2020r2. Please use MobileToolbarButton as a replacement.

Description

A button to add to a Toolbar or Navigation Bar on a View.

Properties

Name

Type

Read-Only

Shared

Caption

Text

Enabled

Boolean

Image

iOSImage

Tag

Auto

Type

Types

Width

Double

Methods

Name

Parameters

Returns

Shared

Constructor

type As iOSToolButton, title As String = "", image As Picture = Nil

FixedSpace

iOSToolButton

FlexibleSpace

iOSToolButton

Handle

Ptr

NewFromHandle

handle As Ptr

iOSToolButton

NewSystemItem

type As iOSToolButton

iOSToolButton

Enumerations

iOSToolButton.Types

Types

System icons to use when creating buttons using NewSystemItem.

Enum

Description

SystemAction

Uses system icon to indicate an action.

SystemAdd

Uses system icon to indicate an add.

SystemBookmarks

Uses system icon to indicate a bookmark.

SystemCamera

Uses system icon to indicate the camera.

SystemCancel

Uses localized text for "Cancel".

SystemCompose

Uses system icon to indicate a new document.

SystemDone

Uses localized text for "Done".

SystemEdit

Uses localized text for "Edit".

SystemFastForward

Uses system fast forward icon.

SystemFixedSpace

Adds a fixed space for separating icons.

SystemFlexibleSpace

A flexible space that pushes icons on the right all the way to the right edge of the toolbar.

SystemOrganize

Uses system icon.

SystemPageCurl

This bar button image can be used only for bar button items placed on toolbars. This type is not recommended for apps that run in iOS 7 and later.

SystemPause

Uses system icon.

SystemPlay

Uses system icon.

SystemRedo

Uses localized text for "Redo".

SystemRefresh

Uses system icon.

SystemReply

Uses system icon.

SystemRewind

Uses system icon.

SystemSave

Uses localized text for "Save".

SystemSearch

Uses system icon.

SystemStop

Uses system icon.

SystemTrash

Uses system icon.

SystemUndo

Uses localized text for "Undo".

Property descriptions


iOSToolButton.Caption

Caption As Text

Sets the caption for the button. If you have both a Caption and Image specified, then only the Image appears.


iOSToolButton.Enabled

Enabled As Boolean

Enables or disables the button.

Add a disabled "Save" button to the toolbar:

Var saveButton As iOSToolbutton
saveButton = iOSToolButton.NewSystemItem(iOSToolbutton.Types.SystemSave)
saveButton.Enabled = False
Self.Toolbar.Add(saveButton)

iOSToolButton.Image

Image As iOSImage

Specifies an image to display for the button. If you have both a Caption and Image specified, then only the Image appears.

Only the mask for the image is used, displayed using the tint color for iOS (currently blue).

Refer to these topics in the Apple iOS Human Interface Guidelines: * Icon Sizes * Bar Button Icons


iOSToolButton.Tag

Tag As Auto

A tag value.


iOSToolButton.Type

Type As Types

The button type.


iOSToolButton.Width

Width As Double

The button width.

Method descriptions


iOSToolButton.Constructor

Constructor(type As iOSToolButton, title As String = "", image As Picture = Nil)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a button with the specified type, title or image.

Adds the SystemRefresh icon as a toolbar button:

Var tb As New iOSToolbutton(iOSToolbutton.Types.SystemRefresh)
Self.Toolbar.Add(tb)

iOSToolButton.FixedSpace

FixedSpace As iOSToolButton

Creates a fixed space button.

Add a fixed space to separate buttons on a toolbar:

Self.Toolbar.Add(iOSToolButton.NewPlain("Save"))
Self.Toolbar.Add(iOSToolButton.FixedSpace)
Self.Toolbar.Add(iOSToolButton.NewPlain("Edit"))

iOSToolButton.FlexibleSpace

FlexibleSpace As iOSToolButton

Creates a flexible space button.

Add a flexible space to separate buttons:

Self.Toolbar.Add(iOSToolButton.NewPlain("Save"))
Self.Toolbar.Add(iOSToolButton.FlexibleSpace)
Self.Toolbar.Add(iOSToolButton.NewPlain("Reports"))

iOSToolButton.Handle

Handle As Ptr

Returns the iOS handle for use with Declares.


iOSToolButton.NewFromHandle

NewFromHandle(handle As Ptr) As iOSToolButton

Creates a button from an iOS handle to a toolbar button.

Used when creating buttons from Declares to Cocoa Touch.


iOSToolButton.NewSystemItem

NewSystemItem(type As iOSToolButton) As iOSToolButton

Creates a button using a built-in system item icon.

This code in the Open event handler of a view places an Add button in the left Navigation Bar:

' Create the button
Var button As iOSToolButton
button = iOSToolButton.NewSystemItem(iOSToolButton.Types.SystemAdd)

' Add it to the view
LeftNavigationToolbar.Add(button)

Compatibility

iOS projects on the iOS operating system.

See also

Object parent class; MobileToolbar