printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget);
nsEventStatus PR_CALLBACK HandleEventGraphicPane(nsGUIEvent *aEvent){    printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget);    nsEventStatus result = nsEventStatus_eConsumeNoDefault;    switch(aEvent->message) {        case NS_PAINT:        {            nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext;            drawCtx->SetColor(aEvent->widget->GetBackgroundColor());            drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect));            return nsEventStatus_eConsumeNoDefault;        }        case NS_MOUSE_LEFT_BUTTON_DOWN:            aEvent->widget->SetFocus();            scribbleData.isDrawing = PR_TRUE;            scribbleData.mousePos = ((nsGUIEvent*)aEvent)->point;            return nsEventStatus_eConsumeNoDefault;        case NS_MOUSE_LEFT_BUTTON_UP:            scribbleData.isDrawing = PR_FALSE;            return nsEventStatus_eConsumeNoDefault;        case NS_MOUSE_MOVE:        {            if (scribbleData.isDrawing) {                nsIRenderingContext *drawCtx = aEvent->widget->GetRenderingContext();                drawCtx->SetColor(aEvent->widget->GetForegroundColor());                drawCtx->DrawLine(scribbleData.mousePos.x,                                   scribbleData.mousePos.y,                                  ((nsGUIEvent*)aEvent)->point.x,                                  ((nsGUIEvent*)aEvent)->point.y);                if (scribbleData.scribble->GetState())                   scribbleData.mousePos = ((nsGUIEvent*)aEvent)->point;                  NS_RELEASE(drawCtx);            }            return nsEventStatus_eConsumeNoDefault;        }    }    return nsEventStatus_eIgnore;}