Presentation is loading. Please wait.

Presentation is loading. Please wait.

BZUPAGES.COM Visual Programming Lecture – 5 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan.

Similar presentations


Presentation on theme: "BZUPAGES.COM Visual Programming Lecture – 5 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan."— Presentation transcript:

1 BZUPAGES.COM Visual Programming Lecture – 5 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan.

2 BZUPAGES.COM Wizard It’s a Software tools with which using step by step procedure. Wizard creates a full environment for application designs. For dialog based programming Wizard programming is used. In which we design applications with using such types of applications as – SDI (Single document) – MDI (Multiple Document) – Dialog Based

3 BZUPAGES.COM SDI SDI stands for Single document interface. An Application which perform operation on one document at one time….eg Notepad In which data is used as Text, Graphics, Sound etc For used SDI programming we want to help with the AppWizard. AppWizard is used to write a great deal of code in our program.

4 BZUPAGES.COM MDI Simultaneously more than one files can be opened in one application. In which the programs will automatically create a new document object for each new object. This means that pure data storage and display. Eg….. MS-WORD Using two different window type raises as interesting issue in MDI programming when the user is working on the document and also want certain menus as File, Edit….etc

5 BZUPAGES.COM Dialog Based Programming This is one of the rectangle area that is used for a purpose of input. Graphics tools are used in it. For dialog based programming also used AppWizard. In dialog Based programming controls are used for input and create our own application through Wizard. These controls are of many types. Such as Buttons, Radio, Check Boxes …etc

6 BZUPAGES.COM Classes For create application through Wizard two classes are used in which CWinApp CDialog CWinApp in used for the handle the full application and next CDialog Class is used for handle the dialog boxes. These are the base classes of Wizard.

7 BZUPAGES.COM eg. “Test” name of application Wizard will design this using 2 base classes. – CTestApp (derived from WinApp) – Test.h – Test.cpp – CTestDlg (derived from WinApp) – Testdlg.h – Testdlg.cpp

8 BZUPAGES.COM AppWizard Is automatically generates a basic framework for the windows programs. Infect, the framework is itself a complete, executable windows programmes. In Wizard, further capabilities for managing, modifying and extended code is provided by the Wizard bar, Which is optionally displayed in the toolbar area of Vc++ window. It’s a particularly used in the context of MFC and API based programming

9 BZUPAGES.COM Class Wizard Classes are the most important language feature of c++ and are fundamental to Windows programming with Visual C++. The class wizard provides an easy means of extending the classes by AppWizard as a part of basic windows application and also helps to add new classes based on MFC Classes. And also the ClassWizard neither recognizes nor deals with the classes that are not based on MFC Classes.

10 BZUPAGES.COM Steps to create Windows Application through Wizard.

11 BZUPAGES.COM Dialog Based Programming Dialog: this is one of the rectangle area that is used for the purpose of input. In dialog based programming such controls are used. Apart from these forms of input, then also supply input through user interface objects like.

12 BZUPAGES.COM Controls/Buttons 1.Buttons 2.List Boxes 3.Edit Controls 4.Combo Boxes 5.Scroll bars 6.Static Controls 7.Check Box 8.Slider 9.Radio Buttons WNDCLASS BUTTON LISTBOX EDIT COMBOBOX SCROLLBAR STATIC BUTTON SLIDER BUTTON MFC ClASS CBUTTON CLISTBOX CEDIT CCOMBOBOX CSCROLLBAR CSTATIC CBUTTON CSLIDER CBUTTON

13 BZUPAGES.COM For any application, we have to attach variables with IDs in control. IDs can’t directly be process so we attach variables as: variable name, category and type. Data to be stored in variables from controls & variables are then attached.

14 BZUPAGES.COM For that, functions which used for that processing. UpdateData(true) – Transfer data from control to be respected variables. UpdateData(false) – Transfer data from variable to controls.

15 BZUPAGES.COM Creating Controls. MFC provides for creating and communicating. This involves constructing an object from a control class and calling that object’s create () function. All the MFC control classes override the create () function inherited from cwnd to simplify creation of control. E.g. mybutton in an object of the type cbutton, mybutton. Create (“ok”, WS-CHILDIWS-VISIBLE BS-PUSHBUTTON, CRECT (100, 100, 150, 150), This 1),

16 BZUPAGES.COM This statement create a push button control. 1.The first parameter in the text that will appear on the face of button. 2.The 2 nd in the button style. 3.Third parameter specifies the control’s location and size. 4.‘this’ identifies the parent window. 5.‘1’ in the identifier for the control. This value in abo knows as child window ID.

17 BZUPAGES.COM Controls:-

18 BZUPAGES.COM Buttons button controls are of four types 1.Push button 2.Check boxes 3.Radio buttons 4.Group boxes

19 BZUPAGES.COM Push button Push buttons are 3D rectangle that appear to go up and down when clicked as if they were push buttons on a control panel. Check boxes Check boxes are small squares in which check marks can be toggled on and off.

20 BZUPAGES.COM Onchkclick() { Update data (true); If (m-chk ==) m-text = “checkbox checked”; Else m-text = “unchecked”; update data (false); }

21 BZUPAGES.COM Radio buttons:- Radio buttons are small circles that are checked with a solid dot when clicked. Radio buttons are usually used to present a list of mutually exclusive option to the user. That is, checking one radio button unchecks the others in the group. Radio buttons are provide multiple selection b/w catagories.

22 BZUPAGES.COM Q- Handling and grouping of radio buttons in one window. Ans For handling and grouping of radio buttons, in one line all radio buttons are considered in one group and If we want to make a group, in an application then we make different groups in this dialog box to select more then one radio buttons at atime. But each in every group. That’s because the three radio buttons already function as a group automatically. They are all in the same window, so they are already coordinated. When the click one of these radio buttons, the program de-selects the other automatically, because they are all share the same window. In that variable is of into type & is attached only with the group’s checked button which is checked in a particular group.

23 BZUPAGES.COM Group boxes: Group boxes are nothing but rectangles used for visual effect. A button can be clicked with the left mouse button or the spacebar works only if the button has the input focus. A button indicates that it has the input focus by displaying a thin dotted rectangle known as a focus rectangle.


Download ppt "BZUPAGES.COM Visual Programming Lecture – 5 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan."

Similar presentations


Ads by Google