Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="layout">The layout to layout.</param>
        /// <param name="totalWidth">Total width of layout space.</param>
        /// <param name="totalHeight">Total width of layout space.</param>
        /// <param name="keySize">The size of a standard key.</param>
        protected LayoutContext(KeyboardLayout layout, double totalWidth, double totalHeight, double keySize)
        {
            this.layout = layout;
            Left        = (totalWidth - layout.KeyWidth * keySize) / 2;
            Top         = (totalHeight - layout.KeyHeight * keySize) / 2;

            KeySize = keySize;

            Debug.Assert(allStates.Count == 0, "All available states has not been initialised");
            layout.GatherKeyboardStates(allStates);

            foreach (var state in allStates)
            {
                otherShowHides[state] = new StateShowHideContainer <TControl>();
            }
        }
Example #2
0
 /// <summary>
 /// Create an instance of the control type.
 /// </summary>
 /// <param name="layout">The control layout.</param>
 /// <param name="list">The show/hide list</param>
 /// <param name="top">Top position within layout space.</param>
 /// <param name="left">Left position within layout space.</param>
 /// <param name="height">Bottom position within layout space.</param>
 /// <param name="width">Right position within layout space.</param>
 /// <param name="isVisible">Is the control initially visible?</param>
 /// <returns>The control.</returns>
 protected abstract TControl CreateStateControl(StateKeyLayout layout, StateShowHideContainer <TControl> list, double left, double top, double width, double height, bool isVisible);