| sure ausbaufähig - but me personally disturbing it very if I whom whole editor not any more using can only because the SuchenFenster on is, or. if I only in a only instance search can.
now can z.B. Strg+F pressing, TEST prompt & [enter] pressing, again STRG+F pressing, BLUP prompt, etc. etc..
herewith is the trouble of table - Perhaps one beginning... CompileMarkSeparation!
======================
IFFindReplace-Klasse
======================
XPrfEditFindReplaceClass.prf
DEF &XFRepl.MaxInstancesCount 5
Class XFRepl = +XFRepl@,
+exit@,
-hide@,
-show@,
-checkActivity@,
+dlg&,
-bClose&,
-bWeit&,
+cCase&,
+cWord&,
-cVor&,
+cZur&,
+eSuch&,
-eFlag&,
-Id&,
-instance&,
+isVisible&
Declare XFRepl.Dlg.Width&,
XFRepl.Dlg.Height&,
XFRepl.h#[&XFRepl.MaxInstancesCount]
Proc XFRepl.XFRepl
parameters instance&
XFRepl.Dlg.Width&=364
XFRepl.Dlg.Height&=110+%cycaption
.instance&=instance&
.DLG& = CREATE("DIALOG",%HWND,"Suchen nach",%maxx,%maxy,640,480)
showwindow(.DLG&,0)
CREATE("TEXT",.DLG&,"&Suchen nach:",15,12,70,20)
.eSuch& = CREATE("EDIT", .DLG&,"", 88, 12, 170, 20)
.bWeit& = CREATE("DEFBUTTON", .DLG&, "&Weitersuchen", 268, 11, 80, 22)
.cCase& = CREATE("CHECKBOX", .DLG&,"&Groß-/Kleinschreibung", 15, 50, 150, 20)
.cWord& = CREATE("CHECKBOX", .DLG&,"&Nur ganzes Wort suchen", 15, 75, 150, 20)
CREATE("GROUPBOX", .DLG&, "Such&richtung", 170, 40, 90, 60)
.cZur& = CREATE("RADIOBUTTON", .DLG&, "nach &oben", 175, 55, 80, 20)
.cVor& = CREATE("RADIOBUTTON", .DLG&, "nach &unten", 175, 75, 80, 20)
.bEsc& = CREATE("BUTTON", .DLG&, "&Abbruch", 268, 38, 80, 22)
.bClose&= CREATE("BUTTON",.DLG&, "&Schliessen", 268, 78, 80, 22)
.show()
endproc
proc XFRepl.Show
declare y&
y&=(%wintop+(XFRepl.Dlg.Height&+20)*.instance&)
case (y&>%winbottom-100) : y&=%winbottom-100
setwindowpos .dlg&=(%winright-50-XFRepl.Dlg.Width&),y& - XFRepl.Dlg.Width&,XFRepl.Dlg.Height&
SetCheck .cVor&, 1
SetCheck .cCase&,0
SetCheck .cWord&,0
SetText .eSuch&,""
showwindow(.dlg&,1)
setfocus(.eSuch&)
SendMessage(.eSuch&,~em_SetSel,0,-1)
.isVisible&=1
endproc
proc XFRepl.Hide
showwindow(.dlg&,0)
setactivewindow(%hwnd)
.isVisible&=0
endproc
proc XFRepl.checkActivities
whileloop &XFRepl.MaxInstancesCount
if Typeof(XFRepl.h#[&loop])="o"
if (XFRepl.h#[&loop].isVisible&)
select XFRepl.h#[&loop].checkActivity()
caseof 1
If Edit#[AktTab%].Search(gettext$(XFRepl.h#[&loop].eSuch&),getcheck(XFRepl.h#[&loop].cWord&), getcheck(XFRepl.h#[&loop].cCase&), GetCheck(XFRepl.h#[&loop].cZur&)) = -1
Messagebox("q" + gettext$(XFRepl.h#[&loop].eSuch&) + "q nicht gefunden!","Information",64)
setactivewindow(XFRepl.h#[&loop].dlg&)
setfocus(XFRepl.h#[&loop].eSuch&)
SendMessage(XFRepl.h#[&loop].eSuch&,~em_SetSel,0,-1)
endif
otherwise
endselect
endif
endif
wend
endproc
proc XFRepl.checkActivity
casenot getactivewindow()=.dlg& : return
if %key=2
.hide()
setmenuitem 0
whileloop &XFRepl.MaxInstancesCount,1,-1
if Typeof(XFRepl.h#[&loop])="o"
if (XFRepl.h#[&loop].isVisible&)
setactivewindow(XFRepl.h#[&loop].dlg&)
setfocus(XFRepl.h#[&loop].eSuch&)
SendMessage(XFRepl.h#[&loop].eSuch&,~em_SetSel,0,-1)
break
endif
endif
wend
return 0
elseif Clicked(.bClose&) or Clicked(.bWeit&) or (%KEY = 13)
if Clicked(.bClose&)
.hide()
setmenuitem 0
whileloop &XFRepl.MaxInstancesCount,1,-1
if Typeof(XFRepl.h#[&loop])="o"
if (XFRepl.h#[&loop].isVisible&)
setactivewindow(XFRepl.h#[&loop].dlg&)
setfocus(XFRepl.h#[&loop].eSuch&)
SendMessage(XFRepl.h#[&loop].eSuch&,~em_SetSel,0,-1)
break
endif
endif
wend
return 0
endif
if %key=13
setfocus(.eSuch&)
SendMessage(.eSuch&,~em_SetSel,0,-1)
endif
.eflag&=0
if GetText$(.eSuch&)>""
return 1
endif
endif
endproc
Proc XFRepl.exit
destroywindow(.bClose&)
destroywindow(.bEsc&)
destroywindow(.bWeit&)
destroywindow(.cCase&)
destroywindow(.cWord&)
destroywindow(.cVor&)
destroywindow(.cZur&)
destroywindow(.eSuch&)
destroywindow(.dlg&)
endproc
in the Hauptprogramm must then following Changes:
The: CompileMarkSeparationmust inkludiert go.
The Proc Search must ausgetausch go: CompileMarkSeparation and in it Hauptschleife the Progammes must over: CompileMarkSeparationthese row eingefügt go: CompileMarkSeparation in the Hauptprogramm must still: CompileMarkSeparationin CompileMarkSeparationsupplant go.
Perhaps building Roland Yes something like or what Ähnliches one.
particularly the the editor not blockiert is find I very useful! |
|