Updated to version 0.08 beta
- fixed a bug in cGUI that prevented specifying a HWND for the control's parent
- added an example script for adding the control to an AutoHotkey Tab control to the download (link on the first page).
Here's one method for adding the RichEdit control to a Tab (version 0.08 or higher required):
Code:
Gui, Add, Tab, x10 y10 w380 h380 +0x2C2, Tab1|Tab2|Tab3
Gui, Add, Button, w100 h30,This is a test
Gui, Add, Text,, Please go to tab 2 to see the RichEdit control
Gui, Tab, Tab2
Gui, Add, Button, w100 h30,Ok
Gui, Add, Picture, w320 h270 HwndREparent1
Gui, Add, Text,, This is another test control
Gui, Tab, Tab3
Gui, Add, Button, w100 h30,Cancel
If A_OSVersion = WIN_95
cGUI("1:Add:" . REparent1, REdit1, 0, 0, 320, 270, "RICHEDIT")
Else
cGUI("1:Add:" . REparent1, REdit1, 0, 0, 320, 270, "RichEdit20A")
cRichEdit(REdit1, "ReplaceSel",
(
"{\rtf1\ansi\ansicpg13312\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fswiss\fprq2\fcharset0 Arial Black;}}{\colortbl ;\red0\green0\blue0;\red128\green128\blue128;\red255\green0\blue0;\red0\green0\blue255;\red0\green255\blue0;\red255\green0\blue255;}\viewkind4\uc1\pard\nowidctlpar\cf1\f0\fs20 .\cf2\f1 This is a test\cf3\f0\par\cf4\parTesting 1 2 3 4\par\par\cf5\fs56 Hello\cf4\fs20 \cf6\fs44 World\cf4\fs20 :) \par}
}"
))
Gui, Show, h400 w400, Tab Test
Return
GuiClose:
If (REdit1)
cRichEdit(REdit1, "Destroy")
Gui, %A_Gui%:Destroy
cGUI("FreeDlls", NULL)
ExitApp
Return
; comment the following #Include lines if you are using stdlib and have copied the required
; cGUI.ahk and cRichedit.ahk files to your stdlib directory
#Include cGUI.ahk
#Include cRichEdit.ahk
