Jump to content

Having problems with _GUICtrlRichEdit


Trax
 Share

Recommended Posts

It seems to put things in controls once and once only. Almost like I need to refresh the GUI or something:

<
HotKeySet("{Esc}", "Quit")

#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <GuiListBox.au3>
#include <GuiRichEdit.au3>
#include <ColorConstantsEx.au3>

#Region ### START Koda GUI section ### Form=c:\users\jimbecher\desktop\idem v2.10\koda_1.7.2.0\forms\efdeck.kxf
$EFDeck = GUICreate("EF Deck Display", 755, 248, 1047, 144)

$EFDAvgTemp1  = _GUICtrlRichEdit_Create($EFDeck,"", 184, 24, 57, 19)
$EFDAvgTemp3  = _GUICtrlRichEdit_Create($EFDeck,"", 184, 200, 57, 19)
$EFDAvgTemp2  = _GUICtrlRichEdit_Create($EFDeck,"", 184, 112, 57, 19)
$EFDLimit1    = _GUICtrlRichEdit_Create($EFDeck,"", 328, 24, 57, 19)
$EFDLimit2    = _GUICtrlRichEdit_Create($EFDeck,"", 328, 112, 57, 19)
$EFDLimit3    = _GUICtrlRichEdit_Create($EFDeck,"", 328, 200, 57, 19)
$EFDExceeded1 = _GUICtrlRichEdit_Create($EFDeck,"", 528, 24, 17, 19)
$EFDExceeded2 = _GUICtrlRichEdit_Create($EFDeck,"", 529, 112, 15, 19)
$EFDExceeded3 = _GUICtrlRichEdit_Create($EFDeck,"", 528, 200, 17, 19)
$EFDReadings1 = _GUICtrlRichEdit_Create($EFDeck,"", 672, 24, 57, 19)
$EFDReadings2 = _GUICtrlRichEdit_Create($EFDeck,"", 672, 112, 57, 19)
$EFDReadings3 = _GUICtrlRichEdit_Create($EFDeck,"", 672, 200, 57, 19)

$Label1 = GUICtrlCreateLabel(" 3 Hr Avg Temp:", 104, 24, 82, 17)
$Label2 = GUICtrlCreateLabel("Limit Exceeded:", 448, 24, 79, 17)
$Label3 = GUICtrlCreateLabel("Readings:", 616, 24, 52, 17)
$Label5 = GUICtrlCreateLabel("Baghouse 1", 32, 24, 61, 17)
$Label9 = GUICtrlCreateLabel("3 Hr Avg Temp:", 104, 112, 79, 17)
$Label10 = GUICtrlCreateLabel("Limit Exceeded:", 448, 112, 79, 17)
$Label11 = GUICtrlCreateLabel("Readings:", 616, 112, 52, 17)
$Label13 = GUICtrlCreateLabel("Baghouse 2", 32, 112, 61, 17)
$Label17 = GUICtrlCreateLabel("3 Hr Avg Temp:", 104, 200, 79, 17)
$Label18 = GUICtrlCreateLabel("Limit Exceeded:", 440, 200, 79, 17)
$Label19 = GUICtrlCreateLabel("Readings:", 616, 200, 52, 17)
$Label21 = GUICtrlCreateLabel("Baghouse 3", 32, 200, 61, 17)
$Label37 = GUICtrlCreateLabel("Limit: ", 296, 24, 31, 17)
$Label38 = GUICtrlCreateLabel("Limit:", 296, 112, 28, 17)
$Label39 = GUICtrlCreateLabel("Limit", 296, 200, 25, 17)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $DefaultBKColor = $RGB_WHITE, $DefaultCharColor = $RGB_BLACK, $Count = 0

While 1
    $Count = $Count + 1
    ColorWrite($EFDReadings1, $Count, 0, "", $DefaultCharColor, $DefaultBKColor)
   Sleep(1000)
WEnd

Func Quit()
    Exit
EndFunc

Func ColorWrite($hWnd, $sText, $iIncrement = 0, $sAttrib = "", $iColor = -1, $BKColor = -1)
    ; Count the @CRLFs
    StringReplace(_GUICtrlRichEdit_GetText($hWnd, True), @CRLF, "")
    $sText = $sText & "                              "
    Local $iLines = @extended
    ; Adjust the text char count to account for the @CRLFs
    Local $iEndPoint = _GUICtrlRichEdit_GetTextLength($hWnd, True, True) - $iLines
    ; Add new text
    _GUICtrlRichEdit_AppendText($hWnd, $sText & @CRLF)
    ; Select text between old and new end points
    _GuiCtrlRichEdit_SetSel($hWnd, $iEndPoint, -1)
    ; Convert colour from RGB to BGR
    $iColor = Hex($iColor, 6)
    $iColor = '0x' & StringMid($iColor, 5, 2) & StringMid($iColor, 3, 2) & StringMid($iColor, 1, 2)
    ; Set colour
    If $iColor <> -1 Then _GuiCtrlRichEdit_SetCharColor($hWnd, $iColor)
    If $BKColor <> -1 Then _GUICtrlRichEdit_SetCharBkColor($hWnd, $BKColor)
    ; Set size
    If $iIncrement <> 0 Then _GUICtrlRichEdit_ChangeFontSize($hWnd, $iIncrement)
    ; Set weight
    If $sAttrib <> "" Then _GUICtrlRichEdit_SetCharAttributes($hWnd, $sAttrib)
    ; Clear selection
    If $BKColor <> -1 Then _GUICtrlRichEdit_SetCharBkColor($hWnd, $BKColor)
    _GUICtrlRichEdit_Deselect($hWnd)
EndFunc
>

 

Link to comment
Share on other sites

What you want to achieve is absolutely unclear and honestly I don't understand ...

But you can check the way the control reacts by temporarily changing its height (as a test)

$EFDReadings1 = _GUICtrlRichEdit_Create($EFDeck,"", 672, 24, 57, 119)

 

Link to comment
Share on other sites

  • 4 weeks later...

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
 Share

  • Recently Browsing   0 members

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