wolfhece.assets.pie.editor

Graphical editor for pie chart asset configuration.

Provides a wx.Frame-based UI for interactively editing pie sector data, layout, geometry, and legend positioning. Changes are applied to a PieZonesController and reflected in the mapviewer in real-time.

Module Contents

wolfhece.assets.pie.editor.GROUP_GEOM = 'Pie - Geometry'[source]
wolfhece.assets.pie.editor.GROUP_LEGEND = 'Pie - Legend'[source]
wolfhece.assets.pie.editor.GROUP_COLORS = 'Pie - Colors'[source]
class wolfhece.assets.pie.editor.PieZonesEditor(parent, controller: wolfhece.assets.pie.controller.PieZonesController)[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.assets.pie.editor.PieZonesEditor

wx editor window for PieZonesController using CpGrid.

Provides a 6-column grid for sector data (label, value, color, fraction, legend x, legend y), plus controls for geometry (center, radius, angle), legend layout (placement mode, offset, text color), and I/O operations (JSON save/load, VEC/VECZ export).

controller[source]
_updating_ui = False[source]
_colors: list[tuple[int, int, int, int]] = [][source]
_wp[source]
_live[source]
_grid[source]
_pick_center[source]
_transform_map[source]
_colorpicker[source]
_alpha[source]
_add[source]
_del[source]
_apply[source]
_save_json[source]
_load_json[source]
_save_vecz[source]
_bind_events()[source]

Bind UI event handlers to controls.

_init_wolf_param_schema() None[source]
_purge_color_params() None[source]
static _color_key(idx: int) str[source]
static _alpha_key(idx: int) str[source]
_sync_color_param_schema(count: int) None[source]
_set_wp_colors(colors: list[tuple[int, int, int, int]]) None[source]
_read_wp_colors(count: int) list[tuple[int, int, int, int]][source]
_colors_from_controller(count: int) list[tuple[int, int, int, int]][source]
_sync_wp_colors_to_grid() None[source]
_read_wp() dict[source]
_color_text(rgba: tuple[int, int, int, int]) str[source]

Format RGBA tuple to comma-separated string.

_set_row_color(row: int, rgba: tuple[int, int, int, int]) None[source]

Set sector fill color for grid row and update color picker.

_sync_picker_from_row(row: int) None[source]

Sync color picker UI to the RGBA value of the current grid row.

_collect_grid_data()[source]

Extract labels, values, colors, and legend positions from grid.

Returns:

Tuple of (labels, values, colors, legend_positions) where legend_positions is a list of (x,y) tuples or None for auto.

_refresh_manual_columns_state() None[source]

Enable/disable Legend X/Y columns based on placement mode.

In ‘manual’ mode, X/Y columns are editable. In ‘auto’ mode, they are read-only to reflect that placement is computed.

_apply_controller()[source]

Commit all UI state to controller and rebuild geometry.

Saves currently-edited cell, reads all grid/control data, applies to controller (legend layout, legend color, geometry, data), and triggers rebuild with mapviewer sync.

refresh_from_controller()[source]

Reload all UI state from controller (after external change or apply).

Syncs grid (add/remove rows as needed), geometry fields, legend controls (mode, offset, color), and color picker from current controller state.

_maybe_live()[source]

Apply controller changes if live-update mode is enabled.

on_prop_changed(event)[source]

Handle changes in the Wolf_Param property panel.

on_grid_changed(event)[source]

Handle changes to grid cells (sector data).

on_grid_select(event)[source]

Handle grid row selection; sync color picker to selected row.

on_grid_editor_hidden(event)[source]

Keep focus on grid after Enter validation to avoid focus jump.

on_picker_changed(event)[source]

Handle color picker changes; apply to selected grid row and live-update.

on_pick_center(event)[source]

Interactive picker for pie center; user clicks map point to log coordinates.

on_transform_map(event)[source]

Start interactive move/resize mode with map handles.

on_add_row(event)[source]

Add a new empty sector row to the grid.

on_del_row(event)[source]

Delete the selected grid row (sector).

on_apply(event)[source]

Commit all changes to controller and rebuild.

on_save_json(event)[source]

Prompt for file and save controller state to JSON.

on_load_json(event)[source]

Prompt for file and load controller state from JSON.

on_save_vecz(event)[source]

Export pie geometry to VEC or VECZ (zipped) format.