Terry,
I guess your problem is located in the If statement in your handler.
If gcAnalFolder <> "" then
note "yes. gcAnalFolder = " + gcAnalFolder
' Alter Button ID GET_AA_FILE_BUTTON_ID enable
Alter Button GET_ANAL_FILE_DIALOG enable
Else
Note "There is no folder specified for this type of Accessiblity Analysis File."
Alter Button ID GET_AA_FILE_BUTTON_ID disable End If
End Sub
The command for enabling a button is
Alter Control id_num Enable
Alter Button ID GET_AA_FILE_BUTTON_ID enable
is used for buttons on buttonpads not controls on dialogs
HTH,
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Terry McDonnell
Sent: Wednesday, March 29, 2006 7:02 PM
To: [EMAIL PROTECTED]
Subject: [MI-L] FW: Dialog controls apparently not doing as they're billed
Update. Maybe indeed a case of being rusty indeed. I included a
ReadControlValue() in the handler and it now gets the correct value from
the combo/popup menu.
However, the button still isn't being enabled.
So half solved
Terry
-----Original Message-----
From: Terry McDonnell
Sent: 29 March 2006 17:02
To: [EMAIL PROTECTED]
Subject: Dialog controls apparently not doing as they're billed
Hi Listers
I have a dialog that's not behaving as expected. Perhaps it's cos I'm
rusty at the moment but I can't see anything wrong with the code.
It has 2 combos. The 2nd is supposed to enable a button on the same
dialog, if it finds a value in an array. But no matter what I select
from the combo:
A) it keeps returning the same index
B) even though a value is got from the array the button doesn't get
enabled.
Code is below. The vars: gnAAStage & gnSelAAID are both declared
globally and initiated to 1. I originally had a "value" clause on the
popup menus but commented them out in case they were resetting the vars
to 1
The Sub GET_ANAL_FILES_FOLDER seems to correctly get gcAnalFolder from
the array.
My "Note" trace at the end of GET_ANAL_FILES_FOLDER sub reacts
positively anyway (as value 1 is legal) but still the button isn't
enabled. Note that I originally tried to enable it via its ID, but I've
had problems with this in the past and had no joy, so I changed it to
enable the handler instead. Neither works.
I've put in a dummy dialog stub for now but it doesn't get invoked.
Anybody see the problem?
'ppreciate it
Terry McDonnell
'________________________________________________
Sub PLOT_OP_FILE_DIALOG
' _____________________
Dim lnSelID as SmallInt
If not glGotAAs then
Note "Sorry. System cannot find Analysis Areas Table."
Else
DIALOG
Title "Select Accessiblity Output File to plot"
Width 240
...
Control PopUpMenu
Position 10, 20
Width 220
Title from Variable gaAAreas
Into gnSelAAID
...
Control PopUpMenu
Position 10, 50
Width 130
Calling GET_ANAL_FILES_FOLDER
Title from Variable gaAccAnalTypes()
Into gnAAStage
Control Button
Position 10, 70
Title "Get Output File ..."
ID GET_AA_FILE_BUTTON_ID
Calling GET_ANAL_FILE_DIALOG
Disable
Control OKButton
Control CancelButton
If CommandInfo( CMD_INFO_DLG_OK) Then
...
End If
End If
End Sub
'________________________________________________
Sub GET_ANAL_FILES_FOLDER
'_______________________
gcAnalFolder = ""
note "gnAAStage = " + str$(gnAAStage)
Do CASE gnAAStage
Case 1
gcAnalFolder = MISysOptions.Stage1Fold
Case 2
gcAnalFolder = MISysOptions.Stage2Fold
Case 3
gcAnalFolder = MISysOptions.Stage3Fold
Case 4
gcAnalFolder = MISysOptions.Stage4Fold
Case 5
gcAnalFolder = MISysOptions.Stage5Fold
End CASE
If gcAnalFolder <> "" then
note "yes. gcAnalFolder = " + gcAnalFolder
' Alter Button ID GET_AA_FILE_BUTTON_ID enable
Alter Button GET_ANAL_FILE_DIALOG enable Else
Note "There is no folder specified for this type of
Accessiblity Analysis File."
Alter Button ID GET_AA_FILE_BUTTON_ID disable End If
End Sub
'________________________________________________
Sub GET_ANAL_FILE_DIALOG
'_______________________
DIALOG
Control OKButton
Control CancelButton
End Sub
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
_______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
