Git Product home page Git Product logo

class_lv_incelledit's Introduction

Class_LV_InCellEdit

AHK class providing in-cell editing for ListView controls in AHK GUIs.

The class provides methods to restrict editing to certain columns, to directly start editing of a specified cell, and to deactivate/activate the built-in message handler for WM_NOTIFY messages (see below).

The message handler for WM_NOTIFY messages will be activated for the specified ListView whenever a new instance is created. As long as the message handler is activated a double-click on any cell will show an Edit control within this cell allowing to edit the current content. The default behavior for editing the first column by two subsequent single clicks is disabled. You have to press "Esc" to cancel editing, otherwise the content of the Edit will be stored in the current cell. ListViews must have the -ReadOnly option to be editable.

While editing, "Esc", "Tab", "Shift+Tab", "Down", and "Up" keys are registered as hotkeys. "Esc" will cancel editing without changing the value of the current cell. All other hotkeys will store the content of the edit in the current cell and continue editing for the next (Tab), previous (Shift+Tab), upper (Up), or lower (Down) cell. You cannot use the keys for other purposes while editing.

All changes are stored in MyInstance.Changed. You may track the changes by triggering (A_GuiEvent == "F") in the ListView's gLabel and checking MyInstance["Changed"] as shown in the sample scipt. If "True", MyInstance.Changed contains an array of objects with keys "Row" (row number), "Col" (column number), and "Txt" (new content). 'Changed' is one of the two keys intended to be accessed directly from outside the class.

If you want to temporarily disable in-cell editing call MyInstance.OnMessage(False). This must be done also before you try to destroy the instance. To enable it again, call `MyInstance.OnMessage()``.

To avoid the loss of Gui events and messages the message handler might need to be Critical. This can be achieved by setting the instance property 'Critical' to the required value (e.g. MyInstance.Critical := 100). New instances default to Critical, Off. Though sometimes needed, ListViews or the whole Gui may become unresponsive under certain circumstances if Critical is set and the ListView has a g-label.

class_lv_incelledit's People

Contributors

ahk-just-me avatar

Watchers

 avatar

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.