File: WordWrap0.3.zip Author: Ed Musgrove BeDev#2076 Release: 23 December 1997 Compatibility: PR 2 Location: pub/contrib/util and/or pub/contrib/develop Description: Word wrap files with long lines. A GUI app with file requester. Uses My font sensitivity routine Notes: (0) Eventually, I hope to break this app into a number of small pieces. I will try to make this a tutorial for beginner BeOS programmers. (1) There is a "load file..." gadget as well as menu item and a preferences panel withan "integer gadget" which accepts a value between 0 and UINT_MAX inclusive. When the file requester sends a "load file" message, the file is buffered, the lines are wordwrapped, and a save file panel opens to allow the file to be placed and named. There are two "font" buttons to enable play with font sensitive gui items. There is provision for some LibPref preferences (window placement and colors of all the gadgets and window background.) Source code is included. This is a test implimentation of my own simple word wrapping procedure. I am also employing the first implimentation of my font sensitive GUI, along with a trial run of an "integer gadget". I am really releasing this as a test of these concepts, not so much as a tool to help tweak text files. Examine the procedures for all three things (the word wrap code, the font sensitive GUI, and the integer restricted gadget) and let me know of errors or needed enhancements you notice. Known Bugs: There is a race condition which causes the windows to be too small horizontally, and hosed when you try to scroll or resize. This can be prevented by running the app from a terminal. See the printf() on line 56 of windowGuts.cpp. This bug only shows up rarely on my BeBox66. I am experimenting with semaphores unsuccessfully. Another problem is that to activate my windows, one must select the title tab, window border, or menu area. The custom scroll view must be gobbling up all the clicks and not properly passing them on--hmmmm. -Ed edgar@harbornet.com