* use Ryan's new BAboutWindow class (also removed the hint that this app
originally was a birthday present for Ingo... hope he is Ok with that) * fixed ticket #1424, now it uses three empty buttons for new pads * cloned pads are now opened at an offset, otherwise one wouldn't have any visual feedback that something happened with a cloned pad on top of the original git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22055 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include "PadView.h"
|
||||
|
||||
// constructor
|
||||
MainWindow::MainWindow(const char* name, BRect frame)
|
||||
MainWindow::MainWindow(const char* name, BRect frame, bool addDefaultButtons)
|
||||
: BWindow(frame, name,
|
||||
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
|
||||
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
||||
@@ -36,15 +36,19 @@ MainWindow::MainWindow(const char* name, BRect frame)
|
||||
fSettings(new BMessage('sett')),
|
||||
fPadView(new PadView("pad view")),
|
||||
fLastID(0),
|
||||
fNamePanelFrame(-1000.0, -1000.0, -900.0, -900.0),
|
||||
fNamePanelFrame(-1000.0, -1000.0, -800.0, -900.0),
|
||||
fAutoRaise(false),
|
||||
fShowOnAllWorkspaces(true)
|
||||
{
|
||||
bool buttonsAdded = false;
|
||||
if (load_settings(fSettings, "main_settings", "LaunchBox") >= B_OK)
|
||||
buttonsAdded = LoadSettings(fSettings);
|
||||
if (!buttonsAdded)
|
||||
_AddDefaultButtons();
|
||||
if (!buttonsAdded) {
|
||||
if (addDefaultButtons)
|
||||
_AddDefaultButtons();
|
||||
else
|
||||
_AddEmptyButtons();
|
||||
}
|
||||
|
||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||
AddChild(fPadView);
|
||||
@@ -65,7 +69,7 @@ MainWindow::MainWindow(const char* name, BRect frame, BMessage* settings)
|
||||
fShowOnAllWorkspaces(true)
|
||||
{
|
||||
if (!LoadSettings(settings))
|
||||
_AddDefaultButtons();
|
||||
_AddEmptyButtons();
|
||||
|
||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||
AddChild(fPadView);
|
||||
@@ -474,6 +478,7 @@ MainWindow::_AdjustLocation(BRect frame)
|
||||
ResizeTo(frame.Width(), frame.Height());
|
||||
}
|
||||
|
||||
// _AddDefaultButtons
|
||||
void
|
||||
MainWindow::_AddDefaultButtons()
|
||||
{
|
||||
@@ -514,4 +519,21 @@ MainWindow::_AddDefaultButtons()
|
||||
button->SetTo("application/x-vnd.Haiku-Terminal", true);
|
||||
}
|
||||
|
||||
// _AddEmptyButtons
|
||||
void
|
||||
MainWindow::_AddEmptyButtons()
|
||||
{
|
||||
LaunchButton* button = new LaunchButton("launch button", fLastID++, NULL,
|
||||
new BMessage(MSG_LAUNCH));
|
||||
fPadView->AddButton(button);
|
||||
|
||||
button = new LaunchButton("launch button", fLastID++, NULL,
|
||||
new BMessage(MSG_LAUNCH));
|
||||
fPadView->AddButton(button);
|
||||
|
||||
button = new LaunchButton("launch button", fLastID++, NULL,
|
||||
new BMessage(MSG_LAUNCH));
|
||||
fPadView->AddButton(button);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user