src/addObjectDialog.cc

changeset 847
274a7fac44fc
parent 844
11587d419d2f
child 861
83426c5fa732
equal deleted inserted replaced
846:e4ad109f33c6 847:274a7fac44fc
80 80
81 case OBJ_BFC: 81 case OBJ_BFC:
82 { 82 {
83 rb_bfcType = new RadioGroup ("Statement", {}, 0, Qt::Vertical); 83 rb_bfcType = new RadioGroup ("Statement", {}, 0, Qt::Vertical);
84 84
85 for (int i = 0; i < LDBFC::NumStatements; ++i) 85 for_enum (BFCStatement, i)
86 { 86 {
87 // Separate these in two columns 87 // Separate these in two columns
88 if (i == LDBFC::NumStatements / 2) 88 if (int (i) == int (BFCStatement::NumValues) / 2)
89 rb_bfcType->rowBreak(); 89 rb_bfcType->rowBreak();
90 90
91 rb_bfcType->addButton (LDBFC::k_statementStrings[i]); 91 rb_bfcType->addButton (LDBFC::StatementStrings[int (i)]);
92 } 92 }
93 93
94 if (obj) 94 if (obj)
95 rb_bfcType->setValue ((int) obj.staticCast<LDBFC>()->statement()); 95 rb_bfcType->setValue ((int) obj.staticCast<LDBFC>()->statement());
96 } break; 96 } break;
353 } break; 353 } break;
354 354
355 case OBJ_BFC: 355 case OBJ_BFC:
356 { 356 {
357 LDBFCPtr bfc = initObj<LDBFC> (obj); 357 LDBFCPtr bfc = initObj<LDBFC> (obj);
358 bfc->setStatement ((LDBFC::Statement) dlg.rb_bfcType->value()); 358 assert (within (dlg.rb_bfcType->value(), 0, int (BFCStatement::NumValues) - 1));
359 bfc->setStatement (BFCStatement (dlg.rb_bfcType->value()));
359 } break; 360 } break;
360 361
361 case OBJ_Vertex: 362 case OBJ_Vertex:
362 { 363 {
363 LDVertexPtr vert = initObj<LDVertex> (obj); 364 LDVertexPtr vert = initObj<LDVertex> (obj);

mercurial