Made window resizable and increased min. window size.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16317 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer
2006-02-09 21:00:14 +00:00
parent 2a5bad1541
commit 2e84c057c0
@@ -120,14 +120,23 @@ AddPrinterView::AttachedToWindow()
{ {
/* protocol class box */ /* protocol class box */
BBox *box; BBox *box;
box = new BBox(PROTOCOL_CLASS_BOX_RECT); box = new BBox(PROTOCOL_CLASS_BOX_RECT, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
box->SetLabel("Protocol Classes:"); box->SetLabel("Protocol Classes:");
AddChild(box); AddChild(box);
/* protocol class */ /* protocol class */
fProtocolClassList = new BListView(PROTOCOL_CLASS_RECT, "protocolClassList"); fProtocolClassList = new BListView(
box->AddChild(new BScrollView("protocolClassListScroller", fProtocolClassList, PROTOCOL_CLASS_RECT,
B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true)); "protocolClassList",
B_SINGLE_SELECTION_LIST,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
box->AddChild(new BScrollView(
"protocolClassListScroller",
fProtocolClassList,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
0,
false,
true));
fProtocolClassList->SetSelectionMessage(new BMessage(kMsgProtocolClassChanged)); fProtocolClassList->SetSelectionMessage(new BMessage(kMsgProtocolClassChanged));
fProtocolClassList->SetTarget(this); fProtocolClassList->SetTarget(this);
@@ -146,27 +155,27 @@ AddPrinterView::AttachedToWindow()
} }
/* description of protocol class box */ /* description of protocol class box */
box = new BBox(DESCRIPTION_BOX_RECT); box = new BBox(DESCRIPTION_BOX_RECT, NULL, B_FOLLOW_ALL_SIDES);
box->SetLabel("Description:"); box->SetLabel("Description:");
AddChild(box); AddChild(box);
/* description of protocol class */ /* description of protocol class */
BRect textRect(DESCRIPTION_RECT); BRect textRect(DESCRIPTION_RECT);
textRect.OffsetTo(0, 0); textRect.OffsetTo(0, 0);
fDescription = new BTextView(DESCRIPTION_RECT, "description", textRect, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); fDescription = new BTextView(DESCRIPTION_RECT, "description", textRect, B_FOLLOW_ALL_SIDES, B_WILL_DRAW);
fDescription->SetViewColor(box->ViewColor()); fDescription->SetViewColor(box->ViewColor());
box->AddChild(new BScrollView("descriptionScroller", fDescription, box->AddChild(new BScrollView("descriptionScroller", fDescription,
B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true, B_NO_BORDER)); B_FOLLOW_ALL_SIDES, 0, false, true, B_NO_BORDER));
fDescription->MakeEditable(false); fDescription->MakeEditable(false);
/* cancel */ /* cancel */
BButton *button; BButton *button;
button = new BButton(CANCEL_RECT, "", CANCEL_TEXT, new BMessage(kMsgCancel)); button = new BButton(CANCEL_RECT, "", CANCEL_TEXT, new BMessage(kMsgCancel), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
AddChild(button); AddChild(button);
/* ok */ /* ok */
button = new BButton(OK_RECT, "", OK_TEXT, new BMessage(kMsgOK)); button = new BButton(OK_RECT, "", OK_TEXT, new BMessage(kMsgOK), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
AddChild(button); AddChild(button);
button->MakeDefault(true); button->MakeDefault(true);
@@ -211,9 +220,16 @@ AddPrinterView::Save()
AddPrinterDlg::AddPrinterDlg(PrinterData *printerData, const PrinterCap *printerCap) AddPrinterDlg::AddPrinterDlg(PrinterData *printerData, const PrinterCap *printerCap)
: DialogWindow(BRect(100, 100, 100 + DIALOG_WIDTH, 100 + DIALOG_HEIGHT), : DialogWindow(BRect(100, 100, 100 + DIALOG_WIDTH, 100 + DIALOG_HEIGHT),
"Add Printer", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, "Add Printer", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS) B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{ {
SetResult(B_ERROR); SetResult(B_ERROR);
// increase min. window size
float minWidth, maxWidth, minHeight, maxHeight;
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
minHeight = DIALOG_HEIGHT;
minWidth = DIALOG_WIDTH;
SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);
fAddPrinterView = new AddPrinterView(Bounds(), printerData, printerCap); fAddPrinterView = new AddPrinterView(Bounds(), printerData, printerCap);
AddChild(fAddPrinterView); AddChild(fAddPrinterView);