874 | | BView *vw = w->ChildAt(0); |
875 | | FailNilMsg(vw, "Error building FilePanel"); |
| 874 | BView *background = savePanel->ChildAt(0); |
| 875 | FailNilMsg(background, "Error building FilePanel"); |
| 876 | |
| 877 | BButton *cancel = dynamic_cast<BButton*>(background->FindView("cancel button")); |
| 878 | FailNilMsg(cancel, "Error building FilePanel"); |
| 879 | |
| 880 | BView *textview = background->FindView("text view"); |
| 881 | FailNilMsg(textview, "Error building FilePanel"); |
877 | | BMenu *m = HResources::GetMenu(rid_Menu_FpMimetypes, true); |
878 | | FailNilMsg(m, "Error building FilePanel"); |
879 | | m->SetFont(be_plain_font); |
880 | | m->SetRadioMode(true); |
| 883 | BMenu *menu = HResources::GetMenu(rid_Menu_FpMimetypes, true); |
| 884 | FailNilMsg(menu, "Error building FilePanel"); |
| 885 | menu->SetFont(be_plain_font); |
| 886 | menu->SetRadioMode(true); |
887 | | r.left = r.right - 45; |
888 | | r.right = r.left + 100; |
889 | | r.top += (r.Height() - 20) / 2; |
| 893 | BMenuField *menuField = new BMenuField(rect, "mime", "Type:", |
| 894 | menu, B_FOLLOW_BOTTOM | B_FOLLOW_LEFT); |
| 895 | FailNilMsg(menuField, "Error building FilePanel"); |
| 896 | menuField->SetDivider(be_plain_font->StringWidth("Type:") + 7); |
| 897 | menuField->MenuBar()->ResizeToPreferred(); |
| 898 | menuField->ResizeToPreferred(); |
| 902 | // find all the views that are in the way and |
| 903 | // move up them up the height of the menu field |
| 904 | BView *poseview = background->FindView("PoseView"); |
| 905 | if (poseview) |
| 906 | poseview->ResizeBy(0, -height); |
| 907 | |
| 908 | BScrollBar *hscrollbar = (BScrollBar *)background->FindView("HScrollBar"); |
| 909 | if (hscrollbar) |
| 910 | hscrollbar->MoveBy(0, -height); |
| 911 | |
| 912 | BScrollBar *vscrollbar = (BScrollBar *)background->FindView("VScrollBar"); |
| 913 | if (vscrollbar) |
| 914 | vscrollbar->ResizeBy(0, -height); |
| 915 | |
| 916 | BView *countvw = (BView *)background->FindView("CountVw"); |
| 917 | if (countvw) |
| 918 | countvw->MoveBy(0, -height); |
| 919 | |
| 920 | textview->MoveBy(0, -height); |
| 921 | textview->ResizeTo(textview->Bounds().Width() * 1.5, |
| 922 | textview->Bounds().Height()); |
| 923 | |
| 924 | background->AddChild(menuField); |
| 925 | |
| 926 | // make sure the smallest window won't draw the "Type" menu over anything else |
| 927 | // we suppose the "Save" button to have the same width as the "Cancel" button |
| 928 | float minWindowWidth = textview->Bounds().Width() |
| 929 | + cancel->Bounds().Width() * 2 |
| 930 | + 50; |
| 931 | savePanel->SetSizeLimits(minWindowWidth, 10000, 250, 10000); |
| 932 | |