改造一些

This commit is contained in:
2026-08-12 00:06:44 +08:00
parent aca480d988
commit abd1b595c7
57 changed files with 883 additions and 732 deletions
+27 -27
View File
@@ -137,36 +137,36 @@ inline auto low_latency_fields() {
inline auto axis_fields() {
using T = Gallery_Axis_Properties;
return std::tuple{
select_property<&T::axis_orientation>("axis_orientation", "主轴方向", "Abs_Axis::set_orientation"),
number_property<&T::axis_x_offset>("axis_x_offset", "X 偏移", "Abs_Axis::set_x"),
number_property<&T::axis_y_offset>("axis_y_offset", "Y 偏移", "Abs_Axis::set_y"),
number_property<&T::axis_length_percent>("axis_length_percent", "轴长百分比", "Abs_Axis::set_pixel_length"),
number_property<&T::tick_length>("tick_length", "主刻度长度", "Abs_Axis::set_tick_length"),
number_property<&T::sub_tick_length>("sub_tick_length", "次刻度长度", "Abs_Axis::set_sub_tick_length"),
color_property<&T::axis_color>("axis_color", "轴颜色", "Abs_Axis::set_color"),
select_property<&T::decimal_separator>("decimal_separator", "小数点", "Abs_Axis::set_locale"),
text_property<&T::unit_text>("unit_text", "单位文本", "Abs_Axis::set_unit_text"),
number_property<&T::unit_font_size>("unit_font_size", "单位字号", "Abs_Axis::set_unit_text_font"),
number_property<&T::unit_font_weight>("unit_font_weight", "单位字重", "Abs_Axis::set_unit_text_font"),
boolean_property<&T::unit_font_italic>("unit_font_italic", "单位斜体", "Abs_Axis::set_unit_text_font"),
color_property<&T::unit_pen_color>("unit_pen_color", "单位文字颜色", "Abs_Axis::set_unit_text_pen"),
color_property<&T::unit_background_color>("unit_background_color", "单位背景颜色", "Abs_Axis::set_unit_text_background_brush"),
number_property<&T::label_rotation>("label_rotation", "标签旋转角度", "Abs_Axis::set_label_rotation_degrees"),
number_property<&T::coord_origin>("coord_origin", "坐标起点", "Axis::set_coord_range"),
number_property<&T::coord_target>("coord_target", "坐标终点", "Axis::set_coord_range"),
number_property<&T::label_precision>("label_precision", "标签精度", "Axis::set_label_precision"),
boolean_property<&T::use_wheel>("use_wheel", "启用滚轮缩放", "Axis::set_use_wheel"),
boolean_property<&T::use_drag>("use_drag", "启用拖拽平移", "Axis::set_use_drag")
select_property<&T::axis_orientation>("axis_orientation", "主轴方向", "Axis::set<&Axis_Base_Properties::orientation>"),
number_property<&T::axis_x_offset>("axis_x_offset", "X 偏移", "Axis::set<&Axis_Base_Properties::x>"),
number_property<&T::axis_y_offset>("axis_y_offset", "Y 偏移", "Axis::set<&Axis_Base_Properties::y>"),
number_property<&T::axis_length_percent>("axis_length_percent", "轴长百分比", "Axis::set<&Axis_Base_Properties::pixel_length>"),
number_property<&T::tick_length>("tick_length", "主刻度长度", "Axis::set<&Axis_Base_Properties::tick_length>"),
number_property<&T::sub_tick_length>("sub_tick_length", "次刻度长度", "Axis::set<&Axis_Base_Properties::sub_tick_length>"),
color_property<&T::axis_color>("axis_color", "轴颜色", "Axis::set<&Axis_Base_Properties::color>"),
select_property<&T::decimal_separator>("decimal_separator", "小数点", "Axis::set<&Axis_Base_Properties::locale>"),
text_property<&T::unit_text>("unit_text", "单位文本", "Axis::set<&Axis_Base_Properties::unit_text>"),
number_property<&T::unit_font_size>("unit_font_size", "单位字号", "Axis::set<&Axis_Base_Properties::unit_text_font>"),
number_property<&T::unit_font_weight>("unit_font_weight", "单位字重", "Axis::set<&Axis_Base_Properties::unit_text_font>"),
boolean_property<&T::unit_font_italic>("unit_font_italic", "单位斜体", "Axis::set<&Axis_Base_Properties::unit_text_font>"),
color_property<&T::unit_pen_color>("unit_pen_color", "单位文字颜色", "Axis::set<&Axis_Base_Properties::unit_text_pen>"),
color_property<&T::unit_background_color>("unit_background_color", "单位背景颜色", "Axis::set<&Axis_Base_Properties::unit_text_background_brush>"),
number_property<&T::label_rotation>("label_rotation", "标签旋转角度", "Axis::set<&Axis_Base_Properties::label_rotation_degrees>"),
number_property<&T::coord_origin>("coord_origin", "坐标起点", "Axis::set<&Axis_Properties::coordinates>"),
number_property<&T::coord_target>("coord_target", "坐标终点", "Axis::set<&Axis_Properties::coordinates>"),
number_property<&T::label_precision>("label_precision", "标签精度", "Axis::set<&Axis_Properties::precision>"),
boolean_property<&T::use_wheel>("use_wheel", "启用滚轮缩放", "Axis::set<&Axis_Properties::wheel>"),
boolean_property<&T::use_drag>("use_drag", "启用拖拽平移", "Axis::set<&Axis_Properties::drag>")
};
}
inline auto time_axis_fields() {
using T = Gallery_Time_Axis_Properties;
return std::tuple{
number_property<&T::time_visible_count>("time_visible_count", "可见时间点", "Time_Axis::set_visible_time_point_count"),
number_property<&T::time_label_spacing>("time_label_spacing", "时间标签间距", "Time_Axis::set_tick_label_spacing_px"),
text_property<&T::time_format>("time_format", "时间格式", "Time_Axis::set_time_format"),
number_property<&T::time_font_size>("time_font_size", "时间字体", "Time_Axis::set_font"),
boolean_property<&T::time_newest_at_start>("time_newest_at_start", "最新数据位于轴起点", "Time_Axis::set_newest_at_axis_start")
number_property<&T::time_visible_count>("time_visible_count", "可见时间点", "Time_Axis::set<&Time_Axis_Properties::visible_count>"),
number_property<&T::time_label_spacing>("time_label_spacing", "时间标签间距", "Time_Axis::set<&Time_Axis_Properties::tick_label_spacing_px>"),
text_property<&T::time_format>("time_format", "时间格式", "Time_Axis::set<&Time_Axis_Properties::format>"),
number_property<&T::time_font_size>("time_font_size", "时间字体", "Time_Axis::set<&Axis_Base_Properties::unit_text_font>"),
boolean_property<&T::time_newest_at_start>("time_newest_at_start", "最新数据位于轴起点", "Time_Axis::set<&Time_Axis_Properties::newest_at_start>")
};
}
inline auto hover_fields() {
@@ -288,8 +288,8 @@ struct Property_Fields<Gallery_Frequency_Trace_Properties> {
return std::tuple_cat(common_fields(), axis_fields(), time_axis_fields(), std::tuple{
color_property<&T::trace_pen>("trace_pen", "轨迹颜色", "Frequency_Trace::set<&Properties::pen>"),
number_property<&T::trace_pen_width>("trace_pen_width", "轨迹宽度", "Frequency_Trace::set<&Properties::pen>"),
number_property<&T::trace_value_min>("trace_value_min", "数值下限", "Axis::set_coord_range"),
number_property<&T::trace_value_max>("trace_value_max", "数值上限", "Axis::set_coord_range")
number_property<&T::trace_value_min>("trace_value_min", "数值下限", "Axis::set<&Axis_Properties::coordinates>"),
number_property<&T::trace_value_max>("trace_value_max", "数值上限", "Axis::set<&Axis_Properties::coordinates>")
});
}
};