Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Karl Wochele Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Themed RTF Control Date: Tue, 12 Jun 2012 16:29:22 +0200 Lines: 76 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net yLlNSb7NTz+6WgAd9j9Xjg6q/ggafKyrjlw9wu6MN17wW3a4CLHLtKKx9500gWH3Dh Cancel-Lock: sha1:hziTAOWO8KM5sDStpkcEO8wHTJk= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: Xref: csiph.com comp.lang.clipper.visual-objects:3598 Hi Arne, you can try CLASS MyRichEdit INHERIT RichEdit METHOD Dispatch(oEvent) CLASS MyRichEdit LOCAL liRt AS LONGINT LOCAL hDC AS PTR LOCAL rc IS _WINRECT LOCAL hTheme AS PTR LOCAL rcm AS _WinRect DO CASE CASE oEvent:message == WM_NCCALCSIZE IF IsThemed() hTheme := OpenThemeData(SELF:handle(),"EDIT") IF hTheme <> NULL_PTR hDC := GetDC(SELF:Owner:handle()) rcm := PTR(_CAST,oEvent:lParam) SetRect(@rc,rcm.Left,rcm.TOp,rcm.right,rcm.bottom) rcm.Left := rc.Left+1 rcm.TOp := rc.TOp+1 rcm.right := rc.right-GetSystemMetrics(SM_CXVSCROLL)-1 rcm.bottom := rc.bottom-1 IF _AND(SELF:dwStyle,WS_HSCROLL) = WS_HSCROLL rcm.bottom := rc.bottom-GetSystemMetrics(SM_CYHSCROLL) ENDIF ReleaseDC(SELF:Owner:handle(), hDC) CloseThemeData(hTheme) liRt := 1 SELF:EventReturnValue := 0 ENDIF ENDIF IF liRt = 0 liRt := SUPER:Dispatch(oEvent) ENDIF CASE oEvent:message = WM_NCPAINT IF IsThemed() hTheme := OpenThemeData(SELF:handle(),"EDIT") IF hTheme <> NULL_PTR hDC := GetWindowDC(SELF:handle()) GetWindowRect(SELF:handle(),@rc) rc.right -= rc.Left rc.bottom -= rc.TOp rc.Left := 0 rc.TOp := 0 ExcludeClipRect(hDC, rc.Left+1, rc.TOp+1, rc.right-1, rc.bottom-1) DrawThemeBackground(hTheme,hDC,EP_EDITTEXT,ETS_NORMAL,@rc,0) ReleaseDC(SELF:handle(),hDC) CloseThemeData(hTheme) liRt := 1 SELF:EventReturnValue := 0 ENDIF ENDIF IF liRt = 0 liRt := SUPER:Dispatch(oEvent) ENDIF OTHERWISE liRt := SUPER:Dispatch(oEvent) ENDCASE RETURN liRt HTH Karl Am 12.06.2012 16:21, schrieb Arne Ortlinghaus: > Until now the rtf controls in my apps are displayed in the old way > (sunken threedimensional border). Changing ws_border, ... does not > influence the control. Has someone made changes that the border is > rendered according to the XP themes? > > Arne Ortlinghaus > ACS Data Systems