Friday, November 27, 2009

Next moves

I'm kind of tired and bored fixing things for the Text class. Many display problems remain. The most annoying one is a "bug" with the MLM_QUERYLINECOUNT message. For some reason it returns difenrent values sometimes.

Now I want to move on. First register the unsolve bugs and then begin the work on the tree and table classes. Probably that will take me a couple of months at least. After that ProgressBar and Sash classes should be implemented.

Work on the port of the Program class should finish the loader for Eclipse and then a full compilation should be the last item in the list.

Well, that's the plan. Let see how close I follow.

Bye

Friday, November 20, 2009

Slowing down

There has been some slowing down on the updates, mainly because I have a heavier load of work and there has been more problems than anticipated with the Text class. I have added two tabs from the control example. One deals with the different kind of dialogs available from SWT and the other with the Text and StyledText classes.
StyledText class does not compile because of the dependencies with some classes that need to be ported so I left it out of the example.

As of now I continue to improve the text class getting ready of small glitches.

Bye

Tuesday, November 3, 2009

Habemus icons

After some extra,,,, extra,,, extra effort I "solved" the issue of the missing images in the Label class. Still needs testing, but so far it looks fine.

The problem is a bug in the WinCreatePointerIndirect that ignores the mini icons. The solution was to draw the image using the GPI Api in the WM_PAINT of the Label class. I used the code from the Botton class that implemented the same solution.

I decided to allow the WinCreatePointerIndirect to work for regular size icons. There is a pallete problem there and the will be problems when the image is 32x32 and the resolution calls for the use of 40x40 icons. In that case PM will scale the icon and it will look ugly.

I'll clean up the code and will upload the changes this week.

Monday, October 26, 2009

Fixing more things

As I go over the code I keep discovering new improvements and unimplemented features to work on.
Last week I corrected the default sizing of the Scale and Slider classes. Now the ControlExample shows them in a correct default size.
The one fix that was really important was the redrawing of the group class. This caused a mess everytime a control was redraw.

The problem happened because the original Win32 implementation uses some flags that indicate when the background should be restore. This feature does not exist in OS/2 so the solution was to implement the WM_PAINT in the group control and there take care of the background refresh. So far it works and now the groups refresh themselfs just fine in the ControlExample testcase.

Over the weekend I added support for the Innotek Font Engine. I tried to see if things worked. Unfortunally there was a lot of tweaking on the SWT port font code to circunvent PM bugs.
Clearly I need to go over the font code since using the FT2LIB screws the true type drawing. The change shows potential but needs some work. I left the engine turned off for now.

This week I'll try to fix the static control. It's now showing images. If I get brave I'll also try to subclass the WC_STATIC and create the conditions and tools to easily extent controls through this OS/2 feature.

Tuesday, October 13, 2009

Improvements

Last week I worked on solving many issues that are pending of solution. Looking at the ControlExample I solved issues with the List class. Many of the display problems were taken care of. Now the code seems to show the List exactly as the Window version does, except for the vertical scrollbar that in OS/2 is always visible.

I also solved some other minor issues like the color of the tabs in tabfolder and I began the imlementation of clipboard support in the Text class.

Also today I fixed the font dialog exception and now the font can be selected for any of the controls.

Thursday, October 1, 2009

Clipping away

It took me a long time to discover why the composite classes didn't repaint their backgrounds after being clipped. At the end thes solution was so simple that's not even funny.

Well with that problem left behind, I have a whole lot of more things to do. First I will go over the implementation of menus. So far everything seems to work OK. I added the mnemonics and they work just fine.

I dicovered a new bug on the creation of the acceletators table. I going through the C JNI implementation.There seems to be a problem. I'm also looking into adding the icons to the menus and the implmentation of the progress bar using the slider control.

The easy part is to finish the mouse events (at least of the second button).

Well, let's go back to work now.

Tuesday, August 4, 2009

More bugs

As I advance on the task of making the control example work, I keep coming accross new bugs. Now I discover that some controls inside the notebook page, do not update their state correctly, but I'll leave that problem for later.
Right now I'm learning how to capture the mouse events inside the notebook pages. I also fixed a crash produced by right mouse button being clicked inside the notebook window.

My work will slow down a little the next weeks for personal reasons.

Friday, July 31, 2009

Notebooks and more notebooks

I took a short vacation and I didn't work on the code at all. At that time I had the problem of double click on tabs would cause a redraw of the window. That problem was solved by not using the autosize flag on the creation of the tab.

Then came the problem of the size and position of the application window inside the tab. I did a lot of testing and finally I understood how to calculate the Y coordinate.

After that the problem was that the initial drawing of the top page didn't happen and that was solved by implementing the drawing on the WM_SIZE message. This also solved the resizing problem I was seeing in the Control examples from Eclipse.

Now on to implement the mouse operations. The Control example doesn't work at all because the notebook is not processing mouse events.

Also on the list should be the drawing of the text happens using os/2 coordinates and it should be using the SWT coordinates

That's all for now....

Tuesday, July 14, 2009

Notebook fixing

After the suggestion of Martin I began to work on making an example work. I modified the SWT control example to leave out all the unimplemented classes and it did work,,,, well sort of.

I discover that my imlementation of the tabfolder class was incomplete to say the least. Actually the onky thing that did was to paint a very basic Tab. I set up to solve the problem and I did some good progress.

First I fixed the adding of new tabs issue, then I was able to color the tabs to make them look more like the rest of the platforms. I changed the testcase to include more functionality and the I found problems with the display of the controls inside the tab page.

After some tests I discover that I wasn't connecting the tab id with the window id. I realized that I'm so ignorant on some of the most basics things of PM programming. Well I guess that's the point of all this... to learn.
Probably today or tomorrow I'll finish the display issues and then I'll go into more little details.

Probably the implementations of scroll bars and menu's aren't that complete either so I'll go back and fix them as I go along.

Monday, July 6, 2009

Some work done

This weekend I had some work done on the code. First I added more needed stuff to create a progress bar example, this includes all the constants from the progress.h to OS.java, 4 APIs definition (only 2 are going to be tested), the JNI implementation of the main API in the swt.c

I was able to compile the C code and the Java code without many problems now I need to implement the second API to set the attributes of the bar. After that I only need to create a testcase and play with the progressbar class.

I also realized that there is a lot of work to do on the Program.java. First I need to understand it's use.

Finally, I tried to run the control example directly from the distribution and I came across a NoDef class exception as it was expected and I learned that there are a bunch of emulated controls, now I just need to compile them and work from there... in other words aa lot of work still.

Friday, July 3, 2009

New ideas

Since I finished the Scale class I have been looking for my next move. I decided to use the eco software runtime and libraries to add support to the missing controls. The downside is that you would actually need the runtime installed before you can use the SWT port.
The other line of work has been to include in the trunk additional classes we need compile in order to make Eclipse port work. I added the boot.jar and the startup.jar to the tree. They both compile now using ant.cmd boot.jar or ant.cmd startup.jar. A lot of investigation needs to be done before moving forward in these tasks.
Finally the last line of work has been the creation of a working test that I can upload to the net and somehow demonstrate where I am with the SWT port. I'm going to use the control example from the eclipse distribution. Hopefully I'll have ready next week

Wednesday, June 17, 2009

Scale class

I found some time to work on the proyect again and I decided to add the Scale class. The main new challenge was to include control data.
In order to do it I wrote a new WinCreateWindow implementation that took the SLDCDATA structure as parameter. I overwrote the constructor of the class using this call instead of using the Control call.
The rest was fairly easy. The only issue was that the result of painting the scale on diffrent systems gives different looks. I have to find out how to make it consistent.