static BColumn* col_named(const char* name, BColumnListView* table) { BColumn* col; for (int32 k = 0; (col = table->ColumnAt(k)); k++) { BString colName; col->GetColumnName( &colName ); if (strcmp( name, colName.String() ) == 0) return col; } return NULL; }
static BColumn* column_named(const char* name, BColumnListView* fromTable) { if (!fromTable) return NULL; BColumn* col; for (uint32 k = 0; (col = fromTable->ColumnAt(k)); k++) { BString n; col->GetColumnName(&n); if (strcmp( n.String(), name ) == 0) return col; } return NULL; }
status_t SeqManageRosterWindow::GetConfiguration(BMessage* config) { ArpASSERT(config); config->what = ConfigWhat(); status_t err = GetDimensions(config, this); if (err != B_OK) return err; /* Add the columns */ BColumnListView* table = dynamic_cast<BColumnListView*>( FindView(TABLE_STR) ); if (table) { BColumn* col; for( int32 k = 0; (col = table->ColumnAt(k)); k++ ) { BMessage colMsg; BString colName; col->GetColumnName(&colName); if( colMsg.AddString("name", colName.String() ) == B_OK && colMsg.AddFloat("width", col->Width() ) == B_OK && colMsg.AddBool("visible", col->IsVisible() ) == B_OK ) { config->AddMessage("column", &colMsg); } } } return B_OK; }