home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / PolarDraw / data1.cab / Samples / Visual_Basic / VBDraw / frmPaper.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-08-31  |  7.1 KB  |  236 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPaper 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Paper settings"
  5.    ClientHeight    =   3315
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   5055
  9.    Icon            =   "frmPaper.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3315
  14.    ScaleWidth      =   5055
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.CommandButton btnPaperOutlineColor 
  17.       Caption         =   "Choose color..."
  18.       Height          =   360
  19.       Left            =   2910
  20.       TabIndex        =   7
  21.       Top             =   2085
  22.       Width           =   1320
  23.    End
  24.    Begin VB.CommandButton btnPaperShadowColor 
  25.       Caption         =   "Choose color..."
  26.       Height          =   360
  27.       Left            =   390
  28.       TabIndex        =   5
  29.       Top             =   2085
  30.       Width           =   1320
  31.    End
  32.    Begin VB.CommandButton btnOK 
  33.       Caption         =   "OK"
  34.       Height          =   375
  35.       Left            =   1200
  36.       TabIndex        =   8
  37.       Top             =   2865
  38.       Width           =   870
  39.    End
  40.    Begin VB.CommandButton btnCancel 
  41.       Caption         =   "Cancel"
  42.       Height          =   375
  43.       Left            =   2175
  44.       TabIndex        =   15
  45.       Top             =   2880
  46.       Width           =   870
  47.    End
  48.    Begin VB.TextBox Text4 
  49.       Height          =   375
  50.       Left            =   7095
  51.       TabIndex        =   12
  52.       Text            =   "Text4"
  53.       Top             =   4980
  54.       Width           =   1335
  55.    End
  56.    Begin VB.TextBox Text3 
  57.       Height          =   375
  58.       Left            =   6990
  59.       TabIndex        =   11
  60.       Text            =   "Text3"
  61.       Top             =   4035
  62.       Width           =   1455
  63.    End
  64.    Begin VB.TextBox txtPageWidth 
  65.       Height          =   285
  66.       Left            =   3525
  67.       TabIndex        =   3
  68.       Text            =   "Text2"
  69.       Top             =   705
  70.       Width           =   765
  71.    End
  72.    Begin VB.TextBox txtPageHeight 
  73.       Height          =   285
  74.       Left            =   3525
  75.       TabIndex        =   2
  76.       Text            =   "Text1"
  77.       Top             =   330
  78.       Width           =   750
  79.    End
  80.    Begin VB.CommandButton btnPaperColor 
  81.       Caption         =   "Choose color..."
  82.       Height          =   360
  83.       Left            =   285
  84.       TabIndex        =   1
  85.       Top             =   690
  86.       Width           =   1320
  87.    End
  88.    Begin VB.CheckBox chckShowPaper 
  89.       Caption         =   "Show paper"
  90.       Height          =   375
  91.       Left            =   285
  92.       TabIndex        =   0
  93.       Top             =   240
  94.       Value           =   1  'Checked
  95.       Width           =   1215
  96.    End
  97.    Begin VB.Frame frOutline 
  98.       Caption         =   "Paper outline"
  99.       Height          =   1290
  100.       Left            =   2640
  101.       TabIndex        =   10
  102.       Top             =   1305
  103.       Width           =   2220
  104.       Begin VB.CheckBox chckPaperOutline 
  105.          Caption         =   "Show paper outline"
  106.          Height          =   375
  107.          Left            =   225
  108.          TabIndex        =   6
  109.          Top             =   360
  110.          Width           =   1710
  111.       End
  112.    End
  113.    Begin VB.Frame frShadow 
  114.       Caption         =   "Paper shadow"
  115.       Height          =   1290
  116.       Left            =   180
  117.       TabIndex        =   9
  118.       Top             =   1305
  119.       Width           =   2220
  120.       Begin VB.CheckBox chckPaperShadow 
  121.          Caption         =   "Show paper shadow"
  122.          Height          =   375
  123.          Left            =   240
  124.          TabIndex        =   4
  125.          Top             =   360
  126.          Width           =   1860
  127.       End
  128.    End
  129.    Begin VB.Label Label1 
  130.       Caption         =   "mm"
  131.       Height          =   225
  132.       Index           =   1
  133.       Left            =   4320
  134.       TabIndex        =   17
  135.       Top             =   810
  136.       Width           =   345
  137.    End
  138.    Begin VB.Label Label1 
  139.       Caption         =   "mm"
  140.       Height          =   225
  141.       Index           =   0
  142.       Left            =   4320
  143.       TabIndex        =   16
  144.       Top             =   390
  145.       Width           =   345
  146.    End
  147.    Begin VB.Label lblPageWidth 
  148.       Caption         =   "Page width:"
  149.       Height          =   255
  150.       Left            =   2565
  151.       TabIndex        =   14
  152.       Top             =   735
  153.       Width           =   975
  154.    End
  155.    Begin VB.Label lblPageHeight 
  156.       Caption         =   "Page height:"
  157.       Height          =   255
  158.       Left            =   2565
  159.       TabIndex        =   13
  160.       Top             =   375
  161.       Width           =   975
  162.    End
  163. Attribute VB_Name = "frmPaper"
  164. Attribute VB_GlobalNameSpace = False
  165. Attribute VB_Creatable = False
  166. Attribute VB_PredeclaredId = True
  167. Attribute VB_Exposed = False
  168. Dim fShowPaper, fShowPaperOutline, fShowPaperShadow As Boolean
  169. Dim crPaperShadowColor, crPaperOutlineColor, crPaperColor As OLE_COLOR
  170. Dim lPageHeight, lPageWidth As Long
  171. Private Sub btnCancel_Click()
  172.    'if user cancels, set back to initial values
  173.    With pd_Page
  174.       .ShowPaper = fShowPaper
  175.       .ShowPaperOutline = fShowPaperOutline
  176.       .ShowPaperShadow = fShowPaperShadow
  177.       .Height = lPageHeight
  178.       .Width = lPageWidth
  179.       .PaperColor = crPaperColor
  180.       .PaperShadowColor = crPaperShadowColor
  181.       .PaperOutlineColor = crPaperOutlineColor
  182.    End With
  183.    Unload Me
  184. End Sub
  185. Private Sub btnOK_Click()
  186.    Unload Me
  187. End Sub
  188. Private Sub btnPaperColor_Click()
  189.    With pd_Page
  190.       .PaperColor = SetColor(.PaperColor)
  191.    End With
  192. End Sub
  193. Private Sub btnPaperOutlineColor_Click()
  194.    With pd_Page
  195.       .PaperOutlineColor = SetColor(.PaperOutlineColor)
  196.    End With
  197. End Sub
  198. Private Sub btnPaperShadowColor_Click()
  199.    With pd_Page
  200.       .PaperShadowColor = SetColor(.PaperShadowColor)
  201.    End With
  202. End Sub
  203. Private Sub chckPaperOutline_Click()
  204.     pd_Page.ShowPaperOutline = CBool(chckPaperOutline)
  205. End Sub
  206. Private Sub chckPaperShadow_Click()
  207.     pd_Page.ShowPaperShadow = CBool(chckPaperShadow)
  208. End Sub
  209. Private Sub chckShowPaper_Click()
  210.     pd_Page.ShowPaper = CBool(chckShowPaper)
  211. End Sub
  212. Private Sub Form_Load()
  213.     'saving initial values
  214.     With pd_Page
  215.       fShowPaper = .ShowPaper
  216.       fShowPaperOutline = .ShowPaperOutline
  217.       fShowPaperShadow = .ShowPaperShadow
  218.       lPageHeight = .Height
  219.       lPageWidth = .Width
  220.       crPaperColor = .PaperColor
  221.       crPaperShadowColor = .PaperShadowColor
  222.       crPaperOutlineColor = .PaperOutlineColor
  223.    End With
  224.    chckShowPaper.Value = Abs(fShowPaper)
  225.    chckPaperOutline.Value = Abs(fShowPaperOutline)
  226.    chckPaperShadow.Value = Abs(fShowPaperShadow)
  227.    txtPageHeight = lPageHeight
  228.    txtPageWidth = lPageWidth
  229. End Sub
  230. Private Sub txtPageHeight_LostFocus()
  231.    If NumberGreaterThanZero(txtPageHeight) Then pd_Page.Height = txtPageHeight
  232. End Sub
  233. Private Sub txtPageWidth_LostFocus()
  234.    If NumberGreaterThanZero(txtPageWidth) Then pd_Page.Width = txtPageWidth
  235. End Sub
  236.