|
|
|
@ -16,18 +16,43 @@
|
|
|
|
|
#include <ScreenSaver.h>
|
|
|
|
|
#include "MouseAreaView.h"
|
|
|
|
|
#include "PreviewView.h"
|
|
|
|
|
#include <Roster.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
const int32 zero=0;
|
|
|
|
|
|
|
|
|
|
void drawPositionalMonitor(BView *view,BRect areaToDrawIn,int state);
|
|
|
|
|
BView *drawSampleMonitor(BView *view, BRect area);
|
|
|
|
|
|
|
|
|
|
struct SSListItem {
|
|
|
|
|
BString fileName;
|
|
|
|
|
BString displayName;
|
|
|
|
|
BString fileName;
|
|
|
|
|
BString displayName;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void ScreenSaverWin::SaverSelected(void) {
|
|
|
|
|
if (ListView1->CurrentSelection()>=0) {
|
|
|
|
|
SSListItem* listItem;
|
|
|
|
|
if (previewDisplay->ScreenSaver())
|
|
|
|
|
previewDisplay->ScreenSaver()->StopConfig();
|
|
|
|
|
listItem = reinterpret_cast<SSListItem*>(AddonList->ItemAt(ListView1->CurrentSelection()));
|
|
|
|
|
BString settingsMsgName(listItem->fileName);
|
|
|
|
|
previewDisplay->SetScreenSaver(settingsMsgName);
|
|
|
|
|
if (settingsArea) {
|
|
|
|
|
ModuleSettingsBox->RemoveChild(settingsArea);
|
|
|
|
|
delete settingsArea;
|
|
|
|
|
}
|
|
|
|
|
BRect bnds=ModuleSettingsBox->Bounds();
|
|
|
|
|
bnds.InsetBy(5,10);
|
|
|
|
|
settingsArea=new BView(bnds,"settingsArea",B_FOLLOW_NONE,B_WILL_DRAW);
|
|
|
|
|
settingsArea->SetViewColor(216,216,216);
|
|
|
|
|
ModuleSettingsBox->AddChild(settingsArea);
|
|
|
|
|
|
|
|
|
|
if (previewDisplay->ScreenSaver())
|
|
|
|
|
previewDisplay->ScreenSaver()->StartConfig(settingsArea);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSaverWin::MessageReceived(BMessage *msg) {
|
|
|
|
|
SSListItem* listItem;
|
|
|
|
|
switch(msg->what) {
|
|
|
|
|
case PWBUTTON:
|
|
|
|
|
pwMessenger->SendMessage(SHOW);
|
|
|
|
@ -35,25 +60,18 @@ void ScreenSaverWin::MessageReceived(BMessage *msg) {
|
|
|
|
|
case B_QUIT_REQUESTED:
|
|
|
|
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
|
|
|
|
break;
|
|
|
|
|
case SAVER_SEL:
|
|
|
|
|
if (previewDisplay->ScreenSaver())
|
|
|
|
|
previewDisplay->ScreenSaver()->StopConfig();
|
|
|
|
|
listItem = reinterpret_cast<SSListItem*>(AddonList->ItemAt(ListView1->CurrentSelection()));
|
|
|
|
|
BString settingsMsgName(listItem->fileName);
|
|
|
|
|
previewDisplay->SetScreenSaver(settingsMsgName);
|
|
|
|
|
if (settingsArea) {
|
|
|
|
|
ModuleSettingsBox->RemoveChild(settingsArea);
|
|
|
|
|
delete settingsArea;
|
|
|
|
|
}
|
|
|
|
|
BRect bnds=ModuleSettingsBox->Bounds();
|
|
|
|
|
bnds.InsetBy(5,10);
|
|
|
|
|
settingsArea=new BView(bnds,"settingsArea",B_FOLLOW_NONE,B_WILL_DRAW);
|
|
|
|
|
settingsArea->SetViewColor(216,216,216);
|
|
|
|
|
ModuleSettingsBox->AddChild(settingsArea);
|
|
|
|
|
|
|
|
|
|
if (previewDisplay->ScreenSaver())
|
|
|
|
|
previewDisplay->ScreenSaver()->StartConfig(settingsArea);
|
|
|
|
|
break;
|
|
|
|
|
case SAVER_SEL:
|
|
|
|
|
SaverSelected();
|
|
|
|
|
break;
|
|
|
|
|
case TEST_BTN:
|
|
|
|
|
be_roster->Launch("application/x-vnd.OBOS-ScreenSaverApp",prefs.GetSettings());
|
|
|
|
|
break;
|
|
|
|
|
case ADD_BTN:
|
|
|
|
|
filePanel->Show();
|
|
|
|
|
break;
|
|
|
|
|
case UPDATELIST:
|
|
|
|
|
populateScreenSaverList();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
updateStatus(); // This could get called sometimes when it doesn't need to. Shouldn't hurt
|
|
|
|
|
BWindow::MessageReceived(msg);
|
|
|
|
@ -98,15 +116,21 @@ void ScreenSaverWin::updateStatus(void) {
|
|
|
|
|
if (selection>=0)
|
|
|
|
|
prefs.SetModuleName(((BStringItem *)(ListView1->ItemAt(selection)))->Text());
|
|
|
|
|
// TODO - Tell the password window to update its stuff
|
|
|
|
|
BMessage ssState;
|
|
|
|
|
if ((previewDisplay->ScreenSaver()) && (previewDisplay->ScreenSaver()->SaveState(&ssState)==B_OK))
|
|
|
|
|
prefs.SetState(&ssState);
|
|
|
|
|
prefs.SaveSettings();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void ScreenSaverWin::SetupForm(void) {
|
|
|
|
|
|
|
|
|
|
filePanel=new BFilePanel();
|
|
|
|
|
|
|
|
|
|
BRect r;
|
|
|
|
|
BView *background;
|
|
|
|
|
BTab *tab;
|
|
|
|
|
r = Bounds();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create a background view
|
|
|
|
|
background=new BView(r,"background",B_FOLLOW_NONE,0);
|
|
|
|
|
background->SetViewColor(216,216,216,0);
|
|
|
|
@ -120,6 +144,10 @@ void ScreenSaverWin::SetupForm(void) {
|
|
|
|
|
r.InsetBy(0,4);
|
|
|
|
|
r.bottom -= tabView->TabHeight();
|
|
|
|
|
|
|
|
|
|
// Time to load the settings into a message and implement them...
|
|
|
|
|
prefs.LoadSettings();
|
|
|
|
|
prefs.WindowFrame().PrintToStream();
|
|
|
|
|
|
|
|
|
|
tab = new BTab();
|
|
|
|
|
tabView->AddTab(tab2=new BView(r,"Fade",B_FOLLOW_NONE,0), tab);
|
|
|
|
|
tab->SetLabel("Fade");
|
|
|
|
@ -137,9 +165,7 @@ void ScreenSaverWin::SetupForm(void) {
|
|
|
|
|
pwWin=new pwWindow;
|
|
|
|
|
pwMessenger=new BMessenger (NULL,pwWin);
|
|
|
|
|
pwWin->Run();
|
|
|
|
|
// Time to load the settings into a message and implement them...
|
|
|
|
|
prefs.LoadSettings();
|
|
|
|
|
prefs.WindowFrame().PrintToStream();
|
|
|
|
|
|
|
|
|
|
MoveTo(prefs.WindowFrame().left,prefs.WindowFrame().top);
|
|
|
|
|
ResizeTo(prefs.WindowFrame().right-prefs.WindowFrame().left,prefs.WindowFrame().bottom-prefs.WindowFrame().top);
|
|
|
|
|
tabView->Select(prefs.WindowTab());
|
|
|
|
@ -152,10 +178,13 @@ void ScreenSaverWin::SetupForm(void) {
|
|
|
|
|
PasswordSlider->SetValue(secondsToSlider(prefs.PasswordTime()));
|
|
|
|
|
const BStringItem **ptr = (const BStringItem **)(ListView1->Items());
|
|
|
|
|
long count=ListView1->CountItems();
|
|
|
|
|
if (prefs.Password() && ptr)
|
|
|
|
|
if (prefs.ModuleName() && ptr)
|
|
|
|
|
for ( long i = 0; i < count; i++ ) {
|
|
|
|
|
if (BString(prefs.Password())==((*ptr++)->Text()))
|
|
|
|
|
if (BString(prefs.ModuleName())==((*ptr++)->Text())) {
|
|
|
|
|
ListView1->Select(count=i); // Clever bit here - intentional assignment.
|
|
|
|
|
SaverSelected();
|
|
|
|
|
ListView1->ScrollToSelection();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
updateStatus();
|
|
|
|
|
}
|
|
|
|
@ -188,162 +217,171 @@ void commonLookAndFeel(BView *widget,bool isSlider,bool isControl) {
|
|
|
|
|
|
|
|
|
|
// Iterate over a directory, adding the directories files to the list
|
|
|
|
|
void addScreenSaversToList (directory_which dir, BList *list) {
|
|
|
|
|
BPath path;
|
|
|
|
|
find_directory(dir,&path);
|
|
|
|
|
path.Append("Screen Savers",true);
|
|
|
|
|
BPath path;
|
|
|
|
|
find_directory(dir,&path);
|
|
|
|
|
path.Append("Screen Savers",true);
|
|
|
|
|
|
|
|
|
|
const char* pathName = path.Path();
|
|
|
|
|
const char* pathName = path.Path();
|
|
|
|
|
|
|
|
|
|
BDirectory ssDir(pathName);
|
|
|
|
|
BEntry thisSS;
|
|
|
|
|
char thisName[B_FILE_NAME_LENGTH];
|
|
|
|
|
BDirectory ssDir(pathName);
|
|
|
|
|
BEntry thisSS;
|
|
|
|
|
char thisName[B_FILE_NAME_LENGTH];
|
|
|
|
|
|
|
|
|
|
while (B_OK==ssDir.GetNextEntry(&thisSS,true)) {
|
|
|
|
|
thisSS.GetName(thisName);
|
|
|
|
|
SSListItem* tempListItem = new SSListItem;
|
|
|
|
|
tempListItem->fileName = pathName;
|
|
|
|
|
tempListItem->fileName += "/";
|
|
|
|
|
tempListItem->fileName += thisName;
|
|
|
|
|
tempListItem->displayName = thisName;
|
|
|
|
|
while (B_OK==ssDir.GetNextEntry(&thisSS,true)) {
|
|
|
|
|
thisSS.GetName(thisName);
|
|
|
|
|
SSListItem* tempListItem = new SSListItem;
|
|
|
|
|
tempListItem->fileName = pathName;
|
|
|
|
|
tempListItem->fileName += "/";
|
|
|
|
|
tempListItem->fileName += thisName;
|
|
|
|
|
tempListItem->displayName = thisName;
|
|
|
|
|
|
|
|
|
|
list->AddItem(tempListItem);
|
|
|
|
|
}
|
|
|
|
|
list->AddItem(tempListItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// sorting function for SSListItems
|
|
|
|
|
int compareSSListItems(const void* left, const void* right) {
|
|
|
|
|
SSListItem* leftItem = *(SSListItem **)left;
|
|
|
|
|
SSListItem* rightItem = *(SSListItem **)right;
|
|
|
|
|
SSListItem* leftItem = *(SSListItem **)left;
|
|
|
|
|
SSListItem* rightItem = *(SSListItem **)right;
|
|
|
|
|
|
|
|
|
|
return leftItem->displayName.Compare(rightItem->displayName);
|
|
|
|
|
return leftItem->displayName.Compare(rightItem->displayName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Add the strings in the BList to a BListView
|
|
|
|
|
void displayScreenSaversList(BList* list, BListView* view) {
|
|
|
|
|
list->SortItems(compareSSListItems);
|
|
|
|
|
void ScreenSaverWin::populateScreenSaverList(void) {
|
|
|
|
|
if (!AddonList)
|
|
|
|
|
AddonList = new BList;
|
|
|
|
|
else
|
|
|
|
|
for (void *i=AddonList->RemoveItem(zero);i;i=AddonList->RemoveItem(zero))
|
|
|
|
|
delete ((SSListItem *)i);
|
|
|
|
|
|
|
|
|
|
SSListItem* tempListItem = new SSListItem;
|
|
|
|
|
tempListItem->fileName = "";
|
|
|
|
|
tempListItem->displayName = "Blackness";
|
|
|
|
|
AddonList->AddItem(tempListItem);
|
|
|
|
|
addScreenSaversToList( B_BEOS_ADDONS_DIRECTORY, AddonList );
|
|
|
|
|
addScreenSaversToList( B_USER_ADDONS_DIRECTORY, AddonList );
|
|
|
|
|
AddonList->SortItems(compareSSListItems);
|
|
|
|
|
|
|
|
|
|
int numItems = list->CountItems();
|
|
|
|
|
for( int i = 0; i < numItems; ++i ) {
|
|
|
|
|
SSListItem* item = (SSListItem*)(list->ItemAt(i));
|
|
|
|
|
view->AddItem( new BStringItem(item->displayName.String()) );
|
|
|
|
|
}
|
|
|
|
|
// Add the strings in the BList to a BListView
|
|
|
|
|
ListView1->DeselectAll();
|
|
|
|
|
for (void *i=ListView1->RemoveItem(zero);i;i=ListView1->RemoveItem(zero))
|
|
|
|
|
delete ((BStringItem *)i);
|
|
|
|
|
|
|
|
|
|
int numItems = AddonList->CountItems();
|
|
|
|
|
for( int i = 0; i < numItems; ++i ) {
|
|
|
|
|
SSListItem* item = (SSListItem*)(AddonList->ItemAt(i));
|
|
|
|
|
ListView1->AddItem( new BStringItem(item->displayName.String()) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create the controls for the first tab
|
|
|
|
|
void ScreenSaverWin::setupTab1(void) {
|
|
|
|
|
int columns[4]={15,150,180,430};
|
|
|
|
|
int rows[6]={15,125,135,255,263,276};
|
|
|
|
|
int columns[4]={15,150,180,430};
|
|
|
|
|
int rows[6]={15,120,135,255,263,280};
|
|
|
|
|
|
|
|
|
|
{rgb_color clr = {216,216,216,255}; tab1->SetViewColor(clr);}
|
|
|
|
|
tab1->AddChild( ModuleSettingsBox = new BBox(BRect(columns[2],rows[0],columns[3],rows[5]),"ModuleSettingsBox",B_FOLLOW_NONE,B_WILL_DRAW));
|
|
|
|
|
ModuleSettingsBox->SetLabel("Module settings");
|
|
|
|
|
ModuleSettingsBox->SetBorder(B_FANCY_BORDER);
|
|
|
|
|
{rgb_color clr = {216,216,216,255}; tab1->SetViewColor(clr);}
|
|
|
|
|
tab1->AddChild( ModuleSettingsBox = new BBox(BRect(columns[2],rows[0],columns[3],rows[5]),"ModuleSettingsBox",B_FOLLOW_NONE,B_WILL_DRAW));
|
|
|
|
|
ModuleSettingsBox->SetLabel("Module settings");
|
|
|
|
|
ModuleSettingsBox->SetBorder(B_FANCY_BORDER);
|
|
|
|
|
|
|
|
|
|
ListView1 = new BListView(BRect(columns[0],rows[2],columns[1]+3,rows[3]),"ListView1",B_SINGLE_SELECTION_LIST);
|
|
|
|
|
tab1->AddChild(new BScrollView("scroll_list",ListView1,B_FOLLOW_NONE,0,false,true));
|
|
|
|
|
commonLookAndFeel(ModuleSettingsBox,false,false);
|
|
|
|
|
{rgb_color clr = {255,255,255,0}; ListView1->SetViewColor(clr);}
|
|
|
|
|
ListView1->SetListType(B_SINGLE_SELECTION_LIST);
|
|
|
|
|
ListView1 = new BListView(BRect(columns[0],rows[2],columns[1]+3,rows[3]),"ListView1",B_SINGLE_SELECTION_LIST);
|
|
|
|
|
tab1->AddChild(new BScrollView("scroll_list",ListView1,B_FOLLOW_NONE,0,false,true));
|
|
|
|
|
commonLookAndFeel(ModuleSettingsBox,false,false);
|
|
|
|
|
{rgb_color clr = {255,255,255,0}; ListView1->SetViewColor(clr);}
|
|
|
|
|
ListView1->SetListType(B_SINGLE_SELECTION_LIST);
|
|
|
|
|
|
|
|
|
|
// selection message for screensaver list
|
|
|
|
|
ListView1->SetSelectionMessage( new BMessage( SAVER_SEL ) );
|
|
|
|
|
// selection message for screensaver list
|
|
|
|
|
ListView1->SetSelectionMessage( new BMessage( SAVER_SEL ) );
|
|
|
|
|
|
|
|
|
|
tab1->AddChild( TestButton = new BButton(BRect(columns[0],rows[4],91,rows[5]),"TestButton","Test", new BMessage (TAB1_CHG)));
|
|
|
|
|
commonLookAndFeel(TestButton,false,true);
|
|
|
|
|
TestButton->SetLabel("Test");
|
|
|
|
|
tab1->AddChild( TestButton = new BButton(BRect(columns[0],rows[4],91,rows[5]),"TestButton","Test", new BMessage (TEST_BTN)));
|
|
|
|
|
commonLookAndFeel(TestButton,false,true);
|
|
|
|
|
TestButton->SetLabel("Test");
|
|
|
|
|
|
|
|
|
|
tab1->AddChild( AddButton = new BButton(BRect(97,rows[4],columns[2]-10,rows[5]),"AddButton","Add...", new BMessage (TAB1_CHG)));
|
|
|
|
|
commonLookAndFeel(AddButton,false,true);
|
|
|
|
|
AddButton->SetLabel("Add...");
|
|
|
|
|
tab1->AddChild( AddButton = new BButton(BRect(97,rows[4],columns[2]-10,rows[5]),"AddButton","Add...", new BMessage (ADD_BTN)));
|
|
|
|
|
commonLookAndFeel(AddButton,false,true);
|
|
|
|
|
AddButton->SetLabel("Add...");
|
|
|
|
|
|
|
|
|
|
tab1->AddChild(previewDisplay = new PreviewView(BRect(columns[0]+5,rows[0],columns[1],rows[1]),"preview",&prefs));
|
|
|
|
|
|
|
|
|
|
AddonList = new BList;
|
|
|
|
|
|
|
|
|
|
addScreenSaversToList( B_BEOS_ADDONS_DIRECTORY, AddonList );
|
|
|
|
|
addScreenSaversToList( B_USER_ADDONS_DIRECTORY, AddonList );
|
|
|
|
|
|
|
|
|
|
displayScreenSaversList( AddonList, ListView1 );
|
|
|
|
|
tab1->AddChild(previewDisplay = new PreviewView(BRect(columns[0]+5,rows[0],columns[1],rows[1]),"preview",&prefs));
|
|
|
|
|
populateScreenSaverList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create the controls for the second tab
|
|
|
|
|
void ScreenSaverWin::setupTab2(void) {
|
|
|
|
|
font_height stdFontHt;
|
|
|
|
|
be_plain_font->GetHeight(&stdFontHt);
|
|
|
|
|
int stringHeight=(int)(stdFontHt.ascent+stdFontHt.descent),sliderHeight=30;
|
|
|
|
|
int topEdge;
|
|
|
|
|
{rgb_color clr = {216,216,216,255}; tab2->SetViewColor(clr);}
|
|
|
|
|
tab2->AddChild( EnableScreenSaverBox = new BBox(BRect(11,13,437,280),"EnableScreenSaverBox"));
|
|
|
|
|
commonLookAndFeel(EnableScreenSaverBox,false,false);
|
|
|
|
|
font_height stdFontHt;
|
|
|
|
|
be_plain_font->GetHeight(&stdFontHt);
|
|
|
|
|
int stringHeight=(int)(stdFontHt.ascent+stdFontHt.descent),sliderHeight=30;
|
|
|
|
|
int topEdge;
|
|
|
|
|
{rgb_color clr = {216,216,216,255}; tab2->SetViewColor(clr);}
|
|
|
|
|
tab2->AddChild( EnableScreenSaverBox = new BBox(BRect(11,13,437,280),"EnableScreenSaverBox"));
|
|
|
|
|
commonLookAndFeel(EnableScreenSaverBox,false,false);
|
|
|
|
|
|
|
|
|
|
EnableCheckbox = new BCheckBox(BRect(0,0,90,stringHeight),"EnableCheckBox","Enable Screen Saver", new BMessage (TAB2_CHG));
|
|
|
|
|
EnableScreenSaverBox->SetLabel(EnableCheckbox);
|
|
|
|
|
EnableScreenSaverBox->SetBorder(B_FANCY_BORDER);
|
|
|
|
|
EnableCheckbox = new BCheckBox(BRect(0,0,90,stringHeight),"EnableCheckBox","Enable Screen Saver", new BMessage (TAB2_CHG));
|
|
|
|
|
EnableScreenSaverBox->SetLabel(EnableCheckbox);
|
|
|
|
|
EnableScreenSaverBox->SetBorder(B_FANCY_BORDER);
|
|
|
|
|
|
|
|
|
|
// Run Module
|
|
|
|
|
topEdge=26;
|
|
|
|
|
EnableScreenSaverBox->AddChild( StringView1 = new BStringView(BRect(21,topEdge,101,topEdge+stringHeight),"StringView1","Run module"));
|
|
|
|
|
commonLookAndFeel(StringView1,false,false);
|
|
|
|
|
StringView1->SetText("Run module");
|
|
|
|
|
StringView1->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
// Run Module
|
|
|
|
|
topEdge=26;
|
|
|
|
|
EnableScreenSaverBox->AddChild( StringView1 = new BStringView(BRect(21,topEdge,101,topEdge+stringHeight),"StringView1","Run module"));
|
|
|
|
|
commonLookAndFeel(StringView1,false,false);
|
|
|
|
|
StringView1->SetText("Run module");
|
|
|
|
|
StringView1->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( RunSlider = new BSlider(BRect(132,topEdge,415,topEdge+sliderHeight),"RunSlider","minutes", new BMessage(TAB2_CHG), 0, 25));
|
|
|
|
|
RunSlider->SetModificationMessage(new BMessage(TAB2_CHG));
|
|
|
|
|
commonLookAndFeel(RunSlider,true,true);
|
|
|
|
|
float w,h;
|
|
|
|
|
RunSlider->GetPreferredSize(&w,&h);
|
|
|
|
|
sliderHeight=(int)h;
|
|
|
|
|
EnableScreenSaverBox->AddChild( RunSlider = new BSlider(BRect(132,topEdge,415,topEdge+sliderHeight),"RunSlider","minutes", new BMessage(TAB2_CHG), 0, 25));
|
|
|
|
|
RunSlider->SetModificationMessage(new BMessage(TAB2_CHG));
|
|
|
|
|
commonLookAndFeel(RunSlider,true,true);
|
|
|
|
|
float w,h;
|
|
|
|
|
RunSlider->GetPreferredSize(&w,&h);
|
|
|
|
|
sliderHeight=(int)h;
|
|
|
|
|
|
|
|
|
|
// Turn Off
|
|
|
|
|
topEdge+=sliderHeight;
|
|
|
|
|
EnableScreenSaverBox->AddChild( TurnOffScreenCheckBox = new BCheckBox(BRect(9,topEdge,107,topEdge+stringHeight),"TurnOffScreenCheckBox","Turn off screen", new BMessage (TAB2_CHG)));
|
|
|
|
|
commonLookAndFeel(TurnOffScreenCheckBox,false,true);
|
|
|
|
|
TurnOffScreenCheckBox->SetLabel("Turn off screen");
|
|
|
|
|
TurnOffScreenCheckBox->SetResizingMode(B_FOLLOW_NONE);
|
|
|
|
|
// Turn Off
|
|
|
|
|
topEdge+=sliderHeight;
|
|
|
|
|
EnableScreenSaverBox->AddChild( TurnOffScreenCheckBox = new BCheckBox(BRect(9,topEdge,107,topEdge+stringHeight),"TurnOffScreenCheckBox","Turn off screen", new BMessage (TAB2_CHG)));
|
|
|
|
|
commonLookAndFeel(TurnOffScreenCheckBox,false,true);
|
|
|
|
|
TurnOffScreenCheckBox->SetLabel("Turn off screen");
|
|
|
|
|
TurnOffScreenCheckBox->SetResizingMode(B_FOLLOW_NONE);
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( TurnOffSlider = new BSlider(BRect(132,topEdge,415,topEdge+sliderHeight),"TurnOffSlider","", new BMessage(TAB2_CHG), 0, 25));
|
|
|
|
|
TurnOffSlider->SetModificationMessage(new BMessage(TAB2_CHG));
|
|
|
|
|
commonLookAndFeel(TurnOffSlider,true,true);
|
|
|
|
|
EnableScreenSaverBox->AddChild( TurnOffSlider = new BSlider(BRect(132,topEdge,415,topEdge+sliderHeight),"TurnOffSlider","", new BMessage(TAB2_CHG), 0, 25));
|
|
|
|
|
TurnOffSlider->SetModificationMessage(new BMessage(TAB2_CHG));
|
|
|
|
|
commonLookAndFeel(TurnOffSlider,true,true);
|
|
|
|
|
|
|
|
|
|
// Password
|
|
|
|
|
topEdge+=sliderHeight;
|
|
|
|
|
EnableScreenSaverBox->AddChild( PasswordCheckbox = new BCheckBox(BRect(9,topEdge,108,topEdge+stringHeight),"PasswordCheckbox","Password lock", new BMessage (TAB2_CHG)));
|
|
|
|
|
commonLookAndFeel(PasswordCheckbox,false,true);
|
|
|
|
|
PasswordCheckbox->SetLabel("Password lock");
|
|
|
|
|
// Password
|
|
|
|
|
topEdge+=sliderHeight;
|
|
|
|
|
EnableScreenSaverBox->AddChild( PasswordCheckbox = new BCheckBox(BRect(9,topEdge,108,topEdge+stringHeight),"PasswordCheckbox","Password lock", new BMessage (TAB2_CHG)));
|
|
|
|
|
commonLookAndFeel(PasswordCheckbox,false,true);
|
|
|
|
|
PasswordCheckbox->SetLabel("Password lock");
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( PasswordSlider = new BSlider(BRect(132,topEdge,415,topEdge+sliderHeight),"PasswordSlider","", new BMessage(TAB2_CHG), 0, 25));
|
|
|
|
|
PasswordSlider->SetModificationMessage(new BMessage(TAB2_CHG));
|
|
|
|
|
commonLookAndFeel(PasswordSlider,true,true);
|
|
|
|
|
EnableScreenSaverBox->AddChild( PasswordSlider = new BSlider(BRect(132,topEdge,415,topEdge+sliderHeight),"PasswordSlider","", new BMessage(TAB2_CHG), 0, 25));
|
|
|
|
|
PasswordSlider->SetModificationMessage(new BMessage(TAB2_CHG));
|
|
|
|
|
commonLookAndFeel(PasswordSlider,true,true);
|
|
|
|
|
|
|
|
|
|
topEdge+=sliderHeight;
|
|
|
|
|
EnableScreenSaverBox->AddChild( PasswordButton = new BButton(BRect(331,topEdge,405,topEdge+25),"PasswordButton","Password...", new BMessage (PWBUTTON)));
|
|
|
|
|
commonLookAndFeel(PasswordButton,false,true);
|
|
|
|
|
PasswordButton->SetLabel("Password...");
|
|
|
|
|
topEdge+=sliderHeight;
|
|
|
|
|
EnableScreenSaverBox->AddChild( PasswordButton = new BButton(BRect(331,topEdge,405,topEdge+25),"PasswordButton","Password...", new BMessage (PWBUTTON)));
|
|
|
|
|
commonLookAndFeel(PasswordButton,false,true);
|
|
|
|
|
PasswordButton->SetLabel("Password...");
|
|
|
|
|
|
|
|
|
|
// Bottom
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild(fadeNow=new MouseAreaView(BRect(20,205,80,260),"fadeNow"));
|
|
|
|
|
EnableScreenSaverBox->AddChild(fadeNever=new MouseAreaView(BRect(220,205,280,260),"fadeNever"));
|
|
|
|
|
EnableScreenSaverBox->AddChild(fadeNow=new MouseAreaView(BRect(20,205,80,260),"fadeNow"));
|
|
|
|
|
EnableScreenSaverBox->AddChild(fadeNever=new MouseAreaView(BRect(220,205,280,260),"fadeNever"));
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( FadeNowString = new BStringView(BRect(85,210,188,222),"FadeNowString","Fade now when"));
|
|
|
|
|
commonLookAndFeel(FadeNowString,false,false);
|
|
|
|
|
FadeNowString->SetText("Fade now when");
|
|
|
|
|
FadeNowString->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
EnableScreenSaverBox->AddChild( FadeNowString = new BStringView(BRect(85,210,188,222),"FadeNowString","Fade now when"));
|
|
|
|
|
commonLookAndFeel(FadeNowString,false,false);
|
|
|
|
|
FadeNowString->SetText("Fade now when");
|
|
|
|
|
FadeNowString->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( FadeNowString2 = new BStringView(BRect(85,225,188,237),"FadeNowString2","mouse is here"));
|
|
|
|
|
commonLookAndFeel(FadeNowString2,false,false);
|
|
|
|
|
FadeNowString2->SetText("mouse is here");
|
|
|
|
|
FadeNowString2->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
EnableScreenSaverBox->AddChild( FadeNowString2 = new BStringView(BRect(85,225,188,237),"FadeNowString2","mouse is here"));
|
|
|
|
|
commonLookAndFeel(FadeNowString2,false,false);
|
|
|
|
|
FadeNowString2->SetText("mouse is here");
|
|
|
|
|
FadeNowString2->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( DontFadeString = new BStringView(BRect(285,210,382,222),"DontFadeString","Don't fade when"));
|
|
|
|
|
commonLookAndFeel(DontFadeString,false,false);
|
|
|
|
|
DontFadeString->SetText("Don't fade when");
|
|
|
|
|
DontFadeString->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
EnableScreenSaverBox->AddChild( DontFadeString = new BStringView(BRect(285,210,382,222),"DontFadeString","Don't fade when"));
|
|
|
|
|
commonLookAndFeel(DontFadeString,false,false);
|
|
|
|
|
DontFadeString->SetText("Don't fade when");
|
|
|
|
|
DontFadeString->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
|
|
|
|
|
EnableScreenSaverBox->AddChild( DontFadeString2 = new BStringView(BRect(285,225,382,237),"DontFadeString2","mouse is here"));
|
|
|
|
|
commonLookAndFeel(DontFadeString2,false,false);
|
|
|
|
|
DontFadeString2->SetText("mouse is here");
|
|
|
|
|
DontFadeString2->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
EnableScreenSaverBox->AddChild( DontFadeString2 = new BStringView(BRect(285,225,382,237),"DontFadeString2","mouse is here"));
|
|
|
|
|
commonLookAndFeel(DontFadeString2,false,false);
|
|
|
|
|
DontFadeString2->SetText("mouse is here");
|
|
|
|
|
DontFadeString2->SetAlignment(B_ALIGN_LEFT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|