PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
WD The Drawing functions - Funções de desenho
Published by Boller
in the category Tools
New features



Description
WD The Drawing functions - Funções de desenho

// Summary: Changes the drawing tool
// Syntax:
//ToolSelection (<nTool> is int)
//
// Parameters:
// nTool (integer): New drawing tool
// Return value:
// None
//
PROCEDURE ToolSelection(LOCAL nTool is int)

// Keeps the tool
gnTOOL = nTool

BTN_DRAWING_DOT..Pushed = False
BTN_DRAWING_LINE..Pushed = False
BTN_DRAWING_SOLID..Pushed = False
BTN_DRAWING_RECTANGLE..Pushed = False
BTN_DRAWING_POLYGON..Pushed = False
BTN_DRAWING_FILLING..Pushed = False
BTN_DRAWING_CIRCLE..Pushed = False
BTN_DRAWING_SECTION..Pushed = False
BTN_DRAWING_ARC..Pushed = False
BTN_DRAWING_CHORD..Pushed = False
BTN_DRAWING_TEXT..Pushed = False

// Enables the tool button
SWITCH nTool

CASE DRAWING_DOT
BTN_DRAWING_DOT..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Disables the anti-aliasing
dChangeMode(drawDefault)
Message(Replace(BTN_DRAWING_DOT..ToolTip, CR, " - "))

CASE DRAWING_LINE
BTN_DRAWING_LINE..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_LINE..ToolTip, CR, " - "))

CASE DRAWING_SOLID
BTN_DRAWING_SOLID..Pushed = True
IMG_DRAWING..MouseCursor = curCustomPen
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_SOLID..ToolTip, CR, " - "))


CASE DRAWING_RECTANGLE
BTN_DRAWING_RECTANGLE..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Active
COMBO_GRADIENTBCKGRDCOLOREND..State = Active
CBOX_GRADIENTBCKGRD..State = Active

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_RECTANGLE..ToolTip, CR, " - "))


CASE DRAWING_POLYGON
BTN_DRAWING_POLYGON..Pushed = True
IMG_DRAWING..MouseCursor = curCustomPen
COMBO_BACKGROUNDCOLOR..State = Active
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_POLYGON..ToolTip, CR, " - "))


CASE DRAWING_FILLING
BTN_DRAWING_FILLING..Pushed = True
IMG_DRAWING..MouseCursor = curCustomBrush
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_FILLING..ToolTip, CR, " - "))

CASE DRAWING_CIRCLE
BTN_DRAWING_CIRCLE..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Active
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_CIRCLE..ToolTip, CR, " - "))


CASE DRAWING_SECTION
BTN_DRAWING_SECTION..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Active
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_SECTION..ToolTip, CR, " - "))


CASE DRAWING_ARC
BTN_DRAWING_ARC..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_ARC..ToolTip, CR, " - "))


CASE DRAWING_CHORD
BTN_DRAWING_CHORD..Pushed = True
IMG_DRAWING..MouseCursor = curCustomCross
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Disables the anti-aliasing
dChangeMode(drawDefault)
Message(Replace(BTN_DRAWING_CHORD..ToolTip, CR, " - "))


CASE DRAWING_TEXT
BTN_DRAWING_TEXT..Pushed = True
IMG_DRAWING..MouseCursor = curIbeam
COMBO_BACKGROUNDCOLOR..State = Grayed
COMBO_GRADIENTBCKGRDCOLOREND..State = Grayed
CBOX_GRADIENTBCKGRD..State = Grayed

// Enables the anti-aliasing
IF gbGDIPLUS THEN dChangeMode(drawAntiAliasing)
Message(Replace(BTN_DRAWING_TEXT..ToolTip, CR, " - "))

OTHER CASE
// This tool is unknown, go back to the 'Dot' tool
ToolSelection(DRAWING_DOT)

END

Illustrations, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
No review or comment? Be the first one!