Categories
MVP

What MVPs Are Saying about Delphi and C++Builder 10 Seattle

Our Embarcadero MVPs are all over the world, and a few of them wanted to share their impressions of Delphi and C++Builder 10 Seattle.

Jens Fudge, Archersoft Aps in Denmark says:

Delphi 10 Seattle is a great product. My favourite development tool indeed, with many nifty utilities that you need to know

Raouf Rahiche in Algeria has a review in Arabic

Roman Kassebaum from Germany, the maintainer of TurboPack, reports on libraries updated to Delphi and C++Builder 10 Seattle.

Radek Cervinka from Czech Republic has a few Delphi 10 Seattle related posts.

Sanghyun Oh of Devgear in Seoul, Korea has some Delphi 10 Seattle related posts in Korean.

Danny Wind of the Delphi Company in Netherlands has some posts on Delphi 10 Seattle in Dutch.

Victory Fernandes of TKS in Salvador Brazil says:

New Delphi 10 Seattle rocks! Spreading the word about Delphi in Brazil!

Xavier Martinez from Andorra has a review on Delphi 10 Seattle in English and in Spanish.

As you can see, the list of improvements is long, so I encourage you to try this new version of Delphi.

Eliseo Gonzalez Nieto of Sistemas CASA in Mexico says the following (Spanish):

Delphi 10 Seattle es la versión que mas me ha gustado por todas las mejoras que se han agregado, destacando la liberación de la RTL que nos permitirá desarrollar aplicaciones listas para Windows 10.

Bruno Fierens of TMS Software in Belgium has their full range of components and libraries updated to work with Delphi and C++Builder 10 Seattle. [Blog in English]

Marcos Antonio Moreira of Unimed Gov. Valadares in Brazil reports:

 The RAD Studio 10 Seattle is fantastic. Its integration with Windows 10 and all the new features that have been incorporated into the tool such as improvements in the IDE, compilers, connectivity and productivity make this the most complete version for Windows development, Mobile and IoT.

Didier Cabalé of DCConseil in France has updates about Delphi 10 Seattle in English.

Landerson Gomes dos Santos in Rio de Janeiro, Brazil says (In Portuguese):

Desde seu lançamento no dia 31 de agosto de 2015, o RAD Studio 10 Seattle vem conquistando o cenário de desenvolvimento rápido de aplicações, acredito eu que nunca um lançamento de versão do RAD foi tão aguardado e comentado como esse.

What do you think of Delphi, C++Builder and RAD Studio 10 Seattle?

Categories
webinar

Skill Sprint: Using FireMonkey Layouts

FireMonkey has many layout controls to choose from. Come learn the differences and how to use them to create dynamic, multi-platform user interfaces.

FireMonkey Layouts with Delphi

FireMonkey Layouts with C++Builder

 

Understanding and using FireMonkey Layouts

FireMonkey and the FireUI makes it easy to build one form to rule all the platforms. Combining layout controls and making use of Anchors, Alignment, Padding and Margins it is easy to make one form that looks and works great on all platforms.

Anchors

  • Position relative to one or more edge(s) of parent:Anchor
    • Top
    • Bottom
    • Left
    • Right
  • Default is Top, Left
  • Moves with parent resize
  • Each control has 0 to 4 anchors

Alignment

  • Aligns control within parent, setting anchors, size and position.
  • Default is None.
  • Anchor and fill along edge:
    • Top, Bottom, Left, Right
  • Fill parent, but preserve aspect ratio:
    • Fit, FitLeft, FitRight
  • Fill along one side of the parent (priority over other edge alignments):
    • MostBottom, MostTop, MostLeft, MostRight
  • Resize only on one axis (width or height)
    • Vertical, VertCenter, Horizontal, HorzCenter
  • Miscellaneous
    • Client – Fills client area, less other children
    • Center – No resize, just centered
    • Contents – Fills client area, ignoring other children
    • Scale – resizes and moves to maintain the relative position and size

Spacing – Margins and Padding

  • MarginsMarginsAndPadding
    • Spacing for siblings (and parent edges)
  • Padding
    • Spacing for children

TFlowLayout

  • Arrange child controls like words in a paragraph
  • Controls arranged in order added to layout
    • Use “Move to Front” or “Send to Back” to reorder
  • Use TFlowLayoutBreak for forced line break

FlowLayout1 FlowLayout2

TGridLayout

  • Arranges child controls in a grid of equal sizes
  • Controls flow through grid as parent resizes
  • Use ItemWidth and ItemHeight properties
  • Customize margins of individual controls

GridLayout2 GridLayout1

TGridPanelLayout

  • Creates a grid of specified rows and columns
  • Does not change the anchor or size of child
  • Each cell can contain 1 child control
  • You set the Height, Width, Align, and Anchors of children
  • Controls can span multiple cells

GridPanelLayout2 GridPanelLayout1

TScaledLayout

  • Stretches child controls as it is resized at runtime
  • Doesn’t respect aspect ratios of controls
  • Set the Align of the TScaledLayout to Fit to maintain aspect ratio
  • Some styles look better zoomed than others. The font grows – it is not a bitmap scale.
  • Has properties for OriginalWidth and OriginalHeight – Compare to Width and Height to determine scaling.

ScaledLayout-Stretch

TScrollBox

TTabControl

  • Control to group child controls into tabs
  • Tabs are in a stack with one visible at a time
  • TabPosition := PlatformDefault to use platform default behavior
  • TabPosition := None to hide navigation
  • Use TTabChangeAction to animate transitions

Frames

  • Reusable pieces of User Interface
    • Includes
      • The layout
      • All the event handlers
      • All the code in the unit
  • Create 1 or more Frames, then reposition based on current layout
    • Examples:
      • In TTabControl for phone
      • Side-by-side for Tablet

TMultiView

  • One super panel with multiple modesMultiView
  • Supported modes
    • PlatformDefault
    • Drawer
    • NavigationPane
    • Panel
    • Popover
    • Custom
  • Point to MasterPane, DetailPane and definable MasterButton
  • PlatformDefault adapts to platform and orientation
  • Custom supports user defined layout and behavior

Learning Resources

ScaledLayout Helper

The AbsoluteToLocal and LocalToAbsolute for TScaledLayout don’t handle the scaling. I’ve created a class helper that adds new methods for dealing with scaling.


{ TScaledLayoutHelper - interface } 

type 
  TScaledLayoutHelper = class helper for TScaledLayout 
    function LocalToAbsoluteScaled(const Point: TPointF): TPointF;
    function AbsoluteToLocalScaled(const Point: TPointF): TPointF; 
  end; 

{ TScaledLayoutHelper - implementation } 

function TScaledLayoutHelper.AbsoluteToLocalScaled( const Point: TPointF): TPointF; 
begin 
  Result.X := Self.Position.X 
              + Point.X 
              * Self.Width 
              / Self.OriginalWidth; 
  Result.Y := Self.Position.Y 
              + Point.Y 
              * Self.Height 
              / Self.OriginalHeight; 
end; 

function TScaledLayoutHelper.LocalToAbsoluteScaled( const Point: TPointF): TPointF; 
begin 
  Result.X := Point.X 
              / Self.Width 
              / Self.OriginalWidth 
              - Self.Position.X; 
  Result.Y := Point.Y 
              / Self.Height 
              / Self.OriginalHeight
              - Self.Position.Y; 
end; 

If you look at the original implementations of AbsoluteToLocal and LocalToAbsolute you will see they have different execution paths and calculations based on private members, so there may be some circumstances where my new ones don’t work as expected. They did work in my tests, and I am open to feedback.

Categories
webinar

Hour of CodinGame with Object Pascal / Delphi

Hour of Code is upon us again. Take some time to learn about programming, or share what you know with others. In this blog post I show how the side CodinGame helps teach Delphi and also provide some resources for those wanting to learn programming.

A short overview to CodinGame for Hour of Code

CodinGame uses Free Pascal behind the scenes, which is based on Delphi. This means it is actually Object Pascal, which is an extension on Pascal. The code I’ve seen on CodinGame is mostly plain procedural Pascal, but since it is using an actual compiler, you should be able to use full Object Pascal. You will however be limited because Free Pascal doesn’t support some of the latest features Delphi does. Still a good learning resource and a lot of fun.

I’m planning to sit down with each of my kids, and probably my wife, on CodinGame this week! If you already know how to code then find someone you can share with too!

Resources for CodinGame and Hour of Code: