Skill Sprint: Unlocking the Windows Runtime (WinRT) and Universal Windows Platform (UWP) on Windows 10

by Nov 24, 2015

 

What is the Windows Runtime (WinRT)?

  • Introduced in Windows 8
  • Default program interface
  • Object Oriented API
  • Native Code API
  • Does not replace Win32
  • Not part of .NET
  • Not managed code
  • Not a tablet version of Windows (WindowsRT)
  • Only way to access some features of Windows 10
  • Asynchronous
    • Non blocking > 50ms

Notifications in Windows 10

Notifications

  • Moved to System.Notifications
  • Works with VCL, RTL and all app types
  • Immediate or scheduled notifications
  • Start menu shortcut required to relaunch app

Share Contract on Windows 10

Share

  • Share content to other apps
  • Act as a source
  • Share text, images, links, etc.
  • Share to email or other apps
  • Include meta information: titles, building and attachments
  • TSharingContract (VCL) or TShareContract (RTL)
  • http://embt.co/using_share_contract 

Windows Runtime (WinRT) API Interfaces

  • WinRT Interfaces found in source\rtl\win\winrt folder
  • Referenced by Interface for automatic reference counting
  • Helpers like TWindowsString in System.Win.WinRT
  • Many classes have default parameterless constructors
  • Use .Factory to access other constructors 
  • Use .Statics to access static members of class

Windows 10 UI/UX Elements

  • VCL & FMX Styles
  • VCL Controls
    • TActivityIndicator – Similar to FMX TAniIndicator
    • TRelativePanel – Controls position based on relative position
    • TSearchBox – Used to manually search or filter other controls
    • TSplitView – Similar to FMX MultiView
    • TToggleSwitch – Similar to FMX TSwitch
  • FireMonkey Platform Native Rendering Architecture

FireMonkey Platform Native Rendering Architecture

Currently available on iOS and Windows (version 7+) http://embt.co/fmx_native_win_controls 

Platform_Rendering

FireMonkey Windows 10 Styles

FMX_Win10_Styles

http://embt.co/fmx-styles  

VCL Animated Activity Indicator TActivityIndicator

  • TActivityIndicator in Vcl.WinXCtrls
  • Similar to FMX TAniIndicator
  • Customizable
    • Three indicator types
    • Four sizes
    • Two colors
    • Adjustable frame delay
  • http://embt.co/TActivityIndicator

VCL Relative Layout Panel – TRelativePanelTRelativePanel

  • Controls position based on relative position
  • Set position via ControlCollection
  • Find child control with IndexOf()
  • Or at design time use properties
    • Align[xx]WithPanel: Boolean
    • Above: [Sibling]
    • Align[xx]With: [Sibling]
    • LeftOf: [Sibling]
  • http://embt.co/TRelativePanel  

VCL SearchBox – TSearchBoxTSearchBox

  • Includes search indicator
    • Text and Audio indicators
  • Has OnInvokeSearch event
  • Used to manually search or filter other controls
  • See also FMX.TSearchBox
  • http://embt.co/TSearchBox 

VCL Split View – TSplitView

TSplitView

  • Similar to FMX MultiView
  • Adjustable behaviors, placements and style
  • Can contain any other controls
  • Animated expand and collapse

VCL Toggle Switch – TToggleSwitchTToggleSwitch

  • Similar to FMX TSwitch
  • Custom captions
  • Custom colors
  • Resizable elements
  • Disabled and Read-Only
    • Property State: tssOn or tssOff
    • Function IsOn: Boolean

VCL Windows 10 Styles

VCL_Win10_Styles

http://embt.co/vcl-styles-overview 

C++Builder Windows 10 WinRT Headers 

Available via GetIt http://embt.co/getit-manager 

GetItWin10CPP

What is Universal Windows Platform (UWP) 

  • Mostly a marketing term (overloaded meaning)
  • Apps built with WinRT
  • Full access to platform
  • Allows for Windows store distribution 
  • Sandboxed execution/user safety
  • Automatic updates
  • Requires universal AppID
  • Project Centennial will bridge Win32 to UWP

Learning Resources

Replay coming soon.

[DownloadButton Product=’Delphi’ Caption=’Download the trial and follow along!’]