home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / PRIMAR.ZIP / README.NXT < prev    next >
Text File  |  1991-10-25  |  8KB  |  178 lines

  1.                              Demonstration
  2.                                 of the
  3.                            PrimaryWindow Class
  4.  
  5.  
  6.  
  7. OBJECTIVE
  8.  
  9. Based on a sample program written in C you should realize:
  10.  
  11. -   how easy it is to create CUA windows (not dialog boxes!) with PM
  12.     controls within the client area
  13.  
  14. -   how you should structure your Presentation Manager applications
  15.     correctly if you want to be successful and efficient in PM application
  16.     development.
  17.  
  18.  
  19.  
  20. WORKING ENVIRONMENT
  21.  
  22. The sample program works with a Dynamic Link Library (DLL). Please make sure
  23. that the DLL is in a directory mentioned in the LIBPATH statement in
  24. CONFIG.SYS.
  25.  
  26. If you want to modify the sample dialog later on, make sure that the path to
  27. the resource compiler (RC.EXE) is set correctly.
  28.  
  29.  
  30.  
  31. COMPONENTS OF THE SAMPLE PROGRAM
  32.  
  33. -   TEST.C, TEST,EXE
  34.     Source code sample for a PM main program. This program generates a
  35.     standard window that simulates a SAA/CUA workplace environment. The
  36.     entire code for the primary  window behavior is stored in the DLL.
  37.  
  38. -   DUMMY.C, DUMMY.DLL
  39.     The DLL DUMMY represents the DUMMY window class, which uses the
  40.     PrimaryWindow Class. In DUMMY.C you see that the DUMMY class is described
  41.     by a creation function (CreateDummy) and a window procedure (DlgWinProc).
  42.     Note that the window procedure contains only application-specific code.
  43.     All PM-specific code for
  44.  
  45.         -       Window generation
  46.         -       Frame size limitation
  47.         -       Horizontal and vertical scrolling
  48.         -       Scrollbar calibration
  49.         -       Action bar handling
  50.         -       Accelerator and mnemonic handling
  51.         -       CUA standard behaviors
  52.  
  53.     is inherited from the PrimaryWindow object by calling the SeiDefDlgProc
  54.     instead of the WinDefWindowProc or WinDefDlgProc.
  55.  
  56.     If a primary window is created that is larger than the screen, paging within
  57.     the client area becomes very easy through the use of the function SeiMoveToTop.
  58.     Parameters for this function are the client window handle and the ID of the
  59.     control which will be moved to the top. An additional parameter determines,
  60.     whether the control should always be moved or only if it is outside of the
  61.     visible area of the client window.
  62.  
  63.     The PrimaryWindow Class also provides an easy interface for direct manipulation
  64.     (drag/drop) of windows. The methods hide the complexity of the standard
  65.     drag/drop mechanism and Dynamic Data Exchange (DDE) and cover a wide range of
  66.     your direct manipulation needs.
  67.  
  68.     The constructor function SeiCreateDialogWindow is the only function you have
  69.     to invoke in order to create a primary window. Its parameter structure is
  70.     adapted to the familiar parameter structure of WinCreateWindow.
  71.     The second constructor function (SeiCreateSmallDummy) shows how to create a dialog window with a size different than the original dialog template.
  72.  
  73. -   DUMMY.H
  74.     Interface file to the class DUMMY. It only contains the prototype definition
  75.     of the constructor function and the type definition of any input parameter
  76.     structure. This file will also contain all message definitions for further
  77.     communication with DUMMY objects.
  78.  
  79. -   DUMMY.RC
  80.     Resource file for objects of the DUMMY class. Here you find the definitions
  81.     for the
  82.         -   icon, that should appear if the dummy window is minimized
  83.         -   action bar
  84.         -   accelerator table.
  85.  
  86. -   DUMMY.DLG
  87.     This file contains the dialog template that had been created by the OS/2
  88.     Dialogbox Editor. It contains one or more dialog templates. These templates
  89.     determine
  90.         -   the type and position of controls within the client area of
  91.             the primary window
  92.         -   the frame controls ( titlebar, scrollbars, system icon,
  93.             min/max icon) which will appear in the primary window
  94.         -   the frame style (whether the window should be visible or not)
  95.         -   the border (sizeable or not sizeable).
  96.  
  97. -   DUMMYI.H, DUMMYD.H
  98.     Class internal interface files, that contain the symbolic names for
  99.     action bar entries and the control identifiers in the client area. The
  100.     file DUMMYD.H is created and maintained exclusively by the Dialogbox
  101.     Editor. Whenever you add an entry to the action bar, you must also define
  102.     its symbolic name in DUMMYI.H.
  103.  
  104. -   TEST.HLP, DUMMY.HLP
  105.     These files contain the online help information that have been created
  106.     with the OS/2 Information Presentation Facility (IPF). You will realize
  107.     that the sample program uses more than one help library, since it is
  108.     very likely that large objectoriented PM applications will work in the
  109.     same manner. To get support for multiple help libraries, you invoke
  110.     SeiCreateHelpInstance (once for the application) and SeiChangeHelpTable
  111.     (each time a new help library is used).
  112.  
  113. IN THE DEMO VERSION THE HELP WINDOW WILL BE DESTROYED WHENEVER AN APPLICATION
  114. WINDOW BECOMES ACTIVE. IN THE FINAL VERSION OF THE PRODUCT, THE HELP WINDOW
  115. WILL ONLY BE DESTROYED WHEN A NEW HELP LIBRARY IS LOADED.
  116.  
  117.  
  118.  
  119. PROGRAMMER'S RESPONSIBILITIES TO CREATE A PRIMARY WINDOW
  120.  
  121. First of all, you have to determine which controls and frame controls (without
  122. the action bar) should be available in the primary  window. The layout of the
  123. primary window and the cursor navigation will be developed exclusively with
  124. the Dialogbox Editor.
  125.  
  126. Now you define the layout of the actionbar (MENU statement), minimize icon
  127. (ICON statement) and accelerator table (ACCELTABLE statement) in the .RC file
  128. with a regular text editor. At the same time you define the symbolic names for your entries of the act
  129. ionbar pull-downs in the internal header file *I.H.
  130.  
  131. Now all Resources for a primary window are defined.
  132.  
  133. Now you write the creation function, that  usually contains only the invocation
  134. of SeiCreateDialogWindow. The next function you have to write is the window
  135. procedure for the primary window. This procedure looks like a normal dialog
  136. window procedure and handles only application specific messages like
  137. WM_INITDLG, WM_COMMAND, WM_CONTROL AND WM_DESTROY.
  138.  
  139. The productivity of an application developer is improved dramatically through
  140. the use of the PrimaryWindow class, because only basic PM skills are necessary
  141. to write sophisticated SAA/CUA workplace applications.
  142.  
  143.  
  144. ADDITIONAL TESTING
  145.  
  146. Test the behavior of the PrimaryWindow class with your own primary  windows.
  147. Just invoke the Dialogbox Editor and edit DUMMY.RES, or change the menu or
  148. icon definition in DUMMY.RC.  You can even create a dialog box that is larger
  149. than the screen.
  150.  
  151. Invoke MAKE after you have changed the resource definitions of the DUMMY
  152. class, start the test application again, and you will see your modified dialog
  153. box (and action bar and icon) in a CUA conforming primary window.
  154.  
  155. Please notice the mnemonics in static controls. If you press Alt+mnemonic,
  156. the next control that is enabled  for character input receives the keyboard
  157. focus. If the keyboard focus control is outside of the visible part of the
  158. client area, the client area is scrolled to make the control visible.
  159.  
  160. Try also the direct manipulation between different test windows by clicking
  161. mouse button 2 in the client area of a PrimaryWindow object. Drag the mouse
  162. pointer and release button 2 over a "good" target window and notice the data
  163. transfer. The "good" target window can be minimized and can be in a different
  164. instance of the test application.
  165.  
  166.  
  167.                HAVE FUN WITH THE PRIMARYWINDOW CLASS AND ENJOY
  168.               APPLICATION DEVELOPMENT UNDER PRESENTATION MANAGER !
  169.  
  170.  
  171.  
  172. For more information contact:
  173.  
  174.                  SES Software Engineering Services Berlin
  175.                      Koenigsallee 49,  1000 Berlin 33
  176.                 Tel: (030) 826 40 63 - FAX: (030) 825 30 14
  177.  
  178.