diff --git a/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp b/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp index ac6dd6008c..230ab1b70e 100644 --- a/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp +++ b/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp @@ -2,7 +2,8 @@ #include 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) { font_height fontHeight; @@ -29,9 +30,7 @@ AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame) fRemoveButton->ResizeTo(buttonWidth,buttonHeight); fAddButton->ResizeTo(buttonWidth,buttonHeight); - fBox->AddChild(fAddButton); fAddButton->MoveTo(fBox->Bounds().Width() - 60 - fAddButton->Bounds().Width(),14); - fBox->AddChild(fRemoveButton); fRemoveButton->MoveTo(fAddButton->Frame().left,fAddButton->Frame().bottom); fListView = new BListView(Bounds(),"listview"); @@ -41,6 +40,8 @@ AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame) fScrollView = new BScrollView("scrollview",fListView,B_FOLLOW_ALL, B_FRAME_EVENTS|B_WILL_DRAW,false,true); fBox->AddChild(fScrollView); + fBox->AddChild(fAddButton); + fBox->AddChild(fRemoveButton); fBox->ResizeTo(Bounds().Width(),fScrollView->Frame().bottom+8); ResizeTo(fBox->Bounds().Width(),fBox->Bounds().Height()); } diff --git a/src/add-ons/tracker/filetype/AppTypeVersionInfoView.cpp b/src/add-ons/tracker/filetype/AppTypeVersionInfoView.cpp index 6f071821d1..97188fc768 100644 --- a/src/add-ons/tracker/filetype/AppTypeVersionInfoView.cpp +++ b/src/add-ons/tracker/filetype/AppTypeVersionInfoView.cpp @@ -1,10 +1,132 @@ #include +#include +#include AppTypeVersionInfoView::AppTypeVersionInfoView(BRect viewFrame) : BView(viewFrame, "AppTypeVersionInfoView", B_FOLLOW_ALL, 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) ); + + 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() diff --git a/src/add-ons/tracker/filetype/AppTypeVersionInfoView.h b/src/add-ons/tracker/filetype/AppTypeVersionInfoView.h index c8dd2acc2e..9dafefb134 100644 --- a/src/add-ons/tracker/filetype/AppTypeVersionInfoView.h +++ b/src/add-ons/tracker/filetype/AppTypeVersionInfoView.h @@ -19,29 +19,31 @@ public: bool IsClean() const; private: - BBox * fVersionInfoBox; - BMenu * fVersionKindMenu; - BMenuItem * fVersionApplicationMenuItem; - BMenuItem * fVersionSystemMenuItem; - BMenuField * fVersionKindMenuField; - BStringView * fVersionStringView; - BTextControl * fVersionMajorTextControl; - BTextControl * fVersionMiddleTextControl; - BTextControl * fVersionMinorTextControl; + BBox * fBox; + BMenu * fKindMenu; + BMenuItem * fApplicationMenuItem; + BMenuItem * fSystemMenuItem; + BMenuField * fKindMenuField; + BStringView * fStringView; + BTextControl * fMajorTextControl; + BStringView * fDot1StringView; + BTextControl * fMiddleTextControl; + BStringView * fDot2StringView; + BTextControl * fMinorTextControl; BMenu * fVarietyMenu; - BMenuItem * fVarietyDevelopmentMenuItem; - BMenuItem * fVarietyAlphaMenuItem; - BMenuItem * fVarietyBetaMenuItem; - BMenuItem * fVarietyGammaMenuItem; - BMenuItem * fVarietyGoldenMasterMenuItem; - BMenuItem * fVarietyFinalMenuItem; + BMenuItem * fDevelopmentMenuItem; + BMenuItem * fAlphaMenuItem; + BMenuItem * fBetaMenuItem; + BMenuItem * fGammaMenuItem; + BMenuItem * fGoldenMasterMenuItem; + BMenuItem * fFinalMenuItem; BMenuField * fVarietyMenuField; BStringView * fSlashStringView; BTextControl * fInternalTextControl; - BStringView * fShortDescriptionStringView; - BTextControl * fShortDescriptionTextControl; - BStringView * fLongDescriptionStringView; - BTextView * fLongDescriptionTextView; + BStringView * fShortStringView; + BTextControl * fShortTextControl; + BStringView * fLongStringView; + BTextView * fLongTextView; }; #endif // APP_TYPE_VERSION_INFO_VIEW_H diff --git a/src/add-ons/tracker/filetype/AppTypeView.cpp b/src/add-ons/tracker/filetype/AppTypeView.cpp index 526a33c61e..697ac69654 100644 --- a/src/add-ons/tracker/filetype/AppTypeView.cpp +++ b/src/add-ons/tracker/filetype/AppTypeView.cpp @@ -31,13 +31,16 @@ AppTypeView::AppTypeView(BRect viewFrame) BRect appSupportedTypesViewFrame = Bounds(); appSupportedTypesViewFrame.top = fAppFlagsView->Frame().bottom + 10; - appSupportedTypesViewFrame.left += 10; + appSupportedTypesViewFrame.left = appFlagsViewFrame.left; appSupportedTypesViewFrame.right -= 10; fSupportedTypesView = new AppTypeSupportedTypesView(appSupportedTypesViewFrame); AddChild(fSupportedTypesView); 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); AddChild(fVersionInfoView); }