Code: Select all
Class PluginClass{
__Call(x*){
m(x)
}__New(){
return this
}Activate(){
WinActivate(hwnd([1]))
}AllCtrl(code,lp,wp){
for a,b in s.ctrl
b[code](lp,wp)
}AutoClose(script){
if(!this.Close[script])
this.Close[script]:=1
}Call(info*){
;this can cause major errors
if(IsFunc(info.1)&&info.1~="i)(Fix_Indent|newindent)"=0){
func:=info.1,info.Remove(1)
return %func%(info*)
} SetTimer,% info.1,-100
}CallTip(text){
sc:=csc(),sc.2200(sc.2128(sc.2166(sc.2008)),text)
}Color(con){
v.con:=con
SetTimer,Color,-1
Sleep,10
v.con:=""
}csc(obj,hwnd){
csc({plugin:obj,hwnd:hwnd})
}Current(x:=""){
return Current(x)
}DynaRun(script){
return DynaRun(script)
}EnableSC(x:=0){
sc:=csc()
if(x){
GuiControl,1:+Redraw,% sc.sc
GuiControl,1:+gnotify,% sc.sc
} else{
GuiControl,1:-Redraw,% sc.sc
GuiControl,1:+g,% sc.sc
}}File(){
return A_ScriptFullPath
}Files(){
return Update("get").1
}Focus(){
ControlFocus,Scintilla1,% hwnd([1])
GuiControl,+Redraw,Scintilla1
Gui,1:Default
Gui,1:TreeView,SysTreeView321
SetPos(TV_GetSelection()),csc(1)
}Get(name){
return _:=%name%
}GuiControl(info*){
GuiControl,% info.1,% info.2,% info.3
}Hotkey(win:=1,key:="",label:="",on:=1){
if(!(win,key,label))
return m("Unable to set hotkey")
Hotkey,IfWinActive,% hwnd([win])
Hotkey,%key%,%label%,% _:=on?"On":"Off"
}HotStrings(Text,String,end:=""){
sc:=csc(),cpos:=sc.2008,TextLength:=StrPut(Text,"UTF-8")-1,StringLength:=StrPut(String,"UTF-8")-1,sc.2686(cpos-TextLength,cpos),sc.2194(StringLength,[String]),sc.2025((!end?cpos+StringLength-TextLength:cpos+end))
}hwnd(win:=1){
return hwnd(win)
}InsertText(text){
Encode(text,return),sc:=csc(),sc.2003(sc.2008,&return)
if(end=0)
sc.2025(sc.2008+StrPut(text,"UTF-8")-1)
else if(end)
sc.2025(sc.2008+end)
}m(info*){
m(info*)
}MoveStudio(){
;auto_version
SplitPath,A_ScriptFullPath,,,,name
FileMove,%A_ScriptFullPath%,%name%-%version%.ahk,1
}Open(info){
tv:=Open(info),tv(tv),WinActivate(hwnd([1]))
}Path(){
return A_ScriptDir
}Plugin(action,hwnd){
SetTimer,%action%,-10
}Publish(info:=0){
return,Publish(info)
}ReplaceSelected(text){
Encode(text,return),csc().2170(0,&return)
}Save(){
Save()
}sc(){
return csc()
}SetText(contents){
length:=VarSetCapacity(text,strput(contents,"utf-8")),StrPut(contents,&text,length,"utf-8"),csc().2181(0,&text)
}SetTimer(timer,period:=-10){
if(!IsFunc(timer)&&!IsLabel(timer))
return
period:=period>0?-period:period
SetTimer,%timer%,%period%
}Show(){
sc:=csc()
WinActivate(hwnd([1]))
GuiControl,+Redraw,% sc.sc
SetPos(sc.2357),sc.2400
}SSN(node,path){
return node.SelectSingleNode(path)
}StudioPath(){
return A_ScriptFullPath
}Style(){
return ea:=Settings.EA(Settings.SSN("//theme/default")),ea.color:=RGB(ea.color),ea.Background:=RGB(ea.Background)
}TrayTip(info){
TrayTip,AHK Studio,%info%,2
}tv(tv){
return tv(tv)
}Update(filename,text){
Update({file:filename,text:text})
}Version(){
;auto_version
return version
}
}