使用逗号定界线十进制进行自己的校准对话框

发布于 2025-02-13 12:45:57 字数 392 浏览 0 评论 0原文

当设置“校准面板”样式时,是否有类似的事件与“完成”的情况类似?我想使用逗号分隔符创建一个自定义校准对话框。我想打开自己的校准对话框,而不是您的对话框。我使用此代码检查了两个点进行校准:

const calibrationEndpoints: HTMLCollection = document.getElementsByClassName('calibration-endpoint');
const countPoint = Array.from(calibrationEndpoints).filter(e => e.classList.contains('editable')).length;
if (countPoint === 2) {
this.openCalibrationDialog();
}

Is there an event similar as "FINISHED_CALIBRATION" when the style for the "calibration panel" is set to display: block? I want to create a custom calibration dialog with comma separator. I want to open own calibration dialog instead of your dialog. I check two point for calibration with this code:

const calibrationEndpoints: HTMLCollection = document.getElementsByClassName('calibration-endpoint');
const countPoint = Array.from(calibrationEndpoints).filter(e => e.classList.contains('editable')).length;
if (countPoint === 2) {
this.openCalibrationDialog();
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长安忆 2025-02-20 12:45:57

请查看

this.showPanel = function() {

    var self = this;
    const _window = this.getWindow();

    if (_calibrationPanel) {
        _window.setTimeout(function () { _calibrationPanel.requestedSizeTextbox.focus();}, 0);
        _calibrationPanel.setVisible(true);
        _calibrationPanel.updatePanelPosition(_measurement.indicator.labelPosition, _measurement.indicator.p1, _measurement.indicator.p2, _measurement.indicator.calibrationLabel.clientHeight);
        self.addWindowEventListener("keyup", function onKeyUp(e){
            var key = e.key || String.fromCharCode(e.keyCode);
            if (key == "Escape" && self.isActive()) {
                self.hidePanel();
                self.clearSize();
                self.showAddCalibrationLabel();
                
                self.removeWindowEventListener("keyup", onKeyUp);
            }
        });
    }
    else {
        _viewer.dispatchEvent({ type: MeasureCommon.Events.OPEN_CALIBRATION_PANEL_EVENT, data: {size: _selectedSize, units: _selectedUnits } });
    }
};

Please review this sample

this.showPanel = function() {

    var self = this;
    const _window = this.getWindow();

    if (_calibrationPanel) {
        _window.setTimeout(function () { _calibrationPanel.requestedSizeTextbox.focus();}, 0);
        _calibrationPanel.setVisible(true);
        _calibrationPanel.updatePanelPosition(_measurement.indicator.labelPosition, _measurement.indicator.p1, _measurement.indicator.p2, _measurement.indicator.calibrationLabel.clientHeight);
        self.addWindowEventListener("keyup", function onKeyUp(e){
            var key = e.key || String.fromCharCode(e.keyCode);
            if (key == "Escape" && self.isActive()) {
                self.hidePanel();
                self.clearSize();
                self.showAddCalibrationLabel();
                
                self.removeWindowEventListener("keyup", onKeyUp);
            }
        });
    }
    else {
        _viewer.dispatchEvent({ type: MeasureCommon.Events.OPEN_CALIBRATION_PANEL_EVENT, data: {size: _selectedSize, units: _selectedUnits } });
    }
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文