home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VB / UNSUPPRT / CALENDAR / APPEAR.PAG (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-16  |  12.4 KB  |  324 lines

  1. VERSION 5.00
  2. Begin VB.PropertyPage ppAppearance 
  3.    Caption         =   "Appearance"
  4.    ClientHeight    =   3405
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   6375
  8.    LockControls    =   -1  'True
  9.    PaletteMode     =   0  'Halftone
  10.    ScaleHeight     =   3405
  11.    ScaleWidth      =   6375
  12.    Begin VB.Frame Frames 
  13.       Caption         =   "Days of Week"
  14.       Height          =   1695
  15.       Index           =   0
  16.       Left            =   120
  17.       TabIndex        =   4
  18.       Top             =   1560
  19.       Width           =   2355
  20.       Begin VB.ComboBox cbxStartOfWeek 
  21.          Height          =   315
  22.          Left            =   120
  23.          Style           =   2  'Dropdown List
  24.          TabIndex        =   8
  25.          Top             =   1260
  26.          Width           =   2115
  27.       End
  28.       Begin VB.ComboBox cbxDayFormat 
  29.          Height          =   315
  30.          ItemData        =   "Appear.pgx":0000
  31.          Left            =   120
  32.          List            =   "Appear.pgx":000D
  33.          Style           =   2  'Dropdown List
  34.          TabIndex        =   6
  35.          Top             =   540
  36.          Width           =   2115
  37.       End
  38.       Begin VB.Label Labels 
  39.          AutoSize        =   -1  'True
  40.          Caption         =   "Start Of Week:"
  41.          Height          =   195
  42.          Index           =   0
  43.          Left            =   120
  44.          TabIndex        =   7
  45.          Top             =   1020
  46.          Width           =   1065
  47.       End
  48.       Begin VB.Label Labels 
  49.          AutoSize        =   -1  'True
  50.          Caption         =   "Day Name Format:"
  51.          Height          =   195
  52.          Index           =   1
  53.          Left            =   120
  54.          TabIndex        =   5
  55.          Top             =   300
  56.          Width           =   1320
  57.       End
  58.    End
  59.    Begin VB.Frame Frames 
  60.       Caption         =   "Preview"
  61.       Height          =   3135
  62.       Index           =   2
  63.       Left            =   2640
  64.       TabIndex        =   9
  65.       Top             =   120
  66.       Width           =   3615
  67.       Begin MSVBCalendar.Calendar calPreview 
  68.          Height          =   2775
  69.          Left            =   240
  70.          TabIndex        =   10
  71.          Top             =   240
  72.          Width           =   3255
  73.          _ExtentX        =   5741
  74.          _ExtentY        =   4895
  75.          Day             =   12
  76.          Month           =   9
  77.          Year            =   1996
  78.          BeginProperty DayNameFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  79.             Name            =   "MS Sans Serif"
  80.             Size            =   8.25
  81.             Charset         =   0
  82.             Weight          =   700
  83.             Underline       =   0   'False
  84.             Italic          =   0   'False
  85.             Strikethrough   =   0   'False
  86.          EndProperty
  87.          BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  88.             Name            =   "MS Sans Serif"
  89.             Size            =   8.25
  90.             Charset         =   0
  91.             Weight          =   400
  92.             Underline       =   0   'False
  93.             Italic          =   0   'False
  94.             Strikethrough   =   0   'False
  95.          EndProperty
  96.          Locked          =   -1  'True
  97.       End
  98.    End
  99.    Begin VB.Frame Frames 
  100.       Caption         =   "Navigation"
  101.       Height          =   1335
  102.       Index           =   1
  103.       Left            =   120
  104.       TabIndex        =   0
  105.       Top             =   120
  106.       Width           =   2355
  107.       Begin VB.CheckBox chkShowIterration 
  108.          Caption         =   "Show Iterration Buttons"
  109.          Height          =   195
  110.          Left            =   180
  111.          TabIndex        =   3
  112.          Top             =   960
  113.          Width           =   1995
  114.       End
  115.       Begin VB.CheckBox chkYearRO 
  116.          Caption         =   "Year Read-Only"
  117.          Height          =   195
  118.          Left            =   180
  119.          TabIndex        =   2
  120.          Top             =   630
  121.          Width           =   1695
  122.       End
  123.       Begin VB.CheckBox chkMonthRO 
  124.          Caption         =   "Month Read-Only"
  125.          Height          =   195
  126.          Left            =   180
  127.          TabIndex        =   1
  128.          Top             =   300
  129.          Width           =   1695
  130.       End
  131.    End
  132. Attribute VB_Name = "ppAppearance"
  133. Attribute VB_GlobalNameSpace = False
  134. Attribute VB_Creatable = True
  135. Attribute VB_PredeclaredId = False
  136. Attribute VB_Exposed = True
  137. '----------------------------------------------------------------------
  138. ' Appearance.pag
  139. '----------------------------------------------------------------------
  140. ' Implementation file for the appearance property page
  141. ' for the VB calendar control.
  142. '----------------------------------------------------------------------
  143. ' Copyright (c) 1996, Microsoft Corporation
  144. '              All Rights Reserved
  145. ' Information Contained Herin is Proprietary and Confidential
  146. '----------------------------------------------------------------------
  147. Option Explicit
  148. '======================================================================
  149. ' Private Data Members
  150. '======================================================================
  151. '======================================================================
  152. ' Private Event Handles
  153. '======================================================================
  154. '----------------------------------------------------------------------
  155. ' SelectionChanged Event
  156. '----------------------------------------------------------------------
  157. ' Purpose:  Called when the selected controls are changed
  158. '           set all controls to reflect property settings
  159. '           of the selected control(s)
  160. ' Inputs:   None
  161. ' Outputs:  None
  162. '----------------------------------------------------------------------
  163. Private Sub PropertyPage_SelectionChanged()
  164.     Dim cal As Calendar     'reference to selected ctl
  165.     Dim ctl As Control
  166.     If PropertyPage.SelectedControls.Count = 0 Then
  167.         'daveste -- 8/16/96
  168.         'REVIEW:
  169.         'what the heck do we do here?
  170.     Else
  171.         'get the first selected control (might be the only)
  172.         Set cal = PropertyPage.SelectedControls(0)
  173.         
  174.         'load the start of week combo
  175.         LoadStartOfWeekCombo
  176.         
  177.         'set the control's values according to current
  178.         'property settings
  179.         chkMonthRO.Value = Abs(cal.MonthReadOnly)
  180.         chkYearRO.Value = Abs(cal.YearReadOnly)
  181.         chkShowIterration.Value = Abs(cal.ShowIterrationButtons)
  182.         
  183.         calPreview.MonthReadOnly = cal.MonthReadOnly
  184.         calPreview.YearReadOnly = cal.YearReadOnly
  185.         calPreview.ShowIterrationButtons = cal.ShowIterrationButtons
  186.         
  187.         cbxDayFormat.ListIndex = cal.DayNameFormat
  188.         cbxStartOfWeek.ListIndex = cal.StartOfWeek
  189.         
  190.         'setting list index on the combos triggers the
  191.         'Click event so we don't need to set the
  192.         'preview's props since they will be set in the
  193.         'click events themselves
  194.             
  195.         'reset the control's data changed state
  196.         'so they are clean
  197.         On Error Resume Next
  198.         For Each ctl In PropertyPage.Controls
  199.             ctl.datachange = False
  200.         Next
  201.         'initialize the page's change flag to false
  202.         PropertyPage.Changed = False
  203.         
  204.     End If 'no controls selected
  205. End Sub 'PropertyPage_Load()
  206. '----------------------------------------------------------------------
  207. ' ApplyChanges Event
  208. '----------------------------------------------------------------------
  209. ' Purpose:  Called when the user applies changes to the property
  210. '           settings.  Set properties of the selected control(s)
  211. ' Inputs:   None
  212. ' Outputs:  None
  213. '----------------------------------------------------------------------
  214. Private Sub PropertyPage_ApplyChanges()
  215.     Dim cal As Calendar
  216.     'get the control to set properties on
  217.     Set cal = PropertyPage.SelectedControls(0)
  218.     'set the properties if they've changed
  219.     If chkMonthRO.DataChanged Then
  220.         cal.MonthReadOnly = CBool(chkMonthRO.Value)
  221.     End If
  222.     If chkYearRO.DataChanged Then
  223.         cal.YearReadOnly = CBool(chkYearRO.Value)
  224.     End If
  225.     If chkShowIterration.DataChanged Then
  226.         cal.ShowIterrationButtons = CBool(chkShowIterration.Value)
  227.     End If
  228.     If cbxDayFormat.DataChanged Then
  229.         cal.DayNameFormat = cbxDayFormat.ListIndex
  230.     End If
  231.     If cbxStartOfWeek.DataChanged Then
  232.         cal.StartOfWeek = cbxStartOfWeek.ListIndex
  233.     End If
  234. End Sub 'PropertyPage_ApplyChanges()
  235. '----------------------------------------------------------------------
  236. ' LoadStartOfWeekCombo()
  237. '----------------------------------------------------------------------
  238. ' Purpose:  Loads the start of week combo box with the names of the
  239. '           week days in the local language
  240. ' Inputs:   None
  241. ' Outputs:  None
  242. '----------------------------------------------------------------------
  243. Private Sub LoadStartOfWeekCombo()
  244.     Dim nDay As Long
  245.     'add the "use system" option first
  246.     'daveste -- 8/16/96
  247.     'TODO: Add code for getting this out of the string table
  248.     cbxStartOfWeek.AddItem "Use System"
  249.     'add the long day names
  250.     For nDay = 1 To 7
  251.         cbxStartOfWeek.AddItem Format(DateSerial(1996, 8, 3 + nDay), "dddd")
  252.     Next nDay
  253. End Sub 'LoadStartOfWeekCombo()
  254. '----------------------------------------------------------------------
  255. ' chkMonthRO_Click Event
  256. '----------------------------------------------------------------------
  257. ' Purpose:  Called when the user changes the state of the month
  258. '           read-only check box.
  259. ' Inputs:   None
  260. ' Outputs:  None
  261. '----------------------------------------------------------------------
  262. Private Sub chkMonthRO_Click()
  263.     'change the preview
  264.     calPreview.MonthReadOnly = CBool(chkMonthRO.Value)
  265.     'set the page's change flag to True
  266.     PropertyPage.Changed = True
  267. End Sub 'chkMonthRO_Click()
  268. '----------------------------------------------------------------------
  269. ' chkYearRO_Click Event
  270. '----------------------------------------------------------------------
  271. ' Purpose:  Called when the user changes the state of the year
  272. '           read-only check box.
  273. ' Inputs:   None
  274. ' Outputs:  None
  275. '----------------------------------------------------------------------
  276. Private Sub chkYearRO_Click()
  277.     'change the preview
  278.     calPreview.YearReadOnly = CBool(chkYearRO.Value)
  279.     'set the page's change flag to True
  280.     PropertyPage.Changed = True
  281. End Sub 'chkYearRO_Click()
  282. '----------------------------------------------------------------------
  283. ' chkShowIterration_Click Event
  284. '----------------------------------------------------------------------
  285. ' Purpose:  Called when the user changes the state of the show
  286. '           iterration buttons check box
  287. ' Inputs:   None
  288. ' Outputs:  None
  289. '----------------------------------------------------------------------
  290. Private Sub chkShowIterration_Click()
  291.     'change the preview
  292.     calPreview.ShowIterrationButtons = CBool(chkShowIterration.Value)
  293.     'set the page's change flag to True
  294.     PropertyPage.Changed = True
  295. End Sub 'chkShowIterration_Click()
  296. '----------------------------------------------------------------------
  297. ' cbxStartOfWeek_Click Event
  298. '----------------------------------------------------------------------
  299. ' Purpose:  Called when the user changes the selected item in the
  300. '           start of week combo box
  301. ' Inputs:   None
  302. ' Outputs:  None
  303. '----------------------------------------------------------------------
  304. Private Sub cbxStartOfWeek_Click()
  305.     'change the preview
  306.     calPreview.StartOfWeek = cbxStartOfWeek.ListIndex
  307.     'set the page's change flag to True
  308.     PropertyPage.Changed = True
  309. End Sub 'cbxStartOfWeek_Click()
  310. '----------------------------------------------------------------------
  311. ' cbxDayFormat_Click Event
  312. '----------------------------------------------------------------------
  313. ' Purpose:  Called when the user changes the selected item in the
  314. '           day format combo box
  315. ' Inputs:   None
  316. ' Outputs:  None
  317. '----------------------------------------------------------------------
  318. Private Sub cbxDayFormat_Click()
  319.     'change the preview
  320.     calPreview.DayNameFormat = cbxDayFormat.ListIndex
  321.     'set the page's change flag to True
  322.     PropertyPage.Changed = True
  323. End Sub 'cbxDayFormat_Click()
  324.