Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rich Text Editor to HTML
#1
First, I thought I saw a Rich Text Editor somewhere before in QM...can't seem to find that. Help there?

2nd, Once text is formatted in a Rich Text Editor, how would you format in HTML and output to a file?

Thanks,
Jimmy Vig
#2
QM does not have a rich text editor.

There are no such functions. Maybe you can find a COM component or dll or command line program on the internet that does it.

It is possible to create an HTML editor in a QM dialog, with limited possibilities. An example is somewhere in the forum.
#3
Would be pretty cool to have a dialog that could do this...

Any plans to ever work out a Rich Text Editor?
#4
No.
#5
Quote:It is possible to create an HTML editor in a QM dialog, with limited possibilities. An example is somewhere in the forum.

Does anyone have any idea where this example is? I've been looking and can't fine it yet Confusedhock:
#6
It should be somewhere but I could not find too.

Function dlg_html_editor
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str ax3SHD
ax3SHD="<HTML></HTML>"
if(!ShowDialog("dlg_html_editor" &dlg_html_editor &controls 0 0 0 0 0 0 0 "" "dlg_html_editor")) ret

;BEGIN DIALOG
;0 "" 0x90CF0A40 0x100 0 0 489 360 ""
;3 ActiveX 0x54030000 0x0 0 0 444 322 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2030009 "*" "" ""

ret
;messages
type DHEDATA hDlg hwb MSHTML.IHTMLDocument2'doc
DHEDATA- t

sel message
,case WM_INITDIALOG
,t.hDlg=hDlg; t.hwb=id(3 hDlg)
,SHDocVw.WebBrowser we3
,we3._getcontrol(t.hwb); t.doc=we3.Document
,t.doc.designMode="On"
,dlg_html_editor hDlg WM_SIZE 0 0
,PostMessage hDlg WM_APP 0 0 ;;sometimes cannot get HTML now
,
,case WM_APP
,DHE_OpenSave -1
,
,case WM_DESTROY
,
,case WM_SIZE
,RECT rc; GetClientRect hDlg &rc; MoveWindow t.hwb 0 0 rc.right rc.bottom 1
,
,case WM_INITMENUPOPUP
,_s=t.doc.designMode
,CheckMenuItem wParam 301 iif(_s~"On" 0 MF_CHECKED)
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 100 ;;New
,DHE_OpenSave 0
,
,case 101 ;;Open
,DHE_OpenSave 1
,
,case [102,103] ;;Save, Save As
,DHE_OpenSave wParam-100
,
,case 301 ;;Browse Mode
,_s=t.doc.designMode; t.doc.designMode=iif(_s~"On" "Off" "On")
,
,case 901 ;;Help
,mes "Right click to insert image etc" "" "i"
,
,case IDCANCEL
,if(!DHE_OpenSave(4)) ret
ret 1

err+ mes "Error: %s[]In: %s" "" "!" _error.description _error.line

;BEGIN MENU
;>&File
,;&New : 100 0 0 Cn
,;&Open : 101 0 0 Co
,;&Save : 102 0 0 Cs
,;Save &As... : 103
,;-
,;>&Recent
,,;not implemented : 190 0 1
,,;<
,;-
,;E&xit : 2 0 0 AF4
,;<
;>&Edit
,;Empty : 201 0 1
,;<
;>&View
,;Browse Mode : 301 0 0 Cb
,;<
;&Help : 901 0
;END MENU

Function DHE_OpenSave
Code:
Copy      Help
;/dlg_html_editor
function! action ;;action: -1 init, 0 new, 1 open, 2 save, 3 save as, 4 exit

DHEDATA- t
str-- openfile ;;current file
int-- crc ;;CRC of saved HTML. Used to get dirty.
str sf sd

sel action
,case [0,1,4]
,if(DHE_GetHtml!=crc) ;;dirty
,,sel mes("Save changes?" "" "YNC?")
,,,case 'Y'
,,,if(!DHE_OpenSave(2)) ret
,,,case 'C' ret
,case 2 if(!openfile.len) action=3

sel(action)
,case [1,3] if(!OpenSaveDialog(action=3 sf "Html files[]*.htm;*.html[]All files[]*" "htm")) ret
,case 4 ret 1

sel action
,case 0 ;;new
,sd="<HTML></HTML>"; sd.setwintext(t.hwb)
,openfile.all
,
,case 1 ;;open
,sd.getfile(sf); sd.setwintext(t.hwb)
,openfile=sf
,
,case [2,3] ;;save
,MSHTML.IHTMLDocument3 doc3=+t.doc
,sd=doc3.documentElement.outerHTML
,sd.setfile(iif(action=2 openfile sf))
,if(action=3) openfile=sf
,

crc=DHE_GetHtml

sel(action) case [-1,0,1,3] _s.from("QM HTML Editor - " openfile) _s.setwintext(t.hDlg)

sel action
,case [1,3] ;;add to recent
,;if(rget(sf

ret 1
err+ end _error

Function DHE_GetHtml
Code:
Copy      Help
;/dlg_html_editor
function# [str&s]

if(!&s) &s=_s
DHEDATA- t
MSHTML.IHTMLDocument3 doc3=+t.doc
s=doc3.documentElement.outerHTML
ret Crc32(s s.len)


Forum Jump:


Users browsing this thread: 1 Guest(s)