home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / DEMOS / STAT_BAR / MAIN.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-01-16  |  6.8 KB  |  221 lines

  1. VERSION 2.00
  2. Begin MDIForm fmMain 
  3.    Caption         =   "Stbar Example Main Form"
  4.    Height          =   4935
  5.    Left            =   1755
  6.    LinkTopic       =   "MDIForm1"
  7.    Top             =   1755
  8.    Width           =   7485
  9.    Begin PictureBox piStBar 
  10.       Align           =   2  'Align Bottom
  11.       BorderStyle     =   0  'None
  12.       Height          =   615
  13.       Left            =   0
  14.       ScaleHeight     =   615
  15.       ScaleWidth      =   7365
  16.       TabIndex        =   0
  17.       Top             =   3630
  18.       Width           =   7365
  19.       Begin StBar sbEnd 
  20.          Prop21          =   -1
  21.          Prop22          =   6
  22.          BackColor       =   &H00C0C0C0&
  23.          DrawMode        =   1  'Flat
  24.          FontBold        =   0   'False
  25.          FontItalic      =   0   'False
  26.          FontName        =   "MS Sans Serif"
  27.          FontSize        =   8.25
  28.          FontStrikethru  =   0   'False
  29.          FontUnderline   =   0   'False
  30.          Height          =   345
  31.          Indicator       =   0  'None
  32.          Left            =   7650
  33.          Top             =   270
  34.          Width           =   855
  35.       End
  36.       Begin StBar sbEdit 
  37.          Prop21          =   -1
  38.          Prop22          =   5
  39.          BackColor       =   &H00C0C0C0&
  40.          Caption         =   "EINF"
  41.          DrawMode        =   0  'Down
  42.          FontBold        =   0   'False
  43.          FontItalic      =   0   'False
  44.          FontName        =   "MS Sans Serif"
  45.          FontSize        =   8.25
  46.          FontStrikethru  =   0   'False
  47.          FontUnderline   =   0   'False
  48.          Height          =   345
  49.          Indicator       =   4  'EditMode
  50.          Left            =   7020
  51.          Top             =   270
  52.          Width           =   630
  53.       End
  54.       Begin StBar sbScroll 
  55.          Prop21          =   -1
  56.          Prop22          =   4
  57.          BackColor       =   &H00C0C0C0&
  58.          DrawMode        =   0  'Down
  59.          FontBold        =   0   'False
  60.          FontItalic      =   0   'False
  61.          FontName        =   "MS Sans Serif"
  62.          FontSize        =   8.25
  63.          FontStrikethru  =   0   'False
  64.          FontUnderline   =   0   'False
  65.          Height          =   345
  66.          Indicator       =   3  'Scroll
  67.          Left            =   6390
  68.          Top             =   270
  69.          Width           =   630
  70.       End
  71.       Begin StBar sbCaps 
  72.          Prop21          =   -1
  73.          Prop22          =   3
  74.          BackColor       =   &H00C0C0C0&
  75.          DrawMode        =   0  'Down
  76.          FontBold        =   0   'False
  77.          FontItalic      =   0   'False
  78.          FontName        =   "MS Sans Serif"
  79.          FontSize        =   8.25
  80.          FontStrikethru  =   0   'False
  81.          FontUnderline   =   0   'False
  82.          Height          =   345
  83.          Indicator       =   2  'Caps
  84.          Left            =   5760
  85.          Top             =   270
  86.          Width           =   630
  87.       End
  88.       Begin StBar sbNum 
  89.          Prop21          =   -1
  90.          Prop22          =   2
  91.          BackColor       =   &H00C0C0C0&
  92.          DrawMode        =   0  'Down
  93.          FontBold        =   0   'False
  94.          FontItalic      =   0   'False
  95.          FontName        =   "MS Sans Serif"
  96.          FontSize        =   8.25
  97.          FontStrikethru  =   0   'False
  98.          FontUnderline   =   0   'False
  99.          Height          =   345
  100.          Indicator       =   1  'Num
  101.          Left            =   5130
  102.          Top             =   270
  103.          Width           =   630
  104.       End
  105.       Begin StBar sbMain 
  106.          Prop21          =   -1
  107.          Prop22          =   1
  108.          BackColor       =   &H00C0C0C0&
  109.          DrawMode        =   0  'Down
  110.          FontBold        =   0   'False
  111.          FontItalic      =   0   'False
  112.          FontName        =   "MS Sans Serif"
  113.          FontSize        =   8.25
  114.          FontStrikethru  =   0   'False
  115.          FontUnderline   =   0   'False
  116.          Height          =   345
  117.          Indicator       =   0  'None
  118.          Left            =   0
  119.          Top             =   270
  120.          Width           =   5130
  121.       End
  122.    End
  123.    Begin Menu muMenu1 
  124.       Caption         =   "Menu 1"
  125.       Begin Menu muItem11 
  126.          Caption         =   "Item 1_1"
  127.       End
  128.       Begin Menu muItem12 
  129.          Caption         =   "Item 1_2"
  130.       End
  131.    End
  132.    Begin Menu muMenu2 
  133.       Caption         =   "Menu 2"
  134.    End
  135.    Begin Menu muWindow 
  136.       Caption         =   "Window"
  137.       WindowList      =   -1  'True
  138.       Begin Menu muWindowOpen 
  139.          Caption         =   "Open Child"
  140.       End
  141.       Begin Menu muWindowClose 
  142.          Caption         =   "Close Child"
  143.       End
  144.    End
  145. Option Explicit
  146. Sub MDIForm_Load ()
  147.     piStBar.Height = sbMain.Height
  148.     muMenu1.Tag = "Menu1.Tag"
  149.     muMenu2.Tag = "Menu2.Tag"
  150.     muItem11.Tag = "Item_1_1.Tag"
  151.     muItem12.Tag = "Item_1_2.Tag"
  152.     muWindow.Tag = "Open, Close, Select MDI child windows"
  153.     muWindowOpen.Tag = "Opens a new document window"
  154.     muWindowClose.Tag = "Close the active child"
  155. End Sub
  156. Sub muWindow_Click ()
  157.     If Forms.Count > 1 Then
  158.     muWindowClose.Enabled = True
  159.     Else
  160.     muWindowClose.Enabled = False
  161.     End If
  162. End Sub
  163. Sub muWindowClose_Click ()
  164.     Unload fmMain.ActiveForm
  165. End Sub
  166. Sub muWindowOpen_Click ()
  167.     Dim fmNew As New fmChild
  168.     fmNew.Show
  169. End Sub
  170. Sub sbMain_MenuSelect (Closing As Integer, MenuCaption As String)
  171.     If Closing <> 0 Then
  172.     Caption = "StBar Example  Main Form"
  173.     sbMain.Caption = ""
  174.     Else
  175.     Caption = "Menu Caption: " + MenuCaption
  176.     End If
  177. End Sub
  178. Sub sbMain_SelectedTag (hWndForm As Integer, MenuTag As String)
  179.     Dim sText As String
  180.     Dim iChildMenu As Integer
  181.     ' determine, if system menu of MDI child has been selected
  182.     If hWndForm = fmMain.hWnd Then
  183.     iChildMenu = False
  184.     Else
  185.     iChildMenu = True
  186.     End If
  187.     Select Case MenuTag
  188.     Case "SYS_SIZE"
  189.         sText = "Changes the window size"
  190.     Case "SYS_MOVE"
  191.         sText = "Changes the window position"
  192.     Case "SYS_MINIMIZE"
  193.         sText = "Reduces the window to an icon"
  194.     Case "SYS_MAXIMIZE"
  195.         sText = "Enlarges the window to full size"
  196.     Case "SYS_RESTORE"
  197.         sText = "Restores the window to normal size"
  198.     Case "SYS_TASKLIST"
  199.         sText = "Opens the task list"
  200.     Case "SYS_NEXT"
  201.         sText = "Switches to next window"
  202.     Case "SYS_SWITCH"
  203.         sText = "Switches to the selected document window"
  204.     Case "SYS_POPUP"
  205.         If iChildMenu Then
  206.         sText = "Move, size or close active window"
  207.         Else
  208.         sText = "Move, size or close application window"
  209.         End If
  210.     Case "SYS_CLOSE"
  211.         If iChildMenu Then
  212.         sText = "Closes the active window"
  213.         Else
  214.         sText = "Quits VSQLTool"
  215.         End If
  216.     Case Else
  217.         sText = MenuTag
  218.     End Select
  219.     sbMain.Caption = sText
  220. End Sub
  221.