CSE3030

CSE3030 Exam Answers

Home Page | CSE3030 | CSE3020 | CSE3510 | Contact Page | Photo1 Page | Jokes Page
  
    

CSE3030 GUI


Long Answer Questions for the Exam

1.Fully describe the components of a standard system window in the Win3.1 or Win95/98 environment. Explain how each is used. (Answer for Win3.1)

Control Menu box:
- Allows resize window, move, maximize, minimize, close and switch task to another window.
- Located in the upper left corner of the window.

Window Bolder:
- The 4 edges of the window can be lengthen or shorten by holding down the mouse button and dragging the required direction.

Minimize button:
- Click to shrinks the active window to an icon.

Maximize button:
- Click to enlarger window to fill the screen.
- After window been enlarged, the button changes to restore button to restore the button to the previous size.

Close button:
- Click to close off the application.
- It will prompt for data save if there is any unsaved data.

Menu bar:
- List available menus
- Most application has a ‘File’, ‘Edit’, ‘Help’ menu unique to the application.

Status bar:
- Display specific information about the status of the application, such as line number, page number etc.

Toolbars:
- A series of related functionality appears as icons displayed on the screen for convenience.
- These icons are usually shortcuts from using the menu bar.

Workspace:
- It is where the user works with the application.

Mouse pointer:
- It is usually an arrow shaped pointer for ‘click and drag’.

Vertical/Horizontal scroll bar:
- Available for user to view a portion of the ‘full picture’ when the application window is not big enough to display the entire range.

2. What are the criteria for a true GUI environment as described by Microsoft (or any other major computer company)?

- It uses bit mapped displays, offering ‘What you see is what you get’ screen presentation of printed out.
- It is graphically oriented interface, making extensive use of icons and click, drag and select rather than having manually calculating and typing.
- It offers standard elements, such as menus, standard window elements and dialogue controls to provide consistency across application.

- Additional elements from Microsoft:
o Application support.
o Consistency across platform as well as across applications.
o Ease of use and visual appeal, ease of installation and configuration.
o Able to be customized for different user.
o Able to support multiple application, support multiple graphics application with inter application communications tools such as DDE (Dynamic Data Exchange), clipboards.
o Embraces the object action paradigm.

- Basic components of GUI environment include:
o Pointer – A symbol that appears on the display screen as a virtual hand of user to move and select objects or commands.

o Pointing device – A device such as a mouse or trackball that enable user to select objects on the display screen.

o Icons – A button like object that represents a command, files or window. The user activates or executes the icon with moving the pointer to the top of the icon and click on it.

o Menus – Most GUI also allows user execute commands by selecting a choice form a menu.

o Windows – Windows allow user to virtually divide the display screen into different areas. For each window, user could manually resize and place it at the appropriate area of the display screen.

o Desktop –


3. Fully describe the ways in which data (text or graphics) can be passed between and within Windows applications.

Clipboard
Clipboard is the primary method in which data can be passed between and within window applications. The clipboard is a computer resource managed by Windows on behalf of executing programs. It is a dynamically allocated, variable sized, chunk of system memory into which users and applications may transfer text and graphics.

When a user wish to moved data within or between applications, he will need to make a selection (by highlighting text or rubber banding graphics), use “Copy” or “Cut” command in Edit menu from the menu bar, then “Paste” (which also a command in Edit menu) at the desired location, the user can repeatedly “Paste” the same data over different window applications or within application until the copied or cut data being replaced with another piece of data.

The difference between “Copy” and “Cut” command is that, “Copy” command simply makes another copy of the chosen data, while “Cut” command does what “Copy” does but remove (or say delete) the selected data from its original location.

It is important to note that the data copied from the clipboard will appear at the cursor position that the user specified.

DDE (Dynamic Data Exchange)
Enabling user applications to directly and continuously exchange data to other window based application. The link could be created at run-time or design-time.

With the link that created during design-time, the communicating applications must contain copy and paste link command. All updates controls are made immediately whenever a data change occurs. Links may fail if other application unable to refresh them.

A run-time link is more flexible… …

OLE (Object Linking and Embedded)
OLE allows a programmer to create an application that can display data from many different applications and allowing editing done within the application in which it was created.

OLE is a method for enhancing the interoperability between applications for windows. Using OLE, one application can display and manipulate data from other windows based application and start the application so the other users can edit the data.

It is ideal for creating a front-end application. In addition, the data always appears in the same view that it would in that application.

OLE client control is used to incorporate data into a VB application by linking the embedding that data from an application. When an object is linked to a VB application, the object’s data can be assessed from any application that contains link to that data and can be changed from within any of them.

4. Microsoft claims that Window is a “device independent” environment. What do they mean by this, and what are the potential benefits of such an environment to the computer industry in general?

The device independent nature means that applications ten to run smoothly on a windows environment (i.e. not on DOS environment). Because windows standardize the video environment, program code is written to determine the hardware configuration for that particular computer. Unlike DOS applications, which must specify the desired graphics screen mode, determine whether the computer has a compatible video board installed, and then create the actual graphics.

What Microsoft claims is that in order to run window environment application, one does not need to buy a specific device. In other words, as long as the hardware requirements of windows is met, one can run windows irrespective of whether one is using a particular brand of VGA card or a faster microprocessor.

Microsoft provides a generic driver for all devices. It is up to the manufacturer of the device to tweak it to a higher level of performance for windows.

Benefits:
Potential benefits for the users:
- Each application windows contain the same basic feature. Because these features are consistent among application, the user can adapt to new application more easily.
- Provide the user with very important capability of multitasking.
- Windows provides access to all available memory resources, so that the user can optimize the system more easily.

Potential benefits for the programmers:
- Allows the programmer to design graphical representations of physical structures such as files and directories and provides convenient features such as pop-up menus and dialog boxes.
- Window’s memory management features enable the programmer to access more memory than is possible with traditional DOS applications, and the programmer can make the most of the system memory resources while maintaining flexibility in system design.
- Device independent graphics means that code is not dependent on a certain system configuration. More flexibility.

5. What are the different types of controls that available as “objects” in a Visual Basic application at design time? Give examples and comparisons of each.

1. Picture Box
A picture box can display a graphics from any graphics file such as .bmp, .gif files. The graphics displayed and fitted into the rectangle frame that the user has drawn with the picture toolbox.

2. Option Button
Option buttons are frequently used in sets to allow one possible choice from set of choices. Each button in such a set allows the user to select only one of the displayed choices. Having made a choice, the rest of the options are automatically turned off.

3. Check Box
A check box contains an X when selected, otherwise blank. This control is used to give the user a True/False, Yes/No type of choice. Check boxes could be grouped to display multiple choices from which the user can select one or more.

4. Text Box
A text box control is sometimes called an “edit field” or “edit control”. Able to display information entered at design time or entered by the user at run time.

5. List Box
List box displays a list of items from which the user can select. If the items exceeds the number it can display, a scroll bar is automatically added to the list box.

6. Combo Box
Combo box combines the features of list box and text box. It allows user to type in the text box portion or select an item from the list portion of the control.

7. Command Button
Command button is chosen by the user to begin, interrupt or end a particular process. When chosen, the button takes on the appearance of a pushed button.

8. Drive List Box
The allows the user to choose a logical drive including network drive and floppy disk drives at run time.

9. Directory List Box
A directory list box displays directories and paths at run time. User can use these controls to display a hierarchical list of directories on the current drive.

10. File List Box
File list box finds and lists the files in the directory specified by the Path property at run time. The listed files are those that conform to the Pattern property.

11. Label
Display text that the user can’t change directly at run time.
12. Timer
Timer can run code a regular interval by generating timer events. The time interval is independent of the speed of CPU, and can be enabled or disabled by code at run time. It is invisible to the user at run time.

13. Image Box
This is a control used to display a standard image. It is a simpler form of the Picture box but uses less resource, is faster to repaint and has fever possible events. Its main use is to hold icons, which can be clicked upon in the tool bar, for example.

14. Data Control
Provides access to data stored in database. Allow user to move from record to record a display data from each record in bound controls such as a text box, a label or a picture box.

15. Horizontal and Vertical Scroll Bar
Provide easy navigation through a long list of items or a large amount of information. It can also used to represent analog or digital representations of values, such as allowing a user to adjust the position of the slider within a particular range.

6. Describe the steps involved in creating an interface to the Clipboard in a VB application. What code should be written to provide the user with a Copy, Cut and Paste facility within an Edit menu command?

Once the Edit menu command and its submenu Copy, Cut and Paste has been created through the menu design option, create a procedure to execute when those submenu option are clicked on:
Sub mnuEdit_Click (Index As Integer)

The three submenu options are separated according to which command the user chooses to execute:
Select Case Index:

If the user chooses “Cut”, then perform the following:
Case 0 `If index = 0, user chose “Cut”
Clipboard.Clear
Clipboard.SetText(txtEdit.SelText) ‘Copy selected text to Clipboard.
TxtEdit.SelText = “” ‘Clear selected text from the document.

If the user chooses “Copy”, then perform the following:
Case 1
Clipboard.Clear
Clipboard.SetText(txtEdit.SelText)

If the user chooses “Paste”, then perform the following:
Case 2
TxtEdit.SelText = Clipboard.GetText() `Paste Clipboard text (if any)

End Select
End sub

The codes above provide the implementation of a VB application interfacing the clipboard.

SetText – Copy a selected block of text into the clipboard.
SelText – The text that is selected (highlighted).
GetText – Copy it into a control within a program.

7. Fully describe the steps you require to build and code a form for typical data entry in a Windows environment. Such a form would naturally contain a number of labels and text boxes, and the user must be permitted to move from one input field to the next using the key (the Windows standard) or the key (the old DOS standard). What steps can you take to control and validate their data entries?

The steps involved in creating a typical data entry form in a windows environment are:

Create a form to place the labels and textboxes. Meanwhile, set their properties such as name, caption, size, height width etc.

All text boxes should be specified as to whether they should accept characters, numeric or both. Use data control function to bind the data to the database. Functions such as “IsDate”, “IsNumeric” may help, but no significant data validation is available for VB. The best validation is through careful coding.

Preprocess special keys such as the , and key should be specified as to the action they perform when user pressed those keys.

In order to allow the to move from input to input, change the Tab Index property of the text box and starts at 0 fro the first input field. As moving from one field to another, specify whether to insert highlight on the field and also whether to change fonts or color whenever each get or lost focus.

Initialize all fields by providing a default value or simply a blank space, decide which control should have focus when the form is first displayed.

8. What is the “minimum” and “desirable” hardware required for a typical GUI, on an Intel-based system? Give examples for Windows 3.1 or O/S (or a similar GUI). Why should the hardware be different from the required for non-GUI applications?

“Minimum” requirement for Windows:
- A XT machine
- 4MB RAM
- Hercules display card
- 40MB hard disk

“Desirable” Hardware for Windows:
- A 80386 machine or greater
- 4MB RAM
- Super VGA display with 1MB video RAM
- 120MB hard disk

Hardware required by GUI differ from Non-GUI because in GUI has more graphics to display on the screen compared to Non-GUI.

In text-based system, screen image is broken down to character location, which is a 80 x 25, i.e. 2000 characters per screen. In GUI applications, the smallest location can be broken down to pixels. For a CGA screen is a 640 x 200 pixel, i.e. 128,000 pixels per screen.

Use of mouse need additional requirement on the system, as its movements and button must be monitored. In general, an GUI environment need to handle a greater number of system calls to perform the additional functions like the mouse movement. DOS has approximate 30 system calls while Windows has approximate 300 system calls.

9. Describe the different types of data storage devices, which can be attached to desktop computer, and the different bus types which connect them to the CPU.

Data storage device
Floppy disk drive:
- A small flexible diskette stored in plastic jacket.
- Low in cost, flexible but not very reliable.
- Available in 2 sizes, 3 ½ inch and 5 ¼ inch
- Maximum of 1.44 MB of capacity
- Portable

Floptical disk drive:
- Portable, flexible and more reliable than FDD
- Relatively high cost
- Information is written and read digitally using laser onto and from the disk
- The information is non erasable, can only write once
- Capacity is around 20MB per disk with a size of 3 ½ inch

Hard disk drive:
- Enclose permanently in a sealed vacuum case. Within the sealed vacuum case, contains a few disk plates with read and write heads on each on the surface of the disk except the uppermost surface and the bottommost surface of the disk.
- The disk drive is installed into the computer casing and connected to the power sources and IDE port.
- Relatively cheap for massive storage.
- Has high transfer rate.

Magnetic tape drive:
- Huge amount of data can be stored.
- It is cheap.
- Very slow in the read/ write process.
- The access method is sequential.
- This form of storage media is good for backup.

CD-ROM drive:
- Uses compact disk to store data/ information
- It is read only memory, not write able.
- Inexpensive medium for mass distribution of information.
- Capable of storing up to 650MB of data per disk.
- Has slower access rate compared to HDD.

Recordable and Re-writable CD drive:
- Extension of CD-ROM drive, allow information to be written on compact disk.
- Recordable allow the disk to be written and information remains on disk permanently; while re-write able allow the information to be erased and re-write.


Magnetic Optional Drive:
- Capable of storing at least 100MB.
- Re-writable.
- …


Bus types
ISA – Industry Standard Architecture
- Data transfer speed through ISA bus is 8 or 16 bits
- Slow (8MHz)
- Serial transfer

EISA – Extended Industry Standard Architecture or MCA – Micro Channel Architecture
- 16/32 bit speed

VESA Local Bus or PCI – Peripheral Component Interconnect
- 32/64 bit bus transfer
- Improve the performance of graphics
- Fast (100MHz)
- Direct link to CPU
- Parallel data transfer.

AGP – Accelerated Graphics Port
- Provides direct pipeline access between graphic card and system memory.
- Allowing transfer rate up to 528MB/ps
- Greater ease in performing complex 3D operatons

ATA/IDE – Attachment/ Integrated Drive Electronic
- Standard hard disk bus.
- Least expensive
- Fastest throughput of 33MB/ps

SCSI – Small Computer System Interface
- More efficient
- Support more attached peripherals on a single channel.
- Fast but add cost to a PC

USB – Universal Serial Bus
- 12 MB/ps channel
- Designed to replace various interfaces that connect external peripherals.