The ToolBar Demo is the perfect way to get started with building cross-platform applications with a single code base. This demo shows you how to set up buttons in a toolbar and design their OnClick events, making it easy to create a consistent look and feel across all your devices. With support for Android, iOS, macOS, Windows, and Linux, the ToolBar Demo is the perfect way to get started with building beautiful, responsive applications.
Download the full cross-platform ToolBar Demo source code on Github.
This demo is part of over 100 cross-platform demos with everything from camera demos to emoji demos and painting demos.
Table of Contents
What is a toolbar control in software development?
A toolbar control is a type of software development element that provides the user with a toolbar, or strip of commands, which can be used to activate certain features or functions within the software. Toolbar controls are often used in grammatical or word-processing software, and typically provide the user with quick access to commonly used features such as bolding, italicizing, or underlining text. In some cases, toolbar controls may also provide more advanced features such as changing the font size or style. While toolbar controls can be beneficial in terms of efficiency, they can also add clutter to a user interface. As such, it is important for developers to carefully consider whether a toolbar control is the best solution for a given software application.
Screenshot
What does the code for the ToolBar demo look lik?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Effects, FMX.Controls.Presentation; type TForm1 = class(TForm) MaterialOxfordBlueSB: TStyleBook; <strong> ToolBar1: TToolBar;</strong> ShadowEffect4: TShadowEffect; Label1: TLabel; <strong> RemoveButton: TButton; AddButton: TButton;</strong> Label2: TLabel; <strong> procedure AddButtonClick(Sender: TObject); procedure RemoveButtonClick(Sender: TObject);</strong> private { Private declarations } public { Public declarations } <strong> FValue: Integer; procedure UpdateLabel(AValue: Integer);</strong> end; var Form1: TForm1; implementation {$R *.fmx} <strong>procedure TForm1.UpdateLabel(AValue: Integer); begin Label2.Text := AValue.ToString; end; procedure TForm1.RemoveButtonClick(Sender: TObject); begin Dec(FValue); UpdateLabel(FValue); end; procedure TForm1.AddButtonClick(Sender: TObject); begin Inc(FValue); UpdateLabel(FValue); end;</strong> end. |
Ready to learn how to program cross-platform apps like this?
Sign up for the Coding Boot Camp 2022 to learn to program. Topics include: Games, JavaScript, Web, Python, SQL, Databases, iOS, MacOS, Android, Mobile, Linux, Windows, Desktop, Server, and Arduino.
Design. Code. Compile. Deploy.
Start Free TrialUpgrade Today
Free Delphi Community EditionFree C++Builder Community Edition