Skip to content

Commit

Permalink
Fixed allowed internal functions list.
Browse files Browse the repository at this point in the history
Minor changes to Export window.
  • Loading branch information
Pulover committed Apr 29, 2016
1 parent 7ff0aff commit 56c3953
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 221 deletions.
20 changes: 10 additions & 10 deletions Documentation/MacroCreator_Help-doc/Examples/SaveScreenshot.pmc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[PMC Code v5.0.0]|+F1||1|Window,2,Fast,0,1|1|EntireScreen
Groups=
[PMC Code v5.0.2]|+F1||1|Window,2,Fast,0,1,Input,-1,-1,1|1|EntireScreen
Groups=Start:1
1|PrintScreen|{PrintScreen}|1|333|Send|||||
2|[Goto]|SaveScreenshot3|1|0|Gosub|||||
2|[Gosub]|SaveScreenshot|1|0|Gosub|||||

[PMC Code v5.0.0]|+F2||1|Window,2,Fast,0,1|1|CurrentWindow
Groups=
[PMC Code v5.0.2]|+F2||1|Window,2,Fast,0,1,Input,-1,-1,1|1|CurrentWindow
Groups=Start:1
1|Alt + PrintScreen|{Alt Down}{PrintScreen}{Alt Up}|1|333|Send|||||
2|[Goto]|SaveScreenshot3|1|0|Gosub|||||
2|[Gosub]|SaveScreenshot|1|0|Gosub|||||

[PMC Code v5.0.0]|+F3||1|Window,2,Fast,0,1|1|SaveScreenshot
Groups=
1|Gdip_Startup|pToken := ""|1|0|Function|||||
2|Gdip_CreateBitmapFromClipboard|pBitmap := ""|1|0|Function|||||
[PMC Code v5.0.2]|+F3||1|Window,2,Fast,0,1,Input,-1,-1,1|1|SaveScreenshot
Groups=Start:1
1|Gdip_Startup|pToken := |1|0|Function|||||
2|Gdip_CreateBitmapFromClipboard|pBitmap := |1|0|Function|||||
3|Gdip_SaveBitmapToFile|sBitmap := pBitmap, A_MyDocuments "\" A_Now ".png", 100|1|0|Function|||||
4|Gdip_DisposeImage|dBitmap := pBitmap|1|0|Function|||||
5|Gdip_Shutdown|sToken := pToken|1|0|Function|||||
Expand Down
192 changes: 0 additions & 192 deletions LIB/COMInterface.ahk

This file was deleted.

2 changes: 2 additions & 0 deletions LIB/Definitions.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1283,3 +1283,5 @@ BuiltinVars := StrReplace(BIV_Characters, "`n", ",")
. StrReplace(BIV_System, "`n", ",")
. StrReplace(BIV_Misc, "`n", ",")
. StrReplace(BIV_Loop, "`n", ",")

FuncWhiteList := "Gdip_,Screenshot,CDO,Zip,CreateZipFile,WinHttpDownloadToFile,CenterImgSrchCoords,Dlg_,IEGet,IELoad,WBGet,ScheduleTask"
2 changes: 1 addition & 1 deletion LIB/Eval.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Eval($x, _CustomVars := "", _Init := true)

If ((IsFunc(_Match1)) && (!Func(_Match1).IsBuiltIn))
{
If _Match1 not in Screenshot,CDO,Zip,UnZip,CreateZipFile,WinHttpDownloadToFile,CenterImgSrchCoords
If _Match1 not contains %FuncWhiteList%
{
$z[$i] := StrReplace($z[$i], _Match,,, 1)
, _Match1 := ""
Expand Down
2 changes: 1 addition & 1 deletion LIB/Playback.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@
{
If (!HideErrors)
{
If Action not in Screenshot,CDO,Zip,UnZip,CreateZipFile,WinHttpDownloadToFile,CenterImgSrchCoords
If Action not contains %FuncWhiteList%
{
MsgBox, 20, %d_Lang007%, % "Macro" Macro_On ", " d_Lang065 " " mListRow
. "`n" d_Lang007 ":`t`t" d_Lang031 "`n" d_Lang066 ":`t" Action "`n`n" d_Lang035
Expand Down
67 changes: 50 additions & 17 deletions MacroCreator.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2125,9 +2125,9 @@ Gui, 14:Add, Button, -Wrap W75 H23 gCheckAll, %t_Lang007%
Gui, 14:Add, Button, -Wrap yp x+5 W75 H23 gUnCheckAll, %t_Lang008%
Gui, 14:Add, Text, yp x+5 h25 0x11
Gui, 14:Add, Checkbox, -Wrap Checked%Ex_AbortKey% yp+5 x+0 W65 vEx_AbortKey gEx_Checks R1, %w_Lang008%:
Gui, 14:Add, Combobox, yp-5 x+0 W60 vAbortKey gAutoComplete, %KeybdList%
Gui, 14:Add, Hotkey, yp-5 x+0 W60 vAbortKey, %AbortKey%
Gui, 14:Add, Checkbox, -Wrap Checked%Ex_PauseKey% yp+5 x+10 W65 vEx_PauseKey R1, %t_Lang081%:
Gui, 14:Add, Combobox, yp-5 x+0 W60 vPauseKey gAutoComplete, %KeybdList%
Gui, 14:Add, Hotkey, yp-5 x+0 W60 vPauseKey, %PauseKey%
; Context
Gui, 14:Add, GroupBox, Section y+16 xs W450 H80
Gui, 14:Add, Checkbox, -Wrap Section ys xs vEx_IfDir gEx_Checks R1, %t_Lang009%:
Expand Down Expand Up @@ -2210,8 +2210,6 @@ Gui, 14:Add, Button, -Wrap Section Default xm W75 H23 hwndExpButton gExpButton,
Gui, 14:Add, Button, -Wrap ys W75 H23 gExpClose, %c_Lang022%
Gui, 14:Add, Progress, ys W305 H20 vExpProgress

GuiControl, 14:ChooseString, AbortKey, %AbortKey%
GuiControl, 14:ChooseString, PauseKey, %PauseKey%
GuiControl, 14:ChooseString, SI, %SI%
GuiControl, 14:ChooseString, ST, %TitleMatch%
GuiControl, 14:ChooseString, SP, %TitleSpeed%
Expand Down Expand Up @@ -2302,24 +2300,30 @@ Gui, 13:+owner14 +ToolWindow +Delimiter%_x% +HwndExLVEdit
Gui, 14:Default
Gui, 14:+Disabled
Gui, 13:Add, GroupBox, Section xm W270 H105
Gui, 13:Add, Edit, ys+15 xs+10 W250 vEx_Macro, %Ex_Macro%
Gui, 13:Add, Combobox, W140 vEx_AutoKey gAutoComplete, %KeybdList%
Gui, 13:Add, Edit, ys+15 xs+10 W140 vEx_Macro, %Ex_Macro%
Gui, 13:Add, Checkbox, -Wrap Checked%Ex_BM% yp+3 x+10 W100 vEx_BM R1, %t_Lang006%
Gui, 13:Add, Text, -Wrap y+17 xs+10 W60 R1 Right, %t_Lang003%:
Gui, 13:Add, Hotkey, W100 y+15 xm+30 vEx_AutoKey, %Ex_AutoKey%
Gui, 13:Add, Combobox, W100 yp x+30 vEx_AutoKeyL gAutoComplete Disabled, %KeybdList%
Gui, 13:Add, Radio, W25 yp+5 xm+5 Checked vEx_AutoKeyFromH gExHotkey
Gui, 13:Add, Radio, W25 yp xm+135 vEx_AutoKeyFromL gExHotkey
Gui, 13:Add, Text, -Wrap y+13 xs+10 W60 R1 Right, %t_Lang003%:
Gui, 13:Add, Edit, yp-3 x+10 Limit Number W70 R1 vEx_TE
Gui, 13:Add, UpDown, 0x80 Range0-999999999 vEx_TimesX, %Ex_TimesX%
Gui, 13:Add, Text, -Wrap R1 yp+3 x+10 , %t_Lang004%
Gui, 13:Add, Button, Section Default -Wrap xm W75 H23 gExpEditOK, %c_Lang020%
Gui, 13:Add, Button, -Wrap ys W75 H23 gExpEditCancel, %c_Lang021%
Gui, 13:Add, Updown, ys x+60 W50 H20 Horz vExpSel gExpSelList Range0-1
If (InStr(KeybdList, Ex_AutoKey _x))
GuiControl, 13:ChooseString, Ex_AutoKey, %Ex_AutoKey%
GuiControl, 13:ChooseString, Ex_AutoKeyL, %Ex_AutoKey%
Else
GuiControl, 13:, Ex_AutoKey, %Ex_AutoKey%%_x%%_x%
GuiControl, 13:, Ex_AutoKeyL, %Ex_AutoKey%%_x%%_x%
If (InStr(Ex_Macro, "()"))
{
GuiControl, 13:Disable, Ex_Macro
GuiControl, 13:Disable, Ex_AutoKey
GuiControl, 13:Disable, Ex_AutoKeyL
GuiControl, 13:Disable, Ex_AutoKeyFromH
GuiControl, 13:Disable, Ex_AutoKeyFromL
GuiControl, 13:Disable, Ex_BM
GuiControl, 13:Disable, Ex_TE
GuiControl, 13:Disable, Ex_TimesX
Expand Down Expand Up @@ -2364,6 +2368,20 @@ Gui, 13:Destroy
LV_Modify(RowNumber,, Ex_Macro, Ex_AutoKey, Ex_TimesX, Ex_BM)
return

ExHotkey:
Gui, 13:Submit, NoHide
If (Ex_AutoKeyFromH)
{
GuiControl, 13:Enable, Ex_AutoKey
GuiControl, 13:Disable, Ex_AutoKeyL
}
Else
{
GuiControl, 13:Disable, Ex_AutoKey
GuiControl, 13:Enable, Ex_AutoKeyL
}
return

ExpSelList:
NewRow := ExpSel ? (RowNumber + 1) : (RowNumber - 1)
Gui, 13:+OwnDialogs
Expand All @@ -2389,6 +2407,7 @@ If (Ex_Macro != "")
}
}
}
Ex_AutoKey := Ex_AutoKeyFromH ? Ex_AutoKey : Ex_AutoKeyL
LV_Modify(RowNumber,, Ex_Macro, Ex_AutoKey, Ex_TimesX, Ex_BM)
, RowNumber := NewRow
If (RowNumber > LV_GetCount())
Expand All @@ -2400,25 +2419,39 @@ LV_Modify(0, "-Select"), LV_Modify(RowNumber, "Select")
, LV_GetText(Ex_AutoKey, RowNumber, 2)
, LV_GetText(Ex_TimesX, RowNumber, 3)
, LV_GetText(Ex_BM, RowNumber, 4)
If (InStr(Ex_Macro, "()"))
{
Ex_AutoKey := ""
GuiControl, 13:, Ex_AutoKeyFromH, 1
}
GuiControl, 13:, Ex_Macro, %Ex_Macro%
GuiControl, 13:, Ex_BM, %Ex_BM%
GuiControl, 13:, Ex_TimesX, %Ex_TimesX%
If (InStr(KeybdList, Ex_AutoKey))
GuiControl, 13:ChooseString, Ex_AutoKey, %Ex_AutoKey%
GuiControl, 13:, Ex_AutoKey, %Ex_AutoKey%
If (InStr(KeybdList, Ex_AutoKey _x))
GuiControl, 13:ChooseString, Ex_AutoKeyL, %Ex_AutoKey%
Else
GuiControl, 13:, Ex_AutoKey, %Ex_AutoKey%||
GuiControl, 13:, Ex_AutoKeyL, %Ex_AutoKey%%_x%%_x%
If (InStr(Ex_Macro, "()"))
{
GuiControl, 13:Disable, Ex_Macro
GuiControl, 13:Disable, Ex_AutoKey
GuiControl, 13:Disable, Ex_AutoKeyL
GuiControl, 13:Disable, Ex_AutoKeyFromH
GuiControl, 13:Disable, Ex_AutoKeyFromL
GuiControl, 13:Disable, Ex_BM
GuiControl, 13:Disable, Ex_TE
GuiControl, 13:Disable, Ex_TimesX
}
Else
{
GuiControl, 13:Enable, Ex_Macro
GuiControl, 13:Enable, Ex_AutoKey
If (Ex_AutoKeyFromH)
GuiControl, 13:Enable, Ex_AutoKey
Else
GuiControl, 13:Enable, Ex_AutoKeyL
GuiControl, 13:Enable, Ex_AutoKeyFromH
GuiControl, 13:Enable, Ex_AutoKeyFromL
GuiControl, 13:Enable, Ex_BM
GuiControl, 13:Enable, Ex_TE
GuiControl, 13:Enable, Ex_TimesX
Expand Down Expand Up @@ -2615,17 +2648,17 @@ If (ExpFile = "")
return
If (Ex_AbortKey = 1)
{
If (!RegExMatch(AbortKey, "^\w+$"))
If (AbortKey = "")
{
MsgBox, 16, %d_Lang007%, %d_Lang073%
MsgBox, 16, %d_Lang007%, %d_Lang073%`n`n> %w_Lang008%
return
}
}
If (Ex_PauseKey = 1)
{
If (!RegExMatch(PauseKey, "^\w+$"))
If (PauseKey = "")
{
MsgBox, 16, %d_Lang007%, %d_Lang073%
MsgBox, 16, %d_Lang007%, %d_Lang073%`n`n> %t_Lang081%
return
}
}
Expand Down

0 comments on commit 56c3953

Please sign in to comment.