#include-once
#include <WindowsConstants.au3>
#include <GuiToolbar.au3>
#include <GuiConstantsEx.au3>
#include <Constants.au3>
#Include <GuiImageList.au3>
Local Enum $idOpen=1000 , $idSave,$idMDconfig, $idHDfactor,$idMCconfig,$idclose
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\桌面\Main_Form.kxf
$Main_Form = GUICreate("Low Cost Gramload Tester Program (Ver2.5A)", 810, 571, 192, 124,$WS_OVERLAPPEDWINDOW)
$Menu_File = GUICtrlCreateMenu("&File")
$Menu_File_New = GUICtrlCreateMenuItem("New", $Menu_File)
$Menu_File_Open = GUICtrlCreateMenuItem("Open"&@TAB&"F3", $Menu_File)
$Menu_File_Close = GUICtrlCreateMenuItem("Close", $Menu_File)
GUICtrlSetState(-1, $GUI_Disable)
GUICtrlCreateMenuItem("", $Menu_File)
$Menu_File_Save = GUICtrlCreateMenuItem("Save", $Menu_File)
$Menu_File_SaveAs = GUICtrlCreateMenuItem("Save As", $Menu_File)
GUICtrlCreateMenuItem("", $Menu_File)
$Menu_File_ModelConfig = GUICtrlCreateMenuItem("Model Config"&@TAB&"F4", $Menu_File)
GUICtrlSetState(-1, $GUI_Disable)
$Menu_File_HDConfig = GUICtrlCreateMenuItem("HD Config", $Menu_File)
GUICtrlSetState(-1, $GUI_Disable)
$Menu_File_MachineConfig = GUICtrlCreateMenuItem("Machine Config "&@TAB&"F5", $Menu_File)
GUICtrlCreateMenuItem("", $Menu_File)
$Menu_File_Exit = GUICtrlCreateMenuItem("Exit"&@TAB&"Alt+F4", $Menu_File)
$Menu_Setup = GUICtrlCreateMenu("&Setup")
$Menu_Setup_Diagnostic = GUICtrlCreateMenuItem("Diagnostic...", $Menu_Setup)
GUICtrlSetState(-1, $GUI_Disable)
$Menu_Setup_GoUp = GUICtrlCreateMenuItem("Go Up", $Menu_Setup)
GUICtrlSetState(-1, $GUI_Disable)
$Menu_Setup_Download = GUICtrlCreateMenuItem("Download", $Menu_Setup)
GUICtrlSetState(-1, $GUI_Disable)
$Menu_Setup_ChangePassword = GUICtrlCreateMenu("Change Password ...", $Menu_Setup)
$Menu_Setup_PRMPassword = GUICtrlCreateMenuItem("PRM Mode ...", $Menu_Setup_ChangePassword)
$Menu_Setup_RWKPassword = GUICtrlCreateMenuItem("RWK Mode ...", $Menu_Setup_ChangePassword)
$Menu_Set_ENGPassword = GUICtrlCreateMenuItem("ENG Mode ...", $Menu_Setup_ChangePassword)
GUICtrlCreateMenuItem("", $Menu_Setup_ChangePassword)
$Menu_Setup_Technical = GUICtrlCreateMenuItem("Technical ...", $Menu_Setup_ChangePassword)
$Menu_Setup_Supervisor = GUICtrlCreateMenuItem("Supervisor ...", $Menu_Setup_ChangePassword)
$Menu_Setup_Engineer = GUICtrlCreateMenuItem("Engineer ...", $Menu_Setup_ChangePassword)
$Menu_Production = GUICtrlCreateMenu("&Prduction")
GUICtrlSetState(-1, $GUI_Disable)
$Menu_Production_Employee = GUICtrlCreateMenuItem("Employee Number ...", $Menu_Production)
$Menu_Production_SBR = GUICtrlCreateMenuItem("SBR Number ...", $Menu_Production)
$Menu_Production_Fixture = GUICtrlCreateMenuItem("Fixtrue Number ...", $Menu_Production)
$Menu_Production_TestMode = GUICtrlCreateMenuItem("Test Mode", $Menu_Production)
$Menu_Production_PRMBuild = GUICtrlCreateMenuItem("Prime Build ..."&@TAB&"F9", $Menu_Production)
$Menu_Production_RWKBuild = GUICtrlCreateMenuItem("Rework Build ..."&@TAB&"F10", $Menu_Production)
$Menu_Production_ENGBuild = GUICtrlCreateMenuItem("Engineer Build ..."&@TAB&"F11", $Menu_Production)
$Menu_Windows = GUICtrlCreateMenu("&Windows")
$MenuItem3 = GUICtrlCreateMenuItem("Cascade", $Menu_Windows)
GUICtrlSetState(-1, $GUI_Disable)
$MenuItem2 = GUICtrlCreateMenuItem("Tile", $Menu_Windows)
GUICtrlSetState(-1, $GUI_Disable)
$MenuItem4 = GUICtrlCreateMenuItem("Arrange Icon", $Menu_Windows)
GUICtrlSetState(-1, $GUI_Disable)
$MenuItem1 = GUICtrlCreateMenuItem("Minimize All", $Menu_Windows)
GUICtrlSetState(-1, $GUI_Disable)
$Menu_Help = GUICtrlCreateMenu("&Help")
$Menu_Help_About = GUICtrlCreateMenuItem("About ..."&@TAB&"F1", $Menu_Help)
GUISetIcon("C:\Lc_gram\1.ico", -1)
Dim $Main_Form_AccelTable[8][2] = [["{F3}", $Menu_File_Open],["{F4}", $Menu_File_ModelConfig],["{F5}", $Menu_File_MachineConfig],["!{F4}", $Menu_File_Exit],["{F9}", $Menu_Production_PRMBuild],["{F10}", $Menu_Production_RWKBuild],["{F11}", $Menu_Production_ENGBuild],["{F1}", $Menu_Help_About]]
GUISetAccelerators($Main_Form_AccelTable)
$hToolbar = _GUICtrlToolbar_Create($Main_Form,$TBSTYLE_FLAT)
$hToolBar_Image = _GUIImageList_Create(32, 32, 5)
_GUIImageList_AddIcon($hToolBar_Image, @SystemDir & "\images\open.ico", 0)
_GUIImageList_AddIcon($hToolBar_Image, @SystemDir & "\images\save.ico", 1)
_GUIImageList_AddIcon($hToolBar_Image, @SystemDir & "\images\md_config.ico", 2)
_GUIImageList_AddIcon($hToolBar_Image, @SystemDir & "\images\hd_factor.ico", 3)
_GUIImageList_AddIcon($hToolBar_Image, @SystemDir & "\images\mc_config", 4)
_GUIImageList_AddIcon($hToolBar_Image, @SystemDir & "\images\close.ico", 5)
_GUICtrlToolbar_SetImageList($hToolBar, $hToolBar_Image)
; Add buttons
_GUICtrlToolbar_AddButton($hToolBar, $idopen, 0)
;_GUICtrlToolbar_EnableButton ($hToolbar, $idOpen, False)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, 1)
_GUICtrlToolbar_AddButton($hToolbar, $idMDconfig,2)
_GUICtrlToolbar_AddButton($hToolbar, $idHDfactor,3)
_GUICtrlToolbar_AddButton($hToolbar, $idMCconfig,4)
_GUICtrlToolbar_AddButton($hToolbar, $idclose,5)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
If $nMsg[1] = $Main_Form Then
GUIDelete($Main_Form)
Exit
EndIf
Case $Menu_Help_About
MsgBox(0,"About","123")
;GUISetState($Main_Form,$GUI_Enable)
;Case $Help_GUI_Btn
EndSwitch
WEnd