DOC PREVIEW
Purdue ECE 462 - Graphical User Interface

This preview shows page 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-212-213-214-215-216-217-218-219-220-221-222-223-224-225-226 out of 226 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 226 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Graphical User InterfaceGUI using C++ / QtQt + EclipsePath Setting (Windows)Qt Widget BoxSignals and SlotsDefault Parameter ValuesGUI using JavaJFrameHandle User ActionsHandle Button ClickHandle Scrollbar EventsHandle Mouse MotionQt Signals and SlotsQt ExamplesVertical LayoutCreate Qt ExecutableGUI and OOPEclipse + EmacsAdd Slots and Connect SignalsDraw Geometric ShapesHandle Mouse EventCollision DetectionTimer UpdateMemory ManagementJava Events and HandlersAdd a Derived Class of JPanelHandle Mouse EventAdd TimerFormat StringStart and PauseArrayJava ArrayArray of intArray of ObjectsObjects Contain ArraysC++ ArrayArray of intArray of ObjectsObjects Contain ArraysYHL Graphical User Interface 1ECE 462Object-Oriented Programmingusing C++ and JavaGraphical User InterfaceYung-Hsiang [email protected] Graphical User Interface 2GUI using C++ / QtYHL Graphical User Interface 3Qt + EclipseYHL Graphical User Interface 4YHL Graphical User Interface 5YHL Graphical User Interface 6YHL Graphical User Interface 7YHL Graphical User Interface 8YHL Graphical User Interface 9YHL Graphical User Interface 10YHL Graphical User Interface 11YHL Graphical User Interface 12YHL Graphical User Interface 13YHL Graphical User Interface 14Path Setting (if there are problems)YHL Graphical User Interface 15YHL Graphical User Interface 16YHL Graphical User Interface 17YHL Graphical User Interface 18Qt\bin and MinGW\bin should be in the pathYHL Graphical User Interface 19YHL Graphical User Interface 20YHL Graphical User Interface 21YHL Graphical User Interface 22YHL Graphical User Interface 23Qt Widget BoxYHL Graphical User Interface 24YHL Graphical User Interface 25YHL Graphical User Interface 26YHL Graphical User Interface 27YHL Graphical User Interface 28YHL Graphical User Interface 29YHL Graphical User Interface 30YHL Graphical User Interface 31YHL Graphical User Interface 32YHL Graphical User Interface 33YHL Graphical User Interface 34YHL Graphical User Interface 35Signals and Slotsi.e. events and handlersYHL Graphical User Interface 36YHL Graphical User Interface 37YHL Graphical User Interface 38YHL Graphical User Interface 39YHL Graphical User Interface 40YHL Graphical User Interface 41YHL Graphical User Interface 42YHL Graphical User Interface 43YHL Graphical User Interface 44YHL Graphical User Interface 45YHL Graphical User Interface 46YHL Graphical User Interface 47YHL Graphical User Interface 48YHL Graphical User Interface 49YHL Graphical User Interface 50YHL Graphical User Interface 51YHL Graphical User Interface 52YHL Graphical User Interface 53YHL Graphical User Interface 54YHL Graphical User Interface 55Default Parameter ValuesYHL Graphical User Interface 56Default Parameter Values in C++ • always start from the last parameterfunc1(int x, int y, int z = 0) ...func1(int x, int y = 1, int z = 0) ...func1(int x = 2, int y = 1, int z = 0) ...⇒ func1(1,2,3) means x = 1, y = 2, z = 3⇒ func1(4, 5) means x = 4, y = 5, z = 0⇒ func1(6) means x = 6, y = 1, z = 0⇒ func1() means x = 2, y = 1, z = 0• cannot skip any parameter (otherwise, ambiguous)func1(int x = 2, int y, int z = 0) ...⇒ what does func1(3, 4) mean?YHL Graphical User Interface 57Graphical User Interface (GUI)• Most GUIs are built using OOP because OOP is a natural way to support GUI.• GUI has "containers", such as QWidget, that can include buttons, labels, scrollbars ...• When the widget is redrawn (restore from minimized, maximized, or content update), the frame asks each component to redraw itself.• Each object knows how to redraw itself because paintEvent(C++ / Qt) or paintComponent (Java) is overridden.YHL Graphical User Interface 58GUI using JavaYHL Graphical User Interface 59JFrame is a derived class of ContainerYHL Graphical User Interface 60YHL Graphical User Interface 61many derived classesYHL Graphical User Interface 62Derived classesoverride paintComponentYHL Graphical User Interface 63JFramesimilar to QWidgetYHL Graphical User Interface 64A frame may contain many objects,such as buttons, labels, scrollbar ...add componentsfrom the paletteYHL Graphical User Interface 65The objects are contained in the NewJFrame classYHL Graphical User Interface 66The objects are created by using new.Netbeans creates initComponent.Do not modify it.YHL Graphical User Interface 67Handle User ActionsYHL Graphical User Interface 68Handle Button ClickEventsActionAction PerformedYHL Graphical User Interface 69YHL Graphical User Interface 70YHL Graphical User Interface 71Handle Scrollbar EventsEventsChangeState ChangedYHL Graphical User Interface 72YHL Graphical User Interface 73YHL Graphical User Interface 74YHL Graphical User Interface 75YHL Graphical User Interface 76JSlider default range is 0 - 100YHL Graphical User Interface 77Handle Mouse MotionEventsMouse MotionMouseMovedYHL Graphical User Interface 78YHL Graphical User Interface 79YHL Graphical User Interface 80Self TestYHL Qt Signals and Slots 1ECE 462Object-Oriented Programmingusing C++ and JavaQt Signals and SlotsYung-Hsiang [email protected] Qt Signals and Slots 2Write Qt Programs without Eclipse(still Eclipse for version control)A better way to know how it works.Many examples are obtained by modified Qt samples. Copyright Trolltech.YHL Qt Signals and Slots 3Qt ExamplesYHL Qt Signals and Slots 4YHL Qt Signals and Slots 5YHL Qt Signals and Slots 6YHL Qt Signals and Slots 7Simple ExampleVertical LayoutYHL Qt Signals and Slots 8YHL Qt Signals and Slots 9YHL Qt Signals and Slots 10YHL Qt Signals and Slots 11YHL Qt Signals and Slots 12Create Qt Executable1. qmake -project2. qmake3. make• This works for both Linux and Windows.YHL Qt Signals and Slots 13YHL Qt Signals and Slots 14YHL Qt Signals and Slots 15YHL Qt Signals and Slots 16YHL Qt Signals and Slots 17YHL Qt Signals and Slots 18derived class of QWidgetmacro to enable signals and slotsdefault value of the parent widgetYHL Qt Signals and Slots 19this includes many Qt classeswindow's titlevertical layoutadd a buttonadd a labeladd a sliderYHL Qt Signals and Slots 20GUI and OOPvbox->addWidget(button1);vbox->addWidget(label1);vbox->addWidget(edit1);vbox->addWidget(slider1);• These are objects of different classes.• These classes are derived class of QWidget.• If a function requires an object of QWidget, the function can be called with an object of QLabel.• Any QLabel object is also a QWidget object (wrong in the other direction).YHL Qt Signals and Slots 21YHL Qt Signals and Slots 22YHL Qt Signals and Slots 23YHL


View Full Document

Purdue ECE 462 - Graphical User Interface

Download Graphical User Interface
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Graphical User Interface and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Graphical User Interface 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?