Changes in SuperWaba version 2.0 beta 1

IMPORTANT: this is a BETA version. if you find any bug, please shrink your code so the bug is still there and send it to me. dont send me big codes! also, backup your data. although this version is stable, be aware that if you find a serious bug, you may need to do a hard reset in your handheld!

I would like to thank Rick Wild; the more I know his virtual machine, the more impressed I become with his work.
I would also like to thank Ralf Kleberhoff, Noli Sicad and Matthias Ringwald for they invaluable help.

This beta release of SuperWaba 2.0 is the result of 5 months of dedicated home work. I had a dream. The dream was give SuperWaba a better look and feel for its user interface. My dream started with the code that Ralf sent me about entering in gray scale. I then started learning the 68000 assembler. This was necessary because the most used routines, like setPixel, drawHLine, drawVLine had to be the fast as possible. After this was done, i started to make the other routines. I spent almost 3 weeks searching for graphical algorithms in the net. Hundreds of sites visited. I found almost all, but the draw/fill arc. I had to made it. Then, a guy asked: dont SuperWaba handles double/long? No, i said, not yet. Then i started the research in how to implement those, and here it is. Native support for longs and doubles. I also improved the wextras exegen and warp files, which now is the official ones to build SuperWaba. There are also hundreds of enhancements through all the library, like support for sprite, collision detection, circles, pies... the sky is the limit! My final goal is: make SuperWaba the best java virtual machine for the PalmPilot of the world! Thanks for all the help. Guilherme Campos Hazan.

tip: to see how powerful SuperWaba 2.0 is, run the welcome app (by clicking in the SuperWaba icon)

. Please be aware that, as ALL programs that supports gray scale in ALL PalmOs devices, SuperWaba 2.0 access some reserved areas in the rom and other structures. So, dont care for PalmEmulator warnings. i'm aware of all of them.
. See the file org/directory.txt for details about the new directory structure. see also the readme.txt files under almost all directories.
. new creator ID for SuperWaba: SWAB . this will help with the coexistence of multiple waba vm versions
. new directory structure to conform with the new Waba Specifications. the org/wabavm/palm/desktop directory has the packages needed to test the program in the desktop computer, and org/wabavm/palm/device directory has the classes, the vm itself, the docs and the bin directory, the waba and the java packages; all related only to when the program runs in the device.
. if you need the project files of CodeWarrior 6 to build the VM and/or the Stub, please ask me.
. wextras.wababin.* now is copied to the bin directory. warp had been modified to create warp files (i removed it a long time ago)
. to see how to build the pdb and prc files, see the make.bat under the \org\wabavm\palm\examples\bench directory.
. exegen now has an option /v to write the app version information. eg: "/v 2.01" or "/v 2.0"
. warp now has an option /! to not create the warp file (only the pdb file will be created)
. desktop.waba.io.Catalog now correctly writes the creation date to the pdb file
. desktop.waba.io.Catalog now sets the AttrBackup field if the database is modified
. new methods in waba.io.Catalog: get/setAttributes. use the DB_ATTR_* masks to get/set individual bits.
. new methods in waba.io.Catalog: get/setRecordAttributes. use the REC_ATTR_* masks to get/set individual bits.
. now in desktop.waba.io.Catalog the date and attributes are preserved if the file was readed from disk
. now in desktop.waba.io.Catalog the methods toPDB and fromPDB are non-static. Use the default constructor to get access to it if you want.
. toPDB and fromPDB now has a new parameter: Vector _attr, which will hold the attributes for each record. they can be null.
. the wextras 1.3 package from Rob Nielsen is now under the org.wabavm.palm.addons directory. this directory will hold all classes from third party users that may be putted together.
. added TextArea from Michael Brereton to the org.wabavm.palm.addons.
. corrected the Convert.toString(char c) method. it was not converting correctly the international chars.
. added support for menu bar from wextras. Since SuperWaba uses the Control class instead of MenuBar, it calls menubar.setVisible(true) in order to pop it up. added the method Window.setMenuBar. added the method wextras.ui.MenuBar.setVisible(boolean b)
. modified org.wabavm.palm.desktop.waba.sys.Vm.openInputStream to handle jar files. used code from Scott Cytacki @ 20010222
. modified org.wabavm.palm.device.waba.io.DataStream.readString as mike mcroberts pointed to grow the byte array if necessary
. implemented Gennadi Pergament modifications to correct the fatal errors when poping up some palm dialogs. this bug is since waba 1.0.
  ATTENTION: to correct this error, i had to create a default form for Waba. So, be aware of this when creating waba.prc from others compilers
. added the Symbol barcode scanner support implemented by Tom Cuthill (vm growed 1.5kb); added the class waba.io.Scanner.java
. added support for the list icon (15x2), thanks to ed crandwel for the startup code.
. corrected convertion in formatDouble, it was not formatting precision below 0.32767
. added support for double's!!! all bytecodes implemented, tested and working.
. added a new constructor to StringBuffer: StringBuffer(startSize)
. changed String.hashCode to match the one in jdk 1.2.2.
. waba.sys.Convert: new method toDouble(String), toString(double), toLong(String), toString(long), toLong(String, radix), toString(long,radix), forDigit(i,radix), digitOf(char,radix)
. new method in class String: reversed (returns the reversed of the current string)
. added support for long's!!! all bytecodes implemented and working.
. now SuperWaba is a multi-segment application. This means that now the sky is the limit. PS: SuperWaba still works in Palm OS 2.0
. improved class Graphics. Now it supports GRAY SCALE in all palm os versions (starting from PalmOS 2). Support for color in next version. Lots of new methods:
  . colors from 0 to 3
  . draw/fill circles
  . draw arcs
  . draw/fill pies
  . draw elliptical arcs
  . draw/fill elliptical pies
  . instant screen erase
  . set/get pixel
  . dotted line in all directions
  . draw/fill round rect
  . getAnglePoint to get the point of an ellipse given an angle; usefull to see where to draw the pie labels
  . draw/fill polygons of any shape
  . collisionDetect: returns true if two bitmaps collides (tested and working)
  . eraseRect replace all pixels with the foreground color by the background color
. new constants in the class Color: GS_WHITE, GS_BRIGHT, GS_DARK, GS_BLACK. those constants are returned from getGray(). New constructor Color(int rgb); new method int getRGB(); new constant array: GS_PAL (GrayScale palette. use the constants GS_xxx as the indexes), used to get the color that represent the desired gray scale; new method equals; new constants BLACK DARK BRIGHT WHITE that represents the colors in gray scale.
. added class Math taked from Jump2. To reduce its size, i stripped out all methods that used float; since double is much more accurate, you can compute the values using double and then cast to float. the method random was modified.
. waba.sys.Convert: removed the methods add,sub,mul,div. since now there is native support, there are no needs for those methods. Also, max,min,abs,random were moved to class waba.util.Math. Added the methods doubleToLongBits and longBitsToDouble. added constants MIN_LONG_VALUE and MAX_LONG_VALUE.
. new methods in waba.io.DataStream: writeDouble, readDouble, writeLong, readLong.
. added method parseNative in MethodsHash so a normal method string is converted to java bytecode defs. eg: boolean clip(waba.fx.Rect r) -> waba/fx/Graphics_clip_(Lwaba/fx/Rect;)Z  . also modified nativeHash to create the output with the same formatting of the waba native method table and a function prototype (with its header) is also created. everything is outputted to methodshash.txt.
. prc commandline: now the maximum class name length for the command line argument in the prc is 200. was 80.
. user defined command line arguments: now the prc can receive command line arguments. there is no maximum length (unless specified by palm os).
. warp and exegen now has an option /$ to set the copy protection attribute of the prc and the pdb file.
. extended the prc name from 30 to 31 bytes.
. PrcFile now automatically finds all the offsets of the placeholders. it scans for strings and scans the prc file to find the offset of each bitmap record.
. in Window.popupModal if the programmer try to popup in the wrong way, do it in the write way. I thoght that just reading the docs would be enough. ;-)
. added a catch to waba/applet/Applet.java class to trap linkage errors.
. new method Vm.getMaxColors: returns the number of colors supported by the device.
. corrected errors in Vm about arrayCopy that Sean Luke WabaWalker :-) pointed out.
. Added 2 methods to Object: equals and toString, this one native. changed all toString methods on the controls.
. Vm.debug is modified. now the strings are sent to a memo record created with the title: "SuperWaba Debug Console". the line is writted as "<timestamp> mystring \n". at the program's end a "--- End ---" line is entered. the memo is *not* deleted at each program start. The Vm.trace strings are also sent to there. the memo is created only if you issue a Vm.debug or vm.setTrace command. it also may slowdown a little your program. dont forget to turn off your echoes when you send your program to your customer!!!
. htPut in waba.c now sends a debug message to the console when it finds a duplicated hash value.
. new Label.set3d method. just for fun... :-)
. the controls are being converted to grayScale and color support. the difference is unbelievable!!!
. String.valueOf(Object) now returns obj.toString instead of "?"
. String.equals(Object), if obj is not a string, now returns super.equals(obj) instead of true
. new methods String.indexOf(String) and String.indexOf(String, startIndex)
. corrected a wrong comparision of string boundaries in String.indexOf(char,int)
. in the vm, new constant STU_USE_STATIC2 so a secundary buffer is used. good for routines that needs 2 temporary buffers. expanded sbytes to 192 (was 64)
. changed the behavior of setVisible in the Control class. now it sets a flag that is ignored in Container.paintChildren method
. new methods and members for class control: (set/get)backColor, (set/get)foreColor. so each control can have different colors (preparation for COLORS!)
. added Color.defaultBackColor, Color.defaultForeColor so users dont have to specify the default colors of the controls.
. added Graphics.draw3dRect, used in most controls. use the constants EDIT LOWERED RAISED CKECK.
. new methods Color.darker, Color.brighter
. removed Tab and TabBar from waba.ui. use TabPanel instead. if you dont want to use it, get the old classes, change the packages and add to your project.
. button.drawButton (static method) removed. use Graphics.draw3dRect instead
. now the controls have a disabled state look&feel.
. removed radio.drawRadio. and check.drawCheck.
. removed ISurface from window, putted in Control.
. added ComboBox, ListBox and PopList to waba.ui. thanks to Daniel Tauschke. just to understand: ComboBox uses a PopList as the popup window. PopList is a Window that adds a ListBox to itself.
. new method Rect.set(x,y,w,h)
. class Edit simplified
. new method Graphics.drawArrow to draw the arrows for all controls.
. new empty constructor for class Rect.
. Button now accepts images.
. new Image.getGraphics(). same as new Graphics(Image)
. new class Coord, to store x,y values. If i used Point, it wont make sense use it in getSize methods. If i used Size, it wont make sense if used in getPoint methods. So, Coord is more general. Coord has two methods width() and height() hat just return x and y. just to make more sense. ;-)
. new constructor for class Rect: Rect(Coord topleft, Coord bottomright)
. to use less memory, Vector grows 20% at each time (instead of doubling)
. new methods Control.getSize and Control.getPos, both returning a Coord
. new method Button.createArrowButton to make easier create image buttons with arrow images. used by many ui classes
. new method Button.setPressed used to simulate a button press.
. new method Control.getParentWindow()
. Container.setEnabled now calls setEnabled in all childrens.
. removed all toString() implementations. they will be back in the appletviewer port. with the toString's i was getting 4549 more bytes in the superwaba.pdb!
. added Control.addedNotify and Control.removedNotify protected methods. called by the container when the control is added/removed to/from it.
. PushButtonGroup: new method setSimpleBorder, to remove the 3d borders (and the bigger required size)
. removed tones at startup. putted a fade out hourglass.
. new method Convert.toString(double d)
. new methods StringBuffer.valueOf(long) and valueOf(double)
. removed beep in TabPanel tab click.
. YES! I DID IT!!! if a system dialog comes on, my trap of sysTrapWinSetActiveWindow turns off gray mode, displayes the dialog and comes back when finished. :-)))
. Image class
  . 1,2,4,8 bit depth support
  . support for rle4 and rle8 compressed bitmaps
  . more bitmap draw operations, including transparent bitmap color (sprite)
  . setPixels and getPixels are DEPRECATED. better saying, they are no more implemented. until the final release, they will be removed. no more time to create another way in this beta version.
. added methods rol and ror to class Math.
. new method Vm.getScreenSize(), returning a Coord.
. new native private method Window.drawOffScreen. only used to update the screen as fast as possible.
. new method Button.setGap to set the gap between the text/image and the borders. the default is 1. used when the size is set by getPreferredXXX.
. new method Button.setBorder. now there are 3 styles of button border: BORDER_NONE, BORDER_SIMPLE AND BORDER_3D. 3D is the default.
. new method Image.set/getTransparentColor
. new method Button.getImage(). returns null if the Button is a text one.
. new method TabPanel.setCaptionColor - just to set the text color of the captions
. corrected FontMetrics documentation.
. now the Control.getBackColor() and getForeColor returns the ideal disabled color if the control is not enabled. the disabled color is defined as foreColor.brighter() and backColor.darker().
. corrected getPalmFontID for PalmOS 2.0 when selected the big font. Theres no big font in palm 2.
. now when a fatal error occurs, the full message is sent to the debug console.
. excluded line number in trace; included method desc;
. trapped a unknown error exception that occured when the array was zero-length
. new method Container.getChilds() to return an array of controls inside the container
. new method Vector.clear() to reset the vector.
. new method Convert.tokenizeString that returns an array of parsed strings
. new methods Edit.setEditable and isEditable() - allow or disallow the enter of text from the user
. new public variable Control.appId : a application defined constant. This constant is not used; its only a placeholder for the application so it can set to any value it wants
. growed default memory sizes of exegen. new option /! in exegen to not generate .lnk file
. new Method Image.changeColors(from, to): Changes all the pixels of the image from one color to the other. Note that the current value of the transparent color is not changed. When you load a mono bmp (consumes less memory), it is stored internally as grayScale (or color). Using this routine, you can change the colors to any other you want.
. putted a message when you try to create a graphics object for the control but theres no parent yet. good for help you debug your code.
. changed Control.toString(): if the appId != 0, append it. good for debugging.
. added Control.isDisplayed: return true if the parent of this Control is added to somewhere. Some controls, like the TabPanel, has n containers, but only one is displayed at a time. With this method, the Control can inspect if your container is the one available.
. new method Graphics.setColors: sets both fore and background colors, taking as parameter a Color.
. corrected visual of round border Windows.
. class TabPanel now is redesigned. new method SetType to set the tab position: TAB_TOP or TAB_BOTTOM. Now the default gaps are 1,1,1,1 instead of 0,0,0,0.
. new methods Rect.modify to resize the rect; x2() returns x+width-1; y2() returns y+height-1
. removed IKeys.CONTRAST. since theres a form, the contrast dialog (and the other system dialogs) dont crash SW.
. removed Window(String title, boolean border) that was deprecated since 1.12
. trapped another unknown error. in this error, the obj was greater than 65535. happened when the Keyboard class was set to doubleBuffer and it was poped up.
. new type for Edit: PASSWORD. in this type, only the last char is displayed. all the others are displayed as *. Thanks to Pablo Lopez-Jamar for the idea.
. now when the Edit mode is CURRENCY and the popup keyboard is invoked, a Calculator is displayed. Taked from VPFinance.
. changed getClientRect to return the rect in relative coords, not in absolute coords. corrected if border but no title
. corrected PushButtonGroup getPreferredWidth and getPreferredHeight.
. currected Hashtable.getKeys. thanks to David gecawich
. new method Window.getOffScreen. used to return the image that the double buffer uses.
. new method Graphics.getTranslation to return the current translate.

Comments and bugs (i have no time to correct those now)
. Note that the foreColor and backColor implementation is to prepare for COLOR support. all disabled colors are based on the control's back and fore colors; they are relative, not fixed.
. although a java int has 32 bits, please dont use graphical coordinates greater than a signed 16 bits integer (< -32767 or > 32768). if you do so, strange things can happen...
. i tested almost 90% of all double and long bytecodes, but some opcodes were not tested (did not found how to test them).
. note that all controls changed its sizes, so youll need to fix some thing when porting old apps.
. DONT TRY TO RUN SUPERWABA 2.0 BETA 1 IN A COLOR DEVICE: IT WILL CRASH!
. Convert.formatDouble still doesnt recognizes exp term.
. If you want to use superwaba 2 with your old code, you must recompile your sources and generate the pdb and prc files. the old prc file wont work with sw 2.0 (ps: this is not a bug!)
. since the vm is now multi-segmented, its harder to compile (and theres no time to write a how to now)
. to make support for double and longs, the vm is now consumming more memory. so, you may have to change the memory params to make your app work. also, since grayscale requires more memory, i'm sure i may have to break the 64k object memory heap sonner than i thinked.
. the welcome app is taking about 20k of the pdb files. until the final release, i'll strip out all the extra stuff putted there. its here now only to demonstrate the new features.
. i found a very interesting and strange behaviour. in my palm iiie, when i draw vertical or horizontal lines under a BRIGHT background, some ghost lines appear. then, if i draw a WHITE line where the ghost lines appers, they disappear! i hope this will only happen in IIIe devices but, if it happen, you can easily use this trick. In Professional, III and V this dont happens.
. need to make the statePosition work.
. the Graphics.copyRect is VERY slow. i need to convert it to assembler. note also that since the offscreen windows uses that method, its popup is very sloooooooooow. :-)

Future Enhancements
. implementation of the changes in the serial class (irda) by Matthias Ringwald. i didnt did this yet bc it needs to convert the whole project to 3.5. but i'll do it in next release.
. virtual screen support
. appletviewer support and, who knows, wince port (anyone wants to do it?)
. use of Image.loadFrom(byte []) and byte []saveTo() to save/load Images (bitmaps). in the loadFrom you pass an array containing a normal bmp file type. saveTo returns a new bmp file format with the image. were there any other use for the old setPixels that i did not know?
. implement the grayscale version of the caps lock and command indicators.
. Color support
. User defined fonts
. automatic dithering or color images to grayscale. currently, the thresshold + color luminance method is used
. faster drawBitmap
. dinamyc load of native methods, thus reducing vm size
. Edit class optimization.
. Child windows
. drawed focus (the dotted rect around the current focused control)
. change invPixelNOCT and erasePixelNOCT to invVLineNOCT and eraseVLineNOCT to improve performance
. IR send/receive.
. command line arguments for methodshash.
. moveable popup/child windows.
. scrollable container.
. use of the default popup keyboard (is this a good idea?)
. Oh my God! when will I have time to SuperWabaJump?




Changes in SuperWaba 2.0 beta 2

. IMPORTANT! install this version in a newly created directory. dont merge it with the old tree. some things were changed!
. IMPORTANT: because of some changes of methods names, you must recompile your app to ensure that it will run in this version.
. Attention: please read the readme.txt files located in the directories. they have important informations!
. new routines to correctly handle unicode chars. thanks to Sean Luke
. Convert.toDouble(String) now handles scientific notation strings.
. Convert.toString(double) still DONT handles scientific notation. but if you want to format double values greater than +-exp16, use the org/wabavm/palm/ext/Double/DoubleToString.java class.
. added again String.valueOf(double/long) and StringBuffer.append(double/long). i dont know what happened. i already had added this.
. corrected String.equals that James GuistWite pointed out.
. removed STU_USE_STATIC2. no more 2 buffers in stringToUtf. (VM)
. corrected bug in normal (non-rle) bitmaps. thanks to Daniel Tauschke who pointed this one.
. new Example file: UIGadgets. shrinked Welcome.java to the original size.
. new make.bat file in the examples directory, configurable to make easier to compile and build the pdb/prc files.
. created Edit.popupKCC() to popup the keyboard/calendar/calculator
. corrected some errors at the ListBox class that ym-bezeq pointed out: documentation bug and 2 bugs when the list contains more items than the visible area.
. now the make.bat file at palm/device compiles the superwaba classes and generates the pdb file. corrected all make.bat files.
. updated desktop classes. now they are compatible with SuperWaba 2.0
  . updated desktop/waba/util/Date. they was different. dont know why.
  . corrected bold fonts not being correctly created.
  . Graphics class completely changed to use the same native algorithms as the VM instead of the java ones
  . support for custom fonts in appletviewer. now wysiwyg in the desktop, using fonts from rom!
. fixed the width/height of vm CollisionDetect when the source surface was a control or mainwin
. added ScanEvent.java, and corrected the Scanner class with the help of Wilbolite. Added a scanner event, TRIGGERED.
. changed method addMemo at wextras.io.builtin.Memo to public. otherwise, theres no how to save the memo. or is?
. added HashTable.put(Object, Object). Now the Key NO MORE needs to be a String.
. the fillpolygon of desktop differs from the one in device. the device's is *very* much faster than the desktop one. but i could not port some annoying c pointers to java, so i used one made in java in the desktop.
. corrected Convert.tokenizeString. now it returns the string itself if no tokens exist
. support for custom fonts under *any* PalmOS. Please see the waba.fx.Font docs for more information.
. created a rundemo.bat at org/wabavm/palm/desktop
. waba.util.Math random is modified to match the ones that Sean Luke created. Now it's in pure java.
. added Control.getFont(). thanks to Bjoern Knafla for the tip.
. corrected ComboBox.setFont. it was not propagating to the pop list.
. corrected listbox height when its height was not multiple of its font height.
. corrected the command line of the superwaba stub. now theres no more horious databases being created.
. corrected also the command line arguments of the superwaba application. now, if you send an argument in the command line, you can get it with the MainWindow.getCommandLine() method. here is the example i tested: Vm.exec("UIGadgets","Hi"+getCommandLine(),0,false); tested using the UIGadgets example. corrected also the Vm.exec; now it can call another superwaba program passing parameters to it.
. changed the warp name from Wrp1 to Wrp2 with the hope that this lets waba co-exist with superwaba. (ps: still didnt work)
. added extensible libraries to SuperWaba. now SuperWaba will scan all extended libraries installed and automatically use them. to create a SuperWaba Extended Library, there are 2 types of libraries: local and global. The local ones have the same creator id of your application, and thus only your app has access to it; also, it will be deleted with your app (when the user do so). The global ones have the same creator id of SuperWaba (SWAB), and all applications will have access to it; it will be deleted with SuperWaba. to create the library, use the new Warp options /LL (for local) and /LG (for global). In the ext/wextras directory is a wextras.pdb file that is a global library (you can use the buildext.bat file to build it if you modify wextras package)
. changed addons directories to ext. just to make sense when creating SWA'X' files, probably stored there.
. created a new option at the warp class: /x lets you specify an excluding list of classes or packages. Suppose you create an extension library (or use wextras and install the wextras.pdb), you need to exclude those files from the warp.
. corrected the setup.bat and class.bat files at wextras package. although they are using deprecated methods, i wont fix this. also, when using its io, be careful with the same name of extra.io.DataStream and waba.io.DataStream. extra's use some things that i dont want to add to sw (like bufferstream).
. bypassed bug when trying to concatenate an array with a string (eg: myArray+""). thanks to Rick Wild to send the fix. thanks to Rick Wild. thanks to Rick Wild. thanks to Rick Wild....  :-)
. added ext\aaafontview12 folder. it contains a freeware utility to see and delete the installed fonts in the device. very cool!
. changed Button.setPressed to Button.press.
. changed Container.getchilds to getChildren. sorry, bad english
. added Rect.intersects
. changed MainWindow.exit to be final. if you overided this method, change it to onExit() and remove any super.exit calls inside the method or you will get a stack overflow error.
. removed hourglass fade. my boss asked: are your batteries getting low? :-)
. corrected ListBox. added examples\ListBoxExample. thanks both to Bjoern Knafla.
. fixed vm.trace output string. added a new trace point. corrected a wrong class name display.
. fixed Window.isVisible.
. added Control.requestFocus(). just a handy method.
. corrected Control.getBackColor when the control is disabled.
. added org/wabavm/palm/desktop/makejar.bat - a cmd line to create a jar file with all SuperWaba files and fonts.
. now in the JavaBridge.openInputStream, if youre running from appletviewer, it tries to find the file in 3 ways: 1. from the archive | 2. from the codebase | 3. from the localhost ; if youre running from java.exe, it searches 1. from the appPath (if defined) | 2. from the classpath (but still not inside jar files on classpath).
. Note: the appPath only needs to be specified if your image/database files are not accessible by the classpath.
. Note: the graphics performance is proposital slow. i think it will be better if you think that your device is faster than the desktop!
. Dont forget to set waba.applet.JavaBridge.showMsgs to false if you are deploying an application using the desktop classes!
. Note: if you didnt liked the new UI design, you can change it back to "monochrome old palm style". just put these lines at the start of the app's constructor
  . Color.defaultBackColor = Color.WHITE; // turn color back to the default "white" for all controls
  . this.setBackColor(Color.WHITE); // turn color back to the default "white" for the current window
  . waba.sys.Vm.oldStyle = true;
  . // note that the disabled ui appearance will still continue to happen.
. added wgl0.5. renamed directory examples\textarea to examples\wgl. thanks to James Guistwite. added old waba.ui.Tab and TabBar to jgui.ui (james, you forgot this ones!)
. added graphics.fillHatchedRect.
. fixes by Mr. Tines
  . corrected the leap error in desktop/waba.io.Catalog
  . new extra.io.Mail class
  . Disambiguate DataStream class - now wextras uses the waba.io.DataStream.
. removed Label.parseText. using now the Convert.tokenizeString.
. corrected bug in the Catalog.close method that was generating 2 warnings in the emulator. the warning depends on which rom you was using:
  . SuperWaba (2.0beta2) just read from memory location 0x0000002F, causing an address error.
  . SuperWaba (2.0beta2) has just read directly from an unallocated chunk of memory
. corrected bug in _RecClose that was crashing the vm.
. corrected bug when a Graphics object was freed and another graphics object was called. the message the emulator was givving is:
  . SuperWaba (2.0beta2) has just written directly to low memory
. Note 2 emulator warnings remain and will not be removed. those are caused of the gray scale and are not bugs. in Debug Options of emulator:
  . Screen Access
  . Hardware Register Access.
. putted back the beep in TabPanel tab select. but now is a beep and not a tone.
. now if theres no memory to handle the ammount of class and object memory desired, it decrease the desired size and try again.
. moved object memory allocation to nmpalm_b.c (was palm os specific code).
. in palm os 2.0, the memo of Vm.debug grows up to 400 bytes and resets. this is bc palm os 2.0 halts if memo grows too much. the limit for palm os >= 3 is 32000.

Bugs
. create 2 edits. call the popupkeyboard in one. close popup keyboard. move focus to the other. call popupkeyboard. the last edit will paint over the poped up keyboard.
. if using wextras memo, the Vm.debug doesnt work.
. when running my VPFinance (www.versapalm.com) under Palm OS 2.0 it crashes PalmEmulator. after spent 8 hours, i could not find the error. it gives a "... has just written directly to memory manager data structures". if i press continue, it gives "during a regular checkup, Poser determined that the dynamic heap chunk with header address 0x0000D5CA got corrupted. The master pointer referenced by the "hOffset" field in the chunk header didnt point back to the chunk". i could not find that chunk under any reference in the vm. any idea to help me? this does not occurs in palm os 3.0.





*VERY* IMPORTANT: please read at least the ones marked with !: they are incompatibilities between this and the last versions.

Changes in SuperWaba version 2.0 beta 3

! Note: you MUST run exegen again in your app.
. Fixed fatal error when running VPFinance in PalmOS 2.0. Just set the "far String Constants" in 68k Processor panel of CodeWarrior 6.
. Converted project to 3.5 support. Note: its still compatible with 2.0.
. Added Mathias Ringwald enhancements for Serial: support for IrCOMM, SIR and USB. you use the serial port class as before. Here are the requirements:
  . To use ircomm on palm 3.1 devices, you'll need the SerIrCOMM Lib from the ir enhancement pack from palm. the vm uses the new serial manager if it is present. adds to SerialPort.java:
    . i just added new constants to the serial port class these are used in the creator
    . public static final int DEFAULT    = 0; /** Default Port (cradle) */
    . public static final int IRCOMM     = 0x1000; /** IrCOMM Port (Serial Connection on top of IrDA Stack) */
    . public static final int SIR        = 0x1001; /** SIR Port (Physical Layer of IrDA Stack)  */
    . public static final int USB  	 = 0x1002; /** USB Endpoint 2 Port (Visor Handspring Devices only) */
. Removed nmpalm_d.* and placed all in nmpalm_c.*. added nmpalm_c.c to a new segment.
. Modified the VmGetSettings and removed the private constructor in Settings.java. removed Settings.getString() from the device dir.
. extra.io.builtin.Mail class updated: Constants made public and documented, some sanity checking. Thanks to Mr. Tines.
. Fixed edit when the height is above PREFERRED. thanks to ymbezeq to point this out. Note: if height is below PREFERRED, the letters will be truncated.
. Fixed edit in oldStyle mode. simplified edit using eraseRect.
. Note: to ensure compatibility and portability, use the PREFERRED as the height for the controls. It is calculated based in the height of the current font.
. corrected make.bat files ("not defined" in environment variables dont work in old M$Dos). thanks to Didier Clerc. ps: in cmd.exe of Windows2000 it works.
. updated IntVector to support stack and the compatible java Vector methods. added IntVector.qsort that does a QuickSort in the elements.
. changed desktop's fillPolygon algorithm. taked from gd 2.0.1 beta (http://www.boutell.com/gd/manual2.0.html) from Thomas Boutell (oh god, why i didnt found this in the beginning of this year!)
. fixed desktop's graphics.fillHatchedRect and also the Button in oldStyle mode (that was using that method to paint itself when filled)
. changed Graphics.draw3dRect.
. changed the pixels order of desktop/waba.fx.[Graphics/Image]. now they are [y][x] instead of [x][y]. created a drawScanLine at drawBitmap to speedup the paint
. fixed double and long support bugs pointed out by Michael Brereton.
. fixed MessageBox width when the title was greater than the text. thanks to Yehuda.
. rearranged the graphics files, separated the palm stuff from the rest.
. device/waba.sys.Vm.getMaxColors now is native, and returns the real max colors of the device. Palm OS < 3.5 always return 4.
. new method waba.fx.Sound.setEnabled to turn on/off the device's sound and isEnabled to get the current status. The default volume is setted back at the vm exit. At the desktop, it only disables the beep, since tones are not supported.
. added destroyHashTables and xfree(mainGrHandle) to correct some memory leaks.
. fixes some bugs that Bjoern Knafla pointed out in the Vector class (and also in IntVector class) :
  . creating a Vector too small wont grow it
  . declaring Vector as final wont make it possible to implement the Stack of java (although, the Vector class already acts like a Stack!)
  . inserting a element greater than the current Vector size isnt checked.
. notes regarding the color support:
  . if palm OS is below version 3.5, i use my assembly routines. if is >= 3.5, i use the internal (PalmOS Winxxx routines) ones. obviously, they are slower than mines.
  . automatic dithering is used when you load an 256 color bitmap in a (up to 16 shades of ) gray scale device. the dithering in color devices is unfeasible, bc it takes about 5 minutes to do the dithering (in a PalmIIIc)
  . there is a way of use my faster assembly routines in palm os >= 3.5. to do that, you just need to use double buffering or create a bitmap and draw in it. bitmaps use the assembler routines, and so they are faster. then the bitmap is displayed using the standard PalmOS routines. very fast.
  . for simplification, if palm os >= 3.5, each bitmap pixel is stored in one byte, even if in devices with 4 bpp (like PalmV). Since those devices have more memory, this is not a pain.
  . in color devices, when you draw a bitmap it palette is applied before drawing and is not removed after this. if you used the default system palette (also known as WebSafePalette, and listed in org/wabavm/palm/WebSafePalette.txt), then theres no problem. but if you dont use that palette and the display only supports 256 colors simultaneously, then youre in trouble *if* the first color of the palette (index 0) is not WHITE. This does not occurs in displays that supports 16k colors.
. corrected bug in desktop/Graphics.drawText if text was null. thanks to Humphrey Bien
. Control constructor: fixed an incompatibility between SW and Waba that Scott Cytacky pointed out regarding font initialization.
. Putted some debug messages in the bitmap loading.
. Vm change: xfree now is a macro that calls xfree_ and set the pointer to null after releasing the memory.
. corrected some bugs when a palm popup was called (like the contrast dialog). after calling the popup, a redraw() event is throwed.
! new method interceptSystemKeys, in where you can select which system keys you want to intercept. use the Vm.SK_xxx constants. the setSystemKeysUse is deprecated and will be removed in beta 4. now in the desktop, it uses this settings in the emulation with Fn keys.
. added corrections by Daniel Tauschke of ComboBox with zero-sized elements.
. added desktop/MainWindow.getCommandLine. it is now setted by the Vm.exec method.
. new class waba.fx.Palette. used to get the system or the bitmap palette and manipulate it.
! changes in class Color
  . GS_PAL from Color moved to class Palette as GrayPalette.
  . removed constants GS_
  . changed the values of Color.BRIGHT from 224 to 191.
  . getGray now returns index values from 0 to 15 depending on the device capabilities.
  . now rgb value is pre-computed to speed up process.
. getPixel returns the index of the palette (as it already works). to get the color, use myAppliedPalette.getColor(g.getPixel()).
. changes in Image class:
  . new method saveTo(Catalog): saves the image to a catalog
  . new method createBmp(DataStream): saves the image to a stream (like a serial or socket stream).
  . note: currently, the bitmap is device-dependent bitmap. this happens bc when a bitmap is load into the device, it is converted to the device's format (and dithered if necessary). so, when saving, it will be saved in this format. the bitmap is always saved using an 256 color palette: if the device is color, it will be used the (palette that came with bitmap) or (websafe palette); if the device is grayscale, the websafe palette is always used and the bitmap is stored as grayscale with dithering.
  . new method setPalette, getPalette and applyPalette.
  ! getPixels was removed (it was deprecated).
. new methods in DataStream: readIntLE, writeIntLE, readShortLE, writeShortLE where LE stands for little endian (intel format). used in the image saveTo method.
. new method Vm.attachLibrary(name) to attach at runtime a library. name must be the name of the catalog, case sensitive, without type and creatorID.
. Vm.getScreenSize now is native.
. new method String.compareTo to do a lexicographical comparision.
. note: the maximum available screen depth will be 8bpp. in my tests, for some reason, the palette is not being correctly applied in VisorPrism at emulator. in beta 4 i will fix this.
. changes in the vm memory manager:
  . now all the heaps are stored in only one catalog.
  . the xmalloc function now is smart: if the chunk is greater than 1024 (1k), then alloc in the storage heap. otherwise, alloc in the normal heap
  . the xfree function is smart too: if the chunk is from the storage heap, release and shrink it to 8 bytes.
  . new method xmallocAtLeast(desired, minimum), used by the object and class heaps (eg: although the usual size of the heap is 64000 bytes, in palm os 2.0 we cant allocate that much, so, allocate the much as possible to let the program run)
! new memory parameters
  . parameters /L, /S and /T dont exist anymore. old programs passing them is harmless and the Large memory model is assumed
  . the parameter /m now can receive 4 values:
    . S (small): 16000 for class/object/hos, and 1500 for each stack
    . M (medium): 32000 for class/object/hos, and 2000 for each stack
    . L (large): 64000 for class/object/hos, and 4000 for each stack
    . H (huge): chunks allocated dinamically, limited by the ammount available in the device, starting from 64000 for class/object/hos and 8000 for each stack (NOT IMPLEMENTED YET)
  . note that each class/object/hos allocates the desired size, so, in the small memory model, the total allocated is 16000 * 3 + 1500 * 2 = 51000 bytes
  . ps: i really dont know if any sw program can run using the Small memory model.
! changes in exegen
  . now the /L, /S and /T give fatal errors
  . /M must have one of the following: small/medium/large/huge ; you can specify only the first letter and lowercase/uppercase dont matter. a number (like using the old format) will give fatal error.
. corrected negative value convertions in double2string.
. corrected Hashtable.getKeys method thanks to Erik Bågfors
. now Graphics.drawImage can receive CENTER as x and/or y, to let it center the image on screen.
. new example added, Clock: "this is a small demo drawing a clock on screen. it also reads from a memo locations and time offset and shows that time in those places if requested.". thanks to Yehuda Miron.
. changed timeout of socket connection to 5000 instead of 1500; mathias ringwald asked for that change to correct some problems in some springboard cards.
. new classes for String and StringBuffer. Here are the release notes of David Gecawich
  . Here are the optimized versions of String and StringBuffer, which we have been running in a production application for over 2 months. Our application is currently in use by fortune 500 companies in the United States.
  . They allow an app to scale much better.  The intern() method was added to String as it allows for SIGNIFICANTLY faster and more efficient XML parsing. There are way too many changes between the 1.21 String/StringBuffer and my String/StringBuffer.
  . I have spent days optimizing these classes to a point where they allow a data access application (database and XML) to grow without bombing out on memory problems. A trivial change or omission can make a huge difference.
. new parameter to the desktop Applet class (if running as application with java.exe) /bpp and new parameter 'bpp' (if running as applet). this lets you emulate all the possible bpp of the real device. you can use the parameters 2,4,8,16,24. no other is permitted. 2 and 4 means gray scale devices; 8 and up means color devices. this . parameter must not be used with the /color parameter (color is automatic calculated). When using color images in grayscale (2 or 4 bpp), the image is dithered.
. new method Catalog.getRecordPos to return the current record.
. changed Hashtable.getKeys so that the vector will be created with the current hashtable size.
. new class IntHashtable whose key and value are int.
. updated desktop classes to match device classes. the palette class will be enhanced in beta 4.
. changed steps of Color.brighter and darker. now instead of 25%, it uses constant increments depending on the current bpp.
. the default bpp at the desktop is 2bpp (gray scale). note also that there's no difference between 8,16 or 24 bpp.
. at the desktop classes, if you save a bitmap to a catalog, theres no way to load it through the Image constructor (attachLibrary dont work at the desktop classes). this may change in the future.
. now if gray mode was active when starting sw, it is left that way when exiting sw.
. corrected debug size of memo for PalmProfessional from 400 to 4000.
. now the hos memory can be smaller than the heap memory.

Important note: the palette was not heavily tested, so please be aware that there can be lots of bugs when dealing with it, specially if you have plenty bitmaps with different palettes being shown at the same time and saving those bitmaps. I'm open for suggestions for enhancing the palette support.
Note: the file GraphicPort.c may be implemented by who want to port the graphics routines to other platforms.

Known bugs:
. due to a change in the way sw use memSemaphore, running superwaba applications in POSE with roms 2.0 and 3.1 (IIIx and IIIe), the screen isnt redrawed. This bug was not removed to help Keith Rollin fix it. In roms >= 3.5 all works fine. in the device too, all works fine.
. not all draw modes were tested at the color device. so, maybe someone can not work. please tell me any difference that occured.

Beta4 Todo list:

. re-implement Image.setPixels.
. improve bat files so it automatically finds the %jarfile% env var.
. translated grayscale drawBitmap to assembler, but i had no time to debug it.
. speedup erasePixel and invertPixel operations and collisionDetect
. check problem in catalog/memo that yehuda pointed out in the ng.
. fix paint problem when pressing the cancel button in f12 in the desktop welcome app in the $$$ field.
. verify if the new fillPolygon is faster than the current one at device.
. add the Random class as soon as noel and sean fix the bugs...
. implement growable stacks
. add introspection
. fix a bug in the desktop when you open a messagebox and minimize the window pointed out by imran zahid.

PS: After beta5, 2.0 final will be released.





Changes in SuperWaba version 2.0 beta 4

       Smarter, smaller and faster!

    1. Smarter: no more desktop/device classes, no more classpath changes! Just
    run your program, and SW will be smart enough to select the appropriate
    classes! And all native methods working smoothly in both platforms.

    2. Smaller: Comparing to SW 2.0beta3, the VM (prc) have now 87.7kb against
    90.6kb, and the class files (pdb) have 175kb against 143kb. Hey, wait a
    second, the pdb is larger! Yes, but it now has more classes (Menu classes,
    International Char convertions, Compression, Random, RadioGroup). So, give a
    discount!

    3. Faster: After spend two weeks on optimizations (i really love that!), the VM is
    45.7% faster comparing with Waba 1.0! In the table below, you can see the results
    running the Bench program in my PalmProfessional (PalmOS 2.0, 1mb ram):

    Benchmark with examples/Bench.java (values in millis):

    . Benchs on         : Graphics+Native Methods,   Loop,  Field,  Method,    Array,   GC+String   (Total  ms)
    . Waba 1.0          : 143010,                   33340,   8860,   25940,   126460,   53250       (390860 ms)
    . SuperWaba 2.0beta3: 117220,                   36030,   9640,   27570,   130740,   69980       (391180 ms)
    . SuperWaba 2.0beta4:  80290,                   24470,   5310,   15600,    94540,   33030       (253240 ms)

Read the ! with care.

Note: now the changes can be identified in the code. Search for the number preceding the fixed item. eg: guich@200b4_1 for fix #1 (unfortunately, i only decided this at the end of this beta4 developement :-) )
. Note! The very long startup delay when running in PalmOS 2.0 is due to the memory manager of PalmOS 2.0. For a "quick" startup you need more than 550kb free. This will be solved maybe in beta5, with the new SuperWaba memory manager, which will make SW require less memory to run.
! changed DRAW_PAINT_COLOR to DRAW_REPLACE_COLOR and DRAW_SPRITE_COLOR to DRAW_SPRITE. makes much more sense.
. converted gray scale's drawBitmap routine to assembler. my benchmark timmings went from 1270ms to 250ms
. added constructor MainWindow(String title, byte style) to match the Window's constructor.
. corrected the fatal error message that was appearing "being being". Thanks to Keith Rollin.
. fixed the generation of javadoc classes for package waba.lang.
. now the setRect constants can be added or subtracted by a constant. EG: PREFERRED+2 (show the control with it desired size plus 2), CENTER-10 (show the control centered minus 10 pixels to left), RIGHT-1 (show the control right justified to the container moved one pixel left), etc.
. you can also use CENTER like above in the method Graphics.drawImage.
. Changed in waba.ui.PushButtonGroup
  . now if you press inside a gap between buttons no event is throwed.
  . if a button name is null, that button isnt showed and dont throw events. If the buttons are all same width, then this skipped button will have the same width of the other buttons; if not, then the button(s) skipped will have a computed average size.
  . corrected a wrong calculation when there was more than one row with gaps between them.
  . simplified some methods.
  . now the button captions are vertically centered
. corrected JustifiedContainer when the Y justify was CENTER.
. Note: depending on the font, the control's PREFERRED height can stay too small. this occurs because of wrong information passed in the font's info.
. corrected ListBox item selection with the mouse. Also corrected selected item cursor height.
. new method extra.io.builtin.Memo static findMemo(String title, boolean ignoreCase). improved documentation regarding null Memos.
. new String methods: startsWith and endsWith.
. corrected compilation of Mail class. Mr.Tines sent it to me with lots of typos bugs!
. new class: waba.ui.RadioGroup: It handles the click on a radio, unchecking the last selected one. It is very simple. See the javadocs to learn how to use it.
. fixed a bug in the desktop when you open a messagebox and minimize the window. pointed out by imran zahid.
. added static waba.ui.Event.getNextAvailableEventId(). with this, you (and all apps running) may register your events and get their id without a conflict possibility.
. made waba.ui.Calculator class public. now its javadocs are also available.
. corrected Edit.popupKCC, bringing the focus back to the edit before popup.
. corrected bug when poping up the Keyboard and some controls painted over it.
. fixed bug when the keyboard was poped up and using popupKCC and the first F11 key was ignored.
! to fix the above error, i had to change Control.postEvent in the way that it now tests if the parent of the control has changed. In this case, the event is no longer broadcasted. This can cause problems (maybe) in old programs, please let me know if this happens.
. new class waba.util.Compression: applies huffman algorithm for compression in a text. thanks to Valentim Batista
. now at ListBox, the selected index starts with -1. pointed by Bjoern Knafla.
. added waba.util.Random class by Sean Luke.
. added the Cards Shuffling classes by Imran Zahid to the examples directory. maybe in the future it will be moved to the ext\games\cards package.
. added extra.ui.ProgressBar class to ext\otherUI directory. if everybody complain that its needed, than i can move to the waba.ui package. thanks again to Imran Zihad
. removed the reference of rt.jar from the compilation with javac in the make.bat files. thanks to Jean Rissoto
. new class waba.ui.MenuBar and waba.ui.PopupMenu. Created from scratch. The menu handles checked and disabled items. PopupMenu automatically saves the covered part of the screen and restores it after is closed.
. Now if the window has a title and you click the title area, the menu (if assigned) is displayed.
. new methods Window.saveBehind and Window.loadBehind. it saves and loads the area behind of the current window. Use it carefully, bc some devices may not have too much memory to keep storing the windows.
. changed Keyboard.names (the string matrix that defines the keys) to public static. Maybe will be useful to customize it to other languages.
. added examples\barcode, an example of how to use the barcode scanner. thanks to Andrew Chitty.
! now the _focus in Window._postEvent is always tested. if its null, move it to the current window. maybe this can have some effects that i did not realized. if so, please let me know.
. fixed an error when a window was poped up and the other windows, for some reason, was repainted (as a minimize in the desktop), and the controls looked faded.
. fixed an error that sometimes a superwaba application (created in a Frame) stopped generating key events to the canvas.
. added a test for strings being readed by the desktop\waba.io.DataStream class. If a "possible" invalid string is readed, a warning is issued and the program fails.
. fixed drawBitmap when trying to draw it at negative positions (like doing a pan in a big bitmap). Thanks to Chris Dawson.
. moved "timeStamp = Vm.getTimeStamp()" ControlEvent and ScanEvent to the Event class default constructor.
. fixed a bug in the UserFont and Graphics.drawText when the char was invalid. Fixed also at the device. Thanks to Jean-Eric Cuendet.
. New method TabPanel.setBorderStyle: Sets the type of border. see the waba.ui.Window xxx_BORDER constants. PS: currently, only the NO_BORDER and RECT_BORDER are supported. NO_BORDER only draws the line under the tabs. Thanks to Jean-Eric Cuendet.
. changed TabPanel drawing: removed the underlying line of the active tab.
! new method ListBox.drawItem, to let you extend ListBox and overload the method to draw the items. new constructors PopList(int x, int y, ListBox lb) and ComboBox(String []items, ListBox userListBox) make possible you create user defined combos. Changed also all references of String to Object in ComboBox,ListBox and PopList. thanks to Jean-Eric Cuendet (note: bc of this last modification, you must recompile your classes if you use ListBox or ComboBox)
. To create an app AT THE DESKTOP just to read or write a pdb file, without a Graphical User Interface, please set the waba.applet.JavaBridge.nonGUIApp flag to true using the method setNonGUIApp. This way, the openInputStream and openOutputStream will use the FileInputStream/FileOutputStream only. Thanks to Jean Rissoto and Nick Forde
   Here is an example of how to do it:
     waba.applet.JavaBridge.nonGUIApp = true;
     Catalog cat = new Catalog("J:\\org\\wabavm\\palm\\desktop\\MemoDB.memo.DATA",Catalog.READ_WRITE);
     if (cat.isOpen())
        ...
   When writting back the db, the path is stripped.
. corrected the problem in reading some pdb files on the desktop, specially the ones created in the device. The problem relied in the fact that my routines was not prepared to find an AppInfoBlock between the header and the data. The AppInfoBlock now is readed and is available for use. Thanks to Jean Rissoto.
. now all attributes readed from the pdb are stored back in case it is writted. they are also available to the programmer. improved documentation about the header fields. See desktop\waba.io.Catalog.
. VERY IMPORTANT! If you open a Catalog, be sure to write the data using the same Catalog object, or you'll loose important information readed and the database may be unusable. also, the info regarding categories are writted in the appInfoBlock. if you dont want to understand how it is generated, please dont change the order of the records (by deleting/inserting in the middle) of the Memo database (and other internal databases that deals categories), because if you do that, the categories will point to the wrong record.
. Now the database name is limited back to 31 characters. There is a wrong information at some documentations that says that the maximum is 32 bytes, but POSE don't agree with that.
. new constructor Socket(host,port,timeout) so you can set the timeout for opening the connection.
. created a method to return the total available memory of the device. EG: this is the memory available for your database.
. now SW reserve 50kb of memory to dont let the user consume all the free memory and that way make sure that SW will have enough memory to start again.
. fixed DRAW_REPLACE_COLOR in palm OS >= 3.5. i had to implement a (relatively slow) routine to make it work, since palm dont have the kind of operation i defined
. new draw operation: DRAW_SWAP_COLORS: swap foreground and background colors.
. added eraseVLineNOCT and invVLineNOCT to GraphicPalm.c.
. note: this could not be done bc pose insist in give a address error where there is no address error. Keith already complained that it is an error of Pose but that it is fixed in next version. So, please wait for Pose 3.3. //bypassed emulator bug that was not updating correctly the display. thanks to Keith Rollin.
. changed getBitmapPixel to getBitmapRow. improved performance in collision detect.
. new method Edit.setMaxLength to set the maximum length of String that can be inputted.
. Fixed the popup Keyboard backspace key not working in SPT1700 device.
. new ControlEvent.WINDOW_MOVED: The event type for a recently moved window. This indicate that all the Graphic objects must be translated or reinitialized. This event is broadcasted to all controls inside the Window being moved.
. new method Container.broadcastEvent. used in the above situation.
. new method Graphics.drawCursorOutline. the correct name for drawCursor should be fillCursor, and then i could add drawCursor. but drawCursor fills the cursor, so i needed to use drawCursorOutline instead to keep backward compatibility.
. reduced flickering when poping up windows. now, instead of repainting the full window, it repaint only the focused control, if it needsPaint.
. new constructor IntHashtable(DataStream ds) and new method IntHashtable.saveTo(DataStream ds). Now the IntHashtable can easily be saved and stored from a Stream.
. New method in Event: touch, to set the current time on the timeStamp member. changed some places that reuse the event to touch that event so the time is correctly updated.
. fixed repaintNow: if the control is a Window, it calls doPaint instead of onPaint, repainting all controls inside it. Else, if it is a Container, it calls paintChildren.
. fixed Math.rol and Math.ror. By mistake, i sent desktop\Math.java with native methods. Now all are not-native.
. new methods in String class: getBytes, replace and equalsIgnoreCase. new constructors: String(byte []value) e String(byte []value, int offset, int count). The new constructor and the getBytes uses the current CharacterConverter assigned class.
. new method Hashtable.get(Object). Removed all methods that has String as parameter and replaced them with method that has Object as paremeter.
. MERGE OF DESKTOP/DEVICE CLASSES
  . moved waba.lang.* sources to java.lang. There is the right place to put them. Also, created a txt explaining what are they.
  . fixed onExit was not being called
. new class waba.sys.CharacterConverter. The bytes are converted to char and vice-versa using the CharacterConverter associated in the charConverter member of the String class.
. changed MethodsHash so it recognizes the class name is the first parameter, no need to specify the package.
. modified the Warp /x command: now it test if the class names given are part (starts with) of the class name (after removing the package) . eg: /x NativeMethods4JDK may exclude waba/fx/NativeMethods4JDK$GraphicsBag.class, waba/fx/NativeMethods4JDK.class, waba/io/NativeMethods4JDK$CatalogBag.class, waba/io/NativeMethods4JDK.class, waba/sys/NativeMethods4JDK$ClipboardObserver.class, waba/sys/NativeMethods4JDK.class, waba/ui/NativeMethods4JDK.class
. Convert.toString(Boolean) isnt native anymore.
! All package fields converted to private. Also, some protected fields also converted to private. So, if you extend any class of SW and something goes wrong, dont hesitate to ask me to put them back to protected!
1. fixed an error in MainWindow that it was not checking the appropriate needsPaint flag. This fix also corrected the bug of not displaying a DialogBox in the onStart method.
2. fixed clicking in the last element near the border of the ComboBox dont select it
3. added two methods sent from Zahid Inram: Random.rand(char s, char e) and rand(int s, int e).
. removed constants LEFT,RIGHT,CENTER of class Label. This will be transparent to you, since the Control class already definess those constants. You'll just have to recompile your program. Thanks to Jean Rissoto
. changed the warp and exegen and added Wxgn that calls both in just one class call. Thanks to Jean Rissoto
4. changed appPath tests to: if appPath == null then appPath = "./"  . Added a output to make sure nobody gets surprised with this, since this can change some behaviours
. somehow, this bug (of beta3) is fixed: create 2 edits. call the popupkeyboard in one. close popup keyboard. move focus to the other. call popupkeyboard. the last edit will paint over the poped up keyboard.
. corrected some javadocs.
5. new emulation key: LAUNCH (isnt HOME, but LAUNCH). new constant Vm.SK_LAUNCH. Now you can intercept the launch (home) key, BUT you must create another way to exit the application.  Note: SK_ALL does not intercept the SK_LAUNCH key (to maintain compatibility with older applications. You must use SK_ALL | SK_LAUNCH to intercept the launch key.
6. Graphics.drawRoundRect and fillRoundRect: If r is greater than width/2 or greater than height/2, it will be adjusted to the minimum of both values. thanks to Humphrey Bien
7. New method Vm.getSystemKeysPressed. This method returns simultaneous key presses (ideal for games). new Constants Vm.SK_PAGE_UP, Vm.SK_PAGE_DOWN. All other VM_SK constants has changed their values. Note that only some few keys can be returned in this method, and also that the key is still queued. This method is correctly being emulated in Desktop.
8. fixed rounding in toString(double). Thanks to Peter D.
9. fixed wrong count of varsNeeded in the hooks. This may be responsible for lots of annoying bugs.
10. Fixed the "light gray box" that bounds objects at device only. The bug was at the clearScreen method; it was not clearing the screen correctly.
11. fixed error when exit sw in palm os 2.0 and come back without restarting the vm.
12. new method Graphics.translateTo(x,y) to set the translation from origin.
13. fixed doubleBuffering in desktop. Thanks to Jean Rissoto for the example.
14. Eric Frik: I found if I made the small change to nmpalm_c.c the getScanManagerVersion and getScanPortDriverVersion to check for STATUS_OK instead of <= 0 the data was returned properly, otherwise it always returned empty strings...
15. fixed a bug when a bitmap was drawed in the onPaint and only a part of the bitmap was marked for repaint.
16. fixed bug when removing a control from the container. Now it changes the focus (if necessary) and repaint's the hole parent area. Thanks to John Mann for the tip.
17. automatic disable the keyboard of Visor when opening and closing the serial port. thanks to dodah12 (aka bob).
18. fixed double painting when the keyboard is poped up
. Changed org/wabavm to org/superwaba.
19. fixed concurrent use of Memo and Vm.debug.
20. improved colors and fixed doublebuffer in PalmOS >= 3.5. The bugs were related, and after 1 full day of debugging i discovered that the bug was in PalmOS. PalmOS does not handle correctly bitmap convertion of a offscreen with 8bpp in a device with 4bpp. To bypass this, i had to create the asm functions to draw in 4bpp (2 days away from my deadline!).
21. fixed invVLineNOCT_Color.
22. fixed bug when using a offscreen image in color devices regarding the palette.
23. optimized Edit.draw when cursorOnly
24. changed all fonts from Helvetica to SW to improve startup speed.
25. fixed bug when a VM error was displayed and the VM crash
. added examples\GuiBuilder, a handly UI designer to be used in your device. Thanks to Yehuda Miron
26. new method Convert.toStringArray(Object []) by calling toString in each object.
27. fixed array cast exception in desktop/Catalog.listCatalogs
28. fixed MessageBox when the size of the Window got bigger than the screen.
29. fixed in MessageBox the fontMetrics it uses to get the width of the Title (which is not the same of the text, since the title is in Bold)
. new Welcome application, with great functionality!
30. new class waba.applet.Handy with handy method to use in the desktop side only. New handy method to parse the text that you want to display using the MessageBox class: see waba.applet.Handy.boundText. Here is an example of use: waba.applet.Handy.boundText(154,'|',getFontMetrics(getFont()),"This is a very long text and i dont want to waste my time parsing it to be fit in the MessageBox!");
31. new constructor for Vector class: Vector(Object []startingWith). The vector still can grow in size when initializing with this.
. fixed javadocs for class Window. Thanks to Tobin.
32. new member boolean Vm.onDevice: true if we're running on device. Faster than testing (Vm.getPlatform().equals("Java")).
33. fixed bug in MessageBox: now if a button is pressed and the cursor is moved out of the button, it doesnt closes the MB.
34. new constructor Catalog(Name, boolean createIfNeeded). Just a handy constructor.
35. fixed Palette.getColor(index).
36. new Image.doAntialias (very slow).
37. fixed clipping of images when creating a Graphics object.
38. fixed Graphics.getClip.
. removed Window.drawOffscreen
. removed PopList constructors that takes x,y as parameters. they are useless.
. Scanner classes now moved to org.superwaba.palm.ext.scanner.* . Scanner native library tested and working. It is also fully documented to serve as an example to build native libraries.
39. now if were a color device, change the MainWindow background a little...
40. on Window.unpop, now if double buffer is true we free up resources.
41. new protected method Window.popupMenuBar().
42. now you can use the arrow keys to scroll the text int the MessageBox.
43. new methods String.toUpperCase and toLowerCase (they call waba.sys.Convert methods)
44. now MessageBox uses the Graphics.drawArrow routine.

   Release 2 Changes

45. fixed insert save of images in alphabetic order.
46. Fixed Welcome app when listing fonts with a . in the name.

   Release 3 changes

47. fixed exiting the app dont switch to the desired program in PalmOS >= 3.0.
48. fixed "handle over-locked" error when running SW more than 13 times.
49. new J:\org\superwaba\palm\JDK1.3 README.txt. thanks to Daniel Tauschke
. now make.bat tests if its my home to avoid copying prc files.
. changed in rundemo.bat: now tests if were using jdk1.3 and use oldjava.exe instead of java.exe
50. changed equalsIgnoreCase(Object) to equalsIgnoreCase(String) to ensure compatibility with JDK
. fixed some bugs in make.bat. Thanks to Philip Steiner, Jean Rissoto and Daniel Tauschke
51. new method Control.repaintNow(boolean eraseBack).
. add Peter Dickerson improvements in MenuBar / PopupMenu
52. Now the window is dragged/menu is poped up only if you drag/click on the title area.
53. fixed TabPanel/remove containers that was not being repainted. Please report any flickering that the code changes may cause.
54. bypassed bug in drawBitmap_gray that it was reading one more byte than allowed. This bug was not fixed, but bypassed by allocating 1 more byte for the image. Note: this bug was bypassed and not fixed to not slowdown the bitblt routine.
55. fixed bug when drawing a bmp at a negative x/y value that would make nothing appear.
. changed Applet to ignore case of arguments.
56. added possibility to scale the applet up to 4x. Use the "/scale n" parameter. Note: now the default is 2x
57. Created a jar file to make SW run in the Browser. NOTE: due to function inlining when optimization is turned on, SW must be compiled with OPTIMIZATIONS TURNED OFF prior you make the jar file; otherwise, the Browser will give strange "xxx is not accessible" exceptions...
. Turned optimization off on make.bat
58. Fixed an ArrayIndexOutOfBoundsException that occured when passing the /bpp parameter
59. avoid flickering when start applet.
60. if applet, load it as a resource first. In the browser using the archive was fetching the whole archive at each request.
61. fixed memory leak; now releasing mainGrHandle in any OS.
. renamed examples\clock to examples\watch
. improved rundemo.bat. added rundemo.bat files to all examples to run it as application.
62. reintroduced the Window.flicker boolean: If true, the background is erased on each paint. If false, you must take care of erasing the background
63. Placed a try/catch in waba.fx.NativeMethods4JDK.drawBitmap.
64. new methods Rect.intersectWith and Rect.unionWith.
65. remade the drawBitmap routine.
66. Optimized drawBitmap routine. Now if you create a bitmap where (noClipOrTranslate && bmp.x/y == 0 && bmp.w == screen.w && bmp.h <= screen.h) then it will be drawed instantaneously.
67. changed make.bat files to compile *.java instead of %appName%.java
68. fixed: In device only, when moving Welcome/ThanksTo to the left of the screen and doing a scroll in the text, the text is shifted up 2 pixels. Problem was caused by a bug in the MAKE32 macro.
69. improved performance of Menu. Now it only saves the hole screen instead of each PopupWindow.
. Created flag Window.saveBehindWhenPopup
. now the classes\make.bat can have as 2nd parameter "only". thus, make compile only will just compile the SW classes without warp'ing them.

   Release 4 changes

70. improved MenuBar performance, by removing unnecessary restore of saved screens.
71. fixed error when loading 4bpp images at desktop and at device. Thanks to Strehler marco
72. fixed error when trying to display a piece of a bitmap larger than the screen
73. fixed error when a penDown event caused an fatal error and it was wrongly being catched to break the vm running loop.
74. bypassed exit error in PalmOS <= 2.0: now it switches to the preferences app. In PalmOS >= 3.0, it switches to the launcher. Thanks to Ben Combee for some important tips.
. new RunningAsApp.txt file.
75. added Jean Rissoto's changes to correct appPath problem.
76. added Jean Rissoto's changes that fixes an error when changing the attributes of a Catalog and not write to it the changes are not saved.
77. fixed "Vm.exit in loop" bug
. removed applicationRunning flag.
78. now SW issues some "cannot allocate memory" errors when trying to alloc memory and fail in the graphics routines.
. improved fatal error messages.
79. Yehuda asked to change Date.getJulianDay to public.
80. added Yehuda improvements for the Keyboard class to support other languages (Hebbrew in his case)
81. corrected a memory that was never being freed (about 5k) and was making the vm crash after some runs.
. fixed documentation for warp regarding the /x parameter
. changed appPath to dataPath at the desktop side, as suggested by Jean Rissoto. note that appPath at commandline still works
82. now at desktop the catalog is stored at the same location it was readed.
83. fixed selection overflowing paint area on ListBox. Thanks to Peter Dickerson.
84. new class waba.sys.Thread to implement a simple thread model. See class javadocs for more details. new MainWindow methods: addThread and removeThread. Note: the original idea of how to implement Threads in Waba was from Isao Yamashita. Although i didnt used his code (which isnt available), i would like to thank him for the idea.
85. fixed a double call to onExit. now only the vm calls it.
. optimization note: the SW classes (for the .pdb) must be compiled with optimization on and enabling inlining methods; otherwise, the String manipulation has a performance degradation above 20%
. changed some classes to final for optimization purposes: java.lang.StringBuffer, waba.util.Data, waba.util.Hashtable, waba.util.IntHashtable, waba.util.IntVector. If you *really* need to extend one of those classes, tell me and i'll remove the final keyword
86. improved performance for drawBitmap (when x=0 and width=160)
. new file: examples/threads
. removed other fonts from jar file
87. fixed bug in TabPanel in that an event was being posted on the creation of the control
88. fixed repaint of menu bar bottom when switching menus

   Release 5 changes

89. changed MenuBar.gap member to public. If you want to put more items in a row, change the public member. See javadocs for more details.
90. fixed VM error messages not being correctly displayed and exiting without a click.
. optimized object creation by changing the java.lang.Object constructor call to 4 NOP's (about 1% improvement over String operations) :-)
91. optimized drawText. Now instead of convert the uint16* to byte* and draw it, i use the uint16* array directly. (have no benchmarks, but its much fast than before)
92. now native funcs are being binded before use.
. improvement note: a (x % n) = (x & (n-1)) if both x and n > 0
93. new method ListBox.setSimpleBorder(boolean).
94. now class heap is allocated on demmand (no more class size limit); it allocates 16kb chunks as needed. First step to HUGE memory model! (note that this make the startup faster in PalmProfessional)
. improved speed. new numbers are: 76620/24170/5040/14920/94330/29470 (original waba: 143010/33340/8860/25940/126460/53250)
. removed Scanner references in waba.io.NativeMethods*
95. removed NativeMethods4JDK CatalogBag.isModified. Now it compares the modificationNumber to know if it was writted
96. improved the message "The SuperWaba VM is not fully installed".
97. changes in ResizeStream (thanks to Oliver):
    . startRecord now returns a boolean to know if operation was successful
    . new method restartRecord, to overwrite the existing record.
98. fixed Vm.setTrace when the class name didnt had a / and that UtfString may not end in zero. This was causing a low memory error in Pose.
. lowered vm stack use to avoid stack overflow (internal device stack)
99. fixed bug when no app class was found, and the vm caused a low memory access.
. added warning messages in NativeMethods4JDK.GraphicsBag to warn in possible bad parameters that can make the VM do a fatal exception (there is no parameter range checking in most VM graphic function - better get them in the desktop side).
. improved VM speed: 76430/24180/4990/14860/94330/29420 (242210)
. added Daniel Tauchke changes to Applet class, where you can specify the x/y screen location to display the applet.

   Release 5+ changes

. fixed scanner support. Hartly thanks to Eric Frick.

   Release 6 changes

. now at desktop, if you set the attribute of a record to "deleted", you won't be able to do a setRecordPos in that record anymore (it no longer exists, right?)
. now at desktop, a getRecordAttribute returns it with the busy flag set, exactly as the device. thanks to Jean Rissoto for those 2 fixes.
. added Thomas Roehr changes in Scanner class to set the length in some barcodes.
100. new constants for relative positioning in x/y: BEFORE,AFTER and SAME. Note that you can use the delta values (eg: BEFORE-2, AFTER+1).
    . NOTE! To use the constants, the control must be already added to the parent container; otherwise, an error will be throwed.
. new handy method Container.add(control, x,y). Adds the control and sets its rect to be x,y,PREFERRED,PREFERRED.
101. fixed support in non-EZ devices (like Visor Edge, SPT 1740, etc).
102. fixed String.indexOf(String, startIndex). Thanks to A.Sommer.
103. fixed error message "records left locked in closed unprotected database" that Pose was giving. I changed the destroyHeapDb function.
104. fixed 1bpp bitmaps drawed with a strange dithering in some devices.
. in the Scanner lib, now it tests if the getxxxVersion is called before the scanner is made active. If yes, returns null. (the device freezes if you call that routine without ativate the scanner before).
105. fixed ArrayIndexOutOfBounds exception when pressing a push button near the bottom of its bounds.
106. fixed Keyboard layout, removed popup delay.
107. fixed javadocs for Window class. fixed bug when popup a Window in the onStart method and a black rectangle appeared after window is closed or when window was moved. Added method Window.dontSaveBehind(repaintOnClose) to fix this. Also, now the VM calls MainWindow.appStarting instead of MainWindow.onStart.
108. fixed (again) the bug when exiting in fatal error calls the same program in an endless loop.
. added back the UIGadgets example.
109. fixed Calculator when the user moved the Window and it was using the old rect for the Numeric Pad.
110. now Container.broadCastEvent posts an event to the current container too.
. fixed bug when exiting SW during a fatal error. Now it closes the scanner if necessary.
. added onClose function in native libraries.
111. fixed repaintNow when eraseBack is true and the control is not a Window (now is erasing the control's area).
. renamed .txt files at org/superwaba/palm to make they appear at first
. added examples/barcode/make.sh that Vik made.

   Release 7 changes

*** Note: All programs that use TabPanel must be recompiled! ***
112. added oldStyle to combobox, listbox and poplist.
113. now the Poplist.lb member is public. removed all methods that called it. This saves 1kb and makes the class easier to use.
114. fixed 3d rect on Buttons.
. new constant Graphics.R3D_SHADED. Changed MenuBar, PopupMenu and ListBox to use it.
. changed Color.fadeStep to public (please use it as read-only). new methods Color.brighter(step) and Color.darker(step)
. fixed design of listbox.
. new Color.toString.
115. fixed problem when the Scanner sends a low battery event and the VM freezes.
116. fixed problem in Catalog when trying to open an resource database. Now it prevents from opening such kind of db..
117. changed Vm.attachLibrary to let you specify an alternative creator ID for the library. This lets you create a local library A to be used in programs B and C. (note: this has not been tested. please report any bugs)
118. changed dates before 1983 giving a wrong result in Date class.
119. added a click when the user press the abc to popup the keyboard.
120. fixed bug of label's background not being correctly painted
. putted FILL in y parameter back. i forgot to add it.
. fixed degradee when starting in devices with 16 colors.
121. fixed drawVLine routines. the bug was drawing strange lines on TabPanels with buttons or radios. i was forgetting to test if y+h >= clipy1.
! removed waba.ui.JustifiedContainer and placed it in the \org\superwaba\palm\ext\moreUI directory.
122. fixed TRANSX/Y and CLIPX12Y12: it was treating -1 as 0xFFFF and such not clipping correctly
123. new examples/SWCalc. It was created for an article in portuguese, so the comments are in portuguese. :-)

   Release 8 changes

DONT FORGET TO TURN OFF "SCREEN ACCESS" IN EMULATOR!!!
*** Note: some changes in the constants behaviour may make your controls move around, due to the clientRect. ***
124. changed default values of Container.lastX/Y to -1. Now, if BEFORE/AFTER is used without a previous absolute coordinate added, they is set to the Window's client rect x/y positions. Also, TOP/LEFT/RIGHT/BOTTOM use the Window client rect too.
125. changed how the control's colors are initialized. Now, only Containers have assigned its foreColor and backColors in their constructors. These two colors are now initialy NULL in the other controls, and when the control is added to the container, the container veryfies if the colors are still NULL; if so, they are initialized to the container's colors. This test must be done bc some controls (like the Check box and Radio change their colors to white as default).
126. now all controls erase its background every time they are repainted. this is necessary bc a control's background color may be different from the container's.
127. fixed array index out of bounds in Palette class when getColor index was greater than the convertion table index.
. reformatted ScrollBar
. fixed TabPanel and label 3d paints.
. fixed Calculator behaviour.
128. now the SAME constant can be used in the width/height
129. added new constructor to class Edit. Now you can specify defaultWidth based in the mask given in the new constructor. Note that this mask is not used to mask the control's input. This will be left to another control in the future (in a separate library that i hope someone build).
130. fixed ListBox when using getPreferredWidth.
. changed all onEvent method in controls to use switch instead of a bunch of if's
. optimized ScrollBar. Now its working perfectly and has 2 styles: palmOS and WinCE.
. changed Graphics.draw3dRect. removed controlShadow1/3. Now the rect is drawed based in the control's fore and back colors.
131. Now the Window is erased only if a full repaint is needed; otherwise, the background erasing is left to the control do it. This may reintroduce some repainting problems, but it is necessary bc its far more efficient.
132. new flag in Event: consumed. Set to true to stop the event propagation to the parents.
133. changed ListBox constructor to startup faster.
134. changed ComboBox constructors to startup faster. You may need to change your code. See ComboBox source code for details
. changed ListBox to use ScrollBar.
135. deep reestructuration of the repaint method. Now, instead of mark a area for repaint, the repaint control is added to a vector at the parent Window; then, all controls in this vector are repainted. This may reintroduce bugs, but will avoid unnecessary repaints.
. new field parentWindow in class Container. This speeds up the repaint
. changed Vm.oldStyle to Vm.uiStyle, who can assume the values Vm.PalmOS and Vm.WinCE.
136. added parameter /uiStyle to applet.
. removed warning for appPath.
137. new method Settings.setPalmOSStyle(boolean withWhiteBackground). Must be called in MainWindow's constructor.
138. new method Control.setRect(x,y,width,height,Control relative) to let you set the coords relative to the ones of the given control, instead to just the last one. new method Container.add(Control control, int x, int y, Control relative)
. Shrinked welcome class. Some menu entries went to .txt files in the org/superwaba directory.
. fixed Compression javadocs.
. added Vik changed to Socket class at VM to correct a bug that was not restarting the Socket after a timeout
. changed in all java files * by <<  and / by >>  when possible.
139. changed back & 999 to % 1000 and & 9 to % 10. This was a bad thing i did and Peter Dickerson reminded me. This fixes a wrong time calculation issue and also a double2str wrong formatting one.
140. fixed bug when alarm was called and SW was running.
141. This one i'm sure everybody will like: added retroguard to the ext folder. This program is a freeware that obfuscates the code, by changing variables and method to 2 letters only. In the VM, it saves only about 5%, but in a finished program, it may save 30-40%. I used this since 1999, and i love this program. I decided to share this with SuperWaba users.
*** Note on retroguard use: you must make sure the main class name and onStart method are not obfuscated or your program can not run. Read its docs.
. now the make.bat file uses retroguard to shrink the VM
. To see an example of how to use retroguard to shrink your files, please see the make.bat file at examples/GuiBuilder. In this case, retroguard shrinked from 30kb to 24.6kb
. added Tomas Roher changes to fix some Scanner bugs related to barcode length.
. as Sean Luke suggested, i removed the CharacterConverter member of String class and placed it in the ConvertClass.
142. new Label.canScroll that returns if the label can scroll in the specified direction.
143. now the arrows in MessageBox grays out when the limits are reached.
144. fixed array index out of bounds in PushButtonGroup (not tested)
145. now when you call ListBox.select, the item is made visible if its not.
146. CANCELED: changed setFocus: now only enabled items can receive focus. Putted a message to alert user.
147. now if the target of a keypress event is not enabled, the focus is changed to the first enabled parent.
148. fixed Date.setDayOfWeek. changed the algorithm.
149. now the Vm.onDevice is false as default. In waba.sys.Settings constructor we set it.
150. at waba.sys.NativeMethods4JDK we test if the waba.applet.Applet is created. See the class for more details.
151. now the NativeMethods.nm will always construct a 4JDK. The VM will tweak the name to load the correct class.
. fixed IKeys documentation.
. added -g:none -O to all make.bat files.
-- start of High level optimizations
152. new method Control.onColorsChanged. Called after a setEnabled, setForeColor and setBackColor
153. new method Control.onFontChanged; called in Control.setFont.
154. new Control.currentFore/BackColor: state dependent colors
. now all waba.fx classes are final.
. new field Control.fmH = fm.getHeight().
. Combo now changes focus to listbox when its poped up.
155. fixed bug when Edit's cursor was drawn after the bounds.
156. fixed TabPanel.captionColor. Now it is used to set the caption color of the tab panel.
. changed Control.isDisplayed to true.
. avoided unnecessary createGraphics.
157. fixed window move not computing the initial distance.
158. changed Color luminance formula in getGray to improve performance.
. changed RelativeLayoutInfo. Since now Rect is final, we tack a Rect member in it.
. fixed PushButtonGroup: now you can change the font before calling getPreferredW/H.
-- final optimizations result: 85910ms -> 64040ms.
! removed some methods from class Vm and putted as constants in class Settings. Below is the convertion table:
  . Vm.oldStyle==true     -> Settings.uiStyle == Settings.PalmOS
  . Vm.oldStyle==false    -> Settings.uiStyle == Settings.WinCE
  . Vm.getScreenSize()    -> Settings.screenWidth,Settings.screenHeight
  . Vm.isColor()          -> Settings.isColor
  . Vm.getMaxColors()     -> Settings.maxColors
  . Vm.getUserName()      -> Settings.userName
  . Vm.getPlatform()      -> Settings.platform
  . Vm.getVersion()       -> Settings.version
  . Vm.getRomVersion()    -> Settings.romVersion
  . Vm.getFreeClassHeap() -> Vm.getDeviceFreeMemory
  Remember that Settings properties are always read-only. Writing to them doesnt change any behaviour and may lead the VM to crash.
  Use Settings.setPalmOSStyle(boolean withWhiteBackground) to switch layouts.
159. added Vm.gc to explicitly call the garbage collector.
. moved Graphic*.c to SWNatives directory.
. made Vm, Settings and Time final.
. now the fast assembler functions are used in all devices and OS versions. This eliminates the slow-but-compatible PalmOS functions, but boost performance up to 5x
160. fixed getting of colors in Visor Prism devices with offscreen bitmaps
161. fixed wrong repaint when moving Keyboard window.
162. NOTE: THIS DIDNT WORK. NEED TO THINK MORE HOW TO HANDLE THIS PROBLEM. created a timer to make sure that the window will be repainted. on the damageRect method, a timer is set. (windows are repainted every time an event occurs; if a window is marked for repaint and no event occurs, the window is never repainted. With this dummy timer, we can ensure that the window will be repainted)
163. new flag Window.eraseBackgroundNow. It erases the background in the next window repaint only. Used in Control.setVisible.
164. new Graphics.getFont: returns the last font set with setFont.
165. fixed bug when you called gImg.free (an image Graphics object) followed by a img.free. Please void do this, anyway (call only img.free)
166. fixed problem when clicking on the menu, on the about and on the menu again.
167. fixed bug in Edit that it was creating too much timers (specially in the Keyboard popup)
. putted a good explanation at Control.repaint javadocs regarding issue 162
. note regarding UI Styles: WinCE is looks better with bright background; PalmOS looks better with white background.
168. Vik: Changed socket code so that allUp is accessable when we check to see if the Netlib open worked. If either the Netlib or any of the interfaces called by Netlib fail to come up, we close Netlib. This makes the next Netlib open restart any closed connections.
. removed Control.repaintNow(boolean eraseBack). Since now each control erase its background, this flag is unneeded.

   Release 9 changes

169. fixed TabPanel.setCaptionColor
. fixed controls to propagate color changes to their child components (like ScrollBar, ComboBox, ListBox).
170. new method Control.setBackForeColors: used to set at once the background and foreground colors.
171. new method TabPanel.setPanelsBackColor to set the background color of each Control
172. new method Color.getAlpha; used to return the alpha chanel of the color.
173. fixed Color.darker.
. fixed ExtraMainWindow's static initializers. Thanks to Thomas Roehr
174. optimized drawHatchedRect and fillHatchedRect: changed them to native
175. added C.K.Lim code to correct Control.getParentWindow
176. added C.K.Lim fixes do Edit.
. fixed some javadoc mistypes. Thanks again to C.K.Lim
177. new method ScrollBar.setValues(int newValue, int newVisibleItems, int newMinimum, int newMaximum)
. optimized SW in Color IIIc. (102290 -> 31620)
178. Optimized Graphics.draw3dRect. Now you must fill a color array with static Graphics.compute3dColors and pass it to the method.
179. added Terry Field code to fix Serial.readCheck.
180. optimized and improved Warp. See bin/instructions.txt for details.
181. Optimized Graphics by removing the double call to each Graphics method. The Graphics.jav is compiled at runtime and linked instead of the normal Graphics.java class.
182. added TabPanel.setPanel. Thanks to C.K.Lim for the code.
183. optimized getMethodByMapNum.
184. fixed close problems in old serial managers
185. added color and list icons for the VM (but not yet to SW programs)
186. fixed name of ScrollBar.getVisibleItems.
187. added Peter Dickerson code to fix the getTimeStamp wrap around. new method Vm.getTimeElapsed
-- started Huge Memory Model
188. removed method Vm.getFreeObjectHeap - use getDeviceFreeMemory, since now all memory are allocated from the same place
189. fixed i2b,i2c,i2s conversions. Thanks to Andrzej JT.
190. optimized double/long operations in 46%
191. ListBox.select now accepts -1 to unselect all.
192. now MainWindow.defaultFont isnt final; you can change to make all controls with the same Font. But make this in the MainWindow constructor or it will not work.
193. added Calculator.getAnswer method to return the pasted text.
194. new method Window.makeUnmovable to set canDrag to false and don't let the user move the window (don't know why someone would like to disable this cool feature).
. cleaned up the Window class. Changed the paintTitle method to protected. Changed isTopMost method to public. A few other members were changed to private.
195. added Alan Stein changed to listbox.select to fix list items from being lost when the comboBox.select() method is used
196. added Oli E. fixes to ListBox.remove: if after removing the list has 0 items, select( -1 ) is called, which does nothing (see there), then selectedIndex keeps being 0 which is wrong, it has to be -1
. changed ResizeStream.restartRecord to public.
197. fixed background color in PalmV.
198. added Peter Dickerson and Andrew Chitty changes in <Int>Hashtable.rehash to correct the optimization i made with << and >>
199. fixed wrong calculation for long >>>
200. optimized int >>>. Thanks to Peter Dickerson.
201. implemented Michael Brereton doubleToString to make Converto.toString(double) support exp notation. Removed ext\Double class. Note: the device toString(double) has a better precision than the desktop.
202. fixed edit's preferredWidth when giving a mask on PalmOS style.
203. fixed PopList.setRect when using in the new forms.
204. added PopList.dontHideParent flag to make the poplist always dont hide the parent, even if PalmOS style
205. change cancelled.
206. fixed ListBox colors when disabled.
207. fixed a bug when popup menu->select item->popup instance of Window class->popup MessageBox when win closed->select menu->events were wrongly dispatched to the focusOnPopup whom was the win previously popped up and nothing happens. Thanks to Nueng Handsome
208. changed collisionDetect method to match what Daniel Tauchke suggested. I don't know if there will be side effects, so please tell me if something is going wrong.
. added ext\Table from Imran Zahid. Needs some enhancements, but its a start.
. added ext\DateRGF with Rony G. Flatscher code for date calculation.

   2.0 Final changes

To do:

. fix bug when in a popup window the button is repainted after it has been closed. (\wababugs\testwin2\HelloBug3)
. fix bug in combobox example where you select bottom, right and then left. Left isnt repainted well
. fix bug in listbox at swcalc: the window is painted on pen_down and in pen_up.
. fix bug at >>> again.




   2.0 Final changes

1. fixed IntVector when returning error values. Now instead of -1 or 0, returns INVALID. Thanks to Mark Pacchiani.
2. a special situation caused by code from Z. Sachen, probably due to a compiler error.
3. avoided unnecessary repaints in ListBox when using the scrollbar.
4. fixed bug when in a popup window the button is repainted after it has been closed. (\wababugs\testwin2\HelloBug3)
5. now if the ListBox item is "", the cursor is correctly drawn.
6. fixed bug when switching menus by dragging the mouse in the bottom line of the menubar.
. changed classes\make.bat file to unswap the classes if compile error in Graphics.jav
7. added Kambiz Darabi changes to fix the behaviour of no events being catched if you don't call setRect in the Window.
. added the SpinList control to ext\moreUI.
8. fixed Catalog.setRecordPos bug when using Vm.debug. Thanks to Nueng Handsome
9. added readCString and writeCString to waba.io.DataStream.
. unfixed Peter code (& 0x1F) in the << and >> operators to make code of Sindre KH work again.
10. fixed killThreads not reseting highPriorityCount properly
11. fixed app switching not killing threads. Now theVM calls appEnding instead of onExit.
12. new method ListBox.remove(int itemIndex). added same method to ComboBox.
. removed memory options from Exegen. Memory since R9 is always huge.
13. fixed ListBox when removing items and the first items was not shown.
. fixed ListBox/ComboBox/ScrollBar when adding too much items, and also removing items.
14. fixed internal border gap for each border style of the Window class.





   2.1 changes

!1. removed methods addNotify and removeNotify. They are not being used at all and they slowdown the add of controls
2. corrected colors at arcPiePointDrawAndFill. Thanks to Christopher.
3. new method Button.onlyShowImage. Perfect if you want to add a image as background to your app. The button will have no borders and won't respond to events.
4. new method Rect.set(Rect another)
5. fixed PopList popping up a PalmOS Combo placed in the LEFT,BOTTOM. Thanks to Karlheinz Toni
6. now fillRect test agains clip boundaries. Thanks to Mark Leeds.
7. fixed GraphicsDestroy when an Image Graphics was the last used and it was freed by the GC. Thanks to Jerason Banes.
8. fixed shift operators again. shame on me. Sorry, Peter, my fault.
9. fixed scrollbar update when selecting items. thanks to Jeb.
10. Added HandEra highres mode support (240x240).
11. added support for Catalog.skipBytes to go backwards.
12. ListBox.add(items []): forgot to update the scrollbar maximum. Thanks to Marc Pacchiani.
13. added ListBox and ComboBox.removeAll to clear the ListBox.
14. added Sony highres mode support (320x320). Needed to change all 8bpp routines.
15. now getClientRect is a method inside Container class.
16. Container now can have borders. Use BORDER_NONE (default),BORDER_SIMPLE,BORDER_RAISED and BORDER_LOWERED. If you created a Control that extends Container and want to use the Container's borders, you must make sure that your implementation of onColorsChanged (if any) is calling super.onColorsChanged.
17. Control.getParentWindow now use the old algorithm, if necessary.
18. Note: ListBox.select must be called only after the control has been added to the container and its rect has been set.
19. Added setCursorColor method to ListBox, ComboBox and PushButtonGroup.
20. Now Convert.toString(double,int) rounds again instead of truncate.





   2.2 changes

1. added ComboBox/ListBox getItems to get the current items.
2. added new method Convert.cloneStringArray to create a copy of a String array.
3. new methods ComboBox/ListBox insert(item,index).
4. fixed bug when the listbox is greater than the current item count
5. fixed bug when adding too much items to the ListBox.
6. fixed sony fonts. now it grabs the high res fonts. be careful with the BIG font size, it is 4 times the size of the standard font.
7. fixed again the double to string routines. Fixed also in the desktop side (which now match exactly the device side). Fully tested and results matching with jdk.
8. now Catalog.listCatalogs running on desktop returns all prc/pdb files in the current directory.
9. now Vm.attachLibrary works in desktop to attach pdbs that contain saved images
10. Graphics.drawImage now accepts LEFT,RIGHT,TOP,BOTTOM as parameters (already supported CENTER)
11. fixed bitmap saving at the desktop. Now it correctly converts from rgb to the index.
12. putted ScrollBar.unitIncrement working.
13. optimized ScrollBar avoiding unnecessary calls.
14. now Image.saveTo stores the bitmap depending on the bpp depth of the current display. It will preserve the original palette only if the device has colors.
15. now IntHashtable.INVALID is not final anymore. This lets you change it to meet your requirements. But note, it is static, so a change will reflect in all instances.
16. fixed emulation of gray devices in desktop. Now you really see like in the device.
17. new constructor Image(byte []fullBmpDescription). It accepts an image from a byte stream. The image can be compressed. The Image.setPixels is now definetly deprecated.
18. added Alain Stein changes to Calendar class.
19. fixed up/down keys on ListBox.
20. fixed setting colors when loading color bitmaps
21. fixed problem in MenuBar when closing without selecting an item and in the next menu popup no popupMenu was openned.
22. fixed PopList of ComboBox positioning when the combo was not added directly to a Window.
!23. fixed preferred height of ComboBox when PalmOS style.
24. fixed x and y positioning of ComboBox in PalmOS style.
25. added Jean Rissoto's fixes in PushButtonGroup: When selecting a new button, the cursor was drawn on the position of pushButtonCroup of the previous screen.
26. added Jean Rissoto's fixes in PushButtonGroup: color of the cursor I set by setCursorColor come on only on the second screen displayed.
27. fixed support for Sony T415.
28. fixed high-res support for some UI controls.
29. fixed high-res support in desktop. This command-line emulates the T415:  /w 320 /h 320 /scale 1 /bpp 4 /useSonyFonts
30. Now you can use the Sony fonts. Just specify /useSonyFonts in the applet commandline. The fonts are located under classes/Sony*.pdb
31. removed Handy class. Moved boundText to Convert.insertLineBreak. This method may be slow. Use it with care.
32. Now Vector.toObjectArray may be casted to a String[] array if the elements are Strings. No more need to use Convert.toStringArray().
33. New Method Vector.qsort (only works if the Vector elements are Strings).
34. new method Convert.qsort(Object[]). Although the parameter is an Object array, all array elements must be Strings.
35. new methods ComboBox.qsort and ListBox.qsort.
36. fixed Catalog.create. Now it matches the behaviour of the device (it catalog found and mode == create, read the data).
37. fixed index out of range in ListBox.find when the listbox contained a "" item.
38. fixed PushButtonGroup.setSelected when myg == null but all other conditions were valid (the result was the selectedIndex was not being set).
39. new Timer.triggered, set when the timer is being triggered. It may be used to distinguish between various timers within the same target control.
40. added Alan Stein fixes to extra/Memo.findMemo.
41. removed heapgap. This was allocating an unneeded 50k chunk.
42. changed some delays in the gray scale start to try to fix the screen corruption.
43. fixed Buttons in PalmOS style being drawn dark instead of black.
44. changed 2bpp device's palette to a bit darker one.
45. made cursor color darker in 2bpp devices.
46. fixed paint problem when a window was popped up in the PRESSED event thrown by a ComboBox.
. added ext/edits, a package from Jean Rissoto that contains a multiline edit and some other cool stuff.
47. fixed setting colors in MessageBox. Now the label follows the fore/back color of the MessageBox and the arrows follow the foreground color.
48. Now in MenuBar and PopupMenu you can set the border to NO_BORDER.
49. added support for colored menubar and popupMenu. new methods MenuBar.setCursorColor and PopupMenu.setCursorColor. new method MenuBar.setPopColors.
50. Now Control.setRect makes sure that the control width does not advance over parent's bounds if PREFERRED was choosen.





   2.3 changes

1. fixed pushbuttongroup cursor color in WinCE style
2. added .rsrc files to vm directory
3. fixed WinTimer bug (there since SW 1.20) to correct multiple timers problem.
4. fixed WinTimer bug (...) to correct long timer delays holding the VM.
5. added Alan Stein code to prevent a timer event from Edit to propagate.
6. now the popup menu of 3.5 devices does not appear anymore. Also, corrected copy/cut/paste in PalmOS 3.5 devices.
7. fixed Graphics.drawPolygon routine.
8. fixed waba.applet.Applet to let bpp be only 2,4 and 8.
9. fixed bug when saving and loading images.
10. added examples/DrawingControl, an example made by JebeDiAH that shows how to use a control that lets the user draw in it, and save and load its contents.
11. new method Catalog.rename
12. now Catalog at desktop issues a warning if you try to create a record bigger than the alowed size.
13. fixed SWCalc to work with the /uiStyle correctly, by splitting the constructor and onStart methods.
14. added support for exceptions in SW. Hartly thanks to Michael Brereton.
15. changed Date.monthNames to public so one can localize them.
16. fixed Warp to not include two times the same file (like a bmp declared in different classes)
17. fixed ComboBox moving to a wrong position when adding items after being switched in a TabPanel.
18. optimized drawing speed when dealing with lots of images that has the same palette.
19. removed Image.doAntialiase.
20. fixed drawing operations in Images on desktop.
21. now Color.getGray returns the Alpha channel if we're in a color device.
22. new parameters Settings.appCreatorId and Settings.appSettings. appCreatorId equals the creator ID of the application. appSettings is a easy way to store a string with settings for your application. The string is stored when the program exits, and loaded again when the program starts. This also works in the desktop, by creating a file named Settings4crid, where crid is your app creator id.
23. fixed Catalog.skipBytes at device
24. now desktop calls onExit method when exiting the application
25. added two virtual machine options, that can be turned on/off through the Options menu in the Welcome app:
    . Audible GC: when on, a beep is heard every time the GC is called. This can be useful to optimize your program by knowing if GC is being called too much (by creating too much objects)
    . Dump Memory Stats: when on, when the program exit, some memory statistics are dumped into the SW Debug Console. These include the total number of times the GC was called, the total memory allocated and the memory usage after running the program.
    Note that these options, when turned on, will work for all SW installed programs. And, of course, they only work at the device.
26. Added Henning Sprang changes to correct a bug in the Date class when using invalid month values. Added a flag allowDay99 to used in VPFinance program (now false as default). Sorry for this, it may be removed in the future.
27. added a public member lastError to Socket and SerialPort classes. It will contain the last error occured when running in the device only. See the javadocs for a detail of the errors that may be returned.
28. fixed bug when calling the Find window and a Window was popped up. Now all windows are painted.
29. fixed ext/edits bat files. added event.consumed to all files in the directory.
30. added Peter Dickerson improvements to the Compression class.
!31. removed constructor from Catalog with the createIfNeeded flag. Just use the flag CREATE to match the same effect.
32. added color support for Calendar. Fixed it in Sony's 320x320.
33. added color support for Calculator. Fixed it in Sony's 320x320.
34. Fixed background for PushButtonGroup with gaps > 0 and colored backgrounds
35. added color support for Keyboard. Fixed it in Sony's 320x320 for both NORMAL and HEBREW.
. Note: i'm not a good color-designer. If you find better color combinations to the classes above, please tell me.
36. fixed some native Catalog methods that was not testing if the catalog was open.
37. added a flag beepOn to TabPanel so you can remove the beep when changing tabs. Just set it to false





   2.4 changes

1. fixed images, greater than the screen, being panned.
2. added Rect.equals and Coord.equals.
3. fixed "low memory access" bug.
4. moved waba.util.Math to java.lang.Math. The VM was tweaked to find the old waba.util.Math to keep compatibility with old versions.
5. fixed Convert.toString(d,precision). Requested by David Haysmith.
6. 6: avoid openning the combobox when its popped up and the user presses the arrow again. Requested by David Haysmith.
7. fixed doubletostr when dealing with 99..99,99..99 -like numbers
8. fixed when adding two controls in the same location but one of them was not visible. Requested by David Haysmith.
9. changed all bat files to call another bat to set the environment variables. Added support for Jdk 1.4. Fixed securityexceptions occuring in Jdk 1.3.1. Fixed problems regarding Jdk 1.4 and Retroguard. Now you can pass "noretro" as argument to the classes/make.bat file to avoid obfuscate the VM (automaticaly done with Jdk 1.4)
10. fixed VM to abort when tour.Tour is located in Tour (and not tour/Tour)
11. changed the target focus of waba.ui.ComboBox so parents can catch the focus_in and focus_out event. Requested by David Haysmith.
12. In ScrollBar, make sure that at the maximum bar pos we get the maximum value
13. changed Throwable.printStackTrace to print the Exception+message instead of nothing.
14. catched uncaught Exceptions thrown from onPaint method
15. Added ext/JTable, a good table to use with SuperWaba. Thanks to Stein Rustad
16. updated waba.util.Compression. thanks to Valentim Batista
17. now instead of return in case of bad utf, we just convert the string as is. This fixes the case of returning an Settings.userName with accents
18. fixed ComboBox, Radio, Check and ScrollBar in Sony. Added Settings.bigFont.
19. added examples/IRChat. Thanks to Shaun O'Brien.
20. added a constant to class Window: highResPrepared. It will be used to scale the Window when running in Sony high res devices. Since almost no user take care of testing the program in such devices (by testing Settings.bigFont), if the window has the highResPrepared set to false, it will scale in the setRect the width/height to *2 and will center the Window on screen. Note: if your program *is* prepared for sony high res, you must set this flag to true in the first line of each Window's constructor (or after calling super). (E.G.: all SuperWaba classes that extends window are prepared for high res, so i have setted the flag to true in those class constructors).
21. fixed Scrollbar arrows not posting event. Thanks to Piet Jonas.
22. fixed screen corruption. Note: i think this time this is really fixed. But i had noted that sometimes the screen still gets corrupted. Try to turn the device off and on again; the screen should change to normal. If the screen still is corrupted, please send me an e-mail.
23. if the postEvent before pops up another Window, we must not set the focus back because the topMost var has changed. Requested by David Haysmith.
25. fixed str2double not recognizing negative values.





   2.41 changes

1. fixed bug if native method library was not found and the hashcodes was not correctly generated
. fixed bug in the bat files. Now tested with all environments. In the rundemo's you can now pass up to 6 parameters from the command line (e.g. "/bpp 8").
. fixed some javadocs tags
. improved performance a little.
2. removed in ComboBox the win.x and win.y being added to the x,y coords (it was appearing away from the control)
3. fixed tweak when using waba.util.Math.
4. added MessageBox.setTextAlignment.
5. fixed getClip returning a different value between device and desktop version
6. fixed Exception not being correctly catched when created in deep stack calls. Now pushing oldpc to the stack; also moved "oldpc=pc" only to those places where an Exception is thrown; now using STACKSAVESIZE instead of # 3 (now is 4)
7. tried to fix the "Records left locked in uprotected closed database" when an uncaught exception occurs. Still no success.
8. Oli E fixed a problem in Convert.insertLineBreak (and also a tip in the javadocs)
9. now the Convert.qSort can be an array of Objects (the toString method will be called). Changed Listbox.qsSort to allow it too.
. added Forte setup sent by Ed J. Szalajeski to org/how-to-start.txt
10. removed waba.io.File. Not used/implemented in PalmOS.
11. added java/lang/Class.forName, Class.newInstance, Class,isInstance, Class.getName. added also the needed Exceptions.
12. updated ext/JTable with version 1.0.3.
13. fixed javadocs for waba.io.DataStream. Fixed writeLong and writeDouble not returning the number of bytes written.
14. fixed waba.io.ResizeStream addRecord so it now may return false if the record could not be added.
15. commented out the javax.comm stuff at waba.io.NativeMethods4JDK. To use it, you need to uncomment the lines marked with !!! and compile again.
16. fixed a problem when running as non gui app by trying to instantiate java.lang.NativeMethods4JDK.
17. changed READ_ONLY to READ_WRITE to fix "operation invalid" error in Settings.appSettings when running in desktop
18. added new example ContainerSwitch to demonstrate how to add/remove Containers.
19. fixed loading longs and doubles in DataStream.
20. now appSettings is stored in the "saved preferrences". In other words, it will survive a hard reset.
. Changed _WebSafePalette.txt to html. Thanks to Carlo Lazzaris for the file.





2.x ToDo List

. Add shortcuts to the menu items
. add introspection
. implement a way to save byte streams as a prc.
. put working the native method to save and restore objects (Serializable)
