onevent>dialog_change not working in a tab

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
sarver311
Pro Scripter
Posts: 84
Joined: Tue Jun 17, 2008 6:37 pm

onevent>dialog_change not working in a tab

Post by sarver311 » Wed Jun 18, 2008 11:47 pm

Hi! First of all, I love macro scheduler!!! However I am noticing an odd curiosity when attempting to get it to work.

Does the onevent>dialog_change work if the dialog/object i'm using resides in a tab?

Here is my setup

I have the following line designed to call the subroutine "subcat" if it detects I choose a different item from a listbox

onevent>DIALOG_CHANGE,Dialog1,mslistbox2,subcat

It works fine for detecting a change for the following listbox in my dialog1

ListBox=msListBox2,240,56,121,97,Apps%CRLF%Hardware%CRLF%Service

However it ceases to work if I put that line inside a tabpage

like so:
TabBook=msTabBook1,8,136,649,417,0

TabPage=Page4
ListBox=msListBox2,240,56,121,97,Apps%CRLF%Hardware%CRLF%Service

EndTabBook


I hope this is enough information. Please let me know if needed and I'll include the whole script. I just think I'm not describing the object name accurately in the onevent part of my script. Any thoughts?

Thanks guys!

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Jun 19, 2008 12:33 am

Looks to me like you might have found a problem with OnEvent>. I couldn't figure out how to make it work. However, whether or not the OnEvent can be made to work by entering the object name differently, The following sample shows you how to accomplish the same thing the old fashioned (pre-Onevent>) way.

I've highlighted the important parts in red. Basically you set a flag to be equal to the itemindex of the list. When the flag and the itemindex no longer match, you call the subroutine.

Hope this makes sense.



SRT>subcat
MDL>ok
END>subcat

Dialog>Dialog1
Caption=Dialog1
Width=774
Height=400
Top=223
Left=167
Max=1
Min=1
Close=1
Resize=1
RadioGroup=msRadioGroup1,msRadioGroup1,88,72,225,121,,-1
Edit=msEdit1,160,104,121,msEdit1
Button=msButton1,152,216,75,25,0
Label=test1,112,104,true
TabBook=msTabBook1,384,72,289,193,0
TabPage=Page1
Label=test2,16,32,true
Edit=msEdit2,56,32,121,msEdit2
ListBox=msListBox2,56,56,121,97,Apps%CRLF%Hardware%CRLF%Service
TabPage=Page2
Label=test3,48,64
Edit=msEdit3,96,64,81,msEdit3
Edit=msEdit4,88,96,121,msEdit4
Label=test4,40,96,true
ProgressBar=msProgressBar1,32,32,209,1,0
ProgressBar=msProgressBar2,32,136,209,1,0
ProgressBar=msProgressBar3,32,32,1,105,0
ProgressBar=msProgressBar4,238,32,1,105,0
EndTabBook
EndDialog>Dialog1

Show>Dialog1


Let>itemindextest=notset

Label>Loop
GetDialogAction>dialog1,res1
If>res1=2,EOF

If>itemindextestnotset
If>itemindextestdialog1.mslistbox2.itemindex,subcat
EndIf
Let>itemindextest=dialog1.mslistbox2.itemindex

Wait>0.01
Goto>Loop

Label>EOF

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jun 19, 2008 8:24 am

Looks like a bug. I have logged it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

sarver311
Pro Scripter
Posts: 84
Joined: Tue Jun 17, 2008 6:37 pm

Post by sarver311 » Thu Jun 19, 2008 8:10 pm

JRL Thanks so much for your quick response and your help. I think I understand that solution and I'm still in the planning stage, of the overall script and unsure if I will even use tabs but that really helps me know my options.

I just wanted to make sure I wasn't crazy and doing something wrong.

Thanks again for your help.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts