There is a very devious way to do it. First, you must have MapInfo v7 or +. 
Second, you must extract the icon as a BMP (via Resource
Hacker for example). Third, the bmp must be registered as a TAB. Fourth you 
must include in your code a dialog handler to display
the icon. Fifth, you should restore the functionality of the icon with the 
appropriate code; however the documentwindow control does
not accept a handler. Thus a little bit more "deviousness"; add a button that 
will "frame" the image and that will have the handler.

If another document window contains an accessible map, you can use such 
icons/buttons to navigate or do other operations (change
style, create objects...) within that dialog.

Does anyone have with some experience in the area of map manipulations in a 
dialog?

This code will prove my point: (the settings are for a large icon; they will 
need some adjustment if a small format is used)

declare sub dialoghandler
declare sub zoomplus
dialog Title "Icon in dialog" calling dialoghandler
        Control DocumentWindow ID 1007 Width 20 Height 18 position 10,10 disable
        control button position 7,7 width 22 height 20 title "" calling zoomplus
        control okbutton 

sub dialoghandler
Dim iHwnd As Integer
iHwnd = ReadControlValue(1007)
Set Next Document Parent iHwnd Style 1
open table "gr01_005_26.tab"
map from gr01_005_26
set coordsys table gr01_005_26
set window frontwindow() width 1.2 Units "in" height 1.2 Units "in" scrollbars 
off
set map window frontwindow() center (60,-60) zoom 120 Units "ft"
end sub

sub zoomplus
run menu command 1705
end sub

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jakob Lanstorp
Sent: 26 septembre 2006 08:01
To: [EMAIL PROTECTED]
Cc: mapinfo-l@lists.directionsmag.com
Subject: RE: [MI-L] Icon Image Buttons in dialogs

You can not do this in MapBasic. Some use c,c++ or delphi to embed forms
in dll to use from MapBasic in MapInfo. If your a novice devloper I
would stick to the standard MapBasic dialogs. 

You could build a buttonpad (not a dialog) in MapBasic with toggle
buttons and icon change on toggle.

HTH
Jakob Lanstorp
Software Developer
GIS, Surveying & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S
Denmark
 
Tel     +45 6311 4900
Mob     +45 4020 7529
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rakesh
Rao
Sent: Tuesday, September 26, 2006 1:05 PM
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Icon Image Buttons in dialogs


Hello,

I am trying to build a MapBasic dialog box with icons in Push buttons
which act like toggles. 
One push and it is On and Push again, it is Off. I need to be able to
dynamically change the icon of each button as it is depressed (like in
VB) by changing the bmp's. How do I do this? 
What control I must use?

Any help is appreciated and thanks in advance.

Regards
- Rakesh Rao [ rakesh.rao (at)4d-technologies.com ]
- Four Dimension Technologies
  [www.4d-technologies.com]
- Get GeoTools, Work smarter: www.4d-technologies.com/geotools
- Free Lisp downloads @ TechCenter: www.4d-technologies.com/techcenter
- View GDF files within the AutoCAD environment, Use GDFViewer with
GeoTools
------- End of forwarded message -------

- Rakesh Rao [ rakesh.rao (at)4d-technologies.com ]
- Four Dimension Technologies
  [www.4d-technologies.com]
- Get GeoTools, Work smarter: www.4d-technologies.com/geotools
- Free Lisp downloads @ TechCenter: www.4d-technologies.com/techcenter
- View GDF files in AutoCAD, Get GDFViewer with GeoTools

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




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




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

Reply via email to