Page 56 - DCAP408_WEB_PROGRAMMING
P. 56

Windows Programming




                    Notes          2.  Do one of the following:
                                           Click the Cast Member Properties button.
                                           Right-click (Windows) or Control-click (Mac), and select Cast Member Properties
                                            from the context menu.
                                           Select Window > Property Inspector. The Property inspector displays only those
                                            properties associated with the selected cast member.

                                   View the Cast Member Number

                                   See the Cast Member Number field in the upper-right corner of the Cast window.

                                   Self Assessment


                                   Fill in the blank:
                                   5.  The  controls  at  the  top  of  the  Cast  window  are  the  similar  in  both  the  List  and
                                       ................................. views.

                                   4.5 Button Controls


                                   A Button is a Windows control utilized to initiate an action. From the user’s point of view, a
                                   button is functional when clicked, in which case the user places the mouse on it and presses one
                                   of the mouse’s buttons.
                                   There are numerous types of buttons. The most general and regularly utilized is a rectangular
                                   object that the user can simply identify. In some programming surroundings, this classic type is
                                   known as a command button. There are other controls that can serve as click controls and initiate
                                   the similar behavior as if a button were clicked.

                                   From the programmer’s point of view, a button requires a host, like a dialog box.
                                   4.5.1 Creating a Push Button


                                   To diagrammatically add a button to a dialog box, in the Toolbox, click Button and click the
                                   required location  on the  dialog box.  By default,  when you visually generate a dialog box,
                                   Microsoft Visual C++ adds two buttons: OK and Cancel. If you don’t require these buttons, click
                                   one and press Delete.
                                   The most accepted button utilized in Windows applications is a rectangular control that exhibits
                                   a word or a short sentence that directs the consumer to access, dismiss, or initiate an action or
                                   suite of actions. In Microsoft Visual C++ applications, this control is executed by means of the
                                   Button control from the Toolbox window.
                                   In the MFC, a button depends on the CButton class, which is obtained from CWnd. Thus, to
                                   programmatically obtain  a button,  you can create a pointer to  CButton and initialize it  by
                                   means of the new operator.

                                   4.5.2 Characteristics of a Command Button

                                   Similar to every Windows control, a button is identified by its  IDentifier. Since a button is a
                                   control, by convention, its identifier’s name begins with IDC (the C stands for Control).






          50                                LOVELY PROFESSIONAL UNIVERSITY
   51   52   53   54   55   56   57   58   59   60   61