
I have just voted for Firefox, Google Reader and PicLens. Even though I have used Internet Explorer 7, I am forced because without my Windows is incomplete (thanks, Microsoft). So what will you vote for?
My name is Lex Li. I love pop music and badminton. Now I live in Shanghai, P.R. China.

I have just voted for Firefox, Google Reader and PicLens. Even though I have used Internet Explorer 7, I am forced because without my Windows is incomplete (thanks, Microsoft). So what will you vote for?
Now I am going to tell you Plus Manager is finally meeting my original goal.
I had been waiting for a tri-state tree view control for so long until I met this article in 2006. However, BDS 2006 was targeting .NET 1.1 so this control cannot be used.
The design of this control is so wonderful that it looks natural and beautiful. Thanks Uwe for creating Zeta C# Library which contains this useful control.
Now you can see that I use both Office 2007 renderer and Tango icons here.
BTW, I modify the original source code in order to make the tree view Vista-aware.
I was just checking in a lot of files to Vault. I thought it was dead so I killed Visual Studio 2005 in Task Manager. OK, from then on it complains that some files are exclusively checked out by a user so I cannot check them in until he checks in. And the serious problem comes, that user is me. Oh, who will save me???
I believe it is a Vault bug but because I am still using the 3.5 old version, so I cannot hope this bug fixed today or in the future (SourceGear is selling 4.1 right now). Therefor I am forced to find out how to resolve it myself.
In fact, today is my lucky day that when I launch the Vault Client, a workaround is so obvious. I UNDO all checkouts but LEAVE my working files there. Then I launch Visual Studio 2005 again, and suddenly see everything is fine. Why not buy some lottery tickets tonight?
I have to confess that I never knew checking in hundreds of files would take such a long time. But I am sure next time I won't kill Visual Studio.![]()
Did you read this post? You might think I use Krypton Toolkit, but in fact I didn't because Krypton Toolkit is not open source.
This article is quite important in this case. It seems Phil did not place an EULA there to restrict us, so I think why not make use of the wonderful code?
That's it! The screen shot above is the latest Expert Manager UI. Do you like it?
An issue that always bothers me is that I cannot find icons that I can use freely. Luckily I met Tango this week and WOW there are a lot of beautiful icons. That's why for the first time you see icons on the tool strip above.
I wish the 6.0 Update 1 bring you a better experience later this year.
Although Visio 2007 is part of Office, it remains the menu and bar style.
Ribbon UI is cool. If you have tried Office 2007, InstallAware 7, or NDepend, you know why it is cool. Although there are negative comments, I really find Ribbon UI a good way to organize so many commands in a rational manner (don't know why Microsoft decides to call it Fluent UI at last).
It is easy to see Ribbon not always a correct option (and probably that is why Microsoft makes Ribbon UI licensing this complex - Ribbon is not a silver bullet.) For example, my project at office has only about twenty menu items at all. If I move it to Ribbon, there would be a lot of empty space in the panels which is very ugly. Although I got a license for r.a.d. Ribbonbar after registering Visual Studio 2005, I would not use it until the time is right.
In my case, menu and bar style is enough. Therefore, I have been working on tool strips heavily lately.
At first I was going to implement something similar to Visual Studio 2005/2008 but I couldn't understand why Microsoft does not make it default,
ToolStripProfessionalRenderer renderer = new ToolStripProfessionalRenderer();renderer.ColorTable.UseSystemColors = true;ToolStripManager.Renderer = renderer;
If Mike did not publish this in a post, I might never know it.
Suddenly I came across another wonderful renderer on CodeProject and its enhancement, I soon gave up the VS style. Yes, I guess you would love the Office 2007 renderer too. Because it highlights items in such a natural and obvious way, I couldn't resist using it anywhere suitable.
The only issue right now is that I don't know whether Microsoft claims any restriction on the Office 2007 renderer alike controls because it seems that Fluent Visual Appearance is part of the Fluent UI License. OMG, it is so hard to make my project look fabulous
.
I have sent a mail to the Microsoft guys. Wish they could clarify the thing for me soon.
(Update: Phil, the creator of Krypton Toolkit kindly reminded me that only Krypton Ribbon users are affected by Microsoft Fluent UI License. So now I have started to use Krypton Toolkit instead of this renderer.)
BTW, Even though it is possible to persist DockPanel state, I do not find a way to persist ToolStripContainer state when I place five ToolStrip items in it. So I have to fix those items.(Updated: Now I become a maintainer of DockPanel Suite. The latest DPS can be found at https://github.com/dockpanelsuite/dockpanelsuite.)
When Microsoft acquired Virtual PC in 2003, Virtual PC was not as good as VMware. VMware has been the leader in this field for years. But after so many years, Microsoft finally succeeds to release a clone of VMware flagship product ESX Server as part of the new operating system product Windows Server 2008. In this way stand alone Virtual PC console vanishes, but we all know Microsoft does have good use of the Virtual PC technology this time and leverage it to the extreme.
There are other competitors too. SUN, IBM and Oracle joins the field by investing on XenSource. And at last SUN enters the war directly by acquiring Innotek, who invents Virtual Box. Because of SUN's attitude towards open source community, I believe it would soon invest more money on Virtual Box and makes it better than ever.
What would happen to Virtual Box in the next few months? Can't wait.
In David's legacy project SharpBuilderTools there is no such kind of checked menu items so I thought it was impossible. Then I started to wonder how the RemObjects guys creates checked menu items in their BDS expert named Everwood.
On Tuesday I suddenly found out how so I added a few new functions in LeXDK. You can see I created a new menu item like this,
RegisterAction(CreateCheckedMenu(MenuItemLocation.Child,
MenuProject,
MenuAutoActivateProject,
0,
"Auto Activate Project",
(bool)PropertyRegistry.Get("AutoActivateProject", true),
new EventHandler(DoAutoActivateProject)
));
The sixth argument of CreateCheckedMenu is named as isChecked. And this is the initial check state.
Because there is no CheckOnClick property on IOTAMenuItem, the event handler must change the check state correctly like this,
private void DoAutoActivateProject(object sender, EventArgs e)
{
bool state = (bool)PropertyRegistry.Get("AutoActivateProject", true);
bool newState = !state;
OtaUtils.SetMenuItemCheckState(MenuAutoActivateProject, newState);
PropertyRegistry.Set("AutoActivateProject", newState);
}
The new functions will be available soon in a later version of LeXDK/CBC.
Why checked menu item is a must? Even though it is a pseudo standard to place all preferences in a global dialogue, in that way in order to change a simple setting like a boolean flag a long sequence of clicks is required. Therefore, sometimes simple settings should be provided as checked menu items so modification of them is straight forward.
Stay tuned.
It is said that CodeSmith is a must for .NET developers. However, even though I have been doing C# for years, I do not use it that frequently. So I prefer the free 2.6 version.
But time goes by so quickly that you may find it fails to launch on Windows Vista. Why it complains that
while Vista pre-installs .NET 2.0 and 3.0? I guess .NET beginners would find it miserable.
The answer is quite simple that its config file prevents you from using it on .NET 2.0/3.0,
Therefore, here comes an easy workaround,
Adding a .NET 2.0 line is enough.
Now I am looking at new icon sets for major operating systems that probably would ship with Firefox 3 Beta 3 and go to the Final. Oh, they are fabulous.
Something interesting is that the only characters in them are Chinese (no English characters there in the icons).
The leftmost two icons are for Windows (XP and Vista) which contain the Chinese character for fox (狐) while the rightmost icon for Linux contains page (页).
This is a post in the 6.0 New Features series, to promote my open source project.
When I published 6.0 on CodeGear Code Central, I put "Customize Your Unique Style" in the title. That is because from this version on, Delphi developers can customize coding style in CBC.
Click LeXtudio | Options | Preferences to launch this dialogue.
Then click Configure button. You can customize the coding style here.
If you were a JCF user before you would feel familiar because the dialogue is just the same.
The problem here is that you cannot preview the style immediately but I would try my best to find a solution later.
CodeGear gave up C#Builder so I could no longer maintain Code Beautifier Collection in it. That was why I moved to SharpDevelop a few months ago. It is OK as now Delphi native becomes the only core again, and most developers are pleased to see this shift.
This shift impacts on GrapeVine in such an unexpected way that I suddenly find most of features are C# or .NET centric. What could GrapeVine bring to Delphi developers in a long term?
If you take a look at GrapeVine (6.0) and compare it with HardQuery (5.2 and 5.3), a key change is that most C# related items are either extended to support Delphi as well or simply removed (don't worry, I keep them so I may revive them if CodeGear revisits .NET in the future).
So in the next major release GrapeVine Update 1 (6.0.1), I am going to further extend features to support Delphi and VCL development. As usual, I won't clone GExperts or CnWizards features. I am just focusing on features that I know well and use frequently.
I am to do a few posts about GrapeVine new features to illustrate how to use them easily. Stay tuned.
This morning I suddenly came across the SF.net Donate button, and then I decided to use it as well. So now you can see two buttons on my blog.
Notice that the SF.net Donate process requires an SF.net account.
Because of the Great Wall I cannot visit my blog at home (fortunately from this month on I can do it at office as IP address there is acquired from a San Jose server. It seems that in that way the Great Wall fails). However, last month I found out a way to indirectly visit the front page somehow. Since I suddenly forgot the link I did not post that earlier. ![]()
Today luckily I reproduced the page, and here is the tip.
Then your web browser will lead you to a place whose URL starts with http://www.blogger.com. But it is still your blog front page, isn't it?![]()
In this way I finally can take a look at it at home to see if my customizations lately look fine.
I have just released the GrapeVine Final as version 6.0.0.1014. After unsuccessful M11 and M12, I decide to skip M13. That is why the final release is the 14th build.
Major changes are,
This is new About dialogue,
You may notice there is one more button. Yes, now you can donate to this project. Finally I set up a PayPal account for Code Beautifier Collection.
You can also donate via my blog by clicking the Donate button.
From now on I can start to enjoy my holidays.![]()
I love AVG Free, but because viruses and Trojans are serious in China I use a commercial product named KAV7 on Windows Vista.
However, for Ubuntu Linux, I am sure that AVG Free is a nice choice. The installation is simpler than the official manual. Simply right click the avg75fld-*.deb package, and choose Open with "GDebi Package Installer".
After installing, you will find AVG Free activated except the Update feature. Why it says "Update process failed. Reason: Sorry, you do not have permission to execute avgupdate."?
According to a thread or two on the AVG Free Forum, the normal user account such as lextm is not a member of a so called avg group.
Now all you have to do is simply launch a Terminal and type in
sudo usermod -a -G avg lextm
Then please log out or reboot in order to apply the change.
Now you can go on to configure other options of AVG Free for Linux on your Ubuntu at home.
I have submitted bug reports to both Microsoft and Borland/CodeGear. The experiences are completely different.
However, using QC client distributed with RAD Studio is quite inconvenient because the user interface is really ugly (sorry Nick, it is not your fault). So I turned to QC Plus once but it failed me too.
Yesterday, I finally decided to have a try of latest QC Plus 1.0 release. Wow, it is now fabulous! Because Visual Studio docking style layout is used, now I can navigate easily to see information I like.
Do you remember that I just updated Project E like this? Although Microsoft does not create a lot of great UI elements in its products like Vista, some UI elements it invents for Visual Studio .NET, Office are standard and rational. Therefore if you don't have the time and energy to design something really innovative, follow Microsoft's style is simply OK.
BTW, I met an issue with QC yesterday when I tried to fire a report for Windows Vista (I am on Windows Vista). This issue broke both QC Plus and CodeGear official client. So you must always specify the platform options to All Windows so as to work it around.
Have to say the sound of fireworks outside the window is so loud. The whole nation is waiting for the coming of Chinese New Year. The PIG is leaving and the MOUSE is coming.
So after a half day working on 6.0 Final, I cleared several items from the list. Sorry that I hadn't listed the items in that post. And in this post I am going to list what items would be fixed in a later version such as 6.0.1 (GrapeVine Update 1).
Why? Some features would be re-implemented in the future in order to catch up with RAD Studio changes I did not take care of in the past. And some features require heavy improvement which may take even more time. Sorry for the convenience.
The "won't fix" list consists of,
Stay tuned. 6.0 Final should be out in a few hours.
Because auto update feature has been added to Code Beautifier Collection (http://code.google.com/p/lextudio) since 2006, I am able to compare other products with my small project to see if their auto update implementation is better or not.
Just one or months ago, auto update feature was added in Notepad++. However, compared to CBC N++'s update executable is launched every time N++ launches. This implementation is OK on Windows XP. But on Windows Vista, it is terrible.
N++ update executable requires elevation. This means even if no update is available I have to elevate it in order to use N++. Because my InDate implementation does not require elevation and do work well, I wonder why N++'s author implements an update executable like this.
(Update: I am using 4.8.2 now and this bug is fixed. Well done.)
Now I'd like to introduce how I find this bug.
The Background and Steps
I'd like to modify AddMany (CodeCentral entry #25077) project without breaking the original source code. Thus I did the following,
Then the issue came that IDE thought the output should be Lextm.AddMany.dll while the correct one is AddMany.dll because the real project file is still AddMany.dpr.
Also when I tried CBC's Delete Project Target, CBC said that target does not exist. Then I debugged inside and saw that IOTAProject.ProjectOptions.TargetName is wrong. The returned string is ***\Lextm.AddMany.dll while the expected is ***\AddMany.dll.
Luckily the workaround is described here so if you also meet this issue you can try my code.
(Update: This bug is logged as QC#57890. And it applies to both Delphi for Win32 and .NET DLL/BPL projects. Strangely it does not affect EXE projects.)
I thought it was a CBC bug at first. However, after debugging I am sure it is another OTA bug.
Now all projects are MSBuild based. Therefore a Delphi project contains a .dproj wrapper and a real .dpr or dpk project file. The bug happens if these two files have different names. Then you cannot get a correctly string from IOTAProject.ProjectOptions.TargetName.
The workaround is also easy that I parse the .dproj file directly to locate the .dpr or .dpk file. The code is,
public static string GetProjectTarget(IOTAProject project) {
if (project != null) {
String targetName = project.ProjectOptions.TargetName;
if (project.Personality == OTAIDEPersonalities.sDelphiDotNetPersonality
|| project.Personality == OTAIDEPersonalities.sDelphiDotNetPersonality)
{
string folder = Path.GetDirectoryName(targetName);
string file = Path.GetFileName(OtaUtils.GetDelphiProjectFileName(project.FileName));
return Path.ChangeExtension(Path.Combine(folder, file), Path.GetExtension(targetName));
}
return targetName;
}
return null;
}
public static string GetDelphiProjectFileName(string project)
{
string content = File.ReadAllText(project, Encoding.UTF8);
Match m = regex.Match(content);
Debug.Assert(m.Success);
string file = m.Groups["source_name"].Value;
return Path.Combine(Path.GetDirectoryName(project), file);
}
readonly static Regex regex = new Regex(
"<DelphiCompile\\s+Include=\"(?<source_name>.+)\">\\s*<MainSo" +
"urce>MainSource</MainSource>\\s*</DelphiCompile>",
RegexOptions.CultureInvariant
| RegexOptions.Compiled
);
I will fire a bug report to QC tomorrow. Oh, that would be Chinese New Year Eve![]()
(Update: This bug is logged as QC#57890. And it applies to both Delphi for Win32 and .NET DLL/BPL projects. Strangely it does not affect EXE projects.)
There are still 14 items on the list which prevent 6.0 from running out of the door. Therefore I wish I could fix them all during the Chinese New Year holidays.
Stay tuned.
I'd like to set Firefox as my default web browser. However, then strange things happens. I cannot open an HTML file by double clicking it in Windows Explorer without a warning.
.NET has a similar issue. When you Process.Start() an HTML file, an exception is thrown. That's why in CBC I am forced to forward such calls to Internet Explorer directly.
But NetSpell library used in CBC does not work around this issue, so when you click the linked button in the following dialogue,
you must meet this exception dialogue,
Please remember to click Continue. Otherwise your IDE may be closed unexpectedly.
Stay tuned.
Today another change in RAD Studio is found during my test on CodeBeautifiers Plus. It seems that redo/undo mechanism is updated. Therefore now if you want to undo after Ctrl + W, you must press Ctrl + Z twice.
Also I received final reply from Anthony this morning. After tests, the result is perfect. Even though it is right now a internal build, I decide to release it in 6.0. You may consider it as a customized build of JCF 2.34.
Stay tuned.
Marco Cantu' has done an interesting post about online communities. It seems that as a C# developer I should join some professional network like LinkedIn. So now I add a button on this blog which links to my LinkedIn profile.
The profile is similar to my resume where I put all required information there. This is completely different from my Facebook profile which mainly focuses on my education.
I have been maintaining a Windows Forms application (Project E) for about 10 months since last April. The user interface was very complex because the original creator left so many lines of code inside event handlers.
Right now after countless rounds of refactorings, I successfully cut off most lines and move them into a low level layer. So I start to add unit tests to the low level layer in order to achieve automatic testing.
However, this is not what the marketing department wants. One message from our customers is that the user interface is not friendly enough compared to other Windows applications.
In order to avoid unpredictable consequences, I won't take the risks to publish a photo here to illustrate why that UI is bad. All I could tell is that every operation is done in a modal dialogue. So you always see a dialogue popping up and away.
That was the Win 9x way. Now on Windows XP and Windows Vista, Microsoft promotes more natural UI styles hard. Two examples are Visual Studio .NET and Office 2007.
After evaluation, I have to say Ribbon UI is much cooler but harder to achieve in a few weeks because there are so many rules to follow and all stable components are commercial. On the other hand, Visual Studio .NET style has been there for years so free components such as DockPanel Suite is stable enough. And our original design is only a few steps behind this approach.
In the last post I talked about my first day with DockPanel Suite. And unbelievably that today I was able to create a more complex demo with latest Project E source code checked out from our Vault. Because my first demo is based on an old version of Project E and I have written down steps I took carefully, I gained enough experience and found a few shortcuts.
The result is very promising so I may present it to my manager after the holidays.
Viruses can damage enterprise network. Even if they are not that harmful, one or two workstations may be damaged. Unluckily, my workstation broke down last week. Both Internet Explorer and Registry Editor are broken so I have to ask the IT guys for help. How I wish they could install a Windows Vista for me because UAC can filter out a lot of viruses and Trojans, but according to the corporate rules, Windows XP is a still the only choice.
Actually, there were another three guys whose workstations were down so IT guys helped all of us reinstall Windows. And I am the only one who restores development environment in a flash. How I achieve that? I just download Virtual PC 2007 installer again, install it, and then launch my old VM from within it. Now my Visual Studio 2005 is back with all other tools. Virtualization really saves me from reinstalling those beasts again.
BTW, because I did not install MSDN Library for Visual Studio 2005 in VM, now I can install MSDN Library for Visual Studio 2008 instead. I continue to install it outside VM in order to limit VM size as well as make updating it easier.
Virtual PC 2007 is enough if you only build Windows VMs. If you need to build Linux VMs, VirtualBox or VMware Server 1.x is required because Virtual PC does not support Linux well. If you can afford commercial tools, VMware Workstation 6 is fabulous.
Even though Windows Server 2008 will be virtualization enabled, I wonder if it can avoid harmful viruses in the future.
I joined BEAWorld 2007 Shanghai last December. Before that event, Oracle had already offered to buy BEA. And in January, BEA finally became an Oracle company. On the same day, SUN acquired MySQL. And today, Microsoft offers to buy Yahoo!.
I guess that was why Borland CEO said "Go big, or go home". However, we have seen Borland's continuous going down last year and wondered what would come in 2008.
This morning I received a mail from Anthony, JCF's author. Because he is so busy, a final reply is going to reach me maybe next week. And if you know Chinese culture, next Wednesday is Chinese New Year Eve. How I wish I could publish 6.o Final by then but nothing is settled down.
Stay tuned. I will keep you update.