Ray Konopka Developing Custom.NET Component Designers DevCon 2005 -- Course No: 4106.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Chapter 3 Working with Layers.
Chapter 1: An Introduction to Visual Basic 2012
Using Macros and Visual Basic for Applications (VBA) with Excel
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Chapter 3 Tables and Page Layout
Introducing Cascading Style Sheets  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles  Text Formatting with CSS.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Customizing Outlook. Forms Window in which you enter and view information in Outlook Outlook Form Designer The environment in which you create and customize.
Chapter 4 Adding Images. Inserting and Aligning Images Using CSS When you choose graphics to add to a web page, it’s important to use graphic files in.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Create a New Application and Project Open the Create Application dialog. Enter the application name of your choice and the directory. Select No Template.
Lesley Bross, August 25, 2010 ArcGIS 10 Add-In Components and Controls.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Chapter 3 Working with Symbols and Interactivity.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Creating a Web Site to Gather Data and Conduct Research.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Working with Symbols and Interactivity
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Dreamweaver MX. 2 Overview of Templates n Templates represent a web page design or _______ that will be common to multiple pages. n There are two situations.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Adobe Photoshop CS Design Professional WITH LAYERS WORKING.
Dm 11 – Photoshop WITH LAYERS WORKING. Chapter B Getting Started with PhotoShop 7.02 Examine and convert layers Examine and convert layers Add and delete.
HTML Comprehensive Concepts and Techniques Second Edition.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
1 Chapter Ten Using Controls. 2 Objectives Learn about Controls How to create a Form containing Labels How to set a Label’s Font How to add Color to a.
Applications Development
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Introducing Cascading Style Sheets. Cascading Style Sheet Basics  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles.
Ray Konopka Developing Custom VCL and VCL.NET Component Designers DevCon Course No: 3146.
Graphical Enablement In this presentation… –What is graphical enablement? –Introduction to newlook dialogs and tools used to graphical enable System i.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
Ray Konopka Creating Custom Microsoft.NET Framework Controls in Delphi.
Ray Konopka Developing Custom.NET Components DevCon Course No: 3118.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Layers.
14 Copyright © 2004, Oracle. All rights reserved. Enhancing the User Interface.
Windows Programming C# Software Development. Overview  DLLs / PInvoke  DirectX .NET Component Library  Custom Controls  Event Model (in C++)  GUI.
Chapter 2 Working with Layers. Chapter Lessons Examine and convert layers Add and delete layers Add a selection from one image to another Organize layers.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
CSCI 6962: Server-side Desig n and Programming ASP Server Controls.
Menus. Menus are a common user interface component in many types of applications. The options menu is the primary collection of menu items for an activity.
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2015
Using Procedures and Exception Handling
Exercise 24 – Software Skills
Presentation transcript:

Ray Konopka Developing Custom.NET Component Designers DevCon Course No: 4106

2 Agenda Component Techniques Type Converters UI Type Editors Designers Component Techniques Type Converters UI Type Editors Designers

3 DesignMode DesignMode is true if the component is currently be used at design-time NOTE DesignMode should not be checked from within the constructor or any code called from the constructor. Constructor called before component assigned to a site. Site determines whether component is in design mode or not. DesignMode is true if the component is currently be used at design-time NOTE DesignMode should not be checked from within the constructor or any code called from the constructor. Constructor called before component assigned to a site. Site determines whether component is in design mode or not.

4 Attributes Attributes used to modify the behavior of properties, methods, events, classes, etc. [ Category( 'Appearance' ) ] [ Description( 'The width of buttons, in pixels.' ) ] [ DefaultValue( 18 ) ] property ButtonWidth: Integer read... write...; [ Category( 'Appearance' ) ] [ Description( 'The width of buttons, in pixels.' ) ] [ DefaultValue( 18 ) ] property ButtonWidth: Integer read... write...;

5 Component Related Attributes Category Specify category property will be grouped in Object Inspector Description Specify a short description displayed when associated property is selected in Object Inspector Browsable Determines whether the associated property is visible in Object Inspector public vs. published. Category Specify category property will be grouped in Object Inspector Description Specify a short description displayed when associated property is selected in Object Inspector Browsable Determines whether the associated property is visible in Object Inspector public vs. published.

6 Component Related Attributes ReadOnly Determines if associated property can be edited in Object Inspector. DefaultValue Specify a value to be considered “default” for the property Localizable Property value can be localized without modifying the source code ReadOnly Determines if associated property can be edited in Object Inspector. DefaultValue Specify a value to be considered “default” for the property Localizable Property value can be localized without modifying the source code

7 Component Related Attributes MergableProperty Determines if associated property is visible when multiple components are selected RefreshProperties Associate with a property that changes other property values DefaultEvent Specify event the form designer will hook up when the control is double-clicked. MergableProperty Determines if associated property is visible when multiple components are selected RefreshProperties Associate with a property that changes other property values DefaultEvent Specify event the form designer will hook up when the control is double-clicked.

8 Component Related Attributes ToolboxBitmap Associate an image with the component for display in a toolbox 16x16 pixel 16-color image or icon added to assembly as a resource ToolboxBitmap Associate an image with the component for display in a toolbox 16x16 pixel 16-color image or icon added to assembly as a resource

9 Component Palette Images Typically avoid using ToolboxBitmap Instead, just add bitmap or icon file to your assembly project (In Delphi) Filename must match name of component class and include the namespace Raize.Samples.WinForms.Delphi.RkSpinner.bmp Typically avoid using ToolboxBitmap Instead, just add bitmap or icon file to your assembly project (In Delphi) Filename must match name of component class and include the namespace Raize.Samples.WinForms.Delphi.RkSpinner.bmp

10 Type Converters System.ComponentModel.TypeConverter Performs similar role to VCL Property Editors Convert one type to another and back Integer String Enum String Property Inspector uses a type converter for each property displayed Can be used outside of design environment Examples StringConverter, Int32Converter, DateTimeConverter System.ComponentModel.TypeConverter Performs similar role to VCL Property Editors Convert one type to another and back Integer String Enum String Property Inspector uses a type converter for each property displayed Can be used outside of design environment Examples StringConverter, Int32Converter, DateTimeConverter

11 Custom TypeConverters TypeConverters can also handle complex properties e.g. sub-properties TypeConverters can also handle complex properties e.g. sub-properties Hand = class private FLineColor: Color; FWidth: Integer; public constructor Create( aLineColor: Color; aWidth: Integer ); published property LineColor: Color read FLineColor write FLineColor; property Width: Integer read FWidth write FWidth; end; Hand = class private FLineColor: Color; FWidth: Integer; public constructor Create( aLineColor: Color; aWidth: Integer ); published property LineColor: Color read FLineColor write FLineColor; property Width: Integer read FWidth write FWidth; end;

12 Create Custom TypeConverter Descend from TypeConverter or descendant Override appropriate methods CanConvertFrom ConvertFrom ConvertTo Associate converter with property using TypeConverter attribute Descend from TypeConverter or descendant Override appropriate methods CanConvertFrom ConvertFrom ConvertTo Associate converter with property using TypeConverter attribute

13 Example RkClock HourHand, MinuteHand, SecondHand properties No Converter Basic Text Converter ExpandableObjectConverter RkClock HourHand, MinuteHand, SecondHand properties No Converter Basic Text Converter ExpandableObjectConverter

14 Serialization with TypeConverters Hand properties are displayable in Property Inspector But even if you make changes, they are not serialized Need to do some extra steps Create a private ShouldSerialXxxx method Create a private ResetXxxx method Return an InstanceDescriptor in ConvertTo method Hand properties are displayable in Property Inspector But even if you make changes, they are not serialized Need to do some extra steps Create a private ShouldSerialXxxx method Create a private ResetXxxx method Return an InstanceDescriptor in ConvertTo method

15 Example Enhanced HandTypeConverter.ConvertTo method

16 UITypeEditors Provides enhanced editing capabilities in Property Inspector Also similar to VCL Property Editors System.Drawing.Design.UITypeEditor Examples FontEditor ColorEditor ImageEditor Provides enhanced editing capabilities in Property Inspector Also similar to VCL Property Editors System.Drawing.Design.UITypeEditor Examples FontEditor ColorEditor ImageEditor

17 Custom UITypeEditors Create a descendant class Override GetEditStyle method UITypeEditorEditStyle.DropDown UITypeEditorEditStyle.Modal UITypeEditorEditStyle.None Override EditValue Optionally override additional methods GetPaintValueSupported PaintValue Associate with property with Editor attribute Create a descendant class Override GetEditStyle method UITypeEditorEditStyle.DropDown UITypeEditorEditStyle.Modal UITypeEditorEditStyle.None Override EditValue Optionally override additional methods GetPaintValueSupported PaintValue Associate with property with Editor attribute

18 Example RkLabel with StringEditor

19 Designers Similar in function to VCL Component Editors System.ComponentModel.Design.ComponentDesigner System.Windows.Forms.Design.ControlDesigner System.Web.UI.Design.ControlDesigner Handles Design-Time Display changes Context Menu Items Design-Time only properties Similar in function to VCL Component Editors System.ComponentModel.Design.ComponentDesigner System.Windows.Forms.Design.ControlDesigner System.Web.UI.Design.ControlDesigner Handles Design-Time Display changes Context Menu Items Design-Time only properties

20 Custom Designers Descend from appropriate base class Override Various methods OnPaintAdornments PreFilterProperties DesignerVerbs Descend from appropriate base class Override Various methods OnPaintAdornments PreFilterProperties DesignerVerbs

21 Example RkClockDesigner OnPaintAdornments Design-Time Only Property RkClockDesigner OnPaintAdornments Design-Time Only Property

22 The Finish Line Contact Information Evaluation Forms Questions & Answers Contact Information Evaluation Forms Questions & Answers Ray Konopka Ray Konopka