TEXT 93, 10, 181, 20, .Text1, "Welcome to the Corel Automatic Guidelines Wizard."
TEXT 94, 70, 187, 18, .Text3, "To begin creating guidelines, click Next."
IMAGE 10, 10, 75, 130, .IntroImage
GROUPBOX 10, 150, 270, 5, .LineGroupBox
TEXT 93, 28, 185, 33, .Text4, "This wizard will guide you through the steps necessary to automatically set up guidelines on your page. You can easily create precise margins, columns, grids, or cross-hairs."
END DIALOG
SUB IntroDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
IF Event% = EVENT_INITIALIZATION THEN
IntroDialog.BackButton.Enable FALSE
ENDIF
IF Event% = EVENT_MOUSE_CLICK THEN ' Mouse click event.
TEXT 93, 10, 181, 20, .Text1, "There are already some guidelines on the current page."
IMAGE 10, 10, 75, 130, .RemoveImage
GROUPBOX 10, 150, 270, 5, .LineGroupBox
TEXT 93, 28, 185, 33, .Text4, "This wizard can remove all of your existing guidelines before it creates any new ones. If you prefer, it can also leave your guidelines intact and just add new ones."
GROUPBOX 94, 62, 177, 54, .GroupBox2, "What do you want the wizard to do?"
TEXT 92, 43, 181, 27, .Text1, "If you prefer, you can also select from a list of pre-configured guideline styles that you do not need to customize."
IMAGE 10, 10, 75, 130, .StyleImage
GROUPBOX 10, 150, 270, 5, .LineGroupBox
GROUPBOX 94, 76, 177, 53, .GroupBox2, "What do you want to do?"
TEXT 92, 10, 181, 27, .Text2, "You can select a guideline type and then customize it. For example, if you choose to create margin guidelines, you will be asked what size of margins to create."
OPTIONGROUP .OptionGroup1Val%
OPTIONBUTTON 109, 105, 139, 12, .PresetOption, "Choose a preset"
TEXT 93, 10, 181, 10, .AngleText, "If you wish, you can generate a rotated "
TEXT 93, 27, 35, 11, .Text1, "Rotate by:"
TEXT 96, 51, 180, 27, .SpokesText1, "You can also choose the number of lines through each of your cross-hairs. The default will give you a simple cross, while larger numbers will give you a starburst effect."
TEXT 96, 84, 79, 12, .SpokesText2, "Number of lines:"
SPINCONTROL 152, 83, 27, 13, .SpokesSpin
END DIALOG
SUB AngleDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
DIM MsgReturn AS LONG ' The return value of MESSAGEBOX calls.
IF Event% = EVENT_INITIALIZATION THEN
' Depending on the type of guidelines being generated, update
' the AngleText.
SELECT CASE ChoiceNum%
CASE GW_TYPE_GRID%
AngleDialog.AngleText.SetText \\
"If you wish, you can generate a rotated grid."
AngleDialog.SpokesText1.SetStyle STYLE_INVISIBLE
AngleDialog.SpokesText2.SetStyle STYLE_INVISIBLE
AngleDialog.SpokesSpin.SetStyle STYLE_INVISIBLE
CASE GW_TYPE_CROSS%
AngleDialog.AngleText.SetText \\
"If you wish, you can generate a rotated set of cross-hairs."
AngleDialog.SpokesText1.SetStyle STYLE_VISIBLE
AngleDialog.SpokesText2.SetStyle STYLE_VISIBLE
AngleDialog.SpokesSpin.SetStyle STYLE_VISIBLE
END SELECT
' Update the angle spin control.
AngleDialog.AngleSpin.SetValue ChosenAngle%
' Update the spokes control.
AngleDialog.SpokesSpin.SetValue NumSpokes%
ENDIF
IF Event% = EVENT_MOUSE_CLICK THEN ' Mouse click event.
SELECT CASE ControlID%
CASE AngleDialog.AngleSpin.GetID()
ChosenAngle% = AngleDialog.AngleSpin.GetValue()
CASE AngleDialog.NextButton.GetID()
LastPageX& = AngleDialog.GetLeftPosition()
LastPageY& = AngleDialog.GetTopPosition()
AngleDialog.CloseDialog DIALOG_RETURN_NEXT%
CASE AngleDialog.BackButton.GetID()
LastPageX& = AngleDialog.GetLeftPosition()
LastPageY& = AngleDialog.GetTopPosition()
AngleDialog.CloseDialog DIALOG_RETURN_BACK%
CASE AngleDialog.CancelButton.GetID()
AngleDialog.CloseDialog DIALOG_RETURN_CANCEL%
END SELECT
ENDIF
IF Event% = EVENT_CHANGE_IN_CONTENT& THEN
SELECT CASE ControlID%
CASE AngleDialog.AngleSpin.GetID()
IF AngleDialog.AngleSpin.GetValue() < -180 THEN
MsgReturn& = MESSAGEBOX("Please select an angle between -180 and 180 degrees.", \\
TITLE_INFOBOX$, MB_INFORMATION_ICON&)
ChosenAngle% = -180
AngleDialog.AngleSpin.SetValue ChosenAngle%
ELSEIF AngleDialog.AngleSpin.GetValue() > 180 THEN
MsgReturn& = MESSAGEBOX("Please select an angle between -180 and 180 degrees.", \\
TITLE_INFOBOX$, MB_INFORMATION_ICON&)
ChosenAngle% = 180
AngleDialog.AngleSpin.SetValue ChosenAngle%
ELSE
ChosenAngle% = AngleDialog.AngleSpin.GetValue()
ENDIF
CASE AngleDialog.SpokesSpin.GetID()
IF AngleDialog.SpokesSpin.GetValue() < 2 THEN
MsgReturn& = MESSAGEBOX("Please select a number of spokes between 2 and 30.", \\
TITLE_INFOBOX$, MB_INFORMATION_ICON&)
NumSpokes% = 2
AngleDialog.SpokesSpin.SetValue NumSpokes%
ELSEIF AngleDialog.SpokesSpin.GetValue() > 30 THEN
MsgReturn& = MESSAGEBOX("Please select a number of spokes between 2 and 30.", \\
TEXT 93, 10, 181, 28, .AngleText, "By default, the Automatic Guidelines Wizard will center your cross-hairs on the page. If you want, you can change the center of the effect."
GROUPBOX 102, 43, 165, 59, .GroupBox2, "Move the effect"
SPINCONTROL 116, 59, 34, 13, .HorizSpin
DDLISTBOX 160, 59, 55, 64, .HorizListbox
SPINCONTROL 116, 78, 34, 13, .VertSpin
DDLISTBOX 160, 78, 55, 64, .VertListbox
TEXT 153, 80, 5, 10, .TextX2, "x"
TEXT 153, 60, 5, 10, .TextX1, "x"
TEXT 220, 79, 40, 11, .Text6, "vertically"
TEXT 220, 61, 40, 11, .Text7, "horizontally"
END DIALOG
SUB CenterCrossDialogEventHandler(BYVAL ControlID%, BYVAL Event%)