Using Context Sensitive Menus to Enter Values in a SAS/AF Data Table Object Richard A. DeVenezia.

Slides:



Advertisements
Similar presentations
Home This training presentation is designed to introduce the Residency Management Suite to new users. This presentation covers the following topics: Login.
Advertisements

Copyright © 2005, Richard A. DeVenezia. All rights reserved. SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries.
Benchmark Series Microsoft Access 2010 Level 1
Microsoft Office XP Microsoft Excel
COMPREHENSIVE Word Tutorial 9 Creating On-Screen Forms Using Advanced Table Techniques.
Developing an Excel Application
Tutorial 8: Developing an Excel Application
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Excel and VBA Creating an Excel Application
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
LOGO Chapter V Formattings 1. LOGO Overview  Conditional formatting  Working with tables  Filtering  Sorting  Freeze panes  Pivot tables  How to.
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
© 2002 ComputerPREP, Inc. All rights reserved. Word 2000: Forms, Merges, and Macros.
Lesson 13: Building Web Forms Introduction to Adobe Dreamweaver CS6 Adobe Certified Associate: Web Communication using Adobe Dreamweaver CS6.
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
SAS® Explorer Use and Customization Richard A. DeVenezia.
Air Quality System Precision and Accuracy Data Transaction Generator (AQSP&A) Training Session.
October 2003Bent Thomsen - FIT 3-21 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
PHP meets MySQL.
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 10 Creating and Formatting an Excel Worksheet.
Microsoft Access Lesson 1 Lexington Technology Center February 11, 2003 Bob Herring On the Web at
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Division of Alcoholic Beverages and Tobacco Liquor Distiller’s and Rectifier’s Monthly Report.
Advanced Word - Lesson 1: Sorting and Calculating.
CREATING TEMPLATES CREATING CUSTOM CHARACTERS IMPORTING BATCH DATA SAVING DATA & TEMPLATES CREATING SERIES DATA PRINTING THE DATA.
Key Applications Module Lesson 21 — Access Essentials
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
76 © 1998, 1999, 2000 David T. Gray, Howard Duncan, Jane Kernan Frames When displaying information in a browser, it is sometimes useful to divide the display.
Cigarette Distributing Agent’s Report. Log in with the user id and password provided through the EDS registration process and click on the Login button.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
FIX Eye FIX Eye Getting started: The guide EPAM Systems B2BITS.
Deposit Module for Depositor DigiTool Version 3.0.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
Online Catalog Tutorial. Introduction Welcome to the Online Catalog Tutorial. This is the place to find answers to all of your online shopping questions.
Staff Module and Summary of Changes 1. Icon Changes: Page 3 Signing In and Password/Pin Changes: Page 4 Logging Out: Page 8 Staff Module Changes: Page.
PestPac Software. Leads The Leads Module allows you to track all of your pending sales for your company from the first contact to the close. By the end.
Transportation Agenda 77. Transportation About Columns Each file in a library and item in a list has properties For example, a Word document can have.
WaveMaker Visual AJAX Studio 4.0 Training Java Script Events.
Extracting Information from an Excel List The purpose of creating a database, or list in Excel, is to be able to manipulate the data elements in ways that.
Staff Module and Summary of Changes 1. Icon Changes: Page 3 Signing In and Password/Pin Changes: Page 4 Logging Out: Page 8 Staff Module Changes: Page.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Excel Tutorial 8 Developing an Excel Application
Partner Program Platform Training Partner Self Service
Topics Graphical User Interfaces Using the tkinter Module
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Building a User Interface with Forms
Data Validation and Protecting Workbook
Developing an Excel Application
For a new user you must click on the “Registration for Generator” link
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
Using Templates and Library Items
Bent Thomsen Institut for Datalogi Aalborg Universitet
CGN 2420 Formatting a Workbook Using Excel’s Ribbon
Presentation transcript:

Using Context Sensitive Menus to Enter Values in a SAS/AF Data Table Object Richard A. DeVenezia

Context Menus n Widespread use ä Windows ä Office 97 ä SAS n Right mouse click ä Present menu of choices applicable to task at hand

Sample Application n Enter data for a fitness study n Add columns to SASUSER.FITNESS –SMOKES –DIET –EXERCISE n Hands off data entry using context menus

SASUSER.FITNESS n SMOKES ä Number of packs smoked a day n DIET ä Diet followed at time of fitness measures n EXERCISE ä Comma separated list of types of regular exercises performed

SAS/AF Front End

Default Context Menu

Desired Context Menus n SMOKES ä List of numbers n DIET ä List of diets n EXERCISE ä List of exercises –Add or remove an exercise from subjects list of exercises

Desired Context Menus

Control of Context Menu n Max Packs ä Restricts number of packs listed in menu n Exercises ä Restricts number of comma separated exercises n Life Style Choices ä Control data set

Life Style Choices n Data set of choices to be shown in context menus n Aspect value matches name of column in table being edited

SAS/AF Makes It Happen n Frame class n Data Table class n Methods n SCL Lists n WPOPUP command –Causes the pop up menus for a window to appear –By default under Windows (and UNIX), this command is associated with the right mouse button

Making the FRAME entry n Issue command ä BUILD SASUSER.NESUG99.MAIN.FRAME ä This creates an instance of a Frame class n Make a Data Table Right click in Frame and select Make or Issue command RM MAKE ä Create an instance of a Data Table class named FITNESS

Data Table: Command Processing n Right click on the Data Table Select Object Attributes –Left click on Command Processing... n Note the Popmenu Processing setting ä Use _POPUP_ method n This is the hook for installing the popmenu, I.e. the context menu

FRAME: Core Concepts n Override Data Table _POPUP_ method ä This becomes the WPOPUP event handler n Attach column handler specifiers to the Data Table widget for the event handler to use

FRAME: Sample n Override _POPUP_ ä call send (_frame_, '_get_widget_',FITNESS',tabid); call send (tabid, '_SET_INSTANCE_METHOD_','_POPUP_', 'SASUSER.NESUG99.CONTEXT.SCL', 'POPUPCEL');

FRAME: Sample n Attach column handler specifiers ä rc = setnitemn (tabid, _smokes, 'RMB_LIST_FOR_SMOKES'); rc = setnitemn (tabid, _diet, 'RMB_LIST_FOR_DIET'); rc = setnitemc (tabid,'CONTEXT:EXERCISE', 'RMB_LIST_FOR_EXERCISE'); n Both _smokes and _diet are SCL lists made and populated in INIT, and repopulated by user front end actions

Column Handler: Core Concept n A column handler specifier is a named item attached to the Data Table widget Item name is RMB_LIST_FOR_ n Item value is –numeric: event handler assumes it is an SCL list id –character: event handler assumes it is an SCL method defined with statement: method _self_ 8 row 8 column_name $32 _pop 8;

WPOPUP Event Handler Method statement must conform to: method plist sel 8; n plist ä the SCL list that is about to be popmenued n sel ä the number of the item selected n Neither argument is used in the sample application

Event Handler Sample Catalog entry SASUSER.NESUG99.CONTEXT.SCL Has this method statement in it POPUPCEL: method plist sel 8;

Event Handler Concepts n Obtain cell coordinates where popup occurred n Obtain column name cell is in n Check for column handler specifier n Set active cell to popup cell n Get column type n Dispatch column handler ä Special case for row 0

Event Handler Details n Obtain cell coordinates ä _poprow = makelist(); _popcol = makelist(); call send (_self_,_GET_POPUP_CELL_, _poprow, _popcol); n Obtain column name ä col = getnitemn (_popcol,1); call send (_self_,_GET_DISPLAYED_COLUMN_NAME_, col, colname);

Event Handler Details n Check for column handler specifier ä handlerItem = namedItem (_self_,RMB_LIST_FOR_ || colname); n Set active cell ä call send (_self_,_SET_ACTIVE_CELL_, _poprow, _popcol); n Get column type ä call send (_self_,_GET_COLUMN_ATTRIBUTE_, colname, TYPE, coltype);

Event Handler Details n Dispatch column handler ä select itemType (_self_,handlerItem); when (N) link popItemN; when (C) link popItemC; otherwise; end; n Special case (not done in Sample) ä If row=0 call code specific to a column header ä Sorting, formatting, column order, etc...

Column Handler Dispatchers n popItemN: ä Column handler specifier is an SCL list n popItemC: ä Column handler specifier is a method name –Term context method used in later slides n Both dispatchers link to setCell: ä Places value selected from context menu into the popup cell or selected region

popItemN: Details n Simplest case n All work was done in the FRAME n Just popmenu the SCL list ä _pop = getItemN(_self_, handlerItem); if listlen (_pop) > 0 then do; choice = popmenu (_pop); if choice > 0 then link setCell; end;

popItemC: Concepts n Dispatching is easy ä Writing the method being dispatched is harder n Get the context method n Call the context method ä No error checking, bad method calls cause error messages in the Log Must conform to method _self_ 8 row 8 column_name $32 _pop 8;

popItemC: Concepts n _pop is an SCL list made by dispatcher and passed to context method ä Upon return –If _pop is not empty n dispatcher will present menu and insert values into table –If _pop is empty or invalid (deleted) n dispatcher will do nothing and exit normally n Context method can perform any actions ä Value insertion not required

popItemC: Details Get the context method and call it ä popcol_method = getitemc (_self_, handlerItem); _pop = makelist (); pophold = _pop; call method (scan (popcol_method,1,':'), scan (popcol_method,2,':'), _self_, row, colname, _pop); ä if listlen (_pop) > 0 then do; choice = popmenu (_pop); if choice > 0 then link setCell; end; n Context method ignores _pop to prevent setCell

popItemC: Concepts n Why let method prevent setCell ? ä Value inserted into table not applicable to region select ä Additional flexibility –requires more work –method should use techniques similar to setCell: if it wants to insert a value into the table –method is called with arguments sufficient enough to do setCell: like processing

setCell: n Long winded grunt code due to filling selected region feature n Methods used: ä _GET_SELECTIONS_ ä _GET_DATASET_ATTRIBUTES_ ä _LOCK_ROW_ / _UNLOCK_ROW_ ä _CLEAR_SELECT_ ä _SET_ACTIVE_CELL_ ä _SET_COLUMN_TEXT_ / _VALUE_

Context Method Statement Must conform to method _self_ 8 row 8 column_name $32 _pop 8; n _SELF_ ä Data Table widget id n ROW & COLUMN_NAME ä Data Table cell where popup event occurred n _POP ä SCL list to be populated

Exercise Context Method Catalog entry SASUSER.NESUG99.CONTEXT.SCL Has this method statement in it EXERCISE: method _self_ 8 row 8 column_name $32 _pop 8 ; n Term Exercise method used in later slides

Exercise Method Overview n End result ä Exercise value is a comma separated list of M values taken from the N choice values in LIFESTYL data set where aspect=EXERCISE n Coupled with a FRAME object ä Input field nExer in the FRAME controls M

Exercise Method Concepts n Get FRAME Data Table resides in n Get nExer value from FRAME n Get current value of Exercise n Check if more exercises allowed n Make a context menu that shows remove before any exercise already present, and add before any exercise not present n Update value in table accordingly

Exercise Method Details n Get nExer value from FRAME Data Table is in ä call send (getnitemn (_self_, '_FRAME_'), '_GET_NUM_VAR_', 'NEXER', nExer); n Get current value of Exercise ä call send (_self_, '_GET_COLUMN_TEXT_', column_name, exercise); n Check if more exercises allowed ä allow_more=(scan(exercise,nExer, ',') = '');

Exercise Method Details n Make a context menu to show values with remove and add prefaces ä Involved bit of code using two SCL lists ä List1 are exercises currently in value ä List2 are exercises obtained from lookup –open LIFESTYL(WHERE=(ASPECT="EXERCISE")) –populate using LVARLEVEL function

Exercise Method Details n Update value in table ä call send (_self_, '_LOCK_ROW_', row); call send (_self_, '_SET_COLUMN_TEXT_', column_name, exercise); call send (_self_, '_UNLOCK_ROW_');

Conclusion n Dare to dream up intuitive interfaces n SAS/AF is superbly capable n You can only maximize your AF investment with deep understanding Richard A. DeVenezia Sample application available upon request SAS and SAS/AF are registered trademarks or trademarks of SAS Institute Inc, in the USA and other countries. indicates USA registration.