JX Application Framework
|
#include <JXSearchTextDialog.h>
Public Types | |
enum | { kHistoryLength = 20 , kCurrentXSearchVersion = 1 } |
enum | { kXSearchSelectionAtomIndex , kXSearchWindowsAtomIndex , kXSearchVersionAtomIndex , kXSearchDataV1AtomIndex , kAtomCount } |
Public Member Functions | |
~JXSearchTextDialog () override | |
void | Activate () override |
bool | Deactivate () override |
bool | HasActiveTE () const |
bool | GetActiveTE (JXTEBase **te) const |
void | SetActiveTE (JXTEBase *te) |
void | TEDeactivated (JXTEBase *te) |
bool | HasSearchText () const |
const JString & | GetSearchText () const |
void | SetSearchText (const JString &str) |
void | SetRegexSearch (const bool regex=true) |
bool | HasReplaceText () const |
void | SetReplaceText (const JString &str) |
void | SetRegexReplace (const bool regex=true) |
bool | GetSearchParameters (JRegex **searchRegex, bool *entireWord, bool *wrapSearch, JString *replaceStr, JInterpolate **interpolator, bool *preserveCase) const |
void | SetFont (const JFont &font) |
void | ReadSetup (std::istream &input) |
void | WriteSetup (std::ostream &output) const |
![]() | |
JXWindowDirector (JXDirector *supervisor) | |
~JXWindowDirector () override | |
void | Activate () override |
bool | Deactivate () override |
void | Suspend () override |
void | Resume () override |
JXWindow * | GetWindow () const |
JXDisplay * | GetDisplay () const |
virtual const JString & | GetName () const |
virtual bool | GetMenuIcon (const JXImage **icon) const |
virtual bool | NeedsSave () const |
![]() | |
JXDirector (JXDirector *supervisor) | |
~JXDirector () override | |
bool | IsClosing () const |
virtual bool | Close () |
bool | IsActive () const |
bool | IsSuspended () const |
bool | HasSubdirectors () const |
bool | GetSubdirectors (const JPtrArray< JXDirector > **list) const |
![]() | |
JBroadcaster () | |
virtual | ~JBroadcaster () |
JBroadcaster & | operator= (const JBroadcaster &source) |
bool | HasSenders () const |
JSize | GetSenderCount () const |
bool | HasRecipients () const |
JSize | GetRecipientCount () const |
virtual JString | ToString () const |
template<class T > | |
void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Static Public Member Functions | |
static JXSearchTextDialog * | Create () |
Protected Member Functions | |
JXSearchTextDialog () | |
void | JXSearchTextDialogX () |
void | SetObjects (JXInputField *searchInput, JXStringHistoryMenu *prevSearchMenu, JXTextCheckbox *ignoreCaseCB, JXTextCheckbox *entireWordCB, JXTextCheckbox *wrapSearchCB, JXTextCheckbox *searchIsRegexCB, JXTextCheckbox *singleLineCB, JXInputField *replaceInput, JXStringHistoryMenu *prevReplaceMenu, JXTextCheckbox *replaceIsRegexCB, JXTextCheckbox *preserveCaseCB, JXTextCheckbox *stayOpenCB, JXTextCheckbox *retainFocusCB, JXSearchTextButton *findFwdButton, JXSearchTextButton *findBackButton, JXTextButton *replaceButton, JXSearchTextButton *replaceFindFwdButton, JXSearchTextButton *replaceFindBackButton, JXTextButton *replaceAllButton, JXTextButton *replaceAllInSelButton, JXTextButton *closeButton, JXTextButton *helpButton, JXTextButton *qRefButton) |
JXSearchTextButton * | GetFindFwdButton () const |
JXSearchTextButton * | GetFindBackButton () const |
JXTextButton * | GetReplaceButton () const |
JXSearchTextButton * | GetReplaceFindFwdButton () const |
JXSearchTextButton * | GetReplaceFindBackButton () const |
JXTextButton * | GetReplaceAllButton () const |
JXTextButton * | GetReplaceAllInSelButton () const |
virtual void | UpdateDisplay () |
void | Receive (JBroadcaster *sender, const Message &message) override |
void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) override |
![]() | |
virtual bool | OKToDeactivate () |
![]() | |
JXDirector * | GetSupervisor () const |
bool | CloseAllSubdirectors () |
virtual void | DirectorClosed (JXDirector *theDirector) |
![]() | |
JBroadcaster (const JBroadcaster &source) | |
void | ListenTo (const JBroadcaster *sender) |
void | StopListening (const JBroadcaster *sender) |
void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
template<class T > | |
void | Send (JBroadcaster *recipient, const T &message) |
template<class T > | |
void | Broadcast (const T &message) |
void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
void | BroadcastWithFeedback (Message *message) |
virtual void | ReceiveGoingAway (JBroadcaster *sender) |
This is used as a global object. We relay all the requests for action to the active text editor. This way, all the text editors share the same dialog window. We also support the XSearch protocol so our settings can be shared with other programs. (http://johnlindal.wixsite.com/xsearch) Derived classes must override BuildWindow() and call SetObjects() at the end of their implementation. They must also call JXSearchTextDialogX() after calling BuildWindow(). To do: support multiple displays
anonymous enum |
|
override |
|
protected |
|
overridevirtual |
We do not propagate the Activate message to subdirectors because each derived class must decide whether or not this is appropriate.
Reimplemented from JXDirector.
|
static |
|
overridevirtual |
Reimplemented from JXDirector.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
bool JXSearchTextDialog::GetSearchParameters | ( | JRegex ** | searchRegex, |
bool * | entireWord, | ||
bool * | wrapSearch, | ||
JString * | replaceStr, | ||
JInterpolate ** | interpolator, | ||
bool * | preserveCase | ||
) | const |
Without regex, "entire word" is only possible if searchStr contains a single word.
Returns false if an error occurs. (e.g. if regex compile fails)
const JString & JXSearchTextDialog::GetSearchText | ( | ) | const |
|
inline |
bool JXSearchTextDialog::HasReplaceText | ( | ) | const |
bool JXSearchTextDialog::HasSearchText | ( | ) | const |
|
protected |
void JXSearchTextDialog::ReadSetup | ( | std::istream & | input | ) |
|
overrideprotectedvirtual |
Process the given message from the given sender. This function is not pure virtual because not all classes will want to implement it.
Reimplemented from JBroadcaster.
|
overrideprotectedvirtual |
Process the given message from the given sender and provide feedback via the message as appropriate. This function is not pure virtual because not all classes will want to implement it.
Reimplemented from JBroadcaster.
|
inline |
void JXSearchTextDialog::SetFont | ( | const JFont & | font | ) |
|
protected |
void JXSearchTextDialog::SetRegexReplace | ( | const bool | regex = true | ) |
void JXSearchTextDialog::SetRegexSearch | ( | const bool | regex = true | ) |
void JXSearchTextDialog::SetReplaceText | ( | const JString & | str | ) |
void JXSearchTextDialog::SetSearchText | ( | const JString & | str | ) |
|
inline |
|
protectedvirtual |
We never need to call this because our update task triggers it regularly.
void JXSearchTextDialog::WriteSetup | ( | std::ostream & | output | ) | const |