Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[module] HiEdit 4.0.0.4-5


  • Please log in to reply
220 replies to this topic

Poll: Do you want HiEdit internaly (103 member(s) have cast votes)

Do you want HiEdit internaly

  1. Voted Yes (76 votes [61.79%])

    Percentage of vote: 61.79%

  2. No, I like Edit control (31 votes [25.20%])

    Percentage of vote: 25.20%

  3. Other (please explain) (16 votes [13.01%])

    Percentage of vote: 13.01%

Vote Guests cannot vote
Mystiq
  • Members
  • 83 posts
  • Last active: Nov 06 2011 07:07 PM
  • Joined: 08 Jan 2007

Here is a function for getting the text off of one because I couldn't find one, pretty simple but it works:

HE_GetText(c="", w="") {
;c is the control ClassNN, defaults to HiEdit1
;w is the window title, defaults to nothing
  If c=
  {
    c=HiEdit1
  }
  ControlGetText,t,%c%,%w%
  return t
}

And also I have yet another request (I am using this control in a program :D). Could you somehow make a function that let's you choose the syntax to use instead of it being selected just by the file extension? So then a user could select the syntax from a menu...


Heres another way. Also i'm aware that i could do select/replace/etc to archive the same thing. :)

HE_GetText(hEdit){
	ControlGetText, t, , ahk_id %hEdit%
Return t
}

HE_SetText(hEdit, txt=""){
	ControlSetText, , %txt%, ahk_id %hEdit%
Return ErrorLevel
}

Update:

I quickly made these functions using the sendmessage, adapted from existing, but for some reason "WM_SETTEXT" returns false even though text is set. It should return true according to the "HiEdit.inc". Otherwise these seem to work...

HE_SetText(hEdit, txt=""){
	static  WM_SETTEXT:=0xC
	
	SendMessage, WM_SETTEXT, 0, &txt,, ahk_id %hEdit% 
	Return ErrorLevel
}

HE_GetText(hEdit, len=-1){
	static WM_GETTEXT:=0xD
	
	if (len=-1)
		len := HE_GetTextLength(hEdit)
	IfEqual,len,0,return
	VarSetCapacity(txt, len+1, 0)
	SendMessage WM_GETTEXT, len+1, &txt, , ahk_id %hEdit%
    if ErrorLevel=FAIL ;-- Test remains as a fail-safe 
	{ 
        Msgbox %A_ThisFunc% failed. 
        return 
    } 
	VarSetCapacity(txt,-1)
	Return txt
}

Cheers!

jballi
  • Members
  • 1015 posts
  • Last active:
  • Joined: 01 Oct 2005

HE_GetText and HE_SetText functions

I wrote these same two functions a while back but for some reason, I never submitted them. I also made the same observations about the return codes that you did. Thanks for filling the gap and submitting these functions. I hope that majkinetor adds them to the library.

For the HE_SetText function, I made the the following observation which can be added as a Remark.

Unlike the standard Edit control, the HiEdit control does not reset the Undo flag when it receives the WM_SETTEXT message. Reset it manually with the HE_EmptyUndoBuffer function if needed.

For the HE_GetText function, my rudimentary benchmarks found that the EM_GETTEXTRANGE message is ~2 times faster than the WM_GETTEXT message for the same amount of text. I reported this idiosyncratic on the winasm.net forum but there has not been a response. I think development of the HiEdit control has stopped, at least for now.

To use the EM_GETTEXTRANGE message until the HE_GetText function is added or instead of the HE_GetText function, use the HE_GetTextRange function using following syntax:
HE_GetTextRange(hEdit)  ;-- The default range is all text


majkinetor
  • Moderators
  • 4512 posts
  • Last active: Oct 02 2013 02:33 PM
  • Joined: 24 May 2006
I added this among the notes on the first page for now.

Thanks.

Types
  • Members
  • 11 posts
  • Last active: Apr 03 2011 01:51 PM
  • Joined: 17 Apr 2010
please call me dumb, but....How to use this editor? I really don't get it...

  • Guests
  • Last active:
  • Joined: --

please call me dumb, but....How to use this editor? I really don't get it...


lol :lol:
its a control, not an editor
use Vic or Quick AHK instead if you want an editor based on HiEdit

autokeyminer
  • Members
  • 12 posts
  • Last active: Dec 01 2011 04:59 PM
  • Joined: 21 May 2010
:idea:

'Do you want HiEdit internaly'

I am a new member and I think the forum supplies all that we need of it. Well done organisers. Bravo.

I did not see the [mispelling in English] title when looking for more info about HiEdit which says it is a vote, and a rant about the voting.

After reading a cyclical argument for a half hour I fell asleep. When I awoke, I read on. The topic later changed to people giving some info which I wanted about the control.

I am humbly learning AHK, but I should point out that there should have been a notice in page 1 to keep the thread clean, and to redirect those with HiEdit problems/solutions to a new thread for that purpose.

Also doesn't anyone use the spellchecker, anymore? I am as guilty as the rest of making typos, but I use a spellchecker. The aforementioned observations are not implied offense, but are well-meant suggestions to improve the legibility, and to find what you are interested in, much faster, by making the search easier. We all like ways to save time, don't we?

Also, users who are just struggling to learn English, will naturally propagate the mispellings which they assume are the correct ones. So let's help each other, by being more organised. Thanks.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: Oct 02 2013 02:33 PM
  • Joined: 24 May 2006
Yet, you somehow managed to talk about most unimportant thing in the world relative to the AHK or HiEdit - this is not "learn English in 7 days" forum. You obviously wanted to visit thisplace....

About your "fell a sleep problem", you should rly redirect your anger to the BBcode team which didn't supply search within a thread, or improve things yourself since you have great ideas. I tried it myself by introducing "Thread Highlights" on the first page but since it obviously failed, it must be that I was not thinking in right direction....

At the end, I am sorry I didn't fulfill your high standards. I will try 2 be more organised in the future.


Thanks.

:idea:

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006

Thread Highlights
[*:s0dartr7] About regular expression syntax highlighting

Hi majkinetor, yeah, I made it to the thread highlights. :D Does this mean HiEdit supports now that kind of syntax or is this still a wish point? My dream editor should actually do only this, together with pasting of RTF formatted contents and also displaying the RTF content correctly. It would be kind of richedit control for pasted RTF contents... right now I am using instead the "RTF exporting/copying into clipboard" feature of Notepad++, then pasting from the Clipboard into eTabula, which is a free RTF editor. The RTF re-formatting capabilities I want mainly for being able to emphasize different text chunks differently, to make the life of readers easier. This should be the point of any way of communication, our goal should be using clear, open, unhidden, uncoded message, so the reader gets happy and energized and learns something new. One more point what an editor should be capable of doing: Control-Mousewheel to change the global text size, as e.g. available in Notepad++. Also support for vim style editing. Also having a special double view mode, where the second additional view is permanently in "print preview using screen paper size divided by two" for the current paragraph only or the selected text chunk only!

majkinetor
  • Moderators
  • 4512 posts
  • Last active: Oct 02 2013 02:33 PM
  • Joined: 24 May 2006
Yes, you are right. You want the best thing from the editors around combined.

In your list, I would include some more : column select and generally better selection (to copy, delete and type over) and easy built in language (like Lua or AHK) for command extension.

RegEx highlighting was just a wish.
RTF displaying / export is something you could do with combined modules (both from Forms framework: HiEdit/RichEdit). There is a need for RTF module for programatic text crafting ( I already started it and made RTF_Table(....) however my interest in RTF language is not so big).

You could generally made such editor in AHK using mentioned modules (altho RegEx highlight would not get into it). It would be very advanced project tho.

On related note, you should perhaps try E-editor. It has some neat things none of the popular editors have (including VIM).

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006
E-editor, have you any url? I checked google but I am not sure what you mean.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: Oct 02 2013 02:33 PM
  • Joined: 24 May 2006
<!-- m -->http://www.e-texteditor.com/<!-- m -->

automaticman
  • Members
  • 658 posts
  • Last active: Nov 20 2012 06:10 PM
  • Joined: 27 Oct 2006
Thank you majkinetor.

DHMH
  • Members
  • 230 posts
  • Last active: Mar 25 2012 10:34 AM
  • Joined: 17 Jul 2008
Hi,

I have one question:
Is it possible to add "Line Intention" Support for HiEdit?
Because I want to add it to my (new version of) Realtime Browser.
Thanks in advance!

Greeting,
DHMH

majkinetor
  • Moderators
  • 4512 posts
  • Last active: Oct 02 2013 02:33 PM
  • Joined: 24 May 2006
line intetion ?

btw, keep in mind that hiedit isnt unicode (if u want to switch to ahkl in the future)

DHMH
  • Members
  • 230 posts
  • Last active: Mar 25 2012 10:34 AM
  • Joined: 17 Jul 2008
Thanks for your reply.
I mean this:

If you press "TAB" in Notepad++ and after that press enter, on the next line you're cursor is at the position if you also pressed TAB at that line.
Maybe I can create a short video, later :p
lg DHMH