140 likes | 154 Views
CITA 342 Section 1. Visual Programming. Visual Programming. Allows the use of visual expressions (such as graphics, drawings, or animation) in the process of programming. These visual expressions may be used as graphical interfaces for textual programming languages (such as Visual C++).
E N D
CITA 342 Section 1 Visual Programming
Visual Programming • Allows the use of visual expressions (such as graphics, drawings, or animation) in the process of programming. • These visual expressions may be used as graphical interfaces for textual programming languages (such as Visual C++).
GUI(Graphical User Interface) • A GUI (usually pronounced GOO-ee) is a graphical (rather than purely textual) user interface to a computer.
OOP • Most of the design work for this course is based on the programming approach called object oriented programming (OOP). • Each graphical interface element is defined as a class from which you can create object instances for your application. You can code or modify prepackaged methods that an object will use to respond to user stimuli.
Windows GUI Services • Windowing • Create, move, resize, display, hide, clip, minimize, restore, maximize… • Commands • Menus, toolbar… • Graphical elements • Icons, buttons, standard shapes, lines… • Combinations • Dialogs, edit box, list box...
Windows Model • Windows is event-driven, message-based. • Virtually everything that happens is in response to a message regarding some kind of event.
Events • Mouse event, keyboard event, window resizing, menu selection, timer hit, window creation and destruction, etc. • Program must respond to many different events that can come in any order. • Multiple events can be triggered and queued for processing.
Messages • Windows events are communicated via messages. • Each hardware and user action causes one or more messages to be generated. • Example: • Press the ‘a’ key • WM_KEYDOWN, WM_KEYUP, and WM_CHAR messages generated • Approximately 200 different WM messages.
Windows Program Logic • Initialize • Wait for a Windows event and receive the message • Process the message • Goto wait
Visual C++ Components • Visual C++ consists of several complete Windows application development systems in one product. • You can use many Visual C++ tools, including the resource editors, to make low-level programming easier. • You can also use application framework libraries such as the MFC library to further speed your Windows-based application development.
Visual Studio • Visual Studio is a suite of developer tools that includes Visual C++. The Visual Studio integrated development environment (IDE) is shared by several tools, including Visual C++, Visual C#, and Visual Basic.
Microsoft Foundation Classes (MFC) • A class library. • Support is integrated into the compiler environment. • Modern versions of Windows operating system are written in Visual C++ using the MFC library. • There are more than 200 MFC classes.
MFC Source Code • MFC library is shipped with its source code so that advanced users may examine its intricacies and find ways to use its code more effectively. • Having the source code available is often useful in debugging a program as well.
MFC Advantages • Windows program interfaces with MFC library at execution time through one or more dynamic link libraries (.dll files). This makes MFC programs potentially smaller and more efficient. • There are tens of thousands of lines of previously written and tested code in MFC library, and the principal of reusability tells us to use it where doing so can save time, money, or effort.