home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Screen_Cal2042371132007.psc / frmRight.frm < prev    next >
Text File  |  2007-01-13  |  10KB  |  326 lines

  1. VERSION 5.00
  2. Begin VB.Form frmRight 
  3.    BorderStyle     =   0  'None
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   1530
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   1485
  9.    Icon            =   "frmRight.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    Picture         =   "frmRight.frx":00EA
  12.    ScaleHeight     =   1530
  13.    ScaleWidth      =   1485
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.CommandButton cmdColor 
  16.       Caption         =   "C"
  17.       BeginProperty Font 
  18.          Name            =   "Arial"
  19.          Size            =   8.25
  20.          Charset         =   0
  21.          Weight          =   400
  22.          Underline       =   0   'False
  23.          Italic          =   0   'False
  24.          Strikethrough   =   0   'False
  25.       EndProperty
  26.       Height          =   210
  27.       Left            =   840
  28.       TabIndex        =   7
  29.       Top             =   720
  30.       Width           =   240
  31.    End
  32.    Begin VB.CommandButton cmdRota 
  33.       BackColor       =   &H00FF8080&
  34.       Caption         =   "5"
  35.       BeginProperty Font 
  36.          Name            =   "Marlett"
  37.          Size            =   8.25
  38.          Charset         =   2
  39.          Weight          =   500
  40.          Underline       =   0   'False
  41.          Italic          =   0   'False
  42.          Strikethrough   =   0   'False
  43.       EndProperty
  44.       Height          =   210
  45.       Left            =   585
  46.       Style           =   1  'Graphical
  47.       TabIndex        =   0
  48.       Top             =   720
  49.       Width           =   225
  50.    End
  51.    Begin VB.CommandButton cmdExit 
  52.       BackColor       =   &H008080FF&
  53.       Caption         =   "X"
  54.       BeginProperty Font 
  55.          Name            =   "Arial"
  56.          Size            =   8.25
  57.          Charset         =   0
  58.          Weight          =   400
  59.          Underline       =   0   'False
  60.          Italic          =   0   'False
  61.          Strikethrough   =   0   'False
  62.       EndProperty
  63.       Height          =   210
  64.       Left            =   330
  65.       Style           =   1  'Graphical
  66.       TabIndex        =   6
  67.       Top             =   495
  68.       Width           =   225
  69.    End
  70.    Begin VB.CommandButton cmdHRRight 
  71.       Caption         =   "4"
  72.       BeginProperty Font 
  73.          Name            =   "Marlett"
  74.          Size            =   8.25
  75.          Charset         =   2
  76.          Weight          =   500
  77.          Underline       =   0   'False
  78.          Italic          =   0   'False
  79.          Strikethrough   =   0   'False
  80.       EndProperty
  81.       Height          =   195
  82.       Left            =   1125
  83.       TabIndex        =   5
  84.       Top             =   735
  85.       Width           =   300
  86.    End
  87.    Begin VB.CommandButton cmdHRLeft 
  88.       Caption         =   "3"
  89.       BeginProperty Font 
  90.          Name            =   "Marlett"
  91.          Size            =   8.25
  92.          Charset         =   2
  93.          Weight          =   500
  94.          Underline       =   0   'False
  95.          Italic          =   0   'False
  96.          Strikethrough   =   0   'False
  97.       EndProperty
  98.       Height          =   210
  99.       Left            =   1125
  100.       TabIndex        =   4
  101.       Top             =   495
  102.       Width           =   300
  103.    End
  104.    Begin VB.CommandButton cmdHLRight 
  105.       Caption         =   "4"
  106.       BeginProperty Font 
  107.          Name            =   "Marlett"
  108.          Size            =   8.25
  109.          Charset         =   2
  110.          Weight          =   500
  111.          Underline       =   0   'False
  112.          Italic          =   0   'False
  113.          Strikethrough   =   0   'False
  114.       EndProperty
  115.       Height          =   195
  116.       Left            =   30
  117.       TabIndex        =   3
  118.       Top             =   705
  119.       Width           =   270
  120.    End
  121.    Begin VB.CommandButton cmdHLLeft 
  122.       Caption         =   "3"
  123.       BeginProperty Font 
  124.          Name            =   "Marlett"
  125.          Size            =   8.25
  126.          Charset         =   2
  127.          Weight          =   500
  128.          Underline       =   0   'False
  129.          Italic          =   0   'False
  130.          Strikethrough   =   0   'False
  131.       EndProperty
  132.       Height          =   195
  133.       Left            =   30
  134.       TabIndex        =   2
  135.       Top             =   510
  136.       Width           =   270
  137.    End
  138.    Begin VB.CommandButton Command1 
  139.       Caption         =   "P"
  140.       BeginProperty Font 
  141.          Name            =   "Arial"
  142.          Size            =   8.25
  143.          Charset         =   0
  144.          Weight          =   400
  145.          Underline       =   0   'False
  146.          Italic          =   0   'False
  147.          Strikethrough   =   0   'False
  148.       EndProperty
  149.       Height          =   210
  150.       Left            =   330
  151.       TabIndex        =   1
  152.       Top             =   720
  153.       Width           =   225
  154.    End
  155.    Begin VB.Line Line2 
  156.       BorderColor     =   &H00000000&
  157.       X1              =   225
  158.       X2              =   225
  159.       Y1              =   885
  160.       Y2              =   1515
  161.    End
  162.    Begin VB.Line Line1 
  163.       BorderColor     =   &H00000000&
  164.       X1              =   210
  165.       X2              =   210
  166.       Y1              =   0
  167.       Y2              =   465
  168.    End
  169. End
  170. Attribute VB_Name = "frmRight"
  171. Attribute VB_GlobalNameSpace = False
  172. Attribute VB_Creatable = False
  173. Attribute VB_PredeclaredId = True
  174. Attribute VB_Exposed = False
  175. '*******************************************************************
  176. '**                              Screen Calipers
  177. '**                               Version 4.4.0
  178. '**                               By Ken Foster
  179. '**                               January  2007
  180. '**                     Freeware--- no copyrights claimed
  181. '*******************************************************************
  182. 'Screen Zoom by Rocky Clark (Kath-Rock Software)
  183.  
  184. 'Right mouse click on Right Calipier to show/hide the zoom window
  185. 'C = color picker for calipier edges
  186. 'P/T selects between pixels and twips
  187. '^ or > selects vertical or horizontal
  188. 'X is the exit button
  189. 'Left side arrow buttons move left side of the calipiers
  190. 'Right side arrow buttons move the right side of the calipiers
  191. '=============================================
  192.  
  193. Option Explicit
  194.  
  195. Dim OldX As Integer
  196. Dim value As Long
  197.  
  198. Private Sub Form_Load()
  199.     MakeTransparent Me
  200.     FormOnTop Me
  201. End Sub
  202.  
  203. Private Sub Form_Activate()
  204.     cValue                           'show display on startup
  205. End Sub
  206.  
  207. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  208.     OldX = X
  209.     If Button = 2 Then frmMain.Visible = Not frmMain.Visible
  210.     
  211. End Sub
  212.  
  213. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  214.     If Button = 1 Then
  215.         frmRight.Left = frmRight.Left + (X - OldX)
  216.         frmRight.Top = frmLeft.Top + 47
  217.         If frmRight.Left < frmLeft.Left + 74 Then
  218.             LockWindowUpdate frmRight.hwnd
  219.             frmRight.Left = frmLeft.Left + 74
  220.             LockWindowUpdate 0&
  221.         End If
  222.         If frmRight.Left < frmCenter.Left Then
  223.             frmCenter.Width = 20
  224.             Exit Sub
  225.         End If
  226.         frmCenter.Width = frmRight.Left - (frmLeft.Left + frmLeft.Width)
  227.     End If
  228. End Sub
  229.  
  230. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  231.     'just to make sure cals are still on top
  232.     FormOnTop frmLeft
  233.     FormOnTop frmCenter
  234.     FormOnTop Me
  235.     cValue                               'make sure value display is still visible
  236. End Sub
  237.  
  238. Private Sub cmdColor_Click()
  239.    frmColor.Top = frmRight.Top + frmRight.Height
  240.    frmColor.Left = frmRight.Left + frmRight.Width / 2
  241.    frmColor.Visible = Not frmColor.Visible
  242.    cmdRota.SetFocus
  243. End Sub
  244.  
  245. Private Sub cmdRota_Click()
  246.     frmLeft.Visible = False
  247.     frmCenter.Visible = False
  248.     frmRight.Visible = False
  249.     frmTop.Visible = True
  250.     frmMid.Visible = True
  251.     frmBot.Visible = True
  252.     frmBot.cmdRot.SetFocus
  253.     frmColor.Visible = False
  254. End Sub
  255.  
  256. Private Sub Command1_Click()
  257.     Smode = Not Smode          'show pixels or twips, see cValue
  258.     cValue                     'update display
  259.     frmBot.cValue
  260.     cmdRota.SetFocus
  261. End Sub
  262.  
  263. Private Sub cmdHLLeft_Click()            'horizontal left,left button
  264.     frmLeft.Left = frmLeft.Left - 15     '15 twips = 1 pixel
  265.     frmCenter.Left = frmCenter.Left - 15
  266.     frmRight.Left = frmRight.Left - 15
  267. End Sub
  268.  
  269. Private Sub cmdHLRight_Click()           'horizontal left, right button
  270.     frmLeft.Left = frmLeft.Left + 15
  271.     frmCenter.Left = frmCenter.Left + 15
  272.     frmRight.Left = frmRight.Left + 15
  273. End Sub
  274.  
  275. Private Sub cmdHRLeft_Click()            'horizontal right, left button
  276.     frmRight.Left = frmRight.Left - 15
  277.     If frmRight.Left <= frmLeft.Left + 74 Then
  278.         frmRight.Left = frmLeft.Left + 74
  279.         cValue
  280.         Exit Sub
  281.     Else
  282.         If frmRight.Left <= frmLeft.Left + frmLeft.Width Then GoTo here
  283.         frmCenter.Width = frmRight.Left - (frmLeft.Left + frmLeft.Width)
  284. here:
  285.         cValue                           'update value display
  286.     End If
  287. End Sub
  288.  
  289. Private Sub cmdHRRight_Click()           'horizontal right, right button
  290.     frmRight.Left = frmRight.Left + 15
  291.     cValue
  292.     If frmRight.Left < frmLeft.Left + frmLeft.Width Then Exit Sub
  293.     frmCenter.Width = frmRight.Left - (frmLeft.Left + frmLeft.Width)
  294. End Sub
  295.  
  296. Private Sub cmdExit_Click()
  297.     Unload frmCenter
  298.     Unload frmMid
  299.     Unload frmLeft
  300.     Unload frmTop
  301.     Unload frmBot
  302.     Unload frmColor
  303.     Unload frmMain
  304.     Unload Me
  305. End Sub
  306.  
  307. Public Sub cValue()
  308.     If Smode = False Then                    '---pixels---
  309.     value = ((frmRight.Left - (Int(frmLeft.Left + 74))) \ 15)  '15 twips = 1 pixel
  310.     Command1.Caption = "P"
  311.     frmRight.Cls
  312.     frmRight.ForeColor = vbWhite
  313.     frmRight.CurrentX = 650
  314.     frmRight.CurrentY = 500
  315.     frmRight.Print value                  'update pixel display
  316. Else                                     '---twips---
  317.     value = (frmRight.Left - (Int(frmLeft.Left + 74)))
  318.     Command1.Caption = "T"
  319.     frmRight.Cls
  320.     frmRight.ForeColor = vbWhite
  321.     frmRight.CurrentX = 550
  322.     frmRight.CurrentY = 500
  323.     frmRight.Print value                  'update pixel display
  324. End If
  325. End Sub
  326.