English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. System (http://eab.abime.net/forumdisplay.php?f=113)
-   -   Drop zones in AppWindow? (http://eab.abime.net/showthread.php?t=101478)

Ami 29 March 2020 16:36

Drop zones in AppWindow?

I'm looking for an advice how to code drop areas in AppWindow, just like in IconEdit for example. Code must be OS2+ compatible.


Thomas Richter 29 March 2020 17:06

Well, not really complicated. You first create an appWindow:

appWindow = AddAppWindow(APP_WINDOW_ID,NULL,window,appPort,TAG_DONE)
and within this appWindow, you create one or multiple appZones:

sourceZone      = AddAppWindowDropZone(appWindow,ZONE_SOURCE_ID,NULL,
                                          WBDZA_Left  ,ng.ng_LeftEdge,
                                          WBDZA_Top  ,ng.ng_TopEdge,
                                          WBDZA_Width ,ng.ng_Width,

here it is taking coordinates from a newgadget structure, but this is just an implementation choice.

Warning, Dopus does not support appZones correctly.

Ami 29 March 2020 17:38

AddAppWindowDropZone() need V44. I need OS2.0+ compatibility (V36). :)

thomas 29 March 2020 18:49

Drop zones are only available in V44+.

You can make your window an AppWindow, then the user can drop icons anywhere in the window. You receive an AppMessage which contains the mouse coordinates. Compare them to the areas where you expect icons to be dropped.

Ami 30 March 2020 21:20

Ah yes, got it working now. Thanks. :)

All times are GMT +2. The time now is 11:28.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.

Page generated in 0.04026 seconds with 11 queries