FMX.DataCube Sample
From RAD Studio XE2 Code Examples
This is a sample that shows how to work with Firemonkey LiveBinding, in order to enter data into a 3D application.
Contents |
Location
You can find the DataCube Sample project at:
- Start | Programs | Embarcadero RAD Studio XE2 | Samples and then navigate to FireMonkey\DataCube
- Subversion Repository for Delphi: http://radstudiodemos.svn.sourceforge.net/viewvc/radstudiodemos/branches/RadStudio_XE2/FireMonkey/DataCube
Description
This application uses TStringGrid, TImageControl and TBindDBGridLink and shows how to introduce some information into the box planes and how you can access it.
How to Use the Sample
- Navigate to Start | Programs | Embarcadero RAD Studio XE2 | Samples, then navigate to FireMonkey\DataCube and open DataRoom.dproj.
- Press F9 or choose Run > Run.
Classes
Data Room represents the main window of the sample. It contains the following components:
- A TScrollBar, a TCamera, a TLayout3D, a TViewport3D, a TBindingsList, a TImageControl, a TBindDBImageLink, a TMemo, a TBindDBMemoLink and a TTimer
- Four TLight objects
- Six TLayer3D objects
- Five TPlane objects
- Three TCheckBox objects
- Three TClientDataSet objects
- Three TDataSource objects
- Three TStringGrid objects
- Three TBindScopeDB objects
- Three TBindDBGridLink objects.
Implementation
- When you run the application, the main window of the sample is displayed. You can see the five planes of the cube: BackPlane, BottomPlane, LeftPlane, RightPlane and TopPlane.
- All the TPlane objects are filled with data. The data is imported from a database. For more details, consult the Using LiveBinding to Create an Application Without Code tutorial.
- The BackPlane contains a TStringGrid object with information about every fish category.
- The LeftPlane contains a TStringGrid object with information about the company customers.
- The RightPlane contains a TStringGrid object with information about the currently selected fish.
- The TopPlane contains a TStringGrid object with information about the company orders.
- The BottomPlane contains a TImageControl object, where the picture of the currently selected fish is displayed.
- Check one of the TCheckBox objects named Rotate box around X/Y/Z axis, and observe how the box rotates around the corresponding axis.
- Move the scroll from the TScrollBar object labeled Speed in order to increase or decrease the rotation speed.
- Uncheck the TCheckBox object, and the rotation stops.
- From the back plane of the box, select another item (fish name) from the column named Category. The image of the selected fish is displayed on the bottom plane, and some details about the selected fish category are displayed on the right plane.
Uses
- FMX.Types3D.TLight
- FMX.Layers3D.TLayer3D
- FMX.ObjectsTypes3D.TPlane
- FMX.Controls.TScrollBar
- FMX.Types3D.TCamera
- FMX.Layers3D.TLayout3D
- FMX.Controls.TCheckBox
- FMX.Types3D.TViewport3D
- Datasnap.DBClient.TClientDataSet
- Data.DB.TDataSource
- FMX.Grid.TStringGrid
- Data.Bind.Components.TBindingsList
- Data.Bind.DBScope.TBindScopeDB
- FMX.Controls.TImageControl
- FMX.Bind.DBLinks.TBindDBImageLink
- FMX.Memo.TMemo
- FMX.Bind.DBLinks.TBindDBMemoLink
- FMX.Bind.DBLinks.TBindDBGridLink
- FMX.Types.TTimer