|
把附件中的GHO中添加GHOST.EXE,在硬盘最后分区一部分空间创建为主分区,然后把GHO恢复到此主分区,运行一次F9.COM,大家可以更改内核并修改BAT内容就可以DIY。F1备份 F5还原 F4退出 F8进入DOS命令行 F1 F8功能无界面提示
界面见截图:
==============================================================================
DEFINT A-Z
'-------------------------------------------------------------------
'定义各控件最多可用的数目:
CONST MaxButton = 6, MaxCheck = 0, MaxOptG = 0, MaxOptI = 0
' 按钮 复选按钮 单选按钮(组数),(每组项目数)
CONST MaxFrame = 0, MaxList = 0, MaxListItem = 100, MaxText = 2
' 框架 列表框 , 每一列表项目数 文本框
CONST MaxCombo = 0, MaxLabel = 2, MaxMainMenu = 4, MaxMenuItem = 5
' 下拉式列表 标签 菜单 菜单项目
CONST MaxPercent = 0
CONST ListScrollSpeed = 1 '列表屏幕滚动速度(-1最快)
'$INCLUDE: 'QBWIN.BI'
'$INCLUDE: 'QBWIN.DAT'
SystemInit 1 '系统初始化
'0:不使用中文字库与输入法文件
'1:必须要中文字库文件(QBWIN.FNT),否则程序不能运行
'-1:如果程序找到有中文字库与输入法文件时可以使用,可以不使用
'定义及初始化用户变量区域 ----------------------------
'-----------------------------------------------------
DO
'桌面定义
'格式: DrawDesktop 提示行开关,桌面颜色,提示行字体颜色,背景色,提示文字$
IF exitwin < 2 THEN DrawDesktop 0, 0, 0, 3, "请用鼠标或快捷键操作"
'各表单控件读入区域, 读入各种控件之间用 [=] 表示该种控件读完
SELECT CASE wins
'1st.QWF
CASE 0:
'格式: LoadWindow X,Y,W,H,Font,BC,Box,TC,Caption
LoadWindow 200, 145, 240, 100, 10, 1, -1, 1, "轻轻松松、一键还原![F1&F8]"
RESTORE WIN00
WIN00:
'格式: DATA X,Y,W,H,Enabled,FC,FW,FH,Hotkey,Caption
LoadButton 0 '读入命令按钮 背景框
DATA 20,20,80,30,-1,4,0,12,315," "
DATA 20,20,80,30,-1,4,0,12,322," "
DATA 20,20,80,30,-1,4,0,12,319,"[F5]恢复"
DATA 130,20,80,30,-1,4,0,12,27,"[ESC]退出"
DATA =
END SELECT
IF exitwin = 0 THEN ProcessLoop '过程循环处理
LOOP
SUB C.ButtonClick (NWin, Inx)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 1:SHELL ("backup.bat")
exitwin = 1
wins = 2
END
CASE 2:SHELL ("dos.bat")
exitwin = 1
wins = 2
END
CASE 3:SHELL ("restore.bat")
exitwin = 1
wins = 2
CASE 4:SHELL ("reboot.com")
exitwin = 1
wins = 2
END
END SELECT
END SUB
SUB C.ButtonState (NWin, Inx, State)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.CheckClick (NWin, Inx)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.ComboClick (NWin, Inx)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.FormUnload (NWin, QBCancel)
SELECT CASE NWin
CASE 0:
END SELECT
END SUB
SUB C.FrameClick (NWin, Inx, button)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.FrameDblClick (NWin, Inx)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.FrameMouseInOut (NWin, Inx, State)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.FrameMouseState (NWin, Inx, X, Y, button)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.ListChange (NWin, Inx, CType)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 1:
END SELECT
END SUB
SUB C.ListClick (NWin, Inx)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.ListDblClick (NWin, Inx)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.ListKeyPress (NWin, Inx, KeyCode)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.MenuClick (NWin, MInx, Inx)
DIM Sel AS LONG
Sel = NWin
Sel = Sel * 10000 + MInx * 100 + Inx
SELECT CASE Sel
END SELECT
END SUB
SUB C.OptionClick (NWin, GInx, Inx)
Sel = NWin * 100 + GInx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.TextKeyPress (NWin, Inx, KeyCode)
Sel = NWin * 100 + Inx
SELECT CASE Sel
CASE 0:
END SELECT
END SUB
SUB C.Timer (NWin, KeyCode)
SELECT CASE NWin
CASE 0:
END SELECT
'LOCATE 1, 1: PRINT Mouse.X - Win.X; Mouse.Y - Win.Y
'LOCATE 1, 1: PRINT FRE(-1)
END SUB
SUB DisplayMenu (MenuNo, X, Y)
SHARED XMenu, ContObj
XMenu = MenuNo: ContObj = -1
IF X >= 0 THEN Mouse.X = X: Mouse.Y = Y
XMenu = MenuNo: ContObj = -1
IF X >= 0 THEN Mouse.X = X: Mouse.Y = Y
END SUB
SUB ListAdd (Inx, InsNo, Item$)
XListAdd Inx, InsNo, Item$, ListB(), ListI(), MaxListItem
END SUB
SUB ListRemove (Inx, RemNo)
XListRemove Inx, RemNo, ListB(), ListI(), MaxListItem
END SUB
SUB LoadButton (Cmd)
DO
READ T$: IF T$ = "=" THEN EXIT DO
SumButton = SumButton + 1
B = SumButton
button(B).X = VAL(T$)
READ button(B).Y, button(B).W, button(B).H, button(B).Enabled
READ button(B).FC, button(B).FW, button(B).FH, button(B).Hotkey, ButtonCap(B)
IF Cmd THEN Get3DCmd win.X + button(B).X - 2, win.Y + button(B).Y - 2, button(B).W + 4, button(B).H + 4, -1, Cmd, win
LOOP
END SUB
SUB LoadCheck
DO
READ T$: IF T$ = "=" THEN EXIT DO
SumCheck = SumCheck + 1
B = SumCheck
Check(B).X = VAL(T$)
READ Check(B).Y, Check(B).Enabled
READ Check(B).Value, Check(B).Hotkey, CheckCap(B)
LOOP
END SUB
SUB LoadCombo
DO
READ T$: IF T$ = "=" THEN EXIT DO
SumCombo = SumCombo + 1
B = SumCombo
Combo(B).X = VAL(T$)
L = B + SumList + 1
READ Combo(B).Y, Combo(B).BW, Combo(B).Col, Combo(B).Enabled, HK, Combo(B).G3D
ListB(L).Hotkey = HK
ListB(L).Count = -1: ListB(L).Index = -1
LOOP
END SUB
SUB LoadFrame (Memo)
DO
READ T$: IF T$ = "=" THEN EXIT DO
X = VAL(T$)
READ Y, W, H, FC, FM, BC, Mode, C$
IF Memo THEN
SumFrame = SumFrame + 1
B = SumFrame
Frame(B).X = X: Frame(B).Y = Y
Frame(B).W = W: Frame(B).H = H
END IF
PrintFrame X, Y, W, H, FC, FM, BC, Mode, C$, win
LOOP
END SUB
SUB LoadLabel (Memo, Cmd)
DO
READ T$: IF T$ = "=" THEN EXIT DO
X = VAL(T$)
READ Y, BW, FW, FH, FC, BC, FM, ST, MSG$
Get3DCmd win.X + X - 3, win.Y + Y - 3, BW * 6 + 6 + (FW - 12) * BW, FH + 5, BC, Cmd, win
IF Memo > 0 THEN
SumLabel = SumLabel + 1
B = SumLabel
Label(B).X = X: Label(B).Y = Y
Label(B).FW = FW: Label(B).FH = FH
Label(B).BW = BW: Label(B).FC = FC
Label(B).BC = BC: Label(B).FM = FM
Label(B).Style = ST: LabelCap(B) = MSG$
ELSE
S = 1: MN = -1
DO
E = INSTR(S, MSG$, "`")
EE = E
IF E = 0 THEN EE = LEN(MSG$) + 1
MN = MN + 1
PrintFont X, Y + MN * FH, FW, FH, FC, BC, FM, MID$(MSG$, S, EE - S), win
S = E + 1
LOOP WHILE E > 0
END IF
LOOP
END SUB
SUB LoadList
DO
READ T$: IF T$ = "=" THEN EXIT DO
SumList = SumList + 1
B = SumList
ListB(B).X = VAL(T$)
READ ListB(B).Y, ListB(B).BW, ListB(B).Col, ListB(B).BH, ListB(B).Hotkey, ListB(B).G3D
ListB(B).Count = -1: ListB(B).Index = -1
LOOP
END SUB
SUB LoadMenu
DO
READ T$
IF T$ = "=" THEN EXIT DO
IF T$ = "-" THEN
SumMMenu = SumMMenu + 1: B = SumMMenu: A = 0
READ MenuHotkey(B), Menu(B, A).Enabled
ELSE
Menu(B, A).Enabled = VAL(T$)
END IF
READ Menu(B, A).Value, MenuCap(B, A)
SumMenu(B) = A: A = A + 1
LOOP
END SUB
SUB LoadOption
DO
READ T$
IF T$ = "=" THEN EXIT DO
IF T$ = "-" THEN
SumOptG = SumOptG + 1: B = SumOptG: A = 0
READ OptBValue(B), OptB(B, A).X
ELSE
OptB(B, A).X = VAL(T$)
END IF
READ OptB(B, A).Y, OptB(B, A).Enabled
READ OptB(B, A).Hotkey, OptBCap(B, A)
SumOptI(B) = A: A = A + 1
LOOP
END SUB
SUB LoadPercentbar
DO
READ T$: IF T$ = "=" THEN EXIT DO
SumPercent = SumPercent + 1
B = SumPercent
PercentBar(B).X = VAL(T$)
READ PercentBar(B).Y, PercentBar(B).W, PercentBar(B).H
READ PercentBar(B).FC, PercentBar(B).BC, PercentBar(B).Style
ShowPercentbar B, 0, PercentBar(), win
LOOP
END SUB
SUB LoadText
DO
READ T$: IF T$ = "=" THEN EXIT DO
SumText = SumText + 1
B = SumText
Text(B).X = VAL(T$)
READ Text(B).Y, Text(B).BW, Text(B).Enabled, Text(B).FC
READ Text(B).Password, Text(B).MaxLen, Text(B).Hotkey, Text(B).G3D
LOOP
END SUB
SUB LoadWindow (XX, YY, W, H, Font, BC, Box, TC, T$)
ON ERROR RESUME NEXT
ERASE button, OptB, SumOptI, Check, Frame, ListB, ListI, texttxt, Text
ERASE ButtonCap, OptBCap, OptBRValue, OptBValue, CheckCap, Combo, ComboTXT
ERASE Label, LabelCap, LabelRCap
ERASE Menu, MenuCap, SumMenu, PercentBar
SumPercent = -1
SumButton = -1
SumCheck = -1
SumOptG = -1
SumFrame = -1
SumList = -1
SumText = -1
SumCombo = -1
SumLabel = -1
SumMMenu = -1
DrawWindow XX, YY, W, H, Font, BC, Box, TC, T$, button(), ButtonCap(), win, SumButton
RW = ASC(MID$(win.RetWins, 1, 1))
RW = RW + 1
MID$(win.RetWins, 1, 1) = CHR$(RW)
MID$(win.RetWins, RW + 1, 1) = CHR$(wins)
exitwin = 0
END SUB
SUB msgbox (KeyB$, Titl$, MSG$)
ON ERROR RESUME NEXT
SHARED MsgKey, ContObj
RW = wins
IF LEFT$(KeyB$, 1) = "@" THEN
TWW = 39: H = 110
wins = -2
SumText = SumText + 1
texttxt(SumText) = MSG$: Text(SumText).Hotkey = 9
Text(SumText).Enabled = -1: Text(SumText).FC = 0
Text(SumText).MaxLen = VAL(MID$(KeyB$, 2)): Text(SumText).G3D = -1
Text(SumText).Locate = LEN(MSG$)
KeyB$ = "OC"
MSG$ = Titl$
Titl$ = ""
ELSE
IF Titl$ = "" THEN Titl$ = "信息:洛阳天风 2010.06.11"
wins = -1
H = 90
END IF
S = 1: MN = -1
MS$ = ""
DO
E = INSTR(S, MSG$, "`")
EE = E
IF E = 0 THEN EE = LEN(MSG$) + 1': IF EE - S = 0 THEN MN = -2
IF MN < 0 AND wins = -2 AND Titl$ = "" THEN
Titl$ = MID$(MSG$, S, EE - S)
IF Titl$ = "" THEN Titl$ = "输入"
ELSE
MN = MN + 1
MS$ = MS$ + MKI$(S) + MKI$(EE - S)
END IF
IF EE - S > TWW THEN TWW = EE - S
S = E + 1
LOOP WHILE E > 0
TW = TWW * 6 + 30
KK = LEN(KeyB$)
H = H + 14 * MN: W = 90 + (KK - 1) * 70: IF TW > W THEN W = TW
RRXX = win.X: RRYY = win.Y: RRWW = win.W: RRHH = win.H: RRBC = win.BC
X = -1: Y = -1
'X = Mouse.X: Y = Mouse.Y
'IF X + W > 639 THEN X = 639 - W
'IF Y + H > 450 THEN Y = 450 - H
RSButton = SumButton + 1
mousehide
GetTX X, Y, W, H, 0
DrawWindow X, Y, W, H, 3, 7, 0, 1, CHR$(1) + Titl$, button(), ButtonCap(), win, SumButton
K = SumButton
FOR KA = 0 TO KK - 1
K$ = MID$(KeyB$, KA + 1, 1)
SELECT CASE UCASE$(K$)
CASE "O": C$ = "确定": HK = 13
CASE "Y": C$ = "是(Y)": HK = 277
CASE "N": C$ = "否(N)": HK = 305
CASE "A": C$ = "中断(A)": HK = 286
CASE "R": C$ = "重试(R)": HK = 275
CASE "I": C$ = "忽略(I)": HK = 279
CASE ELSE: C$ = "取消": HK = 27
END SELECT
K = K + 1: ButtonCap(K) = C$: button(K).Hotkey = HK
button(K).X = (W - KK * 68) \ 2 + 68 * KA
button(K).Y = H - 52
button(K).W = 60: button(K).H = 17
button(K).Enabled = 1: button(K).FC = 0
button(K).FW = 0: button(K).FH = 12
NEXT
SumButton = K
FOR A = 0 TO MN
S = CVI(MID$(MS$, A * 4 + 1, 2))
E = CVI(MID$(MS$, A * 4 + 3, 2))
PrintChr win.X + 10, win.Y + 10 + 14 * A, 12, 12, 0, -1, MID$(MSG$, S, E)
NEXT
IF wins = -2 THEN
Text(SumText).BW = TWW - 1
Text(SumText).X = 8
Text(SumText).Y = H - 83
MSG$ = texttxt(SumText)
END IF
exitwin = 0
MsgKey = RSButton
ProcessLoop
PutTX X, Y, 0
SumButton = RSButton - 1
win.X = RRXX: win.Y = RRYY: win.W = RRWW: win.H = RRHH: win.BC = RRBC
KeyB$ = MID$(KeyB$, MsgKey, 1)
IF wins = -2 THEN
SumText = SumText - 1: IF SumText > -1 THEN PrintText 0, 5, 0, Text(), texttxt(), win, CutBoard, 0
IF MsgKey = 1 THEN MSG$ = texttxt(SumText + 1)
END IF
mouseshow
MsgKey = 0: ContObj = 0
wins = RW: exitwin = 0
END SUB
SUB ProcessLoop
DIM PicTime AS SINGLE, InitTime AS SINGLE, RTimeClick AS SINGLE
SHARED XMenu, ContObj, MsgKey, RXInpT, KeyCode
RecWins = wins
IF SumText > -1 AND RecWins <> -1 THEN ContObj = 3 ELSE ContObj = 0
LST = 0: LEND = SumList: XLLCMD = -1: InitControl = -1
IF RecWins = -2 THEN
XInpText = SumText
ELSE
XInpText = 0
END IF
RXInpT = XInpText
mouseshow
DO
IF ContObj <> -1 THEN GetMouse Mouse
KeyCode = 0
IF NOT InitControl THEN
GetKey KeyCode
C.Timer RecWins, KeyCode
END IF
RTextI = 0
IF ContObj <> 4 AND ContObj < 10 THEN
XRKCL = XKCL
XRLCMD = XXLCMD: A = 0
FOR XLCMD = MsgKey TO SumButton
IF button(XLCMD).Enabled <> button(XLCMD).REnabled OR InitControl AND XLCMD > RSButton THEN PrintButton XLCMD, InitControl - 2, button(), ButtonCap(), win: C.ButtonState RecWins, (XLCMD), 1
GotFocus xicmd, (button(XLCMD).X), (button(XLCMD).Y), (button(XLCMD).W), (button(XLCMD).H), Mouse, win
HK = KeyCode = button(XLCMD).Hotkey
IF (xicmd OR HK) AND button(XLCMD).Enabled THEN
IF Mouse.K = 1 AND Mouse.RK = 0 OR Mouse.K = 1 AND XLLCMD = XLCMD OR HK THEN
IF A <> 2 THEN XLLCMD = XLCMD: IF HK THEN A = 2 ELSE XKCL = 2
ContObj = 7
ELSE
XKCL = -1
IF Mouse.K = 0 AND Mouse.RK = 1 THEN XKCL = 1
END IF
XXLCMD = XLCMD
IF A = 0 THEN A = 1
END IF
NEXT
IF XRLCMD <> XXLCMD OR A = 0 THEN
XKCL = 0
IF XRKCL = 2 THEN XKCL = 1
IF Mouse.K = 0 AND Mouse.RK = 1 THEN XLLCMD = -1
END IF
IF XKCL <> XRKCL THEN
PrintButton XRLCMD, XKCL, button(), ButtonCap(), win
C.ButtonState RecWins, (XRLCMD), (XKCL)
END IF
IF Mouse.K = 0 AND XLLCMD = XXLCMD AND Mouse.RK = 1 OR A = 2 THEN
IF RecWins < 0 THEN
Mouse.K = -99: RXInpT = 0: MsgKey = XLLCMD - MsgKey: exitwin = 2
ELSE
C.ButtonClick RecWins, (XLLCMD)
IF MsgKey = XLLCMD THEN exitwin = 2
END IF
END IF
'IF Mouse.K = 1 AND Mouse.RK = 0 THEN
' GotFocus I, -5, -30, (Win.W), (Win.H), Mouse, Win
' IF I = 0 THEN BEEP
'END IF
IF RecWins <> -1 THEN
IF RecWins = -2 THEN
RSText = SumText
IF RContObj = 3 AND ContObj <> 3 THEN PrintText XInpText, 3, 0, Text(), texttxt(), win, CutBoard, XPutII
RContObj = ContObj
ELSE
RSText = 0
END IF
FOR L = RSText TO SumText
IF InitControl THEN
PrintText L, 5, 0, Text(), texttxt(), win, CutBoard, 0
IF L = SumText THEN PrintText XInpText, 5, 0, Text(), texttxt(), win, CutBoard, 0
ELSE
X = Text(L).X: Y = Text(L).Y: W = (Text(L).BW) * 6 + 8
GotFocus I, X, Y + 1, W, 17, Mouse, win
IF I THEN RTextI = 1
A = (KeyCode = Text(L).Hotkey)
IF I AND Mouse.K <> 0 AND Mouse.RK = 0 OR A THEN
PrintText RXInpT, 3, 0, Text(), texttxt(), win, CutBoard, 1
IF A = 0 THEN Text(L).Locate = (Mouse.X - (win.X + X) + 1) \ 6
XInpText = L: ContObj = 3
PrintText L, 4, 0, Text(), texttxt(), win, CutBoard, 0: RXInpT = XInpText
END IF
IF Text(L).Enabled <> Text(L).REnabled THEN
PrintText RXInpT, 3, 0, Text(), texttxt(), win, CutBoard, 1
PrintText L, 5, 0, Text(), texttxt(), win, CutBoard, 0
RXInpT = L
END IF
END IF
NEXT
IF ContObj = 3 THEN
IF KeyCode <> 0 THEN
'IF KeyCode = 328 THEN XInpText = XInpText - 1: IF XInpText < RSText THEN XInpText = SumText
'IF KeyCode = 336 OR
IF KeyCode = 9 THEN XInpText = XInpText + 1: IF XInpText > SumText THEN XInpText = RSText
ELSE
IF TIMER - PicTime > .4 THEN XPutII = 0
IF TIMER - PicTime > .9 THEN XPutII = 1: PicTime = TIMER
END IF
IF RXInpT <> XInpText THEN
PrintText RXInpT, 3, 0, Text(), texttxt(), win, CutBoard, 1
PrintText XInpText, 4, 0, Text(), texttxt(), win, CutBoard, 0
RXInpT = XInpText
ELSE
IF XPutII <> RXPutII OR KeyCode > 0 THEN
RXPutII = XPutII
PrintText XInpText, 2, KeyCode, Text(), texttxt(), win, CutBoard, XPutII
IF KeyCode <> 0 THEN C.TextKeyPress RecWins, XInpText, KeyCode
END IF
END IF
END IF
END IF
END IF
IF RRTextI <> RTextI THEN RRTextI = RTextI: SetMouseCursor RTextI
IF RecWins > -1 THEN
IF ContObj <> 4 THEN
II = 0
IF ContObj = 11 THEN
'IF Menu(XMenu, 0).Enabled THEN
XMenuHI = Menu(XMenu, 0).Enabled
IF XMenuHI > SumMenu(XMenu) THEN XMenuHI = SumMenu(XMenu)
MW = (SumMenu(XMenu) - 1) \ XMenuHI + 1
GotFocus II, RKMenuX + 2, RKMenuY - 3, MenuWidth * MW - 4, XMenuHI * 14 + 4, Mouse, win
IF II AND (Mouse.Y <> XRMouseY OR Mouse.X <> XRMouseX) AND Mouse.Y > win.Y + RKMenuY THEN
XMINX = ((Mouse.X - win.X - RKMenuX - 1) \ MenuWidth) * XMenuHI + (Mouse.Y - win.Y - RKMenuY - 1) \ 14 + 1
IF XMINX > SumMenu(XMenu) THEN XMINX = XRMINX
XRMouseY = Mouse.Y: XRMouseX = Mouse.X
END IF
IF II = 0 THEN IF Mouse.K = 1 THEN XMINX = 0
FOR A = 0 TO SumMenu(XMenu)
IF KeyCode = 336 THEN XMINX = XMINX + 1: IF XMINX > SumMenu(XMenu) THEN XMINX = 1
IF KeyCode = 328 THEN XMINX = XMINX - 1: IF XMINX < 1 THEN XMINX = SumMenu(XMenu)
IF MenuCap(XMenu, XMINX) <> "" THEN EXIT FOR
NEXT
IF KeyCode < 256 THEN
FOR A = 1 TO SumMenu(XMenu)
Cap$ = MenuCap(XMenu, A): L = INSTR(Cap$, "(")
Cap$ = UCASE$(MID$(Cap$, L + 1, 1))
IF Cap$ = UCASE$(CHR$(KeyCode)) THEN Mouse.K = 0: Mouse.RK = 1: XMINX = A: II = -1: EXIT FOR
NEXT
END IF
IF KeyCode = 13 THEN Mouse.K = 0: Mouse.RK = 1: II = -1
IF XMINX <> XRMINX THEN PrintMenu XMenu, XRMINX, XMINX, 4, Menu(), MenuCap(), SumMenu(), win, RKSMenuX, RKSMenuY, RKMenuX, RKMenuY, MenuWidth: XRMINX = XMINX
IF Mouse.K = 0 AND Mouse.RK = 1 AND Menu(XMenu, XMINX).Enabled AND MenuCap(XMenu, XMINX) <> "" THEN IF XMINX > 0 THEN XPUT = 2 ELSE XPUT = 1
'END IF
IF (Mouse.K = 0 AND Mouse.RK > 0 OR RKSMenuX = -1 AND Mouse.K = 2 AND Mouse.RK = 0) AND II = 0 THEN XPUT = 1
PR = 0
IF KeyCode = 27 THEN XPUT = 1
IF RKSMenuX <> -1 THEN
IF KeyCode = 333 THEN XMenu = XMenu + 1: PR = -1: IF XMenu > SumMMenu THEN XMenu = 0
IF KeyCode = 331 THEN XMenu = XMenu - 1: PR = -1: IF XMenu < 0 THEN XMenu = SumMMenu
END IF
IF PR THEN XPUT = 2: XMINX = 0: ContObj = 10: XRMouseX = Mouse.X: XRMouseY = Mouse.Y
END IF
RKSMX = 0: RKSMY = -1
FOR M = 0 TO SumMMenu
IF M > 0 THEN
RKSMX = RKSMX + (LEN(MenuCap(M - 1, 0)) + 2) * 6 + 2
IF RKSMX + (LEN(MenuCap(M, 0)) + 2) * 6 + 2 > win.W - 7 THEN RKSMX = 0: RKSMY = RKSMY + 14
END IF
GotFocus I, RKSMX - 1, RKSMY - 1, 6 * (LEN(MenuCap(M, 0)) + 2) + 2, 14, Mouse, win
IF I AND II = 0 OR KeyCode = MenuHotkey(M) THEN
IF Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = MenuHotkey(M) OR XMenu <> M AND ContObj = 11 AND (Mouse.X <> XRMouseX OR Mouse.Y <> XRMouseY) THEN
IF ContObj = 11 THEN XPUT = 1
ContObj = 10: XMenu = M: XRMouseX = Mouse.X: XRMouseY = Mouse.Y
END IF
END IF
IF InitControl THEN
PrintMenu M, -1, -1, 0, Menu(), MenuCap(), SumMenu(), win, RKSMX, RKSMY, RKMenuX, RKMenuY, MenuWidth
IF M = SumMMenu THEN mousehide: Get3DBox (win.X), (win.Y) + RKSMY + 14, (win.W) - 8, 1, 8, 15, -1: mouseshow
END IF
IF M = XMenu AND ContObj = 10 THEN RKSMenuX = RKSMX: RKSMenuY = RKSMY: RKMenuX = RKSMenuX - 1: RKMenuY = RKSMenuY + 16
NEXT
IF XPUT THEN
PrintMenu XRMenu, -1, -1, 3, Menu(), MenuCap(), SumMenu(), win, RRKSMX, RRKSMY, RRKMX, RRKMY, RMW
IF XRMenu = XMenu THEN ContObj = 0
XRMenu = XMenu
IF XPUT = 2 THEN
C.MenuClick RecWins, XMenu, XMINX
ELSE
C.MenuClick -RecWins, -XMenu, 0
END IF
XPUT = 0: Mouse.K = -100: Mouse.RK = -100
RRTextI = 0: KeyCode = 0
END IF
IF ContObj = -1 THEN
SetMouseCursor 0: ContObj = 10
RKMenuY = Mouse.Y - win.Y + 3
RKMenuX = Mouse.X - win.X
RKSMenuX = -1
END IF
END IF
IF RContObj = 3 AND ContObj <> 3 THEN PrintText XInpText, 3, 0, Text(), texttxt(), win, CutBoard, XPutII
IF RContObj = 5 AND ContObj <> 5 THEN PrintCombo XCombo, 3, 0, Combo(), ComboTXT(), win
RContObj = ContObj
IF ContObj = 10 THEN
C.MenuClick RecWins, XMenu, 0
PrintMenu XMenu, -1, 0, 1, Menu(), MenuCap(), SumMenu(), win, RKSMenuX, RKSMenuY, RKMenuX, RKMenuY, MenuWidth
XRMenu = XMenu: XRMINX = 0: XMINX = 0
ContObj = 12
RRKSMX = RKSMenuX: RRKSMY = RKSMenuY
RRKMX = RKMenuX: RRKMY = RKMenuY: RMW = MenuWidth
END IF
IF ContObj = 12 AND Mouse.K = 0 AND Mouse.RK = 0 THEN ContObj = 11
IF ContObj < 10 THEN
IF (ContObj = 2 OR ContObj = 4) AND KeyCode > 0 THEN
I = ListB(XList).Index: S = ListB(XList).ScInx
B = S + ListB(XList).BH * ListB(XList).Col
IF KeyCode = 331 AND I > ListB(XList).BH - 1 THEN I = I - ListB(XList).BH: IF I < S THEN S = S - ListB(XList).BH
IF KeyCode = 333 AND I < ListB(XList).Count - ListB(XList).BH + 1 THEN I = I + ListB(XList).BH: IF I > B - 1 THEN S = S + ListB(XList).BH
IF KeyCode = 328 AND I > 0 THEN I = I - 1: IF I < S OR ListB(XList).BW <= 0 THEN IF ListB(XList).Col > 1 THEN S = S - ListB(XList).BH ELSE S = S - 1: I = S
IF KeyCode = 336 AND I < ListB(XList).Count THEN
I = I + 1
IF I > B - 1 OR ListB(XList).BW <= 0 THEN IF ListB(XList).Col > 1 THEN S = S + ListB(XList).BH ELSE S = S + 1: I = B
END IF
IF ContObj = 4 THEN
IF KeyCode = 13 THEN XComExit = 2: KeyCode = 0
IF KeyCode = 27 THEN XComExit = 1: KeyCode = 0
END IF
ListB(XList).Index = I: ListB(XList).ScInx = S
IF I > -1 THEN C.ListKeyPress RecWins, XList, KeyCode
END IF
RXL = XXL: XXX = 0
FOR XL = LST TO LEND
IF InitControl OR ContObj = -9 THEN
PrintList XL, -1, 1, 0, -2, ListB(), ListI(), win: IF ContObj = -9 THEN ContObj = 4
ELSE
X = ListB(XL).X + 2: Y = ListB(XL).Y + 2: W = (ListB(XL).BW * ListB(XL).Col) * 6 + ListB(XL).Col * 3: H = ListB(XL).BH * 14 + 1
GotFocus XILIT, X, Y, W + 18, H, Mouse, win
IF RXL <> XL AND PK AND XILIT THEN ListB(XXL).RCount = -2
IF (XILIT OR KeyCode = ListB(XL).Hotkey) AND ListB(XL).Count >= 0 AND XXX = 0 THEN
IF (Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = ListB(XL).Hotkey) AND ContObj <> 4 THEN ContObj = 2: XList = XL
GotFocus XLIL, X + W, Y, 18, H, Mouse, win
MY = Mouse.Y - (win.Y + Y)
MX = Mouse.X - (win.X + X)
IF XLIL THEN
XSYY = -1
XMS = ListB(XL).Count - ListB(XL).BH * ListB(XL).Col + 1
IF XMS > 0 THEN
IF Mouse.K <> 1 AND Mouse.RK <> Mouse.K THEN PK = 0: MCNT = 0: NK = RNK: PR = 1: EXIT FOR
IF Mouse.K = 1 AND Mouse.RK = 0 THEN
NK = 5: PK = 1
IF MY < 16 THEN NK = 2 ELSE IF MY > H - 14 THEN NK = 3
PR = 1: RTimeClick = TIMER: InitTime = .4
RNK = NK
END IF
END IF
ELSE
IF RNK <> 0 AND Mouse.K <> 1 THEN RXL = XL: PK = 0: MCNT = 0: NK = 4: PR = 1: XSYY = -1: RNK = 0
IF Mouse.K <> 0 AND Mouse.RK = 0 OR ContObj = 4 AND (XRMouseY <> Mouse.Y OR XRMouseX <> Mouse.X) THEN
IL = (MY - 1) \ 14: JL = (MX - 1) \ (ListB(XL).BW * 6 + 3)
IL = ListB(XL).ScInx + JL * ListB(XL).BH + IL
IF IL > ListB(XL).Count THEN IL = -1
ListB(XL).Index = IL: XRMouseY = Mouse.Y: XRMouseX = Mouse.X
END IF
IF Mouse.K = 1 AND Mouse.RK = 0 THEN
IF ContObj = 4 THEN
XComExit = 2
ELSE
IF Mouse.DC AND IL > -1 AND ListB(XL).Index = ListB(XL).rIndex THEN C.ListDblClick RecWins, XL
END IF
END IF
END IF
MCNT = 0
IF Mouse.K = 1 AND (TIMER - RTimeClick > InitTime AND (RNK = 2 OR RNK = 3) OR RNK = 5) THEN MCNT = 1: RTimeClick = TIMER: InitTime = ListScrollSpeed / 10
IF Mouse.K = 1 AND Mouse.RK = 0 OR MCNT THEN
S = ListB(XL).ScInx
IF RNK = 2 AND S > 0 THEN S = S - 1
IF RNK = 5 THEN
XSYY = MY - 15
IF XSYY < 0 THEN XSYY = 0
IF XSYY <> XRY THEN PR = 1: XRY = XSYY
END IF
IF RNK = 3 AND S < XMS + -(ListB(XL).Col > 1) * (ListB(XL).BH - ListB(XL).Count MOD ListB(XL).BH - 1) THEN S = S + 1
ListB(XL).ScInx = S
END IF
XXL = XL: XXX = 1
ELSE
IF RNK <> 0 THEN PK = 1
END IF
XPR = -1: XI = -1
B = ListB(XL).Index <> ListB(XL).rIndex
IF ListB(XL).Count <> ListB(XL).RCount THEN
XPR = 4
ELSEIF ListB(XL).ScInx <> ListB(XL).RScInx THEN
XPR = 5
ELSEIF B THEN
XI = ListB(XL).rIndex
XPR = 0
END IF
IF XPR > -1 THEN
RInx = ListB(XL).Index
RrInx = ListB(XL).rIndex
PrintList XL, XI, XPR, 0, -1, ListB(), ListI(), win
RInx2 = ListB(XL).Index
RrInx2 = ListB(XL).rIndex
ListB(XL).Index = RInx
ListB(XL).rIndex = RrInx
C.ListChange RecWins, XL, XPR
ListB(XL).Index = RInx2
ListB(XL).rIndex = RrInx2
END IF
IF B AND ListB(XL).Index > -1 THEN C.ListClick RecWins, XL
END IF
NEXT
IF XXX = 0 AND PK THEN PR = 1: PK = 0: NK = RNK: XRY = -1: MCNT = 0: RNK = 0
IF PR AND RXL <= LEND THEN
RScInx = ListB(RXL).ScInx
PrintList RXL, -2, NK, PK, XSYY, ListB(), ListI(), win: PR = 0
IF RScInx <> ListB(RXL).ScInx THEN C.ListChange RecWins, RXL, 9
END IF
IF XXX = 0 AND ContObj = 4 AND Mouse.K = 1 AND Mouse.RK = 0 THEN XComExit = 1
IF XComExit AND Mouse.K = 0 THEN
IF XComExit = 1 OR ListB(LEND).Index < 0 THEN ListB(LEND).Index = XComIndex: XComExit = 0
IF XComExit = 2 THEN SetCombo XCombo, (ListB(LEND).Index)
ContObj = 5: Mouse.RK = 0
mousehide
PutTX win.X + Combo(XCombo).X, XCOMY, 0
mouseshow
PrintCombo XCombo, 4, 0, Combo(), ComboTXT(), win
IF XComExit = 2 THEN C.ComboClick RecWins, XCombo
XComExit = 0
LST = 0: LEND = SumList
END IF
IF ContObj <> 4 THEN
FOR T = 0 TO SumLabel
IF LabelCap(T) <> LabelRCap(T) OR InitControl THEN PrintLabel T, Label(), LabelCap(), LabelRCap(), win
NEXT
FOR T = 0 TO SumOptG
FOR L = 0 TO SumOptI(T)
IF OptB(T, L).Enabled <> OptB(T, L).REnabled OR InitControl THEN PrintOption T, L, 11, OptB(), OptBRValue(), OptBValue(), OptBCap(), win, SumOptI()
GotFocus I, (OptB(T, L).X), (OptB(T, L).Y), LEN(OptBCap(T, L)) * 6 + 16, 12, Mouse, win
IF (I AND Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = OptB(T, L).Hotkey) AND OptB(T, L).Enabled THEN
OptBValue(T) = L
ContObj = 1
END IF
NEXT
IF OptBValue(T) <> OptBRValue(T) THEN
PrintOption T, -1, 0, OptB(), OptBRValue(), OptBValue(), OptBCap(), win, SumOptI()
C.OptionClick RecWins, T, (OptBValue(T))
END IF
NEXT
FOR L = 0 TO SumCheck
IF Check(L).Enabled <> Check(L).REnabled OR InitControl THEN PrintCheck L, 11, Check(), CheckCap(), win
GotFocus I, (Check(L).X), (Check(L).Y), LEN(CheckCap(L)) * 6 + 16, 12, Mouse, win
IF (I AND Mouse.RK = 1 AND Mouse.K = 0 OR KeyCode = Check(L).Hotkey) AND Check(L).Enabled THEN
Check(L).Value = NOT Check(L).Value
ContObj = 6
END IF
IF Check(L).Value <> Check(L).RValue THEN
PrintCheck L, 0, Check(), CheckCap(), win
C.CheckClick RecWins, L
END IF
NEXT
FOR A = 0 TO SumFrame
GotFocus I, (Frame(A).X), (Frame(A).Y), (Frame(A).W), (Frame(A).H), Mouse, win
IF I THEN
IF Frame(A).GF = 0 THEN Frame(A).GF = -1: C.FrameMouseInOut RecWins, A, 1
IF Mouse.X <> Mouse.RX OR Mouse.Y <> Mouse.RY OR Mouse.K <> 0 OR Mouse.RK <> Mouse.K THEN C.FrameMouseState RecWins, A, (Mouse.X - win.X - Frame(A).X), (Mouse.Y - win.Y - Frame(A).Y), (Mouse.K)
IF Mouse.DC THEN
C.FrameDblClick RecWins, A
ELSEIF Mouse.K = 0 AND Mouse.RK <> 0 THEN
C.FrameClick RecWins, A, (Mouse.RK)
END IF
'EXIT FOR
ELSE
IF Frame(A).GF THEN Frame(A).GF = 0: C.FrameMouseInOut RecWins, A, 0
END IF
NEXT
FOR XLCOM = 0 TO SumCombo
IF Combo(XLCOM).Enabled <> Combo(XLCOM).REnabled OR InitControl THEN PrintCombo XLCOM, 1, 0, Combo(), ComboTXT(), win
X = Combo(XLCOM).X: Y = Combo(XLCOM).Y: W = (Combo(XLCOM).BW) * 6
IF Combo(XLCOM).G3D > 0 THEN A = 1 ELSE A = 0
GotFocus I, X + A * (W + 7), Y + 1, (1 - A) * W + 23 - A * 5, 21, Mouse, win
IF (I AND Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = ListB(SumList + XLCOM + 1).Hotkey) AND Combo(XLCOM).Enabled THEN
PrintCombo XCombo, 3, 0, Combo(), ComboTXT(), win
mousehide
GetTX win.X + X, XCOMY, W + 25, H - 22, 0
mouseshow
PrintCombo XLCOM, 2, 1, Combo(), ComboTXT(), win
ContObj = -9: XCombo = XLCOM
A = SumList + XLCOM + 1: XList = A
ListB(A).BH = ListB(A).Count + 1: IF ListB(A).BH > 8 THEN ListB(A).BH = 8
IF ListB(A).BH < 2 THEN ListB(A).BH = 1
LST = A: LEND = A: XComIndex = ListB(A).Index
H = ListB(A).BH * 14 + 2
B = Combo(XLCOM).G3D <> 0
XCOMY = win.Y + Y + 18 - B
IF XCOMY + H > 455 THEN XCOMY = XCOMY - H - 20 + B * 2
ListB(A).BW = Combo(XCombo).BW
ListB(A).Col = (ListB(A).Count \ ListB(A).BH) + 1
IF ListB(A).Col > Combo(XLCOM).Col THEN ListB(A).Col = Combo(XLCOM).Col
B = ListB(A).BW * ListB(A).Col * 6 + 20 + (ListB(A).Col - 1) * 3
ListB(A).X = Combo(XCombo).X
IF ListB(A).X + B + win.X + 3 > 640 THEN ListB(A).X = 640 - B - win.X - 3
ListB(A).Y = XCOMY - win.Y
IF RContObj = 3 THEN PrintText XInpText, 3, 0, Text(), texttxt(), win, CutBoard, 1
mousehide
DrawBackBlock win.X + ListB(A).X, win.Y + ListB(A).Y, B, H, 5
mouseshow
C.ComboClick RecWins, -XCombo - 1
END IF
NEXT
END IF
END IF
END IF
InitControl = 0
IF exitwin THEN
IF RecWins < 0 THEN EXIT DO
A = 0
C.FormUnload RecWins, A
IF A = 0 THEN
IF wins = RecWins THEN
B = ASC(MID$(win.RetWins, 1, 1))
IF B <= 1 THEN unloadme
wins = ASC(MID$(win.RetWins, B, 1))
B = B - 2
IF B < 0 THEN B = 0
MID$(win.RetWins, 1, 1) = CHR$(B)
END IF
EXIT DO
ELSE
exitwin = 0: wins = RecWins
END IF
END IF
LOOP
mousehide
END SUB
SUB SetCombo (Inx, InxNo)
A = Inx + SumList + 1
ListB(A).Index = InxNo
IF InxNo < 0 THEN ComboTXT(Inx) = "" ELSE ComboTXT(Inx) = ListI(A, InxNo)
Combo(Inx).REnabled = 2
END SUB
==============================================================================
[ 本帖最后由 天风 于 2010-6-13 08:21 编辑 ] |
|