* Style changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39198 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer
2010-10-30 08:54:52 +00:00
parent 54336e821e
commit 299710a731
2 changed files with 69 additions and 46 deletions
+4 -2
View File
@@ -28,7 +28,8 @@ private:
class AddPrinterView : public BView {
public:
AddPrinterView(BRect frame, PrinterData *printer_data, const PrinterCap *printer_cap);
AddPrinterView(BRect frame, PrinterData* printerData,
const PrinterCap* printerCap);
~AddPrinterView();
virtual void AttachedToWindow();
void FrameResized(float w, float h);
@@ -48,7 +49,8 @@ private:
class AddPrinterDlg : public DialogWindow {
public:
AddPrinterDlg(PrinterData *printerData, const PrinterCap *printerCap);
AddPrinterDlg(PrinterData *printerData,
const PrinterCap *printerCap);
void MessageReceived(BMessage *msg);
private:
+38 -17
View File
@@ -86,12 +86,14 @@ enum MSGS {
kMsgProtocolClassChanged,
};
ProtocolClassItem::ProtocolClassItem(const ProtocolClassCap* cap)
: BStringItem(cap->fLabel.c_str())
, fProtocolClassCap(cap)
{
}
int
ProtocolClassItem::getProtocolClass()
{
@@ -105,26 +107,33 @@ ProtocolClassItem::getDescription()
}
AddPrinterView::AddPrinterView(BRect frame, PrinterData *printer_data, const PrinterCap *printer_cap)
: BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS), fPrinterData(printer_data), fPrinterCap(printer_cap)
AddPrinterView::AddPrinterView(BRect frame, PrinterData* printerData,
const PrinterCap* printerCap)
:
BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS),
fPrinterData(printerData),
fPrinterCap(printerCap)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
AddPrinterView::~AddPrinterView()
{
}
void
AddPrinterView::AttachedToWindow()
{
/* protocol class box */
// protocol class box
BBox *box;
box = new BBox(PROTOCOL_CLASS_BOX_RECT, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
box = new BBox(PROTOCOL_CLASS_BOX_RECT, NULL,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
box->SetLabel("Protocol Classes:");
AddChild(box);
/* protocol class */
// protocol class
fProtocolClassList = new BListView(
PROTOCOL_CLASS_RECT,
"protocolClassList",
@@ -137,11 +146,13 @@ AddPrinterView::AttachedToWindow()
0,
false,
true));
fProtocolClassList->SetSelectionMessage(new BMessage(kMsgProtocolClassChanged));
fProtocolClassList->SetSelectionMessage(
new BMessage(kMsgProtocolClassChanged));
fProtocolClassList->SetTarget(this);
int count = fPrinterCap->countCap(PrinterCap::kProtocolClass);
ProtocolClassCap **protocolClasses = (ProtocolClassCap **)fPrinterCap->enumCap(PrinterCap::kProtocolClass);
ProtocolClassCap **protocolClasses =
(ProtocolClassCap **)fPrinterCap->enumCap(PrinterCap::kProtocolClass);
while (count--) {
const ProtocolClassCap *protocolClass = *protocolClasses;
@@ -154,28 +165,30 @@ AddPrinterView::AttachedToWindow()
protocolClasses ++;
}
/* description of protocol class box */
// description of protocol class box
box = new BBox(DESCRIPTION_BOX_RECT, NULL, B_FOLLOW_ALL_SIDES);
box->SetLabel("Description:");
AddChild(box);
/* description of protocol class */
// description of protocol class
BRect textRect(DESCRIPTION_RECT);
textRect.OffsetTo(0, 0);
fDescription = new BTextView(DESCRIPTION_RECT, "description", textRect, B_FOLLOW_ALL_SIDES, B_WILL_DRAW);
fDescription = new BTextView(DESCRIPTION_RECT, "description", textRect,
B_FOLLOW_ALL_SIDES, B_WILL_DRAW);
fDescription->SetViewColor(box->ViewColor());
box->AddChild(new BScrollView("descriptionScroller", fDescription,
B_FOLLOW_ALL_SIDES, 0, false, true, B_NO_BORDER));
fDescription->MakeEditable(false);
/* cancel */
// cancel
BButton *button;
button = new BButton(CANCEL_RECT, "", CANCEL_TEXT, new BMessage(kMsgCancel), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
button = new BButton(CANCEL_RECT, "", CANCEL_TEXT, new BMessage(kMsgCancel),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
AddChild(button);
/* ok */
button = new BButton(OK_RECT, "", OK_TEXT, new BMessage(kMsgOK), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
// ok
button = new BButton(OK_RECT, "", OK_TEXT, new BMessage(kMsgOK),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
AddChild(button);
button->MakeDefault(true);
@@ -184,6 +197,7 @@ AddPrinterView::AttachedToWindow()
MessageReceived(&updateDescription);
}
void
AddPrinterView::FrameResized(float w, float h)
{
@@ -194,6 +208,7 @@ AddPrinterView::FrameResized(float w, float h)
fDescription->SetTextRect(rect);
}
ProtocolClassItem*
AddPrinterView::CurrentSelection()
{
@@ -204,6 +219,7 @@ AddPrinterView::CurrentSelection()
return NULL;
}
void
AddPrinterView::MessageReceived(BMessage* msg)
{
@@ -217,6 +233,7 @@ AddPrinterView::MessageReceived(BMessage *msg)
}
}
void
AddPrinterView::Save()
{
@@ -227,8 +244,11 @@ AddPrinterView::Save()
}
}
AddPrinterDlg::AddPrinterDlg(PrinterData *printerData, const PrinterCap *printerCap)
: DialogWindow(BRect(100, 100, 100 + DIALOG_WIDTH, 100 + DIALOG_HEIGHT),
AddPrinterDlg::AddPrinterDlg(PrinterData* printerData,
const PrinterCap *printerCap)
:
DialogWindow(BRect(100, 100, 100 + DIALOG_WIDTH, 100 + DIALOG_HEIGHT),
"Add Printer", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
@@ -245,6 +265,7 @@ AddPrinterDlg::AddPrinterDlg(PrinterData *printerData, const PrinterCap *printer
AddChild(fAddPrinterView);
}
void
AddPrinterDlg::MessageReceived(BMessage* msg)
{