Ensure that text input is focused when window is shown.

Minor cleanups.
This commit is contained in:
Rene Gollent 2012-11-04 16:22:31 +01:00
parent ba4dad8b49
commit 862696d9bb
1 changed files with 6 additions and 2 deletions

View File

@ -38,6 +38,7 @@ PromptWindow::PromptWindow(const char* title, const char* label,
fTextControl->SetTarget(this); fTextControl->SetTarget(this);
acceptButton->SetTarget(this); acceptButton->SetTarget(this);
cancelButton->SetTarget(this); cancelButton->SetTarget(this);
fTextControl->MakeFocus(true);
} }
@ -70,12 +71,15 @@ PromptWindow::MessageReceived(BMessage* message)
status_t status_t
PromptWindow::SetTarget(BMessenger messenger) PromptWindow::SetTarget(BMessenger messenger)
{ {
return fTextControl->SetTarget(messenger); fTarget = messenger;
return B_OK;
} }
status_t status_t
PromptWindow::SetMessage(BMessage* message) PromptWindow::SetMessage(BMessage* message)
{ {
return fTextControl->SetMessage(message); delete fMessage;
fMessage = message;
return B_OK;
} }