Modify ↓

#4111 new Feature Request

GuiEdit Extensions

Reported by: MattyD Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:

Description

Hi JPM,

Just a couple suggestions for expanding GuiEdit.au3, because I've been given a gentle nudge to submit them :)
I have an attachment sitting in ​this thread with the following extensions and a couple of examples:

Clipboard messages. (WM_CUT etc.)
 _GuiCtrlEdit_Clear - removes selected text.
 _GuiCtrlEdit_Copy
 _GuiCtrlEdit_Cut
 _GuiCtrlEdit_Paste

End of line funcs. (EM_SETENDOFLINE/EM_GETENDOFLINE) 
Includes "allowed" line-breaking chars and autodetect features.
 _GuiCtrlEdit_GetEOL
 _GuiCtrlEdit_GetEOLEx
 _GuiCtrlEdit_SetEOL
 _GuiCtrlEdit_SetEOLEx
 
Zoom funcs. (EM_SETZOOM etc.)
 _GuiCtrlEdit_GetIsZoomable
 _GuiCtrlEdit_GetZoom
 _GuiCtrlEdit_SetIsZoomable
 _GuiCtrlEdit_SetZoom

I was also thinking that wrapping WM_GETFONT/WM_SETFONT probably makes sense here too for an Edit control. So perhaps something simple like this is worth considering as well?

; #FUNCTION# ====================================================================================================================
; Name ..........: _GUICtrlEdit_SetFont
; Description ...: Sets a control's font
; Syntax ........: _GUICtrlEdit_SetFont($hWnd, $hFont[, $bRedraw = True])
; Parameters ....: $hWnd                - Control handle or control ID.
;                  $hFont               - The font handle (HFONT) to set.
;                  $bRedraw             - [optional] If True, the control is redrawn after setting the new font. Default is True.
; Return values .: None
; Remarks .......: Font handles are not freed automatically. Both old and new should be passed to _WinAPI_DeleteObject() when
;                  they are no longer required.
; ===============================================================================================================================
Func _GUICtrlEdit_SetFont($hWnd, $hFont, $bRedraw = True)
        If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
        Return _SendMessage($hWnd, $WM_SETFONT, $hFont, $bRedraw)
EndFunc   ;==>_GUICtrlEdit_SetFont

; #FUNCTION# ====================================================================================================================
; Name ..........: _GUICtrlEdit_GetFont
; Description ...: Gets a control's font handle
; Syntax ........: _GUICtrlEdit_GetFont($hWnd)
; Parameters ....: $hWnd                - Control handle or control ID.
; Return values .: a font handle (HFONT)
; ===============================================================================================================================
Func _GUICtrlEdit_GetFont($hWnd)
        If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
        Return _SendMessage($hWnd, $WM_GETFONT, 0, 0, 0, "wparam", "lparam", "handle")
EndFunc   ;==>_GUICtrlEdit_GetFont

Many thanks,
Matt

Attachments (0)

Change History (0)

Modify Ticket

Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.