Chat-O-Matic/application/windows/PreferencesWindow.cpp

66 lines
1.4 KiB
C++
Raw Normal View History

/*
* Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
*/
#include "PreferencesWindow.h"
#include <Button.h>
2021-07-19 09:54:27 -05:00
#include <Catalog.h>
#include <ControlLook.h>
#include <LayoutBuilder.h>
#include <TabView.h>
#include "PreferencesAccounts.h"
#include "PreferencesBehavior.h"
#include "PreferencesChatWindow.h"
#include "PreferencesReplicant.h"
2021-07-19 09:54:27 -05:00
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "PreferencesWindow"
const uint32 kApply = 'SAVE';
PreferencesWindow::PreferencesWindow()
2021-07-19 09:54:27 -05:00
: BWindow(BRect(0, 0, 500, 615), B_TRANSLATE("Preferences"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE)
{
BTabView* tabView = new BTabView("tabView", B_WIDTH_AS_USUAL);
tabView->AddTab(new PreferencesAccounts());
tabView->AddTab(new PreferencesBehavior());
tabView->AddTab(new PreferencesChatWindow());
tabView->AddTab(new PreferencesReplicant());
2021-07-19 09:54:27 -05:00
BButton* ok = new BButton(B_TRANSLATE("OK"), new BMessage(kApply));
BLayoutBuilder::Group<>(this, B_VERTICAL)
.Add(tabView)
.AddGroup(B_HORIZONTAL)
.AddGlue()
.Add(ok)
2021-05-30 22:04:45 -05:00
.End();
CenterOnScreen();
}
void
PreferencesWindow::MessageReceived(BMessage* msg)
{
switch (msg->what) {
case kApply:
Close();
break;
default:
BWindow::MessageReceived(msg);
}
}
2021-05-30 22:04:45 -05:00