Editing ListView GUI Control Data Tables (AutoHotkey Legal ListView Part 3)

Once Loaded into an AutoHotkey GUI ListView, You Can Add Tools for Editing Data

With the exception of the first column, AutoHotkey does not allow direct editing in a GUI ListView control. That forces us to create separate editing controls for changing and updating content in any of the other columns. We can either add the controls to the same GUI as in the AddressBook.ahk script (shown below)—discussed in my AutoHotkey Applications e-book—or we can create a second GUI which pops-up on demand. Since putting all the controls in the same GUI creates less confusion for the ListView functions (the functions always operate on the default GUI), you might find the AddressBook.ahk example easier to implement for your application. Continue reading


Use the ListView GUI Control to Find Duplicate Entries in Data Table Files (AutoHotkey Legal ListView Part 2)

ListView Control Functions in a Loop Work Quickly Locate Repetitious Data

In my last blog, “ListView GUI Control for Viewing Data Table Files (AutoHotkey Legal ListView Part 1)“, I introduced using the ListView GUI control to view and correct a data table file—in this case, an INI file (LegalInput.ini). While sorting and viewing a data table in the ListView control offers many benefits, the most power comes from the 11 built-in functions available for manipulating the control and editing data.

All GUI controls (e.g. Edit, Text, MonthCal, etc.) offer options you can call with the initial Gui, Add command. ListView (and its sister TreeView) include similar options plus special functions for directly manipulating the control. Last time, we used LV_Add() to load the data table rows into the ListView control. This time, we use the LV_GetCount() function (the number of ListView rows) to limit the total number of iterations in a loop, LV_Modify() to focus on each table row in sequential order, and LV_GetText() to retrieve and store data in the row. Continue reading

ListView GUI Control for Viewing Data Table Files (AutoHotkey Legal ListView Part 1)

The Powerful ListView GUI (Graphical User Interface) Control Offers Advanced Features for Reading and Sorting Data Tables, Plus How to Make a ListView GUI Control Resizable

Recently, I wrote about how to use a data table to create Hotstrings using the Input command, then, after discovering that I can’t remember all the Hotstring combinations, showed how to build lookup menus from the same data table. Later, I used the same menu technique to demonstrate how to insert Latin legal terms in italics. I made a promise to create a Legal Lingo ListView GUI (Graphical User Interface) pop-up but, before I could undertake the task, other topics intervened. The time has come for me to deliver on my commitment. Continue reading

Searching Data Files and Other Scripting Ploys with Emojis (Secret AutoHotkey Tricks)

Who Knew That You Could Use Emojis in AutoHotkey Scripts Just Like Any Other Computer Character? More Emoji Magic! 😏

Emoji unicornAs I played around with the EmojiMenu.ahk script from my last blog, I tested highlighting an emoji as a search key. I inserted the unicorn emoji (🦄) into a document, highlighted it, then hit CTRL+ALT+E. To my pleasant surprise, it worked! As shown on the right, AutoHotkey searched the EmojiInsert.ahk Hotstring file, located the emoji character for a unicorn, then inserted it into the pop-up menu. (I added the ::!fantasy::🦄 Hotstring—which doesn’t appear in the original EmojiInsert.ahk Hotstring file—after posting the file.)

Continue reading

Use BoundFunc Object [Func.Bind()] to Pass GUI Control Data (An AutoHotkey GUI Revelation)

Added as a Special Feature to AutoHotkey V1.1, You Can Quickly Bind Unique Data to GUI Controls for Passing to Functions—It’s Even Easier in V2.0. Add This One to Your Bag of AutoHotkey Tricks!

Sometimes in my explorations, I come across an unexpected gem. I dig into many aspects AutoHotkey merely because they exist—having no idea how a technique might affect my scriptwriting. Whenever I uncover a feature that switches on a light, I must admit I get a little excited. Interestingly, if I had not been rummaging through AutoHotkey V2.0, I may not have ever understood the significances of this latest revelation for GUI pop-up windows in V1.1 scripts.

*          *          *

GraphicSoundsIn a GUI (Graphical User Interface) pop-up window, passing the right data to a gLabel subroutine (or function) from a GUI control can get complicated. A couple of the more common methods includes calling the Gui, Submit command to store control values or using a technique for capturing control information, such as the MouseGetPos command or the special gLabel alternative function:

 CtrlEvent(CtrlHwnd, GuiEvent, EventInfo, ErrLevel:="")

While I can usually find a way to solve the data passing problem, I often find the answer awkward. Continue reading

Write Less Code with Database Driven Apps (AutoHotkey Script Design)

Use Simple Database Files to Both Write AutoHotkey Code and Create Flexible Scripts

GraphicSoundsIn the last blog, I introduced a simple AutoHotkey app I call PictureSounds.ahk. When the user clicks on an image, AutoHotkey seeks the name of the sound file in an INI lookup table, then plays it. The script uses the image file name as the INI file Key. After loading a series of images, the script plays a different sound for each image. (It even plays videos!)

Using the INI file as a lookup table saved me from writing a different subroutine (or at least If condition) for each Picture control in the GUI window. Now, I show how to use that same data file to write the command code lines for adding the images to the pop-up files. Continue reading

Comparing Today’s AutoHotkey Version 1.1 and the Future Version 2.0 (Part 5—Replacing V1.1 gLabels with V2.0 GuiControl.OnEvent())

AutoHotkey Version 2.0 Drops the GUI gLabel in Favor of the Object OnEvent() Function

In AutoHotkey V1.1, the primary method for adding action to GUI pop-up windows employs the gLabel inserted into a GUI control’s options. As AutoHotkey moves to object-oriented programming in V2.0, the Gui.OnEvent() function replaces gLabels.

Launch Window V2In AutoHotkey V2.0, each GUI control responds to different Gui Events. For example, with the Gui Button control, you can register OnEvent() functions for Click, DoubleClick, Focus, and LoseFocus, while the Edit control directly supports Change. You register each type of initiating action you use with the OnEvent() function. In fact, you must register an event before AutoHotkey will respond. Continue reading