RE: [MI-L] Set Focus on PopupMenu Control in a Dialog

2006-08-25 Thread Peter Horsbøll Møller



If you read the MapBasic Help file:

The Active keyword applies only to EditText 
controls

You'll notice that 
the Active keyword only works for EditText controls. I have spent quite a few 
hours wondering why my dialog wasn't working as designed.

You might wonder 
why the Active keyword doesn't work on other controls. Any ideas 
?
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 
"For enden af 
regnbuen..." - hvordan kommer man dertil og er 
det overhovedet muligt?Læs mere om årets MapInfo konference på 
www.cowi.dk/mapinfokonference 



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Greg 
GoodallSent: Monday, August 21, 2006 10:21 PMTo: 'Jacques 
Paris'; mapinfo-l@lists.directionsmag.comSubject: RE: [MI-L] Set 
Focus on PopupMenu Control in a Dialog


There’s all sorts of 
“hidden” rules in MapBasic and more importantly the MapBasic 
documentation.

I added another 
EditText control to the dialog BEFORE my PopupMenu but made it 
hidden.

Control EditText 
Hide

As it turns out, that 
hidden control received the focus. Go Figure. In essence the dialog 
displays and it appears that No control at all has the focus. However, 
when I hit the tab key the focus goes to the next control which is my 
PopupMenu. This is a better scenario, but not completely what I 
want.





From: Jacques 
Paris [mailto:[EMAIL PROTECTED] Sent: Monday, August 21, 2006 3:42 
PMTo: 'Greg Goodall'; 
mapinfo-l@lists.directionsmag.comSubject: RE: [MI-L] Set Focus on PopupMenu 
Control in a Dialog

There seems to be some 
hidden rules in that control focus setting. Popup menu does not seem to able to 
be set as “default” control, the one that should be active at dialog opening. 
But it is not the only case I have met; I have been unable to set the OkButton 
or any button as default focus.

What could be that 
hidden rule?

Jacques 
Paris

-Original 
Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Greg GoodallSent: 21 août 2006 13:31To: 
mapinfo-l@lists.directionsmag.comSubject: [MI-L] Set Focus on PopupMenu 
Control in a Dialog

I have a Dialog that contains 
several types of controls (StaticText, PopupMenu, EditText, RadioGroup and 
Buttons) and I would like to specify which control has the initial focus when 
the Dialog displays.

Currently when the Dialog displays, 
the focus is placed on the first EditText control. I want the focus to be 
placed on a PopupMenu control instead.

The Controls are defined in the 
following order

StaticText
PopupMenu
EditText

So I would think that the PopupMenu 
would be get the initial focus according to the Help information 
below.




 


Greg 
Goodall
Data Management 
Marketing
Project Manager / Senior Systems 
Analyst
321-725-8081
[EMAIL PROTECTED]

___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


RE: [MI-L] Set Focus on PopupMenu Control in a Dialog

2006-08-22 Thread Greg Goodall
Spencer,

This worked well.  Sometimes rigging the application is the only way to
go.  You'd think MB would allow you to set the focus on any control you
wanted with the active keywrd.

-Original Message-
From: Spencer Simpson [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 21, 2006 4:24 PM
To: 'Greg Goodall'; mapinfo-l@lists.directionsmag.com
Subject: RE: [MI-L] Set Focus on PopupMenu Control in a Dialog

If your dialog has even one EditText control that is enabled, MapInfo will
select one of those to be the active control.  You have no choice.

However, it's possible to work around this limitation by specifying all of
the EditText controls with Disable.  In that case, the first of the
non-disabled controls in the dialog will be the active one.  If you want an
EditText to be enabled when the dialog appears, you can enable it in the
dialog handler; this will not affect which control is active (that is,
unless you use the Active clause of Alter Control).

In the following code, the RadioGroup will be the active control, since it
is the first control that appears in the dialog which is active by default.

Notice the position clauses, which make the radio group appear further
down in the dialog.

' compiled with MB8.5 / run with MI 8.5

declare sub main
declare sub setupdlg

sub main
dialog title Test
   calling setupdlg
   control StaticText title Edit: position 4, 6
   control EditText value edit text ID 1 disable
   position 30, 4
   control StaticText title Radio: position 4, 38
   control RadioGRoup title first option;second option;third option 
   position 30, 36
   control StaticText title Popup: position 4, 22
   control PopupMenu title first option;second option;third option 
   position 30, 20
   control OKButton title OK
   control CancelButton title Done
end sub


sub setupdlg
alter control 1 enable
end sub



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg Goodall
Sent: Monday, August 21, 2006 1:31 PM
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Set Focus on PopupMenu Control in a Dialog

I have a Dialog that contains several types of controls (StaticText,
PopupMenu, EditText, RadioGroup and Buttons) and I would like to specify
which control has the initial focus when the Dialog displays.

Currently when the Dialog displays, the focus is placed on the first
EditText control.  I want the focus to be placed on a PopupMenu control
instead.

The Controls are defined in the following order

StaticText
PopupMenu
EditText

So I would think that the PopupMenu would be get the initial focus according
to the Help information below.




    

Greg Goodall
Data Management Marketing
Project Manager / Senior Systems Analyst
321-725-8081
[EMAIL PROTECTED]







___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


RE: [MI-L] Set Focus on PopupMenu Control in a Dialog

2006-08-21 Thread Jacques Paris








There seems to be some hidden rules in
that control focus setting. Popup menu does not seem to able to be set as default
control, the one that should be active at dialog opening. But it is not the
only case I have met; I have been unable to set the OkButton or any button as
default focus.



What could be that hidden rule?



Jacques Paris



-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg Goodall
Sent: 21 août 2006 13:31
To:
mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Set Focus on
PopupMenu Control in a Dialog



I have a Dialog that contains
several types of controls (StaticText, PopupMenu, EditText, RadioGroup and
Buttons) and I would like to specify which control has the initial focus when
the Dialog displays.



Currently when the Dialog displays,
the focus is placed on the first EditText control. I want the focus to be
placed on a PopupMenu control instead.



The Controls are defined in the
following order



StaticText

PopupMenu

EditText



So I would think that the PopupMenu
would be get the initial focus according to the Help information below.









 



Greg Goodall

Data Management Marketing

Project Manager / Senior Systems
Analyst

321-725-8081

[EMAIL PROTECTED]








___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


RE: [MI-L] Set Focus on PopupMenu Control in a Dialog

2006-08-21 Thread Spencer Simpson
If your dialog has even one EditText control that is enabled, MapInfo will
select one of those to be the active control.  You have no choice.

However, it's possible to work around this limitation by specifying all of
the EditText controls with Disable.  In that case, the first of the
non-disabled controls in the dialog will be the active one.  If you want an
EditText to be enabled when the dialog appears, you can enable it in the
dialog handler; this will not affect which control is active (that is,
unless you use the Active clause of Alter Control).

In the following code, the RadioGroup will be the active control, since it
is the first control that appears in the dialog which is active by default.

Notice the position clauses, which make the radio group appear further
down in the dialog.

' compiled with MB8.5 / run with MI 8.5

declare sub main
declare sub setupdlg

sub main
dialog title Test
   calling setupdlg
   control StaticText title Edit: position 4, 6
   control EditText value edit text ID 1 disable
   position 30, 4
   control StaticText title Radio: position 4, 38
   control RadioGRoup title first option;second option;third option 
   position 30, 36
   control StaticText title Popup: position 4, 22
   control PopupMenu title first option;second option;third option 
   position 30, 20
   control OKButton title OK
   control CancelButton title Done
end sub


sub setupdlg
alter control 1 enable
end sub



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg Goodall
Sent: Monday, August 21, 2006 1:31 PM
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Set Focus on PopupMenu Control in a Dialog

I have a Dialog that contains several types of controls (StaticText,
PopupMenu, EditText, RadioGroup and Buttons) and I would like to specify
which control has the initial focus when the Dialog displays.

Currently when the Dialog displays, the focus is placed on the first
EditText control.  I want the focus to be placed on a PopupMenu control
instead.

The Controls are defined in the following order

StaticText
PopupMenu
EditText

So I would think that the PopupMenu would be get the initial focus according
to the Help information below.




    

Greg Goodall
Data Management Marketing
Project Manager / Senior Systems Analyst
321-725-8081
[EMAIL PROTECTED]




___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


RE: [MI-L] Set Focus on PopupMenu Control in a Dialog

2006-08-21 Thread Greg Goodall








Theres all sorts of hidden
rules in MapBasic and more importantly the MapBasic documentation.



I added another EditText control to the
dialog BEFORE my PopupMenu but made it hidden.



Control EditText Hide



As it turns out, that hidden control
received the focus.  Go Figure.  In essence the dialog displays and it appears
that No control at all has the focus.  However, when I hit the tab key the
focus goes to the next control which is my PopupMenu.  This is a better scenario,
but not completely what I want.











From: Jacques Paris
[mailto:[EMAIL PROTECTED] 
Sent: Monday, August 21, 2006 3:42
PM
To: 'Greg Goodall';
mapinfo-l@lists.directionsmag.com
Subject: RE: [MI-L] Set Focus on
PopupMenu Control in a Dialog





There seems to be some hidden rules in that
control focus setting. Popup menu does not seem to able to be set as
default control, the one that should be active at dialog opening.
But it is not the only case I have met; I have been unable to set the OkButton
or any button as default focus.



What could be that hidden rule?



Jacques Paris



-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg Goodall
Sent: 21 août 2006 13:31
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Set Focus on
PopupMenu Control in a Dialog



I have a Dialog that contains
several types of controls (StaticText, PopupMenu, EditText, RadioGroup and
Buttons) and I would like to specify which control has the initial focus when
the Dialog displays.



Currently when the Dialog displays,
the focus is placed on the first EditText control. I want the focus to be
placed on a PopupMenu control instead.



The Controls are defined in the
following order



StaticText

PopupMenu

EditText



So I would think that the PopupMenu
would be get the initial focus according to the Help information below.









 



Greg Goodall

Data Management Marketing

Project Manager / Senior Systems
Analyst

321-725-8081

[EMAIL PROTECTED]








___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l