AVAX-software.com Forums: Selecting Object, no resize - AVAX-software.com Forums

Jump to content

Page 1 of 1

Selecting Object, no resize

#1 User is offline   Martijn Huinink Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 01-October 07
  • Interests:computer programming with Visual Studio .NET

Posted 01 October 2007 - 07:56 PM

hi,

First off all i draw a rectangle in a avax-component. Then when i select it, it draws a rectangular box around it , wich makes it posible to resize the rectangle. But thats just what i'am trying to prevent. So the user can move the rectangle around, but is not alowed to resize it. Can i set somekind off propety to prevent this ?


Thank you very much for your reply.

Greetings From Holland,

Martijn Huinink.

#2 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 02 October 2007 - 09:16 AM

Here it is an example written in VB6 on how to handle the stretch and move behavior of an object.

Option Explicit

Dim h As Long

Private Sub cAvax1_SelectRegionStretch(StretchHandles() As Long, xOldMin As Single, yOldMin As Single, xOldMax As Single, yOldMax As Single, xNewMin As Single, yNewMin As Single, xNewMax As Single, yNewMax As Single, fCancel As Boolean)
	Dim lCnt As Long, lMax As Long
	Const NumDigitsAfterDecimal As Long = 5
	If Round(Abs(xOldMax - xOldMin), NumDigitsAfterDecimal) = Round(Abs(xNewMax - xNewMin), NumDigitsAfterDecimal) And Round(Abs(yOldMax - yOldMin), NumDigitsAfterDecimal) = Round(Abs(yNewMax - yNewMin), NumDigitsAfterDecimal) Then
	   'Moving objects
	   Exit Sub
	End If
	lMax = UBound(StretchHandles())
	For lCnt = 1 To lMax
		If StretchHandles(lCnt) = h Then
		   fCancel = True
		   Exit Sub
		End If
	Next lCnt
End Sub

Private Sub Form_Load()
	Call cAvax1.StartAvax
	h = cAvax1.Add_Rectangle(0, 0, 10, 10, , cAvax1.NearestPaletteIndexColor(vbRed)) 'Not free to stretch
	Call cAvax1.Add_Rectangle(15, 0, 10, 10, , cAvax1.NearestPaletteIndexColor(vbGreen))  'Free to stretch
End Sub

Private Sub Form_Unload(Cancel As Integer)
	Call cAvax1.EndAvax
End Sub

Athanasios Gardos
Avax-Software.com

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users