Search the Community
Showing results for tags '_GUICtrlRichEdit'.
-
I'm making a little chat client, and I'm using Melbas GUIFrame (). I want it, so that when I re-size the window (with min/max sizes) it re-sizes the input and history boxes to match the new window size. That's working fine with re-sizing the whole GUI (using GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO")), but when I try to move the frame separator bar, the history box (since it's made with _GUICtrlRichEdit instead of GUICtrlEdit) doesn't update until after you're finished moving the separator. Using the other GUIRegisterMsg, the history edit re-sizes instantly as you move the separator bar, but the other controls in the window don't change at all. Using both at once causes only the second one to work. Is there a way to have both things happen (re-size edits on window and separator bar re-size)? #include <GUIRichEdit.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> #include <GUIEdit.Au3> #include "GUIFrame.au3" #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $GUIMINWID = 300, $GUIMINHT = 100 ;Min window sizes Local $GUIMAXWID = @DesktopWidth, $GUIMAXHT = @DesktopHeight ;Max window sizes $hGUI = GUICreate('MEOW', 500, 300, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState(@SW_SHOW) $iFrames = _GUIFrame_Create($hGUI, 0, 200) ;Creation of the two GUI frames _GUIFrame_ResizeSet(0, 1) ;Required for proper resizing _GUIFrame_ResizeReg() ;Required for proper resizing _GUIFrame_SetMin($iFrames, 150, 200, True) ;Set frame min size _GUIFrame_Switch($iFrames, 2) ;Switch to second frame to create controls $History = _GUICtrlRichEdit_Create(_GUIFrame_Switch($iFrames, 2), 'adsfadsfasdf', 2, 2, 263, 255) $Input = GUICtrlCreateEdit('', 2, 272, 293, 20, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_BORDER), $WS_EX_STATICEDGE) GUICtrlSetFont(-1, 10, 400, 0, "Courier New") GUICtrlSetResizing(-1, 582) ;Resizing parameters GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") ;~ GUIRegisterMsg($WM_SIZE, "WM_SIZE") $SepPos = _GUIFrame_GetSepPos($iFrames) ;Get the seperator bars current position While 1 Sleep(10) If $SepPos <> _GUIFrame_GetSepPos($iFrames) Then History_Resize() Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($History) Exit EndSwitch WEnd Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, $GUIMAXWID); max X DllStructSetData($tagMaxinfo, 10, $GUIMAXHT) ; max Y History_Resize() Return 0 EndFunc ;==>WM_GETMINMAXINFO Func WM_SIZE($hwnd, $iMsg, $wParam, $lParam) History_Resize() EndFunc ;==>WM_SIZE Func History_Resize() $SepPos = _GUIFrame_GetSepPos($iFrames) $hGpos = WinGetPos($hGUI) $iPos = ControlGetPos($hGUI, '', 'Edit1') _WinAPI_MoveWindow($History, 2, 2, ($hGpos[2] - $SepPos) - 50, $hGpos[3] - $iPos[3] - 55, False) EndFunc ;==>History_Resize
- 7 replies
-
- GUIRegisterMsg
- GUIFrame
-
(and 1 more)
Tagged with: