Programming with Graphical Components - PowerPoint PPT Presentation

1 / 46
About This Presentation
Title:

Programming with Graphical Components

Description:

PAPAGEORGIOU THEODORE. PETERSSON ERIK. RANDHAHN DIRK. RUEGSEGGER ADRIAN. SACHS HOLGER ... SAVINON RIVERA JOS . AHMED GEILANI. ARTURSSON ANDREAS. BARO JAMES ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 47
Provided by: rag76
Category:

less

Transcript and Presenter's Notes

Title: Programming with Graphical Components


1
Programming with Graphical Components
Ragnar.Nohre_at_ing.hj.se
Project course
Demo-day Dec 9, 7 weeks from now
2
Objectives
  • Practice OO-programming
  • Practice programming
  • Reuse classes (graphical components)
  • Learn how the OS interacts with a graphical app
  • Event driven programming, etc
  • Get experience in software development

3
Topics of today
  • Participants
  • Course information
  • Running a software project
  • A simple MFC application (paint)

4
Topics of today
  • Participants
  • Course information
  • Running a software project
  • A simple MFC application (paint)

5
participants
LANDIN ANDERS LEXELL ERIK LI DEQING MARQUARDT
PATRIK MARTINEZ JORGE OJALA TOMI PAPAGEORGIOU
THEODORE PETERSSON ERIK RANDHAHN DIRK RUEGSEGGER
ADRIAN SACHS HOLGER SALZER MIKE SAVINON RIVERA
JOSÉ
LANDIN ANDERS LEXELL ERIK LI DEQING MARQUARDT
PATRIK MARTINEZ JORGE OJALA TOMI PAPAGEORGIOU
THEODORE PETERSSON ERIK RANDHAHN DIRK RUEGSEGGER
ADRIAN SACHS HOLGER SALZER MIKE SAVINON RIVERA
JOSÉ
AHMED GEILANI ARTURSSON ANDREAS BARO
JAMES BJÖRKETUN JOHN BUCHERER FELIX FJÄLLSTRÖM
ANTON FRASER PETER GUNNARSSON DAVID GUNNARSSON
ERIK HENRIKSSON VICTOR JUNGNELL JOHAN KRALJ
DANIJEL KÜNG KLAUS
AHMED GEILANI ARTURSSON ANDREAS BARO
JAMES BJÖRKETUN JOHN BUCHERER FELIX FJÄLLSTRÖM
ANTON FRASER PETER GUNNARSSON DAVID GUNNARSSON
ERIK HENRIKSSON VICTOR JUNGNELL JOHAN KRALJ
DANIJEL KÜNG KLAUS
6
More participant
SCHECK ARNE STRÖBERG NICHLAS TAPPER
ROBBIN TASEVSKA EMILIA VLASTOS ALEXANDER WELTER
MARKUS YU FEI ÖZBEK FEDRA
SCHECK ARNE STRÖBERG NICHLAS TAPPER
ROBBIN TASEVSKA EMILIA VLASTOS ALEXANDER WELTER
MARKUS YU FEI ÖZBEK FEDRA
Someone else.
Someone else.
7
Topics of today
  • Participants
  • Course information
  • Running a software project
  • A simple MFC application (paint)

8
Course Information
  • Programming language/environment
  • Applications
  • Project groups
  • Gradings/scores (betyg)

9
Programming language/environment
  • Visual C/C
  • - Win32
  • - MFC
  • Other?
  • You need to convince me with a very good reason
  • You are on your own
  • I will ask you to give a seminar on your
    programming environment

10
Visual C/C Win32 API
  • You write all code by yourself
  • You will learn how Windows works- Your
    application will look less impressive

11
Visual C using MFCMicrosoft Foundation Classes
  • Take advantage of Microsoft's class library
  • Take advantage of a program skeleton written by
    AppWizard
  • Easy to make an application with a professional
    look and feel
  • MFC is huge
  • easy to use
  • difficult to understand

12
A popular book on MFC-programming(somewhat
outdated)
ISBN 0130166294 300 pages
akademibokhandeln!
13
Applications
  • Two options
  • Choose and application from my list of project
    ideas
  • Define your own application
  • - And ask me if it is okay (you need to convince
    me)

The application must use graphical components,
such as menus, dialog boxes, buttons,
list-boxes, etc.
14
Project Groups
  • 3 to 7 persons
  • Equal skills in C programming
  • Reading the same additional courses

15
Urgent Actions before 1500 tomorrow
  • Send me a mail and tell me about
  • The group members
  • The name of the group (if any)
  • Programming environment (win32/MFC/(or ?))
  • Your Application

If you like me to choose a group for you send me
a mail to tell me that you are taking this
course..
16
Individual Grades/scores (betyg)
U, 3,4, or 5 (swed) ECTS (int)
17
Gradings, the general idea
  • 3.
  • Your project succeeds
  • You have been working actively in the project
    (5x40200 h)
  • You have done some programming
  • 4-5. as above, in addition you
  • master C programming
  • have knowledge in Windows programming (MFC or
    win32)

18
programming points
/
CALL int m Max(a,b) VERSION
2001-10-22 by NoRa/DuSt TASK Returns
the maximum of a and b.
/
Head 0-3 p
int Max(int a, int b) if (agtb) return
a else return b // Max
Code 0-5 p
If somebody has a bettersuggestion, please let
meknow!
19
Topics of today
  • Participants
  • Course information
  • Running a software project
  • A simple MFC application (paint)

20
Software development projects
This is extremely difficult
most industrial projects fail
The more persons involved, the more likely is
the project to fail
21
The Project
Design
Development
Test
Demo-Day
Test Protocol
Design Doc.
Program
22
Requirement specification
  • Describe the application
  • describe the purpose of the application
  • illustrate the GUI by a figure
  • how to use the application
  • perhaps you need to discuss Use-cases/scenarios?

23
Requirement specification
  • It is a Contract
  • You define what you will deliver
  • Your customer (that is me) has to approve and
    sign the spec
  • 7 weeks from now, your delivery has to match the
    spec

hint dont promise too much
tip specify a basic functionality and
additional features
24
The Time Plan
  • Week 1 design
  • Week 2 programming
  • Week 3 programming
  • Week 4 programming
  • Week 5 programming
  • Week 6 testing

BAD
25
Purpose of the Time Plan
The purpose is to help you deliver on time At
any time, you should be able to match the status
of the project with the original time plan Are
we one-time, late or early? If we are late, what
actions must we take? A vague plan is useless!
26
Tip Use aplhas!
Use the concept of alphas to denote releases
withincomplete functionality Example, consider
a car racing game
Alpha-1 The application displays the road and
the car, but the car cannot move Alpha-2
Animation implemented. The motion of the carcan
be controller by the player, but there is no
collision detection. Alpha-3 Collision-detection
and sound-effects implemented Alpha-4 The
loop-counter , the timer and the high-score list
implemented. Etc. Beta-1 Full functionality,
testing...
27
Design
The design document will help you divide the work
between the group-members
  • Design document (living document)
  • High Level Design
  • which classes/functions do we need?
  • nams, interfaces, functional-descriptions,UML

Low Level Design implementation!
28
When to start programming?Do we have to wait
until the development phase?
Try your tools, write a simple GUI-program! - How
else could you make a proper time plan?
Conduct experiments, try different solutions -
How else could you make a proper design?
29
A typical week
M T W T F
S S
LAB
Sem?
Sem?
My main role is to assist you during the LAB-hours
30
Course Plan
0800. I have defined the groups
Demoday
w43
w50
signed req spec and timeplan required
Before Wednesday 1500 you e-mail a
suggested list of group members to me
31
Topics of today
  • Participants
  • Course information
  • Running a software project
  • A simple MFC application (paint)

32
A simple paint application
33
Old style development
REUSE modify a copy of an old program
old program
new program
Old program

34
New style Development
Existing classbelonging to a class library
Typically, the overridden functions are invoked
from the existing code in the base-class
35
Framework programmingframework arbetsram
Existing code that calls your functions
Overridden functions implemented by you!
Existing functions called by your code
36
Appwizard creates an applicationcontaining 4
important objects
  • application object
  • frame object
  • document object
  • view object

Very important
37
the document object
class CPaintDoc public CDocument ...
old stuff inheritedfrom CDocument
CPaintDoc -object
new stuff addedby me or Wizard
38
the document object
the document-object represents the datathat is
manipulated by my paint-application
member functions to read and save from file, etc
CPaintDoc -object
vector of points (added by me)
39
the view object
class CPaintView public CView ...
old stuff inheritedfrom CView
CPaintView -object
new stuff addedby me or Wizard
40
the view object
the view-object represents the windowthat
displays the painting.
CPaintView -object
41
Let us write some code...
  • Let AppWizard create the application
  • Play with OnDraw(..)
  • to show you when this function is called we will
    let it paint the window by a random color
  • Implement the application
  • add the vector to the CPaintDocument class
  • add OnMouseMove(..) to CPaintView
  • edit the OnDraw(..) on CPaintView

42
Add the data structure to the document class
include ltvectorgt typedef stdvectorltCPointgt
CVecPoint
class CPaintDoc public CDocument . //
Attributes public
CVecPoint m_vecPoint
43
Add OnMoseMove to the view class
void CPaintViewOnMouseMove(UINT nFlags, CPoint
point) if (nFlags MK_LBUTTON) CVecPoint
v GetDocument()-gtm_vecPoint v.push_back(
point ) Invalidate(FALSE)
44
Implement OnDraw()in the view class
void CPaintViewOnDraw(CDC pDC) CPaintDoc
pDoc GetDocument()
CVecPoint v pDoc-gtm_vecPoint CRect
rc(-4,-4,3,3) pDC-gtSelectStockObject(BLACK_BRUSH
) for (CVecPointiterator iv.begin()
i!v.end() i) CPoint pt i
pDC-gtEllipse(rc pt)
45
Topics of today
  • Participants
  • Course information
  • Running a software project
  • A simple MFC application (paint)

46
Urgent Actions before 1500 tomorrow
  • Send me a mail and tell me about
  • The group members
  • The name of the group (if any)
  • Programming environment (win32/MFC/(or ?))
  • Your Application

If you like me to choose a group for you send me
a mail...
Write a Comment
User Comments (0)
About PowerShow.com