version specification row, tab order fix
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4349 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame)
|
AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame)
|
||||||
: BView(viewFrame, "AppTypeSupportedTypesView", B_FOLLOW_ALL,
|
: BView(viewFrame, "AppTypeSupportedTypesView",
|
||||||
|
B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,
|
||||||
B_FRAME_EVENTS|B_WILL_DRAW)
|
B_FRAME_EVENTS|B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
@@ -29,9 +30,7 @@ AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame)
|
|||||||
fRemoveButton->ResizeTo(buttonWidth,buttonHeight);
|
fRemoveButton->ResizeTo(buttonWidth,buttonHeight);
|
||||||
fAddButton->ResizeTo(buttonWidth,buttonHeight);
|
fAddButton->ResizeTo(buttonWidth,buttonHeight);
|
||||||
|
|
||||||
fBox->AddChild(fAddButton);
|
|
||||||
fAddButton->MoveTo(fBox->Bounds().Width() - 60 - fAddButton->Bounds().Width(),14);
|
fAddButton->MoveTo(fBox->Bounds().Width() - 60 - fAddButton->Bounds().Width(),14);
|
||||||
fBox->AddChild(fRemoveButton);
|
|
||||||
fRemoveButton->MoveTo(fAddButton->Frame().left,fAddButton->Frame().bottom);
|
fRemoveButton->MoveTo(fAddButton->Frame().left,fAddButton->Frame().bottom);
|
||||||
|
|
||||||
fListView = new BListView(Bounds(),"listview");
|
fListView = new BListView(Bounds(),"listview");
|
||||||
@@ -41,6 +40,8 @@ AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame)
|
|||||||
fScrollView = new BScrollView("scrollview",fListView,B_FOLLOW_ALL,
|
fScrollView = new BScrollView("scrollview",fListView,B_FOLLOW_ALL,
|
||||||
B_FRAME_EVENTS|B_WILL_DRAW,false,true);
|
B_FRAME_EVENTS|B_WILL_DRAW,false,true);
|
||||||
fBox->AddChild(fScrollView);
|
fBox->AddChild(fScrollView);
|
||||||
|
fBox->AddChild(fAddButton);
|
||||||
|
fBox->AddChild(fRemoveButton);
|
||||||
fBox->ResizeTo(Bounds().Width(),fScrollView->Frame().bottom+8);
|
fBox->ResizeTo(Bounds().Width(),fScrollView->Frame().bottom+8);
|
||||||
ResizeTo(fBox->Bounds().Width(),fBox->Bounds().Height());
|
ResizeTo(fBox->Bounds().Width(),fBox->Bounds().Height());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,132 @@
|
|||||||
#include <AppTypeVersionInfoView.h>
|
#include <AppTypeVersionInfoView.h>
|
||||||
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
AppTypeVersionInfoView::AppTypeVersionInfoView(BRect viewFrame)
|
AppTypeVersionInfoView::AppTypeVersionInfoView(BRect viewFrame)
|
||||||
: BView(viewFrame, "AppTypeVersionInfoView", B_FOLLOW_ALL,
|
: BView(viewFrame, "AppTypeVersionInfoView", B_FOLLOW_ALL,
|
||||||
B_FRAME_EVENTS|B_WILL_DRAW)
|
B_FRAME_EVENTS|B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
|
font_height fontHeight;
|
||||||
|
GetFontHeight(&fontHeight);
|
||||||
|
float lineHeight = fontHeight.ascent+fontHeight.descent+fontHeight.leading;
|
||||||
SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) );
|
SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) );
|
||||||
|
|
||||||
|
fBox = new BBox(Bounds(),"box",B_FOLLOW_ALL);
|
||||||
|
fBox->SetLabel("Version Info:");
|
||||||
|
AddChild(fBox);
|
||||||
|
|
||||||
|
fKindMenu = new BMenu("kind");
|
||||||
|
fApplicationMenuItem = new BMenuItem("Application",NULL);
|
||||||
|
fKindMenu->AddItem(fApplicationMenuItem);
|
||||||
|
fSystemMenuItem = new BMenuItem("System",NULL);
|
||||||
|
fKindMenu->AddItem(fSystemMenuItem);
|
||||||
|
fKindMenu->SetRadioMode(true);
|
||||||
|
fKindMenu->SetLabelFromMarked(true);
|
||||||
|
fApplicationMenuItem->SetMarked(true);
|
||||||
|
|
||||||
|
fKindMenuField = new BMenuField(Bounds(),"kindField",NULL,fKindMenu);
|
||||||
|
const char * kindMenuLabel = "Version kind:";
|
||||||
|
float kindMenuStringWidth = StringWidth(kindMenuLabel);
|
||||||
|
fKindMenuField->SetLabel(kindMenuLabel);
|
||||||
|
fKindMenuField->SetDivider(kindMenuStringWidth+5);
|
||||||
|
float kindMenuFieldWidth = 0, kindMenuFieldHeight = 0;
|
||||||
|
fKindMenuField->GetPreferredSize(&kindMenuFieldWidth,&kindMenuFieldHeight);
|
||||||
|
fKindMenuField->ResizeTo(kindMenuFieldWidth,lineHeight+8);
|
||||||
|
fKindMenuField->MoveTo(8,10);
|
||||||
|
fBox->AddChild(fKindMenuField);
|
||||||
|
|
||||||
|
fStringView = new BStringView(Bounds(),"version","Version:");
|
||||||
|
float stringViewWidth = 0, stringViewHeight = 0;
|
||||||
|
fStringView->GetPreferredSize(&stringViewWidth,&stringViewHeight);
|
||||||
|
fStringView->ResizeTo(stringViewWidth,stringViewHeight);
|
||||||
|
fStringView->MoveTo(9,fKindMenuField->Frame().bottom+4);
|
||||||
|
fBox->AddChild(fStringView);
|
||||||
|
|
||||||
|
fMajorTextControl = new BTextControl(BRect(0,0,21,21),"major",NULL,NULL,NULL);
|
||||||
|
float majorTextControlWidth = 0, majorTextControlHeight = 0;
|
||||||
|
fMajorTextControl->GetPreferredSize(&majorTextControlWidth,&majorTextControlHeight);
|
||||||
|
fMajorTextControl->ResizeTo(20,majorTextControlHeight);
|
||||||
|
fMajorTextControl->MoveTo(fStringView->Frame().right,fStringView->Frame().top-2);
|
||||||
|
fBox->AddChild(fMajorTextControl);
|
||||||
|
|
||||||
|
fDot1StringView = new BStringView(Bounds(),"dot1",".");
|
||||||
|
float dot1stringViewWidth = 0, dot1stringViewHeight = 0;
|
||||||
|
fDot1StringView->GetPreferredSize(&dot1stringViewWidth,&dot1stringViewHeight);
|
||||||
|
fDot1StringView->ResizeTo(dot1stringViewWidth-2,dot1stringViewHeight);
|
||||||
|
fDot1StringView->MoveTo(fMajorTextControl->Frame().right+3,fStringView->Frame().top);
|
||||||
|
fBox->AddChild(fDot1StringView);
|
||||||
|
|
||||||
|
fMiddleTextControl = new BTextControl(BRect(0,0,21,21),"middle",NULL,NULL,NULL);
|
||||||
|
float middleTextControlWidth = 0, middleTextControlHeight = 0;
|
||||||
|
fMiddleTextControl->GetPreferredSize(&middleTextControlWidth,&middleTextControlHeight);
|
||||||
|
fMiddleTextControl->ResizeTo(20,middleTextControlHeight);
|
||||||
|
fMiddleTextControl->MoveTo(fDot1StringView->Frame().right,fStringView->Frame().top-2);
|
||||||
|
fBox->AddChild(fMiddleTextControl);
|
||||||
|
|
||||||
|
fDot2StringView = new BStringView(Bounds(),"dot2",".");
|
||||||
|
float dot2stringViewWidth = 0, dot2stringViewHeight = 0;
|
||||||
|
fDot2StringView->GetPreferredSize(&dot2stringViewWidth,&dot2stringViewHeight);
|
||||||
|
fDot2StringView->ResizeTo(dot2stringViewWidth-2,dot2stringViewHeight);
|
||||||
|
fDot2StringView->MoveTo(fMiddleTextControl->Frame().right+3,fStringView->Frame().top);
|
||||||
|
fBox->AddChild(fDot2StringView);
|
||||||
|
|
||||||
|
fMinorTextControl = new BTextControl(BRect(0,0,21,21),"minor",NULL,NULL,NULL);
|
||||||
|
float minorTextControlWidth = 0, minorTextControlHeight = 0;
|
||||||
|
fMinorTextControl->GetPreferredSize(&minorTextControlWidth,&minorTextControlHeight);
|
||||||
|
fMinorTextControl->ResizeTo(20,minorTextControlHeight);
|
||||||
|
fMinorTextControl->MoveTo(fDot2StringView->Frame().right,fStringView->Frame().top-2);
|
||||||
|
fBox->AddChild(fMinorTextControl);
|
||||||
|
|
||||||
|
float varietyMenuFieldWidth = 0;
|
||||||
|
fVarietyMenu = new BMenu("variety");
|
||||||
|
const char * developmentMenuItemLabel = "Development";
|
||||||
|
varietyMenuFieldWidth = max_c(StringWidth(developmentMenuItemLabel),varietyMenuFieldWidth);
|
||||||
|
fDevelopmentMenuItem = new BMenuItem(developmentMenuItemLabel,NULL);
|
||||||
|
fVarietyMenu->AddItem(fDevelopmentMenuItem);
|
||||||
|
const char * alphaMenuItemLabel = "Alpha";
|
||||||
|
varietyMenuFieldWidth = max_c(StringWidth(alphaMenuItemLabel),varietyMenuFieldWidth);
|
||||||
|
fAlphaMenuItem = new BMenuItem(alphaMenuItemLabel,NULL);
|
||||||
|
fVarietyMenu->AddItem(fAlphaMenuItem);
|
||||||
|
const char * betaMenuItemLabel = "Beta";
|
||||||
|
varietyMenuFieldWidth = max_c(StringWidth(betaMenuItemLabel),varietyMenuFieldWidth);
|
||||||
|
fBetaMenuItem = new BMenuItem(betaMenuItemLabel,NULL);
|
||||||
|
fVarietyMenu->AddItem(fBetaMenuItem);
|
||||||
|
const char * gammaMenuItemLabel = "Gamma";
|
||||||
|
varietyMenuFieldWidth = max_c(StringWidth(gammaMenuItemLabel),varietyMenuFieldWidth);
|
||||||
|
fGammaMenuItem = new BMenuItem(gammaMenuItemLabel,NULL);
|
||||||
|
fVarietyMenu->AddItem(fGammaMenuItem);
|
||||||
|
const char * goldenMasterMenuItemLabel = "Golden master";
|
||||||
|
varietyMenuFieldWidth = max_c(StringWidth(goldenMasterMenuItemLabel),varietyMenuFieldWidth);
|
||||||
|
fGoldenMasterMenuItem = new BMenuItem(goldenMasterMenuItemLabel,NULL);
|
||||||
|
fVarietyMenu->AddItem(fGoldenMasterMenuItem);
|
||||||
|
const char * finalMenuItemLabel = "Final";
|
||||||
|
varietyMenuFieldWidth = max_c(StringWidth(finalMenuItemLabel),varietyMenuFieldWidth);
|
||||||
|
fFinalMenuItem = new BMenuItem(finalMenuItemLabel,NULL);
|
||||||
|
fVarietyMenu->AddItem(fFinalMenuItem);
|
||||||
|
fVarietyMenu->SetRadioMode(true);
|
||||||
|
fVarietyMenu->SetLabelFromMarked(true);
|
||||||
|
fDevelopmentMenuItem->SetMarked(true);
|
||||||
|
|
||||||
|
fVarietyMenuField = new BMenuField(Bounds(),"varietyField",NULL,fVarietyMenu);
|
||||||
|
fVarietyMenuField->ResizeTo(varietyMenuFieldWidth+18,lineHeight+8);
|
||||||
|
fVarietyMenuField->MoveTo(fMinorTextControl->Frame().right+5,fStringView->Frame().top-3);
|
||||||
|
fBox->AddChild(fVarietyMenuField);
|
||||||
|
|
||||||
|
fSlashStringView = new BStringView(Bounds(),"slash","/");
|
||||||
|
float slashStringViewWidth = 0, slashStringViewHeight = 0;
|
||||||
|
fSlashStringView->GetPreferredSize(&slashStringViewWidth,&slashStringViewHeight);
|
||||||
|
fSlashStringView->ResizeTo(slashStringViewWidth,slashStringViewHeight);
|
||||||
|
fSlashStringView->MoveTo(fVarietyMenuField->Frame().right+5,fStringView->Frame().top);
|
||||||
|
fBox->AddChild(fSlashStringView);
|
||||||
|
|
||||||
|
fInternalTextControl = new BTextControl(BRect(0,0,21,21),"internal",NULL,NULL,NULL);
|
||||||
|
float internalTextControlWidth = 0, internalTextControlHeight = 0;
|
||||||
|
fInternalTextControl->GetPreferredSize(&internalTextControlWidth,&internalTextControlHeight);
|
||||||
|
fInternalTextControl->ResizeTo(20,internalTextControlHeight);
|
||||||
|
fInternalTextControl->MoveTo(fSlashStringView->Frame().right-2,fStringView->Frame().top-2);
|
||||||
|
fBox->AddChild(fInternalTextControl);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppTypeVersionInfoView::~AppTypeVersionInfoView()
|
AppTypeVersionInfoView::~AppTypeVersionInfoView()
|
||||||
|
|||||||
@@ -19,29 +19,31 @@ public:
|
|||||||
bool IsClean() const;
|
bool IsClean() const;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
BBox * fVersionInfoBox;
|
BBox * fBox;
|
||||||
BMenu * fVersionKindMenu;
|
BMenu * fKindMenu;
|
||||||
BMenuItem * fVersionApplicationMenuItem;
|
BMenuItem * fApplicationMenuItem;
|
||||||
BMenuItem * fVersionSystemMenuItem;
|
BMenuItem * fSystemMenuItem;
|
||||||
BMenuField * fVersionKindMenuField;
|
BMenuField * fKindMenuField;
|
||||||
BStringView * fVersionStringView;
|
BStringView * fStringView;
|
||||||
BTextControl * fVersionMajorTextControl;
|
BTextControl * fMajorTextControl;
|
||||||
BTextControl * fVersionMiddleTextControl;
|
BStringView * fDot1StringView;
|
||||||
BTextControl * fVersionMinorTextControl;
|
BTextControl * fMiddleTextControl;
|
||||||
|
BStringView * fDot2StringView;
|
||||||
|
BTextControl * fMinorTextControl;
|
||||||
BMenu * fVarietyMenu;
|
BMenu * fVarietyMenu;
|
||||||
BMenuItem * fVarietyDevelopmentMenuItem;
|
BMenuItem * fDevelopmentMenuItem;
|
||||||
BMenuItem * fVarietyAlphaMenuItem;
|
BMenuItem * fAlphaMenuItem;
|
||||||
BMenuItem * fVarietyBetaMenuItem;
|
BMenuItem * fBetaMenuItem;
|
||||||
BMenuItem * fVarietyGammaMenuItem;
|
BMenuItem * fGammaMenuItem;
|
||||||
BMenuItem * fVarietyGoldenMasterMenuItem;
|
BMenuItem * fGoldenMasterMenuItem;
|
||||||
BMenuItem * fVarietyFinalMenuItem;
|
BMenuItem * fFinalMenuItem;
|
||||||
BMenuField * fVarietyMenuField;
|
BMenuField * fVarietyMenuField;
|
||||||
BStringView * fSlashStringView;
|
BStringView * fSlashStringView;
|
||||||
BTextControl * fInternalTextControl;
|
BTextControl * fInternalTextControl;
|
||||||
BStringView * fShortDescriptionStringView;
|
BStringView * fShortStringView;
|
||||||
BTextControl * fShortDescriptionTextControl;
|
BTextControl * fShortTextControl;
|
||||||
BStringView * fLongDescriptionStringView;
|
BStringView * fLongStringView;
|
||||||
BTextView * fLongDescriptionTextView;
|
BTextView * fLongTextView;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // APP_TYPE_VERSION_INFO_VIEW_H
|
#endif // APP_TYPE_VERSION_INFO_VIEW_H
|
||||||
|
|||||||
@@ -31,13 +31,16 @@ AppTypeView::AppTypeView(BRect viewFrame)
|
|||||||
|
|
||||||
BRect appSupportedTypesViewFrame = Bounds();
|
BRect appSupportedTypesViewFrame = Bounds();
|
||||||
appSupportedTypesViewFrame.top = fAppFlagsView->Frame().bottom + 10;
|
appSupportedTypesViewFrame.top = fAppFlagsView->Frame().bottom + 10;
|
||||||
appSupportedTypesViewFrame.left += 10;
|
appSupportedTypesViewFrame.left = appFlagsViewFrame.left;
|
||||||
appSupportedTypesViewFrame.right -= 10;
|
appSupportedTypesViewFrame.right -= 10;
|
||||||
fSupportedTypesView = new AppTypeSupportedTypesView(appSupportedTypesViewFrame);
|
fSupportedTypesView = new AppTypeSupportedTypesView(appSupportedTypesViewFrame);
|
||||||
AddChild(fSupportedTypesView);
|
AddChild(fSupportedTypesView);
|
||||||
|
|
||||||
BRect versionInfoViewFrame = Bounds();
|
BRect versionInfoViewFrame = Bounds();
|
||||||
versionInfoViewFrame.top = Bounds().Height()/2;
|
versionInfoViewFrame.top = fSupportedTypesView->Frame().bottom + 10;
|
||||||
|
versionInfoViewFrame.left = appSupportedTypesViewFrame.left;
|
||||||
|
versionInfoViewFrame.right = appSupportedTypesViewFrame.right;
|
||||||
|
versionInfoViewFrame.bottom -= 10;
|
||||||
fVersionInfoView = new AppTypeVersionInfoView(versionInfoViewFrame);
|
fVersionInfoView = new AppTypeVersionInfoView(versionInfoViewFrame);
|
||||||
AddChild(fVersionInfoView);
|
AddChild(fVersionInfoView);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user