📄 navigation.frm
字号:
VERSION 5.00
Begin VB.Form Navigation
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 5190
ClientLeft = 5040
ClientTop = 2325
ClientWidth = 8775
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "Navigation.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5190
ScaleWidth = 8775
Begin VB.PictureBox Picture1
Align = 3 'Align Left
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 5190
Left = 0
ScaleHeight = 5130
ScaleWidth = 8820
TabIndex = 0
Top = 0
Width = 8880
Begin VB.Label Label1
Caption = "Label1"
Height = 375
Left = 3120
TabIndex = 1
Top = 0
Visible = 0 'False
Width = 3015
End
End
End
Attribute VB_Name = "Navigation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 块 名 称 :应用程序导航窗体
'* 功 能 描 述 :应用程序导航窗体
'* 程序员姓名 : 陈齐国
'* 最后修改人 : 陈齐国
'* 最后修改时间:2005/08/17
'**************************************
Option Explicit
Private Type NavButton
X As Integer ' 按钮所在的X坐标
Y As Integer ' 按钮所在的Y坐标
Width As Integer
Height As Integer
textX As Integer ' 按钮文字所在的X坐标 (相对于按钮的坐标)
textY As Integer ' 按钮文字所在的Y坐标
caption As String ' 按钮文字
btnStyle As Integer ' 按钮的类型 0-导航按钮 1-调用功能按钮
included As Integer ' 功能按钮所属的导航按钮
btnPic As Integer ' 按钮的图片序号 导航按钮的图片为-1
End Type
Private Const NAVBTNUM = 5 ' 0 - 5
Private Const FUNBTNUM = 23 ' 0 - 23
Private m_navBtn(NAVBTNUM) As NavButton ' 导航按钮数组
Private m_funBtn(FUNBTNUM) As NavButton ' 功能按钮数组
Private m_oldBtnIndex As Integer ' 选当前按钮之前的导航按钮
Private m_btnIndex As Integer ' 当前选中的导航按钮
Private m_funBtnPic(23) As CDIB ' 功能按钮图片数组
Private m_oldFunBtnIndex As Integer ' 以前选中的功能按钮
Private m_funBtnIndex As Integer ' 当前选中的功能按钮 -1没有选中
Private m_mouseX As Integer
Private m_mouseY As Integer
Private m_drawType As Integer ' 刷新类型 0-画空白画面 1-画导航图
Private m_tempDib As CDIB ' 画图缓冲画板
Private m_backGrounDib As CDIB ' 背景图片
Private m_blankGrounDib As CDIB ' 空背景图片
Private m_navigationBtn As CDIB ' 导航按钮图片
Private m_apiFont As APIFont ' 文字处理对象
Private Sub Form_Load()
Dim i As Integer
Dim strI As String
'按钮设置
m_navBtn(0).btnPic = -1: m_navBtn(0).btnStyle = 0: m_navBtn(0).caption = "公 司 信 息 ": m_navBtn(0).textX = 13: m_navBtn(0).textY = 8: m_navBtn(0).X = 6: m_navBtn(0).Y = 72: m_navBtn(0).Height = 28: m_navBtn(0).Width = 130
m_navBtn(1).btnPic = -1: m_navBtn(1).btnStyle = 0: m_navBtn(1).caption = "生 产 管 理 ": m_navBtn(1).textX = 13: m_navBtn(1).textY = 8: m_navBtn(1).X = 2: m_navBtn(1).Y = 112: m_navBtn(1).Height = 30: m_navBtn(1).Width = 130
m_navBtn(2).btnPic = -1: m_navBtn(2).btnStyle = 0: m_navBtn(2).caption = "外 协 管 理 ": m_navBtn(2).textX = 13: m_navBtn(2).textY = 8: m_navBtn(2).X = 4: m_navBtn(2).Y = 152: m_navBtn(2).Height = 30: m_navBtn(2).Width = 130
m_navBtn(3).btnPic = -1: m_navBtn(3).btnStyle = 0: m_navBtn(3).caption = "质 检 管 理 ": m_navBtn(3).textX = 13: m_navBtn(3).textY = 8: m_navBtn(3).X = 14: m_navBtn(3).Y = 192: m_navBtn(3).Height = 30: m_navBtn(3).Width = 130
m_navBtn(4).btnPic = -1: m_navBtn(4).btnStyle = 0: m_navBtn(4).caption = "库 存 管 理 ": m_navBtn(4).textX = 13: m_navBtn(4).textY = 8: m_navBtn(4).X = 33: m_navBtn(4).Y = 232: m_navBtn(4).Height = 30: m_navBtn(4).Width = 130
m_navBtn(5).btnPic = -1: m_navBtn(5).btnStyle = 0: m_navBtn(5).caption = "系 统 操 作 ": m_navBtn(5).textX = 13: m_navBtn(5).textY = 8: m_navBtn(5).X = 63: m_navBtn(5).Y = 272: m_navBtn(5).Height = 30: m_navBtn(5).Width = 130
m_btnIndex = 0
' m_funBtn(0).btnPic = 0: m_funBtn(0).btnStyle = 0: m_funBtn(0).caption = "采购定单 ": m_funBtn(0).textX = -5: m_funBtn(0).textY = 40: m_funBtn(0).X = 225: m_funBtn(0).Y = 85: m_funBtn(0).Height = 96: m_funBtn(0).Width = 58: m_funBtn(0).included = 0
' m_funBtn(1).btnPic = 1: m_funBtn(1).btnStyle = 1: m_funBtn(1).caption = "采购入库 ": m_funBtn(1).textX = -5: m_funBtn(1).textY = 40: m_funBtn(1).X = 455: m_funBtn(1).Y = 145: m_funBtn(1).Height = 96: m_funBtn(1).Width = 58: m_funBtn(1).included = 0
m_funBtn(2).btnPic = 2: m_funBtn(2).btnStyle = 2: m_funBtn(2).caption = "公司信息 ": m_funBtn(2).textX = -5: m_funBtn(2).textY = 40: m_funBtn(2).X = 225: m_funBtn(2).Y = 150: m_funBtn(2).Height = 96: m_funBtn(2).Width = 58: m_funBtn(2).included = 0
m_funBtn(3).btnPic = 3: m_funBtn(3).btnStyle = 3: m_funBtn(3).caption = "BOM 设计 ": m_funBtn(3).textX = -5: m_funBtn(3).textY = 35: m_funBtn(3).X = 240: m_funBtn(3).Y = 65: m_funBtn(3).Height = 96: m_funBtn(3).Width = 58: m_funBtn(3).included = 1
m_funBtn(4).btnPic = 4: m_funBtn(4).btnStyle = 4: m_funBtn(4).caption = "生产计划单 ": m_funBtn(4).textX = -10: m_funBtn(4).textY = 35: m_funBtn(4).X = 400: m_funBtn(4).Y = 65: m_funBtn(4).Height = 96: m_funBtn(4).Width = 58: m_funBtn(4).included = 1
m_funBtn(5).btnPic = 5: m_funBtn(5).btnStyle = 5: m_funBtn(5).caption = "生产列表单 ": m_funBtn(5).textX = -10: m_funBtn(5).textY = 35: m_funBtn(5).X = 240: m_funBtn(5).Y = 160: m_funBtn(5).Height = 96: m_funBtn(5).Width = 58: m_funBtn(5).included = 1
m_funBtn(6).btnPic = 6: m_funBtn(6).btnStyle = 6: m_funBtn(6).caption = "生产领料单 ": m_funBtn(6).textX = -10: m_funBtn(6).textY = 35: m_funBtn(6).X = 325: m_funBtn(6).Y = 255: m_funBtn(6).Height = 96: m_funBtn(6).Width = 58: m_funBtn(6).included = 1
m_funBtn(7).btnPic = 7: m_funBtn(7).btnStyle = 7: m_funBtn(7).caption = "生产完工单 ": m_funBtn(7).textX = -10: m_funBtn(7).textY = 35: m_funBtn(7).X = 460: m_funBtn(7).Y = 175: m_funBtn(7).Height = 96: m_funBtn(7).Width = 58: m_funBtn(7).included = 1
m_funBtn(8).btnPic = 8: m_funBtn(8).btnStyle = 8: m_funBtn(8).caption = "外协列表 ": m_funBtn(8).textX = -5: m_funBtn(8).textY = 35: m_funBtn(8).X = 230: m_funBtn(8).Y = 80: m_funBtn(8).Height = 96: m_funBtn(8).Width = 58: m_funBtn(8).included = 2
m_funBtn(9).btnPic = 9: m_funBtn(9).btnStyle = 9: m_funBtn(9).caption = "外协发料 ": m_funBtn(9).textX = -5: m_funBtn(9).textY = 30: m_funBtn(9).X = 398: m_funBtn(9).Y = 70: m_funBtn(9).Height = 96: m_funBtn(9).Width = 58: m_funBtn(9).included = 2
m_funBtn(10).btnPic = 10: m_funBtn(10).btnStyle = 10: m_funBtn(10).caption = "外协收工 ": m_funBtn(10).textX = -5: m_funBtn(10).textY = 35: m_funBtn(10).X = 220: m_funBtn(10).Y = 170: m_funBtn(10).Height = 96: m_funBtn(10).Width = 58: m_funBtn(10).included = 2
m_funBtn(11).btnPic = 11: m_funBtn(11).btnStyle = 11: m_funBtn(11).caption = "外协返工 ": m_funBtn(11).textX = -5: m_funBtn(11).textY = 35: m_funBtn(11).X = 455: m_funBtn(11).Y = 135: m_funBtn(11).Height = 96: m_funBtn(11).Width = 58: m_funBtn(11).included = 2
m_funBtn(12).btnPic = 12: m_funBtn(12).btnStyle = 12: m_funBtn(12).caption = "外协索赔 ": m_funBtn(12).textX = -5: m_funBtn(12).textY = 35: m_funBtn(12).X = 290: m_funBtn(12).Y = 242: m_funBtn(12).Height = 96: m_funBtn(12).Width = 58: m_funBtn(12).included = 2
m_funBtn(13).btnPic = 13: m_funBtn(13).btnStyle = 13: m_funBtn(13).caption = "外协统计 ": m_funBtn(13).textX = -5: m_funBtn(13).textY = 35: m_funBtn(13).X = 438: m_funBtn(13).Y = 234: m_funBtn(13).Height = 96: m_funBtn(13).Width = 58: m_funBtn(13).included = 2
m_funBtn(14).btnPic = 14: m_funBtn(14).btnStyle = 14: m_funBtn(14).caption = "质量检验 ": m_funBtn(14).textX = -7: m_funBtn(14).textY = 35: m_funBtn(14).X = 220: m_funBtn(14).Y = 65: m_funBtn(14).Height = 96: m_funBtn(14).Width = 58: m_funBtn(14).included = 3
m_funBtn(15).btnPic = 15: m_funBtn(15).btnStyle = 15: m_funBtn(15).caption = "检验要求 ": m_funBtn(15).textX = -13: m_funBtn(15).textY = 35: m_funBtn(15).X = 400: m_funBtn(15).Y = 65: m_funBtn(15).Height = 96: m_funBtn(15).Width = 58: m_funBtn(15).included = 3
m_funBtn(16).btnPic = 16: m_funBtn(16).btnStyle = 16: m_funBtn(16).caption = "检验项管理 ": m_funBtn(16).textX = -8: m_funBtn(16).textY = 35: m_funBtn(16).X = 448: m_funBtn(16).Y = 225: m_funBtn(16).Height = 96: m_funBtn(16).Width = 58: m_funBtn(16).included = 3
m_funBtn(17).btnPic = 17: m_funBtn(17).btnStyle = 17: m_funBtn(17).caption = "检验值管理 ": m_funBtn(17).textX = -10: m_funBtn(17).textY = 35: m_funBtn(17).X = 250: m_funBtn(17).Y = 215: m_funBtn(17).Height = 96: m_funBtn(17).Width = 58: m_funBtn(17).included = 3
m_funBtn(18).btnPic = 18: m_funBtn(18).btnStyle = 18: m_funBtn(18).caption = "检验组管理 ": m_funBtn(18).textX = -14: m_funBtn(18).textY = 35: m_funBtn(18).X = 448: m_funBtn(18).Y = 225: m_funBtn(18).Height = 96: m_funBtn(18).Width = 58: m_funBtn(18).included = 100 ' 此图标不用
m_funBtn(19).btnPic = 19: m_funBtn(19).btnStyle = 19: m_funBtn(19).caption = "仓库资料 ": m_funBtn(19).textX = -4: m_funBtn(19).textY = 35: m_funBtn(19).X = 230: m_funBtn(19).Y = 85: m_funBtn(19).Height = 96: m_funBtn(19).Width = 58: m_funBtn(19).included = 4
m_funBtn(20).btnPic = 20: m_funBtn(20).btnStyle = 20: m_funBtn(20).caption = "仓库列表 ": m_funBtn(20).textX = -4: m_funBtn(20).textY = 35: m_funBtn(20).X = 455: m_funBtn(20).Y = 145: m_funBtn(20).Height = 96: m_funBtn(20).Width = 58: m_funBtn(20).included = 4
m_funBtn(21).btnPic = 21: m_funBtn(21).btnStyle = 21: m_funBtn(21).caption = "仓 库 单 ": m_funBtn(21).textX = -4: m_funBtn(21).textY = 35: m_funBtn(21).X = 300: m_funBtn(21).Y = 247: m_funBtn(21).Height = 96: m_funBtn(21).Width = 58: m_funBtn(21).included = 4
m_funBtn(22).btnPic = 22: m_funBtn(22).btnStyle = 22: m_funBtn(22).caption = "重新连接 ": m_funBtn(22).textX = -6: m_funBtn(22).textY = 35: m_funBtn(22).X = 230: m_funBtn(22).Y = 75: m_funBtn(22).Height = 96: m_funBtn(22).Width = 58: m_funBtn(22).included = 5
m_funBtn(23).btnPic = 23: m_funBtn(23).btnStyle = 23: m_funBtn(23).caption = "修改密码 ": m_funBtn(23).textX = -3: m_funBtn(23).textY = 35: m_funBtn(23).X = 444: m_funBtn(23).Y = 227: m_funBtn(23).Height = 96: m_funBtn(23).Width = 58: m_funBtn(23).included = 5
m_funBtnIndex = -1
m_oldFunBtnIndex = -1
' 取得资料文件
Set m_backGrounDib = New CDIB
m_backGrounDib.Clone LoadPicture(App.Path & "\resource\pics\25.gif")
Set m_blankGrounDib = New CDIB
m_blankGrounDib.Clone LoadPicture(App.Path & "\resource\pics\blankground.jpg")
Set m_navigationBtn = New CDIB
m_navigationBtn.Clone LoadPicture(App.Path & "\resource\pics\01.gif")
Set m_tempDib = New CDIB
m_tempDib.Create 627, 318
' 读取功能按钮的图片
For i = 0 To FUNBTNUM
strI = i
Set m_funBtnPic(i) = New CDIB
m_funBtnPic(i).Clone LoadPicture(App.Path & "\resource\pics\funBtn" + strI + ".gif")
Next i
Set m_apiFont = New APIFont
Me.caption = MainForm.g_application.m_applicationName + "导航窗体"
m_drawType = 1
Me.Height = 5300
'Picture1.Height = 5250
Me.Width = 9500
Picture1.Width = 9500
'Me.Visible = False
SetToCenter Me ' 窗体巨中
'Set g_application = New HApplication
'Me.Caption = g_application.m_applicationName
'LoginForm.Show vbModal ' 显示登陆窗体
'If g_application.m_loginSucceeded Then
'Me.Visible = True
'NavigationForm.Show
'Else
'Unload Me
'End
'End If
End Sub
Private Sub Picture1_Click()
m_apiFont.setcolor Picture1, 300
' 导航按钮文字处理
Dim i As Integer
For i = 0 To NAVBTNUM
If m_mouseX >= m_navBtn(i).X And m_mouseX < m_navBtn(i).X + m_navBtn(i).Width And _
m_mouseY >= m_navBtn(i).Y And m_mouseY < m_navBtn(i).Y + m_navBtn(i).Height Then
m_oldBtnIndex = m_btnIndex
m_btnIndex = i ' 选中的功能按钮
If m_oldBtnIndex <> m_btnIndex Then
Picture1.Refresh
End If
End If
Next i
' 功能按钮文字处理
m_funBtnIndex = -1
For i = 2 To FUNBTNUM
If m_btnIndex = m_funBtn(i).included Then
If m_mouseX >= m_funBtn(i).X And m_mouseX < m_funBtn(i).X + m_funBtn(i).Width And _
m_mouseY >= m_funBtn(i).Y And m_mouseY < m_funBtn(i).Y + m_funBtn(i).Height Then
m_funBtnIndex = i ' 选中的功能按钮
' 调用功能按钮的操作,调用函数处理
ProcessFunBtn m_funBtnIndex
End If
End If
Next i
m_apiFont.setcolor Picture1, 200
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
m_mouseX = X / 15
m_mouseY = Y / 15
Dim tempX As String: Dim tempY As String
tempX = m_mouseX: tempY = m_mouseY
Label1.caption = "X:" + tempX + " " + "Y:" + tempY
Label1.Refresh
' 导航按钮文字处理
Dim i As Integer
For i = 0 To NAVBTNUM
If X >= m_navBtn(i).X And X < m_navBtn(i).X + m_navBtn(i).Width And _
Y >= m_navBtn(i).Y And Y < m_navBtn(i).X + m_navBtn(i).Height Then
m_btnIndex = i ' 选中的功能按钮
'Picture1.Refresh
End If
Next i
' 功能按钮文字处理
m_oldFunBtnIndex = m_funBtnIndex
m_funBtnIndex = -1
For i = 0 To FUNBTNUM
If m_btnIndex = m_funBtn(i).included Then
If m_mouseX >= m_funBtn(i).X And m_mouseX < m_funBtn(i).X + m_funBtn(i).Width And _
m_mouseY >= m_funBtn(i).Y And m_mouseY < m_funBtn(i).Y + m_funBtn(i).Height Then
m_funBtnIndex = i ' 选中的功能按钮
'Picture1.Refresh
End If
End If
Next i
If m_funBtnIndex = -1 And m_oldFunBtnIndex <> -1 Then
TextOut Picture1.hDC, m_funBtn(m_oldFunBtnIndex).X + m_funBtn(m_oldFunBtnIndex).textX, _
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -