 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Do you want HiEdit internaly |
| Yes |
|
52% |
[ 37 ] |
| No, I like Edit control |
|
28% |
[ 20 ] |
| Other (please explain) |
|
19% |
[ 14 ] |
|
| Total Votes : 71 |
|
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Sun Sep 06, 2009 10:57 am Post subject: |
|
|
Ye, you can safely remove it for now.
It was serving for Panel control so it can add it as is child. _________________
 |
|
| Back to top |
|
 |
Scratch
Joined: 22 Jan 2009 Posts: 72
|
Posted: Mon Sep 07, 2009 12:59 am Post subject: other |
|
|
I chose other,
as on the one hand I understand Chris concern about keeping the AHK footprint as fast and lean as possible
on the other hand, HiEdit seems a worthwhile addition, specially for developers, so, maybe it would make sense in the future to have two
official releases:
- AHK Standard Edition, lean, mean
- AHK Developer Edition, a beefed up version of the standard edition,
including Hiedit and other SDK tools that makes life easier for the hardcore programmer.
Naturally, the Developer version includes also the standard version, so that they can compile their final code without SDK overhead. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Mon Sep 07, 2009 12:10 pm Post subject: |
|
|
Actually, I changed my mind about this.
HiEdit works perfectly as AHK module, and it will probably be even easier to integrate it in the future.
Lexikos developed some nice things that make stdlib creation more flexibile in the meantime and from what I know that trend will continue.
This poll was created in the time when means of extending AHK were close to zero. _________________
 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Wed Sep 23, 2009 2:49 pm Post subject: |
|
|
*** version 4.0.0.4-2 ***
* All globals removed. Using function as handler instead of subroutine. See SetEvents docs.
* OnNotify method improved for peaceful coexistence with other custom controls.
+ Sample search function updated - now F3 starts searching from the top if nothing was found in the remaining text.
* Sample uses latest Dlg.ahk (instead CmnDlg).
* Sample uses Attach instead of Anchor. _________________
 |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Thu Sep 24, 2009 4:55 am Post subject: |
|
|
Thanks for the update.  |
|
| Back to top |
|
 |
wiseley
Joined: 22 Apr 2009 Posts: 21
|
Posted: Thu Sep 24, 2009 11:44 am Post subject: |
|
|
majkinetor, i just want you to that there's a lot of people including me who appreciate you and other ahk soldier's contributions to ahk.
you've really shown that, there's no limitation to the possibilities of ahk.
thanx  |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Sat Sep 26, 2009 3:32 am Post subject: |
|
|
A few additional HiEdit functions that I've been using lately. Please feel free to add, modify, and/or ignore.
| Code: | ;-------------------------------------------------------------------------------
; Function: HE_GetRect
;
; Gets the formatting rectangle of the HiEdit control.
;
;
; Parameters:
;
; Left, Right, Top, Botttom - These parameters, which must contain
; valid variable names, are used to return the formatting rectangle of
; the HiEdit control.
;
;
; Returns:
;
; {None}. Coordinates are returned in the ByRef parameters.
;
;
HE_GetRect(hEdit,ByRef Left,ByRef Top,ByRef Right,ByRef Bottom)
{
Static EM_GETRECT:=0xB2
VarSetCapacity(RECT_Structure,16,0)
SendMessage EM_GETRECT,0,&RECT_Structure,,ahk_id %hEdit%
Left :=NumGet(RECT_Structure,0,"Int")
Top :=NumGet(RECT_Structure,4,"Int")
Right :=NumGet(RECT_Structure,8,"Int")
Bottom:=NumGet(RECT_Structure,12,"Int")
return
}
;-------------------------------------------------------------------------------
; Function: HE_CharFromPos
;
; Gets information about the character closest to a specified point
; in the client area of the HiEdit control.
;
;
; Parameters:
;
; x, y - The x/y-coordinates of a point in the HiEdit control's client
; area relative to the upper-left corner of the client area.
;
;
; Returns:
;
; The character index of the specified point or the character index to
; the last character if the given point is beyond the last character
; in the control.
;
;
HE_CharFromPos(hEdit,x,y)
{
Static EM_CHARFROMPOS:=0xD7
SendMessage EM_CHARFROMPOS,0,(y<<16)|x,,ahk_id %hEdit%
return ErrorLevel
}
;-------------------------------------------------------------------------------
; Function: HE_PosFromChar
;
; Gets the client area coordinates of a specified character in the
; HiEdit control.
;
;
; Parameters:
;
; iChar - The zero-based index of the character.
;
; x, y - These parameters, which must contain valid variable names,
; are used to return the x/y-coordinates of a point in the HiEdit
; control's client relative to the upper-left corner of the client
; area.
;
;
; Returns:
;
; {None}. The coordinates are returned in ByRef parameters.
;
; Note: If iChar is greater than the index of the last character in
; the control, the returned coordinates are of the position just past
; the last character of the control.
;
;
HE_PosFromChar(hEdit,iChar,ByRef x,ByRef y)
{
Static EM_POSFROMCHAR:=0xD6
VarSetCapacity(POINTL_Structure,8,0)
SendMessage EM_POSFROMCHAR,&POINTL_Structure,iChar,,ahk_id %hEdit%
x:=NumGet(POINTL_Structure,0,"Int")
y:=NumGet(POINTL_Structure,4,"Int")
return
}
;-------------------------------------------------------------------------------
; Function: HE_GetLastVisibleLine
;
; Returns the zero-based line index of the last visible (including
; partially displayed) line on the HiEdit control.
;
; Remarks:
;
; To calculate the total number of visible lines, use the following:
;
; HE_GetLastVisibleLine(hEdit)-HE_GetFirstVisibleLine(hEdit)+1
;
;
HE_GetLastVisibleLine(hEdit)
{
HE_GetRect(hEdit,Left,Top,Right,Bottom)
return HE_LineFromChar(hEdit,HE_CharFromPos(hEdit,0,Bottom))
}
;-------------------------------------------------------------------------------
; Function: Cut, Copy, Paste, Clear (aka Delete)
;
; Standard edit commands for the HiEdit control.
;
;
; Returns:
;
; {None}
;
;
; Remarks:
;
; These messages are more efficent/reliable than sending the
; associated shortcut keys (Ctrl+X, Ctrl+C, etc.) to the HiEdit
; control.
;
;
HE_Cut(hEdit)
{
Static WM_CUT:=0x300
SendMessage WM_CUT,0,0,,ahk_id %hEdit%
return
}
HE_Copy(hEdit)
{
Static WM_COPY:=0x301
SendMessage WM_COPY,0,0,,ahk_id %hEdit%
return
}
HE_Paste(hEdit)
{
Static WM_PASTE:=0x302
SendMessage WM_PASTE,0,0,,ahk_id %hEdit%
return
}
HE_Clear(hEdit)
{
Static WM_CLEAR:=0x303
SendMessage WM_CLEAR,0,0,,ahk_id %hEdit%
return
}
;-------------------------------------------------------------------------------
; Function: HE_CanPaste
;
; Determines whether a HiEdit control can paste a specified clipboard
; format.
;
;
; Parameters:
;
; ClipboardFormat - The default is 0x1 (CF_TEXT).
;
;
; Returns:
;
; TRUE if the clipboard format can be pasted otherwise FALSE.
;
;
; Remarks:
;
; The HiEdit control supports the standard clipboard text formats --
; CF_TEXT, CF_OEMTEXT, CF_UNICODETEXT (for Windows versions that
; support Unicode), and CF_LOCALE (used by the OS to implicitly
; convert from CF_TEXT to CF_UNICODETEXT). If any application copies
; text of any type to the clipboard, it will usually copy the text to
; one (usually all, depending on the OS) of these clipboard formats.
;
; For additional information on clipboard formats, see the following:
;
; http://msdn.microsoft.com/en-us/library/ms649013(VS.85).aspx
;
;
; Observations:
;
; Despite the HiEdit documentation, sending zero as the clipboard
; format never returns a non-zero (can paste) value regardless of
; the contents of the clipboard. [Bug]
;
;
HE_CanPaste(hEdit,ClipboardFormat=0x1) ;-- 0x1=CF_TEXT
{
Static EM_CANPASTE:=1074 ;-- 1074=WM_USER+50
SendMessage EM_CANPASTE,ClipboardFormat,0,,ahk_id %hEdit%
return ErrorLevel ? True : False
}
|
|
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Sat Sep 26, 2009 9:14 am Post subject: |
|
|
Very nice jballi. Thanks again.
Ill definitelly include some/all of them. _________________
 |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Fri Oct 02, 2009 5:59 am Post subject: |
|
|
A couple of tiny functions that I missed on the last round.
| Code: | ;-------------------------------------------------------------------------------
; Function: HE_CanUndo
;
; Returns TRUE if the HiEdit control can correctly process the
; EM_UNDO message.
;
;
HE_CanUndo(hEdit)
{
Static EM_CANUNDO:=0xC6
SendMessage EM_CANUNDO,0,0,,ahk_id %hEdit%
return ErrorLevel
}
;-------------------------------------------------------------------------------
; Function: HE_CanRedo
;
; Returns TRUE if the HiEdit control can correctly process the
; EM_REDO message.
;
;
HE_CanRedo(hEdit)
{
Static EM_CANREDO:=1109 ;-- 1109=WM_USER+85
SendMessage EM_CANREDO,0,0,,ahk_id %hEdit%
return ErrorLevel
}
|
|
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Fri Oct 02, 2009 10:10 am Post subject: |
|
|
Thanks, I merged them and released new module version. _________________
 |
|
| Back to top |
|
 |
paxophobe
Joined: 10 Nov 2007 Posts: 93 Location: Second star to the right.... watching you.
|
Posted: Sat Oct 03, 2009 1:34 am Post subject: |
|
|
I vote no, put it in the standard lib.
Keep ahk small.
Side note: Thank you majkinetor for all your contributions. |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Sat Oct 03, 2009 3:02 am Post subject: |
|
|
Thanks for the update. Found a minor code typo in the HE_GetRect function.
| Code: | | Bottom:=NumGet(RECTe,12,"Int") |
Should be:
| Code: | | Bottom:=NumGet(RECT,12,"Int") |
The HE_GetLastVisibleLine function does not work correctly because of the typo.
Also, the HE_CanRedo function is returning an unexpected value (5) when a redo is available. Although technically still returning a TRUE value, the function might be more correctly written as follows:
| Code: | HE_CanRedo(hEdit)
{
Static EM_CANREDO:=1109 ;-- 1109=WM_USER+85
SendMessage EM_CANREDO,0,0,,ahk_id %hEdit%
return ErrorLevel ? True : False
}
|
Thanks for your help. |
|
| Back to top |
|
 |
Normand
Joined: 21 May 2007 Posts: 63
|
Posted: Tue Dec 01, 2009 4:39 am Post subject: |
|
|
It seems to be impossible to display some characters on certain circumstances in HiEdit control.
When syntactic coloration is OFF, all 256 so-called "ANSI" characters (in fact, Windows-1252) can be displayed (see the list below). And it is possible to display all of them in any foreground/background color setting.
But when syntactic coloration is ON, 54 characters stays in black whatever the color setting choosed (those characters are in red in the list below). And that's the reason why they don't appear at all on a black background color.
Windows-1252 character set
In red, problematic characters in HiEdit control when syntactic coloration is ON | Code: | ¦ 0 1 2 3 4 5 6 7 8 9
-----+---------------------------------------------------
000 ¦ NUL SOH STX ETX EOT ENQ ACK BEL BS TAB
010 ¦ LF VT FF CR SO SI DLE DC1 DC2 DC3
020 ¦ DC4 NAK SYN ETB CAN EM SUB ESC FS GS
030 ¦ RS US SP ! " # $ % & '
040 ¦ ( ) * + , - . / 0 1
050 ¦ 2 3 4 5 6 7 8 9 : ;
060 ¦ < = > ? @ A B C D E
070 ¦ F G H I J K L M N O
080 ¦ P Q R S T U V W X Y
090 ¦ Z [ \ ] ^ _ ` a b c
100 ¦ d e f g h i j k l m
110 ¦ n o p q r s t u v w
120 ¦ x y z { | } ~ €
130 ¦ ‚ ƒ „ … † ‡ ˆ ‰ Š ‹
140 ¦ Œ Ž ‘ ’ “ ” •
150 ¦ – — ˜ ™ š › œ ž Ÿ
160 ¦ NBS ¡ ¢ £ ¤ ¥ ¦ § ¨ ©
170 ¦ ª « ¬ shy ® ¯ ° ± ² ³
180 ¦ ´ µ ¶ · ¸ ¹ º » ¼ ½
190 ¦ ¾ ¿ À Á Â Ã Ä Å Æ Ç
200 ¦ È É Ê Ë Ì Í Î Ï Ð Ñ
210 ¦ Ò Ó Ô Õ Ö × Ø Ù Ú Û
220 ¦ Ü Ý Þ ß à á â ã ä å
230 ¦ æ ç è é ê ë ì í î ï
240 ¦ ð ñ ò ó ô õ ö ÷ ø ù
250 ¦ ú û ü ý þ ÿ
|
As Majkinetor said, with HiEditor or HiEditDemo this problem doesn't happen with the character number 96 (`). But it still with all 53 others.
I hope these observations can help to solve the problem.
HiEdit is great. Thanks a lot for it!
Edit 1
Fincs' remark is right. So, I updated my post to take it into account. _________________ Normand Lamoureux
Last edited by Normand on Wed Dec 02, 2009 6:46 pm; edited 5 times in total |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Tue Dec 01, 2009 8:05 am Post subject: |
|
|
Hej, thats great observation. _________________
 |
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 474 Location: Seville, Spain
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|