Jump to content

Replace text in Grid automatically


Recommended Posts

I have a grid in a window as shown highlighted below. I have also displayed the "Window Info" for the control below. My question is how do I replace any text/value such as "$9.95" with "$6.95" the second they appear in the grid. The software I am using is a POS for a pizza store. When staff member enters "BM", the software automatically fills in the Description and Price, however I'd like to change the price but the software doesn't allow it.

Posted Image

The problem is that AutoIt cannot access the API for grid controls because they are custom to their compilers and not standard Windows APIs. I don't know the solution, but is it possible to search the screen or grid for the text "$9.95" and select the coordinate where it is located then replace the selection with "$6.95"?

Thanks in advance,

Berkal

Edited by berkal
Link to comment
Share on other sites

To be honest. a rag tag hacky script like the one you suggest is hardly the way to go for a commercial software.

If it were me, I'd seriously think about contacting the developer, or creating a whole new program.

But before that, how certain are you that these controls cannot be accessed?

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Moderators

berkal,

A question: Can you manually change the price value in that control? :huh:

Because if you cannot do it manually, I doubt very much whether you are going to be able to do it programmatically with AutoIt given that it is not a standard API control. :(

M23

Edit: Another thought: Surely the original developer did not hard-code all the items and prices into the app - so is there not a file somewhere which links item and price which you can modify? That would be the best solution. ;)

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

it looks like items like 'Discount' have keyboard shortcuts built in, can you just send ALT+N then send 30% as the discount to get from $9.95 to $6.97?

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

berkal,

A question: Can you manually change the price value in that control? :huh:

Because if you cannot do it manually, I doubt very much whether you are going to be able to do it programmatically with AutoIt given that it is not a standard API control. :(

M23

Edit: Another thought: Surely the original developer did not hard-code all the items and prices into the app - so is there not a file somewhere which links item and price which you can modify? That would be the best solution. ;)

Yes you can change the prices manually. You can change the price in the admin section. However every Tuesdays we have a special where we sell our pizzas for $6.95 and there is no feature to automatically change the prices on this date.

Note: I want any of the prices $7.95, $8.95 & $9.95 to automatically change to $6.95 only on Tuesdays.

Link to comment
Share on other sites

  • Moderators

berkal,

You can change the price in the admin section

I take it this is the "admin" section of the POS software. Where does this price change get stored? It must be somewhere on the system. Modifying that storage (or at least replacign it with a new version on Tuesdays) seems like a better bet to me that trying to play around with the GUI itself. ;)

But let us continue on parallel tracks. Is the main GUI you posted above resizeable or of a fixed size? If it is resizeable, does the font size of the item/price change when it is resized? That will determine how we might look for the various sections of the grid text. I have done something similar in the past for an old DOS app where we needed to identify certain parts of the screen display - I am sure we can manage the same trick here. :)

But I would still look to changing the data source first if possible. That is a far more elegant solution - and a lot less code! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

berkal,

I take it this is the "admin" section of the POS software. Where does this price change get stored? It must be somewhere on the system. Modifying that storage (or at least replacign it with a new version on Tuesdays) seems like a better bet to me that trying to play around with the GUI itself. ;)

But let us continue on parallel tracks. Is the main GUI you posted above resizeable or of a fixed size? If it is resizeable, does the font size of the item/price change when it is resized? That will determine how we might look for the various sections of the grid text. I have done something similar in the past for an old DOS app where we needed to identify certain parts of the screen display - I am sure we can manage the same trick here. :)

But I would still look to changing the data source first if possible. That is a far more elegant solution - and a lot less code! :D

M23

Thank you for the speedy reply. I have attempted to modified the data source with no luck. The GUI is fixed and can not be resized. The font is always one size.

Link to comment
Share on other sites

  • Moderators

berkal,

I have attempted to modified the data source with no luck

But have you tried replacing the data source with another which holds different pricing data - that should surely just be a case of renaming/copying a couple of files? The POS app must do something like that when you update the prices. What sort of form does this data source have? Can you post an example? :huh:

I will have a play with your screen shot and see what I can do to locate the various areas - but I am still convinced that the data source is the way to go here. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

http://dl.dropbox.com/u/37233183/EFO.rar

I could not be 100% sure which file is the data source file, so I've upload the entire POS directory to dropbox. The total size is about 30MB. You may have a better idea as to what file it may be. I really appreciate your efforts.

Link to comment
Share on other sites

You should alter the data and save it, then see which files have different modified dates. Currently, none of those files have been modified in nearly 2 years. There's also an encrypted database file "efo.mdw" that might hold the information you're looking for.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

berkal,

I agree with BrewManNH - change the price of the item and see which files change. As long as you can identify the files that are affected it will be simple to swap the different versions depending on the day. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...