nsFilePanelBeOS::nsFilePanelBeOS(file_panel_mode mode, uint32 node_flavors, bool allow_multiple_selection, bool modal, bool hide_when_done) : BLooper() , BFilePanel(mode, NULL, NULL, node_flavors, allow_multiple_selection, NULL, NULL, modal, hide_when_done) , mSelectedActivity(nsFilePanelBeOS::NOT_SELECTED) , mIsSelected(false) , mSaveFileName("") , mSaveDirRef() , mOpenRefs() { if ((wait_sem = create_sem(1,"FilePanel")) < B_OK) printf("nsFilePanelBeOS::nsFilePanelBeOS : create_sem error\n"); if (wait_sem > 0) acquire_sem(wait_sem); SetTarget(BMessenger(this)); if ( mode == B_OPEN_PANEL && node_flavors == B_DIRECTORY_NODE ) { // Add a 'Select <dirname>' button to the open dialog Window()->Lock(); BView *background = Window()->ChildAt(0); entry_ref ref; char label[10+B_FILE_NAME_LENGTH]; GetPanelDirectory(&ref); sprintf(label, "Select '%s'", ref.name); mDirectoryButton = new BButton( BRect(113, background->Bounds().bottom-35, 269, background->Bounds().bottom-10), "directoryButton", label, new BMessage(MSG_DIRECTORY), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); if(mDirectoryButton) { background->AddChild(mDirectoryButton); mDirectoryButton->SetTarget(Messenger()); } else NS_ASSERTION(false, "Out of memory: failed to create mDirectoryButton"); SetButtonLabel(B_DEFAULT_BUTTON, "Select"); Window()->Unlock(); } else mDirectoryButton = nsnull; this->Run(); }
void InitCheckbutton(GladeXML *xml, cngplpData* data, const gpointer *widget) { WidgetInfo *widget_checkbutton = (WidgetInfo *)widget; PropInfo *prop_list = widget_checkbutton->prop_list; PropInfo *property = NULL; const char *text = NULL; if(prop_list != NULL){ property = FindProperty(prop_list, "text"); } if(property != NULL){ text = NameToTextByName(property->res); if(text != NULL){ SetButtonLabel(widget_checkbutton->name, text); } } }
static void SetLabel(UIStatusWnd *wnd) { GtkWidget *window = UI_DIALOG(wnd->sleeps_dlg)->window; int model = wnd->nModel; int type = 0; char* checkboxtext = NULL; char* comboboxtext = NULL; char* captiontext = NULL; switch(model){ case MODEL_LBP9100: case MODEL_LBP6000: case MODEL_LBP6200: type = LABEL_TYPE_POWERSAVEMODE; break; case MODEL_LBP7010: case MODEL_LBP9200: case MODEL_LBP6310: case MODEL_LBP6340: case MODEL_LBP6020: type = LABEL_TYPE_SLEEPMODE2; break; default: type = LABEL_TYPE_SLEEPMODE; break; } checkboxtext = GetStrText(labelModeCheckBox, type); comboboxtext = GetStrText(labelModeComboBox, type); captiontext = GetStrText(labelModeCaption, type); if(checkboxtext != NULL && comboboxtext != NULL){ SetButtonLabel(window, "SleepSDlg_Use_checkbutton", checkboxtext); SetTextToLabel(window, "label157", comboboxtext); SetDialogTitle(window, _(captiontext)); } }
static void SetLabel(UIStatusWnd *wnd) { GtkWidget *window = UI_DIALOG(wnd->resetunit_dlg)->window; int model = wnd->nModel; int type = 0; char* text = NULL; int i = 0; switch(model){ case MODEL_LBP9200: type = LABEL_TYPE_DRAWER; break; default: type = LABEL_TYPE_CASSETTE; break; } for(i = 0; LabelTextList[i].labeltext != NULL; i++){ text = GetStrText(LabelTextList[i].labeltext, type); if(text != NULL){ SetButtonLabel(window, LabelTextList[i].labelname, text); } } }