Search found 550 matches

by iseahound
14 Jun 2020, 03:58
Forum: AutoHotkey v2 Development
Topic: Why are ObjClone() and ObjDeleteProp() removed?
Replies: 4
Views: 1468

Re: Why are ObjClone() and ObjDeleteProp() removed?

I think what I’m trying to ask is why aren’t functions like ObjSetBase reduced to SetBase, since they could theoretically be operated on any. Likewise, HasOwnMethod should be a function too to facilitate introspection, just like HasMethod. I never used ObjClone and I agree this function should be ov...
by iseahound
13 Jun 2020, 14:48
Forum: AutoHotkey v2 Help
Topic: [v2] this.__class returns "Class"
Replies: 2
Views: 685

Re: [v2] this.__class returns "Class"

Yep. I’m going to keep forgetting that the prototype object exists. Thanks again.
by iseahound
13 Jun 2020, 13:28
Forum: AutoHotkey v2 Development
Topic: Do we need to return multiple variables?
Replies: 14
Views: 2669

Re: Do we need to return multiple variables?

I've been playing around with v2 for a bit, and I've noticed that the fat arrow functions use commas as line separators. Currently the last value after the last comma is implicitly returned (without a return statement). If multiple return values are implemented, this functionality would break. It's ...
by iseahound
13 Jun 2020, 13:04
Forum: AutoHotkey v2 Scripts and Functions
Topic: BitmapToBuffer() - Encapsulate a pBitmap to allow pixel := Bitmap[x,y]
Replies: 0
Views: 354

BitmapToBuffer() - Encapsulate a pBitmap to allow pixel := Bitmap[x,y]

Gdip_All is broken at the moment, but all you need is a pToken and a pBitmap /* pToken := gdip_startup() */ #include ImagePut.txt ImagePut.gdiplusstartup() pBitmap := ImagePutBitmap([0,0,100,100]) buffer := BitmapToBuffer(pBitmap) MsgBox buffer.Lock() MsgBox buffer[0, 50] MsgBox buffer.UnLock() Bitm...
by iseahound
13 Jun 2020, 11:34
Forum: AutoHotkey v2 Help
Topic: [v2] this.__class returns "Class"
Replies: 2
Views: 685

[v2] this.__class returns "Class"

Code: Select all

s.lol()
class s {

static lol() {
MsgBox(this.__class)
}
   }
   
by iseahound
13 Jun 2020, 08:17
Forum: AutoHotkey v2 Development
Topic: Why are ObjClone() and ObjDeleteProp() removed?
Replies: 4
Views: 1468

Re: Why are ObjClone() and ObjDeleteProp() removed?

They’re functions. I don’t care if methods get overwritten or erased, because I don’t call methods. It’s mostly style: obj.something.random.sixtyninefourtwentyxd.getmethod() Or ObjGetMethod(obj.something.random.sixtyninefourtwentyxd) I’m using getmethod wrong but the dot operator is already heavily ...
by iseahound
12 Jun 2020, 20:01
Forum: AutoHotkey v2 Help
Topic: Can someone make a key script please? I'm a complete newbie
Replies: 5
Views: 1208

Re: Can someone make a key script please? I'm a complete newbie

F11:: ; Key to activate { ; Send now defaults to SendInput Send '{1 down}' ; Hold key "1" down Sleep 1000 ; 1000ms = 1s delay Send '{1 up}' ; Release the key ..... } Helgef made some changes to how hotkeys work in v2. Hotkeys are now assume local (meaning you won’t get global variables unless you d...
by iseahound
12 Jun 2020, 19:48
Forum: AutoHotkey v2 Development
Topic: Why are ObjClone() and ObjDeleteProp() removed?
Replies: 4
Views: 1468

Why are ObjClone() and ObjDeleteProp() removed?

I personally favor the ObjXXX functions, so I was hoping all of the obj.xxx methods would eventually get transferred to their ObjXXX() counterparts. I was personally hoping for ObjHasOwnMethod(). As it stands the division between ObjXXX and obj.xxx seems rather random. I really don’t know why ObjHas...
by iseahound
12 Jun 2020, 11:02
Forum: AutoHotkey v2 Scripts and Functions
Topic: [a111] ImagePut - Puts an image from anywhere to anywhere
Replies: 9
Views: 1004

[a111] ImagePut - Puts an image from anywhere to anywhere

a111 compatable ; Script: ImagePut.ahk ; Author: iseahound ; License: MIT License ; Version: 2020-05-22 ; Release: 2020-06-13 ; ImagePut - Puts an image from anywhere to anywhere. ; This is a simple functor designed to be intuitive. ; I hope people find this reference library useful. ; Puts the ima...
by iseahound
10 Jun 2020, 12:03
Forum: AutoHotkey v2 Development
Topic: GuiCreate and Gui.Add parameter order
Replies: 11
Views: 1588

Re: GuiCreate and Gui.Add parameter order

Actually, I changed my mind after looking at some Flutter code examples. They mix Text and Options into a single object called a build context. Didn't look too deeply into the language, but I wouldn't mind if they were combined.
by iseahound
10 Jun 2020, 09:43
Forum: AutoHotkey v2 Development
Topic: Remove Gui.Add("Ctrl", ...) or Gui.AddCtrl(...)?
Replies: 13
Views: 2575

Re: Remove Gui.Add("Ctrl", ...) or Gui.AddCtrl(...)?

Both should be kept, there's really no argument for one over the other.

@lexikos why did the ahk v2 size balloon to 3 MB around a76?
by iseahound
10 Jun 2020, 09:16
Forum: AutoHotkey v2 Development
Topic: GuiCreate and Gui.Add parameter order
Replies: 11
Views: 1588

Re: GuiCreate and Gui.Add parameter order

Parameter order: Actions should be first. Values are in the middle. Optional Parameters should be last. Sorry Helgef, I'm not a fan of TextOrOptions, since the text is more likely to change than the options (style). One suggestion would be to save the last options object (style) passed, such that re...
by iseahound
08 Jun 2020, 04:21
Forum: Scripts and Functions
Topic: Image2Include - #include images in your scripts
Replies: 16
Views: 3653

Re: Image2Include - #include images in your scripts

I added Gdip_CreateARGBHBitmapfromBitmap and Gdip_CreateARGBBitmapfromHBitmap to the latest version of Gdip_All
by iseahound
07 Jun 2020, 19:46
Forum: AutoHotkey v2 Scripts and Functions
Topic: [a111] ImagePut - Puts an image from anywhere to anywhere
Replies: 9
Views: 1004

Re: [a110] ImagePut - Puts an image from anywhere to anywhere

Yes! This is what I ended up using: buffer := {}.DefineMethod("__New" , (self) => (this.gdiplusStartup(), self)) ; Increment GDI+ reference count .DefineMethod("__Delete", (self) => (this.gdiplusShutdown("smart_pointer", self.pBitmap))) buffer := buffer.__New() ; On deletion the buffer object will d...
by iseahound
07 Jun 2020, 15:07
Forum: AutoHotkey v2 Scripts and Functions
Topic: [a111] ImagePut - Puts an image from anywhere to anywhere
Replies: 9
Views: 1004

Re: [a110] ImagePut - Puts an image from anywhere to anywhere

Thanks guest3456. Helgef So VarSetStrCapacity now uses wide chars? Also I can't make heads or tails translating this to v2. buffer := {__New: ObjBindMethod(this, "gdiplusStartup") ; Increment GDI+ reference count , __Delete: ObjBindMethod(this, "gdiplusShutdown", "smart_pointer", pBitmap)} buffer :=...
by iseahound
07 Jun 2020, 15:00
Forum: AutoHotkey v2 Help
Topic: What is the best way to create a CLASS OBJECT
Replies: 5
Views: 382

Re: What is the best way to create a CLASS OBJECT

What does this even mean: --------------------------- test.txt --------------------------- Error in #include file "C:\Users\huae\Desktop\ImagePut2.txt": ByRef parameters cannot be upvalues. Specifically: pBitmap Line# 386: if (cotype = "clipboard") 387: Return this.put_clipboard(pBitmap) 390: if (co...
by iseahound
07 Jun 2020, 14:48
Forum: AutoHotkey v2 Help
Topic: What is the best way to create a CLASS OBJECT
Replies: 5
Views: 382

What is the best way to create a CLASS OBJECT

cls := {"property":"property"} .DefineMethod("__New", (this) => (MsgBox("Created: " A_ThisFunc), this)) .DefineMethod("__Delete", (this) => (MsgBox("Deleted: " A_ThisFunc))) obj := cls.__new() cls := "" MsgBox obj.property '`n' obj.HasOwnMethod("__New") '`n' obj.base.HasOwnMethod("__New") Sleep 100...
by iseahound
07 Jun 2020, 09:21
Forum: AutoHotkey v2 Development
Topic: Exceptions (for unknown properties, more)
Replies: 17
Views: 4054

Re: Exceptions (for unknown properties, more)

Helgef It allows the user themselves to debug their own code. If I was starting out in AutoHotkey, Type Mismatch would mean absolutely nothing to me. I'd even google it and get more confused. --------------------------- test.txt --------------------------- Error: Type mismatch. Line# 001: t := A_Ti...
by iseahound
07 Jun 2020, 07:19
Forum: AutoHotkey v2 Development
Topic: Exceptions (for unknown properties, more)
Replies: 17
Views: 4054

Re: Exceptions (for unknown properties, more)

The only issue I run into when assigning is that only some of the operators assign. Notably: := .= The others throw exceptions, because they expect integer values. The ones that I wish assigned from an uninitialized value are : += -= and |= . Otherwise I expect default #Warn UseUnset to be okay so l...

Go to advanced search