[go: up one dir, main page]

0% found this document useful (0 votes)
17 views13 pages

L2 - Generic Graphics Overview

This document discusses event-driven programming and its use in graphical user interfaces. It begins with an overview of event-driven programming, noting that the program waits for and responds to user input events rather than following a predetermined sequence. It then discusses graphical user interfaces and GUI design principles like consistency and simplicity. It also outlines some common graphical events like mouse, keyboard, and timer events that GUI programs respond to. Finally, it provides examples of how events might trigger responses in a GUI program.

Uploaded by

Pau Pau A. Munar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views13 pages

L2 - Generic Graphics Overview

This document discusses event-driven programming and its use in graphical user interfaces. It begins with an overview of event-driven programming, noting that the program waits for and responds to user input events rather than following a predetermined sequence. It then discusses graphical user interfaces and GUI design principles like consistency and simplicity. It also outlines some common graphical events like mouse, keyboard, and timer events that GUI programs respond to. Finally, it provides examples of how events might trigger responses in a GUI program.

Uploaded by

Pau Pau A. Munar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

EVENT-DRIVEN

PROGRAMMING
ITPE 104
TABLE OF CONTENT
01 Generic Graphics Overview
The Graphical User Interface

GUI Design Principles

Graphical Events
TABLE OF CONTENT
02 Primitive Events and their Handlers
Mouse Events

Keyboard Events

Timer Events
GENERIC GRAPHICAL
OVERVIEW
A style of coding where a program’s overall
flow of execution is dictated by events.
• The program loads, then waits for user input events.
• As each events occurs, the program runs particular code to respond.
• The overall flow of what code is executed is determined by the series of
events that occur.
• Contrast with application – or algorithm-driven control where program
expects input data in a pre-determined order and timing
– Typical of large non-GUI applications like web crawling, payroll batch
simulation
GRAPHICAL USER INTERFACE
It refers to the visual elements and interactive features
of software or a digital system that allow users to
interact with and control the program using graphical
elements like icons, buttons, windows, and menus.
GUIs make software more user-friendly and accessible
by providing an intuitive way for users to perform tasks
and access information, typically through mouse clicks
or touchscreen interactions.
GUI IN EDP
GUI is a type of UI that allows users to interact with a computer using graphics.
GUIs typically use windows, icons, menus and pointers to allow user to input and
output information.
GUIs are typically implemented using event-driven programming. This means that
the GUI program listens for events, such as mouse clicks and key presses, and then
responds to those events.
GUI IN EDP
Here are some examples of how EDP is used to implement GUIs:
• When a user clicks on a button, the GUI program may open a window or
perform
• When a user types in a text field, the GUI program may update the display
to show the new text
• When a user moves the mouse over a window, the GUI program may
change the cursor or highlight the window
• When a user presses a key on keyboard, the GUI program may perform
some action such as opening a new menu or closing a window
GRAPHICAL USER INTERFACE
GUI Design Principles
– are set of guidelines that can be used to design effective GUIs
• Consistency: in terms of its design, layout and functionality
• Simplicity: simple and easy to use
• Clarity: clear and easy to understand
• Feedback: provides feedback to users about their actions
• Efficiency: efficient and allows users to complete their tasks quickly and easily
GRAPHICAL USER INTERFACE
GUI Design Principles
In addition to these general principles, there are also a number of specific
principles that can be applied to different aspects of GUI design, such as:
• Window Design
• Menu Design
• Form Design
• Icon Design
• Color Design
GRAPHICAL EVENTS
• ActionEvent: triggered when a user interacts with a GUI component that can
perform an action
• MouseEvent: generated when the mouse is used to interact with GUI
components *primitive
• KeyEvent: associated with keyboard interactions *primitive
• WindowEvent: related to the opening, closing, resizing, and other window-
related actions in GUI applications
• ComponentEvent: generated when there are changes to a GUI component,
such as when it's resized, moved, or shown or hidden
• FocusEvent: related to the focus of GUI components
• ItemEvent: associated with components like checkboxes and radio buttons
GRAPHICAL EVENTS
In Java, handling these graphical events involves creating event listeners and
implementing callback methods to respond to specific events.
PRIMITIVE EVENTS
Here are some examples of how EDP is used to implement GUIs:
• When a user clicks on a button, the GUI program may open a window or
perform
• When a user types in a text field, the GUI program may update the display
to show the new text
• When a user moves the mouse over a window, the GUI program may
change the cursor or highlight the window
• When a user presses a key on keyboard, the GUI program may perform
some action such as opening a new menu or closing a window
Thots? Kweschens?
Konsurnz? Komplaynts?
ssardeng@dmmmsu.edu.ph

RM 108/109 Faculty Room,


CIT Building

Monday/9:30 AM – 10:30 AM
Thursday/3:00 PM – 4:00 PM

You might also like