37    _(  "Select an <b>Option Choice</b> in the listbox above, and then click the " \ 
   38        "<b>Append Selected Option</b> button." ) 
 
   42                                              const wxString& aNickname,
 
   43                                              const std::map<std::string, UTF8>& aPluginOptions,
 
   44                                              const wxString& aFormattedOptions,
 
   53    SetTitle( wxString::Format( 
_( 
"Options for Library '%s'" ), aNickname ) );
 
   55    m_grid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
 
   65        for( std::map<std::string, UTF8>::const_iterator it = 
m_choices.begin(); it != 
m_choices.end(); ++it, ++row )
 
   67            wxString item = 
From_UTF8( it->first.c_str() );
 
 
   86DIALOG_PLUGIN_OPTIONS ::~DIALOG_PLUGIN_OPTIONS()
 
   89    m_grid->PopEventHandler( 
true );
 
 
   95    if( !DIALOG_SHIM::TransferDataToWindow() )
 
  105        if( props.size() > 
static_cast<size_t>( 
m_grid->GetNumberRows() ) )
 
  106            m_grid->AppendRows( props.size() - 
m_grid->GetNumberRows() );
 
  110        for( 
const auto& [key, value] : props )
 
  113            m_grid->SetCellValue( row, 1, value );
 
 
  123    if( !
m_grid->CommitPendingChanges() )
 
  126    if( !DIALOG_SHIM::TransferDataFromWindow() )
 
  129    std::map<std::string, UTF8> props;
 
  130    const int   rowCount = 
m_grid->GetNumberRows();
 
  132    for( 
int row = 0;  row<rowCount;  ++row )
 
  134        std::string 
name = 
TO_UTF8( 
m_grid->GetCellValue( row, 0 ).Trim( 
false ).Trim() );
 
  135        UTF8        value = 
m_grid->GetCellValue( row, 1 ).Trim( 
false ).Trim();
 
 
  149    return m_grid->GetNumberRows() - 1;
 
 
  157    if( row != wxNOT_FOUND )
 
  159        wxString option = 
m_listbox->GetString( row );
 
  161        for( row = 0; row < 
m_grid->GetNumberRows(); ++row )
 
  163            wxString col0 = 
m_grid->GetCellValue( row, 0 );
 
  169        if( row == 
m_grid->GetNumberRows() )
 
  172        m_grid->SetCellValue( row, 0, option );
 
 
  185    if( event.IsSelection() )
 
  187        std::string option = 
TO_UTF8( event.GetString() );
 
  190            m_html->SetPage( it->second );
 
 
  206            [&]() -> std::pair<int, int>
 
 
  216            [&]() -> std::pair<int, int>
 
 
  228                m_grid->DeleteRows( row );
 
 
  246        int width = 
m_grid->GetClientRect().GetWidth();
 
  248        m_grid->AutoSizeColumn( 0 );
 
  249        m_grid->SetColSize( 0, std::max( 72, 
m_grid->GetColSize( 0 ) ) );
 
  251        m_grid->SetColSize( 1, std::max( 120, width - 
m_grid->GetColSize( 0 ) ) );
 
 
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
 
DIALOG_PLUGIN_OPTIONS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER)
 
STD_BITMAP_BUTTON * m_delete_button
 
STD_BITMAP_BUTTON * m_append_button
 
DIALOG_PLUGIN_OPTIONS(wxWindow *aParent, const wxString &aNickname, const std::map< std::string, UTF8 > &aPluginOptions, const wxString &aFormattedOptions, wxString *aResult)
 
void onAppendOption(wxCommandEvent &) override
 
void onListBoxItemSelected(wxCommandEvent &event) override
 
void onDeleteRow(wxCommandEvent &) override
 
bool TransferDataToWindow() override
 
std::map< std::string, UTF8 > m_choices
 
const wxString & m_callers_options
 
void onUpdateUI(wxUpdateUIEvent &) override
 
void onSize(wxSizeEvent &aEvent) override
 
bool TransferDataFromWindow() override
 
void onGridCellChange(wxGridEvent &aEvent) override
 
void onListBoxItemDoubleClicked(wxCommandEvent &event) override
 
void onAppendRow(wxCommandEvent &) override
 
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
 
void SetupStandardButtons(std::map< int, wxString > aLabels={})
 
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
 
static UTF8 FormatOptions(const std::map< std::string, UTF8 > *aProperties)
Returns a list of options from the aProperties parameter.
 
static std::map< std::string, UTF8 > ParseOptions(const std::string &aOptionsList)
Parses aOptionsList and places the result into a #PROPERTIES object which is returned.
 
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
 
wxString From_UTF8(const char *cstring)
 
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.