输入框鼠标编辑、图例省略、信号跨视图共享选择与网格菜单布局修复
- 输入框:支持鼠标左键点击定位插入符、拖拽框选区域,并且不再限制字符长度 - 输入框:长文本使用 ETO_CLIPPED 裁剪绘制,避免字符溢出到编辑区域之外 - 图例:信号名称超过 200px 时省略号截断,不再挤压标尺区域 - 选中状态从 TabConfig 迁移到 DataSet,切换视图后信号选中状态保持一致 - 网格右键菜单:Y 轴最大值/最小值直接显示当前值,点击后原位置弹出内联编辑框 - 标尺数值改为绘制在图例下层,不再因避让图例而隐藏 - 移除已无用的 LegendBandRect,新增共享的编辑框布局与命中检测工具 - .gitignore 忽略 TestData 测试数据目录
This commit is contained in:
1 parent
e3744f3eff
commit
12b3531485
19 files changed
+790
-186
No files matched your search
+31
-15
@@ -550,6 +550,36 @@ namespace jdi
|
||||
return std::isfinite(value) ? value : 1.0;
|
||||
}
|
||||
|
||||
void DataSet::RemapSelectionAfterFileRemoval(int fileIndex)
|
||||
{
|
||||
if (fileIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_selected.fileIndex == fileIndex)
|
||||
{
|
||||
m_selected = SignalRef();
|
||||
}
|
||||
else if (m_selected.fileIndex > fileIndex)
|
||||
{
|
||||
--m_selected.fileIndex;
|
||||
}
|
||||
}
|
||||
|
||||
bool DataSet::ValidateSelection()
|
||||
{
|
||||
if (!m_selected.IsValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (Resolve(m_selected) != nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_selected = SignalRef();
|
||||
return true;
|
||||
}
|
||||
|
||||
// ============================ 采样辅助 ============================
|
||||
|
||||
int FindNearestSample(const DataFile& file, double time)
|
||||
@@ -686,12 +716,7 @@ namespace jdi
|
||||
m_visible[fileIndex].resize(file->signals.size(), false);
|
||||
}
|
||||
|
||||
// 清理已失效的选中状态与网格引用。
|
||||
if (m_selected.IsValid() && dataSet.Resolve(m_selected) == nullptr)
|
||||
{
|
||||
m_selected = SignalRef();
|
||||
}
|
||||
|
||||
// 清理已失效的网格引用(选中状态由 DataSet 统一维护)。
|
||||
for (Lane& lane : m_lanes)
|
||||
{
|
||||
std::vector<SignalRef>& refs = lane.signals;
|
||||
@@ -741,15 +766,6 @@ namespace jdi
|
||||
m_lanes.erase(std::remove_if(m_lanes.begin(), m_lanes.end(),
|
||||
[](const Lane& lane) { return lane.signals.empty(); }),
|
||||
m_lanes.end());
|
||||
|
||||
if (m_selected.fileIndex == fileIndex)
|
||||
{
|
||||
m_selected = SignalRef();
|
||||
}
|
||||
else if (m_selected.fileIndex > fileIndex)
|
||||
{
|
||||
--m_selected.fileIndex;
|
||||
}
|
||||
}
|
||||
|
||||
bool TabConfig::IsVisible(const SignalRef& ref) const
|
||||
|
||||
Reference in new issue
Block a user