bool ListViewEdit::onKeyDown(const UINT iVirtKey) { NotifyMessage<NMLVDISPINFO> oMessage(LVN_ENDLABELEDIT, Handle, WindowID); wstring szText; switch (iVirtKey) { // [RETURN] Pass text to parent, then destroy case VK_RETURN: szText = getText(); oMessage.item.mask = LVIF_TEXT; oMessage.item.pszText = const_cast<TCHAR*>(szText.c_str()); oMessage.item.iItem = m_iItem; oMessage.item.iSubItem = m_iSubItem; oMessage.Send(getParentHandle()); // Fall through... // [ESCAPE] Destroy by switching focus to parent case VK_ESCAPE: getParent()->SetFocus(); break; } return Unhandled; // Pass to base }
void BF_GUI_SetupDialog::Invoke_FlagsSetup(int i_Type) { iSetupMainStyle = oSetup.MainStyle(); EnableDialog(false); /* prepare message */ BMessage oMessage(BF_MSG_MAINVIEW_MAINSETUP_STYLES_UPDATED); oMessage.AddPointer("bf_focus",this); /* make dialog */ BRect oRect(poWinView->Bounds()); oRect.left=0; oRect.right=350; oRect.top+=30; oRect.bottom-=30; /* make dialog */ BF_GUI_Dialog *poDialog = new BF_GUI_Dialog(oRect,BF_DictAt(BF_DICT_FONTSETUP_FLAGS),"flags_dialog", oMessage,BG_GUI_DIALOG_WINRESIZE_MOVE_CENTER); /* flags */ poDialog->LocalBounds(oRect); oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight; //// switch(i_Type){ case BF_GUI_SETUPDIALOG_FLAGS_MAIN:{ Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_ASKEXIT),BF_SETUP_MAIN_ASK_EXIT,oRect,poDialog,true); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_VOLSHOWHOME),BF_SETUP_MAIN_SELECTVOL_SHOWSPEC,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_VOLSTACK),BF_SETUP_MAIN_SELECTVOL_SHOWSTACK,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_VOLICONS),BF_SETUP_MAIN_SELECTVOL_SHOWSICON,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_PATHICON),BF_SETUP_MAIN_FP_HEADERICON,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_PANBACK),BF_SETUP_NODEPANEL_USE_BACKSPACE,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_PANRET),BF_SETUP_MAIN_RETURN_REMEMBER,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_CMDPATH),BF_SETUP_CMDLINE_SHOWPATH,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_TRACKADDICONS),BF_SETUP_FILESPANEL_TRACKERADDONS_SHOWICONS,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_SEARCHVOLICONS),BF_SETUP_SEARCH_SETUP_VOLICONS,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_MAINSETUP_AUTOSAVE),BF_SETUP_AUTOSAVE,oRect,poDialog,false); break;} case BF_GUI_SETUPDIALOG_FLAGS_FILETASKS:{ Insert_MainStyle_Check(BF_DictAt(BF_DICT_SETUPFILES_SHOWDLG),BF_SETUP_OPERROSTER_DEFDIALOG,oRect,poDialog,true); Insert_MainStyle_Check(BF_DictAt(BF_DICT_SETUPFILES_COPYDES),BF_SETUP_NODEPANEL_DESELECT_AFTER_COPY,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_SETUPFILES_MOVEDES),BF_SETUP_NODEPANEL_DESELECT_AFTER_MOVE,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_SETUPFILES_ASKDEL),BF_SETUP_MAIN_ASK_DELETE,oRect,poDialog,false); Insert_MainStyle_Check(BF_DictAt(BF_DICT_SETUPFILES_ASKCOPY),BF_SETUP_MAIN_ASK_COPY,oRect,poDialog,false); break;} case BF_GUI_SETUPDIALOG_FLAGS_DEBUG:{ Insert_MainStyle_Check("Debug : disable node_monitoring",BF_SETUP_DEB_NOMONITORING,oRect,poDialog,true); Insert_MainStyle_Check("Debug : disable filelist_sorting",BF_SETUP_DEB_NOSORTING,oRect,poDialog,false); break;} } /* menu ok */ BL_List *ploMenu = new BL_List(); ploMenu->AddItem(new BF_GUI_ViewMenu_Item(BF_DictAt(BF_DICT_OK),"ok")); poDialog->AddMenu(oRect,ploMenu); /* finish */ //poDialog->SetHeightFromLastChild(); poDialog->MoveToCenter( poWinView ); BF_GUI_Func_AddChildToMainView ( poDialog ); }
void BF_GUI_TopVMenu::NavEscape() { BMessenger oMessenger(poHMenu); BMessage oMessage(BF_MSG_TOPMENU_HCLOSE); oMessage.AddBool("bf_bOk",false); oMessenger.SendMessage(&oMessage); }
void BF_GUI_SetupDialog::Invoke_ColorsSetup() { EnableDialog(false); /* prepare message */ BMessage oMessage(BF_MSG_MAINVIEW_MAINSETUP_0); oMessage.AddPointer("bf_focus",this); /* make dialog */ BRect oRect(poWinView->Bounds()); oRect.left=0; oRect.right=400; oRect.top+=70; oRect.bottom-=70; /* make dialog */ BF_GUI_Dialog *poDialog = new BF_GUI_Dialog(oRect,BF_DictAt(BF_DICT_MAINSETUP_COLSFONTS),"colors_dialog" ,oMessage,BG_GUI_DIALOG_WINRESIZE_MOVE_CENTER); /* insert colors */ BL_List *ploItem = new BL_List(); for(int iColor=0;iColor<BF_COLOR_END;iColor++){ ploItem->AddItem(new BF_GUI_SetupDialog_ColorItem( BF_DictAt(poSysSetup->aoColor[iColor].iDictCode),"",&oSetup.aoColor[iColor].rgb)); } ploItem->AddItem(new BF_GUI_ViewMenu_Item("","")); /* insert fonts */ ploItem->AddItem(new BF_GUI_SetupDialog_FontItem(BF_DictAt(BF_DICT_FONTSETUP_FONTPANEL),"back",&oSetup.oFontNode,poFontSIcon?new BBitmap(poFontSIcon):NULL)); ploItem->AddItem(new BF_GUI_SetupDialog_FontItem(BF_DictAt(BF_DICT_FONTSETUP_FONTDIALOG),"frame",&oSetup.oFontToolView,poFontSIcon?new BBitmap(poFontSIcon):NULL)); ploItem->AddItem(new BF_GUI_SetupDialog_FontItem(BF_DictAt(BF_DICT_FONTSETUP_FONTMONO),"dir",&oSetup.oFontMono,poFontSIcon?new BBitmap(poFontSIcon):NULL)); ploItem->AddItem(new BF_GUI_SetupDialog_FontItem(BF_DictAt(BF_DICT_FONTSETUP_FONTCOMMAND),"dir",&oSetup.oFontCMDLine,poFontSIcon?new BBitmap(poFontSIcon):NULL)); /*-------*/ poDialog->LocalBounds(oRect); oRect.bottom -= +oSetup.oFontToolView.fHeight*2; BF_GUI_DlgView_VMenu* poColorsMenu = new BF_GUI_DlgView_VMenu(oRect,"colors_menu", B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP_BOTTOM,ploItem,BF_GUI_DLGVIEW_VMENU_SICON|BF_GUI_DLGVIEW_VMENU_SET_VSCROLLBAR); poDialog->AddChild(poColorsMenu); /* menu ok */ BL_List *ploMenu = new BL_List(); ploMenu->AddItem(new BF_GUI_ViewMenu_Item(BF_DictAt(BF_DICT_OK),"ok")); poDialog->AddMenu(oRect,ploMenu); /* // add scroll_bar BF_GUI_VScrollBar *poBar = new BF_GUI_VScrollBar(poColorsMenu,"scroll",B_FOLLOW_TOP_BOTTOM|B_FOLLOW_RIGHT); poColorsMenu->SetVScroll(poBar); poDialog->AddChild(poBar); */ /* finish */ //poDialog->SetHeightFromLastChild(); poDialog->MoveToCenter( poWinView ); BF_GUI_Func_AddChildToMainView ( poDialog ); }
void DownloadUI::ShowHelp(void) { if (!::ShowHelp(m_context, Download_Manager)) { GTKMessageDialog oBox; string oMessage("Cannot find the help files. Please make sure that the help files are properly installed, and you are not running "the_BRANDING" from the build directory."); oBox.Show(oMessage.c_str(), string(BRANDING), kMessageOk, true); } }
void BF_GUI_Viewer::QuitViewer() { BMessage oMessage(BF_MSG_VIEWER_CLOSED); BMessenger oMessenger(poPanel); oMessenger.SendMessage(&oMessage); RemoveSelf(); delete this; };
MessageDialogReturnEnum MessageDialog:: Show(const char *szMessage, const char *szTitle, MessageDialogEnum eType, bool InEventLoop) { string oMessage(szMessage), oTitle(szTitle); return Show(oMessage, oTitle, eType, InEventLoop); }
void BF_GUI_FtpPanel_DeleteTask::Run() { iOperIndex = 0; iOperCount = loNode.CountAll(true); SetProgress(iOperIndex,iOperCount); Delete_List(&loNode); // reload panel_nodes BMessenger oMessenger(poPanel); BMessage oMessage(BF_FTP_MSG_DIR_RELOAD_START); oMessenger.SendMessage(&oMessage); }
void BF_GUI_TopVMenu::NavEnter() { BF_GUI_ViewMenu_Item *poItem = (BF_GUI_ViewMenu_Item*)ploMenu->ItemAt(iNavCursorIndex); if(!poItem) return; // BMessenger oMessenger(poHMenu); BMessage oMessage(BF_MSG_TOPMENU_HCLOSE); oMessage.AddBool("bf_bOk",true); oMessage.AddString("bf_Code",poItem->sCode.String()); oMessenger.SendMessage(&oMessage); }
bool BF_GUI_SetupDialog_ColorItem::Invoke(BF_GUI_DlgView_Menu *po_Parent) { ////////////////////////////// BF_GUI_Func_EnableDialog( po_Parent->Parent()->Name(),false ); /* prepare message */ BMessage oMessage(BF_MSG_DIALOG_FOCUS); oMessage.AddPointer("bf_focus",po_Parent->Parent()); /* make dialog */ BF_GUI_Dialog *poDialog = new BF_GUI_Dialog(BRect(0,0,400,0), sTitle.String(),"color_dialog",oMessage,BG_GUI_DIALOG_WINRESIZE_MOVE_CENTER); /* resize dialog */ BRect oRect; /* unit */ poDialog->LocalBounds(oRect); oRect.left = oRect.right - 40; oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight*6+5*2; BF_GUI_ColorsView *poUnit = new BF_GUI_ColorsView(oRect,B_FOLLOW_RIGHT|B_FOLLOW_TOP,puColor); poDialog->AddChild(poUnit); /* compoments */ poDialog->LocalBounds(oRect); oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight*2; oRect.right-=50; poDialog->AddChild(new BF_GUI_ColorView(oRect,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,&puColor->red,0,poUnit)); oRect.top = oRect.bottom+5; oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight*2; poDialog->AddChild(new BF_GUI_ColorView(oRect,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,&puColor->green,1,poUnit)); oRect.top = oRect.bottom+5; oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight*2; poDialog->AddChild(new BF_GUI_ColorView(oRect,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,&puColor->blue,2,poUnit)); /////////////////////////////// /* menu */ BRect oRect1; poDialog->LocalBounds(oRect1); oRect.right = oRect1.right; poDialog->AddOkCancelMenu(oRect); /* finish */ poDialog->SetHeightFromLastChild(); poDialog->MoveToCenter( poWinView ); BF_GUI_Func_AddChildToMainView ( poDialog ); return true; }
void BF_GUI_SetupDialog::MessageReceived(BMessage* po_Message) { switch(po_Message->what){ case BF_MSG_MAINVIEW_MAINSETUP_STYLES_UPDATED:{ EnableDialog(true); poMenu->MakeFocus(); // int32 iMenuRes=-1; if(B_OK==po_Message->FindInt32("menu",&iMenuRes)) oSetup.SetMainStyle(iSetupMainStyle); // break;} case BF_MSG_MAINVIEW_MAINSETUP_0:{ EnableDialog(true); poMenu->MakeFocus(); break;} case BF_MSG_DIALOG_PRESSED_OK:{ BView *po; const char *pc; ASSERT(B_OK==po_Message->FindPointer("bf_DlgView_Focus",(void**)&po),"BF_GUI_SetupDialog::MessageReceived"); pc = po->Name(); if(strcmp(pc,"main_menu")==0){ InvokeMenu(-1,poMenu->iNavCursorIndex); }else{ // poSysSetup->UpdateFrom(oSetup); if(poSysSetup->MainStyle() & BF_SETUP_AUTOSAVE) poSysSetup->Save(); // BF_GUI_Dialog::MessageReceived(po_Message); // BMessenger oMessenger(poWin); BMessage oMessage(BF_MSG_SETUP_UPDATED); oMessenger.SendMessage(&oMessage); } break;} default: BF_GUI_Dialog::MessageReceived(po_Message); }; }
void BF_GUI_Viewer::SearchSample() { /* prepare message */ BMessage oMessage(BF_MSG_VIEWER_SEARCH); oMessage.AddInt32("bf_viewer_search_cmd",BF_VIEWER_CMD_SEARCH_FIRST); oMessage.AddPointer("bf_focus",this); /* make dialog */ BF_GUI_Dialog *poDialog = new BF_GUI_Dialog(BRect(30,30,350,110), "Sample For Search","dialog",&oMessage,BG_GUI_DIALOG_WINRESIZE_MOVE_CENTER); poDialog->MoveToCenter( this ); /* insert views */ BRect oRect; /* insert edit_view */ poDialog->LocalBounds(oRect); oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight; BF_GUI_ViewEdit *poEdit = new BF_GUI_ViewEdit(oRect,"bf_pcValue", poText->GetMatch(), B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,B_NAVIGABLE); poDialog->AddChild(poEdit); /* finish */ AddChild( poDialog ); /* old text BMessage oMessage(BF_MSG_VIEWER_SEARCH); oMessage.AddInt32("bf_viewer_search_cmd",BF_VIEWER_CMD_SEARCH_FIRST); oMessage.AddPointer("bf_focus",this); BF_GUI_ToolEdit *poToolView = new BF_GUI_ToolEdit(BRect(30,30,350,110),"Sample For Search","",oMessage); poToolView->MoveToCenter(this); poToolView->poEditView->sValue << poText->GetMatch(); AddChild(poToolView); poToolView->poEditView->MakeFocus(); */ }
wstring ListView::GetItemText(const UINT iItem, const UINT iSubItem, const UINT iMaxLength) { StringBufferW szBuffer(iMaxLength); // [VIRTUAL] Retrieve text via LVN_GETDISPINFO if (Style INCLUDES LVS_OWNERDATA) { NotifyMessage<NMLVDISPINFO> oMessage(LVN_GETDISPINFO, Handle, WindowID); // Prepare item request oMessage.item.iItem = iItem; oMessage.item.iSubItem = iSubItem; oMessage.item.mask = LVIF_TEXT; oMessage.item.pszText = szBuffer; oMessage.item.cchTextMax = iMaxLength; oMessage.Send(Handle); } else // [NON-VIRTUAL] Retrieve via LVM_GETITEMTEXT ListView_GetItemText(Handle, iItem, iSubItem, szBuffer, iMaxLength); // Return as string return szBuffer; }
void BF_GUI_FilesPanel::Action_Tracker_Addons_Start() { bool bShowIcons = poSysSetup->MainStyle() & BF_SETUP_FILESPANEL_TRACKERADDONS_SHOWICONS; BL_List *ploMenu = new BL_List(); Action_Tracker_Addons_Start_LoadAddOns(true,*ploMenu,bShowIcons); Action_Tracker_Addons_Start_LoadAddOns(false,*ploMenu,bShowIcons); if(ploMenu->CountItems()==0){ BF_Dialog_Alert_Sep(BF_DictAt(BF_DICT_ERROR),BF_DictAt(BF_DICT_TRADDS_NONE),NULL,this); return; } BF_GUI_Func_PanelsEnable(false); /* prepare message for dialog */ BMessage oMessage(BF_MSG_FILEPANEL_TRACKER_ADDONS_SELECTED); oMessage.AddPointer("bf_focus",(void*)this); oMessage.AddPointer("bf_panel_focus",(void*)poWin->CurrentFocus()); /* calc max_item width */ float fMaxWidth=0; { BF_GUI_ViewMenu_Item *po; float f; for(int i=0;i<ploMenu->CountItems();i++){ po = (BF_GUI_ViewMenu_Item*)ploMenu->ItemAt(i); ASSERT(po); f = poSysSetup->oFontToolView.oFont.StringWidth(po->sTitle.String()); if(f>fMaxWidth) fMaxWidth = f; } if(bShowIcons) fMaxWidth+=19; } /* check width */ { float fTitleWidth = poSysSetup->oFontToolView.oFont.StringWidth(WIN_TITLE)+40; if(fTitleWidth>fMaxWidth) fMaxWidth = fTitleWidth; } /* prepare rect for dialog */ BRect oDlgRect(30,30,0,0); if(!bWinPos_OnLeft){ BRect oRect(poWinView->Bounds()); oDlgRect.left+=oRect.Width()/2; } /* make dialog */ BF_GUI_Dialog *poDialog = new BF_GUI_Dialog(oDlgRect,WIN_TITLE,"dialog",oMessage, bWinPos_OnLeft?BG_GUI_DIALOG_WINRESIZE_NONE:BG_GUI_DIALOG_WINRESIZE_MOVE_RCENTER,false); /**/ float fHeight = poSysSetup->oFontToolView.fHeight; if(fHeight<19 && bShowIcons) fHeight = 19; BRect oMenuRect(0,0,0,0); poDialog->LocalBounds(oMenuRect); oMenuRect.right = oMenuRect.left + fMaxWidth; oMenuRect.bottom = oMenuRect.top + 5 + fHeight*ploMenu->CountItems(); /* make menu */ BView* poMenu = new BF_GUI_DlgView_VMenu(oMenuRect,"menu", B_FOLLOW_ALL,ploMenu, bShowIcons?BF_GUI_DLGVIEW_VMENU_SICON:0); /* finish */ poDialog->AddChild(poMenu); poDialog->SetSizeBy(oMenuRect.Width(),oMenuRect.Height()); BF_GUI_Func_AddChildToMainView ( poDialog ); /* */ return; }
bool BF_GUI_SetupDialog_FontItem::Invoke(BF_GUI_DlgView_Menu *po_Parent) { BF_GUI_Func_EnableDialog( po_Parent->Parent()->Name(),false ); /* prepare message */ BMessage oMessage(BF_MSG_DIALOG_FOCUS/*BF_MSG_MAINVIEW_MAINSETUP_FONT_UPDATED*/); oMessage.AddPointer("bf_focus",po_Parent->Parent()); /* make dialog */ printf("BF_GUI_SetupDialog_FontItem::Invoke this=%i\n",this); BF_GUI_SetupDialog_FontDialog *poDialog = new BF_GUI_SetupDialog_FontDialog(this,BRect(0,0,440,0), sTitle.String(),"color_dialog",oMessage,BG_GUI_DIALOG_WINRESIZE_MOVE_CENTER,true); /* resize dialog */ BRect oRect; // make fonts_menu // BL_List *poList = new BL_List(); int32 iCountFam = count_font_families(); for(int32 iFam=0;iFam<iCountFam;iFam++){ font_family uFam; uint32 iFlags; if( B_OK != get_font_family(iFam,&uFam,&iFlags)) continue; // load styles BL_List *plsStyle = new BL_List(); int32 iCountStyles = count_font_styles(uFam); for(int iStyle=0;iStyle<iCountStyles;iStyle++){ font_style uStyle; if(B_OK != get_font_style(uFam,iStyle,&uStyle,&iFlags)) continue; plsStyle->AddItem( new BF_GUI_ViewMenu_Item(uStyle,uStyle)); } // make store item BF_GUI_SetupDialog_FontFamilyItem *poItem = new BF_GUI_SetupDialog_FontFamilyItem(uFam,plsStyle); poList->AddItem(poItem); } poDialog->LocalBounds(oRect); oRect.bottom = oRect.top + 300; oRect.right = oRect.left + 200; poDialog->AddChild( new BF_GUI_DlgView_VMenu(oRect,"families",B_FOLLOW_ALL,poList,BF_GUI_DLGVIEW_VMENU_NAV_PARENTINFORM) ); // make styles // poDialog->LocalBounds(oRect); oRect.bottom = oRect.top + 300; oRect.left += 210; poDialog->AddChild( new BF_GUI_DlgView_VMenu(oRect,"styles",B_FOLLOW_ALL,new BL_List(),BF_GUI_DLGVIEW_VMENU_NAV_PARENTINFORM) ); // make anti_aliasing { poDialog->LocalBounds(oRect); oRect.top += 310; oRect.bottom = oRect.top + poSysSetup->oFontToolView.fHeight*2; oRect.right = oRect.left + 140; BF_GUI_ViewCheck *poCheck = new BF_GUI_ViewCheck(oRect,"anti_aliasing",BF_DictAt(BF_DICT_FONTSETUP_ANTI) ,poFont->iFlags & B_FORCE_ANTIALIASING ,B_FOLLOW_LEFT|B_FOLLOW_TOP,B_WILL_DRAW|B_NAVIGABLE); poDialog->AddChild(poCheck); } // make test poDialog->LocalBounds(oRect); oRect.top += 310; oRect.bottom = oRect.top + poSysSetup->oFontToolView.fHeight*3; oRect.left += 160; poDialog->AddChild( new BF_GUI_FontView(oRect,B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM) ); // make size poDialog->LocalBounds(oRect); oRect.top += 310+poSysSetup->oFontToolView.fHeight*2; oRect.bottom = oRect.top + poSysSetup->oFontToolView.fHeight; oRect.right = oRect.left + 150; BL_String s; s<<poFont->fSize; BF_GUI_ViewEdit_Create(oRect,BF_DictAt(BF_DICT_SIZE),poDialog,"size",s.String() ,B_FOLLOW_LEFT|B_FOLLOW_BOTTOM,B_NAVIGABLE); /////////////////////////////// /* make bottom menu */ BRect oRect1; poDialog->LocalBounds(oRect1); oRect.left = oRect1.left; oRect.right = oRect1.right; oRect.top = oRect.bottom+10; oRect.bottom = oRect.top + poSysSetup->oFontToolView.fHeight; BL_List *ploMenu = new BL_List(); ploMenu->AddItem(new BF_GUI_ViewMenu_Item(BF_DictAt(BF_DICT_OK),"ok")); poDialog->AddMenu(oRect,ploMenu,true); /* finish */ poDialog->SetHeightFromLastChild(); poDialog->MoveToCenter( poWinView ); BF_GUI_Func_AddChildToMainView( poDialog ); return true; }
void BF_GUI_FilesPanel::Action_Search_0() { /////////////////////////////// /* prepare message */ BMessage oMessage(BF_MSG_FILEPANEL_SEARCH_SETUP_CLOSE); oMessage.AddPointer("bf_focus",this); oMessage.AddPointer("bf_current_folder",Path().String()); /* */ BF_GUI_Func_PanelsEnable(false); /* make dialog */ BF_GUI_Dialog *poDialog = new BF_GUI_Dialog(BRect(0,0,300,0), BF_DictAt(BF_DICT_SEARCH),"dialog",oMessage,BG_GUI_DIALOG_WINRESIZE_MOVE_CENTER); /* resize dialog */ BRect oRect; poDialog->LocalBounds(oRect); /* name */ poDialog->LocalBounds(oRect); oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight; BF_GUI_ViewEdit_Create(oRect,BF_DictAt(BF_DICT_FILESEARCH_FILENAME),poDialog,"name","*", B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,B_NAVIGABLE); oRect.top = oRect.bottom + 5; /* text */ oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight; BF_GUI_ViewEdit_Create(oRect,BF_DictAt(BF_DICT_FILESEARCH_BYTEXT),poDialog,"text","", B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,B_NAVIGABLE); oRect.top = oRect.bottom + 5; // check "from current folder" // oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight; poDialog->AddChild(new BF_GUI_ViewCheck(oRect,"from_current_folder", BF_DictAt(BF_DICT_FILESEARCH_FROMCURFOLDER), false,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,B_NAVIGABLE)); oRect.top = oRect.bottom + 5; /* divider */ oRect.bottom = oRect.top; poDialog->AddChild(new BF_GUI_ViewFrame(oRect,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP)); oRect.top = oRect.bottom + 5; /* comment */ oRect.bottom = oRect.top+poSysSetup->oFontToolView.fHeight; poDialog->AddChild(new BF_GUI_ViewText(oRect,"comment",BF_DictAt(BF_DICT_FILESEARCH_ONVOLUMES) ,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP,B_WILL_DRAW,false)); oRect.top = oRect.bottom+5; /* volumes */ { BL_List *ploItem = new BL_List(); BF_GUI_ViewMenu_Item *poItem = NULL; /* prepare volume_list */ bool bShowIcons = poSysSetup->MainStyle() & BF_SETUP_SEARCH_SETUP_VOLICONS; BF_NodeList loNodeVol; BF_Roster_VolumeList(loNodeVol, ( (bShowIcons)?BF_ROSTER_LOADVOLS_SICON:0 ) ); BF_Volume *poNode; for(int i=0;i<loNodeVol.CountItems();i++){ poNode = (BF_Volume*)loNodeVol.ItemAt(i); /// if(poNode->bBootVolume) poNode->sName="boot"; /// poItem = new BF_GUI_ViewMenu_Item(poNode->sName.String(),poNode->sName.String() ); ploItem->AddItem(poItem); if(poNode->poSIcon && bShowIcons) poItem->poSIcon = new BBitmap( poNode->poSIcon ); // poItem->bSelected = poNode->bBootVolume; } oRect.bottom = oRect.top+70; BF_GUI_DlgView_VMenu *poMenu = new BF_GUI_DlgView_VMenu(oRect,"volumes",B_FOLLOW_ALL, ploItem,BF_GUI_DLGVIEW_VMENU_SICON|BF_GUI_DLGVIEW_VMENU_CAN_SELECTING); poDialog->AddChild(poMenu); oRect.top = oRect.bottom+5; } /* divider */ oRect.bottom = oRect.top; poDialog->AddChild(new BF_GUI_ViewFrame(oRect,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP)); oRect.top = oRect.bottom + 5; /////////////////////////////// /* menu */ poDialog->AddOkCancelMenu(oRect); /* finish */ poDialog->SetHeightFromLastChild(); poDialog->MoveToCenter( poWinView ); BF_GUI_Func_AddChildToMainView ( poDialog ); }