home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / source / wedl203 / wedle.pas < prev   
Pascal/Delphi Source File  |  1992-07-30  |  13KB  |  326 lines

  1.  
  2. {-----------------------------------------------------------------------------}
  3. {                                                                             }
  4. {           WEDL(tm) - Windows Enhanced Dialog Library                        }
  5. {           Copyright (c) 1991-1992, Nemisoft, Inc.                           }
  6. {           All Rights Reserved                                               }
  7. {           Module:  WEDLE.PAS                                                }
  8. {                                                                             }
  9. {-----------------------------------------------------------------------------}
  10.  
  11. unit WEDL;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. const
  18.  
  19.     FMF_NONE     : LongInt = 0;
  20.     FMF_OVERTYPE : LongInt = 1;
  21.     FMF_UPDATE   : LongInt = 2;
  22.     FMF_VKEYPRES : LongInt = 4;
  23.     FMF_VLEAVFLD : LongInt = 8;
  24.     FMF_NOSELECT : LongInt = 16;
  25.     FMF_COMPAT   : LongInt = 32;
  26.  
  27.     FDF_NONE     : LongInt = 0;
  28.     FDF_COMPLETE : LongInt = 1;
  29.     FDF_NOTBLANK : LongInt = 2;
  30.     FDF_NOTZERO  : LongInt = 4;
  31.     FDF_NOTEDIT  : LongInt = 8;
  32.     FDF_MUSTEDIT : LongInt = 16;
  33.     FDF_UPDATE   : LongInt = 32;
  34.     FDF_NOSELECT : LongInt = 64;
  35.     FDF_SPCFILL  : LongInt = 128;
  36.     FDF_ZEROFILL : LongInt = 256;
  37.     FDF_BLNKZERO : LongInt = 512;
  38.     FDF_BLNKNEZ  : LongInt = 1024;
  39.     FDF_PHYSICAL : LongInt = 2048;
  40.     FDF_UPPER    : LongInt = 4096;
  41.     FDF_LOWER    : LongInt = 8192;
  42.     FDF_PROPER   : LongInt = 16384;
  43.     FDF_NUMERIC  : LongInt = 32768;
  44.     FDF_CALCNUM  : LongInt = 65536;
  45.     FDF_VKEYPRES : LongInt = 131072;
  46.     FDF_VLEAVFLD : LongInt = 262144;
  47.     FDF_COMBO    : LongInt = 524288;
  48.  
  49.     ELC_BLANK    : LongInt = 1;
  50.     ELC_ZERO     : LongInt = 2;
  51.     ELC_EDITED   : LongInt = 3;
  52.     ELC_CHECKED  : LongInt = 4;
  53.  
  54.     FDT_NULL     = 0;
  55.     FDT_STRING   = 1;
  56.     FDT_SHORT    = 2;
  57.     FDT_USHORT   = 3;
  58.     FDT_INTEGER  = 4;
  59.     FDT_UNSIGNED = 5;
  60.     FDT_LONG     = 6;
  61.     FDT_ULONG    = 7;
  62.     FDT_FLOAT    = 8;
  63.     FDT_DOUBLE   = 9;
  64.  
  65.     BTF_NONE     : LongInt = 0;
  66.     BTF_CHECKED  : LongInt = 1;
  67.     BTF_GRAYED   : LongInt = 2;
  68.     BTF_UPDATE   : LongInt = 4;
  69.     BTF_GENERIC  : LongInt = 8;
  70.     BTF_IDOK     : LongInt = 16;
  71.     BTF_IDCANCEL : LongInt = 32;
  72.  
  73.     KSM_INSERT   = 0;
  74.     KSM_CAPSLOCK = 1;
  75.     KSM_NUMLOCK  = 2;
  76.  
  77.     ERV_BLANK    = 27701;
  78.     ERV_INCOMPL  = 27702;
  79.     ERV_INVCHAR  = 27703;
  80.     ERV_NOTEDIT  = 27704;
  81.     ERV_UNEDITED = 27705;
  82.     ERV_ZERO     = 27706;
  83.  
  84.     ERE_KEYPRESS = 1;
  85.     ERE_LEAVEFLD = 2;
  86.     ERE_SELECTOK = 3;
  87.  
  88. type
  89.  
  90.     HFORM        = THandle;
  91.     HFIELD       = THandle;
  92.     HBUTTON      = THandle;
  93.  
  94.     PVALFUNC     = TFarProc;
  95.     PERRFUNC     = TFarProc;
  96.  
  97.     FIELD = record
  98.         features          : LongInt;
  99.         help_context      : LongInt;
  100.         picture_string    : PStr;
  101.         pdata             : LPVoid;
  102.         pvalid_func       : PVALFUNC;
  103.         hcombo            : HWnd;
  104.         hwnd              : HWnd;
  105.         hfield            : HFIELD;
  106.         hnext_field       : HFIELD;
  107.         ctrl_id           : Integer;
  108.         data_type         : Integer;
  109.         decimal_position  : Integer;
  110.         error_value       : Integer;
  111.         logical_size      : Integer;
  112.         physical_size     : Integer;
  113.         has_changed       : Bool;
  114.     end;
  115.  
  116.     PFIELD  = ^FIELD;
  117.     LPFIELD = PFIELD;
  118.  
  119.     FIELD_POS = record
  120.         ppicture_str_pos  : PStr;
  121.         selection         : LongInt;
  122.         logical_position  : Integer;
  123.         physical_position : Integer;
  124.         val_char_occ      : Integer;
  125.         to_right_of_dec   : Bool;
  126.         validation_char   : Char;
  127.     end;
  128.  
  129.     PFIELD_POS  = ^FIELD_POS;
  130.     LPFIELD_POS = PFIELD_POS;
  131.  
  132.     FORM = record
  133.         features          : LongInt;
  134.         perror_func       : PERRFUNC;
  135.         pdialog_proc      : TFarProc;
  136.         help_context      : LongInt;
  137.         capslock_offmsg   : PStr;
  138.         capslock_onmsg    : PStr;
  139.         help_file_name    : PStr;
  140.         insert_offmsg     : PStr;
  141.         insert_onmsg      : PStr;
  142.         numlock_offmsg    : PStr;
  143.         numlock_onmsg     : PStr;
  144.         undo_selection    : LongInt;
  145.         hhead_elink       : THandle;
  146.         hproc_array       : THandle;
  147.         hundo_buffer1     : THandle;
  148.         hundo_buffer2     : THandle;
  149.         hdlg              : HWnd;
  150.         hform             : HFORM;
  151.         hnext_form        : HFORM;
  152.         hcurr_field       : HFIELD;
  153.         herror_field      : HFIELD;
  154.         hhead_field       : HFIELD;
  155.         hhead_button      : HBUTTON;
  156.         cancel_id         : Integer;
  157.         capslock_id       : Integer;
  158.         error_event       : Integer;
  159.         error_position    : Integer;
  160.         error_value       : Integer;
  161.         insert_id         : Integer;
  162.         numlock_id        : Integer;
  163.         num_controls      : Integer;
  164.         ok_id             : Integer;
  165.         undo_level        : Integer;
  166.         edit_key_pressed  : Bool;
  167.         help_invoked      : Bool;
  168.         insert_mode       : Bool;
  169.         in_error_handler  : Bool;
  170.         just_passed_dec   : Bool;
  171.         pressed_cancel    : Bool;
  172.     end;
  173.  
  174.     PFORM  = ^FORM;
  175.     LPFORM = PFORM;
  176.  
  177.     BUTTON = record
  178.         features          : LongInt;
  179.         help_context      : LongInt;
  180.         pdata             : PInteger;
  181.         hwnd              : HWnd;
  182.         hbutton           : HBUTTON;
  183.         hnext_button      : HBUTTON;
  184.         ctrl_id           : Integer;
  185.         group_id          : Integer;
  186.         off_value         : Integer;
  187.         on_value          : Integer;
  188.         has_changed       : Bool;
  189.     end;
  190.  
  191.     PBUTTON  = ^BUTTON;
  192.     LPBUTTON = PBUTTON;
  193.  
  194. function button_define( form: HFORM; ctrl_id: Integer; pdata: PInteger;
  195.                         group_id, on_value, off_value: Integer;
  196.                         features, help_context: LongInt ): HBUTTON;
  197. function button_get_check( button: HBUTTON ): Integer;
  198. function button_get_from_ctrl_id( form: HFORM; ctrl_id: Integer ): HBUTTON;
  199. function button_get_from_group( form: HFORM; group_id: Integer): HBUTTON;
  200. function button_get_from_hwnd( form: HFORM; Wnd: HWnd ): HBUTTON;
  201. function button_get_hwnd( button: HBUTTON ): HWnd;
  202. function button_has_changed( button: HBUTTON ): Bool;
  203. function button_lock( button: HBUTTON ): LPBUTTON;
  204. function button_set_check( button: HBUTTON; state: Integer ): Integer;
  205. procedure button_unlock( button: HBUTTON );
  206.  
  207. function char_is_printable( ch: Integer ): Bool;
  208. function char_to_lower( ch: Integer ): Integer;
  209. function char_to_upper( ch: Integer ): Integer;
  210.  
  211. function field_data_to_log( field: HFIELD; pbuf: PStr; pdata: LPVoid;
  212.                             data_type: Integer ): Integer;
  213. function field_define( form: HFORM; ctrl_id: Integer; pdata: LPVoid;
  214.                        data_type: Integer; picture_string: PStr;
  215.                        features: LongInt; pvalid_func: PVALFUNC;
  216.                        error_value: Integer; help_context: LongInt ): HFIELD;
  217. function field_get_character( field: HFIELD; position: Integer;
  218.                               physical: Bool ): Integer;
  219. function field_get_from_ctrl_id( form: HFORM; ctrl_id: Integer ): HFIELD;
  220. function field_get_from_hwnd( form: HFORM; Wnd: HWnd ): HFIELD;
  221. function field_get_hwnd( field: HFIELD ): HWND;
  222. function field_get_pos_info( field: HFIELD; logical_position: Integer;
  223.                              pfpos: LPFIELD_POS ): Integer;
  224. function field_get_position( field: HFIELD; pfpos: LPFIELD_POS ): Integer;
  225. function field_get_text( field: HFIELD; pbuf: PStr; physical: Bool ): Integer;
  226. function field_has_changed( field: HFIELD ): Bool;
  227. function field_lock( field: HFIELD ): LPFIELD;
  228. function field_log_to_data( field: HFIELD; pbuf: PStr; pdata: LPVoid;
  229.                             data_type: Integer ): Integer;
  230. function field_log_to_phys( field: HFIELD; pbuf: PStr ): Integer;
  231. function field_phys_to_log( field: HFIELD; pbuf: PStr ): Integer;
  232. function field_set_text( field: HFIELD; pbuf: PStr; physical: Bool ): Integer;
  233. procedure field_unlock( field: HFIELD );
  234.  
  235. function form_begin( hDlg: HWnd; features: LongInt; perror_func: PERRFUNC ): HFORM;
  236. function form_cancel( form: HFORM ): Integer;
  237. function form_end( form: HFORM ): Integer;
  238. function form_exists( form: HFORM ): Bool;
  239. function form_get_from_hdlg( hDlg: HWnd ): HFORM;
  240. function form_get_hdlg( form: HFORM ): HWnd;
  241. function form_has_changed( form: HFORM ): Bool;
  242. function form_in_error_cond( form: HFORM ): Bool;
  243. function form_is_cancelled( form: HFORM ): Bool;
  244. function form_load( form: HFORM ): Integer;
  245. function form_lock( form: HFORM ): LPFORM;
  246. function form_ok( form: HFORM ): Integer;
  247. function form_save( form: HFORM ): Integer;
  248. function form_set_enable_link( form: HFORM; hcontrol: THandle;
  249.                                condition: LongInt; ctrl_id: Integer;
  250.                                enable: Bool ) : Integer;
  251. function form_set_help( form: HFORM; help_file_name: PStr;
  252.                         help_context: LongInt ): Integer;
  253. procedure form_unlock( form: HFORM );
  254. function form_validate( form: HFORM ): HFIELD;
  255.  
  256. function generic_define( form: HFORM; ctrl_id: Integer;
  257.                          help_context: LongInt ): THandle;
  258.  
  259. function keystat_define( form: HFORM; ctrl_id, which: Integer;
  260.                          onmsg, offmsg: PStr ): Integer;
  261.  
  262. function str_delete_char( str: PStr; ch: Integer ): Integer;
  263. procedure str_insert_char( str: PStr; ch, offs: Integer );
  264. function str_is_blank( str: PStr ): Bool;
  265. function str_is_value_zero( str: PStr ): Bool;
  266. procedure str_trim_spaces( str: PStr );
  267.  
  268. implementation
  269.  
  270. function button_define;             external 'WEDL2E' index 7;
  271. function button_get_check;          external 'WEDL2E' index 8;
  272. function button_get_from_ctrl_id;   external 'WEDL2E' index 9;
  273. function button_get_from_group;     external 'WEDL2E' index 10;
  274. function button_get_from_hwnd;      external 'WEDL2E' index 11;
  275. function button_get_hwnd;           external 'WEDL2E' index 12;
  276. function button_has_changed;        external 'WEDL2E' index 13;
  277. function button_lock;               external 'WEDL2E' index 14;
  278. function button_set_check;          external 'WEDL2E' index 15;
  279. procedure button_unlock;            external 'WEDL2E' index 16;
  280. function char_is_printable;         external 'WEDL2E' index 17;
  281. function char_to_lower;             external 'WEDL2E' index 18;
  282. function char_to_upper;             external 'WEDL2E' index 19;
  283. function field_data_to_log;         external 'WEDL2E' index 20;
  284. function field_define;              external 'WEDL2E' index 21;
  285. function field_get_character;       external 'WEDL2E' index 22;
  286. function field_get_from_ctrl_id;    external 'WEDL2E' index 23;
  287. function field_get_from_hwnd;       external 'WEDL2E' index 24;
  288. function field_get_hwnd;            external 'WEDL2E' index 25;
  289. function field_get_pos_info;        external 'WEDL2E' index 26;
  290. function field_get_position;        external 'WEDL2E' index 27;
  291. function field_get_text;            external 'WEDL2E' index 28;
  292. function field_has_changed;         external 'WEDL2E' index 29;
  293. function field_lock;                external 'WEDL2E' index 30;
  294. function field_log_to_data;         external 'WEDL2E' index 31;
  295. function field_log_to_phys;         external 'WEDL2E' index 32;
  296. function field_phys_to_log;         external 'WEDL2E' index 33;
  297. function field_set_text;            external 'WEDL2E' index 34;
  298. procedure field_unlock;             external 'WEDL2E' index 35;
  299. function form_begin;                external 'WEDL2E' index 36;
  300. function form_cancel;               external 'WEDL2E' index 37;
  301. function form_end;                  external 'WEDL2E' index 38;
  302. function form_exists;               external 'WEDL2E' index 39;
  303. function form_get_from_hdlg;        external 'WEDL2E' index 40;
  304. function form_get_hdlg;             external 'WEDL2E' index 41;
  305. function form_has_changed;          external 'WEDL2E' index 42;
  306. function form_in_error_cond;        external 'WEDL2E' index 43;
  307. function form_is_cancelled;         external 'WEDL2E' index 44;
  308. function form_load;                 external 'WEDL2E' index 45;
  309. function form_lock;                 external 'WEDL2E' index 46;
  310. function form_ok;                   external 'WEDL2E' index 47;
  311. function form_save;                 external 'WEDL2E' index 48;
  312. function form_set_enable_link;      external 'WEDL2E' index 49;
  313. function form_set_help;             external 'WEDL2E' index 50;
  314. procedure form_unlock;              external 'WEDL2E' index 51;
  315. function form_validate;             external 'WEDL2E' index 52;
  316. function generic_define;            external 'WEDL2E' index 53;
  317. function keystat_define;            external 'WEDL2E' index 54;
  318. function str_delete_char;           external 'WEDL2E' index 55;
  319. procedure str_insert_char;          external 'WEDL2E' index 56;
  320. function str_is_blank;              external 'WEDL2E' index 57;
  321. function str_is_value_zero;         external 'WEDL2E' index 58;
  322. procedure str_trim_spaces;          external 'WEDL2E' index 59;
  323.  
  324. end.
  325.  
  326.