Search found 150 matches
- 04 Apr 2024, 14:47
- Forum: Scripts and Functions (v1)
- Topic: [Editor] CodeQuickTester - Write and run code without saving to a temporary file
- Replies: 204
- Views: 118709
Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file
I'd also be interested in a v2 release of this. Looks really neat!
- 02 Apr 2024, 01:01
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
@lexikos, this documentation you've added is absolutely fantastic. It's really got to the core of the issue(s) in a clear and consise way, and I for one appreciate it very much. A big thank you from me.
- 30 Mar 2024, 02:54
- Forum: Scripts and Functions (v2)
- Topic: UIA v2
- Replies: 373
- Views: 53351
Re: UIA v2
@Descolada , thanks for the swift response.
I was actually wondering if it was possible to trigger the focus change event only on focus changes to cEl or its descendants, rather than on the whole tree. I thought perhaps that was the purpose of getting cEl in the example?
I was actually wondering if it was possible to trigger the focus change event only on focus changes to cEl or its descendants, rather than on the whole tree. I thought perhaps that was the purpose of getting cEl in the example?
- 29 Mar 2024, 19:19
- Forum: Scripts and Functions (v2)
- Topic: UIA v2
- Replies: 373
- Views: 53351
Re: UIA v2
@Descolada , as always thank you for the UIA library.
I think there may be an error in Example07_FocusChangedEvent.ahk, since the variable cEl is never used.
I think there may be an error in Example07_FocusChangedEvent.ahk, since the variable cEl is never used.
- 26 Mar 2024, 10:04
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
No, avoiding references to the GUI itself being passed indirectly back into the GUI (via an event handler or assigned property) is essential to avoid circular references. You can use bound functions and closures that refer to objects which don't directly or indirectly have any counted reference to ...
- 25 Mar 2024, 12:40
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
Let me thank you again, lexikos , for your detailed response. The extra information about the special case in Gui's __New() implementation explains it all! Thank you. Basically, avoiding function references or boundfunc objects in event handlers is essential to avoid circular references, it seems. I...
- 23 Mar 2024, 12:09
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
Thanks, lexikos , I really appreciate you taking the time to post an example. When I run it, everything works as I'd expect, other than that I thought I'd see the "... will be deleted" message when I x-ed (closed) the GUI, but I don't. Why isn't the destructor called? Also, is it subclassing the GUI...
- 22 Mar 2024, 03:45
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
Sure, I did consider a method in the main GUI class, which could be called from both the main GUI and the sub GUI, but the anonymous function was so neat and compact, I was lured in! However, I am plagued by circular references in my code. I'm starting to recognize when I introduce them, but often t...
- 22 Mar 2024, 02:46
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
Thanks, the -1 worked perfectly. Nice and simple. I hadn't spotted that in the docs before. I just wanted to do this so that the code for opening the submenu is all in one place. Now if I make changes to the way the main GUI opens the context menu, I don't also have to make the same changes to the s...
- 21 Mar 2024, 07:43
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Re: Passing GUI events to another GUI / letting GUI events fall through
Thanks, lexikos - that's a good idea. I tried this, but it does nothing: SubGui.OnEvent("ContextMenu", this.test.Bind(this)) ... test(*) { currentMode := A_CoordModeMouse A_CoordModeMouse := "Screen" MouseGetPos(&x, &y) A_CoordModeMouse := currentMode PostMessage(0x7B, MainGui.Hwnd, (x & 0xFFFFFFFF)...
- 19 Mar 2024, 03:36
- Forum: Ask for Help (v2)
- Topic: Passing GUI events to another GUI / letting GUI events fall through
- Replies: 14
- Views: 500
Passing GUI events to another GUI / letting GUI events fall through
Hi there, I have a main GUI which is a framework for various sub-GUIs. The main GUI listens for ContextMenu events: this.MainGui.OnEvent("ContextMenu", (*) => this.ContextMenu.Show()) I want the sub-GUIs to show the same context menu, but I'd rather avoid recoding the same line on the sub-GUIs. Is t...
- 12 Mar 2024, 15:18
- Forum: Scripts and Functions (v2)
- Topic: UIA v2
- Replies: 373
- Views: 53351
Re: UIA v2
Thanks @Descolada - that's interesting. I'm downloading Accessibility Insights now!
- 12 Mar 2024, 11:28
- Forum: Scripts and Functions (v2)
- Topic: UIA v2
- Replies: 373
- Views: 53351
Re: UIA v2
@Descolada, thanks for your input (and for the brilliant library!). Your code works perfectly - it was the part that I didn't realize I had to do. How did you determine that a simple wouldn't suffice?
Code: Select all
.DocumentRange.GetText()
Code: Select all
.Value
- 10 Mar 2024, 15:07
- Forum: Scripts and Functions (v2)
- Topic: UIA v2
- Replies: 373
- Views: 53351
Re: UIA v2
Hi there. Can anyone report if they've had any luck getting the UIA element of the formula bar in Excel? I tried this but to no avail:
Thanks!
Code: Select all
ExcelElement := UIA.ElementFromHandle("ahk_exe EXCEL.EXE")
FormulaBarElement := ExcelElement.FindElement({AutomationId:"FormulaBar"})
- 07 Mar 2024, 02:40
- Forum: Tutorials (v2)
- Topic: Screen scaling, DPI, and making scripts work in different computers
- Replies: 6
- Views: 6270
Re: Screen scaling, DPI, and making scripts work in different computers
@Descolada, just wanted to say thank you for this. It's a tricky topic, and this is a great summary of the problem and potential solutions. Much appreciated.
- 03 Mar 2024, 09:49
- Forum: Ask for Help (v2)
- Topic: Static methods in base class not accesssible in derived class via "this".
- Replies: 11
- Views: 384
Re: Static methods in base class not accesssible in derived class via "this".
Thanks for your thoughts. Understanding the object instantiation AHK uses is requiring a lot more power than I'm used to providing to my brain. Apologies if it takes a while to click. As for why the design is as it is, it's because: cExcel makes sense as a singleton object, because it encapsulates h...
- 02 Mar 2024, 09:26
- Forum: Ask for Help (v2)
- Topic: Static methods in base class not accesssible in derived class via "this".
- Replies: 11
- Views: 384
Re: Static methods in base class not accesssible in derived class via "this".
Perhaps this will illustrate what I mean: x := cGSheetsAsDatabase() y := cExcelAsDatabase() doSomethingWithCellCoords(x) ; Works doSomethingWithCellCoords(y) ; Fails doSomethingWithCellCoords(instanceOfDatabase) { MsgBox(instanceOfDatabase.GetCellCoords()) } class cExcel { static GetCellCoords() { r...
- 02 Mar 2024, 04:53
- Forum: Ask for Help (v2)
- Topic: Static methods in base class not accesssible in derived class via "this".
- Replies: 11
- Views: 384
Re: Static methods in base class not accesssible in derived class via "this".
Because databaseObjectInstance might be some other type of object that isn't derived from cExcel. But it should still have a GetCellCoords() method. Does that make sense? Perhaps I could define a __Call() method in the derived class that checks super for the relevant method? Not sure if that would w...
- 02 Mar 2024, 03:57
- Forum: Ask for Help (v2)
- Topic: Static methods in base class not accesssible in derived class via "this".
- Replies: 11
- Views: 384
Re: Static methods in base class not accesssible in derived class via "this".
Thanks. The issue is this: I have a cExcel class, which provides various helper functions for dealing with Excel. It's in my lib, and I use it from various scripts I've written, and all its methods are static, so I don't have to create a cExcel object, I just use, eg. cExcel.GetActiveWorkbook(). Now...
- 01 Mar 2024, 19:41
- Forum: Ask for Help (v2)
- Topic: Static methods in base class not accesssible in derived class via "this".
- Replies: 11
- Views: 384
Re: Static methods in base class not accesssible in derived class via "this".
Thanks, @teadrinker. That's interesting, but doens't help in situations like this:
Code: Select all
x := Child()
x.someMethod()
class Base
{
static someMethod()
{
MsgBox("Hello")
}
}
class Child extends Base
{
__New()
{
MsgBox("Hello from child.")
}
}