|
发表于 2019-8-15 13:50:28
|
显示全部楼层
- 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;
- }
复制代码 |
|