fat: Greatly simplify and clean up dosfs_get_file_map().
[haiku.git] / src / preferences / dun / DetailsView.cpp
blob9d64f1a838b15794245bda0adcaa3a8a18b9d267
1 /*
3 DetailsView - View for Details
5 Author: Misza (misza@ihug.com.au)
7 (C) 2002 OpenBeOS under MIT license
9 */
12 #include "DetailsView.h"
14 using std::cout;
15 using std::endl;
17 DetailsView::DetailsView() :
18 BView(BRect(40,31,290,157),"detailsview",B_FOLLOW_NONE,B_WILL_DRAW)
20 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
22 BRect btnr = Bounds();
23 BRect texties(0,0,239,20);
24 phoneno = new BTextControl(texties,"phoneno","Phone number:",NULL,
25 new BMessage(CHANGE_PHONENO));
26 phoneno->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
27 phoneno->SetDivider(80);
28 AddChild(phoneno);
30 texties.OffsetBy(0,24);
31 username = new BTextControl(texties,"username","User name:",NULL,
32 new BMessage(CHANGE_USERNAME));
33 username->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
34 username->SetDivider(80);
36 AddChild(username);
38 texties.OffsetBy(0,24);
39 passwd = new BTextControl(texties,"passwd","Password:",NULL,
40 new BMessage(CHANGE_PASSWORD));
41 passwd->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
42 passwd->SetDivider(80);
43 //we don't want any people seeing our "3y3lurveBe05" password ;)
44 passwd->TextView()->HideTyping(true);
45 AddChild(passwd);
47 texties.OffsetBy(0,24);
48 texties.left += 82;
49 savepasswd = new BCheckBox(texties,"savepasswd","Save Password", new BMessage(SAVEPASSWORD),B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
50 savepasswd->SetLabel("Save Password");
51 AddChild(savepasswd);
53 btnr.right -= 8;
54 btnr.bottom -= 8;
55 btnr.top = btnr.bottom - 24;
56 btnr.left = btnr.right - 70;
58 settingsbtn = new BButton(btnr,"Settings","Settings" B_UTF8_ELLIPSIS", new BMessage(BTN_SETTINGS), B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
59 AddChild(settingsbtn);
61 void DetailsView::MessageReceived(BMessage* msg)
63 switch(msg->what)
65 case CHANGE_PHONENO:
66 case CHANGE_USERNAME:
67 case CHANGE_PASSWORD:
68 case SAVEPASSWORD:
70 cout << "\n\nPhone number: ";
71 cout << phoneno->Text();
72 cout << "\nUser name: ";
73 cout << username->Text();
74 cout << "\nPassword: ";
75 cout << passwd->Text();
76 cout << "\nSave Password? ";
77 if(savepasswd->Value() == B_CONTROL_ON)
79 cout << "YES\n" << endl;
80 else
81 cout << "NO\n" << endl;
82 break;
84 default:
85 BView::MessageReceived(msg);
86 break;
89 void DetailsView::AttachedToWindow()
91 phoneno->SetTarget(this);
92 username->SetTarget(this);
93 passwd->SetTarget(this);
94 savepasswd->SetTarget(this);