Текущий архив: 2002.09.30;
Скачать: CL | DM;
Вниз
MapInfo Найти похожие ветки
← →
qube © (2002-09-18 17:22) [0]Могу ли я обрабатывать события мыши, когда курсор находится в окне Mapinfo?
oleMapInfo := CreateOLEObject("MapInfo.Application");
Str(pnlMap.Handle, sWinHand);
MsgString := "Set Next Document Parent " + sWinHand + " Style 1";
oleMapInfo.Do(MsgString);
MsgString := "Set Window Info Parent " + sWinHand;
oleMapInfo.Do(MsgString);
MsgString:="Set Window Ruler Parent " + sWinHand;
oleMapInfo.Do(MsgString);
MsgString := "Set Application Window " + sWinHand;
oleMapInfo.Do(MsgString);
MsgString:="Set Window Info Parent " + sWinHand;
oleMapInfo.Do(MsgString);
← →
Подземельный Кадастрат (2002-09-18 18:49) [1]Вот тут такая ерунда в хэлпе по МБ:
The following steps provide an overview of the process of using callbacks through OLE:
1. Using Visual Basic 4.0, C++, or any other language that can act as an OLE server, create a class definition that defines one or more OLE methods. For details on how to create a class definition, see the documentation for your programming language.
2. If you want to emulate MapInfo"s status bar, create a method called SetStatusText. Define this method so that it takes one argument: a string.
3. If you want MapInfo to notify your program each time a Map window changes, create a method called WindowContentsChanged. Define this method so that it takes one argument: a four-byte integer.
4. If you want MapInfo to notify your client program whenever custom menu commands or custom buttons are used, create one or more additional method(s), using whatever method names you choose. Each of these methods should take one argument: a string.
5. Create an object using your custom class. For example, if you called the class "CMyClass", the following Visual Basic statement creates an object of that class:
Public myObject As New CMyClass
6. After your program launches MapInfo, call MapInfo"s SetCallback method, and specify the name of the object:
mapinfo.SetCallback myObject
7. If you want MapInfo to notify your client program when the user uses a custom toolbar button, define a custom button (e.g. send MapInfo an Alter ButtonPad ... Add statement). Define the custom button so that it uses the syntax Calling OLE methodname (using the method name you created in step 4).
Note that MapInfo"s toolbars are hidden, like the rest of MapInfo"s user interface. The user will not see the new custom button. Therefore, you may want to add an icon, button, or other visible control to your client program"s user interface. When the user clicks on your Visual Basic icon or button, send MapInfo a Run Menu Command ID statement so that your custom toolbutton becomes the "active" MapInfo tool.
8. If you want MapInfo to notify your client program whenever the user uses a custom menu command, define a custom menu command (e.g. using the Alter Menu ... Add statement to add an item to one of MapInfo"s shortcut menus). Define the custom menu command so that it uses the syntax Calling OLE methodname (using the method name you specified in step 4).
9. Within the method(s) that you defined, issue whatever statements are needed to process the arguments sent by MapInfo.
If you created a SetStatusText method, MapInfo sends a simple text string to the method, representing the text that MapInfo would display on the status bar. If you want to emulate MapInfo"s status bar, add code to this method to display the text somewhere in your user interface.
If you created a WindowContentsChanged method, MapInfo sends a four-byte integer (representing a MapInfo window ID number) to indicate which Map window has changed. Add code to this method to do whatever processing is necessary in response to the window"s changing. For example, if you are keeping track of the Map window"s current zoom level, you may want to call MapInfo"s MapperInfo( ) function to determine the Map window"s latest zoom level.
If you are using methods to handle custom buttons or menu commands, MapInfo sends a comma-delimited string to your custom method. Within your method, parse the string. The exact format of the string varies, depending on whether the user used a menu command, a "point-mode" drawing tool, a "line-mode" drawing tool, etc. The following section explains the syntax of the comma-separated string.
По-ихнему, получается, нельзя.
Но, может быть, получится и "не по-ихнему", т.е., по-другому определить задачу.
Пиши на skaminski@yandex.ru, может чем то и помогу, так как сам решал некоторые задачи "совокупления" МИ и делфи
← →
qube © (2002-09-19 10:14) [2]Спасибо, я уж и не надеялся на ответ :).
Callback"и уже использовал, но нужных мне событий (а именно мышиных) там нет :(.
Проблема-то вот в чем: я хотел бы прилепить к Мапинфо нормальное PopupMenu (о "Create menu id 17 as ..." знаю, но его использовать не хочу). Может, есть идеи?
Страницы: 1 вся ветка
Текущий архив: 2002.09.30;
Скачать: CL | DM;
Память: 0.47 MB
Время: 0.012 c