How to make a Context Menu Tool?

I’ve literally searched everything to find how to do it (GMod, Unofficial, Old Wiki; Facepunch Forum; even the Reddit) but did not find this information :worried:. So, title says it all: How to code it (The ones that has the icon and Text in up-left)?

(I hope this is the right category for that)

I saw the Tools like PAC3, WireMod (E2 extension or something like that) that made it.

There are no tutorials on the Wiki but I can give you some examples to help you in your process:

If you have any questions, I will try to answer you in the best way.