Module VdfBase.pkg
1// VdfBase.pkg
2//
3// Provides low level support expected of all VDF applications (windows and webapp). This should never be used by itself
4// This will be loaded as part of base windows (WinAppBase) or base webapp (WebAppBase)
5
6use ui
7
8// Minimum fmac version required for these packages
9// fmac versions are stored in FMAC
10#Replace Required_FMAC_Version |CI16
11#Replace Required_FMAC_Revision |CI1
12#Replace Required_FMAC_Build |CI81
13
14// Minimum Runtime version required for these packages
15// return versions returned in version_information
16#Replace Required_RT_Version |CI16
17#Replace Required_RT_Revision |CI1
18#Replace Required_RT_Build |CI22
19
20Use ErrorNum.inc // allows all packages to use symbolic names for errors.
21use dll.pkg // support for Dll stuff
22use registry.pkg // (obsolete) this just has defintiions of registry commands and constants
23use InetTransfer.pkg // add defintions for Internet transfer classes
24
25Use BaseData_Set.pkg // defines RT baseData_set
26
27// define class used throughout system for mixins
28{ HelpTopic=Mixin }
29Class Mixin Is A cObject
30End_Class
31
32
33// As of 8.3, these classes should no longer be used. We provide the names here for
34// backwards compatibility issues.
35#replace U_Message U_cUIObject // should use cObject or cUIObject
36#replace U_Desktop U_cObject // should use cObject
37#replace U_BaseClass U_cObject // should use cObject
38
39
40// Very low level abstract classes. Note that these replacement
41// name are never directly used in the class heirarchy. They are
42// provided so the documented class hierarchy may use these names.
43#replace U_DFObject U_DFBaseObject
44#replace U_DFWindow U_DFBaseWindow
45#replace U_DFUIWindow U_DFBaseUIWindow
46#replace U_DFContainer U_DFBaseContainer
47#replace U_DFDialog U_DFBaseDialog
48#replace U_DFPanel U_DFBasePanel
49#replace U_DFDesktop U_cDesktop
50#replace U_DFControl U_DFBaseControl
51#replace U_DFMenu U_DFBaseMenu
52#replace U_DFList U_DFBaseList
53#replace U_DFForm U_DFBaseForm
54#replace U_DFButton U_DFBaseButton
55
56// Low Level Communication classes
57#replace U_DFSession U_DFBaseSession //obsolete
58#replace U_DFSerial U_DFBaseSerial //obsolete
59#replace U_DFMapiSession U_DFBaseMapiSession //obsolete
60
61// Classes that we currently don't support at other than this
62// very low level. If any of these become needed we will abstract these
63// to a higher level.
64#replace U_DFTriState U_DFBaseTriState //obsolete
65#replace U_DFCheckList U_DFBaseCheckList //obsolete
66#replace U_DFRadioList U_DFBaseRadioList //obsolete
67#replace U_DFTriStateList U_DFBaseTriStateList //obsolete
68#replace U_DFPushButtonList U_DFBasePushButtonList //obsolete
69
70
71// Classes that require no augmentation (so far)
72#replace U_VertScrollBar U_DFBaseScrollBar //obsolete
73#replace U_HorzScrollBar U_DFBaseHorzScrollBar //obsolete
74#replace U_SystemMenu U_DFBaseSysMenu
75#replace U_ImageList U_DFBaseImageList //obsolete
76
77// Function Create:
78// is used to create an object based on the passed classed. returns the object handle
79// Class Id can be represented as the U_ClassName.
80//
81Function Create for cObject integer iClassId Returns Handle
82 Integer hObj
83 Name (iClassid) U_ObjectClassID
84 object oObject is a ObjectClassID
85 Move Self to hObj
86 end_object
87 function_return hObj
88End_function
89
90Procedure Destroy for cObject
91 Handle hoID
92 Broadcast send Destroy
93 Send Destroy_Object // destroy acutal object
94End_Procedure
95
96{ Obsolete=True }
97Procedure Request_Destroy_Object for cObject
98 Send Destroy
99End_Procedure
100
101
102//* Justification modes */
103
104#REPLACE JMode_Left |CI0
105#REPLACE JMode_Center |CI1
106#REPLACE JMode_Right |CI2
107#REPLACE JMode_Top |CI4
108#REPLACE JMode_Bottom |CI8
109#REPLACE JMode_VCenter |CI512 //12
110#REPLACE JMode_Wrap |CI16
111
112//* Form Justificationmodes */
113#REPLACE Form_DisplayLeft |CI0
114#REPLACE Form_DisplayCenter |CI$0001
115#REPLACE Form_DisplayRight |CI$0002
116#REPLACE Form_EditLeft |CI$0000
117#REPLACE Form_EditRight |CI$0800
118
119//* Button Aspects */
120#REPLACE BAspect_None |CI0
121#REPLACE BAspect_Pushbutton |CI1
122#REPLACE BAspect_Checkbox |CI2
123#REPLACE BAspect_Radio |CI3
124#REPLACE BAspect_Tristate |CI4
125#REPLACE BAspect_Pulldown |CI5
126#REPLACE BAspect_Combobutton |CI6
127#REPLACE BAspect_Form |CI7
128#REPLACE BAspect_Comboform |CI8
129#REPLACE BAspect_Actionbar |CI9
130
131
132#REPLACE BAspect_Multi |CI128
133#REPLACE BAspect_Pushbuttonlist |CI129
134#REPLACE BAspect_Checklist |CI130
135#REPLACE BAspect_Radiolist |CI131
136#REPLACE BAspect_Tristatelist |CI132
137
138// Map modes
139#REPLACE Map_Device |CI0
140#REPLACE Map_Character |CI1
141#REPLACE Map_Dialog |CI2
142#REPLACE Map_Ratio |CI3
143
144//* Borders */
145#REPLACE Border_None |CI0
146#REPLACE Border_Normal |CI1
147#REPLACE Border_Dialog |CI2
148#REPLACE Border_Thick |CI3
149#REPLACE Border_ClientEdge |CI4
150#REPLACE Border_WindowEdge |CI5
151#REPLACE Border_StaticEdge |CI6
152
153//* View Modes */
154#REPLACE Viewmode_Normal |CI0
155#REPLACE Viewmode_Iconize |CI1
156#REPLACE Viewmode_Zoom |CI2
157
158// Data Types
159#REPLACE Date_Window |CI128
160#REPLACE Ascii_Window |CI255
161
162// Make Proportional constants
163
164#REPLACE MP_Size |CI0 // the window was resized
165#REPLACE MP_ActionBar |CI1 // an action bar was added or deleted
166#REPLACE MP_Border |CI2 // the border style was changed
167#REPLACE MP_Caption |CI3 // the caption_bar was added or deleted
168#REPLACE MP_MapMode |CI4 // switched to map_ratio
169#REPLACE MP_MapRatios |CI5 // program changed ratios with message
170
171// ImageList constants
172#REPLACE ILC_Mask |CI$0001
173#REPLACE ILC_Color |CI$0000
174#REPLACE ILC_Colorddb |CI$00FE
175#REPLACE ILC_Color4 |CI$0004
176#REPLACE ILC_Color8 |CI$0008
177#REPLACE ILC_Color16 |CI$0010
178#REPLACE ILC_Color24 |CI$0018
179#REPLACE ILC_Color32 |CI$0020
180#REPLACE ILC_Palette |CI$0800
181
182// Buttonbar constants
183// Button Styles
184#REPLACE TBStyle_Button 0
185#REPLACE TBStyle_Sep 1
186#REPLACE TBStyle_Check 2
187#REPLACE TBStyle_Group 4
188#REPLACE TBStyle_Checkgroup (TBSTYLE_GROUP IOR TBSTYLE_CHECK)
189
190#REPLACE IDB_Standard 1
191#REPLACE IDB_View 2
192#REPLACE IDB_Small 0
193#REPLACE IDB_Large 4
194
195// icon indexes for standard bitmaps
196#REPLACE ICO_STD_Cut 0
197#REPLACE ICO_STD_Copy 1
198#REPLACE ICO_STD_Paste 2
199#REPLACE ICO_STD_Undo 3
200#REPLACE ICO_STD_Redow 4
201#REPLACE ICO_STD_Delete 5
202#REPLACE ICO_STD_Filenew 6
203#REPLACE ICO_STD_Fileopen 7
204#REPLACE ICO_STD_Filesave 8
205#REPLACE ICO_STD_Printpre 9
206#REPLACE ICO_STD_Properties 10
207#REPLACE ICO_STD_Help 11
208#REPLACE ICO_STD_Find 12
209#REPLACE ICO_STD_Replace 13
210#REPLACE ICO_STD_Print 14
211
212// icon indexes for standard view bitmaps
213#REPLACE ICO_View 15
214#REPLACE ICO_View_LargeIcons (ICO_VIEW + 0)
215#REPLACE ICO_View_SmallIcons (ICO_VIEW + 1)
216#REPLACE ICO_View_List (ICO_VIEW + 2)
217#REPLACE ICO_View_Details (ICO_VIEW + 3)
218#REPLACE ICO_View_SortName (ICO_VIEW + 4)
219#REPLACE ICO_View_SortSize (ICO_VIEW + 5)
220#REPLACE ICO_View_SortDate (ICO_VIEW + 6)
221#REPLACE ICO_View_SortType (ICO_VIEW + 7)
222#REPLACE ICO_View_ParentFolder (ICO_VIEW + 8)
223#REPLACE ICO_View_NetConnect (ICO_VIEW + 9)
224#REPLACE ICO_View_NetDisconnect (ICO_VIEW + 10)
225#REPLACE ICO_View_NewFolder (ICO_VIEW + 11)
226
227#REPLACE ICO_User (ICO_VIEW_NEWFOLDER+1)
228
229// MAPI constants
230#REPLACE MAPI_Orig 0 // Recipient is message originator
231#REPLACE MAPI_To 1 // Recipient is a primary recipient
232#REPLACE MAPI_Cc 2 // Recipient is a copy recipient
233#REPLACE MAPI_Bcc 3 // Recipient is blind copy recipient
234
235#replace MAPI_Dialog |CI$00000008
236
237#replace MAPI_Logon_ui |CI$00000001
238#replace MAPI_Password_ui |CI$00020000
239#replace MAPI_New_Session |CI$00000002
240#replace MAPI_Force_Download |CI$00001000
241#replace MAPI_Allow_Others |CI$00000008
242#replace MAPI_Explicit_Profile |CI$00000010
243#replace MAPI_Extended |CI$00000020
244#replace MAPI_Use_Default |CI$00000040
245
246#replace MAPI_Simple_Default (MAPI_LOGON_UI + MAPI_FORCE_DOWNLOAD + MAPI_ALLOW_OTHERS)
247#replace MAPI_Simple_Explicit (MAPI_NEW_SESSION + MAPI_FORCE_DOWNLOAD + MAPI_EXPLICIT_PROFILE)
248
249// MAPIFindNext() flags.
250#replace MAPI_Unread_Only (|CI$00000020)
251#replace MAPI_Guarantee_fifo |CI$00000100
252#replace MAPI_Long_msgid |CI$00004000
253
254// MAPIReadMail() flags.
255#replace MAPI_Peek |CI$00000080
256#replace MAPI_Suppress_Attach |CI$00000800
257#replace MAPI_Body_as_File |CI$00000200
258
259#replace MAPI_ENVELOPE_ONLY |CI$00000040
260
261// Masked Edit control constants
262#REPLACE Mask_Boolean_Window 512
263#REPLACE Mask_Clock_Window 1024
264#REPLACE Mask_Currency_Window 2048
265#REPLACE Mask_Date_Window 4096
266#REPLACE Mask_Datetime_Window 8192
267#REPLACE Mask_Window 16384
268#REPLACE Mask_Numeric_Window 32768
269#REPLACE Mask_Time 65536
270
271// Form Button constants
272#REPLACE Form_Button_None 0
273#REPLACE Form_Button_Prompt 1
274#REPLACE Form_Button_Spin 2
275#REPLACE Form_Button_Spin_Wrap 3
276
277// Grid Modes
278#REPLACE Grid_Visible_None 0
279#REPLACE Grid_Visible_Horz 1
280#REPLACE Grid_Visible_Vert 2
281#REPLACE Grid_Visible_Both (Grid_visible_horz+grid_visible_vert)
282
283// Bitmap Styles
284#REPLACE Bitmap_Actual 0 // actual size
285#REPLACE Bitmap_Stretch 1 // stretch to client size
286#REPLACE Bitmap_Center 2 // center in client
287#REPLACE Bitmap_Tile 3 // tile inside client
288
289
290Enum_List
291 Define anNone for 0
292 Define anTop for 1
293 Define anBottom for 2
294 Define anTopBottom for 3
295 Define anLeft for 4
296 Define anTopLeft for 5
297 Define anBottomLeft for 6
298 Define anTopBottomLeft for 7
299 Define anRight for 8
300 Define anTopRight for 9
301 Define anBottomRight for 10
302 Define anTopBottomRight for 11
303 Define anLeftRight for 12
304 Define anTopLeftRight for 13
305 Define anBottomLeftRight for 14
306 Define anAll for 15
307End_Enum_List
308
309// This symbol can be used to detect if an object is in its preconstruction
310// phase - before Contruct_Object is called. If BuildingObjectID is GT 0, the
311// object is being initialized. The value contained in BuildingObjectID is actually
312// the ID of the object currently being initialized.
313//
314
315#REPLACE BuildingObjectID |VI105
316
317// flags can be added together.
318
319#replace Shift_Key_Down 1
320#replace Ctrl_Key_Down 2
321#replace Alt_Key_Down 4
322
323
324
325#REPLACE Drive_not_available 0
326#REPLACE Drive_root_not_exist 1
327#REPLACE Drive_removable 2
328#REPLACE Drive_fixed 3
329#REPLACE Drive_remote 4
330#REPLACE Drive_cdrom 5
331#REPLACE Drive_ramdisk 6
332
333#COMMAND GETDSKINFO RS#DG RC#DG .
334 !A [] $541 !1 !2
335#ENDCOMMAND
336
337// This command is the same as GET_CURRENT_DIRECTORY except that a
338// new parameter has been provided to get the directory of any drive.
339// if specified drive is 0, the current drive is used. Drive A is 1.
340// Usage: Get_Drive_Directory DriveNum to DirString
341
342#COMMAND GET_DRIVE_DIRECTORY _RUND "TO" _RUNRIDCE .
343 !A [] $54F !3 !1
344#ENDCOMMAND
345
346#COMMAND GET_WINDOWS_DIRECTORY "TO" _RUDINEC
347 !A [] $548 !2
348#ENDCOMMAND
349
350#COMMAND GET_PRINTER_SETUP _RUND "TEMP""PERM" "TO" _RUND
351 #IFSAME !2 PERM
352 MOVE 1 TO STRMARK
353 #ELSE
354 MOVE 0 TO STRMARK
355 #ENDIF
356 !A [] $549 !1 !4
357#ENDCOMMAND
358
359#COMMAND GET_ICON_COUNT _R "TO" _R
360 !A [] $54A !1 !3
361#ENDCOMMAND
362
363#COMMAND DESTROY_CLASS _RUND .
364 !A [] $466 !1
365#ENDCOMMAND
366
367#COMMAND GRAPHICS_ADJUST_COORDS _R _R .
368 !A [] $3A9 !1 !2
369#ENDCOMMAND
370
371#COMMAND SET_DEFAULT_MAP_MODE "TO" _RDU .
372 !A [] $54E !2
373#ENDCOMMAND
374
375#COMMAND GET_DEFAULT_MAP_MODE "TO" _RDU .
376 !A [] $550 !2
377#ENDCOMMAND
378
379
380// The GetAddress Command returns the memory address of a DF string
381// variable. The command is necessary where external function require
382// The address of a string to be passed.
383
384#COMMAND GETADDRESS "OF" R "TO" R
385 !A [] $54B !2 !4
386#ENDCOMMAND
387
388
389#COMMAND WINPUT #ULGR #LUG #ULG .
390 #IFCLASS !1 "C"
391 #CHECK !2 _RCLUEG _RCLUG
392 GETADDRESS OF !1 to STRMARK
393 // INPUT !2 !3
394 !A [] $140 !2 !3 |CI79
395 #ELSE
396 #CHECK !1 _RCLUEG
397 !A [] $140 !1 !2 |CI79
398 #ENDIF
399#ENDCOMMAND
400
401#COMMAND IS_DF_WINDOW R TO R
402 !A [] $551 !1 !3
403#ENDCOMMAND
404
405#COMMAND GET_OBJECT_FROM_WINDOW R TO R
406 !A [] $552 !1 !3
407#ENDCOMMAND
408
409#COMMAND GET_FILE_PATH R "TO" _RUDINEC
410 !A [] $555 !1 !3
411#ENDCOMMAND
412
413// Get_Program_Key to Program-Key-Name
414// returns name of key that started the program. Returns blank
415// if no key (program was started with file name).
416
417#COMMAND GET_PROGRAM_KEY "TO" R
418 !A [] $566 !2
419#ENDCOMMAND
420
421// This command returns the state of a key of the keyboard.
422//
423// 1st Parameter is the virtual key code of the key being tested.
424// 2nd Parameter receives the result.
425//
426
427#COMMAND GET_KEY_STATE _R "TO" _R
428 !A [] $567 !1 !3
429#ENDCOMMAND
430
431// This command maps a virtual key to a scancode.
432//
433// 1st Parameter is the virtual key code to translate.
434// 2nd Parameter is the translated scancode.
435//
436
437#COMMAND MAP_VIRTUAL_KEY _R "TO" _R
438 !A [] $568 !1 !3
439#ENDCOMMAND
440
441// This command maps a scancode to a virtual key.
442//
443// 1st Parameter is the scancode to translate.
444// 2nd Parameter is the translated virtual key code.
445//
446
447#COMMAND MAP_SCANCODE _R "TO" _R
448 !A [] $569 !1 !3
449#ENDCOMMAND
450
451// This command maps a character to a virtual key code and shift state.
452//
453// 1st Parameter is the char to translate. Integer represents TCHAR.
454// 2nd Parameter is the virtual key code and shift state.
455// If the function succeeds, the low-order byte of the return value contains the virtual-key code
456// and the high-order byte contains the shift state, which can be a combination of the following flag
457// bits:
458//
459//Bit 1 Meaning Either SHIFT key is pressed.
460// 2 Either CTRL key is pressed.
461// 4 Either ALT key is pressed.
462//
463// If the function finds no key that translates to the passed character code, both the low-order
464// and high-order bytes contain -1.
465//
466
467#COMMAND TRANSLATE_CHARACTER _R "TO" _R
468 !A [] $56A !1 !3
469#ENDCOMMAND
470
471#COMMAND MAP_VK_TO_UNSHIFTED_CHAR _R "TO" _R
472 !A [] $56C !1 !3
473#ENDCOMMAND
474
475#COMMAND RESET_KEY_ARRAY
476 !A [] $56D
477#ENDCOMMAND
478
479#COMMAND SET_KEY_ARRAY _R "TO" _R
480 !A [] $56E !1 !3
481#ENDCOMMAND
482
483#COMMAND GET_KEY_ARRAY _R "TO" _R
484 !A [] $56F !1 !3
485#ENDCOMMAND
486
487#COMMAND REFRESH_KEY_ARRAY
488 !A [] $570
489#ENDCOMMAND
490
491#COMMAND TO_ASCII _R "TO" _R
492 !A [] $571 !1 !3
493#ENDCOMMAND
494
495#COMMAND BEGIN$NEW$ERROR$SYSTEM
496 !A [] $2e4
497#ENDCOMMAND
498
499#COMMAND BEGIN$NEW$MOUSE$INTERFACE
500 !A [] $577
501#ENDCOMMAND
502
503#COMMAND BEGIN$NEW$SCROLLBAR$INTERFACE
504 !A [] $579
505#ENDCOMMAND
506
507
508// Retreives: Version, Revision and Build
509#COMMAND VERSION_INFORMATION R R R
510 !A [] $2e5 !1 !2 // version and revision
511 !A [] $2e6 !3 // build #
512#ENDCOMMAND
513
514#COMMAND DFCTRLS_VERSION_INFORMATION R R R
515 !A [] $2e7 !1 !2 // version and revision
516 !A [] $2e8 !3 // build #
517#ENDCOMMAND
518
519BEGIN$NEW$ERROR$SYSTEM // internal
520BEGIN$NEW$MOUSE$INTERFACE // internal
521BEGIN$NEW$SCROLLBAR$INTERFACE // internal
522
523Set_Default_Map_Mode to Map_Dialog
524
525// As of 12.0, this is set here. You can change this later but there is really no longer
526// any need to show these to developers in every single project. Y2K has come and gone.
527//
528// Set date attributes as needed
529Set_Date_Attribute SysDate4_State to True
530Set_Date_Attribute Date4_State to True
531Set_Date_Attribute Epoch_Value to 30
532
533
534Use case.mac // adds case commands
535
536