#FireFly_Form# Version=3.70 Locked=0 ClientOffset=0 ClientWidth=580 ClientHeight=492 [ControlType] Form | PropertyCount=24 | zorder=1 | tabindex=0 | name=frmPopup classstyles=CS_VREDRAW, CS_HREDRAW, CS_DBLCLKS windowstyles=WS_POPUP, WS_THICKFRAME, WS_CAPTION, WS_SYSMENU, WS_MINIMIZEBOX, WS_MAXIMIZEBOX, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_VISIBLE|WS_EX_WINDOWEDGE, WS_EX_CONTROLPARENT, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR backbitmap= backbitmapmode=0 - Tiled backcolor=SYS,15 caption=For review export=False height=531 icon= left=0 mdichild=False minwidth=0 minheight=0 maxwidth=0 maxheight=0 startupposition=1 - Centered tabcontrolchild=False tabcontrolchildautosize=False tag= tag2= top=0 width=596 windowstate=0 - Normal [ControlType] TextBox | PropertyCount=22 | zorder=2 | tabindex=17 | name=txtMsg1 windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, ES_LEFT, ES_MULTILINE, ES_AUTOHSCROLL, ES_AUTOVSCROLL, ES_READONLY|WS_EX_CLIENTEDGE, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR backcolor=SYS,5 controlindex=0 font=Courier New,9,0 fontupgrade=False forecolor=SYS,8 height=54 left=10 locked=False leftmargin=0 maxlength=0 rightmargin=0 resizerules= seltext=False text= tag= tag2= tooltip= tooltipballoon=False top=9 width=365 [ControlType] TextBox | PropertyCount=22 | zorder=3 | tabindex=16 | name=txtMsg2 windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, ES_LEFT, ES_MULTILINE, ES_AUTOHSCROLL, ES_AUTOVSCROLL, ES_READONLY|WS_EX_CLIENTEDGE, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR backcolor=SYS,5 controlindex=0 font=Courier New,9,0 fontupgrade=False forecolor=SYS,8 height=36 left=8 locked=False leftmargin=0 maxlength=0 rightmargin=0 resizerules= seltext=False text= tag= tag2= tooltip= tooltipballoon=False top=109 width=365 [ControlType] CommandButton | PropertyCount=17 | zorder=4 | tabindex=15 | name=cmdCLOSE windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=CLOSE controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=20 left=514 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=456 width=50 [ControlType] CommandButton | PropertyCount=17 | zorder=5 | tabindex=14 | name=cmdSave windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=SAVE TEXTS controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=20 left=432 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=456 width=70 [ControlType] CommandButton | PropertyCount=17 | zorder=1 | tabindex=13 | name=cmdMoveTextFromMsg2ToMsg1 windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Copy txt up controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=25 left=8 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=74 width=83 [ControlType] RichEdit | PropertyCount=19 | zorder=2 | tabindex=12 | name=reText1 windowstyles=WS_CHILD, WS_VISIBLE, WS_HSCROLL, WS_VSCROLL, WS_TABSTOP, ES_LEFT, ES_MULTILINE, ES_AUTOHSCROLL, ES_AUTOVSCROLL, ES_WANTRETURN|WS_EX_CLIENTEDGE, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=173 left=9 locked=False leftmargin=0 maxlength=0 rightmargin=0 resizerules= text= tag= tag2= tooltip= tooltipballoon=False top=209 width=365 [ControlType] External {5D834536-1276-7999-766C-398746547920} | PropertyCount=30 | zorder=1 | tabindex=11 | name=FireTextBox1 windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, WS_CLIPSIBLINGS, WS_CLIPCHILDREN|WS_EX_LEFT, WS_EX_LTRREADING about= custom= designstyle=0 - Traditional backcolor=QB,16777215 backhotcolor=QB,16777215 controlindex=0 font=Tahoma,-11,0,0,0,400,0,0,0,0,0,0,0,0 height=28 locked=False left=8 leftmargin=0 linehotcolor=QB,8388608 linenormalcolor=QB,8421504 readonly=0 - False resizerules=FL,FT,FL,FT rightmargin=0 rightaligntext=0 - False seltext=0 - False showselector=0 - False showtriangle=1 - True tag= tag2= text= textcolor=QB,8388608 texthotcolor=QB,8388608 textdisablecolor=QB,8421504 top=163 width=171 [ControlType] Label | PropertyCount=20 | zorder=1 | tabindex=9 | name=Label1 windowstyles=WS_CHILD, WS_VISIBLE, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, SS_LEFT, SS_NOTIFY|WS_EX_LEFT, WS_EX_LTRREADING backcolor=SYS,15 backstyle=1 - Opaque caption=RichText controlindex=0 font=Segoe UI,9,0 fontupgrade=False forecolor=SYS,8 height=12 identifier=True left=9 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=197 width=45 [ControlType] Label | PropertyCount=20 | zorder=2 | tabindex=10 | name=Label2 windowstyles=WS_CHILD, WS_VISIBLE, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, SS_LEFT, SS_NOTIFY|WS_EX_LEFT, WS_EX_LTRREADING backcolor=SYS,15 backstyle=1 - Opaque caption=FireText controlindex=0 font=Segoe UI,9,0 fontupgrade=False forecolor=SYS,8 height=14 identifier=True left=8 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=150 width=45 [ControlType] CommandButton | PropertyCount=17 | zorder=3 | tabindex=8 | name=cmdCopy windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Copy controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=388 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=211 width=54 [ControlType] CommandButton | PropertyCount=17 | zorder=4 | tabindex=4 | name=cmdPaste windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Paste controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=447 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=211 width=54 [ControlType] CommandButton | PropertyCount=17 | zorder=5 | tabindex=3 | name=cmdUndo windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Undo controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=505 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=211 width=54 [ControlType] CommandButton | PropertyCount=17 | zorder=6 | tabindex=2 | name=cmdNextURL windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=NextURL controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=505 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=324 width=54 [ControlType] CommandButton | PropertyCount=17 | zorder=7 | tabindex=7 | name=cmdFind windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Find controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=505 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=246 width=54 [ControlType] CommandButton | PropertyCount=17 | zorder=8 | tabindex=6 | name=cmdRepeat windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Repeat controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=505 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=266 width=54 [ControlType] TextBox | PropertyCount=22 | zorder=9 | tabindex=5 | name=txtFindTEXT windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, ES_LEFT, ES_AUTOHSCROLL|WS_EX_CLIENTEDGE, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR backcolor=SYS,5 controlindex=0 font=Segoe UI,9,0 fontupgrade=False forecolor=SYS,8 height=24 left=391 locked=False leftmargin=0 maxlength=0 rightmargin=0 resizerules= seltext=False text= tag= tag2= tooltip= tooltipballoon=False top=253 width=104 [ControlType] TextBox | PropertyCount=22 | zorder=10 | tabindex=1 | name=txtFindURL windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, ES_LEFT, ES_AUTOHSCROLL|WS_EX_CLIENTEDGE, WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR backcolor=SYS,5 controlindex=0 font=Segoe UI,9,0 fontupgrade=False forecolor=SYS,8 height=24 left=391 locked=False leftmargin=0 maxlength=0 rightmargin=0 resizerules= seltext=False text= tag= tag2= tooltip= tooltipballoon=False top=312 width=104 [ControlType] CommandButton | PropertyCount=17 | zorder=11 | tabindex=0 | name=cmdFindURL windowstyles=WS_CHILD, WS_VISIBLE, WS_TABSTOP, BS_TEXT, BS_PUSHBUTTON, BS_NOTIFY, BS_CENTER, BS_VCENTER|WS_EX_LEFT, WS_EX_LTRREADING cancel=False caption=Find URL controlindex=0 font=Segoe UI,9,0 fontupgrade=False height=19 left=505 locked=False resizerules= tag= tag2= tooltip= tooltipballoon=False top=304 width=54 [AllCode] '-------------------------------------------------------------------------------- Function FRMPOPUP_WM_CREATE ( _ hWndForm As Dword, _ ' handle of Form ByVal UserData As Long _ ' optional user defined Long value ) As Long Local lRet As Long Local m As String 'during DEVTEST, just get some text into the RE control: m = "There is text in the textbox, and more text on the " & $CrLf & "floor. Search for THE and see if it hits." lRet = FF_RichEdit_SetText(HWND_frmPopup_reText1, m, %TRUE) 'TRUE sets it to PLAIN text - but see below RichEdit_SetSel (HWND_frmPopup_reText1, 5, 10) ' 'maybe I'm having difficulties bc I set the RE text to plain? let's try with unicode: 'm = UCode$(m & Chr$(0,0)) ''lRet = FF_RichEdit_SetText(HWND_frmPopup_reText1, m, %FALSE) 'TRUE sets it to PLAIN text 'SendMessage HWND_FRMPOPUP_RETEXT1, %WM_SETTEXT, 0, StrPtr(m) To lRet 'does SendMessage do the job better? ' SendMessage HWND_FRMPOPUP_RETEXT1, %EM_SETSEL, 20, 30 'although this does not SHOW what's selected, it certainly does get set! 'we have proof when we see the Find routine DEVTEST messages showing the RT SetFocus HWND_FRMPOPUP_txtFindText 'for convenience during DEVTEST End Function '-------------------------------------------------------------------------------- Function FRMPOPUP_CMDCLOSE_BN_CLICKED ( _ ControlIndex As Long, _ ' index in Control Array hWndForm As Dword, _ ' handle of Form hWndControl As Dword, _ ' handle of Control idButtonControl As Long _ ' identifier of button ) As Long 'Font End gfhCourierNew 'etc... ' SaveWindowPosition(gsINI_File, hWndForm, "frmPopup") ' (use a literal for FormName) ' '+++++++++++++++++++++++++++++++++ 'close all window, files, etc. FF_CloseForm hWndForm End Function '-------------------------------------------------------------------------------- Function FRMPOPUP_CMDFIND_BN_CLICKED ( _ ControlIndex As Long, _ ' index in Control Array hWndForm As Dword, _ ' handle of Form hWndControl As Dword, _ ' handle of Control idButtonControl As Long _ ' identifier of button ) As Long Local sUserText As String Local wMainString As wString ' plain text wasn't working, trying wide Local lRet, lStart, lEnd As Long Local ft As FindTextEx 'Be sure both the main box and the search box have text '====================================================== 'search box '---------- 'get the user's search string: sUserText = FF_TextBox_GetText(HWND_FRMPOPUP_txtFindTEXT) If Len(sUserText) = 0 Then ? "HWND_FRMPOPUP_txtFindTEXT is blank!" ,, "DEVTEST - Textbox" Exit Function End If sUserText &= Chr$(0) 'main - may be empty, have text, or have user-selected text... '---- 'if the RE has selected text, get just that; otherwise get all of it. '---- wMainString = RichEdit_GetSelText (HWND_FRMPOPUP_RETEXT1) ' no status flag, so just try it. '? "wMainString = " & wMainString,,"proves the RE_GST() routine is ok" If wMainString = "" Then wMainString = RichEdit_GetText (HWND_FRMPOPUP_RETEXT1) ' nothing selected, get all of it. End If If Len(wMainString) = 0 Then ? "HWND_FRMPOPUP_RETEXT1 is blank!" ,, "DEVTEST - RichEdit" Exit Function End If ? "wMainString = " & wMainString,,"proving the above code works as intended" 'do the search '============= 'what's the RE command for something like INSTR? FindText '----------------- 'Set search range: '----------------- ft.chrg.cpMin = 0 'start at the beginning of the RE text ft.chrg.cpMax = -1 'and go as far as the end ft.lpstrText = StrPtr(sUserText) ? "ft.lpstrText = " & ft.@lpstrText ,, "this is OK" ' we see the whole word as expected lRet = SendMessage(HWND_FRMPOPUP_RETEXT1, %WM_GETTEXTLENGTH, 0, 0) ? "%WM_GETTEXTLENGTH gives us: " & Str$(lRet),,"DEVTEST" ' 94 chars - so we have access to the RE contents 'SetSel BEFORE search *DOES* restrict the search! 'SendMessage HWND_FRMPOPUP_RETEXT1, %EM_SETSEL, 0, 20 ' but %EM_EXSETSEL sent us to limbo then death SendMessage HWND_FRMPOPUP_RETEXT1, %EM_FINDTEXTEX, %FR_DOWN, VarPtr(ft) To lRet '? "lRet = " & Str$(lRet) ,, "result of SendMessage with %EM_FINDTEXTEX" lStart = ft.chrg.cpMin lEnd = ft.chrg.cpMax '? "lRet: " & Str$(lRet) & $CrLf & $CrLf & "lStart: " & Str$(lStart) & $CrLf & "lEnd: " & Str$(lEnd) ,, "DEVTEST" ' 'why didn't those values change after the SendMessage? THIS IS ONE PROBLEM INDICATOR, but WHY? ? "ft.chrg.cpMin: " & Str$(ft.chrg.cpMin) & $CrLf & "ft.chrg.cpMax: " & Str$(ft.chrg.cpMax) & $CrLf & $CrLf & "lRet: " & Str$(lRet) ,, "DEVTEST" 'no diff, the search just did not execute properly... 'show the result SendMessage HWND_FRMPOPUP_RETEXT1, %EM_SETSEL, lRet, 0 'if lRet = -1, carat is placed at the end... SetFocus HWND_FRMPOPUP_RETEXT1 If lRet > 1 Then ? "found a match from: " & Str$(ft.chrg.cpMin) & " to: " & Str$(ft.chrg.cpMax) & $CrLf ,, "DEVTEST" End Function