more stuff
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4325 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -22,8 +22,8 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame)
|
|||||||
const char * singleRadioButtonLabel = "Single Launch";
|
const char * singleRadioButtonLabel = "Single Launch";
|
||||||
float singleRadioButtonStringWidth = StringWidth(singleRadioButtonLabel);
|
float singleRadioButtonStringWidth = StringWidth(singleRadioButtonLabel);
|
||||||
BRect singleRadioButtonFrame = fAppFlagsBox->Bounds();
|
BRect singleRadioButtonFrame = fAppFlagsBox->Bounds();
|
||||||
singleRadioButtonFrame.top += fAppFlagsCheckBox->Bounds().Height()/2 + 10;
|
singleRadioButtonFrame.top = fAppFlagsCheckBox->Bounds().Height()/2 + 10;
|
||||||
singleRadioButtonFrame.left += 10;
|
singleRadioButtonFrame.left = 10;
|
||||||
singleRadioButtonFrame.right -= 10;
|
singleRadioButtonFrame.right -= 10;
|
||||||
fAppFlagsSingleRadioButton = new BRadioButton(singleRadioButtonFrame,
|
fAppFlagsSingleRadioButton = new BRadioButton(singleRadioButtonFrame,
|
||||||
singleRadioButtonLabel,
|
singleRadioButtonLabel,
|
||||||
@@ -31,12 +31,13 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame)
|
|||||||
fAppFlagsBox->AddChild(fAppFlagsSingleRadioButton);
|
fAppFlagsBox->AddChild(fAppFlagsSingleRadioButton);
|
||||||
fAppFlagsSingleRadioButton->GetPreferredSize(&width,&height);
|
fAppFlagsSingleRadioButton->GetPreferredSize(&width,&height);
|
||||||
fAppFlagsSingleRadioButton->ResizeTo(width,height);
|
fAppFlagsSingleRadioButton->ResizeTo(width,height);
|
||||||
|
float leftWidth = width;
|
||||||
|
|
||||||
const char * multipleRadioButtonLabel = "Multiple Launch";
|
const char * multipleRadioButtonLabel = "Multiple Launch";
|
||||||
float multipleRadioButtonStringWidth = StringWidth(multipleRadioButtonLabel);
|
float multipleRadioButtonStringWidth = StringWidth(multipleRadioButtonLabel);
|
||||||
BRect multipleRadioButtonFrame = fAppFlagsBox->Bounds();
|
BRect multipleRadioButtonFrame = fAppFlagsBox->Bounds();
|
||||||
multipleRadioButtonFrame.top = fAppFlagsSingleRadioButton->Frame().bottom;
|
multipleRadioButtonFrame.top = fAppFlagsSingleRadioButton->Frame().bottom;
|
||||||
multipleRadioButtonFrame.left += 10;
|
multipleRadioButtonFrame.left = 10;
|
||||||
multipleRadioButtonFrame.right -= 10;
|
multipleRadioButtonFrame.right -= 10;
|
||||||
fAppFlagsMultipleRadioButton = new BRadioButton(multipleRadioButtonFrame,
|
fAppFlagsMultipleRadioButton = new BRadioButton(multipleRadioButtonFrame,
|
||||||
multipleRadioButtonLabel,
|
multipleRadioButtonLabel,
|
||||||
@@ -44,12 +45,13 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame)
|
|||||||
fAppFlagsBox->AddChild(fAppFlagsMultipleRadioButton);
|
fAppFlagsBox->AddChild(fAppFlagsMultipleRadioButton);
|
||||||
fAppFlagsMultipleRadioButton->GetPreferredSize(&width,&height);
|
fAppFlagsMultipleRadioButton->GetPreferredSize(&width,&height);
|
||||||
fAppFlagsMultipleRadioButton->ResizeTo(width,height);
|
fAppFlagsMultipleRadioButton->ResizeTo(width,height);
|
||||||
|
if (width > leftWidth) leftWidth = width;
|
||||||
|
|
||||||
const char * exclusiveRadioButtonLabel = "Exclusive Launch";
|
const char * exclusiveRadioButtonLabel = "Exclusive Launch";
|
||||||
float exclusiveRadioButtonStringWidth = StringWidth(exclusiveRadioButtonLabel);
|
float exclusiveRadioButtonStringWidth = StringWidth(exclusiveRadioButtonLabel);
|
||||||
BRect exclusiveRadioButtonFrame = fAppFlagsBox->Bounds();
|
BRect exclusiveRadioButtonFrame = fAppFlagsBox->Bounds();
|
||||||
exclusiveRadioButtonFrame.top = fAppFlagsMultipleRadioButton->Frame().bottom;
|
exclusiveRadioButtonFrame.top = fAppFlagsMultipleRadioButton->Frame().bottom;
|
||||||
exclusiveRadioButtonFrame.left += 10;
|
exclusiveRadioButtonFrame.left = 10;
|
||||||
exclusiveRadioButtonFrame.right -= 10;
|
exclusiveRadioButtonFrame.right -= 10;
|
||||||
fAppFlagsExclusiveRadioButton = new BRadioButton(exclusiveRadioButtonFrame,
|
fAppFlagsExclusiveRadioButton = new BRadioButton(exclusiveRadioButtonFrame,
|
||||||
exclusiveRadioButtonLabel,
|
exclusiveRadioButtonLabel,
|
||||||
@@ -57,8 +59,37 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame)
|
|||||||
fAppFlagsBox->AddChild(fAppFlagsExclusiveRadioButton);
|
fAppFlagsBox->AddChild(fAppFlagsExclusiveRadioButton);
|
||||||
fAppFlagsExclusiveRadioButton->GetPreferredSize(&width,&height);
|
fAppFlagsExclusiveRadioButton->GetPreferredSize(&width,&height);
|
||||||
fAppFlagsExclusiveRadioButton->ResizeTo(width,height);
|
fAppFlagsExclusiveRadioButton->ResizeTo(width,height);
|
||||||
|
if (width > leftWidth) leftWidth = width;
|
||||||
|
|
||||||
|
const char * argvOnlyCheckBoxLabel = "Argv Only";
|
||||||
|
float argvOnlyCheckBoxStringWidth = StringWidth(argvOnlyCheckBoxLabel);
|
||||||
|
BRect argvOnlyCheckBoxFrame = fAppFlagsBox->Bounds();
|
||||||
|
argvOnlyCheckBoxFrame.top = fAppFlagsSingleRadioButton->Frame().top - 1;
|
||||||
|
argvOnlyCheckBoxFrame.left = 10 + leftWidth;
|
||||||
|
argvOnlyCheckBoxFrame.right -= 10;
|
||||||
|
fAppFlagsArgvOnlyCheckBox = new BCheckBox(argvOnlyCheckBoxFrame,
|
||||||
|
argvOnlyCheckBoxLabel,
|
||||||
|
argvOnlyCheckBoxLabel,NULL);
|
||||||
|
fAppFlagsBox->AddChild(fAppFlagsArgvOnlyCheckBox);
|
||||||
|
fAppFlagsArgvOnlyCheckBox->GetPreferredSize(&width,&height);
|
||||||
|
fAppFlagsArgvOnlyCheckBox->ResizeTo(width,height);
|
||||||
|
float rightWidth = width;
|
||||||
|
|
||||||
width = fAppFlagsBox->Bounds().Width();
|
const char * backgroundCheckBoxLabel = "Background App";
|
||||||
|
float backgroundCheckBoxStringWidth = StringWidth(backgroundCheckBoxLabel);
|
||||||
|
BRect backgroundCheckBoxFrame = fAppFlagsBox->Bounds();
|
||||||
|
backgroundCheckBoxFrame.top = fAppFlagsArgvOnlyCheckBox->Frame().bottom - 1;
|
||||||
|
backgroundCheckBoxFrame.left = 10 + leftWidth;
|
||||||
|
backgroundCheckBoxFrame.right -= 10;
|
||||||
|
fAppFlagsBackgroundCheckBox = new BCheckBox(backgroundCheckBoxFrame,
|
||||||
|
backgroundCheckBoxLabel,
|
||||||
|
backgroundCheckBoxLabel,NULL);
|
||||||
|
fAppFlagsBox->AddChild(fAppFlagsBackgroundCheckBox);
|
||||||
|
fAppFlagsBackgroundCheckBox->GetPreferredSize(&width,&height);
|
||||||
|
fAppFlagsBackgroundCheckBox->ResizeTo(width,height);
|
||||||
|
if (width > rightWidth) rightWidth = width;
|
||||||
|
|
||||||
|
width = 10 + leftWidth + rightWidth + 5;
|
||||||
height = fAppFlagsExclusiveRadioButton->Frame().bottom + 5;
|
height = fAppFlagsExclusiveRadioButton->Frame().bottom + 5;
|
||||||
fAppFlagsBox->ResizeTo(width,height);
|
fAppFlagsBox->ResizeTo(width,height);
|
||||||
ResizeTo(width,height);
|
ResizeTo(width,height);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ private:
|
|||||||
BRadioButton * fAppFlagsMultipleRadioButton;
|
BRadioButton * fAppFlagsMultipleRadioButton;
|
||||||
BRadioButton * fAppFlagsExclusiveRadioButton;
|
BRadioButton * fAppFlagsExclusiveRadioButton;
|
||||||
BCheckBox * fAppFlagsArgvOnlyCheckBox;
|
BCheckBox * fAppFlagsArgvOnlyCheckBox;
|
||||||
BCheckBox * fAppFlagsBackOnlyCheckBox;
|
BCheckBox * fAppFlagsBackgroundCheckBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // APP_TYPE_APP_FLAGS_VIEW_H
|
#endif // APP_TYPE_APP_FLAGS_VIEW_H
|
||||||
|
|||||||
@@ -4,7 +4,29 @@ AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame)
|
|||||||
: BView(viewFrame, "AppTypeSupportedTypesView", B_FOLLOW_ALL,
|
: BView(viewFrame, "AppTypeSupportedTypesView", B_FOLLOW_ALL,
|
||||||
B_FRAME_EVENTS|B_WILL_DRAW)
|
B_FRAME_EVENTS|B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
|
float width = 0, height = 0;
|
||||||
SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) );
|
SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) );
|
||||||
|
|
||||||
|
fSupportedTypesBox = new BBox(Bounds(),"box",
|
||||||
|
B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP);
|
||||||
|
fSupportedTypesBox->SetLabel("Supported Types:");
|
||||||
|
AddChild(fSupportedTypesBox);
|
||||||
|
|
||||||
|
const char * addButtonLabel = "Add...";
|
||||||
|
float addButtonStringWidth = StringWidth(addButtonLabel);
|
||||||
|
BRect addButtonFrame = fSupportedTypesBox->Bounds();
|
||||||
|
addButtonFrame.top = 10;
|
||||||
|
addButtonFrame.left = 10;
|
||||||
|
addButtonFrame.right -= 10;
|
||||||
|
fSupportedTypesAddButton = new BButton(addButtonFrame,
|
||||||
|
addButtonLabel,
|
||||||
|
addButtonLabel,NULL);
|
||||||
|
fSupportedTypesBox->AddChild(fSupportedTypesAddButton);
|
||||||
|
fSupportedTypesAddButton->GetPreferredSize(&width,&height);
|
||||||
|
fSupportedTypesAddButton->ResizeTo(width,height);
|
||||||
|
float leftWidth = width;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppTypeSupportedTypesView::~AppTypeSupportedTypesView()
|
AppTypeSupportedTypesView::~AppTypeSupportedTypesView()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define APP_TYPE_SUPPORTED_TYPES_VIEW_H
|
#define APP_TYPE_SUPPORTED_TYPES_VIEW_H
|
||||||
|
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
|
#include <Button.h>
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ AppTypeView::AppTypeView(BRect viewFrame)
|
|||||||
fAppFlagsView = new AppTypeAppFlagsView(appFlagsViewFrame);
|
fAppFlagsView = new AppTypeAppFlagsView(appFlagsViewFrame);
|
||||||
AddChild(fAppFlagsView);
|
AddChild(fAppFlagsView);
|
||||||
|
|
||||||
|
BRect appSupportedTypesViewFrame = Bounds();
|
||||||
|
appSupportedTypesViewFrame.top = fAppFlagsView->Frame().bottom + 10;
|
||||||
|
appSupportedTypesViewFrame.left += 10;
|
||||||
|
appSupportedTypesViewFrame.right -= 10;
|
||||||
|
fSupportedTypesView = new AppTypeSupportedTypesView(appSupportedTypesViewFrame);
|
||||||
|
AddChild(fSupportedTypesView);
|
||||||
|
|
||||||
BRect versionInfoViewFrame = Bounds();
|
BRect versionInfoViewFrame = Bounds();
|
||||||
versionInfoViewFrame.top = Bounds().Height()/2;
|
versionInfoViewFrame.top = Bounds().Height()/2;
|
||||||
fVersionInfoView = new AppTypeVersionInfoView(versionInfoViewFrame);
|
fVersionInfoView = new AppTypeVersionInfoView(versionInfoViewFrame);
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ BFilePanel *
|
|||||||
FileTypeApp::OpenPanel()
|
FileTypeApp::OpenPanel()
|
||||||
{
|
{
|
||||||
if (fOpenPanel == 0) {
|
if (fOpenPanel == 0) {
|
||||||
fOpenPanel = new BFilePanel(B_OPEN_PANEL);
|
fOpenPanel = new BFilePanel(B_OPEN_PANEL,NULL,NULL,B_FILE_NODE|B_DIRECTORY_NODE);
|
||||||
}
|
}
|
||||||
return fOpenPanel;
|
return fOpenPanel;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user