home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 January / Chip_1997-01_cd.bin / ms95 / disk22 / dir04 / f015470.re_ / f015470.re
Text File  |  1996-04-02  |  5KB  |  158 lines

  1. /*----------------------------------------------------------------------+
  2. |                                    |
  3. |  Copyright (1995) Bentley Systems, Inc., All rights reserved.        |
  4. |                                    |
  5. |  "MicroStation" is a registered trademark and "MDL" and "MicroCSL"    |
  6. |  are trademarks of Bentley Systems, Inc.                    |
  7. |                                    |
  8. |  Limited permission is hereby granted to reproduce and modify this    |
  9. |  copyrighted material provided that the resulting code is used only     |
  10. |  in conjunction with Bentley Systems products under the terms of the    |
  11. |  license agreement provided therein, and that this notice is retained    |
  12. |  in its entirety in any such reproduction or modification.        |
  13. |                                    |
  14. +----------------------------------------------------------------------*/
  15. /*----------------------------------------------------------------------+
  16. |                                    |
  17. |    $Logfile:   J:/mdl/examples/listbox/listicon.r_v  $
  18. |   $Workfile:   listicon.r  $
  19. |   $Revision:   1.1  $
  20. |       $Date:   29 Jun 1995 15:33:54  $
  21. |                                    |
  22. +----------------------------------------------------------------------*/
  23. /*----------------------------------------------------------------------+
  24. |                                    |
  25. |   listicon.r                                |
  26. |                                    |
  27. |    Dialog Resources                            |
  28. |                                    |
  29. +----------------------------------------------------------------------*/
  30. /*----------------------------------------------------------------------+
  31. |                                    |
  32. |   Include Files                               |
  33. |                                    |
  34. +----------------------------------------------------------------------*/
  35. #include <dlogbox.h>    /* dlog box manager resource constants & structs */
  36. #include <dlogids.h>    /* MicroStation resource IDs */
  37. #include <keys.h>
  38.  
  39. #include "listbox.h"    /* newitems dialog box example constants & structs */
  40. #include "listbtxt.h"    /* newitems static text definitions */
  41.  
  42. /*----------------------------------------------------------------------+
  43. |                                    |
  44. |                                       |
  45. |                                    |
  46. +----------------------------------------------------------------------*/
  47. #define YBUT        YSEP+YC
  48. #define    YSIZE        (YBUT+2*YC+YC)
  49.  
  50. /*----------------------------------------------------------------------+
  51. |                                    |
  52. |   Example Dialog containing a list box with icons            |
  53. |                                    |
  54. +----------------------------------------------------------------------*/
  55. #define XSIZE    (38*XC)
  56. #define GBW (15*XC)
  57. #define XW  (11*XC)
  58.  
  59. #define X1 (3*XC)
  60. #define X2 (X1 + 1.5*XC)
  61. #define X3 (10*XC)
  62. #define X4 (X3 + 1.5*XC)
  63.  
  64. #define YSEP (GENY(12)-YC+5*YC)
  65.  
  66. DialogBoxRsc  DIALOGID_ListIcon =
  67.     {
  68.     DIALOGATTR_DEFAULT | DIALOGATTR_SINKABLE,
  69.     XSIZE, YSIZE, 
  70.     NOHELP, MHELP, HOOKDIALOGID_ListIcon, NOPARENTID,
  71.     TXT_ListIcon,
  72. {
  73. {{X1,GENY(1), (WIDTH_FILEOPENDIRS_LISTBOX + 10)*XC,0}, Text, TEXTID_Directory, ON, 0, "", ""},
  74. {{X1,GENY(2), 0,0}, ListBox, LISTBOXID_Directories, ON, 0, "", ""},
  75. {{X1,GENY(12),0,0}, ListBox, LISTBOXID_Choices, ON, 0, "", ""},
  76.  
  77. }
  78.     };
  79.  
  80. #undef XSIZE        /* undef symbols so they can be reused */
  81. #undef GBW
  82. #undef XW
  83.  
  84. #undef X1
  85. #undef X2
  86. #undef X3
  87. #undef X4
  88. #undef X5
  89.  
  90. #undef YSEP
  91.  
  92. /*----------------------------------------------------------------------+
  93. |                                    |
  94. |   Item Resource Specifications                    |
  95. |                                    |
  96. +----------------------------------------------------------------------*/
  97.  
  98. /*----------------------------------------------------------------------+
  99. |                                    |
  100. |   ListBox Resources (With ICONS)                    |
  101. |                                    |
  102. +----------------------------------------------------------------------*/
  103. /*----------------------------------------------------------------------+
  104. |                                    |
  105. |   List Box which includes ICONS                    |
  106. |                                    |
  107. | Sample list box resource using DRAWPREFIXICON - Directory List on file|
  108. | open.                                    |
  109. |Include the LISTATTR_DRAWPREFIXICON attribute in the list box resource.| 
  110. |This attribute is defined in "dlogbox.h".                |
  111. |The programmer must set up the list box resource to allow space for the|
  112. | icon to be drawn.                            |
  113. +----------------------------------------------------------------------*/
  114. DItem_ListBoxRsc LISTBOXID_Directories =
  115.     {
  116.     NOHELP, MHELP, HOOKITEMID_ListIcon_FileListDirectory, NOARG, 
  117. #if defined (MSVERSION)    && (MSVERSION >= 0x551)
  118.     LISTATTR_DYNAMICSCROLL | LISTATTR_DRAWPREFIXICON | LISTATTR_NOSELECTION,
  119. #else
  120.     LISTATTR_DYNAMICSCROLL | LISTATTR_NOSELECTION,
  121. #endif
  122.     10, 0, "",
  123.     {
  124.     {(WIDTH_FILEOPENDIRS_LISTBOX + 10)*XC, 32, 0, ""},
  125.     }
  126.     };
  127.  
  128.  
  129. DItem_ListBoxRsc LISTBOXID_Choices =
  130.     {
  131.     NOHELP, MHELP, 
  132.     HOOKITEMID_CheckListBox, NOARG, 
  133. #if defined (MSVERSION)    && (MSVERSION >= 0x551)
  134.     LISTATTR_DYNAMICSCROLL | LISTATTR_DRAWPREFIXICON | LISTATTR_NOSELECTION, 
  135. #else
  136.     LISTATTR_DYNAMICSCROLL | LISTATTR_NOSELECTION,
  137. #endif
  138.     5, 0, "",
  139.     {
  140.     {(WIDTH_FILEOPENDIRS_LISTBOX + 10)*XC, 30, 0, ""},
  141.     }
  142.     };
  143.  
  144.  
  145. /*----------------------------------------------------------------------+
  146. |                                                                       |
  147. |   Text Item Resource Definitions                    |
  148. |                                                                       |
  149. +----------------------------------------------------------------------*/
  150. DItem_TextRsc TEXTID_Directory =
  151.    {
  152.    NOCMD, MCMD, NOSYNONYM, NOHELP, MHELP, NOHOOK, NOARG, 
  153.    MAXDIRLENGTH, "%s", "%s", "", "", NOMASK, 
  154.    TEXT_READONLY | TEXT_ABBREVFILENAME,
  155.    "", 
  156.    "listboxGlobs.directoryName"
  157.    };
  158.