15 #include "uicmddrivermod.h" 34 virtual const char* name()
const = 0;
35 virtual bool approved(
const CallBacker*)
const = 0;
38 #define mDeclClassifierClass(callerclass) \ 40 class callerclass##Classifier : public Classifier \ 44 static const char* className() { return #callerclass; } \ 45 const char* name() const { return className(); } \ 47 bool approved(const CallBacker* caller) const \ 48 { return dynamic_cast<const callerclass*>(caller); } \ 57 static void initStandardComposers();
59 const char* extrakey=0);
64 virtual const char* name() = 0;
66 virtual bool greedy()
const;
69 virtual bool tryToFinish();
71 bool done()
const {
return done_; }
76 void testCB(CallBacker*);
87 void shrinkEventList(
int firstnr=1,
int lastnr=-1);
92 bool casedep =
false)
const;
94 void srcWinClosed(CallBacker*);
119 #define mStartDeclComposerClassNoAccept(mod,cmdkey,parentclass) \ 121 mExpClass(mod) cmdkey##CmdComposer : public parentclass \ 124 cmdkey##CmdComposer(CmdRecorder& cmdrec) \ 125 : parentclass(cmdrec) \ 128 static const char* keyWord() { return #cmdkey; } \ 129 virtual const char* name() { return keyWord(); } \ 131 #define mStartDeclComposerClass(mod,cmdkey,parentclass,callerclass) \ 133 mStartDeclComposerClassNoAccept(mod,cmdkey,parentclass) \ 134 mDeclClassifierClass(callerclass) \ 136 virtual bool accept(const CmdRecEvent&); \ 138 static CmdComposer* createInstance(CmdRecorder& cmdrec) \ 139 { return new cmdkey##CmdComposer(cmdrec); } \ 140 static void initClass() \ 141 { factory().addCreator( createInstance, \ 142 createFactoryKey(new callerclass##Classifier(), \ 145 #define mStartDeclComposerClassWithInit(mod,cmdkey,parentclass,callerclass) \ 146 mStartDeclComposerClass(mod,cmdkey,parentclass,callerclass) \ 149 #define mEndDeclComposerClass \ 156 #define mRefuseAndQuit() \ 159 if ( stackwasempty_ ) \ 160 refuseAndQuitDone(); \ 166 #define mCompleteAndQuitIfEventNested( ev, notifierstr ) \ 170 else if ( ev.begin_ && !stackwasempty_ && \ 171 stringEndsWithCI(notifierstr,ev.msg_) ) \ 173 ignoreflag_ = false; \ 178 #define mNotifyTest( objclass, uiobject, notifiername ) \ 180 mDynamicCastGet( objclass*, uiclassobj, uiobject ); \ 182 uiclassobj->notifiername.notify( mCB(this,CmdComposer,testCB) ); \ 186 #define mGetInputString( inpptr, txt, haschanged ) \ 188 BufferString inpstr; \ 189 char* inpptr = inpstr.getCStr(); \ 192 inpstr = " "; inpstr += txt; \ 193 mSkipBlanks( inpptr ); \ 195 strtod( inpptr, &endptr ); \ 196 const char* nextword = endptr; \ 197 mSkipBlanks( nextword ); \ 198 if ( inpptr!=endptr && !*nextword ) \ 205 mDressUserInputString( inpstr, sInputStr ); \ 206 IdentifierManager().tryFilePathPlaceholders( inpstr ); \ 208 inpptr = inpstr.getCStr(); \ 213 #define mWriteInputCmd( haschanged, txt, enter ) \ 215 mGetInputString( inpptr, txt, haschanged ); \ 216 if ( haschanged || enter ) \ 218 insertWindowCaseExec( *eventlist_[0] ); \ 219 mRecOutStrm << "Input \"" << eventlist_[0]->keystr_ << "\" " \ 220 << inpptr << (enter ? "Enter" : "Hold") << od_endl; \ 225 #define mGetItemName( uiobj,sizefunc,textfunc,curitemidx,curitemname,casedep ) \ 227 BufferString curitemname = uiobj->textfunc( curitemidx ); \ 228 mDressNameString( curitemname, sItemName ); \ 229 bool casedep = false; \ 234 for ( int itmidx=0; itmidx<uiobj->sizefunc(); itmidx++ ) \ 236 const char* itmtxt = uiobj->textfunc( itmidx ); \ 237 if ( SearchKey(curitemname,false).isMatching(itmtxt) ) \ 239 if ( SearchKey(curitemname,true).isMatching(itmtxt) ) \ 242 if ( itmidx == curitemidx ) \ 250 if ( selnr && nrmatches>1 ) \ 252 curitemname += "#"; curitemname += selnr; \ #define mExpClass(module)
Definition: commondefs.h:160
User interface main window.
Definition: uimainwin.h:36
bool updateflag_
Definition: cmdcomposer.h:103
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Command Drive
Definition: canvascommands.h:22
virtual void updateInternalState()
Definition: cmdcomposer.h:68
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
void objClosed(CallBacker *)
Definition: cmdcomposer.h:75
bool done() const
Definition: cmdcomposer.h:71
BufferStringSet bursteventnames_
Definition: cmdcomposer.h:111
Set of BufferString objects.
Definition: bufstringset.h:28
BufferStringSet voideventnames_
Definition: cmdcomposer.h:112
bool ignoreflag_
Definition: cmdcomposer.h:101
#define mDefineFactory1ParamInClass(T, P, funcname)
Definition: factory.h:447
Definition: cmdrecorder.h:71
Set of pointers to objects.
Definition: commontypes.h:32
TypeSet< int > refnrstack_
Definition: cmdcomposer.h:105
bool objclosed_
Definition: cmdcomposer.h:107
Definition: cmdcomposer.h:30
Definition: cmdrecorder.h:35
bool stateUpdateNeeded()
Definition: cmdcomposer.h:70
Definition: cmdcomposer.h:52
bool quitflag_
Definition: cmdcomposer.h:102
CmdRecorder & rec_
Definition: cmdcomposer.h:99
virtual ~Classifier()
Definition: cmdcomposer.h:33
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
void notDone()
Definition: cmdcomposer.h:96
virtual void init()
Definition: cmdcomposer.h:82
void refuseAndQuitDone()
Definition: cmdcomposer.h:97
bool done_
Definition: cmdcomposer.h:115
ObjectSet< CmdRecEvent > eventlist_
Definition: cmdcomposer.h:109
bool stackwasempty_
Definition: cmdcomposer.h:106