FLTK Help Session By Richard Yu Gu CS 638 -Graphics Fall, 1999.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Chapter 16 Graphical User Interfaces
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Microsoft® Small Basic
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
FLUID  The Fast Light User Interface Designer, or FLUID, is a graphical editor that is used to produce FLTK source code  Creates C++ code  Compile.fl.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Based on slides created by Edward Angel
Chapter Day 9. © 2007 Pearson Addison-Wesley. All rights reserved4-2 Agenda Day 8 Questions from last Class?? Problem set 2 posted  10 programs from.
CS 480/680 Computer Graphics Programming with Open GL Part 8: Working with Callbacks Dr. Frederick C Harris, Jr. Fall 2011.
Lesley Bross, August 25, 2010 ArcGIS 10 Add-In Components and Controls.
Sep-05 Slide:1 ActiveX Controls in VB ActiveX Controls in VB6.
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Chapter 8: Writing Graphical User Interfaces
EzWindows API A Graphical Application Programmer Interface JPC and JWD © 2002 McGraw-Hill, Inc.
Introduction to Matlab & Data Analysis
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
FLTK Tutorial.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Lecture 3.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
1 Input and Interaction. 2 Input Devices Physical input devices Keyboard devices and pointing devices Logical input devices.
Computer Graphics I, Fall 2010 Input and Interaction.
Lab 6: event & input intro User Interface Lab: GUI Lab Oct. 2 nd, 2013.
Java GUI’s are event driven, meaning they generate events when the user interacts with the program. Typical events are moving the mouse, clicking a mouse.
 2002 Prentice Hall, Inc. All rights reserved Introduction Graphical User Interface (GUI) –Gives program distinctive “look” and “feel” –Provides.
1 Outline 1 Introduction 2 Overview of Swing Components 3 JLabel 4 Event Handling 5 TextFields 6 How Event Handling Works 7 JButton 8 JCheckBox and JRadioButton.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Even-Driven Programming and basic Graphical User Interface.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 15: GUIs 1.
MSc Workshop - © S. Kamin, U. ReddyLect 3 - GUI -1 Lecture 3 - Graphical User Interfaces r GUI toolkits in Java API r JFrame r GUI components.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
FLTK. Objectives Install and Use FLTK Widgets ◦Callbacks Handling event ◦System events ◦Mouse events ◦Keyboard events.
Graphical User Interfaces (Part 2) 1. View  view  presents the user with a sensory (visual, audio, haptic) representation of the model state  a user.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
FLTK. Оконная система, DWM XWindows (Linux/UNIX) Windows DWM (Win Vista, 7, 8)
Program 2 due 02/01  Be sure to document your program  program level doc  your name  what the program does  each function  describe the arguments.
Object Oriented Programming.  Interface  Event Handling.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Agenda Introduction. Event Model. Creating GUI Application. Event Examples.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Computer Graphics I, Fall 2010 Working with Callbacks.
Test 2 Review. General Info. All tests are comprehensive. You are still responsible for the material covered prior to the first exam. You will be tested.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
Creating User Interfaces Event-Driven Programming.
Tutorial 7 Creating Animations. XP Objectives Learn about animation Create a timeline Add AP divs and graphics to a timeline Move and resize animation.
OpenGL in FLTK  .
To gain an overview of the session, the session log file (.LOG) contains the time when each event occurs. The session has its own timer, where “hour zero"
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
View  view  presents the user with a sensory (visual, audio, haptic) representation of the model state  a user interface element (the user interface.
July FLTK The Fast Light Toolkit • A C++ graphical user interface toolkit • Can be used under X, Windows, MacOS • Supports OpenGL • Provides: – Interactive.
Forms Concepts Triggers Fired when Internal/External events occur
Introduction to Event-Driven Programming
FLTK The Fast Light Toolkit
Lesson 1: Buttons and Events – 12/18
Chapter 2: GUI API Chapter 2.
Fundamentals of Python: From First Programs Through Data Structures
Event Driven Programming
Introduction to Computing Using Java
Chapter 16 Graphical User Interfaces
Event Driven Programming Anatomy – Handle
Model, View, Controller design pattern
Chapter 16 Graphical User Interfaces
Presentation transcript:

FLTK Help Session By Richard Yu Gu CS 638 -Graphics Fall, 1999

Component of FLTK to Discuss Widget Basics Sub-classing Widgets Basic Drawing Event Handling Questions

Widgets in FLTK Building blocks Several widgets can behave independently or interrelated Many different “build- in” types come with FLTK Window Button Box Input Field File Chooser Menu Slider Group

Window by Example Creating a new Window with its size as parameters Subsequent Widget creation are to this window until end() occur. show() member method displays the window damage(1) member method triggers refreshing of the window

Box by Example Add Box to a window with its position in the window and its size. redraw() method refreshes and update the display of the box, which is triggered by damage(1). label() method allow drawing of text or image to the box.

Buttons and Callback Functions Button respond to click on them by calling the pre-registered function- “callback” function Register a callback function by using the member function callback(, ). Define callback function as void funcname(Fl_Widget *but, )

Sidetrack on Callback Functions Callback functions can be used and is meaningful for most of the widgets in FLTK library When the default event of the widget occurred, the registered callback function if invoked automatically.

Drawing Using FLTK #include color(x) to change color to see pre-defined colors Override draw() func of the widget to make the drawing persistent fl_rectf fl_rect fl_line fl_loop fl_polygon fl_arc fl_pie fl_draw(char *, int x, inty)

Drawing Images Image Stored as char array, image, of length width*height*3. (Ordered in RGB) fl_draw_image(image, X, Y, imgW, imgH) With in a widget such as box do the following (new Fl_Image((unsigned char *)(image), imgW, imgH))->label(this); To make the drawing persistent programmer should subclass the widget that which to be drawn to and override the private: void draw() function.

Event Handling User Interaction Mouse and Keyboard Actions –Subclass the widget that need to deal with some specific events –Override the public: int handle(int e) method in the new class. –If, in the handle() function an event is dealt with, function should return 1, otherwise return 0.

Event Handling Cont. Parameter e tells the type of event, common types are –FL_PUSH –FL_DRAG –FL_RELEASE –FL_MOVE –FL_KEYBOARD To find out where the mouse is use –Fl::event_x(); –Fl::event_y(); To find out which button is pressed –Fl::event_button(); To find which key is pressed –Fl::event_key();

Questions? More example of widgets? More details at S:\fltk\documentationS:\fltk\documentation Questions?