Custom Query (3922 matches)
Results (391 - 393 of 3922)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #2485 | Fixed | Selection goes invisible after _GUICtrlRichEdit_GetFont | ||
| Description |
In a RichEdit control, the selection goes invisible (not the text, the highlighting) after using UDF _GUICtrlRichEdit_GetFont. The selection remains invisible even if _GUICtrlRichEdit_SetSel is used afterwards. The script below will demonstrate this. Run the script and click the button to get started. A series of message boxes will pause the script at each step for verification. FYI, this causes another issue that will be reported in in bugtracker "_GUICtrlRichEdit_GetFont does not return an empty string for mixed fonts". #include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $hRichEdit, $hGui, $iMsg, $btnNext, $aFontAtts
$hGui = GUICreate("_GUICtrlRichEdit_GetFont", 300, 150, (@DesktopWidth - 300) / 2, 100)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "Selection NOT visible after _GUICtrlRichEdit_GetFont", 10, 10, 300, 90, BitOR($ES_MULTILINE, $ES_NOHIDESEL))
$btnNext = GUICtrlCreateButton(" Click Me To Start ", 110, 110)
GUISetState()
While True
$iMsg = GUIGetMsg()
Select
Case $iMsg = $GUI_EVENT_CLOSE
_GUICtrlRichEdit_Destroy($hRichEdit)
Exit
Case $iMsg = $btnNext
GUICtrlSetState($btnNext, $GUI_DISABLE)
_GUICtrlRichEdit_SetSel($hRichEdit, 0, 9) ; <<<< Selection is visible.
MsgBox(4096, "1", "The word 'Selection' should be visually selected!")
$aFontAtts = _GUICtrlRichEdit_GetFont($hRichEdit) ; <<<< Causes selection to go invisible.
MsgBox(4096, "2", _
"The UFD _GUICtrlRichEdit_GetFont function was called." & @LF & _
"Is the word 'Selection' still visually selected?" & @LF & _
"It should be, but it's not." & @LF & _
@LF & _
"It's actually selected, although not visually." & @LF & _
@LF & _
"Click OK to do _GUICtrlRichEdit_SetSel($hRichEdit, 0, 9).")
_GUICtrlRichEdit_SetSel($hRichEdit, 0, 9) ; <<<< Setting Seletion again does not make selecion visible.
; _GUICtrlRichEdit_SetSel($hRichEdit, 0, 9, False) ; <<<< Setting Seletion again does not make selecion visible.
MsgBox(4096, "3", _
"Is the word 'Selection' selected?" & @LF & _
"_GUICtrlRichEdit_SetSel($hRichEdit, 0, 9) was called" & @LF & _
"but the selection is still invisible." & @LF & _
@LF & _
"Even if _GUICtrlRichEdit_SetSel($hRichEdit, 0, 9, False)" & @LF & _
"is called, the selection is still invisible." & @LF & _
@LF & _
"Click OK and it's back to visually selected (I don't know why).")
EndSelect
WEnd
Exit
|
|||
| #2486 | Fixed | _GUICtrlRichEdit_GetFont does not return an empty string for mixed fonts | ||
| Description |
According to the doc, _GUICtrlRichEdit_GetFont should return an empty string when the selection contains mixed font. This makes sense, and is similar to what happens in VB for RichText. However, this is not what happens. Instead, the name of the font at the start of the selection is returned (depends on direction of selection). The example script below will demonstrate this. When started, the 3 lines of text in the RichEdit box will be selected. Each line is a different font face. WIth all 3 lines selected, click the button to show the font face (in the label below the RichEdit) that is returned by _GUICtrlRichEdit_GetFont. It also demonstrates a second issue, that being the inability to make another selection after _GUICtrlRichEdit_GetFont is used. Note: The 2nd issue is related to the “invisible selection” issue reported as "Selection goes invisible after _GUICtrlRichEdit_GetFont". #include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $lblMsg, $hRichEdit
Example()
Func Example()
Local $hGui, $iMsg, $btnNext, $sMsg
$hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, 4) & ")", 370, 350, -1, -1)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is the default font of this RichEdit box." & @CR, 10, 10, 330, 120, _
BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
$lblMsg = GUICtrlCreateLabel(@LF & "Leave all text selected and click the button.", 10, 135, 330, 175)
GUICtrlSetBkColor(-1, 0xffffd5)
$btnNext = GUICtrlCreateButton(" Click Me to list the font face of the selection ", 75, 320)
GUISetState()
_GUICtrlRichEdit_SetFont($hRichEdit, 15, "Comic Sans MS")
_GUICtrlRichEdit_AppendText($hRichEdit, "This is Comic Sans MS" & @CR)
_GUICtrlRichEdit_SetFont($hRichEdit, 15, "Times New Roman")
_GUICtrlRichEdit_AppendText($hRichEdit, "This is Times New Roman" & @CR)
_GUICtrlRichEdit_SetSel($hRichEdit, 0, 100, False)
While True
$iMsg = GUIGetMsg()
Select
Case $iMsg = $GUI_EVENT_CLOSE
_GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
Exit
Case $iMsg = $btnNext
Local $aRet = _GUICtrlRichEdit_GetFont($hRichEdit)
$sMsg = "The selection is font face " & $aRet[1] & "," & @LF & _
"but there are 3 fonts in the selection, and _GUICtrlRichEdit_GetFont" & @LF & _
"should have returned an empty string per the doc." & @LF & _
@LF & _
"Instead, it returned the font face at the start of the selecton." & @LF & _
@LF & _
"Next, select what you'd like and press button to see what happens." & @LF & _
"That leads to issue #2, which is, after _GUICtrlRichEdit_GetFont" & @LF & _
"the selection is invisible, and it's difficult to make another" & @LF & _
"selection. Before a selection can be made, click anywhere on the" & @LF & _
"text in the RichEdit box, then click the button. Then you'll be" & @LF & _
"able to make another selection, and the issues repeat. Try various" & @LF & _
"selections (right to left, one font through another, etc."
GUICtrlSetData($lblMsg, $sMsg)
EndSelect
WEnd
EndFunc ;==>Example
Exit
|
|||
| #2902 | Wont Fix | Incorrect GUI Scrolling when GUI is resizeable | ||
| Description |
While playing with the example in the help file for the UDF on “GUI Scroll Bars”, I’ve encountered 2 issues as follow:
Attached is a script that describes each step to reproduce the issues. Use the buttons “Show Issue 1” and "Show Issue 2” to display the steps to follow for each issue. Just perform those steps in the order given. The script is based upon the help file example for UDF function _GUIScrollBars_Init, with modifications to the GUI section, but no modifications to functions WM_SIZE, WM_HSCROLL or WM_VSCROLL. Same results in AutoIt v3.3.12.0 and 3.3.13.19 beta. LarsJ provided a fix that appears to work correctly. You can find his code and description on the issues at: http://www.autoitscript.com/forum/topic/164438-two-gui-scrollbar-issues/#entry1199648 While I select “Documentation” for the “Component”, I believe the UDF function _GUIScrollBars_Init needs to be modified, based upon the code that LarsJ provided, so that specifying the maximum vertical scroll value is straight forward, just like the horizontal value. LarsJ’s fix requires calling _GUIScrollBars_Init twice, with some calculations between them. |
|||
