wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ElementEditor Class Reference

Widget for inspecting and editing the properties of selected circuit elements. More...

#include <ElementEditor.h>

Inheritance diagram for ElementEditor:
[legend]

Public Member Functions

void audioBox ()
 Opens the audio file selector for the selected element(s).
void changeTriggerAction ()
 Opens a dialog to change the trigger key for the selected element(s).
void contextMenu (QPoint screenPos, QGraphicsItem *itemAtMouse)
 Shows the element context menu at screenPos for the item under itemAtMouse.
void editSubcircuitRequested (const QString &blobName, int icElementId)
 Emitted when the user requests editing an embedded IC sub-circuit.
 ElementEditor (QWidget *parent=nullptr)
 Constructs the element editor with optional parent.
void embedSubcircuitRequested ()
 Emitted when the user requests embedding a file-backed IC.
void extractToFileRequested ()
 Emitted when the user requests extracting an embedded IC to file.
void fillColorComboBox ()
 Repopulates the color combo box with available color options.
void openSubcircuitFileRequested (const QString &filePath)
 Emitted when the user requests editing a file-backed IC's sub-circuit file.
void renameAction ()
 Opens an inline editor to rename the selected element(s).
void retranslateUi ()
 Re-applies translatable strings to all editor widgets.
void sendCommand (QUndoCommand *cmd)
 Emitted when a property change should be pushed onto the undo stack.
void setScene (Scene *scene)
 Associates the editor with scene to read/write selected elements.
void truthTable ()
 Opens the truth table editor for the selected element(s).
void update ()
 Refreshes the editor UI to reflect the current selection.
void updateElementAppearance ()
 Applies the chosen appearance to the selected element(s).
void updateTheme ()
 Applies the current theme colors to the editor widgets.
 ~ElementEditor () override

Friends

class ElementTabNavigator

Detailed Description

Widget for inspecting and editing the properties of selected circuit elements.

The ElementEditor dynamically shows controls appropriate for the current selection: label, color, frequency, input/output count, appearance, trigger, audio, and truth-table. When multiple elements are selected it coalesces values, showing placeholder text when values differ. Property changes are pushed as QUndoCommands.

Definition at line 34 of file ElementEditor.h.

Constructor & Destructor Documentation

◆ ElementEditor()

ElementEditor::ElementEditor ( QWidget * parent = nullptr)
explicit

Constructs the element editor with optional parent.

Definition at line 39 of file ElementEditor.cpp.

References audioBox(), ElementTabNavigator, fillColorComboBox(), truthTable(), and updateElementAppearance().

Referenced by extractToFileRequested().

◆ ~ElementEditor()

ElementEditor::~ElementEditor ( )
override

Definition at line 100 of file ElementEditor.cpp.

Member Function Documentation

◆ audioBox()

void ElementEditor::audioBox ( )

Opens the audio file selector for the selected element(s).

Definition at line 944 of file ElementEditor.cpp.

References FileDialogProvider::getOpenFileName(), FileDialogs::provider(), and sentryBreadcrumb().

Referenced by ElementEditor().

◆ changeTriggerAction()

void ElementEditor::changeTriggerAction ( )

Opens a dialog to change the trigger key for the selected element(s).

Definition at line 167 of file ElementEditor.cpp.

◆ contextMenu()

void ElementEditor::contextMenu ( QPoint screenPos,
QGraphicsItem * itemAtMouse )

Shows the element context menu at screenPos for the item under itemAtMouse.

Definition at line 135 of file ElementEditor.cpp.

References ElementContextMenu::exec().

Referenced by setScene().

◆ editSubcircuitRequested()

void ElementEditor::editSubcircuitRequested ( const QString & blobName,
int icElementId )

Emitted when the user requests editing an embedded IC sub-circuit.

◆ embedSubcircuitRequested()

void ElementEditor::embedSubcircuitRequested ( )

Emitted when the user requests embedding a file-backed IC.

◆ extractToFileRequested()

void ElementEditor::extractToFileRequested ( )

Emitted when the user requests extracting an embedded IC to file.

References ElementEditor().

◆ fillColorComboBox()

void ElementEditor::fillColorComboBox ( )

Repopulates the color combo box with available color options.

Definition at line 281 of file ElementEditor.cpp.

Referenced by ElementEditor(), and retranslateUi().

◆ openSubcircuitFileRequested()

void ElementEditor::openSubcircuitFileRequested ( const QString & filePath)

Emitted when the user requests editing a file-backed IC's sub-circuit file.

◆ renameAction()

void ElementEditor::renameAction ( )

Opens an inline editor to rename the selected element(s).

Definition at line 161 of file ElementEditor.cpp.

◆ retranslateUi()

void ElementEditor::retranslateUi ( )

Re-applies translatable strings to all editor widgets.

Definition at line 296 of file ElementEditor.cpp.

References fillColorComboBox().

◆ sendCommand()

void ElementEditor::sendCommand ( QUndoCommand * cmd)

Emitted when a property change should be pushed onto the undo stack.

Parameters
cmdThe undo command encapsulating the change.

Referenced by setScene().

◆ setScene()

void ElementEditor::setScene ( Scene * scene)

Associates the editor with scene to read/write selected elements.

Definition at line 260 of file ElementEditor.cpp.

References contextMenu(), Scene::contextMenuPos(), Scene::receiveCommand(), sendCommand(), truthTable(), and Scene::truthTableElementChanged().

◆ truthTable()

void ElementEditor::truthTable ( )

Opens the truth table editor for the selected element(s).

Definition at line 837 of file ElementEditor.cpp.

References sentryBreadcrumb().

Referenced by ElementEditor(), and setScene().

◆ update()

void ElementEditor::update ( )

Refreshes the editor UI to reflect the current selection.

Definition at line 976 of file ElementEditor.cpp.

◆ updateElementAppearance()

void ElementEditor::updateElementAppearance ( )

Applies the chosen appearance to the selected element(s).

Definition at line 207 of file ElementEditor.cpp.

References FileDialogProvider::getOpenFileName(), InMemorySnapshot, FileDialogs::provider(), qCDebug, sentryBreadcrumb(), and Serialization::writePandaHeader().

Referenced by ElementEditor().

◆ updateTheme()

void ElementEditor::updateTheme ( )

Applies the current theme colors to the editor widgets.

Definition at line 983 of file ElementEditor.cpp.

References ThemeManager::effectiveTheme(), and Light.

◆ ElementTabNavigator

friend class ElementTabNavigator
friend

Definition at line 101 of file ElementEditor.h.

References ElementTabNavigator.

Referenced by ElementEditor(), and ElementTabNavigator.


The documentation for this class was generated from the following files: