MagiWOL 3.00 (Beta 1)

Illustration

Although MagiWOL is not program that gets downloaded the most from these pages, it is definitely one that generates most of feedback. Good feedback from loyal users forced me to continue development and it is directly responsible for this beta.

Changes are:

  • No registry writes will be performed if application is not installed.
  • Double-click now wakes computer instead of editing entry.
  • Broadcast address now can be host name (useful for waking over Internet).
  • Lot of bug fixing.

Beta is available for download at https://www.medo64.com/magiwol/beta/.

Bingo

Strange thing just happened. I got same one-time password two times. First one I got in November last year and second one I received just now. Some would call it an error but I call it a warning.

Run away! Laws of physics do not apply here. Escape while you can.

P.S. I already heard best joke about this from friend in office: “Only Chuck Norris and you can get same one-time password twice.”

ToolStrip as Main Menu

Let’s take small project as an example. You need two or three options and you cram everything as root menu item. Since you like your users and your users like pictures, you additionally create toolbar with same options. Final toolbar has one-to-one mapping with menu. Now question is why do we need menu in first place?

Personally I see only one reason - keyboard accessibility. Toolbar might be nice but it will not allow us to use pure keyboard interface in order to select items. However, solution is simple. First we set KeyPreview=true on form itself and then we just handle Alt key:

private void MainForm_KeyDown(object sender, KeyEventArgs e) {
    switch (e.KeyData) {
        case Keys.Alt | Keys.Menu: {
            menu.Select();
            menuNew.Select();
            e.SuppressKeyPress = true;
            e.Handled = true;
        } break;
    }
}

This code acts upon Alt key press. First we need to select ToolStrip control and then we select first item (New, in this case) within it. If we just use Select on item it will look same, but keyboard arrows will not move selection between items.

Downside to this is handling shortcut keys. While MenuItem will allow us to set Ctrl+N as shortcut key same is not true for ToolStripButton. All shortcuts should be handled explicitly now (within MainForm_KeyDown event):

···
case Keys.Control | Keys.N:
    menuNew_Click(null, null);
    e.SuppressKeyPress = true;
    e.Handled = true;
    break;
···

Full code example is available here.

Everything Bothers IE

Illustration

Internet Explorer is not my primary browser anymore but I do use it occasionally. Of course I installed IE 9. And it got me angry.

First it complained about open programs that are preventing installation progress. I think that it basically just listed all processes running at my computer. What Visual Studio has to do with IE installation is everybody’s guess. And, of course, installation required restart. Why?

P.S. Once install is over, Internet Explorer 9 becomes pretty decent browser. It is quite similar to Chrome in philosophy and that is good thing.

Dirty Docs

Illustration

I usually like Google Docs. They are not full-blown editing tool and they will not replace Microsoft Office for me (at least not soon) but they offer quite a lot when it comes to editing documents from various locations. Your document goes where your browser is.

For reasons I will not get into, I had to do some automatic processing on one of my Google Docs textual documents. I created it with care, all headings were properly defined and most of text was of “Normal” style. It was made with clean export into HTML in mind.

Unfortunately export result was quite far from clean code. First thing is that all is in one line. Yes, this saves few bytes but it is pain in the ass if you need any manual editing of this document. Fortunately PSPad knows how to expand such code.

Biggest issue I have here is that everything is set via style-sheets. While I usually agree with that, Google overdid it this time. They added bunch of span tags all over place. Even when you have just “Normal” text, you can be sure that it will not stand without around it. Event bolds and italics will not get just and but they will have full-blown CSS definition.

I agree that this is not an issue if you just want to view it. However this makes any automatic processing of text real pain-in-the-ass. It definitely brings back memory of Microsoft FrontPage and it’s html mess.

P.S. No, ODT export is not solution - it is even bigger and dirtier.