Click here to Skip to main content
15,897,182 members
Articles / Programming Languages / Visual Basic

Mathemathics Framework

Rate me:
Please Sign up or sign in to vote.
4.76/5 (56 votes)
16 Sep 2008CPOL6 min read 75.5K   6.2K   171  
.NET Mathematical Framework
Imports System.Windows.Forms
Imports System.Drawing
Imports System.ComponentModel

<DesignTimeVisible(False), CLSCompliant(True)> _
Public MustInherit Class BVToolBarObjectBase
    Inherits System.ComponentModel.Component

    Protected intName As String
    Protected intEnabled As Boolean
    Protected intRec As Rectangle
    Protected WithEvents intParent As BVToolBar
    Protected intVisible As Boolean

    Protected intBrush As SolidBrush

    Public Event VisibilityChange(ByVal sender As Object, ByVal e As EventArgs)


    Public Sub New()
        'Me.Name = "BVToolBarButton" & Rnd().ToString
        Initialize()
    End Sub

    Public Sub New(ByVal Name As String)
        MyBase.New()
        Me.Name = Name
        Initialize()
    End Sub

    Protected Overridable Sub Initialize()
        Me.intName = intName
        intEnabled = True

        intRec = New Rectangle(0, 0, 30, 30)
        intBrush = New SolidBrush(Color.Gray)
    End Sub

#Region "Properties"

    Public Property Name() As String
        Get
            Return Me.intName
        End Get
        Set(ByVal Value As String)
            intName = Value
        End Set
    End Property

    Public Property Enabled() As Boolean
        Get
            Return intEnabled
        End Get
        Set(ByVal Value As Boolean)
            If intEnabled <> Value Then
                intEnabled = Value
                If Not Me.intParent Is Nothing Then
                    Me.intParent.Refresh()
                End If
            End If
        End Set
    End Property

    <Browsable(False)> _
    Public Overridable Property Parent() As BVToolBar
        Get
            Return intParent
        End Get
        Set(ByVal Value As BVToolBar)
            If Not intParent Is Nothing Then
                If intParent Is Value Then
                    intParent.Bands.Remove(Me) 'un botton o banda solo tiene un parent  Value
                End If
            End If
            intParent = Value
        End Set
    End Property

    <Browsable(False)> _
    Public Overridable Property Rectangle() As System.Drawing.Rectangle
        Get
            Return Me.intRec
        End Get
        Set(ByVal Value As System.Drawing.Rectangle)
            Me.intRec = Value
        End Set
    End Property

    <Browsable(False)> _
    Public Overridable Property Location() As Point
        Get
            Return Me.intRec.Location
        End Get
        Set(ByVal Value As Point)
            Me.intRec.Location = Value
            'Me.UpdateButtons()
        End Set
    End Property

    <Browsable(False)> _
    Public Overridable Property Size() As Size
        Get
            Return Me.intRec.Size
        End Get
        Set(ByVal Value As Size)
            Me.intRec.Size = Value
            'Me.UpdateButtons()
        End Set
    End Property

    Public Overridable Property Visible() As Boolean
        Get
            Return intVisible
        End Get
        Set(ByVal Value As Boolean)
            If intVisible <> Value Then
                intVisible = Value
                RaiseEvent VisibilityChange(Me, New EventArgs)
            End If
        End Set
    End Property

#End Region

    Public MustOverride Sub Redraw(ByVal sender As Object, ByVal P As PaintEventArgs)

    Protected Overridable Sub OnVisibilityChange(ByVal sender As Object, ByVal e As EventArgs)
        RaiseEvent VisibilityChange(sender, e)
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer Universidad Tecnológica Nacional
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions