Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native placeholders #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 0 additions & 118 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
Loading