void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext) { nsIView* textView; mTextFrame->GetView(&textView); if (nsnull == textView) { return; } nsIWidget* widget; mTextFrame->GetWidget(&widget); if (!widget) { return; }  nsITextWidget* textWidget; nsresult result = widget->QueryInterface(kITextWidgetIID, (void**)&textWidget); if (NS_OK != result) { NS_RELEASE(widget); return; }  nsIView*   parentView; textView->GetParent(parentView); nsIWidget* parentWidget = GetWindowTemp(parentView);  nsIFileWidget *fileWidget;  nsString title("FileWidget Title <here> mode = save"); nsRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);  nsString titles[] = {"all files"}; nsString filters[] = {"*.*"}; fileWidget->SetFilterList(1, titles, filters);  fileWidget->Create(parentWidget, title, eMode_load, nsnull, nsnull); result = fileWidget->Show();  if (result) { PRUint32 size; nsString fileName; fileWidget->GetFile(fileName); textWidget->SetText(fileName,size); } NS_RELEASE(fileWidget); NS_RELEASE(parentWidget); NS_RELEASE(textWidget); NS_RELEASE(widget); }
virtual void MouseClicked(nsIPresContext* aPresContext) {}
void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext){  nsIView* textView;  mTextFrame->GetView(&textView);  if (nsnull == textView) {    return;  }  nsIWidget* widget;  mTextFrame->GetWidget(&widget);  if (!widget) {    return;  }   nsITextWidget* textWidget;  nsresult result = widget->QueryInterface(kITextWidgetIID, (void**)&textWidget);  if (NS_OK != result) {    NS_RELEASE(widget);    return;  }    nsIView*   parentView;  textView->GetParent(parentView);  nsIWidget* parentWidget = GetWindowTemp(parentView);   nsIFileWidget *fileWidget;  nsString title("FileWidget Title <here> mode = save");  nsRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);    nsString titles[] = {"all files"};  nsString filters[] = {"*.*"};  fileWidget->SetFilterList(1, titles, filters);  fileWidget->Create(parentWidget, title, eMode_load, nsnull, nsnull);  result = fileWidget->Show();  if (result) {    PRUint32 size;    nsString fileName;    fileWidget->GetFile(fileName);    textWidget->SetText(fileName,size);  }  NS_RELEASE(fileWidget);  NS_RELEASE(parentWidget);  NS_RELEASE(textWidget);  NS_RELEASE(widget);}