wex v24.10.0
Public Member Functions | List of all members
wex::stc_entry_dialog Class Reference

Offers an stc as a dialog (like wxTextEntryDialog). More...

#include <wex/stc/entry-dialog.h>

Inheritance diagram for wex::stc_entry_dialog:
Inheritance graph
[legend]

Public Member Functions

 stc_entry_dialog (const std::string &text=std::string(), const std::string &prompt=std::string(), const data::window &data=data::window(), const data::stc &stc_data=data::stc())
 Default constructor.
 
auto * get_stc ()
 Returns stc component.
 
bool set_validator (const std::string &regex, bool ic=false)
 Sets a validator regular expression (case sensitive) for the stc contents.
 
- Public Member Functions inherited from wex::dialog
 dialog (const data::window &data=data::window())
 Default constructor.
 
const auto & data () const
 Returns the window data.
 

Additional Inherited Members

- Protected Member Functions inherited from wex::dialog
wxSizerItem * add_user_sizer (wxWindow *window, const wxSizerFlags &flags=wxSizerFlags().Expand())
 Adds to the user sizer using the sizer flags.
 
wxSizerItem * add_user_sizer (wxSizer *sizer, const wxSizerFlags &flags=wxSizerFlags().Expand())
 Adds to the user sizer using the sizer flags.
 
void layout_sizers (bool add_separator_line=true)
 layouts the sizers.
 

Detailed Description

Offers an stc as a dialog (like wxTextEntryDialog).

The prompt (if not empty) is first added as a text sizer to the user sizer. Then the stc component is added to the user sizer.

Constructor & Destructor Documentation

◆ stc_entry_dialog()

wex::stc_entry_dialog::stc_entry_dialog ( const std::string & text = std::string(),
const std::string & prompt = std::string(),
const data::window & data = data::window(),
const data::stc & stc_data = data::stc() )

Default constructor.

Parameters
textinitial text
promptprompt (as with wxTextEntryDialog)
datadialog data with style: default wxDEFAULT_DIALOG_STYLE wxRESIZE_BORDER (set in dialog.cpp)
stc_datastc data default multi line component

Member Function Documentation

◆ set_validator()

bool wex::stc_entry_dialog::set_validator ( const std::string & regex,
bool ic = false )

Sets a validator regular expression (case sensitive) for the stc contents.

The validator is cleared after each valid wxID_OK, or after wxID_CANCEL.

Parameters
regexthe regex
icdefault the regex is case sensitive, set ic to override this