Huntwindows V2.7 by Jörg Bublath ================================ COPYRIGHT: Huntwindows is freely distributable. Huntwindows is free to be spread on public-domain and shareware disks especially on Fred Fish's AmigaLibDisks, as long as they are sold for a reasonable charge that is less than US $6 or DM 8.- . For use in commercial products the permission of the author is required. Huntwindows may be copied and distributed via electronic networks such as the Internet, also it may be moved on anonymous ftp-servers, mail-boxes or BBS's. The Copyright is still by the Author. You may use the source for your own non-commercial purposes, but you are not allowed to spread a changed version under the same name. If you think you have made a useful change contact me, so I may include it. REQUIREMENTS: Kickstart 2.04 (V37) or higher PREFACE: Coming with 2.0 you can make screens bigger than the visual size of your monitor. After I tried to catch windows like requesters etc. on my double-sized workbench, I got enough and wrote this little tool. It hangs itself into the VBI to find out which window in being activated and moves the screen to show the window in full view. Additionally there are some other related features like remembering and activating one window for each screen or bring the window or screen being activated to front. For full user-comfort, coming with version 2.0, Huntwindows is now a commodity and can placed into your WBStartup Drawer and has a Graphical User Interface. USAGE: Template: MOVE/S,SFRONT/S,WFRONT/S,DEFPUB/S,ALWAYS/S,REMWIN/S,MOVEMOUSE/S,CX_POPUP/S CX_PRIORITY/K,CX_POPKEY/K,HADJ/K,VADJ/K,SCREEN/K,WINDOW/K or the same options as worbench tooltypes (if no default values are mentioned, then giving the tooltype turn on, leaving it away turns it off) MOVE: Enable ScreenMove() whenever a window is actived - this option should always be given, because it's the main purpose of the program :) SFRONT: Enable the ScreenToFront() whenever a window is activated WFRONT: Do an additional WindowToFront() for windows being activated. DEFPUB: If the Intuition FirstScreen is a PublicScreen it will automaticly set as DefaultPubScreen, so all windows opening on the default will use the FirstScreen. ALWAYS: Turns off the optimization done when a window is already totally visible. This will only have any affect if a HADJ or VADJ option is set. REMWIN: Remember the ActiveWindow for every screen. When switching through the screens Huntwindows will activate the last window that was active when it was the FirstScreen. A maximum of 64 different screens will be remembered - that should be enough, right? This option was based on TWA by Matthias Scheler. MOVEMOUSE: When you try to click on a close-gadget (or any other) of a window that is not completely visible, Huntwindows will move the window to show it completely before you have time to release the button and activate it. When this option is set Huntwindows will move the mouse with the screen, so it still is at the same position as before, and the window will really close (or whatever). This movement will only take place if the mouse was on a position that was already visible before scrolling - otherwise no mouse move will occur. CX_POPUP: Show the Graphical User Interface on startup. The Interface will be automaticly shown, if Huntwindows is already running. CX_PRIORITY= (Default 0) Set the commodity priority. This is the only function which can't be changed from the GUI. It will naturally be saved anyway. To edit it you have to use the workbench to directly change the tooltype. CX_POPKEY= (Default: control alt h) Sets the Popup-hotkey for the GUI. By pressing this key-combination, the GUI will pop open. HADJ=: (only the first letter of the string is significant, Default "l" ) Horizontal Adjustment: l : Left - means that IF scrolling is necessary, huntwindows will try to get the window adjusted to the left edge of the screen r : Same as above with the right edge c : Same as above but centering in the screen Everything else will switch the adjustment off VADJ=: (only the first letter of the string is significant, Default "t" ) Horizontal Adjustment: t : Top - means that IF scrolling is necessary, huntwindows will try to get the window adjusted to the top edge of the screen b : Same as above with the buttom edge c : Same as above but centering in the screen Everything else will switch the adjustment off SCREEN= (Default no pattern) All actions will only take place if the DefaultTitle of the actual screen matches to the given pattern. If no pattern is given, all screens match. If you only want to exclude some screens, simply negate the pattern. For example: SCREEN=~(myscreen#?) The patternmatching is case insensitive. WINDOW= (Default no pattern) Same as screen, but checks the Title of the window that is going to be processed. From CLI you will have to start the program in the background via run nil: huntwindows [options] or whatever you like. If you want to quit Huntwindows simply break the task or quit it with the "Exchange" Commodity Program. From Workbench adjust the tooltypes and simply start by double-clicking. THE GRAPHICAL USER INTERFACE: By defining CX_POPUP, by starting Huntwindows a second time or by using "Show Interface" from the "Exchange" Commodity Program a GUI comes up. All options and tooltypes can be changed here. So you can play around to find out your configuration. If you already have placed Huntwindows in your wbstartup-drawer you may simply click "Save" to add all your options as tooltypes to the icon. When starting from CLI, the "Save"-gadget will be disabled. All options matching the default-value will not be entered when saving. The tooltype "DONOTWAIT", which is necessary when placing Huntwindows into wbstartup is automaticly added on saving as is CX_PRIORITY if not default. When changing the pattern from the GUI, a check will be done when you press return. If there is an error in the pattern, a requester comes up and tells you so. If you do not re-edit the pattern until it is ok, it will match nothing, which is equal to disabling Huntwindows. THANX TO: -Michael Suelmann for help with the workbench/gadtools -Markus 'ill' Illenseer for ideas and Aswarm (where I looked up how to do commodities) -Georg 'Gucky' Hessmann and Matthias 'Tron' Scheler for the idea with the REMWIN option. -Bernhard 'ZZA' Möllemann for testing and help. -Stefan Sticht for help. -Olaf 'MagicOlf' Peters for finding V37-bugs. TECHNICAL: For reaching this Huntwindows installs a Vertical-Blank interrupt-server, which tests if the ActiveWindow and the FirstScreen recorded by intuition differs from the last interrupt and then signals the main-task to move the display. Don't mind it taking away too much CPU time - if you have a look at the source at label 'Interrupt3' you will find that it doesn't do anyhing that is worth arguing about. HISTORY: Version 1.0: Worked with patching vectors, which didn't solve the problem of getting every active window completly. Version 1.1: Now uses VBI for catching active windows. Version 1.2: Added some new options and removed some bugs. Version 1.3: WBONLY and WFRONT option added. WFRONT will not make WindowToFront() on Backdrop and WBENCHWINDOW windows because it causes problems. Workbenchsupport added. Version 1.4: Crash when entering wrong arguments removed Added DEFPUB option Version 2.0: Enforcer Hits (old debugging stuff) removed. Added Commodity support. Added GUI. Version 2.1: Removed small bugs. Added REMWIN feature. Version 2.2: Removed bug in argument-order at CLI-call. Added MOVEMOUSE feature. Version 2.3: Added SCREEN and WINDOW option. Redesigned GUI. Version 2.4: Now tooltypes can be saved to icon. Added "Save", "About" and "GUI Popup" Gadgets to GUI. Removed crash at closedown and some minor bugs. Version 2.5: Added CX_PRIORITY tooltype. Removed small bug which caused REMWIN not to work in 2.4. Version 2.6: Added CX_POPKEY tooltype. GUI can now be opened with a Hotkey. Added Key-Support for Quit,Save,About and Hide - which are easy to implement (I don't think its worth the work and space to do it for all) Hotkey can be edited and saved from GUI. Again removed errors in CLI-call. Version 2.7: CheckBox Gadgets now work under V37, too. MOVEMOUSE debugged, now works under V37 correctly, too. Huntwindows now only moves windows if the button is released, or after it is released which avoids a lot of problems (thanx to Stefan Sticht) Due to the point above Huntwindows does no longer restricts Workbench drawers from WindowToFront The DISP_CLIP is now determined better (thanx to Bernhard Möllemann) Removed Bug which caused Huntwindows to crash when quit after save. TODO: Can anyone out there draw me a nice icon? Waiting for any suggestions from you! BUGS: none - I hope. FINAL REMARKS: This tool is very nice to be used together with Windowshuffle by Stefan Sticht, for hopping through the windows and actually seeing them, when having a BIG workbench. Huntwindows could do a lot of more interesting things - if I could think about anything, so if you have ideas please contact me! For problems and ideas, reach me at: EMAIL: bublath@forwiss.uni-passau.de IRC : Skull (to be found on #amigager - the german amiga channel) SMAIL: Jörg Bublath Holzheimerstr. 4/E07 8390 Passau Germany Phone: Germany-0851-59947