June 2004 - Posts

Download Visual Studio 2005 Beta 1

Only the Express editions are currently available for non-MSDN customers. Get it now! I'm downloading Visual C# Express.

“Within a few weeks, non-subscribers will also be able to order a copy of Beta 1 for a nominal fulfillment fee.”

 

Check out the Express contest on Channel 9!
It is a summer of express on Channel 9

Posted by aelij with no comments
Filed under: , ,

I Got Gmail!

I just got myself a Gmail account. Well, I must admit there has been a lot of hype about Gmail, but it really is great. So simple, so fast. It's not just about the size! (c:
Posted by aelij with no comments
Filed under:

RTL Mirroring in .NET 2.0/VS 2005

Apparently there's a new API method, Application.EnableRTLMirroring(), in the next version of the framework, which is supposed to handle the mirroring in Windows Forms for you.

There are rumors that the VS 2005 beta will be available for download by the end of next week. That would be nice, especially since I need the C# compiler with the generics for my thesis.

 

Update: After downloading the beta, I've expetimented a bit with this. The above method is changes the behavior of the RightToLeft property (they didn't do this by default so that currect apps would work as expected,) When setting a Form's RightToLeft Property to RightToLeft.Yes, it mirrors (even at the designer). This means that all the controls in the form inherit this behavior as well. This renders the RTL CommandBar useless (unless you need to deploy something right now), as Windows Forms 2.0 also has very nice customizable ToolStrip and MenuStrip controls, which can even mimic the look of the latest Office.

Posted by aelij with no comments
Filed under: , ,

Mirrored CommandBar

I've been working on a mirrored RTL (right-to-left) version of Lutz Roeder's great CommandBar control for Windows Forms. There's one problem left, which I haven't solved yet, so I'd appreciate any comment on the matter.

This is my tweaked CommandBar:

 

As you may have noticed, I have custom-drawn the MenuItems. Aren't round rectangles just swell? (c:

Nothing wrong in this picture, but take a look at the next one. The phenomena surfaces when you hover with the mouse from the second menu to the third. The menu text disappears, and the hottracking remains. This is obviously a mirroring issue.

 

You may find interest in Middle East MSDN's article about mirroring (there are a few useful mirrored controls downloadable there). Mirroring a Windows Forms control is easy:

protected override CreateParams CreateParams
{
    get
    {
        CreateParams CP;
        CP = base
.CreateParams;
        if(!base
.DesignMode)
            CP.ExStyle |= WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT;
        return
CP;
    }
}

protected override CreateParams CreateParams
{
    get
    {
        CreateParams CP;
        CP = base
.CreateParams;
        if(!base
.DesignMode)
            CP.ExStyle |= WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT;
        return
CP;
    }
}

protected override CreateParams CreateParams
{
    get
    {
        CreateParams CP;
        CP = base
.CreateParams;
        if(!base
.DesignMode)
            CP.ExStyle |= WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT;
        return
CP;
    }
}

public const int WS_EX_LAYOUTRTL = 0x400000;
public const int WS_EX_NOINHERITLAYOUT = 0x100000;

const int WS_EX_LAYOUTRTL = 0x400000;
public const int WS_EX_NOINHERITLAYOUT = 0x100000;

 

You can also create a property to control this.

The above problem could be a bug in GDI+. I started to suspect that it was the culprit when the menu image, which was drawn using Graphics.DrawImage, appeared on the left side. In mirroring, the entire coordinate system of a window changes, so if you specify a point (x,y), the x would be the distance from the right, not from the left. Lutz used a function from ImageList (using P/Invoke) called ImageList_DrawIndirect to draw the “disabled” image, and I noticed they were drawn correctly. So I copied the code to the non-disabled part as well, and it worked. The bottom line is, that the Framework's DrawImage method couldn't handle a mirrored control, which made me wonder if this is the reason for the bug described above.

Wow, that was a long post. I hope it was clear enough. I will be releasing the source code here as soon as I get it working. I haven't found an RTL [Command/Re/Cool/]Bar for .NET anywhere else...

Posted by aelij with no comments
Filed under: ,

Unison

I just noticed there were n Unison posts. This is a great opportonity to present Björk, my favorite singer.

Unison is actually the name of one of her songs. The Royal Opera House version of it is downloadable from her website. I should say that the entire ROH DVD is divine...

This is my desktop's wallpaper (from the Vespertine CD):

 

Björk expresses so wide an emotional range in her music, that you could find something for any mood. She will soothe, vibrate, enthuse, and carry you to new places in your mind. Just give her a chance. (c:

Posted by aelij with no comments
Filed under:

I haven't written here for a while

The end of my last semester at the Open University is nigh, so I don't have much time for extracurricular activities.

Since I haven't mentioned it before, I'm studying for a B.A. in Computer Science. Last chores for this semester:

  • Compilation project (quite simple).
  • Prolog/”AI” project (game or some expert system). I haven't chosen a topic yet.
  • Programming Languages project: “Generics in the C# Language and the CLR“. In this thesis I will examine the implementation of generics in .NET, compare it to other languages, and implement generics in the Mono C# compiler (unlike the Microsoft generics, this will be C++/Java-style, i.e. not in the Mono CLR, which is inferior, but much less work. :-) BTW, if you're interested in PLs, you should check out Lambda the Ultimate, a most up-to-date blog on these matters, which is managed by my professor.
Posted by aelij with no comments
Filed under: , , , ,

Think in Ink Contest Winners Announced

Microsoft finally announced the winners in the DYCTII contest (I got tired of writing the full name :). But they only mentioned the first two winning categories, so I'm not there :|. Anyway, is there anyone interested in buying my VS.NET Enterprise Developer?

Posted by aelij with no comments
Filed under: ,
More Posts