Jump to content

Recommended Posts

  • AutoBert changed the title to New function's for GuiRichEdit => GuiRichEditPlus
Posted

Tested with some files from my PC, it works good in most of the cases. With certain filenames (containing underscores, unicode characters, etc) the insert function fails but it works pretty good in most cases.

Posted (edited)
  On 2/5/2023 at 9:49 PM, Andreik said:

With certain filenames (containing underscores, unicode characters, etc) the insert function fails

Expand  

I will have a look at this. A hotfix for  underscores: disable first line from 

Func _GUICtrlRichEdit_insertFileLink($hWnd, $sFile, $sDisplay, $bCRLF = False)
    ;autor autoBert
    If Not FileExists(StringReplace($sFile, '_', ' ')) Then Return SetError(1, 1, '')

in this line i check for file existing. The _GUICtrlRichEdit_GetFileLink fails with these links. You can hotfix with changing in _GUICtrlRichEdit_GetFileLink

$sLink = StringReplace(StringReplace(_GUICtrlRichEdit_GetTextInRange($hWnd, $cpMin, $cpMax), 'File:', ''), '_', ' ')

to

$sLink = StringReplace(_GUICtrlRichEdit_GetTextInRange($hWnd, $cpMin, $cpMax), 'File:', '')

 

Edited by AutoBert
Posted

It's good but these two lines

Local Const $sbinDisplay = '{\fldrslt\ul\cf1'
Local Const $sbinEndLine = '\ul0\cf0}}\f0\fs17'

can cause problems also, because if the filename starts with a number it won't work correctly. Most probably a space after cf1 and fs17 would fix this.

Posted (edited)
  On 2/7/2023 at 10:23 PM, Andreik said:

if the filename starts with a number it won't work correctly.

Expand  

Just tested with such a filename:

+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop.
encoding False
$EN_LINK
insertFileLink: C:\Users\(len)Bert\Downloads\Rezepte\1 Allgäuer Bauernschnitzel mit Petersilienkartöffelchen und Preiselbeeren.pdf     1 Allgäuer Bauernschnitzel mit Petersilienkartöffelchen und Preiselbeeren.pdf 
{\rtf1{\field{\*\fldinst{HYPERLINK "File:\\\\C:\\\\Users\\\\(len)Bert\\\\Downloads\\\\Rezepte\\\\1 Allgäuer Bauernschnitzel mit Petersilienkartöffelchen und Preiselbeeren.pdf"}}{\fldrslt\ul\cf1 1 Allgäuer Bauernschnitzel mit Petersilienkartöffelchen und Preiselbeeren.pdf \ul0\cf0}}\f0\fs17}}}}\par\par}
    True|0
1 FileLinks inserted
$EN_LINK
$EN_LINK
$EN_LINK
File:\C:\Users\(len)Bert\Downloads\Rezepte\1 Allgäuer Bauernschnitzel mit Petersilienkartöffelchen und Preiselbeeren.pdf: 0|0
$EN_LINK

a test with the a space after both const's makes no differences in resutlt: "It works for me" so by the next update these is changed.  

Edited by AutoBert
Posted (edited)

A newer Version is in #1, Added: _GUICtrlRichEdit_insertLink which should work with Files also, if not use _GUICtrlRichEdit_insertFileLink.

 

Edit: added: _GUICtrlRichEdit_AppendTextEx (Original from @corgano). I plan to integrate settings for bkColor and CharAttributes.

Edited by AutoBert
Posted
  On 2/10/2023 at 7:11 PM, AutoBert said:

a RTF printing routine

Expand  

Take a look for 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 2/10/2023 at 7:11 PM, AutoBert said:

converter routine to PDF format

Expand  

IT is possible with Open/Libre Office SDK.

 

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@AutoBert please reedit your post and change code by changing #CS #CE to #cs #ce

becuase Code highlighting on web page will be fixed when you do this.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

not all:

FUNC _GUICTRLRICHEDIT_INSERTLINK($HWND, $SURL, $SDISPLAY, $BCRLF = FALSE, $BENCODE = $G_BENCODE)
    #cs
        CAN BE USED FOR ALL LINKS, IF NOT WORK FOR FILES USE _GUICTRLRICHEDIT_INSERTFILELINK
    ;AUTOR AUTOBERT
    #CE
    $SDISPLAY = ' ' & $SDISPLAY & ' '
    IF $G_REDEBUG THEN CONSOLEWRITE('INSERTLINK: ' & $SURL & @TAB & $SDISPLAY & @CRLF)
    LOCAL CONST $ALINKS[4] = ['HTTP:', 'FTP:', 'WWW.', 'HINT:']
    LOCAL $SMODE = '/\'

should be:

FUNC _GUICTRLRICHEDIT_INSERTLINK($HWND, $SURL, $SDISPLAY, $BCRLF = FALSE, $BENCODE = $G_BENCODE)
    #cs
        CAN BE USED FOR ALL LINKS, IF NOT WORK FOR FILES USE _GUICTRLRICHEDIT_INSERTFILELINK
    ;AUTOR AUTOBERT
    #ce
    $SDISPLAY = ' ' & $SDISPLAY & ' '
    IF $G_REDEBUG THEN CONSOLEWRITE('INSERTLINK: ' & $SURL & @TAB & $SDISPLAY & @CRLF)
    LOCAL CONST $ALINKS[4] = ['HTTP:', 'FTP:', 'WWW.', 'HINT:']
    LOCAL $SMODE = '/\'

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...