home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 7.ddi / RWDOC.ZIP / MANUAL.RW < prev   
Encoding:
Text File  |  1992-06-10  |  63.9 KB  |  1,862 lines

  1.                             MANUAL.RW
  2.                             =========
  3.  
  4.  
  5. This file contains additions and corrections to the Resource
  6. Workshop User's Guide, including support of Windows 3.1 and
  7. Borland Windows Custom Controls (BWCC).
  8.  
  9. The Resource Workshop online documentation also includes these
  10. files:
  11.  
  12. BWCCAPI.RW    Describes technical aspects of Borland Windows
  13.               Custom Controls.
  14.  
  15. CUSTCNTL.RW   Describes creating Windows custom controls classes,
  16.               with C and Pascal programming examples.
  17.  
  18. BWCCSTYL.RW   Describes general style guidelines for creating
  19.               resources using BWCC.
  20.  
  21. Contents (lists only section and first subsection headings)
  22. -----------------------------------------------------------
  23.  
  24.     1  Changes to the Resource Workshop User's Guide
  25.          1.1     Introduction
  26.          1.2     Chapter 2, Resource Workshop Basics
  27.          1.3     Chapter 3, Working with projects and resources
  28.          1.4     Chapter 4, Creating dialog boxes
  29.          1.5     Chapter 5, Creating menus
  30.          1.6     Chapter 6, Creating accelerators
  31.          1.7     Chapter 8, Using the Paint editor
  32.          1.8     Chapter 9, Creating icons
  33.          1.9     Chapter 10, Creating cursors
  34.          1.10    Chapter 11, Creating fonts
  35.          1.11    Appendix A, Technical notes
  36.     2  Changes for this release
  37.          2.1     Visible option
  38.          2.2     Windows version compatibility
  39.          2.3     Dialog box positioning
  40.     3  New features in Windows 3.1
  41.          3.1     Style dialog boxes
  42.          3.2     Icon sizes
  43.          3.3     Version stamper
  44.     4  Linker requirements
  45.          4.1     BWCC.LIB
  46.          4.2     BWCC.DLL
  47.          4.3     BWCC and Object Windows Library (OWL)
  48.     5  Borland Windows Custom Controls
  49.          5.1     Using the custom dialog class
  50.          5.2     Using the custom controls
  51.          5.3     Customizing existing applications for BWCC
  52.     6  Loading BWCC to enable Borland custom controls
  53.     7  Sample exercise: Customizing an existing application
  54.          7.1     Backing up the application
  55.          7.2     Opening a project
  56.          7.3     Editing the application's controls
  57.          7.4     Saving and testing the project
  58.     8  Tips on editing resources
  59.          8.1     Accelerators
  60.          8.2     Bitmaps
  61.          8.3     Cursors
  62.          8.4     Dialog boxes
  63.          8.5     Icons
  64.          8.6     Menus
  65.          8.7     String tables
  66.     9  Command-line tools: RLINK.EXE, BRCC.EXE, and BRC.EXE
  67.          9.1     RLINK.EXE
  68.          9.2     BRCC.EXE
  69.          9.3     BRC.EXE
  70.  
  71.  
  72. 1        Changes to the Resource Workshop User's Guide
  73. ------------------------------------------------------
  74.  
  75. The following sections describe corrections to the Resource
  76. Workshop User's Guide or changes to existing functionality.
  77.  
  78.  
  79. 1.1      Introduction
  80. ---------------------
  81.  
  82. p. 5     The following is current information for "How to contact
  83. Borland":
  84.  
  85.     Phone/Command       Service
  86.     -------------------------------------------------------------
  87.     408-461-9133        Borland C++ Technical Support, 6 a.m. to
  88.                            5 p.m. PST
  89.     800-822-4269        TechFax, 24-hour technical information to
  90.                            fax machines (touch-tone phones only)
  91.     408-439-9096        Borland File Download BBS (2400 baud)
  92.     GO BORLAND          CompuServe
  93.     JOIN BORLAND        BIX
  94.     BORLAND             GEnie
  95.  
  96.  
  97. 1.2      Chapter 2, Resource Workshop basics
  98. --------------------------------------------
  99.  
  100. p. 17    If you have a Pascal compiler, the demo file is called
  101. RWPDEMO. If you have a C++ compiler, the demo file is RWCDEMO.
  102.  
  103. p. 25    If you have a Pascal compiler, put your identifiers in a
  104. .PAS constant file.
  105.  
  106.  
  107. 1.3      Chapter 3, Working with projects and resources
  108. -------------------------------------------------------
  109.  
  110. p. 33, step 2, last paragraph: The Resource|New and File|Add to
  111. Project commands are not available for the .CUR, .ICO, .BMP, and
  112. .FNT resource types.
  113.  
  114.  
  115. 1.4      Chapter 4, Creating dialog boxes
  116. -----------------------------------------
  117.  
  118. p. 64    Change the first bullet in the bulleted list at the
  119. bottom of the page to the following:
  120.  
  121.     - Resize the dialog box in either of the following ways:
  122.  
  123.          - Drag the appropriate edge or corner.
  124.  
  125.          - Select the dialog box by clicking the dialog box's
  126.            title bar, and then choose Align|Size to display the
  127.            Size Dialog dialog box. Enter width (CX) and height
  128.            (CY) values in dialog units.  The size values apply to
  129.            the outer dimensions of the dialog box.
  130.  
  131. p. 70    The following paragraph applies to Figure 4.6:
  132.  
  133.     If you install a custom control library containing custom
  134.     controls whose Class is recognized by Resource Workshop, the
  135.     Tools palette can have more than four columns. Bitmaps for
  136.     these custom controls are added to the right side of the
  137.     Tools palette. (See page 99 and the file CUSTCNTL.RW on the
  138.     installation disk for more information on custom controls.)
  139.  
  140. p. 82    In the section "Aligning multiple controls," the command
  141. is Align|Align, not Align|Align Controls.
  142.  
  143. p. 90    The following text accurately describes the scroll bar
  144. alignment options:
  145.  
  146. None          The scroll bar fills the entire selection frame
  147.               (default). If you resize the selection frame, you
  148.               can distort the scroll bar.
  149.  
  150. Top Left      A horizontal scroll bar displays undistorted at the
  151.               top of the selection frame and extends the full
  152.               width of the frame. A vertical scroll bar displays
  153.               undistorted at the left side of the selection frame
  154.               and extends the full height of the frame.
  155.  
  156. Bottom Right  A horizontal scroll bar displays undistorted at the
  157.               bottom of the selection frame and extends the full
  158.               width of the frame. A vertical scroll bar displays
  159.               undistorted at the right side of the selection
  160.               frame and extends the full height of the frame.
  161.  
  162. p. 100   Add the following paragraphs to the first sentence after
  163. "Adding a custom control":
  164.  
  165.     If you've added a custom control library whose Class is
  166.     recognized by Resource Workshop and which has its own custom
  167.     bitmaps, you can select your controls directly from the
  168.     custom bitmaps on the right side of the Tools palette.
  169.  
  170.     If Resource Workshop doesn't recognize the Class of your
  171.     custom controls, you must do the following to add them to
  172.     your dialog boxes:
  173.  
  174. p. 103   In step 5, just above the figure, the last sentence of
  175. the second paragraph should read:
  176.  
  177.     If you can't see it, select the Project window and then
  178.     choose View|By File.
  179.  
  180. p. 106   The description of the Draft Drawing Type option in
  181. Table 4.27 should read as follows:
  182.  
  183.     Draws each control as a rectangle with its control_ID in the
  184.     center. This option also allows you to see the exact size of
  185.     each control rectangle.
  186.  
  187. The following is the correct description of the Selection options
  188. (Table 4.28):
  189.  
  190. Select Near Border      This option applies to clicking to select
  191.                         controls.
  192.                         On: You must click on the control's
  193.                         border.
  194.                         Off: You can click anywhere inside the
  195.                         control's border.
  196.  
  197. Selection Rectangle     This option applies to dragging a
  198. Surrounds               selection frame to select controls.
  199.                         On: You must entirely surround the
  200.                         control (or controls) with the selection
  201.                         rectangle.
  202.                         Off: The selection rectangle need only
  203.                         touch the control (or controls).
  204.  
  205.  
  206. 1.5           Chapter 5, Creating menus
  207. ---------------------------------------
  208.  
  209. p. 119, Table 5.1: Use the EnableMenuItem function to change the
  210. state of Enabled, Disabled, and Grayed menu items. Use the
  211. CheckMenuItem function to change the state of Checked menu items.
  212.  
  213. p. 125   In the text below the figure, "Arrange List..." should
  214. be "A&rrange List".
  215.  
  216. p. 126, Fig. 5.9: The illustration shows the menu before the new
  217. items are inserted, not after. The figure will be corrected in
  218. the next printing of the manual.
  219.  
  220. p. 136   The C header file (WDGCONST.H) would look like this:
  221.  
  222.     #define WMNU_LST 101
  223.     #define WMNU_ADD 102
  224.     #define WMNU_ASC 103
  225.     #define WMNU_DESC 104
  226.  
  227. In addition, the #include for the C version of the file would be
  228.  
  229.     #include "wdgconst.h"
  230.  
  231. p. 137   In the last paragraph of step 4, the text should say:
  232.  
  233.     ...indicating that you can press Alt-W to display the Widgets
  234.     menu.
  235.  
  236.  
  237. 1.6      Chapter 6, Creating acclereators
  238. -----------------------------------------
  239.  
  240. p. 140   The figure shows incorrect identifiers for the first
  241. four accelerators. The correct identifiers are, in order,
  242. cm_Undo, cm_Cut, cm_Copy, and cm_Paste.
  243.  
  244.  
  245. p. 153, step 6. The correct message text is "No duplicate key
  246. values found".
  247.  
  248.  
  249. 1.7      Chapter 8, Using the Paint editor
  250. ------------------------------------------
  251.  
  252. p. 181, Table 8.1. The mouse actions for Zoom In and Zoom Out are
  253. reversed. To zoom in, double-click on the Zoom icon; to zoom out,
  254. Shift+double-click on the Zoom icon.
  255.  
  256. p. 188   The correct text for the second bullet is
  257.  
  258.     ...then choose Edit Foreground Color or Edit Background Color
  259.     from the Icon or Bitmap menu, depending on which type of
  260.     resource you're editing.
  261.  
  262. p. 189   In two places on this page, the text says "palette"
  263. where it should say "device." In the section "Editing a color,"
  264. the text in parentheses in the first paragraph should read
  265.  
  266.     (for a 16-color device, you might see a dithered color appear
  267.     in this box)
  268.  
  269. The marginal notation at the bottom of the page refers to a
  270. 256-color palette. The Granted color matches the Requested color
  271. on 256-color (or higher) devices, not palettes.
  272.  
  273. p. 190   The System button is enabled for devices that support
  274. 256 colors or more.
  275.  
  276.  
  277. 1.8      Chapter 9, Creating icons
  278. ----------------------------------
  279.  
  280. p. 202, Fig. 9.4 and surrounding text: The dialog box is called
  281. New File Resource.
  282.  
  283.  
  284. 1.9      Chapter 10, Creating cursors
  285. -------------------------------------
  286.  
  287. p. 224, Fig. 10.4 and surrounding text: The dialog box is called
  288. New File Resource.
  289.  
  290.  
  291. 1.10     Chapter 12, Creating fonts
  292. -----------------------------------
  293.  
  294. p. 243   The following paragraph should appear after Step 1 of
  295. "Creating a new font resource":
  296.  
  297.     If you create a new project, you can choose the .RC, .RES, or
  298.     .FNT format. If you choose .RES or .FNT, Resource Workshop
  299.     automatically starts the Paint editor. The Source/Binary
  300.     dialog box is not displayed.
  301.  
  302. In Step 2, the option you choose is called FONT, not .FNT. In
  303. addition, the following might further clarify the Source and
  304. Binary options:
  305.  
  306.     The Source option "embeds" the font resource in the current
  307.     project; the font does not exist as a separate file and
  308.     cannot be used in any other project. The Binary option saves
  309.     the font resource as a separate file (with the .FNT
  310.     extension) that is linked to the current project. You can
  311.     link an .FNT file to other projects using the File|Add to
  312.     Project command.
  313.  
  314. p. 244   The Paint editor tools appear on the right side of the
  315. screen. (A similar error occurs on p. 255.)
  316.  
  317. p. 246   The following might further clarify the explanation of
  318. the Stretch Current Chars option:
  319.  
  320.     When this option is checked, any changes you make to the
  321.     width or height values in this dialog box will cause the
  322.     width or height of existing characters to change accordingly.
  323.  
  324. p. 252   In Step 4 at the top of the page, the command is
  325. File|Save Project or File|Save File As. File|Save Project
  326. overwrites the current project; File|Save File As creates a new
  327. project file, allowing you to keep your old version.
  328.  
  329. In the section "Saving the project," the command is File|Save
  330. Project.
  331.  
  332. In the section "Saving a font resource as a file," the command is
  333. Resource|Save Resource As, and the dialog box is called Save
  334. Resource As. The first sentence in the section should read as
  335. follows:
  336.  
  337.     Saving the entire project saves all resources in the project,
  338.     not just the font resource you're working on.
  339.  
  340. p. 256   In Step 3, the two page references are inaccurate. In
  341. the second paragraph, the correct page reference for the maximum
  342. width value is to page 246. In the third paragraph, the correct
  343. page reference for the break character is to page 247.
  344.  
  345.  
  346. 1.11     Appendix A, Technical notes
  347. ------------------------------------
  348.  
  349. p. 266   The preprocessor incompatibility between the Microsoft
  350. Resource Compiler and the Resource Workshop compiler in handling
  351. complex parameterized #defines no longer exists.
  352.  
  353. However, the Microsoft Resource Compiler and Resource Workshop
  354. are still incompatible in several areas:
  355.  
  356. - interpretation of numbers with leading zeros
  357.  
  358. - the #undef preprocessor directive
  359.  
  360. - preprocessor token pasting
  361.  
  362. - expressions in resources IDs and resource type IDs
  363.  
  364. - hexadecimal numbers in resources IDs and resource type IDs
  365.  
  366. - complex constant expressions
  367.  
  368. - duplicate resource IDs
  369.  
  370. - resource IDs greater than 32767
  371.  
  372. - floating END statements
  373.  
  374. - floating operators in expressions
  375.  
  376. - missing operators in expressions
  377.  
  378. - parsing of the CAPTION statement
  379.  
  380. - macros in include directives
  381.  
  382. - valid characters in resource names
  383.  
  384.  
  385. 1.11.1   Numbers with leading zeros
  386. -----------------------------------
  387.  
  388. Because of inconsistencies in the Microsoft Resource Compiler's
  389. treatment of numbers with leading zeros, don't use them in
  390. preprocessor expressions or identifiers. The Resource Workshop
  391. compiler is consistent in interpreting as an octal number any
  392. numeric constant preceded by a zero that's used as part of an
  393. identifier or a preprocessor expression. However, the Microsoft
  394. Resource Compiler interprets numbers with leading zeros in
  395. preprocessor expressions as octal numbers, but interprets the
  396. same numbers in identifiers as decimal numbers.
  397.  
  398. For example, the Microsoft Resource Compiler would interpret the
  399. expression 010+1 as a 9 in the following preprocessor expression,
  400. but as an 11 in the string table identifier.
  401.  
  402.     #if (9 == 010+1)
  403.        STRINGTABLE
  404.        BEGIN
  405.            010+1, "Bug"
  406.        END
  407.     #endif
  408.  
  409.  
  410. 1.11.2   The #undef preprocessor directive
  411. ------------------------------------------
  412.  
  413. Resource Workshop has limited support for the #undef preprocessor
  414. directive. You can use it only with #defines that are not
  415. referenced by a resource. If you use #undef with a #define that's
  416. been referenced, you get a fatal compiler error when compiling
  417. the .RC file under Resource Workshop.
  418.  
  419. This restriction does not apply to the command-line resource
  420. compiler.
  421.  
  422.  
  423. 1.11.3   Token pasting
  424. ----------------------
  425.  
  426. Resource Workshop does not support token pasting in preprocessor
  427. statements. See the "Borland C++ Programmer's Guide" for more
  428. information on token pasting.
  429.  
  430.  
  431. 1.11.4   Hexadecimal numbers in
  432.          resource IDs and resource type IDs
  433. -------------------------------------------
  434.  
  435. Resource Workshop supports hexadecimal numbers in resource IDs;
  436. the Microsoft Resource Compiler does not. For example, the
  437. following statement compiles correctly using Resource Workshop,
  438. but fails using the Microsoft Resource Compiler:
  439.  
  440.     0x0001  ICON file.ico
  441.  
  442. The Microsoft Resource Compiler emits an icon resource with the
  443. name "0x0001". Resource Workshop emits an icon resource with an
  444. ID equal to 1.
  445.  
  446.  
  447. 1.11.5   Expressions in resource IDs and resource type IDs
  448. ----------------------------------------------------------
  449.  
  450. Resource Workshop supports expressions in resource IDs; the
  451. Microsoft Resource Compiler does not. For example, the following
  452. statement compiles correctly using Resource Workshop, but fails
  453. using the Microsoft Resource Compiler:
  454.  
  455.     101 + 1000 BITMAP vga.bmp
  456.  
  457. The Microsoft Resource Compiler parses "101" as a resource ID,
  458. "+" as a resource type name, "1000" as a file name, and then
  459. fails. Resource Workshop correctly emits a bitmap resource with
  460. an ID equal to 1101.
  461.  
  462.  
  463. 1.11.6   Complex constant expressions
  464. -------------------------------------
  465.  
  466. Resource Workshop supports full C-language constant expressions
  467. in place of a simple number anywhere in a resource script where a
  468. number is allowed. The Microsoft Resource Compiler supports only
  469. simple expressions. For example, the following expression is
  470. correctly evaluated by Resource Workshop, but fails using the
  471. Microsoft Resource Compiler:
  472.  
  473.     3 * (1 + 2) - 1
  474.  
  475. The most common example of this incompatibility is often seen in
  476. ICON statements in DIALOG templates. The following statement
  477. causes an error in Resource Workshop, but not in the Microsoft
  478. Resource Compiler:
  479.  
  480.     ICON   3 -1, 10, 10, 0, 0
  481.  
  482. Resource Workshop interprets "3 -1" as an expression that
  483. evaluates to 2. The Microsoft Resource compiler interprets "3 -1"
  484. as two separate fields. If you add a comma after the first
  485. number, both compilers interpret the statement correctly:
  486.  
  487.     ICON   3, -1, 10, 10, 0, 0
  488.  
  489.  
  490. 1.11.7   Duplicate resource IDs
  491. -------------------------------
  492.  
  493. To allow resources to be accessed at run time, Resource Workshop
  494. enforces the rule that resource IDs or names must be unique
  495. within each resource type; the Microsoft Resource Compiler does
  496. not. The following statements causes Resource Workshop to display
  497. an error:
  498.  
  499.     1 ICON file1.ico
  500.     1 ICON file2.ico
  501.  
  502.  
  503. 1.11.8   Resource IDs greater than 32767
  504. ----------------------------------------
  505.  
  506. Although the Microsoft documentation states that resource IDs can
  507. be any number between 1 and 65535, you must actually use resource
  508. IDs that fall between 1 and 32767 to ensure that the IDs are
  509. unique. The reason is that resource binders like RLINK or the
  510. Microsoft Resource Compiler OR all resource IDs with 0x8000 when
  511. they build the resource directory in the executable file,
  512. producing a value from 32768 to 65535.
  513.  
  514.  
  515. 1.11.9   Floating END statements
  516. --------------------------------
  517.  
  518. Resource Workshop does not allow END statements with no
  519. corresponding BEGIN. The Microsoft Resource Compiler allows these
  520. statements. For example, the following script fragment causes an
  521. error in Resource Workshop:
  522.  
  523.     1 RCDATA
  524.     BEGIN
  525.       0
  526.     END
  527.  
  528.     END
  529.  
  530.  
  531. 1.11.10  Floating operators in expressions
  532. ------------------------------------------
  533.  
  534. Resource Workshop's expression parser does not allow "floating"
  535. operators in constant expressions; the Microsoft Resource
  536. Compiler does. For example, the following expression is flagged
  537. as an error in Resource Workshop:
  538.  
  539.     WS_SYSMENU | WS_CAPTION |
  540.  
  541. To correct the error, merely remove the last bitwise OR operator:
  542.  
  543.     WS_SYSMENU | WS_CAPTION
  544.  
  545.  
  546. 1.11.11  Missing operators in expressions
  547. -----------------------------------------
  548.  
  549. Resource Workshop's expression parser requires that all operators
  550. required for an expression be present. The Microsoft Resource
  551. Compiler assumes that a missing operator is a bitwise OR
  552. operator. For example, the following expression is flagged as an
  553. error in Resource Workshop:
  554.  
  555.     WS_SYSMENU  WS_CAPTION
  556.  
  557. To correct the error, add the bitwise OR operator:
  558.  
  559.     WS_SYSMENU | WS_CAPTION
  560.  
  561.  
  562. 1.11.12  Parsing of the CAPTION statement
  563. -----------------------------------------
  564.  
  565. The Microsoft Resource Compiler is order-dependent in the way it
  566. handles the CAPTION statement in a DIALOG template; the Resource
  567. Workshop compiler is not. The following fragments illustrate this
  568. difference:
  569.  
  570.     1 DIALOG 10, 10, 100, 100
  571.     CAPTION "Caption"
  572.     BEGIN
  573.     END
  574.  
  575.     2 DIALOG 10, 10, 100, 100
  576.     STYLE WS_POPUP
  577.     CAPTION "Caption"
  578.     BEGIN
  579.     END
  580.  
  581.     3 DIALOG 10, 10, 100, 100
  582.     CAPTION "Caption"
  583.     STYLE WS_POPUP
  584.     BEGIN
  585.     END
  586.  
  587. In the first example, there is no explicit STYLE statement, and
  588. both compilers default to WS_POPUP | WS_BORDER | WS_SYSMENU,
  589. which is OR'd with WS_CAPTION. The style of the resulting DIALOG
  590. template is
  591.  
  592.     WS_POPUP | WS_BORDER | WS_SYSMENU | WS_CAPTION
  593.  
  594. In the second example, the STYLE statement precedes the CAPTION
  595. statement, and both compilers OR the two together. The style of
  596. the resulting DIALOG template is
  597.  
  598.     WS_POPUP | WS_CAPTION
  599.  
  600. In the third example, the CAPTION statement precedes the STYLE
  601. statement.
  602.  
  603. The Microsoft Resource Compiler, having encountered an explicit
  604. STYLE statement, clears any preceding implicit or preset styles.
  605. The resulting DIALOG template has the style
  606.  
  607.     WS_POPUP
  608.  
  609. By contrast, the Resource Workshop compiler ORs the CAPTION and
  610. STYLE statements to produce a DIALOG template with the style
  611.  
  612.     WS_CAPTION | WS_POPUP
  613.  
  614.  
  615. 1.11.13  Macros in include directives
  616. -------------------------------------
  617.  
  618. Resource Workshop does not support macro expansion in include
  619. directives. For example, the following fragment causes a compile
  620. error:
  621.  
  622.     #define MYFILE "afile.h"
  623.  
  624.     #include MYFILE
  625.  
  626.  
  627. 1.11.14  Support of the CTLDATA statement
  628. -----------------------------------------
  629.  
  630. Resource Workshop supports the CTLDATA statement for use with
  631. custom controls. The CTLDATA statement is described in the online
  632. file CUSTCNTL.RW. The Microsoft Resource Compiler does not
  633. support CTLDATA.
  634.  
  635.  
  636. 1.11.15  Valid characters in resource names
  637. -------------------------------------------
  638.  
  639. Resource Workshop follows standard C-language practice for valid
  640. characters in resource names. It accepts any alphanumeric
  641. characters in the ANSI character set (including accented
  642. non-English-language characters like "é"), plus the underscore.
  643. Nonalphanumeric characters like slash, backslash, or the plus
  644. sign are not valid. The resource name must start with a letter or
  645. the underscore; it cannot start with a number.
  646.  
  647. The Microsoft Resource Compiler does not restrict resource names
  648. to alphanumeric characters.
  649.  
  650.  
  651. 2        Changes for this release
  652. ---------------------------------
  653.  
  654. This section describes the changes made for this release of
  655. Resource Workshop.
  656.  
  657.  
  658. 2.1      Visible option
  659. -----------------------
  660.  
  661. The style dialog boxes for buttons, list boxes, group boxes,
  662. combo boxes, static controls, and text controls (including static
  663. text) have a check box option called Visible.
  664.  
  665. By default, this option is checked on (WS_VISIBLE), and the
  666. control appears when the dialog box is first displayed. If the
  667. option is turned off (NOT WS_VISIBLE), the control does not
  668. appear. In that case, the application can call the ShowWindow
  669. function at run time to display the hidden control.
  670.  
  671.  
  672. 2.2      Windows version compatibility
  673. --------------------------------------
  674.  
  675. You can specify the target Windows version in the
  676. File|Preferences dialog box.  Note that .RES and .EXE files
  677. targeted for Windows 3.1 are not backward-compatible with Windows
  678. 3.0.
  679.  
  680. If the .RES file is targeted to Windows 3.1, you cannot use the
  681. Windows 3.0 version of RC.EXE to bind your resources to the
  682. application. You must use Borland tools or version 3.1 of the
  683. Microsoft Resource Compiler.
  684.  
  685.  
  686. 2.3      Dialog box positioning
  687. -------------------------------
  688.  
  689. For dialog boxes that use the WS_OVERLAPPED style, Windows allows
  690. you to leave the positioning of a dialog box to Windows itself.
  691. The Size Dialog dialog box (Align|Size) has a radio button called
  692. Set by Windows, which appears in the Horizontal Size column when
  693. the selected control is a dialog box frame.
  694.  
  695. If you click Set by Windows, the X-position field is
  696. automatically blanked out. Resource Workshop puts a value of
  697. 0x8000 into the X field (although not displayed on the screen),
  698. which tells Windows that it has charge of positioning the dialog
  699. box.
  700.  
  701. This option is generally used for dialog box frames that are used
  702. as main windows.
  703.  
  704.  
  705. 3        New features in Windows 3.1
  706. ------------------------------------
  707.  
  708. The following sections describe changes to Resource Workshop that
  709. reflect new features in Windows 3.1.
  710.  
  711.  
  712. 3.1      Style dialog boxes
  713. ---------------------------
  714.  
  715. The following check box options implemented in Windows 3.1 have
  716. been added to three of the style dialog boxes.
  717.  
  718. List Box Style
  719.  
  720.     Scroll bar always   The list box always displays a vertical
  721.                         scroll bar, regardless of the number of
  722.                         items it contains. The WINDOWS.H constant
  723.                         for this style is LBS_DISABLENOSCROL.
  724.  
  725. Combo Box Style
  726.  
  727.     Vertical scroll     The combo box always displays a vertical
  728.     always              scroll bar, regardless of the number of
  729.                         items it contains. The WINDOWS.H constant
  730.                         for this style is CBS_DISABLENOSCROL.
  731.  
  732. Edit Text Style
  733.  
  734.     Read only           The text is set to read-only. The
  735.                         WINDOWS.H constant for this style is
  736.                         ES_READONLY.
  737.  
  738.     Want return         A multiline edit text control accepts a
  739.                         carriage return to force a line break.
  740.                         The carriage return goes to the
  741.                         Defpushbutton if keyboard focus is NOT in
  742.                         the edit text control. The WINDOWS.H
  743.                         constant for this style is ES_WANTRETURN.
  744.  
  745.  
  746. 3.2      Icon sizes
  747. -------------------
  748.  
  749. Windows 3.1 supports icons in three sizes: 32x32 and 32x16 (also
  750. supported in Windows 3.0), plus 64x64.  The New Icon Image dialog
  751. box, illustrated in Figures 3.14 and 9.5 in the Resource Workshop
  752. User's Guide, now includes the new 64x64 option.  In reading
  753. Chapter 9, "Creating Icons," keep in mind that this new image
  754. size is now supported.
  755.  
  756.  
  757. 3.3      Version stamper
  758. ------------------------
  759.  
  760. Resource Workshop now supports VERSIONINFO, the version stamper
  761. for Windows 3.1 .EXE files. For a detailed description of
  762. VERSIONINFO, see the Resource Workshop online Help file.
  763.  
  764.  
  765. 4        Linker requirements
  766. ----------------------------
  767.  
  768. The following sections describe some special requirements for
  769. linking. See also section 9 for a description of Resource
  770. Workshop's command-line linker and compilers.
  771.  
  772.  
  773. 4.1      BWCC.LIB
  774. -----------------
  775.  
  776. You must link your program first with the import library BWCC.LIB
  777. and then with IMPORT.LIB, both of which are contained in the LIB
  778. subdirectory specified by the Install program. The order in which
  779. you use these two library files is critical: BWCC.LIB must
  780. precede IMPORT.LIB.
  781.  
  782.  
  783. 4.2      BWCC.DLL
  784. -----------------
  785.  
  786. Make the dynamic link library BWCC.DLL available for your
  787. application to use at run time by locating it in one of the
  788. following places:
  789.  
  790. - the same directory as your application's .EXE file
  791.  
  792. - the Windows startup or system directory
  793.  
  794. - a directory in your PATH
  795.  
  796.  
  797. 4.3      BWCC and Object Windows Library (OWL)
  798. ----------------------------------------------
  799.  
  800. If you use the DLL version of OWL, you must load BWCC.DLL
  801. explicitly.  To do so, insert the following code into WinMain
  802. before the code that invokes the Application Run method:
  803.  
  804.     HANDLE hDLL:
  805.       hDLL = LoadLibrary ("BWCC.DLL");
  806.  
  807. At the end of WinMain, insert this line of code:
  808.  
  809.     if (hDLL) FreeLibrary ("BWCC.DLL");
  810.  
  811.  
  812. 5        Borland Windows Custom Controls
  813. ----------------------------------------
  814.  
  815. The Borland Windows Custom Controls (BWCC) library contains a
  816. custom dialog class and a set of custom controls (buttons, check
  817. boxes, group shading boxes, and the like). BWCC adds to the
  818. visual impact of your dialog boxes and optimize their
  819. functionality.
  820.  
  821.  
  822. 5.1      Using the custom dialog class
  823. --------------------------------------
  824.  
  825. The custom dialog class, BORDLG, works on both a visual and a
  826. functional level.
  827.  
  828. - It improves the appearance of your dialog window by painting
  829.   the background with a brush that varies according to the target
  830.   display device. For screens of VGA and higher resolution, the
  831.   background is a fine grid of perpendicular white lines, giving
  832.   the effect of "chiseled steel." For EGA and monochrome screens,
  833.   the background is white.
  834.  
  835. - It optimizes the drawing of dialog boxes by calling the custom
  836.   control drawing routines directly, instead of waiting for
  837.   Windows to paint the controls. This eliminates the typical
  838.   sluggish drawing of dialog boxes.
  839.  
  840. To use the custom dialog class, enter "bordlg" as the Class in
  841. the Window Style dialog box.
  842.  
  843.  
  844. 5.2      Using the custom controls
  845. ----------------------------------
  846.  
  847. The custom controls give the dialog box visual impact, with
  848. several of them adding a three-dimensional effect. To the
  849. end-user, they function in the same manner as the standard
  850. Windows controls, although they include several technical
  851. enhancements (described later).
  852.  
  853. The following is a brief description of the custom controls.
  854. Detailed descriptions are given later in this file.
  855.  
  856. Group shade        A recessed, shaded rectangular box used to
  857.                    group other controls. It differs from the
  858.                    standard group box by giving an impression of
  859.                    depth.
  860.  
  861. Borland            A family of push buttons with several highly
  862. push button        visual bitmapped symbols, plus an owner-draw
  863.                    option. The BWCC push buttons are larger than
  864.                    most standard Windows push buttons.
  865.  
  866. Borland            A raised diamond-shaped radio button. When the
  867. radio button       button is clicked, a black diamond appears in
  868.                    its center, and the button shading reverses,
  869.                    giving the impression that the button has been
  870.                    pushed down. There is also an owner-draw
  871.                    option.
  872.  
  873. Borland            A raised check box that displays a check mark
  874. check box          instead of an "X." There is also an owner-draw
  875.                    option.
  876.  
  877. Bitmap             A bitmap that can display a splash panel, or a
  878.                    non-modifiable image that remains on the
  879.                    dialog box.
  880.  
  881. Horizontal/        Horizontal and vertical dividing lines that
  882. Vertical dip       give the impression of being etched into the
  883.                    surface of the dialog box. You can convert the
  884.                    dips to horizontal and vertical bumps, which
  885.                    appear to be raised above the surface of the
  886.                    dialog box.
  887.  
  888.  
  889. 5.2.1    Button and check box messages
  890. --------------------------------------
  891.  
  892. The BWCC push buttons, radio buttons, and check boxes have the
  893. following functional enhancements over the standard Windows
  894. controls:
  895.  
  896. - They include an additional level of parent window notification
  897.   and control over keyboard focus and tab movement. If you choose
  898.   the Parent Notify option in the control's style dialog box, the
  899.   control sends the following messages (as appropriate) at run
  900.   time:
  901.  
  902.   BBN_SETFOCUS          Indicates to the parent window that the
  903.                         push button, radio button, or check box
  904.                         has gained keyboard focus through an
  905.                         action other than a mouse click.
  906.  
  907.   BBN_SETFOCUSMOUSE     Indicates to the parent window that the
  908.                         push button, radio button, or check box
  909.                         has gained keyboard focus through a mouse
  910.                         click.
  911.  
  912.   BBN_GOTATAB           Indicates to the parent window that the
  913.                         user has pressed the Tab key while the
  914.                         push button, radio button, or check box
  915.                         has keyboard focus. The parent can
  916.                         intervene in the processing of the
  917.                         keystroke by returning a nonzero value.
  918.  
  919.   BBN_GOTABTAB          Indicates to the parent window that the
  920.                         user has pressed Shift-Tab (back-tab)
  921.                         while the push button, radio button, or
  922.                         check box has keyboard focus. The parent
  923.                         can intervene in the processing of the
  924.                         keystroke by returning a nonzero value.
  925.  
  926. - They include an owner-draw option so that the parent window can
  927.   draw the push button, radio button, or check box. The
  928.   owner-drawn control will look different from standard Windows
  929.   controls, but will have the standard behavior of that class of
  930.   control.
  931.  
  932.  
  933. 5.2.2    Using the BWCC style dialog boxes
  934. ------------------------------------------
  935.  
  936. There are four style dialog boxes for the BWCC controls:
  937.  
  938. - Borland Button Style
  939.  
  940. - Borland Radio Button Style
  941.  
  942. - Borland Check Box Style
  943.  
  944. - Borland Shade Style
  945.  
  946. Each has a control window for entering a Caption and a Control
  947. ID.  The button style and check box style dialog boxes have
  948. Attributes options for Tab Stop, Disabled, Group, and Border
  949. (described in the Resource Workshop User's Guide), as well as
  950. Visible, Parent Notify, and Owner Draw (described earlier in this
  951. file). The shade style dialog box's only Attribute option is
  952. Group.
  953.  
  954. The next four sections describe the features unique to each of
  955. the style dialog boxes.
  956.  
  957.  
  958. 5.2.2.1  Borland Button Style dialog box
  959. ----------------------------------------
  960.  
  961. This dialog box allows you to choose from the three button types:
  962. Pushbutton, Defpushbutton, and Bitmap.
  963.  
  964. By default, Pushbutton is the selected option. A Defpushbutton
  965. has a bold border to identify it to the end-user as the "default
  966. button," which is executed when the user presses the Enter key.
  967. (The one exception occurs when keyboard focus is in an Edit Text
  968. control for which the Want Return flag has been set. See Section
  969. 3.1 of this file.)
  970.  
  971. The following Control ID values and images are predefined for the
  972. BWCC button controls:
  973.  
  974.    ID  button      image
  975.   ---  ------      -----------------
  976.     1  OK          green check mark
  977.     2  Cancel      red X
  978.     3  Abort       panic button
  979.     4  Retry       slot machine
  980.     5  Ignore      55 mph speed-limit sign
  981.     6  Yes         green check mark
  982.     7  No          red circle-slash
  983.   998  Help        blue question mark
  984.     -  Button      generic "Button" text - uses next available
  985.                    Control ID
  986.  
  987. If you choose the Bitmap option, you can insert an image (based
  988. on its Control ID) into the button image. To read in a bitmap:
  989.  
  990. 1.  Use the Button control to add the generic BWCC button to your
  991.     dialog box. Note its Control ID.
  992.  
  993. 2.  Switch to the Paint editor and create a bitmap image. (See
  994.     page 234 for information about creating bitmaps.)
  995.  
  996. 3.  In the Paint editor, choose Resource|Rename.
  997.  
  998.     If you have a screen of VGA resolution or higher, add 1000 to
  999.     the Control ID, and enter this value into the New Name field.
  1000.     For EGA or monochrome screens, add 2000 to the Control ID,
  1001.     and enter this value into the New Name field. Choose OK.
  1002.  
  1003. 6.  Close the Paint editor and return to the Dialog editor. The
  1004.     bitmap will then appear in the BWCC button.
  1005.  
  1006.  
  1007. 5.2.2.2  Borland Radio Button Style dialog box
  1008. ----------------------------------------------
  1009.  
  1010. This dialog box lists two button styles:
  1011.  
  1012. Auto radio button  BWCC and Windows combine to handle
  1013.                    highlighting the selected button and
  1014.                    deselecting the other buttons. This is the
  1015.                    default option.
  1016.  
  1017. Radio button       The application must call the CheckDlgButton
  1018.                    function to send a BM_SETCHECK message to
  1019.                    highlight the selected button and deselect the
  1020.                    other buttons.
  1021.  
  1022.  
  1023. 5.2.2.3  Borland Check Box Style dialog box
  1024. -------------------------------------------
  1025.  
  1026. This dialog box lists two check box styles:
  1027.  
  1028. Auto check box     BWCC and Windows combine to handle checking
  1029.                    the selected box. This is the default option.
  1030.  
  1031. Check box          The application must call the CheckRadioButton
  1032.                    function to send a BM_SETCHECK message to
  1033.                    check the selected box.
  1034.  
  1035.  
  1036. 5.2.2.4  Borland Shade Style dialog box
  1037. ---------------------------------------
  1038.  
  1039. You can use this dialog box to convert a vertical or horizontal
  1040. dip (described in section 5.2 of this file) to a vertical or
  1041. horizontal bump. Dips are primarily intended to act as separators
  1042. in the dialog box background; bumps are intended as separators in
  1043. gray shade boxes.
  1044.  
  1045. To convert a vertical dip to a vertical bump,
  1046.  
  1047. 1.  Use the Vertical Dip control to add the dip to your dialog
  1048.     box.
  1049.  
  1050. 2.  Locate and size the dip as you want it.
  1051.  
  1052. 3.  Double-click on the dip to display the Borland Shade Style
  1053.     dialog box.
  1054.  
  1055. 4.  Click the Vertical Bump radio button and then click OK.
  1056.  
  1057. To convert a horizontal dip to a horizontal bump, follow the same
  1058. series of steps using the Horizontal Dip tool and the Horizontal
  1059. Bump radio button.
  1060.  
  1061.  
  1062. 5.3      Customizing existing applications for BWCC
  1063. ---------------------------------------------------
  1064.  
  1065. Resource Workshop allows you to customize existing Windows
  1066. applications with Borland-style custom controls (3D buttons,
  1067. dialog boxes with the "chiseled steel" look, and so on). There
  1068. are two steps to this process:
  1069.  
  1070. 1.  Modify your WIN.INI file to load the Borland Windows Custom
  1071.     Control (BWCC) library each time you start Windows.
  1072.  
  1073. 2.  Edit the application in Resource Workshop to change user
  1074.     interface features like dialog boxes, menus, icons, and so
  1075.     on.
  1076.  
  1077. The next two sections describe these steps in greater detail.
  1078.  
  1079.  
  1080. 6        Loading BWCC to enable Borland custom controls
  1081. -------------------------------------------------------
  1082.  
  1083. The BWCC library, which provides support for Borland-style custom
  1084. controls, must be loaded before an application can use BWCC's
  1085. features.
  1086.  
  1087. Edit the WIN.INI file (located in the Windows main directory) so
  1088. that Windows loads the file LOADBWCC.EXE into memory at start up.
  1089. The installation program places LOADBWCC.EXE in the language
  1090. compiler directory (the default location is \BORLANDC\BIN) and
  1091. adds this directory to your PATH.
  1092.  
  1093. Add LOADBWCC.EXE to the beginning of the list of files that
  1094. appear after the "LOAD=" statement. For example, if the LOAD
  1095. statement in your WIN.INI file looks like this:
  1096.  
  1097.     LOAD=NWPOPUP.EXE
  1098.  
  1099. the statement must be changed to this:
  1100.  
  1101.     LOAD=loadbwcc.exe NWPOPUP.EXE
  1102.  
  1103. LOADBWCC.EXE must appear first in the statement, to ensure that
  1104. BWCC is loaded into memory before any modified applications are
  1105. executed.
  1106.  
  1107. If you edit WIN.INI from within Windows, you must exit and
  1108. restart Windows to actually load LOADBWCC.EXE.
  1109.  
  1110.  
  1111. 7        Sample exercise: Customizing an existing application
  1112. -------------------------------------------------------------
  1113.  
  1114. This section gives an overview of the steps typically involved in
  1115. modifying an existing application--in this case, the Windows
  1116. Program Manager.
  1117.  
  1118. Resource Workshop operates on projects, which are made up of one
  1119. or more resources. Because a Windows application contains a
  1120. collection of resources, you can open the application itself as a
  1121. project and then modify its resources.
  1122.  
  1123.  
  1124. 7.1      Backing up the application
  1125. -----------------------------------
  1126.  
  1127. You should always edit backup copies of an application. Only
  1128. replace the original when you're satisfied that the modified
  1129. version functions correctly.
  1130.  
  1131. To make a backup copy of PROGMAN.EXE (Program Manager),
  1132.  
  1133. 1.  In the Program Manager's Main window, double-click the DOS
  1134.     Prompt icon.
  1135.  
  1136. 2.  At the DOS command line, switch to the C:\WINDOWS directory.
  1137.  
  1138. 3.  Type "copy PROGMAN.EXE MYSHELL.EXE" and press the Enter key.
  1139.  
  1140. 4.  Return to Windows by typing "exit" and pressing the Enter
  1141.     key.
  1142.  
  1143.  
  1144. 7.2      Opening a project
  1145. --------------------------
  1146.  
  1147. To open the Program Manager as a project in Resource Workshop,
  1148.  
  1149. 1.  Choose File|Open Project to display the Open Project dialog
  1150.     box.
  1151.  
  1152. 2.  Display the list of types by pressing the button for the File
  1153.     Type drop-down list box. Select EXE Application from the
  1154.     list.
  1155.  
  1156. 3.  Use the Directories box to change to the directory containing
  1157.     MYSHELL.EXE.
  1158.  
  1159. 4.  Double-click on the file name in the Files list box to load
  1160.     MYSHELL.EXE as the project.
  1161.  
  1162.  
  1163. 7.3      Editing the application's controls
  1164. -------------------------------------------
  1165.  
  1166. Now that you've loaded the application into Resource Workshop,
  1167. you can use the Dialog editor, Menu editor, Accelerator editor,
  1168. String editor, or Paint editor to customize the application. The
  1169. editors are discussed in the Resource Workshop User's Guide.
  1170.  
  1171. In this exercise, you'll use the Dialog editor to convert one of
  1172. the dialog boxes in the Program Manager to use BWCC.
  1173.  
  1174. NOTE: When it appears in the body of a paragraph, text that you
  1175. enter from the keyboard is set off by quotation marks. Unless you
  1176. are explicitly told to do so, do NOT include the quotation marks
  1177. in the text you enter.
  1178.  
  1179.  
  1180. 7.3.1    Starting the Dialog editor
  1181. -----------------------------------
  1182.  
  1183. With MYSHELL.EXE loaded as the current project, you see the
  1184. Project window appear with "myshell.exe" as the title. This
  1185. window displays a list of the resources contained in the Program
  1186. Manager: a menu, several dialogs, a few string tables, an
  1187. accelerator table, and a number of icons. You can edit any one of
  1188. these resources by double-clicking it or by highlighting it and
  1189. choosing Resource|Edit.
  1190.  
  1191. Select dialog number 3 by locating the "Dialog" section of the
  1192. resource list and double-clicking "3". The dialog editor loads
  1193. the New Program Object dialog box (displayed when the user
  1194. chooses the Program Manager's File|New command).
  1195.  
  1196. When the Dialog editor appears, you can begin editing the dialog
  1197. box. The tasks you'll perform in this exercise include
  1198.  
  1199. - Changing the dialog box's class to the Borland style
  1200.  
  1201. - Changing the size of the dialog box
  1202.  
  1203. - Recessing and aligning the controls
  1204.  
  1205. - Changing the radio buttons to BWCC
  1206.  
  1207. - Replacing the buttons with BWCC buttons
  1208.  
  1209. - Aligning the buttons
  1210.  
  1211. - Saving and testing the edited dialog box
  1212.  
  1213.  
  1214. 7.3.2    Changing the dialog's class name
  1215. -----------------------------------------
  1216.  
  1217. To convert the New Program Object dialog box to a Borland-style
  1218. dialog box, you must first change its class name.
  1219.  
  1220. 1.  Double-click on the New Program Object dialog box's title bar
  1221.     to display the Window Style dialog box.
  1222.  
  1223. 2.  Press the Tab key to move the cursor to the Class text
  1224.     control.
  1225.  
  1226. 3.  Enter the following as the Class:
  1227.  
  1228.        BorDlg
  1229.  
  1230.     Click OK to exit the dialog box.
  1231.  
  1232. The New Program Object dialog box now has the BWCC
  1233. "chiseled-steel" background.
  1234.  
  1235.  
  1236. 7.3.3    Sizing and rearranging the dialog box
  1237. ----------------------------------------------
  1238.  
  1239. Now change the size and layout of the dialog box to make room for
  1240. the "group shade" and the BWCC buttons. (The group shade is a
  1241. recessed area you place behind the two radio buttons to give the
  1242. dialog box the appearance of depth.)
  1243.  
  1244. 1.  Select the dialog box by clicking on its title bar or edge.
  1245.     (If the dialog box is already selected, skip this step.)
  1246.  
  1247. 2.  Drag the bottom border down about two inches.
  1248.  
  1249. 3.  Deselect the dialog box frame by clicking anywhere in the
  1250.     empty Dialog editor workspace outside the dialog box itself.
  1251.     (Use this same technique whenever you are instructed to
  1252.     deselect something.)
  1253.  
  1254. 4.  Shift-click on each of the dialog box's buttons (OK, Cancel,
  1255.     and Help) to select them. Delete them by pressing the Del
  1256.     key. (The BWCC buttons are larger than standard Windows
  1257.     buttons. You will replace the buttons in a later set of
  1258.     steps.)
  1259.  
  1260. 5.  Select the "New" group and press the Del key to delete it.
  1261.     You will replace it shortly.
  1262.  
  1263. The gray background of the two radio buttons extends well past
  1264. the text strings. Make the background smaller by doing this:
  1265.  
  1266. 1.  Select the "Program Group" radio button.
  1267.  
  1268. 2.  Drag the right edge of its selection frame to the left, until
  1269.     it's close to the text.
  1270.  
  1271. 3.  Shift-click to select the other radio button. Both should now
  1272.     be selected.
  1273.  
  1274. 4.  Choose Align|Size, and choose the Horizontal Size|Shrink to
  1275.     Smallest option from the Size Controls dialog box.
  1276.  
  1277. 5.  With both radio buttons still selected (and their gray
  1278.     backgrounds now the same size), click the Horizontal Center
  1279.     in Dialog tool (third from the left in the top row of
  1280.     alignment tools).
  1281.  
  1282. 6.  To make room for the new "New" text string, press the
  1283.     down-arrow key several times to move the radio buttons down
  1284.     in the dialog box. Press the Enter key when the radio buttons
  1285.     are where you want them.
  1286.  
  1287.  
  1288. 7.3.4    Adding the group shade
  1289. -------------------------------
  1290.  
  1291. To make the controls appear recessed, add the group shade.
  1292.  
  1293. 1.  Click the group shade tool (in the upper right corner of the
  1294.     Tools palette).
  1295.  
  1296. 2.  Move the crosshair cursor above and to the left of the radio
  1297.     buttons. Don't start so far above the radio buttons that
  1298.     there won't be room for the "New" text string. Click to place
  1299.     the group shade box.
  1300.  
  1301. 3.  Drag the lower right corner of the group shade box until it
  1302.     surrounds the radio buttons. Make it large enough that the
  1303.     radio buttons don't appear crowded inside.
  1304.  
  1305. 4.  Click the Horizontal Center in Dialog tool (third from the
  1306.     left in the top row of the Alignment tools) to center the
  1307.     group shade in the dialog box.
  1308.  
  1309.  
  1310. 7.3.5    Adding the text string
  1311. -------------------------------
  1312.  
  1313. To add the "New" text string above the group shade box,
  1314.  
  1315. 1.  Click the Text Static Tool (the large letter T in the third
  1316.     column from the left of the Tools Palette).
  1317.  
  1318. 2.  Move the crosshair to a point directly above the upper left
  1319.     corner of the group shade box. Click to place the static
  1320.     text.
  1321.  
  1322. 3.  Drag the right edge of the static text frame to the right
  1323.     until it is not quite as wide as the group shade box.
  1324.  
  1325. 4.  Double-click on the static text to display the Static Style
  1326.     dialog box.
  1327.  
  1328. 5.  Type " New" (with one leading blank space) as the Caption,
  1329.     and click OK to close the dialog box.
  1330.  
  1331. 6.  With the static text still selected, Shift-click to select
  1332.     the group shade box too.
  1333.  
  1334. 7.  Choose Align|Size and then Grow to Largest from the Size
  1335.     Controls dialog box.
  1336.  
  1337. 8.  Deselect everything by clicking in the empty work area
  1338.     outside the dialog box frame. Note how the static text
  1339.     appears to be slightly longer than the group shade because of
  1340.     the white edge on the right side of the group shade.
  1341.  
  1342. 9.  Click to select the static text.
  1343.  
  1344. 10. Drag its right edge one grid increment to the right. (You'll
  1345.     see the selection frame "snap" to the new position.)
  1346.  
  1347. 11. At this time, you can also drag the static text down closer
  1348.     to the group shade, if necessary, to leave just a single dark
  1349.     line between the static text and the group shade.
  1350.  
  1351.     Deselect the static text if you need to check its position.
  1352.  
  1353.  
  1354. 7.3.6    Converting the radio buttons
  1355. -------------------------------------
  1356.  
  1357. To convert the "Program Group" radio button to BWCC,
  1358.  
  1359. 1.  Hold down the Ctrl key as you double-click the radio button.
  1360.     The Generic Control Style dialog box is displayed.
  1361.  
  1362. 2.  Change the Class from "BUTTON" to "BorRadio" and then click
  1363.     OK. The quotes are required, but the text is not case
  1364.     sensitive.
  1365.  
  1366. Repeat these steps for the "Program Item" radio button.
  1367.  
  1368.  
  1369. 7.3.7    Adding a horizontal dip
  1370. --------------------------------
  1371.  
  1372. Borland dialog boxes use a horizontal dip (see section 5.2 of
  1373. this file) to separate the exit buttons (OK, Cancel, and others)
  1374. from the rest of the controls.  To add a horizontal dip
  1375.  
  1376. 1.  Click the Horizontal Dip tool (second from the top in the
  1377.     BWCC column in the Tools palette).
  1378.  
  1379. 2.  Click the crosshair at the left edge of the dialog box frame,
  1380.     about a quarter of an inch below the group shade box. Note
  1381.     that the horizontal dip does not extend the full width of the
  1382.     dialog box.
  1383.  
  1384. 3.  Choose Align|Size and then choose the Horizontal Size|Width
  1385.     of Dialog option.
  1386.  
  1387.  
  1388. 7.3.8    Replacing the buttons
  1389. ------------------------------
  1390.  
  1391. To replace the dialog box's buttons with BWCC buttons,
  1392.  
  1393. 1.  Select the BWCC Button tool (in the middle of the fourth
  1394.     column of the Tools palette).
  1395.  
  1396. 2.  Locate the crosshair at the point where you want the upper
  1397.     left corner of the first button (the OK button), and click.
  1398.     At this point, all the new buttons will simply say "Button".
  1399.  
  1400.     If the dialog box is not large enough for the new buttons,
  1401.     drag the bottom border to make more room.
  1402.  
  1403. 3.  Move the mouse to the right, locate the pointer arrow at the
  1404.     point where you want the upper left corner of the second
  1405.     button (Cancel), and click the RIGHT mouse button. By doing
  1406.     so, you duplicate the most recently added control (in this
  1407.     case, the first button).
  1408.  
  1409. 4.  Repeat step 3 to place the third button (Help). When you are
  1410.     done, you should have a horizontal row of three buttons.
  1411.     Don't worry about how neat the row is.
  1412.  
  1413. To convert the first button to a BWCC OK button with the green
  1414. check mark,
  1415.  
  1416. 1.  Double-click on the left button to display the Borland Button
  1417.     Style dialog box.
  1418.  
  1419. 2.  Type the following (in all uppercase letters) as the Control
  1420.     ID:
  1421.  
  1422.        IDOK
  1423.  
  1424.     You can also enter 1 as the Control ID.
  1425.  
  1426. 3.  Select Defpushbutton as the Button Type to make OK the
  1427.     default push button.
  1428.  
  1429. 4.  Click the Group check box in the Attributes. (The button
  1430.     should now be set to both Tab Stop and Group.)
  1431.  
  1432. 5.  Click OK to change the button to the Borland-style OK button.
  1433.  
  1434. To convert the second button to a BWCC Cancel button with the red
  1435. X,
  1436.  
  1437. 1.  Double-click on the second button to display the Borland
  1438.     Button Style dialog box.
  1439.  
  1440.     Type the following (in all uppercase letters) as the Control
  1441.     ID:
  1442.  
  1443.        IDCANCEL
  1444.  
  1445.     You can also enter 2 as the Control ID.
  1446.  
  1447. 2.  Click the Group check box in the Attributes. (The button
  1448.     should now be set to both Tab Stop and Group.)
  1449.  
  1450. 3.  Click OK to change the button to the Borland-style Cancel
  1451.     button.
  1452.  
  1453. To modify the last button for Help,
  1454.  
  1455. 1.  Double-click on the last button to display the Borland Button
  1456.     Style dialog box.
  1457.  
  1458.     Type the following as the Caption:
  1459.  
  1460.        &Help
  1461.  
  1462.     (The ampersand puts an underscore under the "H," so the user
  1463.     can get Help by pressing the Alt-H key combination.)
  1464.  
  1465. 2.  Tab to Control ID and enter "126". (This was the button's
  1466.     original control ID and is required for the user to be able
  1467.     to access Help successfully.)
  1468.  
  1469. 3.  Click the Group check box in the Attributes. (The button
  1470.     should now be set to both Tab Stop and Group.)
  1471.  
  1472. 4.  Click OK to exit the dialog box.
  1473.  
  1474. To align the buttons relative to each other and to center them in
  1475. the dialog box, first select them by dragging a selection frame.
  1476. Make sure nothing else is selected. Then use the Align menu
  1477. commands or the Alignment tools.
  1478.  
  1479. To use the Align menu commands,
  1480.  
  1481. 1.  Choose Align|Align to display the Align Controls dialog box.
  1482.     Choose the Vertical Alignment|Centers option and click OK.
  1483.     This command aligns the buttons in a single row.
  1484.  
  1485. 2.  Choose Align|Array to display the Form Control Into an Array
  1486.     dialog box. Set Rows to 1, Columns to 3, and Order to "Left
  1487.     to right." Click OK. This command spaces the buttons evenly
  1488.     relative to each other.
  1489.  
  1490. 3.  If there is too much space at the bottom of the dialog box,
  1491.     now is the time to drag the buttons up nearer to the gray
  1492.     shade and to drag the bottom edge of the dialog box up.
  1493.  
  1494. 4.  Choose Align|Align again. Choose the Horizontal
  1495.     Alignment|Center In Dialog option and click OK. This command
  1496.     centers the buttons horizontally in the dialog box.
  1497.  
  1498. To use the Alignment tools,
  1499.  
  1500. 1.  Click the Vertical Alignment|Centers tool, the vertical
  1501.     double-headed arrow without line segments (second from the
  1502.     left, bottom row). This tool aligns the buttons in a single
  1503.     row.
  1504.  
  1505. 2.  Click the Duplicate tool (in the left column of the Tools
  1506.     palette, second from the bottom). In the Form Control Into an
  1507.     Array dialog box, set Rows to 1, Columns to 3, and Order to
  1508.     "Left to right." Click OK. This tool spaces the buttons
  1509.     evenly relative to each other.
  1510.  
  1511. 3.  If there is too much space at the bottom of the dialog box,
  1512.     now is the time to drag the buttons up nearer to the gray
  1513.     shade and to drag the bottom edge of the dialog box up.
  1514.  
  1515. 4.  Click the Horizontal Alignment|Center in Dialog tool, the
  1516.     horizontal double-headed arrow with line segments at each end
  1517.     (third from the left, top row). This tool centers the buttons
  1518.     horizontally in the dialog box.
  1519.  
  1520.  
  1521. 7.4      Saving and testing the project
  1522. ---------------------------------------
  1523.  
  1524. You have now completed your modifications to the Program
  1525. Manager's New Program Object dialog box. To save your work,
  1526. choose File|Save Project.
  1527.  
  1528. To test the modified dialog box in Resource Workshop, choose
  1529. Options|Test Dialog or click the Test tool.
  1530.  
  1531. You can also run MYSHELL.EXE from Windows to see how the new
  1532. dialog box looks under the Program Manager. Choose File|Run, and
  1533. set the command line to "C:\WINDOWS\MYSHELL.EXE" (or give the
  1534. path to your Windows directory, if it is not on drive C). In this
  1535. case, you are actually running a second "copy" of the Program
  1536. Manager. When you are finished, choose File|Exit Windows to
  1537. return to your initial "copy" of the Program Manager.
  1538.  
  1539.  
  1540. 8        Tips on editing resources
  1541. ----------------------------------
  1542.  
  1543. This section discusses considerations to keep in mind when
  1544. editing resources of existing applications.
  1545.  
  1546.  
  1547. 8.1      Accelerators
  1548. ---------------------
  1549.  
  1550. If you add an accelerator, make sure it returns the same ID value
  1551. as its corresponding menu command. If you don't, the accelerator
  1552. will either execute the wrong command or do nothing.
  1553.  
  1554.  
  1555. 8.2      Bitmaps
  1556. ----------------
  1557.  
  1558. You may modify existing bitmaps in an application, but you may
  1559. not delete them.
  1560.  
  1561. Do not add new bitmaps. In most cases, the application will not
  1562. be able to use them.
  1563.  
  1564.  
  1565. 8.3      Cursors
  1566. ----------------
  1567.  
  1568. You may modify existing cursors in an application, but you may
  1569. not delete them.
  1570.  
  1571. Do not add new cursors. In most cases, the application will not
  1572. be able to use them.
  1573.  
  1574.  
  1575. 8.4      Dialog boxes
  1576. ---------------------
  1577.  
  1578. You can reposition items in a dialog box and convert controls to
  1579. their Borland custom control counterparts.
  1580.  
  1581. As you edit, be sure not to change the type of control associated
  1582. with each control ID value. For example, if control ID 100 is a
  1583. check box, don't change it to a radio button. The application
  1584. will still treat it as a check box.
  1585.  
  1586. In most cases you can remove controls that are not directly tied
  1587. to the application's functionality. For example, you can usually
  1588. remove a caption, a static text item that has no effect on how
  1589. the application works; but you can't remove an edit control,
  1590. which does affect how the application works.
  1591.  
  1592. Never add new controls. The application will not be able to use
  1593. them.
  1594.  
  1595.  
  1596. 8.5      Icons
  1597. --------------
  1598.  
  1599. You may modify existing icons in an application, but you may not
  1600. delete them.
  1601.  
  1602. Do not add new icons. In most cases, the application will not be
  1603. able to use them.
  1604.  
  1605.  
  1606. 8.6      Menus
  1607. --------------
  1608.  
  1609. With most applications, you can safely move commands within a
  1610. menu. Don't, however, move commands from one menu to another.
  1611. (For example, don't move the Open command from the File menu to
  1612. the Edit menu.) If you do, the application might be unable to
  1613. display context-sensitive Help or to check or uncheck the menu
  1614. commands.
  1615.  
  1616. Never change the order of the menus in the menu bar. For example,
  1617. if File is the first menu, don't make it the second.
  1618.  
  1619.  
  1620. 8.7      String tables
  1621. ----------------------
  1622.  
  1623. Use caution when editing existing string tables. Some programs
  1624. load the strings into buffers of fixed size, and adding text to
  1625. an existing string could overflow the buffer.
  1626.  
  1627. Never add new strings. The application will not be able to use
  1628. them.
  1629.  
  1630.  
  1631. 9        Command-line tools: RLINK.EXE, BRCC.EXE, and BRC.EXE
  1632. -------------------------------------------------------------
  1633.  
  1634. This release of Resource Workshop includes three new
  1635. resource-related command-line tools: RLINK.EXE, BRCC.EXE, and
  1636. BRC.EXE.
  1637.  
  1638.  
  1639. 9.1      RLINK.EXE
  1640. ------------------
  1641.  
  1642. RLINK is a true Windows resource linker. It accepts as input one
  1643. or more object files (.RES) and a single Windows executable file.
  1644. It links the resources by fixing up string tables, icons and
  1645. cursors, and name tables and then binds these linked resources to
  1646. the executable. Finally, it attempts to make your application run
  1647. faster by building a preload section for the Windows loader.
  1648.  
  1649. RLINK uses the following command-line syntax:
  1650.  
  1651.     rlink [switches] <filename>.RES  <filename>.EXE
  1652.  
  1653. RLINK accepts these switches:
  1654.  
  1655. @<filename>   Takes instructions from the specified command file.
  1656. -d            Removes resources from the .EXE file (no .RES file
  1657.               is specified).
  1658. -e            Moves the default DLL location into EMS memory.
  1659. -fe<filename> Renames the output .EXE file.
  1660. -fi<filename> Specifies additional input .RES files.
  1661. -k            Disables the contiguous preload of segments and
  1662.               resources in the .EXE file. Segments are kept in
  1663.               the order in which they appear in the .DEF file.
  1664. -l            Compiles an application that uses LIM 3.2 EMS.
  1665. -m            When Windows is running with LIM 4.0, causes each
  1666.               instance of an application task to be assigned to a
  1667.               separate EMS bank (the Multiple Instance flag).
  1668. -p            Creates a private DLL (called only by one
  1669.               application), optimizing Windows' use of memory.
  1670. -t            Creates an application that runs only in protected
  1671.               mode (Windows Standard or 386 enhanced mode).
  1672. -v            Prints progress messages (verbose listing).
  1673. -vx           lists resources but does not bind to .exe file
  1674. -30           Marks the application as targeted for Windows 3.0
  1675.               (or above).  This is the default setting.
  1676. -31           Marks the application as targeted for Windows 3.1
  1677.               (or above).
  1678.  
  1679.  
  1680. 9.1.1    Examples
  1681. -----------------
  1682.  
  1683. The following example marks the .EXE file with the default
  1684. Windows version (3.0) and creates a preload area.
  1685.  
  1686.     rlink <filename>.EXE
  1687.  
  1688. To mark the .EXE file for Windows 3.1, the switch must be
  1689. explicitly stated:
  1690.  
  1691.     rlink -31 <filename>.EXE
  1692.  
  1693. The next example binds the resources in the .RES file into the
  1694. .EXE file and creates a preload area.
  1695.  
  1696.     rlink <filename>.RES <filename>.EXE
  1697.  
  1698. The next example links the resources in the two .RES files, binds
  1699. them to the .EXE file, and creates a preload area.
  1700.  
  1701.     rlink -fi<filename>.RES <filename>.RES <filename>.EXE
  1702.  
  1703. The next example combines the program code in the input .EXE file
  1704. with the resources in the input .RES file, produces an output
  1705. .EXE file with a new name, and creates a preload area.
  1706.  
  1707.     rlink -fe<filename>.exe <filename>.RES <filename>.EXE
  1708.  
  1709. The final example takes input from an .RLK command file. It then
  1710. links the resources in three .RES files, binds them to the .EXE
  1711. file, and creates a preload area.
  1712.  
  1713.     rlink @<filename>.rlk
  1714.  
  1715. The command file (<filename>.RLK) contains:
  1716.  
  1717.     -fi<filename>.res
  1718.     -fi<filename>.res
  1719.     <filename>.res
  1720.     <filename>.exe
  1721.  
  1722.  
  1723. 9.2      BRCC.EXE
  1724. -----------------
  1725.  
  1726. BRCC is a command-line version of Resource Workshop's resource
  1727. compiler. It accepts a resource script file (.RC) as input and
  1728. produces a resource object file (.RES) as output. BRCC uses the
  1729. following command-line syntax:
  1730.  
  1731.     brcc [switches] <filename>.RC
  1732.  
  1733. BRCC accepts these switches:
  1734.  
  1735. -d<name>[=<string>]     Defines a preprocessor symbol.
  1736. -fo<filename> Renames the output .RES file. (By default, BRCC
  1737.               creates the output .RES file with the same name as
  1738.               the input .RC file.)
  1739. -i<path>      Adds one or more directories (separated by
  1740.               semicolons) to the include search path.
  1741. -r            This switch is ignored. It is included for
  1742.               compatibility with other resource compilers.
  1743. -v            Prints progress messages (verbose).
  1744. -x            Deletes the current include path.
  1745. -30           Creates a Windows 3.0-compatible .RES file.
  1746. -31           Creates a Windows 3.10-compatible .RES file.
  1747. -? or -h      Displays switch help.
  1748.  
  1749. Like Resource Workshop's resource compiler, BRCC predefines
  1750. common resource-related Windows constants such as WS_VISIBLE
  1751. BS_PUSHBUTTON. In addition, two special compiler-related symbols
  1752. are defined: RC_INVOKED and WORKSHOP_INVOKED. These symbols may
  1753. be used in the source text in conjunction with conditional
  1754. preprocessor statements to control compilation. For example, the
  1755. following construct can greatly speed up compilation:
  1756.  
  1757.     #ifndef WORKSHOP_INVOKED
  1758.     #include "windows.h"
  1759.     #endif
  1760.  
  1761.  
  1762. 9.2.1    Examples
  1763. -----------------
  1764.  
  1765. The following example adds two directories to the include path
  1766. and produces a .RES file with the same name as the input .RC
  1767. file.
  1768.  
  1769.     brcc -i<dir1>;<dir2> <filename>.RC
  1770.  
  1771. This example enables you to produce an output .RES file with a
  1772. name different from the input .RC file's.
  1773.  
  1774.     brcc -fo<filename>.RES <filename>.RC
  1775.  
  1776.  
  1777. 9.3      BRC.EXE
  1778. ----------------
  1779.  
  1780. The Borland Resource Compiler (BRC) is a resource compiler shell
  1781. with a high degree of compatibility with other resource
  1782. compilers. It accepts command lines formatted for those resource
  1783. compilers and invokes either BRCC or RLINK or both, depending on
  1784. the command-line syntax. The command-line syntax for BRC is as
  1785. follows:
  1786.  
  1787.     brc [switches] <filename>.RC [<filename>.EXE]
  1788.  
  1789. BRC accepts these switches:
  1790.  
  1791. -d            Defines a symbol you can test with the #ifdef
  1792.               preprocessor directive.
  1793. -fo<filename> Renames the .RES file.
  1794. -fe<filename> Renames the .EXE file.
  1795. -fi<filename> Specifies additional input .RES files.
  1796. -i<path>      Adds one or more directories (separated by
  1797.               semicolons) to the include search path.
  1798. -r            Creates a .RES file only. The compiled .RES file is
  1799.               not added to the .EXE.
  1800. -v            Prints progress messages (verbose listing).
  1801. -x            Directs the compiler to ignore the INCLUDE
  1802.               environment variable when it searches for include
  1803.               or resource files.
  1804. -z            Skips the check for RCINCLUDE statements.
  1805.  
  1806. The following switches are invalid when the -r switch is
  1807. specified.
  1808.  
  1809. -e            Moves the default DLL location into EMS.
  1810. -k            Disables the contiguous preload of segments and
  1811.               resources in the .EXE file. Segments are kept in
  1812.               the order in which they appear in the .DEF file.
  1813. -l            Compiles an application that uses LIM 3.2 EMS.
  1814. -m            When Windows is running with LIM 4.0, causes each
  1815.               instance of an application task to be assigned to a
  1816.               separate EMS bank (the Multiple Instance flag).
  1817. -p            Creates a private DLL that is called only by one
  1818.               application, optimizing Windows' use of memory.
  1819. -t            Creates an application that runs only in protected
  1820.               mode (Windows Standard or 386 enhanced mode).
  1821. -30           Marks the application as targeted for Windows 3.0
  1822.               (or above). This is the default setting.
  1823. -31           Marks the application as targeted for Windows 3.1
  1824.               (or above).
  1825.  
  1826.  
  1827. 9.3.1    Examples
  1828. -----------------
  1829.  
  1830. Depending on your task, there are several variations on the basic
  1831. BRC command line syntax.
  1832.  
  1833. The following statement compiles the .RC file, creates a .RES
  1834. file, and adds the .RES file to the executable file.
  1835.  
  1836.     brc <filename>.RC [<filename>.EXE]
  1837.  
  1838. BRC automatically seeks an .EXE file with the same name as the
  1839. .RC file. You need only specify the .EXE file if its name is
  1840. different from the .RC file's.
  1841.  
  1842. The following statement creates a .RES file, but not an .EXE
  1843. file. If you name an .EXE file in the command line, BRC ignores
  1844. it.
  1845.  
  1846.     brc -r <filename>.RC
  1847.  
  1848. The following statement compiles a Windows 3.1 version of a DLL
  1849. file. You must give the DLL file's extension (.DLL, .DRV, or
  1850. .EXE) in the command line.
  1851.  
  1852.     brc -31 <filename>.DLL
  1853.  
  1854. The following statement adds an existing .RES file to an
  1855. executable file. The .EXE filename is required only if it differs
  1856. from the .RES filename.
  1857.  
  1858.     brc <filename>.RES [<filename>.EXE]
  1859.  
  1860.  
  1861. ==================== END OF FILE MANUAL.RW =====================
  1862.