home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / slfinsta.zip / dw.h < prev    next >
C/C++ Source or Header  |  2000-03-26  |  3KB  |  92 lines

  1. /* $Id: dw.h,v 1.1 2000/03/27 04:52:53 ktk Exp $ */
  2.  
  3. #ifndef _H_DW
  4. #define _H_DW
  5.  
  6. /* Used internally */
  7. #define TYPEBOX  0
  8. #define TYPEITEM 1
  9.  
  10. #define SIZESTATIC 0
  11. #define SIZEEXPAND 1
  12.  
  13. #define BOXHORZ 0
  14. #define BOXVERT 1
  15.  
  16. extern HAB dwhab;
  17. extern HMQ dwhmq;
  18.  
  19. typedef struct _item {
  20.     /* Item type - Box or Item */
  21.     int type;
  22.     /* Handle to Frame or Window */
  23.     HWND hwnd;
  24.     /* Width and Height of static size */
  25.     int width, height, origwidth, origheight;
  26.     /* Size Type - Static or Expand */
  27.     int size;
  28.     /* Padding */
  29.     int pad;
  30.     /* Ratio of current item */
  31.     float xratio, yratio;
  32. } Item;
  33.  
  34. typedef struct _box {
  35.     /* Number of items in the box */
  36.     int count;
  37.     /* Box type - horizontal or vertical */
  38.     int type;
  39.     /* Padding */
  40.     int pad, parentpad;
  41.     /* Used as temporary storage in the calculation stage */
  42.     int upx, upy, minheight, minwidth;
  43.     /* Ratio in this box */
  44.     float xratio, yratio, parentxratio, parentyratio;
  45.     /* Used for calculating individual item ratios */
  46.     int width, height;
  47.     /* Array of item structures */
  48.     struct _item *items;
  49. } Box;
  50.  
  51. void dw_box_pack_start_stub(HWND box, HWND item, int width, int height, int size, int pad);
  52. void dw_box_pack_end_stub(HWND box, HWND item, int width, int height, int size, int pad);
  53.  
  54. /* Public function prototypes */
  55. void dw_box_pack_start(HWND box, HWND item, int width, int height, int size, int pad);
  56. void dw_box_pack_end(HWND box, HWND item, int width, int height, int size, int pad);
  57. int dw_init(int newthread);
  58. void dw_main(HAB currenthab, int (* EXPENTRY func)(HWND, ULONG, MPARAM, MPARAM));
  59. int dw_window_show(HWND handle);
  60. int dw_window_hide(HWND handle);
  61. int dw_window_destroy(HWND handle);
  62. int dw_window_set_font(HWND handle, char *fontname);
  63. int dw_window_set_color(HWND handle, ULONG fore, ULONG back);
  64. HWND dw_window_new(HWND hwndOwner, PSZ title, ULONG flStyle);
  65. HWND dw_box_new(int type, int pad);
  66. HWND dw_groupbox_new(int type, int pad);
  67. HWND dw_bitmap_new(ULONG id);
  68. HWND dw_container_new(ULONG id);
  69. HWND dw_text_new(char *text, ULONG id);
  70. HWND dw_mle_new(ULONG id);
  71. HWND dw_entryfield_new(char *text, ULONG id);
  72. HWND dw_combobox_new(char *text, ULONG id);
  73. HWND dw_button_new(char *text, ULONG id);
  74. HWND dw_spinbutton_new(char *text, ULONG id);
  75. HWND dw_slider_new(ULONG id);
  76. HWND dw_checkbox_new(char *text, ULONG id);
  77. HWND dw_listbox_new(ULONG id);
  78. void dw_window_set_pos(HWND handle, ULONG x, ULONG y);
  79. void dw_window_set_usize(HWND handle, ULONG width, ULONG height);
  80. void dw_window_set_pos_size(HWND handle, ULONG x, ULONG y, ULONG width, ULONG height);
  81. void dw_window_set_style(HWND handle, ULONG style, ULONG mask);
  82. void dw_window_set_icon(HWND handle, ULONG id);
  83. void dw_window_set_bitmap(HWND handle, ULONG id);
  84. BOOL dw_window_set_bitmapfile(HWND handle, char *filename);
  85. void dw_window_set_text(HWND handle, char *text);
  86. void dw_window_disable(HWND handle);
  87. void dw_window_enable(HWND handle);
  88. int dw_screen_width(void);
  89. int dw_screen_height(void);
  90.  
  91. #endif
  92.