home *** CD-ROM | disk | FTP | other *** search
- DefInt A-Z
-
- ' Misc helpful VB routines that augment or make certain
- ' WGLib v 1.01 or VB calls easier
-
- '
- ' Copyright (c) InfoSoft 1991, 1992
- ' ALl Rights Reserved
- '
-
- ' CenterForm
- ' Passed a Form it will set it's Top and Left properties
- ' to that required to center the form on the display context
- ' Invoke after the form is loaded, but before shown.
- '
- ' CenterForm (Frm as Form)
-
-
- ' EmFXCalc
- ' passed a control that is to be Empressed or Embossed,
- ' it will calc the 'optimum' coords for the call.
- ' Since some controls control more area than they show
- ' (Pictures and frames mainly) and due to different DC's
- ' this is mainly a design tool to get a good starting point.
- '
- ' EmFXCalc(Ctl as Control)
-
-
- ' Like CenterForm, but only does the Horz centering
- ' CenterFrmH
-
-
- ' Like CenterForm, but only does the Vert centering
- ' CenterFrmVH
-
-
- ' CtlLabel
- ' Prints a label on the Form just to the left of a control.
- ' Using an actual VB Label Control just to print "Name:" and such
- ' wastes system resources, when we can easily print ON the form
- ' Uses current Form FG color
- '
- ' CtlLabel (Frm As Form, Ctl As Control, Text$)
- '
-
- ' CtlLabelFX
- ' Prints a label on the Form to the left of a control, just
- ' like CtlLabel, but with a shading effect (some call it
- ' blurred). Uses FormFG color for text, shades with white
- '
- ' CtlLabelFX (Frm As Form, Ctl As Control, Text$)
- '
-
-
- 'CtlLabelOvr
- ' Like CtlLabel but puts the label over the control, for
- ' those wider controls that come to close to the form edge.
- ' Note: this is designed for NON FX controls. The use of
- ' ConCave or Convex Frm would require the text to be even
- ' further above the control
- '
- ' CtlLabelOvr (Frm As Form, Ctl As Control, Text$)
- '
-
-
- 'CtlLabelOvrFX
- ' Like CtlLabelOvr with the label over the control, but
- ' with FX. Same cautions apply.
- '
- ' CtlLabelOvrFX (Frm As Form, Ctl As Control, Text$)
- '
-
- Sub CenterForm (Frm As Form)
-
- ScrTall = Screen.Height
- ScrWide = Screen.Width
-
- FrmTall = Frm.Height
- FrmWide = Frm.Width
-
- Frm.Top = (ScrTall - FrmTall) \ 2
- Frm.Left = (ScrWide - FrmWide) \ 2
-
-
- End Sub
-
- Sub CenterFrmH (Frm As Form)
-
- ScrWide = Screen.Width
-
- FrmWide = Frm.Width
-
- Frm.Left = (ScrWide - FrmWide) \ 2
-
- End Sub
-
- Sub CenterFrmV (Frm As Form)
-
- ScrTall = Screen.Height
-
- FrmTall = Frm.Height
-
- Frm.Top = (ScrTall - FrmTall) \ 2
-
- End Sub
-
- Sub CtlLabel (Frm As Form, Ctl As Control, Text$)
-
- ' center text in realm of adjacent control
- L = Ctl.Left - (Frm.TextWidth(Text$) + 15)
- T = Ctl.Top + (Frm.TextHeight(Text$) \ 2)
-
- Frm.CurrentY = T
- Frm.CurrentX = L
- Frm.Print Text$;
-
- End Sub
-
- Sub CtlLabelFX (Frm As Form, Ctl As Control, Text$)
-
- ' center text in realm of adjacent control
- L = Ctl.Left - (Frm.TextWidth(Text$) + 15)
- T = Ctl.Top + (Frm.TextHeight(Text$) \ 2)
- OldClr& = Frm.ForeColor
-
- ' print in white 15 is min increment for most
- Frm.ForeColor = &HFFFFFF
- Frm.CurrentY = T
-
- ' the next line adds shadow below as well.
- 'Frm.CurrentY = T + 15
-
- Frm.CurrentX = L + 15
- Frm.Print Text$;
-
- 'Print in ???
- Frm.ForeColor = OldClr&
- Frm.CurrentY = T
- Frm.CurrentX = L
- Frm.Print Text$;
-
- End Sub
-
- Sub CtlLabelOvr (Frm As Form, Ctl As Control, Text$)
-
- ' center text in realm of adjacent control
- L = Ctl.Left
-
- ' to allow for FX, increase 15 below to 45 or 6
- ' depending on the Thickness factor (15 per increment)
- T = Ctl.Top - (Frm.TextHeight(Text$) + 15)
-
- Frm.CurrentY = T
- Frm.CurrentX = L
- Frm.Print Text$;
-
- End Sub
-
- Sub CtlLabelOvrFX (Frm As Form, Ctl As Control, Text$)
-
- ' center text in realm of adjacent control
- L = Ctl.Left
- T = Ctl.Top - (Frm.TextHeight(Text$))
- OldClr& = Frm.ForeColor
-
- ' print in white 15 is min increment for most
- Frm.ForeColor = &HFFFFFF
- Frm.CurrentY = T
-
- ' the next line adds shadow below as well.
- 'Frm.CurrentY = T + 15
-
- Frm.CurrentX = L + 15
- Frm.Print Text$;
-
- 'Print in ???
- Frm.ForeColor = OldClr&
- Frm.CurrentY = T
- Frm.CurrentX = L
- Frm.Print Text$;
-
- End Sub
-
- Sub EmFXCalc (Ctl As Control, T%, L%, B%, R%)
-
- T = Ctl.Top - 15
- L = Ctl.Left - 15
- B = T + Ctl.Height + 15
- R = L + Ctl.Width + 15
-
- End Sub
-
-