Skip to content

Commit

Permalink
Use native placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
0tkl committed Jul 16, 2024
1 parent 6b4a340 commit b691bb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 126 deletions.
117 changes: 0 additions & 117 deletions src/placeholder_ctrl.h

This file was deleted.

9 changes: 6 additions & 3 deletions src/subs_edit_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "include/aegisub/hotkey.h"
#include "initial_line_state.h"
#include "options.h"
#include "placeholder_ctrl.h"
#include "project.h"
#include "retina_helper.h"
#include "selection_controller.h"
Expand Down Expand Up @@ -134,12 +133,16 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
});
top_sizer->Add(style_edit_button, wxSizerFlags().Center().Border(wxRIGHT));

actor_box = new Placeholder<wxComboBox>(this, _("Actor"), wxSize(110, -1), wxCB_DROPDOWN | wxTE_PROCESS_ENTER, _("Actor name for this speech. This is only for reference, and is mainly useless."));
actor_box = new wxComboBox(this, -1, _("Actor"), wxDefaultPosition, wxSize(110, -1), 0, nullptr, wxCB_DROPDOWN | wxTE_PROCESS_ENTER);
actor_box->SetToolTip(_("Actor name for this speech. This is only for reference, and is mainly useless."));
actor_box->SetHint(_("Actor"));
Bind(wxEVT_TEXT, &SubsEditBox::OnActorChange, this, actor_box->GetId());
Bind(wxEVT_COMBOBOX, &SubsEditBox::OnActorChange, this, actor_box->GetId());
top_sizer->Add(actor_box, wxSizerFlags(2).Center().Border(wxRIGHT));

effect_box = new Placeholder<wxComboBox>(this, _("Effect"), wxSize(80,-1), wxCB_DROPDOWN | wxTE_PROCESS_ENTER, _("Effect for this line. This can be used to store extra information for karaoke scripts, or for the effects supported by the renderer."));
effect_box = new wxComboBox(this, -1, _("Effect"), wxDefaultPosition, wxSize(80, -1), 0, nullptr, wxCB_DROPDOWN | wxTE_PROCESS_ENTER);
effect_box->SetToolTip(_("Effect for this line. This can be used to store extra information for karaoke scripts, or for the effects supported by the renderer."));
effect_box->SetHint(_("Effect"));
Bind(wxEVT_TEXT, &SubsEditBox::OnEffectChange, this, effect_box->GetId());
Bind(wxEVT_COMBOBOX, &SubsEditBox::OnEffectChange, this, effect_box->GetId());
top_sizer->Add(effect_box, 3, wxALIGN_CENTER, 5);
Expand Down
8 changes: 2 additions & 6 deletions src/subs_edit_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class wxStyledTextEvent;
class wxTextCtrl;
struct AssDialogueBase;

template<class Base> class Placeholder;

/// @brief Main subtitle edit box
///
/// Controls the text edit and all surrounding controls
Expand Down Expand Up @@ -87,13 +85,13 @@ class SubsEditBox final : public wxPanel {
wxCheckBox *comment_box;
wxComboBox *style_box;
wxButton *style_edit_button;
Placeholder<wxComboBox> *actor_box;
wxComboBox *actor_box;
TimeEdit *start_time;
TimeEdit *end_time;
TimeEdit *duration;
wxSpinCtrl *layer;
std::array<wxTextCtrl *, 3> margin;
Placeholder<wxComboBox> *effect_box;
wxComboBox *effect_box;
wxRadioButton *by_time;
wxRadioButton *by_frame;
wxTextCtrl *char_count;
Expand Down Expand Up @@ -157,8 +155,6 @@ class SubsEditBox final : public wxPanel {
void OnSplit(wxCommandEvent&);
void DoOnSplit(bool show_original);

void SetPlaceholderCtrl(wxControl *ctrl, wxString const& value);

/// @brief Set a field in each selected line to a specified value
/// @param set Callable which updates a passed line
/// @param desc Undo description to use
Expand Down

0 comments on commit b691bb4

Please sign in to comment.