9 #include <LayoutBuilder.h>
11 #include "constants.h"
12 #include "PoorManSiteView.h"
13 #include "PoorManWindow.h"
14 #include "PoorManApplication.h"
16 PoorManSiteView::PoorManSiteView(const char* name
)
17 : BView(name
, B_WILL_DRAW
, NULL
)
20 win
= ((PoorManApplication
*)be_app
)->GetPoorManWindow();
22 SetLayout(new BGroupLayout(B_VERTICAL
));
24 // Web Site Location BBox
25 BBox
* webSiteLocation
= new BBox("Web Location");
26 webSiteLocation
->SetLabel(STR_BBX_LOCATION
);
28 // Web Site Options BBox
29 BBox
* webSiteOptions
= new BBox("Web Options");
30 webSiteOptions
->SetLabel(STR_BBX_OPTIONS
);
32 // Send Directory List if No Index
33 fSendDir
= new BCheckBox("Send Dir", STR_CBX_DIR_LIST_LABEL
,
34 new BMessage(MSG_PREF_SITE_CBX_INDEX
));
35 // set the checkbox to the value the program has
36 SetSendDirValue(win
->DirListFlag());
38 // Web Directory Text Control
39 fWebDir
= new BTextControl(STR_TXT_DIRECTORY
, NULL
, NULL
);
40 SetWebDir(win
->WebDir());
42 // Select Web Directory Button
43 fSelectWebDir
= new BButton("Select Web Dir", STR_BTN_DIRECTORY
,
44 new BMessage(MSG_PREF_SITE_BTN_SELECT
));
46 // Index File Name Text Control
47 fIndexFileName
= new BTextControl(STR_TXT_INDEX
, NULL
, NULL
);
48 SetIndexFileName(win
->IndexFileName());
51 BGroupLayout
* webSiteLocationLayout
= new BGroupLayout(B_VERTICAL
, 0);
52 webSiteLocation
->SetLayout(webSiteLocationLayout
);
54 BGroupLayout
* webSiteOptionsLayout
= new BGroupLayout(B_VERTICAL
, 0);
55 webSiteOptions
->SetLayout(webSiteOptionsLayout
);
57 BLayoutBuilder::Group
<>(this, B_VERTICAL
)
58 .SetInsets(B_USE_WINDOW_SPACING
, B_USE_WINDOW_SPACING
,
59 B_USE_WINDOW_SPACING
, B_USE_DEFAULT_SPACING
)
60 .AddGroup(webSiteLocationLayout
)
61 .SetInsets(B_USE_ITEM_INSETS
)
62 .AddGrid(B_USE_SMALL_SPACING
, B_USE_SMALL_SPACING
)
63 .SetInsets(0, B_USE_ITEM_INSETS
, 0, 0)
64 .AddTextControl(fWebDir
, 0, 0, B_ALIGN_LEFT
, 1, 2)
65 .Add(fSelectWebDir
, 2, 1)
66 .AddTextControl(fIndexFileName
, 0, 2, B_ALIGN_LEFT
, 1, 2)
67 .SetColumnWeight(1, 10.f
)
70 .AddGroup(webSiteOptionsLayout
)
71 .SetInsets(B_USE_ITEM_INSETS
)
72 .AddStrut(B_USE_ITEM_SPACING
)
73 .AddGroup(B_HORIZONTAL
)