root/_TextViewer/BF_GUI_MessageBox.cpp

/* [previous][next][first][last][top][bottom][index][help] */
   1 #include "BF_GUI_MessageBox.h"
   2 #include "BF_Msg.h"
   3 
   4 BF_GUI_MessageBox::BF_GUI_MessageBox(BRect  o_Bounds, char *pc_Title, char *pc_MessageText, BView *po_ParentView, char *pc_ButtonText) 
   5         : BF_GUI_Dialog(o_Bounds,pc_Title,"",NULL,B_FOLLOW_H_CENTER | B_FOLLOW_V_CENTER)
   6 {
   7                 /* make new message */          
   8                 oMessage.what = BF_MSG_VIEWER_MESSAGE; 
   9                 oMessage.AddPointer("bf_focus",(void*)po_ParentView);
  10                 /* move self to center */               
  11                 MoveToCenter(po_ParentView);
  12                 /* add text_view */
  13                 BRect oRect;
  14                 LocalBounds(oRect);
  15                 oRect.top += 10;
  16                 oRect.bottom = oRect.top + poSysSetup->oFontToolView.fHeight * 2 + 4;
  17                 AddChild(new BF_GUI_ViewText(oRect,"text",pc_MessageText,
  18                         B_FOLLOW_H_CENTER | B_FOLLOW_TOP,B_WILL_DRAW));
  19                 /* add menu */
  20                 LocalBounds(oRect);
  21                 oRect.bottom-=5;
  22                 oRect.top=oRect.bottom - poSysSetup->oFontToolView.fHeight+2;
  23                 oRect.left+=10;
  24                 oRect.right-=10;                
  25                 BL_List *ploMenu = new BL_List();
  26                 ploMenu->AddItem(new BF_GUI_ViewMenu_Item(pc_ButtonText,pc_ButtonText));
  27                 po_Buttons = new BF_GUI_DlgView_HMenu(oRect,"buttons",B_FOLLOW_BOTTOM,ploMenu);
  28                 AddChild(po_Buttons);                                   
  29 };

/* [previous][next][first][last][top][bottom][index][help] */