-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStdAbout.pkg
More file actions
203 lines (182 loc) · 8.11 KB
/
Copy pathStdAbout.pkg
File metadata and controls
203 lines (182 loc) · 8.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//************************************************************************
// Confidential Trade Secret.
// Copyright (c) 1997 Data Access Corporation, Miami Florida
// as an unpublished work. All rights reserved.
// DataFlex is a registered trademark of Data Access Corporation.
//
//************************************************************************
//************************************************************************
//
// $File name : StdAbout.pkg
// $File title : Standard about object package for VDF
// Notice :
// $Author(s) : John Tuohy
//
// $Rev History
//
// JT 06/27/97 File created
//************************************************************************
// This provides a quick and simple way to create an about package for a program.
// You need to create a message inside you client area called Activate_About.
// Within this message you should send the message DoAbout passing needed
// string information.
//
// Procedure Activate_About
// Send DoAbout sTitle sVersion sCopyright sAuthor sBitmap
// End_Procedure
// where: sTitle = Name of application. If none provided, uses caption
// bar title
// sVersion = Version Line. If none provided, will be blank
// sCopyRight = Copyright Line. If none provided, will be blank
// sAuthor = Author name, blank if none provided
// sBitMap = Bitmap logo. If none provided, standard VDF bitmap
// is used.
// It is expected that you will place this in your own object package. For
// example an order about package may look like this:
//
// // OrderAbout.pkg
// Use StdAbout.pkg
// Procedure Activate_About
// String sTitle sCopyright sVersion sAuthor
// Move "My Order Entry System" to sTitle
// Move "Version 2.1" to sVersion
// Move "Copyright 1997, Super Software Inc." to sCopyright
// Move "John Smith" to sAuthor
// Send DoAbout sTitle sVersion sCopyright sAuthor ""
// end_procedure
// // end of file.
Use DfAbout.pkg
// *************************************************************************
// Public message. This is the default message. It is expected that you will
// create your own message to override this
// *************************************************************************
Procedure Activate_About
Send DoAbout "" "" "" "" "" "" "" "" "" ""
End_Procedure
// *************************************************************************
// Public message. It is expected that you will send this message (most
// likely from Activate_About. This creates an about object, activates it
// and destroys it when done. It is not exepected that you will augment this.
// *************************************************************************
// Sample usage:
// The first two params will automatically be filled from the application settings if not provided.
// Send DoAbout "" "" ("Copyright: 2013" * psCompany(ghoApplication)) "Created by: Your Name" "YourAppBitmap.bmp" "Internet: http://www.YourWebAddress.com" "E-mail: mailto:support@YourEmailAddress.com" "Some other description of choice" "9th param" "and last param"
Procedure DoAbout String sTitle String sVersion String sCopyRight String sAuthor String sBitmap ;
String sParam6 String sParam7 String sParam8 String sParam9 String sParam10
Integer hoObj hoMain iArgs
String sValue sVer sCompany
// Create object
Object About is an AboutDialog
// Uncomment these two lines if you would like to have a resizable About object.
// Set Border_Style to Border_Thick
// Set peAnchors to anAll
// Add checking for the number of arguments passed to avoid runtime errors
// if one of them is not passed. This makes the interface
// more flexible.
Move num_arguments to iArgs
If (iArgs > 4 and sTitle = "" and sVersion = "" and sCopyRight = "" and sAuthor = "") Begin
#IFDEF ShouldEmbeddAboutHelpFile
Set pbShowRTFFile to True
#ENDIF
Set Version to sVersion
End
Else Begin
If (sCopyRight = "") Begin
Get piVersionMajor of (phoVersionInfo(ghoApplication)) to sVer
Get psCompany of ghoApplication to sCompany
Move ("Copyright:" * String(sVer) * String(sCompany)) to sCopyRight
End
// If no title is passed use the label of the main panel (if a main panel exists).
If (iArgs > 0 and sTitle = "") Begin
Get psProduct of ghoApplication to sValue
If (sValue <> "") Begin
Move ("Program:" * sValue) to sValue
End
Else Begin
Get Main_Window of Desktop to hoMain
If hoMain Begin
Get Label of hoMain to sValue
End
End
End
Else If (iArgs > 0 and sTitle <> "") Begin
Move sTitle to sValue
End
Else If (iArgs = 0) Begin
Get psProduct of ghoApplication to sValue
If (sValue <> "") Begin
Move ("Program:" * sValue) to sValue
End
Else Begin
Get Main_Window of Desktop to hoMain
If hoMain Begin
Get Label of hoMain to sValue
End
End
End
If (sValue <> "") Begin
Send Add_LineLn sValue
End
Move "" to sValue
// If the passed sVersion value is blank, the info will be retrieved from the cApplication object.
// For this to work the Project Properties Version must have been set in the Studio.
If (iArgs < 2) Begin
Move "" to sValue
End
Else Begin
If (sVersion <> "" and not(Lowercase(sVersion) contains "ver")) Begin
Move (C_$Version + ":" * String(sVersion)) to sVersion
End
Move sVersion to sValue
End
Set Version to sValue
If (iArgs > 2 and sCopyRight <> "") Begin
Send Add_LineLn sCopyRight
End
// If only the five "standard" params were passed we don't add an extra linefeed;
// else we do.
If (iArgs > 3 and iArgs < 6 and sAuthor <> "") Begin
Send Add_Line sAuthor
End
Else If (iArgs > 5 and sAuthor <> "") Begin
Send Add_LineLn sAuthor
Send Add_LineLn ""
End
End
// Square bitmaps of 80x80 works best
If (iArgs > 4 and sBitmap <> "") Begin
Set Logo to sBitMap
End
// Here starts handling of the five optional params:
If (iArgs = 6 and sParam6 <> "") Begin
Send Add_Line sParam6
End
Else If (iArgs > 6 and sParam6 <> "") Begin
Send Add_LineLn sParam6
End
If (iArgs = 7 and sParam7 <> "") Begin
Send Add_Line sParam7
End
Else If (iArgs > 7 and sParam7 <> "") Begin
Send Add_LineLn sParam7
End
If (iArgs = 8 and sParam8 <> "") Begin
Send Add_Line sParam8
End
Else If (iArgs > 8 and sParam8 <> "") Begin
Send Add_LineLn sParam8
End
If (iArgs = 9 and sParam9 <> "") Begin
Send Add_LineLn sParam9
End
Else If (iArgs > 9 and sParam9 <> "") Begin
Send Add_LineLn sParam9
End
If (iArgs = 10 and sParam10 <> "") Begin
Send Add_Line sParam10
End
Move Self to hoObj
End_Object
Send Popup of hoObj // Popup the about object
Send Destroy of hoObj // When done, it will be destroyed
End_Procedure