step 7: harden docs and prepare beta
This commit is contained in:
@@ -139,6 +139,7 @@ def create_gauge_context(gauge_type: str, config: ConfigT) -> GaugeContext[Confi
|
||||
|
||||
|
||||
def gauge_panel(**config: Any) -> LayoutContext:
|
||||
"""Create a lightweight child-window container for related gauges."""
|
||||
if not _dpg_context_active:
|
||||
return LayoutContext(None)
|
||||
tag = config.pop("tag", 0)
|
||||
@@ -160,6 +161,7 @@ def gauge_panel(**config: Any) -> LayoutContext:
|
||||
|
||||
|
||||
def gauge_grid(**config: Any) -> LayoutContext:
|
||||
"""Create a lightweight horizontal gauge layout container."""
|
||||
if not _dpg_context_active:
|
||||
return LayoutContext(None)
|
||||
columns = max(int(config.pop("columns", 1)), 1)
|
||||
@@ -175,42 +177,52 @@ def gauge_grid(**config: Any) -> LayoutContext:
|
||||
|
||||
|
||||
def analog_gauge(**config: Any) -> GaugeContext[AnalogGaugeConfig]:
|
||||
"""Create an analog dial gauge with ticks, needle, thresholds, and markers."""
|
||||
return create_gauge_context("analog", AnalogGaugeConfig(**config))
|
||||
|
||||
|
||||
def digital_gauge(**config: Any) -> GaugeContext[DigitalGaugeConfig]:
|
||||
"""Create a large numeric readout gauge."""
|
||||
return create_gauge_context("digital", DigitalGaugeConfig(**config))
|
||||
|
||||
|
||||
def bar_gauge(**config: Any) -> GaugeContext[BarGaugeConfig]:
|
||||
"""Create a horizontal or vertical fill bar gauge."""
|
||||
return create_gauge_context("bar", BarGaugeConfig(**config))
|
||||
|
||||
|
||||
def level_gauge(**config: Any) -> GaugeContext[LevelGaugeConfig]:
|
||||
"""Create a tank or level-style vertical gauge."""
|
||||
return create_gauge_context("level", LevelGaugeConfig(**config))
|
||||
|
||||
|
||||
def status_light(**config: Any) -> GaugeContext[StatusLightConfig]:
|
||||
"""Create an LED-style status indicator gauge."""
|
||||
return create_gauge_context("status_light", StatusLightConfig(**config))
|
||||
|
||||
|
||||
def segmented_gauge(**config: Any) -> GaugeContext[SegmentedGaugeConfig]:
|
||||
"""Create a segmented strip gauge for shift-light or cell-style displays."""
|
||||
return create_gauge_context("segmented", SegmentedGaugeConfig(**config))
|
||||
|
||||
|
||||
def compass_gauge(**config: Any) -> GaugeContext[CompassGaugeConfig]:
|
||||
"""Create a compass gauge that wraps numeric headings to 0-360 degrees."""
|
||||
return create_gauge_context("compass", CompassGaugeConfig(**config))
|
||||
|
||||
|
||||
def thermometer_gauge(**config: Any) -> GaugeContext[ThermometerGaugeConfig]:
|
||||
"""Create a thermometer-style temperature gauge."""
|
||||
return create_gauge_context("thermometer", ThermometerGaugeConfig(**config))
|
||||
|
||||
|
||||
def battery_gauge(**config: Any) -> GaugeContext[BatteryGaugeConfig]:
|
||||
"""Create a battery-style percentage or value gauge."""
|
||||
return create_gauge_context("battery", BatteryGaugeConfig(**config))
|
||||
|
||||
|
||||
def multi_value_gauge(**config: Any) -> GaugeContext[MultiValueGaugeConfig]:
|
||||
"""Create a compact grouped key/value readout gauge."""
|
||||
return create_gauge_context("multi_value", MultiValueGaugeConfig(**config))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user