Roy Tang

Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart.

Blog Notes Photos Links Archives About

All entries tagged questions.

You can subscribe to an RSS feed of this list.

Jun 2009

  • Given the code below:

    function test() {
        document.forms[0].TEST[0].focus();
    }
    
    <form>
        <input type="button" value="Test" onclick="test()" />
        <input type="radio" name="TEST" value="A">A
        <input type="radio" name="TEST" value="B">B
    </form>
    

    In IE6, clicking the button doesn’t focus the control, unless I’ve already tabbed through the radio at least once, in which case it works. =/

    Any idea how I should be focusing the control? The above works perfectly fine in FF of course.

    Edit: I found that the control is being focused, except the highlight box around the radio button is not being rendered. (I can hit space to activate the radio button, and also use arrow keys to change the active button). So the question becomes: how can I force the focus highlighting box to render?

Apr 2009

  • I’m experimenting with wx.aui.AuiNotebook; is there a way I can prevent particular tabs from being closed? i.e. I have an app that allows the user to create multiple tabs in an AuiNotebook, but the first 2 tabs are system managed and I don’t want them to be closed.

    Also, in a close event, can I get the window object attached to the tab being closed? (to extract data from it)

Jan 2009

Dec 2008

  • I’m not sure if this a settings problem or an HTML problem, but on a page layout I’m working on, Firefox does not render the stylesheet immediately. Meaning for maybe half a second I can see the unstyled page, then the stylesheet kicks in and it renders as I expect.

    All my stylesheets are in external css files loaded in the head tag. I’m not encountering this on Flock (which is a Firefox variant) nor on Google Chrome/IE.

    Any idea how to avoid it?

Oct 2008

  • In my program, I have been receiving an error when I use a command-line compile command for mxmlc. The error is related to an embedded font name not being correctly identified by flex in the system fonts list.

    However, on a whim, I decided to copy the code to Flex Builder and compile it there. To my surprise, it worked, and it found the proper font using the same system name I had given (PMingLiU).

    I suspected my problem may be a locale one, and that my system cannot correctly identify the font name because of locale considerations.

    I’ve tried setting the locale of the compile code to en_US, to no avail. So I would like to ask if anyone here knows how exactly Flex Builder invokes the MXML compiler and what differences there are compared to running mxmlc directly? We know it’s not using the mxmlc.exe directly, since we tried replacing mxmlc with our own executable to capture the command line parameters.

    If it matters, the OS used is Windows XP.

  • I need to parse a large amount of text that uses HTML font tags for formatting,

    For example:

    <font face="fontname" ...>Some text</font>
    

    Specifically, I need to determine which characters would be rendered using each font used in the text. I need to be able to handle stuff like font tags inside another font tag.

    I need to use C# for this. Is there some sort of C# parser class to make this easier? Or would I have to write it myself?

    Thanks!

Sep 2008

  • I’m writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throw a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn’t find any specific advice on what to do regarding this error, or how to avoid it. From Googling it looks like something to do with the message queue or Single-Threaded Apartments. Or am I way off?

    Example of the error message is:

    System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED))
    at Microsoft.Office.Interop.PowerPoint._Presentation.get_FullName()

    Unfortunately, the problem is occurring on a client’s machine, so I have no easy way to debug it! Should I just retry the calls whenever I get this error?

    Any advice to help me resolve this problem would be greatly appreciated!