home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / csview / fdesk.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-05  |  20.0 KB  |  579 lines

  1. VERSION 2.00
  2. Begin Form fdesk 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H0080FFFF&
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   6135
  7.    ClientLeft      =   510
  8.    ClientTop       =   630
  9.    ClientWidth     =   9105
  10.    ClipControls    =   0   'False
  11.    ControlBox      =   0   'False
  12.    Height          =   6540
  13.    Left            =   450
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   6135
  18.    ScaleWidth      =   9105
  19.    Top             =   285
  20.    Width           =   9225
  21.    Begin PictureBox Picture1 
  22.       BackColor       =   &H00C0C0C0&
  23.       Height          =   3915
  24.       Index           =   1
  25.       Left            =   1590
  26.       ScaleHeight     =   3165
  27.       ScaleWidth      =   6900
  28.       TabIndex        =   1
  29.       Top             =   1635
  30.       Width           =   7200
  31.       Begin Frame Frame1 
  32.          BackColor       =   &H00C0C0C0&
  33.          Caption         =   "Margins"
  34.          Height          =   2535
  35.          Left            =   3300
  36.          TabIndex        =   11
  37.          Top             =   480
  38.          Width           =   3525
  39.          Begin TextBox text1 
  40.             Alignment       =   1  'Right Justify
  41.             BackColor       =   &H00FFFFFF&
  42.             FontBold        =   0   'False
  43.             FontItalic      =   0   'False
  44.             FontName        =   "Arial"
  45.             FontSize        =   8.25
  46.             FontStrikethru  =   0   'False
  47.             FontUnderline   =   0   'False
  48.             Height          =   315
  49.             Index           =   1
  50.             Left            =   2385
  51.             MultiLine       =   -1  'True
  52.             TabIndex        =   15
  53.             Text            =   "Text1"
  54.             Top             =   1110
  55.             Width           =   990
  56.          End
  57.          Begin TextBox text1 
  58.             Alignment       =   1  'Right Justify
  59.             BackColor       =   &H00FFFFFF&
  60.             FontBold        =   0   'False
  61.             FontItalic      =   0   'False
  62.             FontName        =   "MS Sans Serif"
  63.             FontSize        =   8.25
  64.             FontStrikethru  =   0   'False
  65.             FontUnderline   =   0   'False
  66.             Height          =   315
  67.             Index           =   3
  68.             Left            =   195
  69.             MultiLine       =   -1  'True
  70.             TabIndex        =   14
  71.             Text            =   "Text1"
  72.             Top             =   1140
  73.             Width           =   990
  74.          End
  75.          Begin TextBox text1 
  76.             Alignment       =   1  'Right Justify
  77.             BackColor       =   &H00FFFFFF&
  78.             FontBold        =   0   'False
  79.             FontItalic      =   0   'False
  80.             FontName        =   "MS Sans Serif"
  81.             FontSize        =   8.25
  82.             FontStrikethru  =   0   'False
  83.             FontUnderline   =   0   'False
  84.             Height          =   315
  85.             Index           =   2
  86.             Left            =   1275
  87.             MultiLine       =   -1  'True
  88.             TabIndex        =   13
  89.             Text            =   "Text1"
  90.             Top             =   2100
  91.             Width           =   990
  92.          End
  93.          Begin TextBox text1 
  94.             Alignment       =   1  'Right Justify
  95.             BackColor       =   &H00FFFFFF&
  96.             FontBold        =   0   'False
  97.             FontItalic      =   0   'False
  98.             FontName        =   "MS Sans Serif"
  99.             FontSize        =   8.25
  100.             FontStrikethru  =   0   'False
  101.             FontUnderline   =   0   'False
  102.             Height          =   315
  103.             Index           =   0
  104.             Left            =   1290
  105.             MultiLine       =   -1  'True
  106.             TabIndex        =   12
  107.             Text            =   "Text1"
  108.             Top             =   210
  109.             Width           =   990
  110.          End
  111.          Begin Label LLm 
  112.             AutoSize        =   -1  'True
  113.             BackStyle       =   0  'Transparent
  114.             Caption         =   "&Left"
  115.             FontBold        =   0   'False
  116.             FontItalic      =   0   'False
  117.             FontName        =   "MS Sans Serif"
  118.             FontSize        =   8.25
  119.             FontStrikethru  =   0   'False
  120.             FontUnderline   =   0   'False
  121.             Height          =   195
  122.             Index           =   1
  123.             Left            =   240
  124.             TabIndex        =   7
  125.             Tag             =   "FRMarge &Gauche;GB&Left margin;ALL&Left Margin"
  126.             Top             =   900
  127.             Width           =   270
  128.          End
  129.          Begin Label Ltm 
  130.             AutoSize        =   -1  'True
  131.             BackStyle       =   0  'Transparent
  132.             Caption         =   "&Right"
  133.             FontBold        =   0   'False
  134.             FontItalic      =   0   'False
  135.             FontName        =   "MS Sans Serif"
  136.             FontSize        =   8.25
  137.             FontStrikethru  =   0   'False
  138.             FontUnderline   =   0   'False
  139.             ForeColor       =   &H00000000&
  140.             Height          =   195
  141.             Index           =   1
  142.             Left            =   2460
  143.             TabIndex        =   8
  144.             Tag             =   "FRMarge &Droite;GB&Right Margin;ALL&Right Margin"
  145.             Top             =   840
  146.             Width           =   375
  147.          End
  148.          Begin Label Ltm 
  149.             AutoSize        =   -1  'True
  150.             BackStyle       =   0  'Transparent
  151.             Caption         =   "&Top"
  152.             FontBold        =   0   'False
  153.             FontItalic      =   0   'False
  154.             FontName        =   "MS Sans Serif"
  155.             FontSize        =   8.25
  156.             FontStrikethru  =   0   'False
  157.             FontUnderline   =   0   'False
  158.             ForeColor       =   &H00000000&
  159.             Height          =   195
  160.             Index           =   0
  161.             Left            =   915
  162.             TabIndex        =   9
  163.             Tag             =   "FRMarge &Haut;GB&Top Margin;ALL&Top Margin"
  164.             Top             =   255
  165.             Width           =   285
  166.          End
  167.          Begin Label LLm 
  168.             AutoSize        =   -1  'True
  169.             BackStyle       =   0  'Transparent
  170.             Caption         =   "&Bottom"
  171.             FontBold        =   0   'False
  172.             FontItalic      =   0   'False
  173.             FontName        =   "MS Sans Serif"
  174.             FontSize        =   8.25
  175.             FontStrikethru  =   0   'False
  176.             FontUnderline   =   0   'False
  177.             Height          =   195
  178.             Index           =   0
  179.             Left            =   735
  180.             TabIndex        =   10
  181.             Tag             =   "FRMarge &Bas;GB&Bottom Margin;ALL&Bottom Margin"
  182.             Top             =   2145
  183.             Width           =   495
  184.          End
  185.          Begin Image Image1 
  186.             Height          =   1575
  187.             Left            =   1155
  188.             Picture         =   FDESK.FRX:0000
  189.             Stretch         =   -1  'True
  190.             Top             =   510
  191.             Width           =   1230
  192.          End
  193.       End
  194.       Begin Frame Frame4 
  195.          BackColor       =   &H00C0C0C0&
  196.          Caption         =   "Orientation"
  197.          Height          =   945
  198.          Left            =   300
  199.          TabIndex        =   4
  200.          Top             =   2025
  201.          Width           =   2910
  202.          Begin OptionButton Option1 
  203.             BackColor       =   &H00C0C0C0&
  204.             Caption         =   "Portrait"
  205.             FontBold        =   0   'False
  206.             FontItalic      =   0   'False
  207.             FontName        =   "MS Sans Serif"
  208.             FontSize        =   8.25
  209.             FontStrikethru  =   0   'False
  210.             FontUnderline   =   0   'False
  211.             Height          =   285
  212.             Index           =   0
  213.             Left            =   1020
  214.             TabIndex        =   6
  215.             Top             =   240
  216.             Width           =   1185
  217.          End
  218.          Begin OptionButton Option1 
  219.             BackColor       =   &H00C0C0C0&
  220.             Caption         =   "Landscape"
  221.             FontBold        =   0   'False
  222.             FontItalic      =   0   'False
  223.             FontName        =   "MS Sans Serif"
  224.             FontSize        =   8.25
  225.             FontStrikethru  =   0   'False
  226.             FontUnderline   =   0   'False
  227.             Height          =   285
  228.             Index           =   1
  229.             Left            =   1005
  230.             TabIndex        =   5
  231.             Top             =   510
  232.             Width           =   1185
  233.          End
  234.          Begin Image Image3 
  235.             Height          =   450
  236.             Index           =   1
  237.             Left            =   1740
  238.             Picture         =   FDESK.FRX:4492
  239.             Top             =   45
  240.             Visible         =   0   'False
  241.             Width           =   570
  242.          End
  243.          Begin Image Image3 
  244.             Height          =   570
  245.             Index           =   0
  246.             Left            =   285
  247.             Picture         =   FDESK.FRX:4D7C
  248.             Top             =   210
  249.             Visible         =   0   'False
  250.             Width           =   495
  251.          End
  252.          Begin Image Image4 
  253.             Height          =   465
  254.             Left            =   105
  255.             Top             =   225
  256.             Width           =   780
  257.          End
  258.       End
  259.       Begin ComboBox cmb_printers 
  260.          FontBold        =   0   'False
  261.          FontItalic      =   0   'False
  262.          FontName        =   "MS Sans Serif"
  263.          FontSize        =   8.25
  264.          FontStrikethru  =   0   'False
  265.          FontUnderline   =   0   'False
  266.          Height          =   315
  267.          Left            =   300
  268.          Style           =   2  'Dropdown List
  269.          TabIndex        =   3
  270.          Top             =   435
  271.          Width           =   2850
  272.       End
  273.       Begin vsInForm VSInForm2 
  274.          BarColor        =   &H00800080&
  275.          BarColorInactive=   &H00800080&
  276.          BarHeight       =   30
  277.          BarStyle        =   3  'Raised
  278.          ButtonsLeft     =   0  '0
  279.          CapAlign        =   1  'Left Center
  280.          CapColor        =   &H00FFFFFF&
  281.          CapColorInactive=   &H00FFFFFF&
  282.          Caption         =   "  Printer Settings"
  283.          ConvInfo        =   FDESK.FRX:570E
  284.          CustomFrame     =   -1  'True
  285.          FrameColor      =   &H00C0C0C0&
  286.          FrameColorInactive=   &H00C0C0C0&
  287.          FrameCorners    =   0   'False
  288.          FrameSizing     =   0  'None
  289.          FrameStyle      =   3  'Raised Form
  290.          FrameWidth      =   10
  291.          Index           =   2
  292.          Left            =   -15
  293.          Top             =   495
  294.       End
  295.       Begin Label Label1 
  296.          BackStyle       =   0  'Transparent
  297.          Caption         =   "Default Printer"
  298.          FontBold        =   0   'False
  299.          FontItalic      =   0   'False
  300.          FontName        =   "MS Sans Serif"
  301.          FontSize        =   8.25
  302.          FontStrikethru  =   0   'False
  303.          FontUnderline   =   0   'False
  304.          Height          =   240
  305.          Left            =   300
  306.          TabIndex        =   16
  307.          Top             =   180
  308.          Width           =   1125
  309.       End
  310.       Begin Label lStatus 
  311.          BackStyle       =   0  'Transparent
  312.          FontBold        =   0   'False
  313.          FontItalic      =   0   'False
  314.          FontName        =   "MS Sans Serif"
  315.          FontSize        =   8.25
  316.          FontStrikethru  =   0   'False
  317.          FontUnderline   =   0   'False
  318.          Height          =   960
  319.          Index           =   1
  320.          Left            =   300
  321.          TabIndex        =   2
  322.          Top             =   975
  323.          Width           =   2640
  324.       End
  325.    End
  326.    Begin vsInForm InForm 
  327.       BarColor        =   &H00800080&
  328.       BarColorInactive=   &H00800080&
  329.       BarHeight       =   16
  330.       ButtonsLeft     =   3  '3
  331.       ButtonsRight    =   2  '2
  332.       CapAlign        =   1  'Left Center
  333.       CapColor        =   &H00FFFFFF&
  334.       CapColorInactive=   &H00FFFFFF&
  335.       Caption         =   " VideoSoft SmartDesk"
  336.       ClipMon         =   -1  'True
  337.       ConvInfo        =   FDESK.FRX:5719
  338.       FontBold        =   -1  'True
  339.       FontItalic      =   0   'False
  340.       FontName        =   "Small Fonts"
  341.       FontSize        =   6.75
  342.       FontStrikethru  =   0   'False
  343.       FontUnderline   =   0   'False
  344.       FrameColor      =   &H00C0C0C0&
  345.       FrameColorInactive=   &H00C0C0C0&
  346.       FrameStyle      =   4  'Raised Frame
  347.       FrameWidth      =   10
  348.       Left            =   5835
  349.       PictLeft0       =   FDESK.FRX:5724
  350.       PictLeft1       =   FDESK.FRX:57EE
  351.       PictLeft2       =   FDESK.FRX:58B8
  352.       PictRight0      =   FDESK.FRX:5982
  353.       PictRight1      =   FDESK.FRX:5A4C
  354.       Top             =   480
  355.    End
  356.    Begin PictureBox Picture4 
  357.       BackColor       =   &H00C0C0C0&
  358.       Height          =   4935
  359.       Left            =   150
  360.       ScaleHeight     =   4125
  361.       ScaleWidth      =   4800
  362.       TabIndex        =   0
  363.       Top             =   615
  364.       Width           =   5100
  365.       Begin vsInForm vsInForm3 
  366.          AcceptFiles     =   -1  'True
  367.          BarColorInactive=   &H00808000&
  368.          BarHeight       =   34
  369.          ButtonsLeft     =   0  '0
  370.          ButtonsRight    =   3  '3
  371.          CapColorInactive=   &H00FFFFFF&
  372.          Caption         =   "Visual Printer"
  373.          ConvInfo        =   FDESK.FRX:5B16
  374.          CustomFrame     =   -1  'True
  375.          FontBold        =   -1  'True
  376.          FontItalic      =   0   'False
  377.          FontName        =   "Arial"
  378.          FontSize        =   12
  379.          FontStrikethru  =   0   'False
  380.          FontUnderline   =   0   'False
  381.          FrameColor      =   &H00C0C0C0&
  382.          FrameColorInactive=   &H00C0C0C0&
  383.          FrameCorners    =   0   'False
  384.          FrameSizing     =   0  'None
  385.          FrameStyle      =   3  'Raised Form
  386.          FrameWidth      =   10
  387.          Left            =   480
  388.          PictRight0      =   FDESK.FRX:5B21
  389.          PictRight1      =   FDESK.FRX:5D2B
  390.          PictRight2      =   FDESK.FRX:5F15
  391.          Top             =   3120
  392.       End
  393.       Begin vsViewPort vsViewPort1 
  394.          BackColor       =   &H00808080&
  395.          ConvInfo        =   FDESK.FRX:610F
  396.          Height          =   3870
  397.          Left            =   105
  398.          Top             =   105
  399.          VirtualHeight   =   0
  400.          VirtualWidth    =   0
  401.          Width           =   4530
  402.          Begin vsPrinter vsPrinter 
  403.             ConvInfo        =   FDESK.FRX:611A
  404.             FontName        =   "Arial"
  405.             FontSize        =   24
  406.             HdrColor        =   &H00FF0000&
  407.             HdrFontBold     =   -1  'True
  408.             HdrFontName     =   "Bookman Old Style"
  409.             HdrFontSize     =   18
  410.             Header          =   "|VideoSoft VSView"
  411.             Height          =   2430
  412.             Left            =   105
  413.             Top             =   105
  414.             Width           =   2640
  415.          End
  416.       End
  417.    End
  418.    Begin Image Pin 
  419.       Height          =   150
  420.       Index           =   0
  421.       Left            =   105
  422.       Picture         =   FDESK.FRX:6125
  423.       Top             =   0
  424.       Visible         =   0   'False
  425.       Width           =   150
  426.    End
  427.    Begin Image Pin 
  428.       Height          =   150
  429.       Index           =   1
  430.       Left            =   300
  431.       Picture         =   FDESK.FRX:61EF
  432.       Top             =   60
  433.       Visible         =   0   'False
  434.       Width           =   150
  435.    End
  436. Option Explicit
  437. Sub cmb_printers_Click ()
  438.     Dim s$
  439.     mousepointer = 11
  440.     vsPrinter.Device = cmb_printers.List(cmb_printers.ListIndex)
  441.     s = "Port: :" + vsPrinter.Port + Chr(13)
  442.     s = s + "Driver: :" + vsPrinter.Driver
  443.     lStatus(1) = s
  444.     text1(0) = vsPrinter.MarginTop
  445.     text1(1) = vsPrinter.MarginRight
  446.     text1(2) = vsPrinter.MarginBottom
  447.     text1(3) = vsPrinter.MarginLeft
  448.     mousepointer = 0
  449. End Sub
  450. Sub Form_Load ()
  451.   Inform.CustomFrame = True
  452.   Dim s$
  453.   ' Display Printer Settings
  454.   Dim i%
  455.   For i = 0 To vsPrinter.NDevices - 1
  456.     cmb_printers.AddItem vsPrinter.Devices(i)
  457.   Next i
  458.   cmb_printers.ListIndex = 0
  459.   vsPrinter.Width = vsPrinter.PageWidth
  460.   vsPrinter.Height = vsPrinter.PageHeight
  461.   VSViewPort1.VirtualWidth = vsPrinter.PageWidth
  462.   VSViewPort1.VirtualHeight = vsPrinter.PageHeight
  463.   option1(vsPrinter.Orientation) = True
  464.   Me.Show
  465.   vsPrinter.Preview = True
  466.   MsgBox " Drag TEXT files from File Manager to the Visual Printer"
  467. End Sub
  468. Sub Form_Paint ()
  469.   'vsPrinter.Top = VSViewPort1.VirtualHeight / 2
  470. End Sub
  471. Sub GoPrint (c As Control)
  472.   Dim i%, fn$, fl&
  473.   vsPrinter.PageBorder = 3   'top and bottom
  474.   For i = 0 To c.NumFiles - 1
  475.     ' set header and footer
  476.     fn = c.FileName(i)
  477.     fl = FileLen(fn)
  478.     vsPrinter.FileName = fn
  479.     vsPrinter.Header = fn + "||Page %d"
  480.     vsPrinter.Footer = FileDateTime(fn) + "|VideoSoft VSView|"
  481.     If fl > 10 * 1024 Then
  482.       vsPrinter.Footer = vsPrinter.Footer + Format(fl / 1024, "###,###,###") + " K bytes"
  483.     Else
  484.       vsPrinter.Footer = vsPrinter.Footer + Format(fl, "###,###,###") + " bytes"
  485.     End If
  486.     vsPrinter.Action = 1
  487.   Next
  488.   Form_Paint
  489. End Sub
  490. Sub InForm_ClickLButton (Button As Integer)
  491.   Dim s$
  492.   Select Case Button
  493.     ' button 0 is end
  494.     Case 0
  495.       Unload Me
  496.     ' button 1 is keep on top
  497.     Case 1
  498.       Inform.OnTop = Not Inform.OnTop
  499.       If Inform.OnTop Then
  500.         Inform.PictLeft1 = Pin(1)
  501.       Else
  502.         Inform.PictLeft1 = Pin(0)
  503.       End If
  504.     ' button 2 is help
  505.     Case 2
  506.       s = "Drag files from the file manager into the Visual printer"
  507.       s = s + Chr(13) + "Use pin button to keep the window on top"
  508.       MsgBox s
  509.   End Select
  510. End Sub
  511. Sub InForm_ClickRButton (Button As Integer)
  512.   Select Case Button
  513.     ' button 0 is maximize/restore
  514.     Case 0
  515.       InForm_DblClickCaption
  516.     ' button 1 is minimize
  517.     Case 1
  518.       WindowState = 1
  519.   End Select
  520. End Sub
  521. Sub InForm_DblClickCaption ()
  522.   If WindowState = 0 Then
  523.     WindowState = 2
  524.   ElseIf WindowState = 2 Then
  525.     WindowState = 0
  526.   End If
  527. End Sub
  528. Sub InForm_NewClipboardData ()
  529.  ' eV = Clipboard.GetText()
  530.  ' If eV = "" Then
  531.  '   eV.Picture = Clipboard.GetData()
  532.  ' End If
  533. End Sub
  534. Sub Option1_Click (Index As Integer)
  535.     vsPrinter.Orientation = Index
  536.     image4 = image3(Index)
  537.     vsPrinter.Width = vsPrinter.PageWidth
  538.     vsPrinter.Height = vsPrinter.PageHeight
  539.     VSViewPort1.VirtualWidth = vsPrinter.PageWidth
  540.     VSViewPort1.VirtualHeight = vsPrinter.PageHeight
  541. End Sub
  542. Sub vsInForm3_ClickRButton (Button As Integer)
  543.   Static Zoom%
  544.   mousepointer = 11
  545.   DoEvents
  546.   Select Case Button
  547.       Case 0    'Zoom
  548.           Zoom = Zoom + 20
  549.           If Zoom > 100 Then Zoom = 20
  550.           vsPrinter.Width = vsPrinter.PageWidth * Zoom / 100 * 2.15
  551.           vsPrinter.Height = vsPrinter.PageHeight * Zoom / 100 * 2.15
  552.           VSViewPort1.VirtualWidth = vsPrinter.Width
  553.           VSViewPort1.VirtualHeight = vsPrinter.Height
  554.       Case 1      'Print file
  555.           If vsPrinter.FileName <> "" Then
  556.             vsPrinter.Preview = False
  557.             vsPrinter.Action = 1
  558.             vsPrinter.Preview = True
  559.           End If
  560.       Case 2      'Clear the printer
  561.           vsPrinter.FileName = ""
  562.           vsPrinter.PageBorder = 0   'none
  563.           vsPrinter.Header = ""
  564.           vsPrinter.Footer = ""
  565.           vsPrinter.Action = 3
  566.           vsPrinter.Action = 6
  567.           
  568.   End Select
  569.   mousepointer = 0
  570. End Sub
  571. Sub vsInForm3_DropFile ()
  572.   ' print file
  573.   mousepointer = 11
  574.   vsPrinter.Preview = True
  575.   vsPrinter.PreviewPage = 1
  576.   GoPrint vsInform3
  577.   mousepointer = 0
  578. End Sub
  579.