VERSION 5.00
Begin VB.UserControl QuickMenu 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   930
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   1560
   InvisibleAtRuntime=   -1  'True
   ScaleHeight     =   930
   ScaleWidth      =   1560
End
Attribute VB_Name = "QuickMenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'Default Property Values:
Const m_def_UseVersion = 0
Const m_def_LastIsESC = 0
Const m_def_CenterForm = 0
Const m_def_Caption = ""
Const m_def_CaptionColor1 = 0
Const m_def_CaptionColor2 = 0
Const m_def_TopicFinalColor = 0
'Event Declarations:
Event ItemClick(Index As Integer)

Public Function WaitResults() As Boolean
Dim M As Integer

    Do
    M = DynaMenu.GetResult
    
        If M <> 0 Then
        RaiseEvent ItemClick(M)
        End If
        
    DoEvents
    Loop

End Function
'Property Variables:
Private Sub UserControl_Initialize()
End Sub
Public Function AddTopic(ByVal TopicName As String, Optional UseSpace As Boolean = True) As Boolean
Attribute AddTopic.VB_Description = "Adds a topic to the menu."
DynaMenu.AddTopic TopicName, UseSpace
End Function

Public Function AddItem(ByVal Text As String, Optional Code As Variant) As Boolean
Attribute AddItem.VB_Description = "Adds a item to the menu."
DynaMenu.AddItem Text, Code
End Function

Public Property Get UseVersion() As Boolean
End Property
Public Property Let UseVersion(ByVal New_UseVersion As Boolean)
    DynaMenu.UseVersion = New_UseVersion
    PropertyChanged "UseVersion"
End Property

Public Property Get LastIsESC() As Boolean
    LastIsESC = DynaMenu.LastIsESC
End Property
Public Property Let LastIsESC(ByVal New_LastIsESC As Boolean)
    DynaMenu.LastIsESC = New_LastIsESC
    PropertyChanged "LastIsESC"
End Property

Public Property Get CenterForm() As Boolean
    CenterForm = DynaMenu.CenterForm
End Property

Public Property Let CenterForm(ByVal New_CenterForm As Boolean)
    DynaMenu.CenterForm = New_CenterForm
    PropertyChanged "CenterForm"
End Property

Public Property Get Caption() As String
    Caption = DynaMenu.rotCaption.Caption
End Property

Public Property Let Caption(ByVal New_Caption As String)
    DynaMenu.rotCaption.Caption = New_Caption
    PropertyChanged "Caption"
End Property

Public Property Get CaptionColor1() As OLE_COLOR
    CaptionColor1 = DynaMenu.rotCaption.DegradeeColor
End Property
Public Property Let CaptionColor1(ByVal New_CaptionColor1 As OLE_COLOR)
    DynaMenu.rotCaption.DegradeeColor = New_CaptionColor1
    PropertyChanged "CaptionColor1"
End Property

Public Property Get CaptionColor2() As OLE_COLOR
    CaptionColor2 = DynaMenu.rotCaption.DegradeeInit
End Property
Public Property Let CaptionColor2(ByVal New_CaptionColor2 As OLE_COLOR)
    DynaMenu.rotCaption.DegradeeInit = New_CaptionColor2
    PropertyChanged "CaptionColor2"
End Property

Public Property Get TopicFinalColor() As OLE_COLOR
    TopicFinalColor = DynaMenu.TopicLabel(0).DegradeeColor
End Property
Public Property Let TopicFinalColor(ByVal New_TopicFinalColor As OLE_COLOR)
    DynaMenu.TopicLabel(0).DegradeeColor = New_TopicFinalColor
    PropertyChanged "TopicFinalColor"
End Property

Public Function AdjustSizes() As Boolean
DynaMenu.Visible = True
DynaMenu.AdjustSizes
End Function

'Initialize Properties for User Control
Private Sub UserControl_InitProperties()
End Sub
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

    DynaMenu.UseVersion = PropBag.ReadProperty("UseVersion", m_def_UseVersion)
    DynaMenu.LastIsESC = PropBag.ReadProperty("LastIsESC", m_def_LastIsESC)
    DynaMenu.CenterForm = PropBag.ReadProperty("CenterForm", m_def_CenterForm)
    DynaMenu.rotCaption.Caption = PropBag.ReadProperty("Caption", m_def_Caption)
    DynaMenu.rotCaption.DegradeeColor = PropBag.ReadProperty("CaptionColor1", m_def_CaptionColor1)
    DynaMenu.rotCaption.DegradeeInit = PropBag.ReadProperty("CaptionColor2", m_def_CaptionColor2)
    DynaMenu.TopicLabel(0).DegradeeColor = PropBag.ReadProperty("TopicFinalColor", m_def_TopicFinalColor)
End Sub

Private Sub UserControl_Terminate()
Unload DynaMenu
End Sub

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

    Call PropBag.WriteProperty("UseVersion", DynaMenu.UseVersion, m_def_UseVersion)
    Call PropBag.WriteProperty("LastIsESC", DynaMenu.LastIsESC, m_def_LastIsESC)
    Call PropBag.WriteProperty("CenterForm", DynaMenu.CenterForm, m_def_CenterForm)
    Call PropBag.WriteProperty("Caption", DynaMenu.rotCaption.Caption, m_def_Caption)
    Call PropBag.WriteProperty("CaptionColor1", DynaMenu.rotCaption.DegradeeColor, m_def_CaptionColor1)
    Call PropBag.WriteProperty("CaptionColor2", DynaMenu.rotCaption.DegradeeInit, m_def_CaptionColor2)
    Call PropBag.WriteProperty("TopicFinalColor", DynaMenu.TopicLabel(0).DegradeeColor, m_def_TopicFinalColor)
End Sub
