Notes (weeks 13-14) – No more QuickView prototypes

April 7th, 2012

Still no snapshot I’m afraid. Last week I coded a file previewer for the QuickView (first image). This week I finished coding the image viewer (second image). I’m pretty happy how it turned out. You can now zoom and pan images. Also it supports optimized loading of JPEG images which makes things nice and fast.

I was planning to release a snapshot this week but due to some nasty memory leaks (Delphi’s TJPEGImage is not thread-safe it turns out) I wasn’t able to finish things on time. However, I have managed to finally move the prototype code into CE.

I’ll finish things up next week and release new snapshot on Friday.

File previewQuickView image viewer

QuickView tab

Notes (weeks 11-12) – Hunt for bug

March 24th, 2012

No snapshot this week unfortunately. I started last week by transferring the QuickView prototype code into CE. Once everything was up and running I noticed severe painting issues on resize. It was something I hadn’t seen before and it made very little sense. So I spent many days in trying to figure out what the problem was. Eventually I realized that the problem appeared when using too many nested windows. In the prototype everything worked fine because I was using only few nested windows but since CE has more complex layout, the limit was reached.

resize_bug

It turned out to be a limit in Windows Kernel that caused those painting issues. Here’s a good description about the issue by Jordan Russell: http://news.jrsoftware.org/news/toolbar2000/msg07779.html. Thankfully there was already a fix available so I didn’t have to do any major changes.

For those interested, here’s the fix (credits goes to Andreas Hausladen)

ControlResizeBugFix.pas (not needed for Delphi 2009 and up)
http://cubicexplorer.googlecode.com/svn/trunk/Source/ControlResizeBugFix.pas

Notes (week 48)

December 1st, 2007

I’ve been working this week with the new version of SpTBX library. It’s a set of controls that I use in CE (menu,toolbars,buttons etc.). Thanks to Robert Lee’s great work, the new version now supports skinning. I had to do quite a lot modifications to CE to make the new version work correctly but it’s mostly up and running now.

There’s few cool new themes available but some old themes are missing, like Aluminum.
ce_leopard_themece_office2007_silverce_office2007_black

I wrote a simple skin editor that makes it easier to create your own skins.
SpSkin Editor

SpSkin Editor, source + exe (852KB)
http://cubicreality.pp.fi/files/misc/SpSkinEditor.zip

I’m still not sure when the next release date is. I’ve done some work on the options dialog and have pretty good idea on how it will look and feel.

Using version control system

July 13th, 2007

I finally took version control system in use for CubicExplorer. I chose SVN. Currently I’m using local repository but will move it to a server once I have the time and energy to build a new case for the hardware. I’ve been using this thing for a week now and it’s really nice. Currently CE has over 100 files in it’s source so it started to be a bit hard to handle. The biggest thing I like it is the log. Now I can write note on every bug fix or other change, which means there will be change logs for releases :D

I used to use a simple folder tree to handle different versions. Every once in a while I took copy of CE’s source folder and started to work in that new folder. I also had all the files in one folder so it was quite a mess. I decided to change the folder structure a bit so that source files and .dcu files are in their own sub-folders. It’s much cleaner now.

I’m using TortoiseSVN to do everything. It supports local repositories so there’s no need to use svnserve or Apache. Also I’m using a simple add-in for Delphi that adds menu with common TortoiseSVN commands.

TortoiseSVN
http://tortoisesvn.tigris.org/

Delphi add-in for TortoiseSVN
http://delphiaddinfortortoisesvn.tigris.org/

Hand Point (link) cursor in Delphi

June 21st, 2007

So I’m writing some code and need to use the hand point (link) cursor. However I noticed that Delphi is using different looking cursor than Windows. After I looked around in the Forms unit to see how TScreen handles cursors I wrote this fix which seems to work fine.

procedure TForm1.FormCreate(Sender: TObject);
begin
Screen.Cursors[crHandPoint]:= LoadCursor(0, IDC_HAND);
end;

Delphi app preventing Windows to shutdown?

March 15th, 2007

Whew! After about 6 hours of constant debugging and testing in VMWare I finally managed to find the cause for a problem that prevented Windows from shutting down if my Application was running. The solution is very simple, in my case at least. Basically I had one component that used AllocateHWND to create a handle. In my WindowProc I didn’t have a call to the DefWindowProc, so the WM_QUERYENDSESSION didn’t get handled properly.

Continue reading »