Where OO meets the GUI for.NET Its new, its different, its still just ABL Session 135 Peter Judge Principal Software Engineer OpenEdge Development.

Презентация:



Advertisements
Похожие презентации
OpenEdge ® GUI for.NET Modernize your user interface with ABL Shelley Chase OpenEdge Architect Progress Software Corporation Session 113.
Advertisements

1 When And How To Make Interfaces Work For You Advanced OO Techniques Alex Herbstritt Principal Software Engineer, Progress Software Session 102.
Structured Error Handling in the ABL Sarah Marshall QA Architect, OpenEdge Session 128.
MARK INFORMATION R & D Tales from the Trenches: Using the GUI for.NET Session 109 Niels Bredegaard.
Lets look at some interesting and popular devices which have touchscreens.
Be The Most Productive Developer You Can Be! Kristen Howell OpenEdge Product Manager Matt Baker Principal Software Engineer Session 108.
Using Dreamweaver MX Slide 1 Window menu Manage Sites… Window menu Manage Sites… 2 2 Open Dreamweaver 1 1 Set up a website folder (1). Click New…
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Configuring Groups and Policies Configuring Policies.
DB-12 - Pick An Index, Any Index… Michael Lonski Allegro Consultants, LTD.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Customer-to-Provider Connectivity with BGP Connecting a Multihomed Customer to Multiple Service.
11 BASIC DRESS-UP FEATURES. LESSON II : DRESS UP FEATURES 12.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary © Wind River Systems, released under EPL 1.0. All logos are TM of their respective.
© 2009 Avaya Inc. All rights reserved.1 Chapter Three, Voic Pro Advanced Functions Module Four – Voic Campaigns.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Configuring Groups and Policies Building an Agent Kit.
Using Actional with OpenEdge The Zen of Business Transaction Assurance David Cleary Principal Software Engineer – Progress Software Session 116.
© 2009 Avaya Inc. All rights reserved.1 Chapter Three, Voic Pro Advanced Functions Module Three – TAPI.
1 Watch Your Production Environment ( while at Exchange ) using OpenEdge Management Libor Laubacher Principal TSE, Progress Software Session 133.
Welcome to PowerPoint Design and deliver beautiful presentations with ease and confidence.
© 2009 Avaya Inc. All rights reserved.1 Chapter Two, Voic Pro Components Module Two – Actions, Variables & Conditions.
© 2006 Cisco Systems, Inc. All rights reserved. MPLS v Complex MPLS VPNs Introducing Central Services VPNs.
Транксрипт:

Where OO meets the GUI for.NET Its new, its different, its still just ABL Session 135 Peter Judge Principal Software Engineer OpenEdge Development

© 2009 Progress Software Corporation. All rights reserved. What is the GUI for.NET? ABL Code Classes Procedures Built-in objects OE Architect Visual Designer WinForms Controls & components Microsoft UltraControls 3 rd -party 2

© 2009 Progress Software Corporation. All rights reserved. Who does what? OpenEdge Built-in Progress.* classes do the ABL-to-.NET talking All ABL classes inherit Progress.Lang.Object -All.NET classes inherit System.Object … which also inherits Progress.Lang.Object You Composition of UI UI logic Business logic procedures or classes (on AppServer) 3

© 2009 Progress Software Corporation. All rights reserved. Building blocks used by Demo OOABL Classes MainForm ItemUserControl DepartmentDataObject CustomerDataObject SalesrepDataObject.NET Controls OpenEdge built-ins Progress.Windows.Form Progress.Windows.UserControl Progress.Data.BindingSource Microsoft System.Windows.Forms TextBox & Label DataGridView TreeView SplitContainer Panel GroupBox Sports2000 4

© 2009 Progress Software Corporation. All rights reserved. If you can read this, we survived the demo 5

© 2009 Progress Software Corporation. All rights reserved. Form design Start with static nodes Easy resizing & layout Multiple UI elements share ABL data Compose complex controls: ABL User Controls 6

© 2009 Progress Software Corporation. All rights reserved. ProBindingSource: Binding UI controls to ProDataSet data Set DataSource, DataMember on dataGridOrder Set BindingSourceProp on Item detail UserControl edtItemNum:DataBindings:Add(new Binding( "Text", BindingSourceProp, "eOrder.eOrderLine.eItem.ItemNum")). dataGridOrder:DataMember = "eOrder". dataGridOrder:DataSource = bsCustomer. ucItems1:BindingSourceProp = bsCustomer. eCustomer eOrder eOrderLine eItem ItemNum ProDataSet 7

© 2009 Progress Software Corporation. All rights reserved. Interacting with the.NET UI: Handling UI events 8 method private InitializeComponent(): /* lotsa stuff */ treeView1:NodeMouseClick:subscribe(treeView1_NodeMouseClick). method private void treeview1_NodeMouseClick( sender as System.Object, e as TreeNodeMouseClickEventArgs ): System.EventArgs System.Windows.Forms. MouseEventArgs System.Windows.Forms. TreeNodeMouseClickEventArgs Empty : System.EventArgs Button : MouseButtons Clicks : integer Node : TreeNode

© 2009 Progress Software Corporation. All rights reserved. Interacting with the.NET UI: tree node click event handler Everythings an object e:Node - Just Like Any Other Node Object Chained calls Call ABL node creation method Using USING Makes Life Easier! using System.Windows.Forms.*. method private void tree1_NodeMouseClick( sender as System.Object, e as TreeNodeMouseClickEventArgs ): /* Deal with top level (zero-based) */ if e:Node:Level eq 0 then do: cNodeName = e:Node:Name. /* only create the children once. */ if e:Node:Nodes:Count eq 0 then case cNodeName: when 'CustomerNode' then do: CreateCustomerNodes(). DecorateCustomerNodes(). end./* customer */ 8

© 2009 Progress Software Corporation. All rights reserved. CreateCustomerNodes() method oData contains filled ProDataSet DatasetHandle property same as handle variable BindingSource uses ProDataSet Nodes property collection of Node objects Query stuff is all standard ABL Can work on new node def var oParent, oNode as TreeNode. oData = GetCustomerData(). hBuffer = oData:DatasetHandle :get-buffer-handle('eCustomer'). bsCustomer:Handle = oData:DatasetHandle. oParent = treeView1:Nodes:Item['CustomerNode']. /* create ABL query, set buffers */ hQuery:query-prepare ('preselect each eCustomer by Name'). hQuery:query-open(). hQuery:get-first(). do while hBuffer:available: cKey = hBuffer::CustNum. cText = hBuffer::Name. oNode = oParent:Nodes:Add(cKey, cText). oNode:Tag = 'Some extra info'. 10

© 2009 Progress Software Corporation. All rights reserved. DecorateCustomerNodes() method Get node by name or by index Zero-based counting Standard ABL query finds data to manipulate.NET UI Node colour based on business rules def var oCustomerNodes as TreeNodeCollection. oCustomerNodes = treeView1:Nodes['CustomerNode']:Nodes. do iLoop = 0 to oCustomerNodes:Count - 1: oNode = oCustomerNodes[iLoop]. /* hBuffer from oData, as earlier */ hBuffer:find-unique( ' where CustNum = ' + quoter(oNode:Name)). dPercent = hBuffer::Balance / hBuffer::CreditLimit * 100. if dPercent > 90 then oNode:BackColor = System.Drawing.Color:Red. 11

© 2009 Progress Software Corporation. All rights reserved. Customer data binding One BindingSource binds to one ProDataSet providing multi-level data to UI controls Automaticlinked navigation via ProDataSet data-relations WICKED cool, no? Customer BindingSource Orders OrderLines Items 12

© 2009 Progress Software Corporation. All rights reserved. ProBindingSource: Binding UI controls to an ABL query Not using ProDataSets? Use a query instead Can even query PDS data Always single- level to UI Provides data to multiple controls Salesrep BindingSource create query hQuery. hQuery:query-prepare('for each eSalesrep'). bsSalesrep:Handle = hQuery. create query hQuery. hQuery:query-prepare('for each eSalesrep'). bsSalesrep:Handle = hQuery. 13

© 2009 Progress Software Corporation. All rights reserved. Sorting the DataGridView Standard event handler signature Sorting location depends on control, could be on grid or BindingSource Identity is not equality Build standard ABL query off event args Easily make this generic method void BindingSource_SortRequest( sender as System.Object, e as Progress.Data.SortRequestEventArgs): if sender:Equals(bsSalesrep) then do: hQuery = bsSalesrep:Handle. cSortBy = ' by ' + e:FieldName. if not e:Ascending then cSortBy = cSortBy + ' desc '. hQuery:query-prepare ('for each eSalesrep ' + cSortBy). hQuery:query-open(). end. end method. method void BindingSource_SortRequest( sender as System.Object, e as Progress.Data.SortRequestEventArgs): if sender:Equals(bsSalesrep) then do: hQuery = bsSalesrep:Handle. cSortBy = ' by ' + e:FieldName. if not e:Ascending then cSortBy = cSortBy + ' desc '. hQuery:query-prepare ('for each eSalesrep ' + cSortBy). hQuery:query-open(). end. end method. 14

© 2009 Progress Software Corporation. All rights reserved. Alternate controls: same data, same business logic, much prettier, different & more features Microsoft controls do the basics Vendor-specific functionality Grouping, multi-column sorting, multi-level browsing Filters, aggregates Themes / skins 15 Presentation layer design opportunity: OERA, MVP et al

© 2009 Progress Software Corporation. All rights reserved. What you see is.NET, what you get is ABL.NET … Paints stuff on screen Fires UI events : Click, Resize, Sort ABL … Works with data -Temp-tables, queries, ProDataSets -Built-in ProBindingSource talks both ways Handles UI events Invokes methods & classes, set properties -Same on all types: OO ABL and.NET 16

© 2009 Progress Software Corporation. All rights reserved. Where can I learn more? Right here at ExchangeOnlineOhNine Shelley Chases Introducing OpenEdge GUI for.NET Alex Herbstritts Advanced OO Techniques Niels Bredegaards Tales from the Trenches: Using the GUI for.NET OpenEdge Documentations Getting Started books Object Oriented Programming Introducing the OpenEdge Architect Visual Designer GUI for.NET Mapping Reference GUI for.NET Programming OpenEdge Architect : Class browser, help files, etc Progress Communities discussions (forums) 3 rd party control vendors documentation, support, forums MSDN 17

© 2009 Progress Software Corporation. All rights reserved. Conclusion Pretty easy, right? Its Just ABL … and youre all experts in ABL From the ABL, you dont care if its.NET 18

© 2009 Progress Software Corporation. All rights reserved. Peter Judge Principal Software Engineer, OpenEdge Development 19