Jump to content

Gui Windows selection


IvanCodin
 Share

Recommended Posts

My current script has a GUI window opened that is displaying db records. I highlight the record I want to use. Based on the selected record it needs to set 7 variables.

When I look at the Help file I can not find a function that looks like it will do this.

I looked at _GUICtrlListSelectStrng, _GUICtrlListGetSelItems, and _GUICtrlListGetSelItems but did not find a function that does what I need.

What would you recommend I use? Am I using the correct function?

Me

Link to comment
Share on other sites

My current script has a GUI window opened that is displaying db records. I highlight the record I want to use. Based on the selected record it needs to set 7 variables.

When I look at the Help file I can not find a function that looks like it will do this.

I looked at _GUICtrlListSelectStrng, _GUICtrlListGetSelItems, and _GUICtrlListGetSelItems but did not find a function that does what I need.

What would you recommend I use? Am I using the correct function?

Me

What control are you using to display the db records?

Try looking in the UDF3s.chm help file, you will probably find what you want there.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

The code I use was provided by ChrisL fro another thread. I do not know how to answer your question but will provide the code used.

Script is here:

#include <GUIConstants.au3>

#include "_DBlistView.au3"

Opt("GUIOnEventMode", 1) ; OnEvent mode

Dim $title="Access db Viewer" ;gui title

Dim $gui = GUICreate($title, 600, 600)

GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

$DB="\\192.168.10.11\connect\alarm.mdb"

$Query= "SELECT ID,CompanyName,CompanyAddress1,CompanyState,Companydial,CompanyUser,CPass,RASU,RASP FROM CompanyName"

$Number_of_Records_to_Display = 20 ;these variables are self explanitory...

$Listview_Left = 100

$Listview_Top = 50

$Listview_Width = 400

$Listview_Height = 400

$Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1

$Listview_exStyle = $LVS_EX_FULLROWSELECT + $LVS_EX_GRIDLINES ;default is -1

;call the function _createDBlistView($DB,$Query,$Number_of_Records_to_Display,$Listview_Left,$Listview_Top,$Listview_Width,$Listview_Height,$Listview_style,$Listview_exStyle)

GUISetState ()

While 1

Sleep(3000) ; Idle around

WEnd

Func CLOSEClicked()

Exit

EndFunc

I have attached the include file. Does this provide you with the information you need to see?

When the script opens the database I select the record (highlight it). I want to set variables based on the selected record.

Because I am new to this I am having a difficult grasping some of the concepts you guys obviously understand. Thanks for responding.

Me

Link to comment
Share on other sites

Is anyone interested in answering my question? If it is too basic please let me know and I will do more looking.

Me

I've had a look at your script, sorry I didn't notice your replies earlier.

I need you to explain what you want to though, at the moment there are no controls created in you gui.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

PLEASE!!! I need help with this.

All of my code works except for the select portion of the code.

1. Ask the user for a password to open the software. Done

2. Query a database and display records. Done

3. Based on the highlighted record in guilistview set variables for the record set HELP HELP

(I temporally hardcoded entries to test)

4. Look for an active RAS connection. Done

5. Disconnect RAS connection if opened. Done

6. Create a RAS DUN script file to call the customer site. Done

7. Use RAS Dial to connect to remote system. Done

8. Telnet to the customers system Done

For those of you who do phone systems for a living, I do, you can see this script will be use to connect to an Avaya telephone server.

As you can see from my previous post my query works without issue. I am looking for assistance as to how a selected item in a guilist box, when clicked sets specific variables based on the highlighted record.

I have spent many hours looking at the _dblistview and trying to understand what it is doing. I have also read the help files and am not able to figure what I would use the set the variables for the record.

I do understand it is my inexperience that is preventing me from being successful but would appreciate any help provided.

Me

Link to comment
Share on other sites

Bump

I can almost feel the final bump coming.

People have responded and asked for more information which YOU have not provided. If you can't comply with a simple request then people won't make the effort to help. It's that simple.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

@ IvanCodin

Can you supply a script which I can run to see the problem, and a sample database?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

GEOSoft - I do not understand you comment. I was asked for information for which I provided the script I was using and provided the include file I was using. Why are you saying I have not responded with the appropriate information? I have looked at all of the help files but unless you understand how the gui works it's a little to make things work. I might hold the record for downloads of any snippet or example that includes the guilist ;-)

Martin - I am at a customer site but will download the database for you tonight. I provide the scrip and include file in my previous port. I'll assume from you request that you want to see my entire script, includes and database. Expect them later tonight.

BTW - I have spent many hours trying to figure this out. Is there any good documents, besides the helps file, that explain the programming login used?

Autiit for Dummies?

I appreciate you assistance but I am also interested in understand how the code works so I don't need to post for help.

GEOSoft - Don't expect another dump. You won't see one.

Me

Link to comment
Share on other sites

I'll assume from you request that you want to see my entire script, includes and database.

Always assume this when someone wants to see your code. We are not all experts and we need something we can see, and feel, and touch, to be able to help people. This is one of the largest hurdles we experience when trying to help people.
Link to comment
Share on other sites

Here is my script. The database query functions and displays the records. However I want to set variables for specific fields based on the clicked item in the view. I know there is an easy way to do this but have been unable to figure it out.

Your help with this is appreciated.

BTW If you can point me to good tutorial I'll read it and see if I can get a better understnading of the applicaiton.

Me

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...