Cillian 发表于 2019-8-14 17:11:09

thjing001 发表于 2019-8-11 12:36
是要这个效果吗???微,信139327---94771

谢谢您回复,我加您。

wxchg 发表于 2019-8-15 13:50:28

Cillian 发表于 2019-8-14 17:10
谢谢您回复,我找到这个文件夹,之后要修改哪些呢?谢谢您

NXOpen::BlockStyler::Tree::BeginLabelEditState fwj_tree_list_test::OnBeginLabelEditCallback(NXOpen::BlockStyler::Tree *tree, NXOpen::BlockStyler::Node *node, int columnID)
{
        NXOpen::BlockStyler::Tree::BeginLabelEditState OnBeginLabelEdit = BlockStyler::Tree::BeginLabelEditStateDisallow;

        return OnBeginLabelEdit;
}

NXOpen::BlockStyler::Tree::EndLabelEditState fwj_tree_list_test::OnEndLabelEditCallback(NXOpen::BlockStyler::Tree *tree, NXOpen::BlockStyler::Node *node, int, NXString editedText)
{
        NXOpen::BlockStyler::Tree::EndLabelEditState OnEndLabelEdit = BlockStyler::Tree::EndLabelEditStateRejectText;
        if (0 == strcmp(editedText.GetText(), "Reject"))
        {
                OnEndLabelEdit = BlockStyler::Tree::EndLabelEditStateRejectText;
        }
        else
        {
                OnEndLabelEdit = BlockStyler::Tree::EndLabelEditStateAcceptText;
        }

        return OnEndLabelEdit;
}

NXOpen::BlockStyler::Tree::EditControlOption fwj_tree_list_test::OnEditOptionSelectedCallback(NXOpen::BlockStyler::Tree *tree, NXOpen::BlockStyler::Node *node, int columnID, int selectedOptionID, NXString selectedOptionText, NXOpen::BlockStyler::Tree::ControlType type)
{
        NXOpen::BlockStyler::Tree::EditControlOption OnEditOptionSelected = BlockStyler::Tree::EditControlOptionReject;

        if (BlockStyler::Tree::ControlTypeComboBox == type)
        {
                if (0 == strcmp(selectedOptionText.GetText(), "ComboBox-RejectText"))
                {
                        OnEditOptionSelected = BlockStyler::Tree::EditControlOptionReject;
                }
                else
                {
                        OnEditOptionSelected = BlockStyler::Tree::EditControlOptionAccept;
                }
        }
        else if (BlockStyler::Tree::ControlTypeListBox == type)
        {
                if (0 == strcmp(selectedOptionText.GetText(), "ListBox-RejectText"))
                {
                        OnEditOptionSelected = BlockStyler::Tree::EditControlOptionReject;
                }
                else
                {
                        OnEditOptionSelected = BlockStyler::Tree::EditControlOptionAccept;
                }
        }

        return OnEditOptionSelected;
}

NXOpen::BlockStyler::Tree::ControlType fwj_tree_list_test::AskEditControlCallback(NXOpen::BlockStyler::Tree *tree, NXOpen::BlockStyler::Node *node, int columnID)
{
        NXOpen::BlockStyler::Tree::ControlType AskEditControl = BlockStyler::Tree::ControlTypeNone;;
        AskEditControl = BlockStyler::Tree::ControlTypeComboBox;
        std::vector<NXOpen::NXString> options;
        options.push_back(NXOpen::NXString("备选对象"));
        tree->SetEditOptions(options, 1);

        return AskEditControl;
}

wxchg 发表于 2019-8-15 13:54:40

wxchg 发表于 2019-8-15 13:50


想要实现删除建议挂个右键菜单,递归一下子节点就可以了

宏耀机械 发表于 2019-12-4 10:38:44

thjing001 发表于 2019-8-11 12:36
是要这个效果吗???微,信139327---94771

兄弟,这个哪里可以下载呢

冷酷到底456 发表于 2020-2-22 14:22:40

谢谢分享
页: 1 [2]
查看完整版本: UG二次开发一个标准库,如何在二级分类目录以下,可自由增加删除