Giter VIP home page Giter VIP logo

codequicktester's People

Contributors

g33kdude avatar kczx3 avatar mike-clark-8192 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codequicktester's Issues

Saving error

I'm running it as Administrator.

Save As works fine, but simple Save returns following error:


Error: Missing a required parameter.

Specifically: saveAs

	---- C:\Users\acer\Documents\GitHub\AutoHotkey\GeekDude\CodeQuickTester\lib\CQT.ahk
	090: }
	090: {
▶	090: Return  this.Save()
	090: }
	090: {

File -> New = Error at line 1.

image

Couldn't find MZ and obviously nothing apparently wrong with line one.. I'm curious why the error line doesn't match up with the exception line?

[Feature request] Word Wrap

Word wrap would make it much easier to use. Alternatively, saving the GUI size after being resized would mostly remove the need for wrapping.

Also, being able to replace tabs with spaces would be nice, but easy enough to get around with a user-made hotkey.

The Contextmenu Doesn't Work Properly.

https://github.com/G33kDude/RichCode.ahk/blob/9a54252d193dbafeccb86b9e751cb36c8c8f5548/RichCode.ahk#L207-L241

I apologise for not being able to point out exactly where the problem is, but this is what I have done so far to fix it.
I'm sure you'll understand as soon as you see it.

; Create the right click menu
this.menu := Menu()
for Index, Entry in RichCode.MenuItems
	this.menu.Add(Entry?, IsSet(Entry) ? RightClickMenu : unset)

; Get the ITextDocument object
bufpIRichEditOle := Buffer(A_PtrSize, 0)
this.SendMsg(0x43C, 0, bufpIRichEditOle) ; EM_GETOLEINTERFACE
this.pIRichEditOle := NumGet(bufpIRichEditOle, "UPtr")
this.IRichEditOle := ComValue(9, this.pIRichEditOle, 1)
; ObjAddRef(this.pIRichEditOle)
this.pITextDocument := ComObjQuery(this.IRichEditOle, RichCode.IID_ITextDocument)
this.ITextDocument := ComValue(9, this.pITextDocument, 1)
; ObjAddRef(this.pITextDocument)

RightClickMenu(ItemName, ItemPos, MenuName)
{
	Switch ItemName {
	case "Cut"       : A_Clipboard := this.SelectedText, this.SelectedText := ""
	case "Copy"      : A_Clipboard := this.SelectedText
	case "Paste"     : this.SelectedText := A_Clipboard
	case "Delete"    : this.SelectedText := ""
	case "Select All": this.Selection    := [0, -1]
	case "UPPERCASE" : this.SelectedText := Format("{:U}", this.SelectedText)
	case "lowercase" : this.SelectedText := Format("{:L}", this.SelectedText)
	case "TitleCase" : this.SelectedText := Format("{:T}", this.SelectedText)
	}
}

enclosing a task manager

How about enclosing a task manager function?

#SingleInstance, FORCE
#NoEnv
#NoTrayIcon

SetTitleMatchMode, 1
DetectHiddenWindows, On

;Valiables Setup
    app_title = AhkTaskMan

    ; column number
    col_file      =   1
    col_pid       =   2
    col_mem       =   3
    col_exe       =   4
    col_ver       =   5
    col_hwnd      =   6
    col_dir       =   7

    ; header label
    label_file    =  ; スクリプト
    label_pid     =  ; PID
    label_mem     =  ; Mem(kb)
    label_exe     =  ; プロセス名
    label_ver     =  ; バージョン
    label_hwnd    =  ; ウィンドウハンドル
    label_dir     =  ; スクリプト位置

    ; column options
    opt_file      =   120
    opt_pid       =   50
    opt_mem       =   70 Integer
    opt_exe       =   120
    opt_ver       =   90
    opt_hwnd      =   70
    opt_dir       =   200

    refresh_dur   =   5000 ; (ms)

    use_comma     =   1

    refresh_timer =   0


Init:
    Gosub, InitGui
    Gosub, ListViewColumnSetUp
    Gosub, SB_Show
    monitor:=true
    Gosub, RefleshView
    monitor:=refresh_timer
Return

RefleshView:
    Thread, Interrupt, 1000
    Thread, Priority, 10000
    If !(monitor)
        Return
    pidList := "|"
    row:=LV_GetCount()
    ; reverse loop for deleting row(s)
    While (row>0) {
        LV_GetText(pid, row, col_pid)
        pidList.=pid . "|"
        Process, Exist, %pid%
        If (ErrorLevel!=pid)
            LV_Delete(row)
        else
            LV_Modify(row, "Col" col_mem, GetMem(pid))
        row--
    }
    WinGet, list, List, ahk_class AutoHotkey,,%A_ScriptFullPath%
    Loop, % list {
        hwnd:=list%A_Index%
        IfWinNotExist, ahk_id %hwnd%
            continue
        WinGet, pid, PID
        If pid && InStr(pidList, "|" pid "|")
            continue
        WinGetTitle, title
        If RegExMatch(title, "(?P<path>.+) - AutoHotkey v(?P<ver>\d(?:\.\w+)+)$", $) {
            path := $path, ver:=$ver
        } else {
            path := title, ver:=""
        }
        WinGet, exe, ProcessName
        mem := GetMem(pid)
        SplitPath, path, file, dir
        val%col_pid%  := pid
        val%col_file% := file
        val%col_mem%  := mem
        val%col_exe%  := exe
        val%col_ver%  := ver
        val%col_dir%  := dir
        val%col_hwnd% := hwnd
        LV_Add("", val1, val2, val3, val4, val5, val6, val7)
    }
    SB_SetText("Process:" A_Tab A_Tab LV_GetCount() " ", 2)
Return


InitGui:
    
    Gui, +LastFound +Resize
    
    Gui, Margin, 0, 0
    Gui, Add, ListView,  vLV gLvEvent r8 w620 grid AltSubmit -Multi
    Gui, Add, StatusBar, vSB gSbEvent 0x800
    SB_SetParts(100, 100)

    Menu, Tray, NoStandard
    Menu, Tray, Add,     &Restore, RestoreGui
    Menu, Tray, Add,     E&xit,    EndApp
    Menu, Tray, Default, &Restore
    
    Menu, M1, Add, Show &Main Window       , ShowMainWindow
    Menu, M1, Add
    Menu, M1, Add, &Reload Script          , BypassMenu
    Menu, M1, Add, &Suspend Hotkeys        , BypassMenu
    Menu, M1, Add, &Pause                  , BypassMenu
    Menu, M1, Add, E&xit (Terminate Script), BypassMenu
    Menu, M1, Add,
    Menu, M1, Add, &Kill Process           , KillProcess
    Menu, M1, Add,
    Menu, M1, Add, &Cancel                 , MenuCancel
    
    Gui, Show,, %app_title%
Return

ListViewColumnSetUp:
    col_headers = 
        (LTrim Join|
            file
            pid
            mem
            exe
            ver
            hwnd
            dir
        )
    Loop, 7
    {
        idx:=A_Index
        Loop, PARSE, col_headers, |, %A_Tab%%A_Space%
        {
            If (col_%A_LoopField%==idx) 
            {
                LV_InsertCol(idx, opt_%A_LoopField%, label_%A_LoopField% ? label_%A_LoopField% : A_LoopField)
            }
        }
    }
Return

RestoreGui:
    Menu, Tray, NoIcon
    Gui, Show
Return

EndApp:
GuiClose:
    ExitApp
Return

GuiSize:
    If (A_EventInfo==0 || A_EventInfo==2) 
    {
        GuiControlGet, p, POS, SB
        GuiControl, Move, LV, % "w" A_GuiWidth " h" (A_GuiHeight-pH)
    }
    else If (A_EventInfo==1) 
    {
        Menu, Tray, Icon
        Gui, Hide
    }
Return

SB_Show:
    If (monitor) 
    {
        SB_SetIcon(A_Windir . "\system32\shell32.dll", 138, 1)
        SB_SetText("monitoring...")
        SetTimer, RefleshView, %refresh_dur%
    } 
    else 
    {
        SB_SetIcon(A_Windir . "\system32\shell32.dll", 4*28-2, 1)
        SB_SetText("Idle")
        SetTimer, RefleshView, Off
    }
Return

KillProcess:
    Thread, NoTimers, true
    SetTimer, RefleshView, Off
    Gui, +OwnDialogs
    MsgBox, 305, Alert, Are you sure?, 500
    IfMsgBox, OK
    {
        Process, Close, %pid%
        Sleep, 500
        Gosub, RefleshView
        SetTimer, RefleshView, %refresh_dur%
    }
Return


ShowMainWindow:
    WinShow, ahk_id %hwnd%
Return

BypassMenu:
    Thread, NoTimers, true
    SetTimer, RefleshView, Off
    WinMenuSelectItem, ahk_id %hwnd%,, File, %A_ThisMenuItem%
    Sleep, 500
    Gosub, RefleshView
    SetTimer, RefleshView, %refresh_dur%
Return

MenuCancel:
    ; dummy
Return

LvEvent:
    Thread, NoTimers, true
    If (A_GuiEvent="RightClick" && row:=LV_GetNext(0, "F")) 
    {
        LV_GetText(path, row, col_file)
        LV_GetText(exe , row, col_exe )
        LV_GetText(ver , row, col_ver )
        LV_GetText(pid , row, col_pid )
        LV_GetText(dir , row, col_dir )
        LV_GetText(mem , row, col_mem )
        LV_GetText(hwnd, row, col_hwnd)
        Menu, M1, Show
    }
Return

SbEvent:
    If (A_EventInfo==1 && A_GuiEvent="DoubleClick") {
        monitor:=!monitor
        Gosub, SB_Show
    }
Return

GetMem(pid) {
    Global use_comma
    mem := GetProcessMemoryState(pid)
    Return use_comma ? comma(mem) : mem
}

Comma(value) {
    return RegExReplace(value, "(\d{1,3})(?=(?:\d\d\d)+(?!\d))", "$1,", "", -1)
}

GetProcessMemoryState(pid,type=8){
    pMemSt:=SAlloc(40)
    hProcess:=DllCall("OpenProcess"
        , "UInt", 0x001F0FFF
        , "UInt", 0
        , "UInt", pid
        , "UInt")
    If (hProcess) {
        If DllCall("psapi.dll\GetProcessMemoryInfo", "UInt",hProcess, "UInt",pMemst, "UInt",40) {
            val:=SGetInt(pMemSt,type*4)
        }
        releaseProcessHandle(hProcess)
    }
    SFree(pMemSt)
    Return val
}

SAlloc(size){
    Return DllCall("GlobalAlloc","UInt",0x40,"UInt",size,"UInt")
}
SFree(ptr){
    DllCall("GlobalFree","UInt",ptr)
}

SGetInt(pStruct,offset){
    DllCall("RtlMoveMemory", "UIntP",val, "UInt",pStruct+offset, "Int",4)
    Return val
}
releaseProcessHandle(hProcess){
    DllCall("psapi.dll\CloseProcess","Int",hProcess)
}

Gutter sync issues

The line number gutter fails to stay in sync with the editor when the editor is zoomed, or sometimes when it is scrolled. It also goes out of sync when moving to the end of the document by the Control-End shortcut.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.