Introduction to Systems Programming (CS 0449) User Interface Elements (UIE) - Resources Palm OS resources ( Ch.4—PDA Programming in C Book & Ch.6,7 PalmOS.

Slides:



Advertisements
Similar presentations
ICFS Annotated User Interface Design [Accounts Set Up]
Advertisements

1 After completing this lesson, you will be able to: Create a database. Create a table using the Table Wizard. Create and modify a table in Design view.
Microsoft Expression Web-Illustrated Unit J: Creating Forms.
MS® PowerPoint.
Microsoft Office 2007-Illustrated Introductory, Windows Vista Edition Windows XP Unit A.
Microsoft Office XP Microsoft Excel
User Training. Step 1 Press Ctrl-I or choose File > Login, this will open the Login window. Figure 1-1 shows the Login window. Figure 1-1 Login Window.
Using Macros and Visual Basic for Applications (VBA) with Excel
Chapter 5 Multitable Forms
Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 3 – A Professional Looking Worksheet.
Introduction to Systems Programming (CS 0449) PalmOS Events Handling Events OS–AppEventLoop() – Event Handlers.
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Create a Form in Dreamweaver Go to: Introduction Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Introduction Goals Purpose Scope Prerequisites Install (if needed)
Chapter 4: Working with Windows Types of Windows –Program Windows –Message Boxes –Dialog Boxes Elements of a Window –Window Panes –Scroll Bars –Menus –Tool.
Quick Start Guide. This 22 page introduction to the Financial Assessment Subsystem provides the user with a visual overview of the components of the system.
Excel Web App By: Ms. Fatima Shannag.
1 ONE TIME PRINT SETUP To print Requisitions from Banner, follow this process once: Open Microsoft Excel, select (1) TOOLS, then (2) MACROS, then (3) SECURITY.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Recruitment Office Procedures Job Posting Requests Creating a Search Committee –Adding Search Committee MembersAdding Search Committee Members –Designating.
Lecture 2 Event driven programming Mobile and Handheld Applications1 Programming of Handheld and Mobile Devices Lecture 2: Event driven programming concepts.
Lesson No:9 MS-Word Tools, Mail Merge and working with Tables CHBT-01 Basic Micro process & Computer Operation.
Forms. 2 Project Objectives Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
 Starting Excel 2003  Using Help  Workbook Management  Cursor Management  Manipulating Data  Using Formulae and Functions  Formatting Spreadsheet.
Creating a Web Site to Gather Data and Conduct Research.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Dreamweaver CS4 Concepts and Techniques Chapter 4 Forms.
XP 1 Microsoft Word 2002 Tutorial 1 – Creating a Document.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 5 Compiling with resources Rob Pooley
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Microsoft Word Tables ITSW 1401, Intro to Word Processing Instructor: Glenda H. Easter.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Key Applications Module Lesson 21 — Access Essentials
Dreamweaver MX. 2 Overview of Templates n Forms enable you to collect data from ______. n A form contains ________ such as text fields, radio buttons,
Moodle with Style Integrating new technologies to empower learning and transform leadership.
XP Practical OpenOffice.org Chapter 8 1 Creating a Presentation.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Tutorial 51 Programming Structures Sequence - program instructions are processed, one after another, in the order in which they appear in the program Selection.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 10 Administering a Database System.
© 2006 Palm, Inc. All worldwide rights reserved. Contacts application Digging Deeper.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
For additional assistance, please call the Help Desk Searching 1. If a Search window does not appear after logging into the system, click the Search icon.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
Excel Web App By: Ms. Fatima Shannag.
Lecture 4 OXO for PalmMobile and Handheld Applications1 Programming of Mobile and Handheld Devices Lecture 4: Programming OXO for Palm OS Rob Pooley
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
User Interface Components Lecture # 5 From: interface-elements.html.
CRSD Technology Training Tony Judice. Quick Access Toolbar – can be modifiedSave as… allows you to save the file to a different location and also as an.
Slide 1 of 35 Welcome to GSA’s Vendor and Customer Self Service (VCSS) course Section 3: Basic Navigation This presentation is compliant with section 508.
Page Designer Storyboard J. A. Fitzpatrick December 2004.
External Study Credit Granting with SurveyGizmo Shepherd University Department of Psychology.
Create new project or open existing project (here, we will create a new project)
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
MS WORD INFORMATION TECHNOLOGY MANAGEMENT SERVICE Training & Research Division.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Excel Tutorial 8 Developing an Excel Application
Data Validation and Protecting Workbook
Bulk update E. Camelback Road #559, Phoenix, AZ Phone: Fax:
Chapter 7 Advanced Form Techniques
Predefined Dialog Boxes
Operate A Spreadsheet Application Advanced
Objectives At the end of this session, students will be able to:
Presentation transcript:

Introduction to Systems Programming (CS 0449) User Interface Elements (UIE) - Resources Palm OS resources ( Ch.4—PDA Programming in C Book & Ch.6,7 PalmOS Bible Book )

Palm OS Resources -User Interface Elements Forms Alerts Menus Tables Lists Pop-up Triggers Buttons Repeating Buttons Selector Triggers Push Buttons Check Boxes Slides Labels Form Bitmaps Fields Graffiti Shift Indicator Scroll Bars Gadgets

Palm Resources (User Interface Elements) Forms Alerts Menus Tables Lists/Popup Buttons Push buttons Check boxes Sliders, scrollbars Labels Look Up: Form bitmaps TextFields

Resource Files //This is a file used by PilRC to create a.prc file. #include "helloRsc.h" APPLICATIONICONNAME ID 100 "Hello 1" APPLICATION ID 1 "49p1" VERSION ID 1 "1.0.0g" ICONFAMILY "largeicon_1bpp.bmp" "largeicon_2bpp.bmp" "" "largeicon_8bpp.bmp" TRANSPARENT SMALLICONFAMILY "smallicon_1bpp.bmp" "smallicon_2bpp.bmp" "" "smallicon_8bpp.bmp" TRANSPARENT

Resource Files (2) // Here we define the form that we need for our program. FORM ID MainForm AT ( ) //more details next USABLE BEGIN TITLE "Hello World" END ALERT ID ByeAlert//more details after next INFORMATION BEGIN TITLE "Hello World Alert" MESSAGE "Goodbye, my friend !" BUTTONS "OK" END

Resource Files (3) BITMAP ID MyBitmap "picture.bmp" COMPRESS FORM ID MainForm AT ( ) USABLE BEGIN TITLE "Hello World“ TABLE ID MainTable AT ( ) ROWS 11 COLUMNS 9 COLUMNWIDTHS LABEL "Enter your name here:" AUTOID AT (0 17) FONT 1 FIELD ID MyFieldName AT (PrevLeft PrevBottom ) UNDERLINED AUTOSHIFT MAXCHARS 40 BUTTON "Hello" ID MyButtonHi AT (1 147 AUTO AUTO) BUTTON "Bye" ID MyButtonBye AT (PrevRight+5 PrevTop AUTO AUTO) FORMBITMAP AT (7 19) BITMAP MyBitmap END

Programming User Interface Elements - ALERT Programming Alerts An Alert resource dialog box could be either 1.Information. (i) 2.Confirmation. (?) 3.Warning. (!) 4.Error. (x) ALERT ID HelloAlert INFORMATION BEGIN TITLE “Hello World” (i) MESSAGE “Good Day To you, My Friend, ^1 !” BUTTONS “OK” END // ^1 resource ID –first arg in FrmCustomAlert(HelloAlert, “yourname”) ALERT ID DeleteAlert CONFIRMATION BEGIN TITLE “Please Confirm deletion” (?) MESSAGE “About to delete ^1 records from ^2 category!” “Proceed?” BUTTONS “OK” “Cancel” END // ^2 –2 nd arg in FrmCustomAlert(DeleteAlert,”5”, business”, NULL) FrmAlert ( ) is equivalent to FrmCustonAlert(AlertID, NULL, NULL, NULL) –does not take ^1, ^2, ^3 To include ^`, ^2, ^3, then use FrmCustomALert

Programming User Interface Elements - ALERT ALERT ID WarningAlert WARNING BEGIN TITLE “Warning Alert Dialog Box” (!) MESSAGE “Are you sure you want to delete, ^1 !” BUTTONS “Yes” “NO” END // ^1 resource ID –first arg in FrmCustomAlert(WarningAlert) ALERT ID ErrorAlert ERROR BEGIN TITLE ”Password Dialog Box” (x) MESSAGE “Incorrect Password” BUTTONS “OK” END

Creating Resources – Adding Objects to a Form Resource 1)BUTTONS: BUTTON “label” ID resourceID AT (Left Top Width Height) AT Positions: AUTO, CENTER, PREVLEFT, PREVRIGHT, PREVTOP, PREVBOTTOM, PREVWIDTH,PREVHEIGHT. 2) PUSHBUTTONS: PUSHBUTTON“HEX”IDHexGROUP 1 PUSHBUTTON“DEC”IDDecGROUP 1 3) CHECKBOXES: CHECKBOX “label” ID resourceID AT (Left Top Width Height)

Creating Resources – Adding Objects to a Form Resource 4) Fields: FIELD “label” ID resourceID AT (Left Top Width Height) [ USABLE | NONUSABLE ] [LEFTALIGN | RIGHTALIGN] [ FONT fontnumber ] [EDITABLE | NONEDITABLE] [ UNDERLINED] [ SINGLELINE | MULTIPLELINES] [DYNAMICSIZE] MAXCHARS maxChars [ AUTOSHIFT ] [NUMERIC] [HASSCROLLBAR] [DYNAMICSIZE]– causes field to out fldheightChangedEvent onto the queue whenever user input causes field to scroll. [ AUTOSHIFT ]– tells system to perform graffiti auto shifting in the field. [HASSCROLLBAR] – update scrollbar constantly.

Creating Resources – Adding Objects to a Form Resource 1)BUTTONS: BUTTON “label” ID resourceID AT (Left Top Width Height) AT Positions: AUTO, CENTER, PREVLEFT, PREVRIGHT, PREVTOP, PREVBOTTOM, PREVWIDTH,PREVHEIGHT. 2) PUSHBUTTONS: PUSHBUTTON“HEX”IDHexGROUP 1 PUSHBUTTON“DEC”IDDecGROUP 1 3) CHECKBOXES: HEX DEC CHECKBOX “label” ID resourceID AT (Left Top Width Height) HEXDEC 1)BUTTONS: BUTTON “label” ID resourceID AT (Left Top Width Height) AT Positions: AUTO, CENTER, PREVLEFT, PREVRIGHT, PREVTOP, PREVBOTTOM, PREVWIDTH,PREVHEIGHT. 2) PUSHBUTTONS: PUSHBUTTON“HEX”IDHexGROUP 1 PUSHBUTTON“DEC”IDDecGROUP 1 3) CHECKBOXES: HEX DEC CHECKBOX “label” ID resourceID AT (Left Top Width Height)

Creating Resources – Adding Objects to a Form Resource 4) Text Fields:Enter your name: ______________ FIELD “label” ID resourceID AT (Left Top Width Height) [ USABLE | NONUSABLE ] [LEFTALIGN | RIGHTALIGN] [ FONT fontnumber ] [EDITABLE | NONEDITABLE] [ UNDERLINED] [ SINGLELINE | MULTIPLELINES] [DYNAMICSIZE] MAXCHARS maxChars [ AUTOSHIFT ] [NUMERIC] [HASSCROLLBAR] [DYNAMICSIZE]– causes field to out fldheightChangedEvent onto the queue whenever user input causes field to scroll. [ AUTOSHIFT ]– tells system to perform graffiti auto shifting in the field. [HASSCROLLBAR] – update scrollbar constantly.

Programming User Interface Elements – Forms FORM ID MainForm AT ( ) USABLE | MODAL BEGIN TITLE "CS 0449 Calculator“ FIELDIDInputFldAT( ) FONT 0 UNDERLINED SINGLELINE MAXCHARS 8 BUTTON "1" ID One BUTTON "F" ID HexF PUSHBUTTON“HEX”IDHexGROUP 1 PUSHBUTTON“DEC”IDDecGROUP 1 BUTTON "Exit" ID Exit END

Programming User Interface Elements - Forms Programming Forms 1-Switch to a new form: Erase current form and display a new one (Full-SCREEN, VIEWS-Modeless, or USABLE) 2-Display a modal dialog box: A quick prompt for user input. i.e. delete confirmation dialog box (POP-UP, MODAL-DIALOGS) - MODAL: forms and windows ignore taps outside them. User must finish the dialog and exit the form. FORM ID MainForm AT ( ) USABLE BEGIN TITLE "CS 0449 Calculator“ FIELDIDInputFldAT( ) FONT 0 UNDERLINED SINGLELINE MAXCHARS 8 BUTTON "1" ID One BUTTON "F" ID HexF PUSHBUTTON“HEX”IDHexGROUP 1 PUSHBUTTON“DEC”IDDecGROUP 1 BUTTON "Exit" ID Exit END FORM ID MainForm AT ( ) MODAL DEFAULTBTNID MyDeleteButtonID BEGIN TITLE “Delete Book“ LABEL “Delete Selected Book Record?” BUTTON “OK" ID DeleteBookOK BUTTON “Cancel” IDDeleteBookCancel END

Programming User Interface Elements - Forms Programming Forms 1-Switch to a new form: Erase current form and display a new one. 2-Display a modal dialog box: A quick prompt for user input, i.e. delete confirmation dialog box. To switch forms call: FrmGotoForm( MyOtherFormID ) What happens in OS? frmColseEvent is sent to the current form FrmHandleEvent() takes care of this event frmLoadEvent is sent to MyOtherForm from your AppHandleEvent() call: FrmInitForm() FrmSetActiveForm() FrmSetEventHandler() FrmOpenEvent -- respond by calling FrmDrawForm()

Event Driven Architecture PalmMain() AppEventLoop() AppHandleEvent() MainFormHandleEvent() FrmDispatchEvent() frmColseEvent FrmHandleEvent() Events frmLoadEvent FrmInitForm() FrmSetActiveForm() FrmSetEventHandler() frmOpenEvent FrmDrawForm()

Hiding and Showing Form Objects (page 270 – Palm OS Bible) // Hides MyButtonID when MyHideBushbuttonID tapped //... in your FormHandleEvent()... and Handling Control Groups (pp.273) on pushbuttons and check boxes. if( event -> eType == ctlSelectEvent ) { switch ( event. data. ctlSelect. controlID ) { //see what button is tapped case MyHidePushButtonID : form = GetActiveForm( ); //get active form buttonIndex =FrmGetObjectIndex( form, MyButton); ctl = GetObjectPtr (MyHidePushButtonID); if( CtlGetValue ( ctl ) ) FrmHideObject( form, buttonIndex ); //Hide Pushbutton else FrmShowObject( form, buttonIndex ); //Show Pushbutton break; case MyButton :...//do something when user taps MyButton }Related Slides for CsCalProjectRelated Slides for CsCalProject

Adding TABLE to Form //...in the resource file, add to the form definition FORM ID MainForm AT ( ) USABLE BEGIN TITLE “Tables“ TABLE ID MainTable AT ( ) ROWS 11 COLUMNS 9 COLUMNWIDTHS BUTTON “HideRows” ID MainHideRowsButton AT( ) BUTTON “HideColumns” ID MainHideColumnsButton AT( ) LIST “X” “Y” “Z” ID MainList AT( ) NONUSABLE VISIBLEITEMS 3... END

typedef struct{// in Table.h TableItemStyleTypeitemType; FontIDfontID; Int16intValue; Char *ptr; } TableItemType; Item Type Editable by User TableItemType Fields Used by This type checkboxTableItemYesintValue customTableItemYes None, although you may store data in the intValue and ptr fields if required by yourapplication dataTableItemNointValue labelTableItemNoptr numericTableItemNointValue popupTriggerTableItemYesintValue, ptr textTableItemYesfontID, ptr textWithNoteTableItemYesfontID, ptr narrowTextTableItemYesfontID, intValue, ptr TABLE Item Types (ref: table page 397)

TblSetItemStyle(params) -- Set value of the table item’s itemType field Given a pointer to the table, the row and column of the item to set, and the type desired. params= (ptr to table, row of cell to set, column of cell to set, TableItemStyleType value) TblSetItemFont( ) -- Set fontID for a table item. TblSetItemInt( ) -- Set the intValue. TblSetItemPtr( ) -- Set the ptr field. TblGetItemFont( ) – Retrieve the fontID for a table item. TblGetItemInt( ) – Retrieve the intValue. TblGetItemPtr( ) -- Retrieve the ptr field. Given a pointer to the table, the row & column of the desired table item. PalmOS Table Functions: Set/Retrieve Values

-Usually, initializing the table is when handling the form’s frmOpenEvent -In the given table sample code, - MainFormHandleEvent initializes the form in the MainFormInit static Boolean MainFormHandleEvent(EventPtr event) { Boolean handled = false; FormPtr form; switch (event->eType) { case frmOpenEvent: form = FrmGetActiveForm(); MainFormInit(form); FrmDrawForm(form); handled = true; //other event handling omitted default: break; } return handled; } Initializing a Table Click to see MainFormInit() functionMainFormInit() Table sample codes: Table.c MainFormInit() MainFormHandleEventTable.cMainFormInit() MainFormHandleEvent

// allocate new memory handle for each array element and filling the handle’s contents with single training null. static Err StartApplication(void) { Int16 i, j; for (i = 0; i < numTextColumns; i++) { //num of columns for (j = 0; j < numTableRows; j++) {//num of rows Char *str; gTextHandles[i][j] = MemHandleNew(1); str = MemHandleLock(gTextHandles[i][j]); *str = '\0'; MemHandleUnlock(gTextHandles[i][j]); } return false; } Initializing a Table Array in StartApplication

Creating Menu Resource pg 244, PalmOS Bible MENU ID MyMenuID BEGIN PULLDOWN "Edit" BEGIN MENUITEM "Copy" ID MyMenuCopyID"C" MENUITEM "Paste" ID MyMenuPasteID"P" END PULLDOWN "Help" BEGIN MENUITEM "Help" ID MyMenuHelpID"H" MENUITEM SEPARATOR MENUITEM "About" ID MyMenuAboutID"A" END

Adding Menu to Form //...in the resource file, add to the form definition FORM ID MainForm AT ( ) MENUID MyMenuID USABLE BEGIN TITLE "CsCalc by Leo"... END

Programming Menus pg 296, PalmOS Bible //... in your FormHandleEvent() if( event -> eType == menuEvent ) { switch ( event. data. menu. itemID ) { case MyMenuCopyID : // Do your copy business break; case MyMenuPasteID : // Do your paste business break;... }

Using Standard Edit Menu Sometimes we can use resources that are built in Palm OS, such as Edit menu –We still have to define the menu resource, using the correct IDs –We do not need to write code, it is built in PalmOS Details in PalmOS Bible, pg 247.