Implemented upgrade_text_entry_dialog() fuction to avoid a getting an empty string from wxTextEntryDialog (disable OK button, if TextCtrl is empty)

All mode conflicting or meaningless ticks are marked by "exclamation" icon and described in tooltip.
This commit is contained in:
YuSanka 2020-01-27 12:40:12 +01:00
parent be8f464bf8
commit d8b1d074a1
2 changed files with 100 additions and 27 deletions

View file

@ -39,6 +39,14 @@ enum IconFocus {
ifCog
};
enum ConflictType
{
ctNone,
ctModeConflict,
ctMeaningless,
ctRedundant
};
using t_mode = CustomGCode::Mode;
struct TickCode
@ -74,8 +82,12 @@ public:
bool switch_code_for_tick(std::set<TickCode>::iterator it, const std::string& code_to, const int extruder);
void erase_all_ticks_with_code(const std::string& gcode);
bool has_tick_with_code(const std::string& gcode);
bool is_conflict_tick(const TickCode& tick, t_mode out_mode);
bool has_tick_with_code(const std::string& gcode);
ConflictType is_conflict_tick(const TickCode& tick, t_mode out_mode, int only_extruder, double print_z);
// Get used extruders for tick.
// Means all extruders(tools) which will be used during printing from current tick to the end
std::set<int> get_used_extruders_for_tick(int tick, int only_extruder, double print_z) const;
void suppress_plus (bool suppress) { m_suppress_plus = suppress; }
void suppress_minus(bool suppress) { m_suppress_minus = suppress; }
@ -253,10 +265,6 @@ private:
// Use those values to disable selection of active extruders
std::array<int, 2> get_active_extruders_for_tick(int tick) const;
// Get used extruders for tick.
// Means all extruders(toools) will be used during printing from current tick to the end
std::set<int> get_used_extruders_for_tick(int tick) const;
void post_ticks_changed_event(const std::string& gcode = "");
bool check_ticks_changed_event(const std::string& gcode);