   Help for RoText

Properties	Events

Registration Information

Order Form

Getting Custom Controls Written

Description

RoText is a Visual Basic custom control that lets you put a label on your form at any angle of rotation.  It also lets you print rotated text using the Printer Object.

File Name

ROTEXT1.VBX

Object Type

RoText

Compatibility

VB 2.0 and above

Usage Note  RoText only uses TrueType fonts, which are only available under Windows 3.1 and later.

Distribution Note     When you develop and distribute an application that uses RoText, you should install the file ROTEXT1.VBX into the users Windows SYSTEM directory.  RoText has version information built into it.  So, during installation, you should ensure that you are not overwriting a newer version of RoText.


Properties

All of the properties that apply to this control are in this table.  Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

*Angle	FontStrike	Name

BackColor	FontUnder	Parent

Caption	ForeColor	*PrinterHDC

DataChanged	Height	*PrinterHeight

DataField	HelpContextID	*PrinterLeft

DataSource	hWnd	*PrinterScaleMode

DragIcon	Index	*PrinterTop

DragMode	Left	*PrinterWidth

Enabled	LinkItem	TabIndex

FontBold	LinkMode	Tag

FontItalic	LinkTimeout	Top

FontName	LinkTopic	Visible

FontSize	MousePointer	Width

Enabled is the default value for the control.


Angle Property

Example

Description

Determines the angle of the text.

Usage

[form.][control.]Angle[ = integer ]

Remarks

This property determines what angle, in degrees, the text is displayed.

Data Type

Integer


Angle Property Example

In this example, the program will let you play with the angle of rotation of a RoText label. To try this example, paste the code into the Declarations section of a form that contains a horizontal scroll bar, and an RoText control.  Press F5.

Sub Form_Load ()

    RoText1.Caption = "TEST CAPTION"

    RoText1.Angle = 0

    HScroll1.Min = 0

    HScroll1.Max = 359

    HScroll1.Value = 0

End Sub

Sub HScroll1_Change ()

    RoText1.Angle = HScroll1.Value

End Sub

Sub HScroll1_Scroll ()

    Call HScroll1_Change

End Sub


PrinterHDC Property

See Also	Example

Description

Causes the control to be painted in the device handle specified (usually the printer object).

Usage

[form.][control.]PrinterHDC[ = integer ]

Remarks

When this property is set, the control paints itself into the Windows device context specified.  Normally, this is used to print the control.  To do this, use the hDC property of VBs Printer Object.

To print, make sure the Caption property is set correctly.  Then, set the PrinterHeight , PrinterLeft , PrinterTop , and PrinterWidth properties.  Finally, set PrinterHDC to Printer.hDC.

Data Type

Integer


See Also

Objects:

Printer Object

Properties:

hDC

PrinterLeft, PrinterTop, PrinterRight, PrinterBottom

PrinterScaleMode


PrinterLeft, PrinterTop, PrinterWidth, and PrinterHeight Properties

See Also	Example

Description

Describes the area in which to paint the control when printing.

Usage

[form.][control.]PrinterLeft[ = x ]

[form.][control.]PrinterTop[ = y ]

[form.][control.]PrinterWidth[ = nx ]

[form.][control.]PrinterHeight[ = ny ]

Remarks

These properties describe where to place the control when printing.  The coordinates used should be in the units specified by the PrinterScaleMode property.

To print, make sure the Caption property is set correctly.  Then, set the PrinterHeight , PrinterLeft , PrinterTop , and PrinterWidth properties.  Finally, set PrinterHDC to Printer.hDC.

Data Type

Integer (long)


See Also

Properties:

Caption

PrinterHDC

PrinterScaleMode


PrinterScaleMode Property

See Also	Example

Description

Determines the units of measurement used by the PrinterLeft, PrinterTop, PrinterWidth, and PrinterHeight properties.

Usage

[form.][control.]PrinterScaleMode[ = integer ]

Remarks

This property determines what units to use for the properties describing the area to print in.  This property can be one of:

Value	Description

0	Pixel (default, smallest unit of printer resolution)

1	Twip (1440 twips per inch)

2	Point (72 points per inch)

3	Pixel (smallest unit of printer resolution)

4	Character (12 per inch horizontally, 6 per inch vertically)

5	Inch

6	Millimeter

7	Centimeter

To print, make sure the Caption property is set correctly.  Then, set the PrinterHeight, PrinterLeft, PrinterTop, and PrinterWidth properties.  Finally, set PrinterHDC to Printer.hDC.

Data Type

Integer (enumerated)


See Also

Properties:

Caption

PrinterHDC

PrinterLeft, PrinterTop, PrinterWidth, PrinterHeight


Printing Example

In this example, the program will print a rotated label on your printer.  The text and the amount of rotation are determined by an edit box and a horizontal scroll bar. To try this example, paste the code into the Declarations section of a form that contains a text box, a command button, a label, a horizontal scroll bar, and a RoText control.  Press F5.  Then, enter text into the edit box and use the scroll bar to rotate it.  Once you have it the way you like, press the command button to print it.

Sub Form_Load ()

    HScroll1.Min = 0

    HScroll1.Max = 359

    HScroll1.Value = 0

    Text1.Text = "The quick brown fox ..."

    RoText1.Caption = Text1.Text

    RoText1.FontName = "Arial"

    RoText1.FontSize = 14

    RoText1.FontBold = True

    Label1.Caption = Format$(HScroll1.Value)

End Sub

Sub Command1_Click ()

    Screen.MousePointer = 11

    Printer.ScaleMode = 1

    RoText1.PrinterScaleMode = Printer.ScaleMode

    RoText1.PrinterLeft = 1440

    RoText1.PrinterTop = 1440

    RoText1.PrinterWidth = 3 * 1440

    RoText1.PrinterHeight = 3 * 1440

    RoText1.PrinterHDC = Printer.hDC

    Printer.Print ""

    Printer.NewPage

    Printer.EndDoc

    Screen.MousePointer = 0

End Sub

Sub Text1_Change ()

    RoText1.Caption = Text1.Text

End Sub

Sub HScroll1_Change ()

    RoText1.Angle = HScroll1.Value

    Label1.Caption = Format$( HScroll1.Value )

End Sub

Sub HScroll1_Scroll ()

    Call HScroll1_Change

End Sub


Events

All of the events that apply to this control are in this table.  Events that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

*Change	LinkError

Click	LinkNotify

DblClick	LinkOpen

DragDrop	MouseDown

DragOver	MouseMove

LinkChange	MouseUp

LinkClose


Change Event

Description

Occurs when the Caption changes.

Syntax

Sub ctlname_Change ( )

Remarks

This event only occurs when the Caption property changes (via the data control or through code).


Registration Information

Credits

RoText was written by Zane Thomas.  He can be reached on CompuServe at 72060,3327 or on Internet at 72060.3327@compuserve.com.  His mailing address is:

Zane Thomas

Post Office Box 300

Indianola, WA  98342

Inquiries, tech support, comments should be sent to James Shields.  His address is 71231,2066 on CompuServe, or mabry@halcyon.com on Internet.  If you must send something via U.S. Mail, the address is:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Registration

You can register this program by sending $15 ($20 for international orders) and your address.  You can register RoText and its C source code by sending $35 ($40 for international orders).  With your order, you will receive a copy of our manual documenting all of our controls.

For your convenience, an order form has been provided that you can print out directly from this help file.

E-mail Discount

You may take a $5 discount for e-mail delivery of this package (CompuServe or Internet).  If you choose this option, please note: a printed manual is not included.  Be sure to include your full mailing address with your order.  Sometimes (on the Internet) the package cannot be e-mailed.  So, we are forced to send it through the normal mails.

CompuServe members may also take the $5 e-mail discount by registering this package in the software registration forum (GO SWREG).  RoTexts SWREG ID number is 1338.  The source code version's ID number is 1339.

Credit Card Orders

We accept VISA and Mastercard.  If you e-mail your order to us, please be sure to include your card number, expiration date, complete mailing address, and your phone number (in case we have any questions about your order).

© Copyright 1993-1995 by Zane Thomas and Mabry Software, Inc.


Order Form
 RoText Order Form

Use the Print Topic.. command from the File menu to print this order form.

Mail this	Mabry Software, Inc.

form to:	Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com

Where did you get this copy of RoText?

____________________________________________________________________

Ship to:	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone:	_________________________________________________________________

Fax:	_________________________________________________________________

E-Mail:	_________________________________________________________________

MC/VISA:	_________________________________________ exp. ___________________

Disk Size:	(circle one)	 3½	5¼

qty ordered	____	REGISTRATION

$15 each, postpaid (check or money order in hard currency). Outside of North America add $5.00 shipping.

qty ordered	____	SOURCE CODE AND REGISTRATION

$35 each, postpaid (check or money order in hard currency). Outside of North America add $5.00 shipping.


Getting Custom Controls Written

If you or your organization would like to have custom controls written, you can contact me at the following:

James Shields

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com

You can also contact Zane Thomas.  He can be reached at:

Zane Thomas

Post Office Box 300

Indianola, WA  98342

CompuServe: 72060,3327