| 2601 | } |
| 2602 | |
| 2603 | void LabelLayoutBaseTest::initWrapOption(const ax::Size& size) |
| 2604 | { |
| 2605 | auto label = Label::createWithSystemFont("Enable Wrap:", "Arial", 10); |
| 2606 | label->setColor(Color3B::WHITE); |
| 2607 | label->setPosition(Vec2(size.width * 0.8f - 100, size.height * 0.8f)); |
| 2608 | this->addChild(label); |
| 2609 | |
| 2610 | CheckBox* checkBox = CheckBox::create("cocosui/check_box_normal.png", "cocosui/check_box_normal_press.png", |
| 2611 | "cocosui/check_box_active.png", "cocosui/check_box_normal_disable.png", |
| 2612 | "cocosui/check_box_active_disable.png"); |
| 2613 | checkBox->setPosition(Vec2(size.width * 0.8f - 55, size.height * 0.8f)); |
| 2614 | checkBox->setScale(0.5); |
| 2615 | checkBox->setSelected(true); |
| 2616 | checkBox->setName("toggleWrap"); |
| 2617 | |
| 2618 | checkBox->addEventListener([this](Object* /*sender*/, CheckBox::EventType event) { |
| 2619 | if (event == CheckBox::EventType::SELECTED) |
| 2620 | { |
| 2621 | _label->enableWrap(true); |
| 2622 | } |
| 2623 | else |
| 2624 | { |
| 2625 | _label->enableWrap(false); |
| 2626 | } |
| 2627 | this->updateDrawNodeSize(_label->getContentSize()); |
| 2628 | }); |
| 2629 | this->addChild(checkBox); |
| 2630 | } |
| 2631 | |
| 2632 | void LabelLayoutBaseTest::initToggleLabelTypeOption(const ax::Size& size) |
| 2633 | { |
no test coverage detected